diff --git a/common/formatter/formatter.cpp b/common/formatter/formatter.cpp index 6018251992..5aa0205b7e 100644 --- a/common/formatter/formatter.cpp +++ b/common/formatter/formatter.cpp @@ -147,7 +147,7 @@ void apply_formatting_config( // Find the maximum number of columns int max_columns = 0; for (const auto& field : curr_node.refs) { - if (field.refs.size() > max_columns) { + if ((int)field.refs.size() > max_columns) { max_columns = field.refs.size(); } } @@ -156,7 +156,7 @@ void apply_formatting_config( for (int col = 0; col < max_columns; col++) { column_max_widths.push_back(0); for (const auto& field : curr_node.refs) { - if (field.refs.size() > col) { + if ((int)field.refs.size() > col) { const auto width = get_total_form_inlined_width(field.refs.at(col)); if (width > column_max_widths.at(col)) { column_max_widths[col] = width; @@ -271,7 +271,7 @@ std::vector apply_formatting(const FormatterTreeNode& curr_node, val = comments::format_block_comment(ref.token_str()); } form_lines.push_back(val); - if (!curr_node.metadata.is_top_level && i == curr_node.refs.size() - 1 && + if (!curr_node.metadata.is_top_level && i == (int)curr_node.refs.size() - 1 && (ref.metadata.is_comment)) { // if there's an inline comment at the end of a form, we have to force the paren to the next // line and do a new-line paren this is ugly, but we have no choice! @@ -354,9 +354,9 @@ std::vector apply_formatting(const FormatterTreeNode& curr_node, // Add any column padding if (!curr_node.formatting_config.list_element_column_widths.empty()) { - for (int i = 0; i < form_lines.size(); i++) { + for (int i = 0; i < (int)form_lines.size(); i++) { const auto& token = form_lines.at(i); - if (i < form_lines.size() - 1) { + if (i < (int)form_lines.size() - 1) { form_lines[i] = str_util::pad_right( token, curr_node.formatting_config.list_element_column_widths.at(i), ' '); } diff --git a/common/util/Trie.h b/common/util/Trie.h index 5790813de6..76a6a86a6a 100644 --- a/common/util/Trie.h +++ b/common/util/Trie.h @@ -187,4 +187,4 @@ std::vector Trie::get_all_nodes() const { std::vector result; m_root.get_all_children(result); return result; -} +} \ No newline at end of file diff --git a/common/util/string_util.cpp b/common/util/string_util.cpp index 5f8db4f80e..b4fd766121 100644 --- a/common/util/string_util.cpp +++ b/common/util/string_util.cpp @@ -247,7 +247,7 @@ std::string titlize(const std::string& str) { } std::string pad_right(const std::string& input, const int width, const char padding_char) { - if (input.length() >= width) { + if ((int)input.length() >= width) { return input; // No need to pad if input length is already greater or equal to width } else { int padding_width = width - input.length(); diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 64ff160c51..f8f1d37186 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -5505,6 +5505,14 @@ FormElement* ConditionElement::make_generic(const Env& env, casted); } + case IR2_Condition::Kind::LEQ_ZERO_UNSIGNED: { + auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env); + auto zero = pool.form(SimpleAtom::make_int_constant(0)); + casted.push_back(zero); + return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::LEQ), + casted); + } + case IR2_Condition::Kind::GEQ_ZERO_SIGNED: { return make_geq_zero_signed_check_generic(env, pool, source_forms, types); } diff --git a/decompiler/analysis/find_skelgroups.cpp b/decompiler/analysis/find_skelgroups.cpp index 869374a8b4..9316c53b5d 100644 --- a/decompiler/analysis/find_skelgroups.cpp +++ b/decompiler/analysis/find_skelgroups.cpp @@ -570,7 +570,7 @@ void inspect_cloth_data_jak3(LetElement* let, DefskelgroupElement::StaticInfo& i auto array_set = dynamic_cast(when_body->at(0)); if (array_set) { // get elements - auto elts = when_body->elts().size() - 2; + auto elts = (int)when_body->elts().size() - 2; for (int i = 0; i < elts; i++) { auto parms_form = dynamic_cast(when_body->at(i + 1)); if (parms_form) { diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 32829112be..0b2d100b10 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -2266,10 +2266,10 @@ (define-extern matrix-fur-compose (function matrix vector vector vector matrix)) (define-extern matrix-fu-compose (function matrix vector vector matrix)) -(define-extern matrix-fr-compose (function matrix vector vector vector matrix)) +(define-extern matrix-fr-compose (function matrix vector vector matrix)) (define-extern matrix-ur-compose (function matrix vector vector vector matrix)) (define-extern matrix-f-u-compose (function matrix vector vector matrix)) -(define-extern matrix-f-r-compose (function matrix vector vector vector matrix)) +(define-extern matrix-f-r-compose (function matrix vector vector matrix)) (define-extern matrix-u-f-compose (function matrix vector vector matrix)) (define-extern matrix-u-r-compose (function matrix vector vector vector matrix)) (define-extern matrix-r-f-compose (function matrix vector vector vector matrix)) @@ -3534,7 +3534,7 @@ :type int32 (bucket0 0) (bucket1 1) - (bucket2 2) + (bucket2 2) ;; pc vis stuff (bucket3 3) ;; blit? (tex-lcom-sky-pre 4) (bucket5 5) ;; sky @@ -3810,7 +3810,7 @@ (tex-l2-alpha 252) (tfrag-l2-alpha 253) (tie-l2-alpha 254) - (etie-l02alpha 255) + (etie-l2-alpha 255) (merc-l2-alpha 256) (emerc-l2-alpha 257) (gmerc-l2-alpha 258) @@ -4185,9 +4185,9 @@ (tex-hud-pris2 580) (hud-draw-pris2 581) (bucket582 582) - (bucket583 583) + (debug 583) (debug-no-zbuf2 584) - (bucket585 585) + (debug-menu 585) (bucket586 586) ) @@ -6645,11 +6645,14 @@ (miptbp1 gs-miptbp :offset 32) ;; (clamp gs-clamp :offset 48) ;; gs-clamp (clamp-reg gs-reg64 :offset 56) ;; - (alpha gs-alpha :offset 64) ;; + (alpha gs-miptbp :offset 64) ;; (link-test link-test-flags :offset 8) ;; guessed by decompiler (texture-id texture-id :offset 24) ;; guessed by decompiler (next shader-ptr :offset 40) ;; guessed by decompiler ;(alpha-as-miptb2 gs-miptbp :offset 64) ;; added!! + (alpha-as-miptb2 gs-miptbp :offset 64) + (reg-4-u32 gs-reg32 :offset 72) + ) :method-count-assert 9 :size-assert #x50 @@ -6880,7 +6883,7 @@ (alpha-near float :offset-assert 124) (alpha-far float :offset-assert 128) (alpha-delta float :offset-assert 132) - (color uint32 :offset-assert 136) + (color rgba :offset-assert 136) ) :method-count-assert 9 :size-assert #x8c @@ -10346,8 +10349,8 @@ (armor2 54) (armor3 55) (feature56 56) - (feature57 57) - (feature58 58) + (lighteco 57) + (darkeco 58) (feature59 59) (feature60 60) (feature61 61) @@ -10470,6 +10473,14 @@ ) ;; ---settings-h:game-vehicles +;; +++settings-h:game-vehicle-u8 +(defenum game-vehicle-u8 + :type uint8 + :bitfield #t + :copy-entries game-vehicles + ) +;; ---settings-h:game-vehicle-u8 + (declare-type resetter-spec structure) (define-extern crate type) (deftype user-setting-data (structure) @@ -10821,7 +10832,7 @@ (remove-setting (_type_ process symbol) none) ;; 12 (kill-persister (_type_ engine-pers object) none) ;; 13 (setting-control-method-14 (_type_ object) connectable) ;; 14 - (setting-control-method-15 (_type_ object) connectable) ;; 15 + (get-setting (_type_ object) connectable) ;; 15 (remove-setting-by-arg0 (_type_ object) none) ;; 16 (set-setting-by-param (_type_ symbol object object object) connection) ;; 17 (apply-settings (_type_) user-setting-data) ;; 18 @@ -10914,6 +10925,28 @@ (debug 88) + (other-pool 91) + (8k-dead-pool 92) + (16k-dead-pool 93) + (nk-dead-pool 94) + (target-dead-pool 95) + (camera-dead-pool 96) + (debug-dead-pool 97) + + (process-active 98) + (heap-total 99) + (heap-process 100) + (heap-header 101) + (head-thread 102) + (heap-root 103) + (heap-draw-control 104) + (heap-joint-control 105) + (heap-cspace 106) + (heap-bone 107) + (heap-part 108) + (heap-collide-prim 109) + (heap-mis 110) + (eye-anim 112) ) @@ -11227,7 +11260,7 @@ (sky-work-method-9 () none) ;; 9 ;; (init-sun-data! (_type_ int float float float) none) (sky-work-method-10 () none) ;; 10 ;; (init-orbit-settings! (_type_ int float float float float float float) none) (sky-work-method-11 () none) ;; 11 ;; (update-colors-for-time (_type_ float) none) - (sky-work-method-12 () none) ;; 12 ;; (update-time-and-speed (_type_ float float) none) + (update-time-and-speed (_type_ float float) none) ;; 12 (sky-work-method-13 () none) ;; 13 (draw (_type_) none) ;; 14 ;; (update-matrix (_type_ matrix) none) (sky-work-method-15 () none) ;; 15 ;; (update-template-colors (_type_) none) @@ -12072,18 +12105,9 @@ ;; +++main-h:race-selection (defenum race-selection :type int64 - ; (kiera-class3 0) - ; (kiera-class2 1) - ; (kiera-class1 2) - ; (errol 3) - ; (bush-class3 4) - ; (bush-class2 5) - ; (bush-class1 6) - ; (bush-errol 7) - ; (bush-port 8) - ; (bush-class3-reverse 9) - ; (bush-class2-reverse 10) - ; (bush-class1-reverse 11) + (desertb-race-record 0) + (rs1 1) + (desrally-record 2) ) ;; ---main-h:race-selection @@ -12253,7 +12277,7 @@ (define-extern *debug-view-anims* symbol) (define-extern *debug-unkillable* symbol) (define-extern *debug-player-vehicle-unkillable* symbol) -(define-extern *debug-actor* object) +(define-extern *debug-actor* process) (define-extern *gun-marks* symbol) (define-extern *bug-report-output-mode* symbol) (define-extern *display-scene-control* scene-controls) @@ -12500,7 +12524,7 @@ (deftype drawable-tree-array (drawable-group) "Collection of drawable trees. This might have a tfrag tree, tie tree, etc." - () + ((trees drawable-tree :dynamic :offset 32 :score 100)) :flag-assert #x1100000020 ) @@ -14011,7 +14035,7 @@ (:methods (game-task-node-info-method-9 () none) ;; 9 ;; (close! (_type_ symbol) int) (open! (_type_ symbol) int) ;; 10 ;; (open! (_type_ symbol) int) - (game-task-node-info-method-11 () none) ;; 11 ;; (open? (_type_) symbol) + (game-task-node-info-method-11 (_type_ symbol) none) ;; 11 ;; (open? (_type_) symbol) (game-task-node-info-method-12 (_type_) symbol) ;; 12 ;; (copy-hooks! (_type_ game-task-node-info) game-task-node-info) (game-task-node-info-method-13 () none) ;; 13 ;; (eval-add (_type_) int) ) @@ -16743,7 +16767,7 @@ (dust-storm handle :offset-assert 768) (flut-count int32 :offset-assert 776) (death-resetter resetter-spec :inline :offset-assert 780) - (current-vehicle uint8 :offset-assert 796) + (current-vehicle game-vehicle-u8 :offset-assert 796) (vehicle-turbo-ready float :offset-assert 800) (percent-complete float :offset-assert 804) ) @@ -17818,6 +17842,7 @@ "Scratch info computed per-merc-effect by the foreground code, then later read by merc DMA generation. This is only for the currently-processing merc model's effects." ((color-fade rgba :offset-assert 0) ;; guessed by decompiler + (alpha uint8 :offset 3) (merc-path uint8 :offset-assert 4) (ignore-alpha uint8 :offset-assert 5) (disable-draw uint8 :offset-assert 6) @@ -17879,6 +17904,7 @@ :bitfield #t (pls0 0) (pls1 1) + (pls2 2) ) ;; ---engines:part-local-space-flags @@ -19349,6 +19375,7 @@ (spec pair :offset-assert 4) ;; guessed by decompiler (func (function script-context object) :offset-assert 8) ;; guessed by decompiler ) + :pack-me :method-count-assert 10 :size-assert #xc :flag-assert #xa0000000c @@ -19378,8 +19405,8 @@ (:methods (new (symbol type object process vector) _type_) ;; 0 (eval! (_type_ pair) object) ;; 9 - (script-context-method-10 () none) ;; 10 ;; (script-context-method-10 (_type_ object pair) object) - (script-context-method-11 () none) ;; 11 ;; (script-context-method-11 (_type_ pair pair symbol) symbol) + (script-context-method-10 (_type_ object pair) object) ;; 10 + (script-context-method-11 (_type_ pair pair symbol) symbol) ;; 11 ) ) @@ -20217,6 +20244,7 @@ :flag-assert #x900000008 ) +(declare-type collide-mesh-cache-tri structure) (deftype collide-mesh (basic) "A collision mesh for foreground objects, bound to the joint specified by `joint-id`." @@ -20230,13 +20258,13 @@ :size-assert #x28 :flag-assert #x1000000028 (:methods - (collide-mesh-method-9 () none) ;; 9 ;; (debug-draw-tris (_type_ process-drawable int) none) - (collide-mesh-method-10 () none) ;; 10 ;; (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) - (collide-mesh-method-11 () none) ;; 11 ;; (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) - (collide-mesh-method-12 () none) ;; 12 ;; (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) - (collide-mesh-method-13 () none) ;; 13 ;; (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) - (collide-mesh-method-14 () none) ;; 14 ;; (collide-mesh-math-1 (_type_ object object) none) - (collide-mesh-method-15 () none) ;; 15 ;; (collide-mesh-math-2 (_type_ object object object) none) + (debug-draw-tris (_type_ process-drawable int) none) ;; 9 + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) ;; 10 + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) ;; 11 + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) ;; 12 + (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) ;; 13 + (collide-mesh-math-1 (_type_ object object) none) ;; 14 + (collide-mesh-math-2 (_type_ object object object) none) ;; 15 ) ) @@ -20245,7 +20273,7 @@ ((vertex vector 3 :inline :offset-assert 0) ;; guessed by decompiler (normal vector :inline :offset-assert 48) (bbox4w bounding-box4w :inline :offset-assert 64) - (pat pat-surface :offset 60) ;; guessed by decompiler + (pat pat-surface :offset 60 :score 1) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x60 @@ -20255,13 +20283,14 @@ (deftype collide-mesh-cache-entry (structure) "A foreground mesh collide cache entry." ((mat matrix :inline :offset-assert 0) - (tris collide-mesh-cache-tri :dynamic :offset-assert 64) ;; guessed by decompiler + (tris collide-mesh-cache-tri :dynamic :inline :offset-assert 64) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) +(declare-type collide-shape-prim-mesh basic) (deftype collide-mesh-cache (basic) "A collide cache for foreground meshes." ((used-size uint32 :offset-assert 4) @@ -20273,13 +20302,13 @@ :size-assert #xbb90 :flag-assert #xd0000bb90 (:methods - (collide-mesh-cache-method-9 () none) ;; 9 ;; (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) + (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) ;; 9 (is-id? "Does this cache have the given ID?" (_type_ int) symbol) ;; 10 (next-id! "Reset all used entries in the cache and increment the ID. If the id is zero, set it to 1." (_type_) uint) ;; 11 - (collide-mesh-cache-method-12 () none) ;; 12 ;; (allocate! (_type_ int) collide-mesh-cache-entry) + (allocate! (_type_ int) collide-mesh-cache-entry) ;; 12 ) ) @@ -20312,7 +20341,7 @@ :size-assert #x290 :flag-assert #xb00000290 (:methods - (collide-rider-pool-method-9 () none) ;; 9 ;; (add-rider (_type_ handle) collide-rider) + (add-rider (_type_ handle) collide-rider) ;; 9 (prepare (_type_) none) ;; 10 ) ) @@ -20413,7 +20442,9 @@ ) (declare-type collide-query structure) +(declare-type collide-cache basic) (declare-type collide-cache-prim structure) +(declare-type collide-shape-prim-group basic) (deftype collide-shape-prim (basic) "Base class for collide primitives." ((cshape collide-shape :offset-assert 4) ;; guessed by decompiler @@ -20435,17 +20466,17 @@ :flag-assert #x1400000050 (:methods (new (symbol type collide-shape uint int) _type_) ;; 0 - (collide-shape-prim-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) - (collide-shape-prim-method-10 () none) ;; 10 ;; (add-fg-prim-using-box (_type_ collide-cache) none) - (collide-shape-prim-method-11 () none) ;; 11 ;; (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) - (collide-shape-prim-method-12 () none) ;; 12 ;; (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) - (collide-shape-prim-method-13 () none) ;; 13 ;; (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) + (debug-draw (_type_) none) ;; 9 + (add-fg-prim-using-box (_type_ collide-cache) none) ;; 10 + (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) ;; 11 + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) ;; 12 + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) ;; 13 (collide-shape-prim-method-14 () none) ;; 14 ;; (collide-shape-prim-method-14 () none) - (collide-shape-prim-method-15 () none) ;; 15 ;; (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) + (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) ;; 15 (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none) ;; 16 - (collide-shape-prim-method-17 () none) ;; 17 ;; (on-platform-test (_type_ collide-shape-prim collide-query float) none) - (collide-shape-prim-method-18 () none) ;; 18 ;; (should-push-away-test (_type_ collide-shape-prim collide-query) none) - (collide-shape-prim-method-19 () none) ;; 19 ;; (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) + (on-platform-test (_type_ collide-shape-prim collide-query float) none) ;; 17 + (should-push-away-test (_type_ collide-shape-prim collide-query) none) ;; 18 + (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) ;; 19 ) ) @@ -20531,31 +20562,31 @@ (new (symbol type process-drawable collide-list-enum) _type_) ;; 0 (move-by-vector! (_type_ vector) none) ;; 28 (move-to-point! (_type_ vector) none) ;; 29 - (collide-shape-method-30 () none) ;; 30 ;; (debug-draw (_type_) none) + (debug-draw (_type_) none) ;; 30 (fill-cache-for-shape (_type_ float collide-query) none) ;; 31 (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) ;; 32 - (collide-shape-method-33 () none) ;; 33 ;; (find-prim-by-id (_type_ uint) collide-shape-prim) - (collide-shape-method-34 () none) ;; 34 ;; (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) + (find-prim-by-id (_type_ uint) collide-shape-prim) ;; 33 + (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) ;; 34 (detect-riders! (_type_) symbol) ;; 35 - (collide-shape-method-36 () none) ;; 36 ;; (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) + (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) ;; 36 (integrate-and-collide! (_type_ vector) none) ;; 37 (find-collision-meshes (_type_) none) ;; 38 - (collide-shape-method-39 () none) ;; 39 ;; (on-platform (_type_ collide-shape collide-query) symbol) + (on-platform (_type_ collide-shape collide-query) symbol) ;; 39 (find-overlapping-shapes (_type_ overlaps-others-params) symbol) ;; 40 - (collide-shape-method-41 () none) ;; 41 ;; (shove-to-closest-point-on-path (_type_ attack-info float) vector) - (collide-shape-method-42 () none) ;; 42 ;; (should-push-away (_type_ collide-shape collide-query) symbol) - (collide-shape-method-43 () none) ;; 43 ;; (pull-rider! (_type_ pull-rider-info) none) + (shove-to-closest-point-on-path (_type_ attack-info float) vector) ;; 41 + (should-push-away (_type_ collide-shape collide-query) symbol) ;; 42 + (pull-rider! (_type_ pull-rider-info) none) ;; 43 (pull-riders! (_type_) symbol) ;; 44 (do-push-aways (_type_) collide-spec) ;; 45 (update-transforms (_type_) none) ;; 46 (set-collide-with! (_type_ collide-spec) none) ;; 47 (set-collide-as! (_type_ collide-spec) none) ;; 48 - (collide-shape-method-49 () none) ;; 49 ;; (modify-collide-as! (_type_ int collide-spec collide-spec) none) + (modify-collide-as! (_type_ int collide-spec collide-spec) none) ;; 49 (send-shoves (_type_ process touching-shapes-entry float float float) symbol) ;; 50 (above-ground? (_type_ collide-query vector collide-spec float float float) symbol) ;; 51 (water-info-init! (_type_ water-info collide-action) water-info) ;; 52 (iterate-prims (_type_ (function collide-shape-prim none)) none) ;; 53 - (collide-shape-method-54 () none) ;; 54 ;; (pusher-init (_type_) none) + (pusher-init (_type_) none) ;; 54 ) ) @@ -20661,18 +20692,18 @@ ;; field penetrate is likely a value type. field penetrate is likely a value type. (:methods (new (symbol type process-drawable collide-list-enum) _type_) ;; 0 - (find-ground (_type_ collide-query collide-spec float float float) symbol) ;; 55 + (find-ground (_type_ collide-query collide-spec float float float process) symbol) ;; 55 (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) ;; 56 - (collide-shape-moving-method-57 () none) ;; 57 ;; (integrate-no-collide! (_type_ vector) none) - (collide-shape-moving-method-58 () none) ;; 58 ;; (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) - (collide-shape-moving-method-59 () none) ;; 59 ;; (move-above-ground (_type_ vector move-above-ground-params) none) - (collide-shape-moving-method-60 () none) ;; 60 ;; (move-to-ground (_type_ float float symbol collide-spec) none) + (integrate-no-collide! (_type_ vector) none) ;; 57 + (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) ;; 58 + (move-above-ground (_type_ vector move-above-ground-params) none) ;; 59 + (move-to-ground (_type_ float float symbol collide-spec) none) ;; 60 (move-to-ground-point (_type_ vector vector vector) none) ;; 61 (compute-acc-due-to-gravity (_type_ vector float) vector) ;; 62 (rbody-collision (_type_ rigid-body-control float) none) ;; 63 - (collide-shape-moving-method-64 () none) ;; 64 ;; (try-snap-to-surface (_type_ vector float float float) symbol) + (try-snap-to-surface (_type_ vector float float float) symbol) ;; 64 (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) ;; 65 - (collide-shape-moving-method-66 () none) ;; 66 ;; (step-collison! (_type_ vector vector float int) float) + (step-collision! (_type_ vector vector float int) float) ;; 66 (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ;; 67 ) ) @@ -21423,8 +21454,8 @@ :size-assert #xe8 :flag-assert #xd000000e8 (:methods - (touching-prims-entry-method-9 () none) ;; 9 ;; (get-middle-of-bsphere-overlap (_type_ vector) vector) - (touching-prims-entry-method-10 () none) ;; 10 + (touching-prims-entry-method-9 (_type_ vector) vector) ;; 9 + (get-middle-of-bsphere-overlap (_type_ vector) vector) ;; 10 (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim) ;; 11 (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ;; 12 ) @@ -21440,10 +21471,10 @@ :flag-assert #xd00003c10 (:methods (new (symbol type) _type_) ;; 0 - (touching-prims-entry-pool-method-9 () none) ;; 9 ;; (alloc-node (_type_) touching-prims-entry) - (touching-prims-entry-pool-method-10 () none) ;; 10 ;; (get-free-node-count (_type_) int) + (alloc-node (_type_) touching-prims-entry) ;; 9 + (get-free-node-count (_type_) int) ;; 10 (init-list! (_type_) none) ;; 11 - (touching-prims-entry-pool-method-12 () none) ;; 12 ;; (free-node (_type_ touching-prims-entry) touching-prims-entry) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ;; 12 ) ) @@ -21467,7 +21498,7 @@ (get-touched-shape (_type_ collide-shape) collide-shape) ;; 11 (prims-touching? (_type_ collide-shape uint) touching-prims-entry) ;; 12 (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) ;; 13 - (touching-shapes-entry-method-14 () none) ;; 14 ;; (free-touching-prims-list (_type_) none) + (free-touching-prims-list (_type_) none) ;; 14 ) ) @@ -21481,12 +21512,12 @@ :size-assert #x408 :flag-assert #xe00000408 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type) _type_) - (touching-list-method-9 () none) ;; 9 ;; (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) + (new (symbol type) _type_) ;; 0 + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) ;; 9 (free-nodes (_type_) none) ;; 10 - (touching-list-method-11 () none) ;; 11 ;; (update-from-step-size (_type_ float) none) + (update-from-step-size (_type_ float) none) ;; 11 (send-events-for-touching-shapes (_type_) none) ;; 12 - (touching-list-method-13 () none) ;; 13 ;; (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ;; 13 ) ) @@ -21535,7 +21566,7 @@ :flag-assert #xb000001e4 (:methods (edge-grab-info-method-9 (_type_) symbol) ;; 9 - (edge-grab-info-method-10 () none) ;; 10 ;; (debug-draw (_type_) none) + (edge-grab-info-method-10 (_type_) none) ;; 10 ;; (debug-draw (_type_) none) ) ) @@ -21550,6 +21581,7 @@ :flag-assert #x900000020 ) +(declare-type collide-edge-work structure) (deftype collide-edge-edge (structure) ((ignore symbol :offset-assert 0) (etri collide-edge-tri :offset-assert 4) @@ -21561,7 +21593,7 @@ :size-assert #x30 :flag-assert #xa00000030 (:methods - (collide-edge-edge-method-9 () none) ;; 9 ;; (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) + (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) ;; 9 ) ) @@ -21589,8 +21621,8 @@ :size-assert #x810 :flag-assert #xb00000810 (:methods - (collide-edge-hold-list-method-9 () none) ;; 9 ;; (debug-draw (_type_) object) - (collide-edge-hold-list-method-10 () none) ;; 10 ;; (add-to-list! (_type_ collide-edge-hold-item) none) + (debug-draw (_type_) object) ;; 9 + (add-to-list! (_type_ collide-edge-hold-item) none) ;; 10 ) ) @@ -21651,18 +21683,18 @@ :size-assert #x26c0 :flag-assert #x15000026c0 (:methods - (collide-edge-work-method-9 () none) ;; 9 ;; (search-for-edges (_type_ collide-edge-hold-list) none) - (collide-edge-work-method-10 () none) ;; 10 ;; (debug-draw-edges (_type_) object) - (collide-edge-work-method-11 () none) ;; 11 ;; (debug-draw-tris (_type_) none) - (collide-edge-work-method-12 () none) ;; 12 ;; (debug-draw-sphere (_type_) none) - (collide-edge-work-method-13 () none) ;; 13 ;; (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) - (collide-edge-work-method-14 () none) ;; 14 ;; (compute-center-point! (_type_ collide-edge-edge vector) float) - (collide-edge-work-method-15 () none) ;; 15 ;; (get-best-hand-point (_type_ vector vector int) float) - (collide-edge-work-method-16 () none) ;; 16 ;; (find-grabbable-edges (_type_) none) - (collide-edge-work-method-17 () none) ;; 17 ;; (find-grabbable-tris (_type_) none) - (collide-edge-work-method-18 () none) ;; 18 ;; (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) - (collide-edge-work-method-19 () none) ;; 19 ;; (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) - (collide-edge-work-method-20 () none) ;; 20 ;; (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) + (search-for-edges (_type_ collide-edge-hold-list) none) ;; 9 + (debug-draw-edges (_type_) object) ;; 10 + (debug-draw-tris (_type_) none) ;; 11 + (debug-draw-sphere (_type_) none) ;; 12 + (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) ;; 13 + (compute-center-point! (_type_ collide-edge-edge vector) float) ;; 14 + (get-best-hand-point (_type_ vector vector int) float) ;; 15 + (find-grabbable-edges (_type_) none) ;; 16 + (find-grabbable-tris (_type_) none) ;; 17 + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) ;; 18 + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) ;; 19 + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ;; 20 ) ) @@ -22000,6 +22032,7 @@ ((id uint32 :offset-assert 0) (collidable basic :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 @@ -22076,7 +22109,7 @@ (axis-scale vector :inline :offset 48) (avg-extents vector :inline :offset 64) (bucket-array uint32 :offset 44) - (item-array (inline-array collide-hash-item) :offset 60) ;; guessed by decompiler + (item-array (inline-array collide-hash-item) :offset 60 :score 1) ;; guessed by decompiler (dimension-array uint32 3 :offset 76) ;; guessed by decompiler (num-items uint32 :offset 92) ) @@ -22858,7 +22891,7 @@ (target-roll-flip float float) target-turn-around (target-jump float float surface) - (target-jump-forward float float) + (target-jump-forward float float symbol) (target-high-jump float float object) (target-double-jump float float) (target-falling symbol) @@ -22884,7 +22917,7 @@ target-darkjak-running-attack target-darkjak-smack-charge target-darkjak-smack - target-darkjak-bomb1 ;; associated process guessed by decompiler, old: (state float float target) + (target-darkjak-bomb1 float float) target-darkjak-bomb0 (target-invisible-get-on handle time-frame) ;; lightjak @@ -23009,7 +23042,7 @@ ;; pole (target-pole-cycle handle) (target-pole-flip-up float float float) - (target-pole-flip-up-jump float float) + (target-pole-flip-up-jump float float symbol) (target-pole-flip-forward float float float) (target-pole-flip-forward-jump float float) (target-launch float symbol vector int) @@ -23025,6 +23058,12 @@ ;; ladder (target-ladder-start handle) target-ladder + target-ladder-stance + target-ladder-walk-up + target-ladder-walk-down + target-ladder-slide-down + target-ladder-switch + target-ladder-jump-off ;; tube (target-tube-start handle) target-tube @@ -23258,7 +23297,7 @@ (nav-meshes (array entity-nav-mesh) :offset-assert 180) (actor-groups (array actor-group) :offset-assert 184) (region-trees (array drawable-tree-region-prim) :offset 188) - ; (region-array region-array :offset-assert 192) + (region-array region-array :offset-assert 192) (collide-hash collide-hash :offset 196) ; ;; 200 is some array (wind-array uint32 :offset 200) @@ -23397,6 +23436,7 @@ (prim-index uint16 :offset 56) (user16 uint16 :offset 58) (user32 uint32 :offset 60) + (clear-flags uint128 :offset 48) ;; added ) :method-count-assert 9 :size-assert #x40 @@ -23412,6 +23452,7 @@ (fake-prim 2) ) +(declare-type collide-list structure) (deftype collide-cache-prim (structure) "A primitive inside the collide-cache. This can represent a sphere, a triangle mesh, or a group of other primitives within a bounding sphere." @@ -23431,8 +23472,8 @@ :size-assert #x30 :flag-assert #xb00000030 (:methods - (collide-cache-prim-method-9 () none) ;; 9 ;; (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) - (collide-cache-prim-method-10 () none) ;; 10 ;; (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ;; 9 + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ;; 10 ) ) @@ -23444,7 +23485,9 @@ The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything). It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'." ((num-tris int32 :offset-assert 4) + (num-tris-u32 uint32 :offset 4) (num-prims int32 :offset-assert 8) + (num-prims-u32 uint32 :offset 8) (ignore-mask pat-surface :offset-assert 12) ;; guessed by decompiler (ignore-processes process 2 :offset-assert 16) ;; guessed by decompiler (collide-box bounding-box :inline :offset-assert 32) @@ -23458,19 +23501,19 @@ :size-assert #x8670 :flag-assert #x1a00008670 (:methods - (collide-cache-method-9 () none) ;; 9 ;; (debug-draw (_type_) none) + (debug-draw (_type_) none) ;; 9 (fill-and-probe-using-line-sphere (_type_ collide-query) float) ;; 10 (fill-and-probe-using-spheres (_type_ collide-query) symbol) ;; 11 (fill-using-bounding-box (_type_ collide-query) none) ;; 12 (fill-using-line-sphere (_type_ collide-query) none) ;; 13 - (collide-cache-method-14 () none) ;; 14 ;; (fill-using-spheres (_type_ collide-query) none) - (collide-cache-method-15 () none) ;; 15 ;; (reset (_type_) none) + (fill-using-spheres (_type_ collide-query) none) ;; 14 + (reset (_type_) none) ;; 15 (probe-using-line-sphere (_type_ collide-query) float) ;; 16 - (collide-cache-method-17 () none) ;; 17 ;; (probe-using-spheres (_type_ collide-query) symbol) - (collide-cache-method-18 () none) ;; 18 ;; (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) - (collide-cache-method-19 () none) ;; 19 ;; (fill-from-fg-boxes (_type_) none) - (collide-cache-method-20 () none) ;; 20 ;; (fill-from-fg-line-sphere (_type_ collide-query) none) - (collide-cache-method-21 () none) ;; 21 ;; (fill-from-water (_type_ water-control) none) + (probe-using-spheres (_type_ collide-query) symbol) ;; 17 + (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) ;; 18 + (fill-from-fg-boxes (_type_) none) ;; 19 + (fill-from-fg-line-sphere (_type_ collide-query) none) ;; 20 + (fill-from-water (_type_ water-control) none) ;; 21 (collide-cache-method-22 () none) ;; 22 ;; (collide-cache-method-22 () none) (collide-cache-method-23 () none) ;; 23 ;; (collide-cache-method-23 () none) (collide-cache-method-24 () none) ;; 24 ;; (collide-cache-method-24 () none) @@ -23516,7 +23559,9 @@ (ignore-process0 process-tree :offset 88) ;; guessed by decompiler (ignore-process1 process-tree :offset 92) ;; guessed by decompiler (ignore-pat pat-surface :offset-assert 96) ;; guessed by decompiler + (ignore-pat-s32 int32 :offset 96) (collide-with collide-spec :offset-assert 100) ;; guessed by decompiler + (collide-with-s32 int32 :offset 100) (overlay-params uint32 3 :offset 112) ;; guessed by decompiler (bbox bounding-box :inline :offset-assert 128) (bbox4w bounding-box4w :inline :offset-assert 160) @@ -23530,7 +23575,7 @@ (spheres (inline-array sphere) :offset 112 :score 1) ;; guessed by decompiler (num-spheres uint32 :offset 116) (solid-only symbol :offset 120) ;; guessed by decompiler - (best-dist float :offset 112) + (best-dist float :offset 112 :score 2) (best-other-prim collide-shape-prim :offset 116 :score 1) ;; guessed by decompiler (best-my-prim collide-shape-prim :offset 120 :score 1) ;; guessed by decompiler (move-vec vector :inline :offset 224) @@ -23553,6 +23598,15 @@ :flag-assert #x90000021c ) +(deftype do-push-aways-work (structure) + "Added" + ((cquery collide-query :inline) + (push-vel vector :inline) + (vec33 vector :inline :offset 560) + (cspec collide-spec :offset 576) + ) + ) + (define-extern *collide-test-flag* symbol) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -24175,6 +24229,7 @@ (color-count uint8 :offset 57) (texture-masks-index uint16 :offset 58) (generic generic-tfragment :offset 60) + (generic-u32 uint32 :offset 60) ;; added ) :method-count-assert 17 :size-assert #x40 @@ -24660,8 +24715,8 @@ :size-assert #x60 :flag-assert #x1600000060 (:methods - (hfragment-method-17 () none) ;; 17 - (hfragment-method-18 () none) ;; 18 + (hfragment-method-17 (_type_ collide-cache collide-query) none) ;; 17 + (hfragment-method-18 (_type_ collide-cache collide-query) none) ;; 18 (hfragment-method-19 () none) ;; 19 (hfragment-method-20 () none) ;; 20 (hfragment-method-21 () none) ;; 21 @@ -26088,7 +26143,7 @@ (matrix int8 :offset-assert 32) (state-mode uint8 3 :offset-assert 33) ;; guessed by decompiler (state-counter uint32 :offset-assert 36) - (local-space-binding particle-local-space-info :offset 28) + (local-space-binding particle-local-space-info :offset 28 :score 1) (last-spawn-frame int32 :offset-assert 40) (last-spawn-time int32 :offset-assert 44) (origin matrix :inline :offset-assert 48) @@ -26099,13 +26154,13 @@ :size-assert #x70 :flag-assert #x1500000070 (:methods - (sparticle-launch-control-method-14 () none) ;; 14 ;; (kill-and-free-particles (_type_) none) - (sparticle-launch-control-method-15 () none) ;; 15 ;; (kill-particles (_type_) none) + (initialize (_type_ sparticle-launch-group process-drawable) none) ;; 14 ;; (kill-and-free-particles (_type_) none) + (is-visible? (_type_ vector) symbol) ;; 15 ;; (kill-particles (_type_) none) (spawn (_type_ vector) object) ;; 16 - (sparticle-launch-control-method-17 (_type_ matrix) none) ;; 17 - (sparticle-launch-control-method-18 (_type_ cspace) none) ;; 18 + (spawn-from-mat (_type_ matrix) none) ;; 17 + (spawn-from-cspace (_type_ cspace) none) ;; 18 (kill-particles (_type_) none) ;; 19 - (sparticle-launch-control-method-20 (_type_ float) none) ;; 20 + (set-local-space-info (_type_ particle-local-space-info) none) ;; 20 ) ) @@ -26121,8 +26176,8 @@ :flag-assert #xb00000054 (:methods (new (symbol type sparticle-system sparticle-launcher float) _type_) - (sparticle-subsampler-method-9 () none) ;; 9 - (sparticle-subsampler-method-10 (_type_ matrix) none) ;; 10 + (init-with-vec! (_type_ vector) vector) ;; 9 + (init-with-mat! (_type_ matrix) matrix) ;; 10 ) ) @@ -26183,6 +26238,7 @@ (friction float :offset-assert 96) (timer int32 :offset-assert 100) (flags sp-cpuinfo-flag :offset-assert 104) ;; guessed by decompiler + (flags-s32 int32 :offset 104) ;; added (user-int32 int32 :offset-assert 108) (user-uint32 uint32 :offset 108) (user-float float :offset 108 :score 1) @@ -26246,6 +26302,9 @@ :method-count-assert 9 :size-assert #x34 :flag-assert #x900000034 + (:methods + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) ;; 0 + ) ) (define-extern *sp-60-hz* symbol) @@ -28485,10 +28544,10 @@ :flag-assert #x2800000074 (:methods (new (symbol type int int) _type_) ;; 0 - (spatial-hash-method-33 () none) ;; 33 - (add-an-object (_type_ vector hash-object-info) int) ;; 34 + (spatial-hash-method-33 (_type_ vector hash-object-info) none) ;; 33 + (add-an-object (_type_ bounding-box (pointer collide-shape) int) int) ;; 34 (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int) ;; 35 - (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int) ;; 36 + (fill-actor-list-for-sphere (_type_ vector vector float (pointer collide-shape) int int) int) ;; 36 (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) ;; 37 (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) ;; 38 (spatial-hash-method-39 (_type_ object hash-object-info) int) ;; 39 @@ -29790,7 +29849,6 @@ ;; merc-blend-shape ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype blerc-block-header (structure) ((tag generic-merc-tag :inline :offset-assert 0) (vtx-count uint32 :offset-assert 16) @@ -29802,9 +29860,7 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype blerc-block (structure) ((output uint8 848 :offset-assert 0) ;; guessed by decompiler (header blerc-block-header :inline :offset-assert 848) @@ -29813,19 +29869,15 @@ :size-assert #x370 :flag-assert #x900000370 ) -|# -#| (deftype blerc-dcache (structure) - ((repl-mult vector 40 :offset-assert 0) ;; guessed by decompiler + ((repl-mult vector 40 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x280 :flag-assert #x900000280 ) -|# -#| (deftype blerc-globals (structure) ((first uint32 :offset-assert 0) (next uint32 :offset-assert 4) @@ -29839,9 +29891,7 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype blerc-context (structure) ((block-a blerc-block :inline :offset-assert 0) (dummy uint8 7312 :offset-assert 880) ;; guessed by decompiler @@ -29851,19 +29901,18 @@ :size-assert #x2370 :flag-assert #x900002370 ) -|# -;; (define-extern *stats-blerc* object) ;; symbol -;; (define-extern *blerc-globals* object) ;; blerc-globals -;; (define-extern blerc-stats-init function) ;; (function none) +(define-extern *stats-blerc* symbol) +(define-extern *blerc-globals* blerc-globals) +(define-extern blerc-stats-init (function none)) (define-extern blerc-init (function none)) -;; (define-extern blerc-a-fragment function) -;; (define-extern dma-from-spr function) -;; (define-extern merc-dma-chain-to-spr function) +(define-extern blerc-a-fragment function) +(define-extern dma-from-spr function) +(define-extern merc-dma-chain-to-spr function) (define-extern blerc-execute (function none)) (define-extern merc-blend-shape (function process-drawable object)) -;; (define-extern setup-blerc-chains-for-one-fragment function) ;; (function object object object object object object object) -;; (define-extern setup-blerc-chains function) ;; (function merc-ctrl (pointer int16) dma-buffer none) +(define-extern setup-blerc-chains-for-one-fragment (function object object object object object object object)) +(define-extern setup-blerc-chains (function merc-ctrl (pointer int16) dma-buffer none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; merc ;; @@ -29896,38 +29945,35 @@ ;; ripple ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ripple-request (structure) ((waveform ripple-wave :offset-assert 0) ;; guessed by decompiler (effect merc-effect :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype ripple-globals (structure) ((count int32 :offset-assert 0) - (requests ripple-request 16 :offset-assert 4) ;; guessed by decompiler + (requests ripple-request 16 :inline :offset-assert 4) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x84 :flag-assert #x900000084 ) -|# -;; (define-extern *ripple-globals* object) ;; ripple-globals +(define-extern *ripple-globals* ripple-globals) (define-extern ripple-make-request (function ripple-wave merc-effect none)) -;; (define-extern ripple-update-waveform-offs function) ;; (function ripple-wave-set clock none) -;; (define-extern ripple-execute-init function) ;; (function none) -;; (define-extern ripple-create-wave-table function) ;; (function ripple-wave-set int) -;; (define-extern ripple-apply-wave-table function) ;; (function merc-effect symbol) +(define-extern ripple-update-waveform-offs (function ripple-wave-set clock none)) +(define-extern ripple-execute-init (function none)) +(define-extern ripple-create-wave-table (function ripple-wave-set int)) +(define-extern ripple-apply-wave-table (function merc-effect symbol)) (define-extern ripple-execute (function none)) -;; (define-extern ripple-matrix-scale function) ;; function -;; (define-extern ripple-add-debug-sphere function) ;; (function process-drawable vector float float none) -;; (define-extern ripple-slow-add-sine-waves function) ;; (function ripple-wave-set float float float) +(define-extern ripple-matrix-scale function) +(define-extern ripple-add-debug-sphere (function process-drawable vector float float none)) +(define-extern ripple-slow-add-sine-waves (function ripple-wave-set float float float)) (define-extern ripple-find-height (function process-drawable int vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -30303,7 +30349,7 @@ (define-extern set-fog-height! (function float none)) (define-extern set-cloud-minmax! (function float float none)) (define-extern *darkjak-texture-anim-array* (texture-anim-array texture-anim)) -;; (define-extern set-darkjak-texture-morph! function) ;; (function float none) +(define-extern set-darkjak-texture-morph! (function float none)) (define-extern *darkjak-highres-texture-anim-array* (texture-anim-array texture-anim)) ;; (define-extern set-darkjak-highres-texture-morph! function) ;; (function float symbol) (define-extern *skull-gem-texture-anim-array* (texture-anim-array texture-anim)) @@ -30882,112 +30928,112 @@ (define-extern lookup-part-group-pointer-by-name (function string (pointer object))) (define-extern part-group-pointer? (function pointer symbol)) (define-extern unlink-part-group-by-heap (function kheap int)) -;; (define-extern sp-init-fields! function) ;; (function (pointer float) (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol (inline-array sp-field-init-spec)) +(define-extern sp-init-fields! (function (pointer float) (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol (inline-array sp-field-init-spec))) (define-extern *sp-launcher-lock* symbol) (define-extern *sp-launch-queue* sp-launch-queue) (define-extern *sp-launcher-enable* symbol) -;; (define-extern particle-setup-adgif function) ;; (function adgif-shader int none) +(define-extern particle-setup-adgif (function adgif-shader int none)) (define-extern *particle-adgif-cache* particle-adgif-cache) (define-extern particle-adgif-cache-flush (function none)) -;; (define-extern particle-adgif function) ;; (function adgif-shader texture-id none) -;; (define-extern particle-adgif-callback function) ;; (function adgif-shader texture-id none) -;; (define-extern sp-queue-launch function) ;; (function sparticle-system sparticle-launcher matrix int) -;; (define-extern sp-adjust-launch function) ;; (function sparticle-launchinfo sparticle-cpuinfo (inline-array sp-field-init-spec) matrix symbol none) -;; (define-extern sp-euler-convert function) ;; (function sparticle-launchinfo sparticle-cpuinfo none) -;; (define-extern sp-rotate-system function) ;; (function sparticle-launchinfo sparticle-cpuinfo transformq none) +(define-extern particle-adgif (function adgif-shader texture-id none)) +(define-extern particle-adgif-callback (function adgif-shader texture-id none)) +(define-extern sp-queue-launch (function sparticle-system sparticle-launcher matrix int)) +(define-extern sp-adjust-launch (function sparticle-launchinfo sparticle-cpuinfo (inline-array sp-field-init-spec) matrix symbol none)) +(define-extern sp-euler-convert (function sparticle-launchinfo sparticle-cpuinfo none)) +(define-extern sp-rotate-system (function sparticle-launchinfo sparticle-cpuinfo transformq none)) (define-extern sp-launch-particles-var (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)) (define-extern *death-adgif* adgif-shader) -;; (define-extern sp-launch-particles-death function) ;; (function sparticle-system sparticle-launcher vector none) -;; (define-extern sp-clear-queue function) ;; (function none) -;; (define-extern sp-relaunch-setup-fields function) ;; (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none) -;; (define-extern sp-relaunch-particle-2d function) ;; (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none) -;; (define-extern sp-relaunch-particle-3d function) ;; (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none) +(define-extern sp-launch-particles-death (function sparticle-system sparticle-launcher vector none)) +(define-extern sp-clear-queue (function none)) +(define-extern sp-relaunch-setup-fields (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none)) +(define-extern sp-relaunch-particle-2d (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern sp-relaunch-particle-3d (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none)) (define-extern execute-particle-local-space-engine (function int none)) -;; (define-extern local-space-camera function) +(define-extern local-space-camera (function particle-local-space-info none)) (define-extern local-space-proc-joint (function particle-local-space-info none)) (define-extern execute-part-engine (function none)) -;; (define-extern sparticle-track-root function) ;; (function object sparticle-cpuinfo vector none) -;; (define-extern sparticle-track-root-prim function) ;; (function object sparticle-cpuinfo vector none) -;; (define-extern sparticle-track-joint function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-turn-to-vel function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none) -;; (define-extern sparticle-rotate-to-vel-3d function) -;; (define-extern birth-func-clean function) -;; (define-extern birth-func-process-clock function) -;; (define-extern birth-func-copy-rot-color function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none) +(define-extern sparticle-track-root (function object sparticle-cpuinfo vector none)) +(define-extern sparticle-track-root-prim (function object sparticle-cpuinfo vector none)) +(define-extern sparticle-track-joint (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-turn-to-vel (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) +(define-extern sparticle-rotate-to-vel-3d (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d vector none)) +(define-extern birth-func-clean (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-process-clock (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-copy-rot-color (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) (define-extern *global-toggle* int) -;; (define-extern birth-func-copy2-rot-color function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none) -;; (define-extern birth-func-copy-omega-to-z function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none) -;; (define-extern birth-func-random-next-time function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none) -;; (define-extern sparticle-respawn-heights function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-respawn-timer function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-texture-animate function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-texture-day-night function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none) -;; (define-extern sparticle-mode-animate function) ;; (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none) +(define-extern birth-func-copy2-rot-color (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-copy-omega-to-z (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-random-next-time (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern sparticle-respawn-heights (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-respawn-timer (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-texture-animate (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-texture-day-night (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern sparticle-mode-animate (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) (define-extern sparticle-motion-blur (function sparticle-system sparticle-cpuinfo vector none)) -;; (define-extern sparticle-motion-blur-old function) ;; (function object sparticle-cpuinfo sprite-vec-data-3d object) -;; (define-extern sparticle-set-conerot function) ;; (function sparticle-launcher vector none) -;; (define-extern sparticle-next-on-mode-1 function) ;; (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float) -;; (define-extern check-ground-bounce function) ;; (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float) -;; (define-extern check-drop-group-center function) ;; (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern check-bubble-height function) -;; (define-extern check-raise-group-center function) -;; (define-extern birth-func-y->userdata function) ;; (function sparticle-system sparticle-cpuinfo matrix none) -;; (define-extern birth-func-ocean-height function) ;; (function sparticle-system sparticle-cpuinfo matrix none) -;; (define-extern birth-func-camera-orient function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-set-parent-pntr function) -;; (define-extern birth-func-get-parent-quat function) -;; (define-extern spt-func-camera-facing-orbiter function) +(define-extern sparticle-motion-blur-old (function object sparticle-cpuinfo sprite-vec-data-3d object)) +(define-extern sparticle-set-conerot (function sparticle-launcher vector none)) +(define-extern sparticle-next-on-mode-1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float)) +(define-extern check-ground-bounce (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float)) +(define-extern check-drop-group-center (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern check-bubble-height (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern check-raise-group-center (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-y->userdata (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern birth-func-ocean-height (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern birth-func-camera-orient (function int sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-set-parent-pntr (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-get-parent-quat (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern spt-func-camera-facing-orbiter (function sparticle-system sparticle-cpuinfo sparticle-launchinfo quaternion)) (define-extern *particle-quat* quaternion) -;; (define-extern birth-func-set-quat function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) +(define-extern birth-func-set-quat (function int sparticle-cpuinfo sparticle-launchinfo none)) (define-extern *particle-vel* vector) -;; (define-extern birth-func-set-vel function) ;; (function object sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-texture-group function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) +(define-extern birth-func-set-vel (function object sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-texture-group (function int sparticle-cpuinfo sparticle-launchinfo none)) (define-extern rot-to-particle (function degrees sprite-vec-data-2d matrix none)) -;; (define-extern birth-func-flip-based-on-scale function) -;; (define-extern sparticle-2d-spline-align function) -(define-extern sparticle-2d-spline-align-instant (function object sparticle-cpuinfo sprite-vec-data-2d object none)) -;; (define-extern birth-func-inherit-size function) -;; (define-extern birth-func-texture-group-2d function) -;; (define-extern birth-func-set-vel-2d function) -;; (define-extern sparticle-3d-rotate-xz-to-camera function) -;; (define-extern spt-func-relative-pos function) -;; (define-extern spt-func-turn-to-vel-radial function) +(define-extern birth-func-flip-based-on-scale (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern sparticle-2d-spline-align (function object sparticle-cpuinfo sprite-vec-data-2d object none)) +(define-extern sparticle-2d-spline-align-instant (function object sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern birth-func-inherit-size (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-texture-group-2d (function object sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-set-vel-2d (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern sparticle-3d-rotate-xz-to-camera (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) +(define-extern spt-func-relative-pos (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) +(define-extern spt-func-turn-to-vel-radial (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sparticle ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern sp-particle-copy! function) ;; (function sparticle-cpuinfo sparticle-cpuinfo none) +(define-extern sp-particle-copy! (function sparticle-cpuinfo sparticle-cpuinfo none)) (define-extern *sp-particle-system-2d* sparticle-system) (define-extern *sp-particle-system-3d* sparticle-system) -;; (define-extern sp-get-block-size function) ;; (function sparticle-system int int) -;; (define-extern sp-get-approx-alloc-size function) ;; (function sparticle-system int int) -;; (define-extern sp-free-particle function) ;; (function sparticle-system int sparticle-cpuinfo sprite-vec-data-2d none) -;; (define-extern sp-get-particle function) ;; (function sparticle-system int sparticle-launch-state sparticle-cpuinfo) +(define-extern sp-get-block-size (function sparticle-system int int)) +(define-extern sp-get-approx-alloc-size (function sparticle-system int int)) +(define-extern sp-free-particle (function sparticle-system int sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern sp-get-particle (function sparticle-system int sparticle-launch-state sparticle-cpuinfo)) (define-extern sp-kill-particle (function sparticle-system sparticle-cpuinfo symbol)) -;; (define-extern sp-orbiter function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sp-process-block-2d function) ;; (function sparticle-system int int int int symbol none) -;; (define-extern sp-process-block-3d function) ;; (function sparticle-system int int int int symbol none) -;; (define-extern sp-copy-to-spr function) ;; (function int pointer int none) -;; (define-extern sp-copy-from-spr function) ;; (function int pointer int none) -;; (define-extern memcpy function) ;; function -;; (define-extern sp-process-block function) ;; (function sparticle-system int sprite-array-2d int none) -;; (define-extern sp-process-particle-system function) ;; (function sparticle-system int sprite-array-2d none) -;; (define-extern *particles-flag* object) ;; symbol -;; (define-extern forall-particles-with-key-runner function) ;; (function sparticle-launch-control (function sparticle-system sparticle-cpuinfo none) sparticle-system none) -;; (define-extern forall-particles-with-key function) ;; (function sparticle-launch-control (function sparticle-system sparticle-cpuinfo none) symbol symbol none) -;; (define-extern sparticle-kill-it function) ;; (function sparticle-system sparticle-cpuinfo none) -;; (define-extern *sparticle-kill-it-level* object) -;; (define-extern sparticle-kill-it-level function) -;; (define-extern sparticle-60-to-50 function) ;; (function sparticle-system sparticle-cpuinfo pointer none) -;; (define-extern sparticle-50-to-60 function) ;; (function sparticle-system sparticle-cpuinfo pointer none) +(define-extern sp-orbiter (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sp-process-block-2d (function sparticle-system int int int int symbol none)) +(define-extern sp-process-block-3d (function sparticle-system int int int int symbol none)) +(define-extern sp-copy-to-spr (function int pointer int none)) +(define-extern sp-copy-from-spr (function int pointer int none)) +(define-extern memcpy (function pointer pointer none)) +(define-extern sp-process-block (function sparticle-system int sprite-array-2d int none)) +(define-extern sp-process-particle-system (function sparticle-system int sprite-array-2d none)) +(define-extern *particles-flag* symbol) +(define-extern forall-particles-with-key-runner (function sparticle-launch-control (function sparticle-system sparticle-cpuinfo none) sparticle-system none)) +(define-extern forall-particles-with-key (function sparticle-launch-control (function sparticle-system sparticle-cpuinfo none) symbol symbol none)) +(define-extern sparticle-kill-it (function sparticle-system sparticle-cpuinfo none)) +(define-extern *sparticle-kill-it-level* int) +(define-extern sparticle-kill-it-level (function sparticle-system sparticle-cpuinfo pointer none)) +(define-extern sparticle-60-to-50 (function sparticle-system sparticle-cpuinfo pointer none)) +(define-extern sparticle-50-to-60 (function sparticle-system sparticle-cpuinfo pointer none)) (define-extern kill-all-particles-with-key (function sparticle-launch-control none)) -;; (define-extern forall-particles-runner function) ;; (function (function sparticle-system sparticle-cpuinfo pointer none) sparticle-system none) -;; (define-extern forall-particles function) ;; (function function symbol symbol none) +(define-extern forall-particles-runner (function (function sparticle-system sparticle-cpuinfo pointer none) sparticle-system none)) +(define-extern forall-particles (function function symbol symbol none)) (define-extern kill-all-particles-in-level (function level int)) -;; (define-extern all-particles-50-to-60 function) ;; (function none) -;; (define-extern all-particles-60-to-50 function) ;; (function none) -;; (define-extern remap-particle function) ;; (function sparticle-system sparticle-cpuinfo pointer none) +(define-extern all-particles-50-to-60 (function none)) +(define-extern all-particles-60-to-50 (function none)) +(define-extern remap-particle (function sparticle-system sparticle-cpuinfo pointer none)) (define-extern remap-all-particles (function none)) (define-extern process-particles (function none)) @@ -31391,7 +31437,7 @@ @returns [[none]]" (function mood-table none)) ;; (define-extern *overide-table* mood-table) ;; mood-table -(define-extern print-mood-tables "Generates the GOAL code for defining the current state of [[*overide-table*]]" (function none)) ;; ( +(define-extern print-mood-tables "Generates the GOAL code for defining the current state of [[*overide-table*]]" (function none)) (define-extern desaturate-mood-colors "Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color Apply said overrides to the [[*overide-table*]]" @@ -31799,17 +31845,17 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-extern time-of-day-effect (function none)) -(define-extern time-of-day-update (function none :behavior time-of-day-proc)) -(define-extern update-counters (function float :behavior time-of-day-proc)) +(define-extern time-of-day-update "Update particles, sky, and effect for time-of-day." (function none :behavior time-of-day-proc)) +(define-extern update-counters "Set hours, minutes, senonds based on current frame." (function float :behavior time-of-day-proc)) (define-extern time-of-day-tick (state time-of-day-proc)) -(define-extern init-time-of-day (function object :behavior time-of-day-proc)) -(define-extern start-time-of-day (function (pointer time-of-day-proc))) -(define-extern time-of-day-setup (function symbol symbol)) +(define-extern init-time-of-day "Initialize the time-of-day process" (function object :behavior time-of-day-proc)) +(define-extern start-time-of-day "Start a new time of day process, killing old one if needed." (function (pointer time-of-day-proc))) +(define-extern time-of-day-setup "Check if the time of day ratio is set up or not. If arg0 = #t, then set it if needed." (function symbol symbol)) (define-extern time-of-day-interp-colors (function (pointer rgba) uint mood-context none)) (define-extern time-of-day-interp-colors-scratch (function (pointer rgba) time-of-day-palette mood-context none)) -(define-extern init-time-of-day-context (function time-of-day-context symbol)) -(define-extern set-filter-color! (function float float float none)) -(define-extern tod-madd! (function vector vector vector float)) +(define-extern init-time-of-day-context "Set up lighting data to defaults" (function time-of-day-context symbol)) +(define-extern set-filter-color! "Set RGB of filter." (function float float float none)) +(define-extern tod-madd! "Multiply-add" (function vector vector vector float)) (define-extern update-environment-colors (function time-of-day-context vector)) (define-extern update-time-of-day (function time-of-day-context none)) (define-extern calc-fade-from-fog (function vector float)) @@ -32213,19 +32259,18 @@ ;; collide-hash ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern add-collide-debug-box function) ;; (function vector rgba none) -;; (define-extern print-collide-cache-tri-count function) ;; (function none) -;; (define-extern print-exceeded-max-cache-tris function) ;; (function none) -;; (define-extern fill-bg-using-box-new function) ;; (function collide-cache object collide-query none) -;; (define-extern fill-bg-using-line-sphere-new function) ;; (function collide-cache object collide-query none) -;; (define-extern collide-list-fill-bg-using-box function) ;; (function collide-cache collide-list collide-query none) -;; (define-extern collide-list-fill-bg-using-line-sphere function) ;; (function collide-cache collide-list collide-query none) +(define-extern add-collide-debug-box (function vector rgba none)) +(define-extern print-collide-cache-tri-count (function none)) +(define-extern print-exceeded-max-cache-tris (function none)) +(define-extern fill-bg-using-box-new (function collide-cache object collide-query none)) +(define-extern fill-bg-using-line-sphere-new (function collide-cache object collide-query none)) +(define-extern collide-list-fill-bg-using-box (function collide-cache collide-list collide-query none)) +(define-extern collide-list-fill-bg-using-line-sphere (function collide-cache collide-list collide-query none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-probe ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype collide-probe-stack-elem (structure) ((child uint32 :offset-assert 0) (count uint32 :offset-assert 4) @@ -32234,40 +32279,37 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype collide-probe-stack (structure) - ((data collide-probe-stack-elem 1024 :offset-assert 0) ;; guessed by decompiler + ((data collide-probe-stack-elem 1024 :inline :offset-assert 0) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x4000 :flag-assert #x900004000 ) -|# -;; (define-extern creates-new-method? function) ;; (function type int symbol) -;; (define-extern overrides-parent-method? function) ;; (function type int symbol) -;; (define-extern describe-methods function) ;; (function type symbol) -;; (define-extern indent-to function) ;; (function int none) -;; (define-extern probe-traverse-draw-node function) ;; (function draw-node int none) -;; (define-extern probe-traverse-inline-array-node function) ;; (function drawable-inline-array-node int none) -;; (define-extern probe-traverse-collide-fragment function) ;; (function drawable-tree-collide-fragment int none) -;; (define-extern *collide-probe-stack* object) ;; collide-probe-stack -;; (define-extern collide-vu0-block object) ;; vu-function -;; (define-extern collide-probe-node function) ;; (function (inline-array draw-node) int collide-list int) -;; (define-extern print-out function) ;; (function int object) -;; (define-extern collide-probe-instance-tie-collide-frags function) ;; (function none) -;; (define-extern collide-probe-instance-tie function) ;; (function object int collide-list int int) -;; (define-extern collide-probe-collide-fragment-tree-make-list function) ;; (function drawable-tree-collide-fragment collide-list none) -;; (define-extern collide-probe-instance-tie-tree-make-list function) ;; (function drawable-tree-instance-tie collide-list int) -;; (define-extern collide-upload-vu0 function) ;; (function none) -;; (define-extern collide-probe-make-list function) ;; (function level collide-list none) -;; (define-extern distc function) ;; (function vector vector float) -;; (define-extern interpolate function) ;; (function float float float float float float) -;; (define-extern misty-ambush-height function) ;; (function vector float) -;; (define-extern misty-ambush-height-probe function) ;; (function vector float float) -;; (define-extern pke-collide-test function) ;; (function none) +(define-extern creates-new-method? (function type int symbol)) +(define-extern overrides-parent-method? (function type int symbol)) +(define-extern describe-methods (function type symbol)) +(define-extern indent-to (function int none)) +(define-extern probe-traverse-draw-node (function draw-node int none)) +(define-extern probe-traverse-inline-array-node (function drawable-inline-array-node int none)) +(define-extern probe-traverse-collide-fragment (function drawable-tree-collide-fragment int none)) +(define-extern *collide-probe-stack* collide-probe-stack) +(define-extern collide-vu0-block vu-function) +(define-extern collide-probe-node (function (inline-array draw-node) int collide-list int)) +(define-extern print-out (function int object)) +(define-extern collide-probe-instance-tie-collide-frags (function none)) +(define-extern collide-probe-instance-tie (function object int collide-list int int)) +(define-extern collide-probe-collide-fragment-tree-make-list (function drawable-tree-collide-fragment collide-list none)) +(define-extern collide-probe-instance-tie-tree-make-list (function drawable-tree-instance-tie collide-list int)) +(define-extern collide-upload-vu0 (function none)) +(define-extern collide-probe-make-list (function level collide-list none)) +(define-extern distc (function vector vector float)) +(define-extern interpolate (function float float float float float float)) +(define-extern misty-ambush-height (function vector float)) +(define-extern misty-ambush-height-probe (function vector float float)) +(define-extern pke-collide-test (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-frag ;; @@ -32278,7 +32320,6 @@ ;; collide-mesh ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype sopt-work (structure) ((intersect vector :inline :offset-assert 0) (sphere-bbox4w bounding-box4w :inline :offset-assert 16) @@ -32287,9 +32328,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype spat-work (structure) ((intersect vector :inline :offset-assert 0) (sphere-bbox4w bounding-box4w :inline :offset-assert 16) @@ -32298,9 +32337,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype oot-work (structure) ((intersect vector :inline :offset-assert 0) (sphere-bbox4w bounding-box4w :inline :offset-assert 16) @@ -32309,14 +32346,11 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-touch ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype add-prims-touching-work (structure) ((tri1 collide-tri-result :offset-assert 0) (tri2 collide-tri-result :offset-assert 4) @@ -32325,7 +32359,6 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# (define-extern get-intersect-point (function vector touching-prims-entry collide-shape touching-shapes-entry vector)) @@ -32333,7 +32366,6 @@ ;; collide-edge-grab ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pbhp-stack-vars (structure) ((edge collide-edge-edge :offset-assert 0) (allocated basic :offset-assert 4) @@ -32344,9 +32376,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype faei-stack-vars (structure) ((hold-edge-vec-norm vector :inline :offset-assert 0) (adj-edge-vec-norm vector :inline :offset-assert 16) @@ -32359,25 +32389,24 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -;; (define-extern *no-walk-surface* surface) ;; surface +(define-extern *no-walk-surface* surface) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-shape ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern find-ground-point function) ;; (function control-info vector float float vector) -;; (define-extern target-attack-up function) ;; (function target symbol symbol none) +(define-extern find-ground-point (function control-info vector float float vector)) +(define-extern target-attack-up (function target symbol symbol none)) (define-extern collide-shape-moving-angle-set! (function collide-shape-moving vector vector none)) (define-extern cshape-reaction-update-state (function control-info collide-query vector none)) (define-extern cshape-reaction-default (function control-info collide-query vector vector collide-status)) (define-extern cshape-reaction-just-move (function control-info collide-query vector collide-status)) (define-extern collide-shape-draw-debug-marks (function none)) -;; (define-extern *col-timer* object) ;; stopwatch -;; (define-extern *frame-timer* object) ;; stopwatch -;; (define-extern *col-timer-enable* object) ;; symbol -;; (define-extern debug-report-col-stats function) ;; (function int) +(define-extern *col-timer* stopwatch) +(define-extern *frame-timer* stopwatch) +(define-extern *col-timer-enable* symbol) +(define-extern debug-report-col-stats (function int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-shape-rider ;; @@ -32403,10 +32432,9 @@ ;; spatial-hash ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype grid-hash-work (basic) - ((result-words uint8 32 :offset-assert 16) ;; guessed by decompiler - (result-bits uint8 32 :offset-assert 16) ;; guessed by decompiler + ((result-words uint8 32 :offset 16) ;; guessed by decompiler + (result-bits uint8 32 :offset 16) ;; guessed by decompiler (object-id int32 :offset-assert 48) (temp-box-min vector :inline :offset-assert 64) (temp-box-max vector :inline :offset-assert 80) @@ -32421,19 +32449,17 @@ :size-assert #x78 :flag-assert #x900000078 ) -|# -;; (define-extern *grid-hash-work* grid-hash-work) ;; grid-hash-work -;; (define-extern validate-bucket-bits function) ;; (function grid-hash (pointer grid-hash-word) symbol) -;; (define-extern draw-grid function) ;; (function vector vector (pointer int8) rgba none) -;; (define-extern draw-sphere-box function) ;; (function sphere rgba none) -;; (define-extern draw-line-sphere function) ;; (function vector vector float rgba none) +(define-extern *grid-hash-work* grid-hash-work) +(define-extern validate-bucket-bits (function grid-hash (pointer grid-hash-word) symbol)) +(define-extern draw-grid (function vector vector (pointer int8) rgba none)) +(define-extern draw-sphere-box (function sphere rgba none)) +(define-extern draw-line-sphere (function vector vector float rgba none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; actor-hash ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype actor-cshape-ptr (structure) ((cshape collide-shape :offset-assert 0) ;; guessed by decompiler ) @@ -32441,41 +32467,37 @@ :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype actor-hash-bucket (structure) ((length int16 :offset-assert 0) (max-length int16 :offset-assert 2) (data (inline-array actor-cshape-ptr) :offset-assert 4) ;; guessed by decompiler ) + :allow-misaligned :method-count-assert 10 :size-assert #x8 :flag-assert #xa00000008 (:methods - (actor-hash-bucket-method-9 () none) ;; 9 ;; (add-actor-cshape (_type_ collide-shape) none) + (add-actor-cshape (_type_ collide-shape) none) ;; 9 ) ) -|# -#| (deftype actor-hash-buckets (structure) ((hash spatial-hash :offset-assert 0) ;; guessed by decompiler (list engine :offset-assert 4) ;; guessed by decompiler - (data actor-hash-bucket 4 :offset-assert 8) ;; guessed by decompiler + (data actor-hash-bucket 4 :inline :offset-assert 8) ;; guessed by decompiler (tpos vector :inline :offset-assert 80) ) :method-count-assert 10 :size-assert #x60 :flag-assert #xa00000060 (:methods - (actor-hash-buckets-method-9 () none) ;; 9 ;; (hash-actors (_type_) none) + (hash-actors (_type_) none) ;; 9 ) ) -|# (define-extern *actor-hash* spatial-hash) -;; (define-extern *actor-hash-buckets* object) ;; actor-hash-buckets +(define-extern *actor-hash-buckets* actor-hash-buckets) (define-extern update-actor-hash (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -33748,7 +33770,7 @@ (deftype prim-beam-settings (structure) ((width float :offset-assert 0) - (color uint32 :offset-assert 4) + (color rgba :offset-assert 4) (alpha float :offset-assert 8) (tex-id uint32 :offset-assert 12) (num-tiles float :offset-assert 16) @@ -33787,17 +33809,17 @@ (define-extern command-get-int (function object int int)) (define-extern command-get-float (function object float float)) -;; (define-extern command-get-time function) ;; (function object int time-frame) +(define-extern command-get-time (function object int time-frame)) (define-extern command-get-param (function object object object)) -;; (define-extern command-get-quoted-param function) ;; (function object object object) +(define-extern command-get-quoted-param (function object object object)) (define-extern command-get-process (function object process process)) -;; (define-extern command-get-entity function) ;; (function object entity entity) -;; (define-extern command-get-trans function) ;; (function object vector vector) -;; (define-extern key-assoc function) ;; (function object pair vector4w pair) -;; (define-extern *script-form* object) ;; (inline-array script-form) -;; (define-extern level-from-heap function) ;; (function int level) -;; (define-extern *syntax-context* object) ;; script-context -;; (define-extern *script-context* object) ;; script-context +(define-extern command-get-entity (function object entity entity)) +(define-extern command-get-trans (function object vector vector)) +(define-extern key-assoc (function object pair vector4w pair)) +(define-extern *script-form* (inline-array script-form)) +(define-extern level-from-heap (function int level)) +(define-extern *syntax-context* script-context) +(define-extern *script-context* script-context) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; generic-obs ;; @@ -34241,82 +34263,72 @@ ;; lightning-new-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype lightning-appearance (structure) ((base-alpha float :offset-assert 0) (width-range-start float :offset-assert 4) (width-range-end float :offset-assert 8) (tex-id uint32 :offset-assert 12) (blend-mode uint64 :offset-assert 16) - (fade-time uint64 :offset-assert 24) - (regenerate-time-start uint64 :offset-assert 32) - (regenerate-time-end uint64 :offset-assert 40) - (alpha-1-curve basic :offset-assert 48) + (fade-time time-frame :offset-assert 24) + (regenerate-time-start time-frame :offset-assert 32) + (regenerate-time-end time-frame :offset-assert 40) + (alpha-1-curve curve2d-fast :offset-assert 48) (alpha-1-mode uint64 :offset-assert 56) (alpha-1-repeat-dist float :offset-assert 64) - (alpha-2-curve basic :offset-assert 68) + (alpha-2-curve curve2d-fast :offset-assert 68) (alpha-2-mode uint64 :offset-assert 72) (alpha-2-repeat-dist float :offset-assert 80) - (width-curve basic :offset-assert 84) + (width-curve curve2d-fast :offset-assert 84) (width-mode uint64 :offset-assert 88) (width-repeat-dist float :offset-assert 96) (uv-repeat-dist float :offset-assert 100) - (uv-shift? basic :offset-assert 104) - (uv-shift-speed uint64 :offset-assert 112) - (fade-time uint64 :offset-assert 24) - (use-sprite-bucket? basic :offset-assert 128) - (use-accurate-interp? basic :offset-assert 132) + (uv-shift? symbol :offset-assert 104) + (uv-shift-speed time-frame :offset-assert 112) + (use-sprite-bucket? symbol :offset 128) + (use-accurate-interp? symbol :offset-assert 132) ) :method-count-assert 9 :size-assert #x88 :flag-assert #x900000088 ) -|# -#| (deftype lightning-span-internal (structure) ((index int16 :offset-assert 0) (span-flags uint8 :offset-assert 2) (num-inner-points int8 :offset-assert 3) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype lightning-span (structure) ((random-offset-size-start float :offset-assert 0) (inner-random-offset-size float :offset-assert 4) ) + :pack-me :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype lightning-spans-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data lightning-span :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype lightning-spans-internal-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data lightning-span-internal :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype tex-u-holder (structure) ((uu float :offset-assert 0) (last-dist float :offset-assert 4) @@ -34325,21 +34337,19 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype lightning-bolt (basic) - ((current-points basic :offset-assert 4) - (desired-points basic :offset-assert 8) - (span-pts-start basic :offset-assert 12) - (spans basic :offset-assert 16) - (spans-internal basic :offset-assert 20) - (strip1 basic :offset-assert 24) - (strip2 basic :offset-assert 28) - (inner-point-travel-time uint64 :offset-assert 32) - (start-fade-time uint64 :offset-assert 40) - (new-inner-point-generate-time uint64 :offset-assert 48) - (last-generate-time uint64 :offset-assert 56) + ((current-points vector-array :offset-assert 4) + (desired-points vector-array :offset-assert 8) + (span-pts-start vector-array :offset-assert 12) + (spans lightning-spans-array :offset-assert 16) + (spans-internal lightning-spans-internal-array :offset-assert 20) + (strip1 prim-strip :offset-assert 24) + (strip2 prim-strip :offset-assert 28) + (inner-point-travel-time time-frame :offset-assert 32) + (start-fade-time time-frame :offset-assert 40) + (new-inner-point-generate-time time-frame :offset-assert 48) + (last-generate-time time-frame :offset-assert 56) (base-width float :offset-assert 64) (current-uv-shift float :offset-assert 68) (current-fade-scalar float :offset-assert 72) @@ -34347,22 +34357,22 @@ (appearance lightning-appearance :offset-assert 80) (fade-mode uint64 :offset-assert 88) (generate-mode uint64 :offset-assert 96) - (snap-inner-points? basic :offset-assert 104) - (span-data UNKNOWN 2 :offset-assert 108) - (num-active-spans int8 :offset-assert 108) - (num-spans int8 :offset-assert 109) - (base-color uint32 :offset-assert 112) + (snap-inner-points? symbol :offset-assert 104) + (span-data int8 2 :offset-assert 108) + (num-active-spans int8 :offset 108) + (num-spans int8 :offset 109) + (base-color rgba :offset-assert 112) ) :method-count-assert 23 :size-assert #x74 :flag-assert #x1700000074 (:methods - (lightning-bolt-method-9 () none) ;; 9 + (lightning-bolt-method-9 (_type_ int int lightning-appearance) none) ;; 9 (lightning-bolt-method-10 () none) ;; 10 - (lightning-bolt-method-11 () none) ;; 11 - (lightning-bolt-method-12 () none) ;; 12 - (lightning-bolt-method-13 () none) ;; 13 - (lightning-bolt-method-14 () none) ;; 14 + (lightning-bolt-method-11 (_type_) none) ;; 11 + (lightning-bolt-method-12 (_type_) none) ;; 12 + (lightning-bolt-method-13 (_type_ int) none) ;; 13 + (lightning-bolt-method-14 (_type_) int) ;; 14 (lightning-bolt-method-15 () none) ;; 15 (lightning-bolt-method-16 () none) ;; 16 (lightning-bolt-method-17 () none) ;; 17 @@ -34373,13 +34383,11 @@ (lightning-bolt-method-22 () none) ;; 22 ) ) -|# -#| (deftype lightning-new-tracker (process) - ((bolt basic :offset-assert 128) - (lifetime uint64 :offset-assert 136) - (state-time uint64 :offset-assert 144) + ((bolt lightning-bolt :offset-assert 128) + (lifetime time-frame :offset-assert 136) + (state-time time-frame :offset-assert 144) ) :method-count-assert 16 :size-assert #x98 @@ -34389,14 +34397,12 @@ (lightning-new-tracker-method-15 () none) ;; 15 ) ) -|# -#| (deftype lightning-tracker-init-params (structure) ((appearance lightning-appearance :offset-assert 0) (start-pt vector :inline :offset-assert 16) (end-pt vector :inline :offset-assert 32) - (lifetime uint64 :offset-assert 48) + (lifetime time-frame :offset-assert 48) (num-inner-points int8 :offset-assert 56) (inner-random-offset-size float :offset-assert 60) (random-offset-size-start float :offset-assert 64) @@ -34405,8 +34411,6 @@ :size-assert #x44 :flag-assert #x900000044 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; particle-curves ;; @@ -35104,14 +35108,14 @@ (clock-on symbol :offset-assert 80) ;; guessed by decompiler (hud handle 1 :offset-assert 88) ;; guessed by decompiler (tone sound-id :offset-assert 96) ;; guessed by decompiler - (bomb uint32 :offset-assert 100) + (bomb (pointer process) :offset-assert 100) (mode-sound-bank connection :offset-assert 104) ) :method-count-assert 10 :size-assert #x6c :flag-assert #xa0000006c (:methods - (darkjak-info-method-9 () none) ;; 9 ;; (update-clock! (_type_ int) none) + (update-clock! (_type_ int) none) ;; 9 ) ) @@ -35358,31 +35362,31 @@ ;; target-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern spt-birth-func-brightness-part-droppings-for function) -;; (define-extern birth-func-copy-target-y-rot function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-ground-orient function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-target-orient function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-vector-orient function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern birth-func-set-alpha-from-userdata function) ;; (function int sparticle-cpuinfo sparticle-launchinfo float) -;; (define-extern part-tracker-track-target-joint function) ;; (function int sparticle-cpuinfo sparticle-launchinfo none) -;; (define-extern spt-birth-func-part-land-droppings-for function) -;; (define-extern spt-birth-func-part-droppings-for function) -;; (define-extern spt-birth-func-part-slide-droppings-for function) -;; (define-extern spt-birth-func-part-jump-droppings-for function) +(define-extern spt-birth-func-brightness-part-droppings-for (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d object object none)) +(define-extern birth-func-copy-target-y-rot (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-ground-orient (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-target-orient (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-vector-orient (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern birth-func-set-alpha-from-userdata (function sparticle-system sparticle-cpuinfo sparticle-launchinfo float)) +(define-extern part-tracker-track-target-joint (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern spt-birth-func-part-land-droppings-for (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d object object none)) +(define-extern spt-birth-func-part-droppings-for (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-slide-droppings-for (function int sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-jump-droppings-for (function int sparticle-cpuinfo sparticle-launchinfo object object none)) (define-extern process-drawable-burn-effect (function time-frame rgbaf :behavior target)) (define-extern lightning-probe-callback (function lightning-tracker none)) (define-extern process-drawable-shock-effect-replace (function process-drawable lightning-spec (function lightning-tracker none) int int float none)) (define-extern process-drawable-shock-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher int int float object)) -;; (define-extern process-drawable-shock-wall-effect function) ;; (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher symbol) +(define-extern process-drawable-shock-wall-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher symbol)) (define-extern process-drawable2-shock-effect (function process-drawable process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher none)) -;; (define-extern process-drawable-shock-skel-effect function) ;; (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher float int int none) +(define-extern process-drawable-shock-skel-effect (function process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher float int int none)) (define-extern *lightning-darkjak-pill* lightning-spec) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gun-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern sparticle-track-gun-joint function) +(define-extern sparticle-track-gun-joint (function sparticle-system sparticle-cpuinfo vector none)) (define-extern *red-shot-colors* (pointer rgba)) (define-extern *range-explo-dust-color* curve-color-fast) (define-extern *range-explo-dust-alpha* curve2d-fast) @@ -35406,15 +35410,15 @@ (define-extern *curve-yellow2-shot-color* curve-color-fast) (define-extern *curve-linear-down-long* curve2d-fast) (define-extern *yellow-shot-2-trail* light-trail-composition) -;; (define-extern check-shell-level1 function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern check-shell-level2 function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-dark-shot-lightning function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-track-gun-joint-3d function) -;; (define-extern sparticle-track-gun-joint-player-y function) +(define-extern check-shell-level1 (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern check-shell-level2 (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-dark-shot-lightning (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-track-gun-joint-3d (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-track-gun-joint-player-y (function sparticle-system sparticle-cpuinfo vector none)) (define-extern *last-player-pos* vector) -;; (define-extern birth-func-converge function) -;; (define-extern sparticle-red-2-converge function) -;; (define-extern sparticle-red-2-glow-trail-halt function) +(define-extern birth-func-converge (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-red-2-converge (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-red-2-glow-trail-halt (function sparticle-system sparticle-cpuinfo vector none)) (define-extern *gun-dark-3-nuke-fade-time* time-frame) (define-extern *gun-dark-3-nuke-fade-curve* curve-color-piecewise) (define-extern *gun-dark-3-nuke-blur-segs* uint) @@ -35429,7 +35433,7 @@ (define-extern *gun-dark-3-nuke-blur-segs-small* uint) (define-extern *gun-dark-3-nuke-blur-time-small* time-frame) (define-extern *gun-dark-3-nuke-blur-curve-small* curve2d-piecewise) -;; (define-extern spt-func-part-gun-dark-1-upgrade-shot-edges function) +(define-extern spt-func-part-gun-dark-1-upgrade-shot-edges (function sparticle-system sparticle-cpuinfo vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-reaction-target ;; @@ -35590,17 +35594,18 @@ ;; collectables-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern eco-fadeout function) ;; (function sparticle-system sparticle-cpuinfo none) -;; (define-extern eco-track-root-prim-fadeout function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern sparticle-3d-rotate-xz-to-camera-eco-shaft function) -;; (define-extern spt-func-part-vent-eco-dark-shaft function) -;; (define-extern spt-func-part-vent-eco-dark-touched-specs function) +(define-extern eco-fadeout (function sparticle-system sparticle-cpuinfo none)) +(define-extern eco-track-root-prim-fadeout (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern sparticle-3d-rotate-xz-to-camera-eco-shaft (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d none)) +(define-extern spt-func-part-vent-eco-dark-shaft (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern spt-func-part-vent-eco-dark-touched-specs (function sparticle-system sparticle-cpuinfo vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; debug-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern sparticle-track-root-money function) ;; (function sparticle-system sparticle-cpuinfo vector none) +(define-extern hud-money type) +(define-extern sparticle-track-root-money (function sparticle-system sparticle-cpuinfo vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; find-nearest ;; @@ -35808,9 +35813,9 @@ ((impact? symbol :offset-assert 512) (fire-point vector :inline :offset-assert 528) (explode-sound uint32 :offset-assert 544) - (bolts basic :offset-assert 548) + (bolts (array lightning-bolt) :offset-assert 548) (ball-pos vector 2 :inline :offset-assert 560) - (trail light-trail :offset-assert 592) + (trail sparticle-launch-control :offset-assert 592) (ball1 sparticle-launch-control :offset-assert 596) (last-ground-height float :offset-assert 600) (fire-sound sound-id :offset-assert 604) @@ -35822,22 +35827,22 @@ impact ;; 22 ) (:methods - (darkjak-ball-method-41 () none) ;; 41 + (setup-bolts! (_type_ vector vector) none) ;; 41 ) ) -(define-extern darkjak-ball-slide-reaction (function none :behavior darkjak-ball)) -(define-extern darkjak-ball-move (function none :behavior darkjak-ball)) -(define-extern *darkjak-ball-lightning* lightning-spec) +(define-extern darkjak-ball-slide-reaction (function control-info collide-query vector vector collide-status)) +(define-extern darkjak-ball-move (function darkjak-ball none)) +(define-extern *darkjak-ball-lightning* lightning-appearance) (define-extern *darkjak-ball-lightning-colors* (array rgba)) -(define-extern sparticle-track-hadouken (function none)) +(define-extern sparticle-track-hadouken (function object sparticle-cpuinfo vector none)) (define-extern target-darkjak-setup (function symbol none :behavior target)) (define-extern want-to-darkjak? (function symbol :behavior target)) (define-extern *darkjak-trans-mods* surface) (define-extern target-darkjak-end-mode (function symbol none :behavior target)) (define-extern target-darkjak-process (function none :behavior target)) -(define-extern target-darkjak-bomb-collide (function float float none :behavior target)) -(define-extern target-bomb1-fire-shot (function (pointer handle) int int int none :behavior target)) +(define-extern target-darkjak-bomb-collide (function (pointer float) float none :behavior target)) +(define-extern target-bomb1-fire-shot (function (array handle) int int object :behavior target)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-lightjak ;; @@ -36145,8 +36150,16 @@ :flag-assert #x900000240 ) +;; +++gun-blue-shot:gun-blue-lightning-cmd-msg +(defenum gun-blue-lightning-cmd-msg + :type uint64 + (active 0) + (inactive 1) + ) +;; ---gun-blue-shot:gun-blue-lightning-cmd-msg + (deftype gun-blue-lightning-command (structure) - ((msg uint64 :offset-assert 0) + ((msg gun-blue-lightning-cmd-msg :offset-assert 0) (lightning-info gun-blue-2-lightning-info :inline :offset-assert 16) ) :method-count-assert 9 @@ -36155,7 +36168,7 @@ ) (deftype gun-blue-2-lightning-tracker (process-drawable) - ((lt-array (array gun-blue-2-lightning-info) :offset-assert 200) + ((lt-array (array lightning-bolt) :offset-assert 200) (should-draw-this-frame? symbol :offset-assert 204) (last-spark-time time-frame :offset 216) (spark-time-interval time-frame :offset-assert 224) @@ -36179,9 +36192,9 @@ test ;; 23 ) (:methods - (gun-blue-2-lightning-tracker-method-24 () none) ;; 24 - (gun-blue-2-lightning-tracker-method-25 () none) ;; 25 - (gun-blue-2-lightning-tracker-method-26 () none) ;; 26 + (setup-draw! (_type_ gun-blue-2-lightning-info) none) ;; 24 + (gun-blue-2-lightning-tracker-method-25 (_type_) object) ;; 25 + (gun-blue-2-lightning-tracker-method-26 (_type_ vector vector gun-blue-lightning-command) symbol) ;; 26 ) ) @@ -36212,7 +36225,7 @@ :size-assert #x241 :flag-assert #xa00000241 (:methods - (rope-constraint-method-9 () none) ;; 9 + (rope-constraint-method-9 (_type_ int) symbol) ;; 9 ) ) @@ -36241,32 +36254,32 @@ :flag-assert #x2901b00230 ) -;; (define-extern sparticle-fade-alpha-dist function) -;; (define-extern gun-fire-blue-1 function) -;; (define-extern fmod-2 function) -;; (define-extern get-dist-and-dot function) -;; (define-extern gun-blue-shot-3-move function) +(define-extern sparticle-fade-alpha-dist (function sparticle-system sparticle-cpuinfo matrix none)) +(define-extern gun-fire-blue-1 (function object :behavior target)) +(define-extern fmod-2 (function float float float)) +(define-extern get-dist-and-dot (function gun-blue-shot dist-dot-val object)) +(define-extern gun-blue-shot-3-move (function gun-blue-shot-3 none)) (define-extern *blue-shot-trail* light-trail-composition) -;; (define-extern gun-fire-blue-3 function) -;; (define-extern draw-beam-segment function) -;; (define-extern *found-objects* object) -;; (define-extern *gun-blue-2-last-attack-id* object) -;; (define-extern *gun-blue-2-last-attack-id-time* object) -;; (define-extern fire-projectile-if-necessary function) -;; (define-extern *gun-blue-2-targets* object) -;; (define-extern *blue-2-lightning-shape* object) +(define-extern gun-fire-blue-3 (function object :behavior target)) +(define-extern draw-beam-segment (function none)) +(define-extern *found-objects* (pointer handle)) +(define-extern *gun-blue-2-last-attack-id* uint) +(define-extern *gun-blue-2-last-attack-id-time* timeframe-wrapper) +(define-extern fire-projectile-if-necessary (function vector vector handle (pointer gun-blue-shot-2))) +(define-extern *gun-blue-2-targets* (inline-array gun-blue-2-target-info)) +(define-extern *blue-2-lightning-shape* rope-constraint) (define-extern *uv-loop-curve* curve2d-piecewise) -;; (define-extern *blue-light-test* object) -;; (define-extern *blue-light-test-end* object) -;; (define-extern *blue-light-test-big* object) -;; (define-extern *blue-light-test-big-intense* object) -;; (define-extern *blue-light-test-small-fade* object) -;; (define-extern gun-blue-2-lightning-init-by-other function) -;; (define-extern create-lightning-tracker-if-necessary function) -;; (define-extern is-valid-blue-2-target function) -;; (define-extern find-gun-blue-2-target function) -;; (define-extern find-gun-blue-2-target-old function) -;; (define-extern *lightning-pts-cache* object) +(define-extern *blue-light-test* lightning-appearance) +(define-extern *blue-light-test-end* lightning-appearance) +(define-extern *blue-light-test-big* lightning-appearance) +(define-extern *blue-light-test-big-intense* lightning-appearance) +(define-extern *blue-light-test-small-fade* lightning-appearance) +(define-extern gun-blue-2-lightning-init-by-other (function gun-blue-2-lightning-init-params object :behavior gun-blue-2-lightning-tracker)) +(define-extern create-lightning-tracker-if-necessary (function handle :behavior target)) +(define-extern is-valid-blue-2-target (function process-focusable int symbol)) +(define-extern find-gun-blue-2-target (function vector int process-drawable)) +(define-extern find-gun-blue-2-target-old (function vector int vector process-drawable)) +(define-extern *lightning-pts-cache* (inline-array vector)) (define-extern gun-fire-blue-2 (function object :behavior target)) (define-extern gun-fire-blue-2-old (function object :behavior target)) (define-extern target-gun-can-fire-blue? (function pickup-type symbol :behavior target)) @@ -36933,8 +36946,8 @@ ;; board-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern board-charge-track function) -;; (define-extern board-zap-track function) +(define-extern board-charge-track (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern board-zap-track (function sparticle-system sparticle-cpuinfo vector none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; board-states ;; @@ -37341,7 +37354,6 @@ ;; collide-cache ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype collide-puls-work (structure) ((ignore-pat pat-surface :offset-assert 0) ;; guessed by decompiler (bsphere sphere :inline :offset-assert 16) @@ -37351,9 +37363,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype lsmi-work (structure) ((best-u float :offset-assert 0) (orig-best-u float :offset-assert 4) @@ -37364,15 +37374,13 @@ :size-assert #x22c :flag-assert #x90000022c ) -|# -;; (define-extern test-closest-pt-in-triangle function) ;; (function collide-cache symbol) +(define-extern test-closest-pt-in-triangle (function collide-cache symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; collide-debug ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype col-rend-filter (structure) ((show-pat-set pat-surface :offset-assert 0) ;; guessed by decompiler (show-pat-clear pat-surface :offset-assert 4) ;; guessed by decompiler @@ -37382,9 +37390,8 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -;; (define-extern col-rend-draw function) ;; (function col-rend col-rend-filter none) +(define-extern col-rend-draw (function col-rend col-rend-filter none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; relocate ;; @@ -37398,7 +37405,7 @@ ;; memory-usage-block is already defined! (define-extern mem-size (function basic symbol int int)) -;; (define-extern *max-dma* object) ;; int +(define-extern *max-dma* int) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; entity ;; @@ -37639,7 +37646,7 @@ ;; effect-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-extern *footstep-surface* object) ;; pat-surface +(define-extern *footstep-surface* pat-surface) (define-extern *debug-effect-control* symbol) (define-extern sound-name-with-material (function string pat-surface string sound-name)) (define-extern effect-param->sound-spec (function sound-spec (pointer float) int process-focusable sound-spec)) @@ -37649,25 +37656,25 @@ ;; water-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-wsplash-color* curve-color-fast) -;; (define-extern *range-wsplash-alpha* curve2d-fast) -;; (define-extern *range-wsplash-scale-x* curve2d-fast) -;; (define-extern *range-wsplash-scale-y* curve2d-fast) -;; (define-extern *curve-wsplash-alpha* curve2d-fast) -;; (define-extern *curve-wsplash-scale-x* curve2d-fast) -;; (define-extern *curve-wsplash-scale-y* curve2d-fast) -;; (define-extern *part-water-splash-curve-settings* object) -;; (define-extern *range-splash-color* curve-color-fast) -;; (define-extern *range-splash-alpha* curve2d-fast) -;; (define-extern *range-splash-scale-x* curve2d-fast) -;; (define-extern *range-splash-scale-y* curve2d-fast) -;; (define-extern *curve-splash-alpha* curve2d-fast) -;; (define-extern *curve-splash-scale-x* curve2d-fast) -;; (define-extern *curve-splash-scale-y* curve2d-fast) -;; (define-extern *part-water-splash-center-curve-settings* object) -;; (define-extern *curve-wsplash-small-scale-x* curve2d-fast) -;; (define-extern *curve-wsplash-small-scale-y* curve2d-fast) -;; (define-extern *part-water-splash-small-curve-settings* object) +(define-extern *range-wsplash-color* curve-color-fast) +(define-extern *range-wsplash-alpha* curve2d-fast) +(define-extern *range-wsplash-scale-x* curve2d-fast) +(define-extern *range-wsplash-scale-y* curve2d-fast) +(define-extern *curve-wsplash-alpha* curve2d-fast) +(define-extern *curve-wsplash-scale-x* curve2d-fast) +(define-extern *curve-wsplash-scale-y* curve2d-fast) +(define-extern *part-water-splash-curve-settings* particle-curve-settings) +(define-extern *range-splash-color* curve-color-fast) +(define-extern *range-splash-alpha* curve2d-fast) +(define-extern *range-splash-scale-x* curve2d-fast) +(define-extern *range-splash-scale-y* curve2d-fast) +(define-extern *curve-splash-alpha* curve2d-fast) +(define-extern *curve-splash-scale-x* curve2d-fast) +(define-extern *curve-splash-scale-y* curve2d-fast) +(define-extern *part-water-splash-center-curve-settings* particle-curve-settings) +(define-extern *curve-wsplash-small-scale-x* curve2d-fast) +(define-extern *curve-wsplash-small-scale-y* curve2d-fast) +(define-extern *part-water-splash-small-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; water ;; @@ -38116,15 +38123,15 @@ ;; (define-extern task-closed? function) ;; (function string symbol) ;; (define-extern open-task-nodes function) ;; (function (array game-task-node-info) (array game-task-node-info)) (define-extern task-node-closed? (function game-task-node symbol)) -;; (define-extern task-node-close! function) ;; (function game-task-node int) +(define-extern task-node-close! (function game-task-node int)) ;; (define-extern task-open? function) -;; (define-extern task-node-open? function) ;; (function game-task-node symbol) +(define-extern task-node-open? (function game-task-node symbol)) (define-extern task-node-open! (function game-task-node symbol int)) ;; (define-extern task-node-close-upwards function) (define-extern task-node-reset (function symbol int)) ;; (define-extern task-node-dump function) ;; (function symbol symbol) ;; (define-extern resetter-init-by-other function) -;; (define-extern task-manager-init-by-other function) ;; (function game-task-node-info symbol object :behavior task-manager) +(define-extern task-manager-init-by-other (function game-task-node-info symbol object :behavior task-manager)) ;; (define-extern task-manager-event-handler function) ;; (function process int symbol event-message-block object :behavior task-manager) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -38552,7 +38559,6 @@ ;; glist-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype glst-node (structure) ((next glst-node :offset-assert 0) (prev glst-node :offset-assert 4) @@ -38561,9 +38567,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype glst-named-node (glst-node) ((privname string :offset-assert 8) ;; guessed by decompiler ) @@ -38571,54 +38575,51 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype glst-list (structure) ((head glst-node :offset-assert 0) (tail glst-node :offset-assert 4) (tailpred glst-node :offset-assert 8) (numelem int32 :offset-assert 12) ) + :pack-me :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -;; (define-extern glst-next function) ;; (function glst-node glst-node) -;; (define-extern glst-prev function) ;; (function glst-node glst-node) -;; (define-extern glst-head function) ;; (function glst-list glst-node) -;; (define-extern glst-tail function) ;; (function glst-list glst-node) -;; (define-extern glst-end-of-list? function) ;; (function glst-node symbol) -;; (define-extern glst-start-of-list? function) ;; (function glst-node symbol) -;; (define-extern glst-empty? function) ;; (function glst-list symbol) -;; (define-extern glst-node-name function) ;; (function glst-named-node string) -;; (define-extern glst-set-name! function) ;; (function glst-named-node string string) +(define-extern glst-next (function glst-node glst-node)) +(define-extern glst-prev (function glst-node glst-node)) +(define-extern glst-head (function glst-list glst-node)) +(define-extern glst-tail (function glst-list glst-node)) +(define-extern glst-end-of-list? (function glst-node symbol)) +(define-extern glst-start-of-list? (function glst-node symbol)) +(define-extern glst-empty? (function glst-list symbol)) +(define-extern glst-node-name (function glst-named-node string)) +(define-extern glst-set-name! (function glst-named-node string string)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; glist ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern glst-num-elements function) ;; (function glst-list int) -;; (define-extern glst-remove function) ;; (function glst-list glst-node glst-node) -;; (define-extern glst-remove-tail function) ;; (function glst-list glst-node) -;; (define-extern glst-remove-head function) ;; (function glst-list glst-node) -;; (define-extern glst-insert-before function) ;; (function glst-list glst-node glst-node glst-node) -;; (define-extern glst-insert-after function) ;; (function glst-list glst-node glst-node glst-node) -;; (define-extern glst-add-tail function) ;; (function glst-list glst-node glst-node) -;; (define-extern glst-add-head function) ;; (function glst-list glst-node glst-node) -;; (define-extern glst-init-list! function) ;; (function glst-list glst-list) -;; (define-extern glst-find-node-by-name function) ;; (function glst-list string glst-node) -;; (define-extern glst-get-node-by-index function) ;; (function glst-list int glst-node) -;; (define-extern glst-length-of-longest-name function) ;; (function glst-list int) -;; (define-extern glst-get-node-index function) ;; (function glst-list glst-node int) +(define-extern glst-num-elements (function glst-list int)) +(define-extern glst-remove (function glst-list glst-node glst-node)) +(define-extern glst-remove-tail (function glst-list glst-node)) +(define-extern glst-remove-head (function glst-list glst-node)) +(define-extern glst-insert-before (function glst-list glst-node glst-node glst-node)) +(define-extern glst-insert-after (function glst-list glst-node glst-node glst-node)) +(define-extern glst-add-tail (function glst-list glst-node glst-node)) +(define-extern glst-add-head (function glst-list glst-node glst-node)) +(define-extern glst-init-list! (function glst-list glst-list)) +(define-extern glst-find-node-by-name (function glst-list string glst-node)) +(define-extern glst-get-node-by-index (function glst-list int glst-node)) +(define-extern glst-length-of-longest-name (function glst-list int)) +(define-extern glst-get-node-index (function glst-list glst-node int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; anim-tester ;; +;; anim-tester ;;ä ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype list-control (structure) ((listfunc (function int list-control symbol) :offset-assert 0) ;; guessed by decompiler (list-owner uint32 :offset-assert 4) @@ -38641,13 +38642,12 @@ (user-info int32 :offset-assert 72) (return-int int32 :offset-assert 76) ) + :allow-misaligned :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 ) -|# -#| (deftype list-field (structure) ((left int32 :offset-assert 0) (width int32 :offset-assert 4) @@ -38656,9 +38656,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype DISP_LIST-bank (basic) ((V_SPACING int32 :offset-assert 4) (BORDER_WIDTH int32 :offset-assert 8) @@ -38676,9 +38674,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype anim-tester-bank (basic) ((ANIM_SPEED float :offset-assert 4) (BLEND float :offset-assert 8) @@ -38701,11 +38697,57 @@ :size-assert #x44 :flag-assert #x900000044 ) -|# -;; anim-tester is already defined! +(defenum anim-tester-flags + :bitfield #t + :type int32 + (fanimt0) + (fanimt1) + (fanimt2) + (fanimt3) + (fanimt4) + (fanimt5) + ) + +;; (defenum anim-tester-debug-flags +;; :bitfield #t +;; :type int32 +;; (unk0) +;; (unk1) +;; (unk2) +;; (unk3) +;; (at-show-joint-info) +;; (at-apply-align) +;; (unk6) +;; ) + +(deftype anim-tester (process-focusable) + ((flags anim-tester-flags :offset-assert 208) + ;; (debug-flags anim-tester-debug-flags :offset-assert 204) + (obj-list glst-list :inline :offset-assert 212) + (current-obj string :offset-assert 228) + (speed int32 :offset-assert 232) + (list-con list-control :inline :offset-assert 236) + (pick-con list-control :inline :offset-assert 316) + (item-field int64 :offset-assert 400) + (inc-delay int32 :offset-assert 408) + (inc-timer int32 :offset-assert 412) + (edit-mode int32 :offset-assert 416) + (old-mode int32 :offset-assert 420) + (anim-speed float :offset-assert 424) + (anim-gspeed float :offset-assert 428) + (anim-first float :offset-assert 432) + (anim-last float :offset-assert 436) + ) + :method-count-assert 28 + :size-assert #x1b8 + :heap-base #x140 + :flag-assert #x1c014001b8 + (:states + anim-tester-process + ) + ) -#| (deftype anim-test-obj (glst-named-node) ((obj-art-group basic :offset-assert 12) (seq-list glst-list :inline :offset-assert 16) @@ -38723,9 +38765,7 @@ :size-assert #x90 :flag-assert #x900000090 ) -|# -#| (deftype anim-test-sequence (glst-named-node) ((item-list glst-list :inline :offset-assert 12) (playing-item int32 :offset-assert 28) @@ -38737,9 +38777,7 @@ :size-assert #x78 :flag-assert #x900000078 ) -|# -#| (deftype anim-test-seq-item (glst-named-node) ((speed int32 :offset-assert 12) (blend int32 :offset-assert 16) @@ -38754,13 +38792,12 @@ :size-assert #x2c :flag-assert #x90000002c ) -|# ;; (define-extern *DISP_LIST-bank* DISP_LIST-bank) ;; (define-extern display-list-control function) ;; (define-extern *ANIM_TESTER-bank* anim-tester-bank) ;; (define-extern anim-tester-num-print function) -;; (define-extern *anim-tester* object) ;; (pointer anim-tester) +(define-extern *anim-tester* (pointer anim-tester)) ;; (define-extern anim-test-obj-init function) ;; (define-extern anim-test-sequence-init function) ;; (define-extern anim-test-seq-item-copy! function) @@ -38790,7 +38827,7 @@ ;; (define-extern anim-tester-save-all-objects function) ;; (define-extern anim-tester-add-newobj function) ;; (define-extern anim-tester-stop function) -;; (define-extern anim-tester-start function) ;; (function symbol) +(define-extern anim-tester-start (function symbol)) (define-extern anim-tester-add-object (function string none)) ;; (define-extern anim-tester-set-name function) ;; (define-extern anim-tester-add-sequence function) @@ -38850,11 +38887,32 @@ ;; manipulator ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++manipulator:manipulator-mode +(defenum manipulator-mode + :type uint32 + (mm0 0) + (mm1 1) + ) +;; ---manipulator:manipulator-mode + +;; +++manipulator:manipulator-action +(defenum manipulator-action + :type uint32 + (ma0 0) + (ma1 1) + (ma2 2) + (ma3 3) + (ma4 4) + (ma5 5) + (ma6 6) + (ma7 7) + ) +;; ---manipulator:manipulator-action + (deftype manipulator (structure) - ((action uint32 :offset-assert 0) - (mode uint32 :offset-assert 4) - (dragging? basic :offset-assert 8) + ((action manipulator-action :offset-assert 0) + (mode manipulator-mode :offset-assert 4) + (dragging? symbol :offset-assert 8) (position vector :inline :offset-assert 16) (speed vector :inline :offset-assert 32) (drag-ref-position vector :inline :offset-assert 48) @@ -38867,23 +38925,127 @@ :size-assert #xb0 :flag-assert #xf000000b0 (:methods - (manipulator-method-9 () none) ;; 9 - (manipulator-method-10 () none) ;; 10 - (manipulator-method-11 () none) ;; 11 - (manipulator-method-12 () none) ;; 12 - (manipulator-method-13 () none) ;; 13 - (manipulator-method-14 () none) ;; 14 + (set-mode (_type_ manipulator-mode) none) ;; 9 + (manipulator-method-10 (_type_) none) ;; 10 + (manipulator-method-11 (_type_) none) ;; 11 + (manipulator-method-12 (_type_ vector) none) ;; 12 + (manipulator-method-13 (_type_ vector vector) none) ;; 13 + (manipulator-method-14 (_type_) none) ;; 14 ) ) -|# -;; (define-extern draw-axis function) +(define-extern draw-axis (function vector vector float float rgba none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; editable-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++editable-h:editable-command +(defenum editable-command + :type uint32 + (none 0) + (exit 1) + (kill 2) + (select-one 3) + (select-add 4) + (select-remove 5) + (select-toggle 6) + (select-all 7) + (select-none 8) + (select-region 9) + (select-face 10) + (select-prim 11) + (select-current-owner 12) + (select-current-region 13) + (select-current-face 14) + (select-current-prim 15) + (pick-target 16) + (pick-loc 17) + (pick-yes-no 18) + (cancel 19) + (drag-none 20) + (drag-move 21) + (drag-scale 22) + (drag-rotate 23) + (drag-resize 24) + (camera-tumble 25) + (camera-xz 26) + (camera-xy 27) + (camera-rotate 28) + (camera-move 29) + (camera-zoom 30) + (insert-sphere 31) + (insert-point 32) + (insert-sample 33) + (insert-simple-camera 34) + (insert-light 35) + (insert-entity 36) + (insert-face 37) + (insert-plane 38) + (insert-box 39) + (insert-wall 40) + (delete 41) + (copy 42) + (resize 43) + (snap-to-ground 44) + (snap-xz 45) + (snap-y 46) + (snap-rotate 47) + (flip-side 48) + (region-set 49) + (region-new 50) + (edit-plane-set 51) + (edit-plane-clear 52) + (delete-region 53) + (copy-region 54) + (region-add 55) + (save 56) + (load 57) + (update-game 58) + (print-region-info 59) + (refresh-filter 60) + (rotate-level 61) + (translate-y-level 62) + (select-user0 63) + (select-user1 64) + (select-user2 65) + (select-user3 66) + (select-user4 67) + (select-user5 68) + (select-user6 69) + (select-user7 70) + (select-user8 71) + (select-user9 72) + (select-user10 73) + (select-user11 74) + (select-user12 75) + ) +;; ---editable-h:editable-command + +;; +++editable-h:editable-filter +(defenum editable-filter + :type uint32 + :bitfield #t + (none 0) + (unknown 1) + (sound 2) + (part 3) + (user-setting 4) + (cam-setting 5) + (load 6) + (water-command 7) + (camera 8) + (target 9) + (water 10) + (data 11) + (city_vis 12) + (sample 13) + (light 14) + (entity 15) + (selected 16) + ) +;; ---editable-h:editable-filter + (deftype editable-region (basic) ((changed symbol :offset-assert 4) ;; guessed by decompiler (locked symbol :offset-assert 8) ;; guessed by decompiler @@ -38900,16 +39062,33 @@ :flag-assert #xd00000030 ;; field on-enter uses ~A with a signed load. field on-inside uses ~A with a signed load. field on-exit uses ~A with a signed load. (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type) _type_) + (new (symbol type) _type_) ;; 0 (editable-region-method-9 () none) ;; 9 ;; (editable-region-method-9 (_type_ editable-array int int) symbol) (editable-region-method-10 () none) ;; 10 ;; (editable-region-method-10 (_type_ int) symbol) (editable-region-method-11 () none) ;; 11 ;; (editable-region-method-11 (_type_ vector int) none) (editable-region-method-12 () none) ;; 12 ;; (editable-region-method-12 (_type_) editable-filter) ) ) -|# -#| +;; +++editable-h:editable-flag +(defenum editable-flag + :type uint32 + :bitfield #t + (selected) + (no-save) + (orient) + (x) + (y) + (z) + (no-plane-snap) + (no-update) + (mark) + (top-set) + (bot-set) + (changed) + ) +;; ---editable-h:editable-flag + (deftype editable (basic) ((flags editable-flag :offset-assert 4) (name string :offset-assert 8) ;; guessed by decompiler @@ -38951,9 +39130,8 @@ (editable-method-35 () none) ;; 35 ) ) -|# -#| +(declare-type editable-plane editable) (deftype editable-array (basic) ((allocated-length int32 :offset-assert 4) (length int32 :offset-assert 8) @@ -38976,13 +39154,12 @@ (level uint32 :offset-assert 116) ;; guessed by decompiler (edit-param0 float :offset-assert 120) (data editable :dynamic :offset-assert 124) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. ) :method-count-assert 20 :size-assert #x7c :flag-assert #x140000007c (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type int) _type_) + (new (symbol type int) _type_) ;; 0 (editable-array-method-9 () none) ;; 9 ;; (editable-array-method-9 (_type_ editable-command mouse-info) symbol) (editable-array-method-10 () none) ;; 10 ;; (editable-array-method-10 (_type_ vector int) editable) (editable-array-method-11 () none) ;; 11 ;; (editable-array-method-11 (_type_) int) @@ -38996,137 +39173,104 @@ (editable-array-method-19 () none) ;; 19 ) ) -|# -#| (deftype editable-point (editable) - ((flags editable-flag :offset-assert 0) - (name string :offset-assert 4) ;; guessed by decompiler - (id uint32 :offset-assert 8) - (region editable-region :offset-assert 12) ;; guessed by decompiler - (owner pair :offset-assert 16) ;; guessed by decompiler - (prefix basic :offset-assert 20) - (radius meters :offset-assert 24) ;; float - (trans vector :inline :offset-assert 28) + ((radius meters :offset-assert 28) ;; float + (trans vector :inline :offset-assert 32) ) :method-count-assert 36 :size-assert #x30 :flag-assert #x2400000030 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type vector editable-region) _type_) + (new (symbol type vector editable-region) _type_) ;; 0 ) ) -|# -#| (deftype editable-sphere (editable-point) () :method-count-assert 36 :size-assert #x30 :flag-assert #x2400000030 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type vector float editable-region) _type_) + (new (symbol type vector float editable-region) _type_) ;; 0 ) ) -|# -#| (deftype editable-sample (editable-point) () :method-count-assert 36 :size-assert #x30 :flag-assert #x2400000030 ) -|# -#| (deftype editable-light (editable-sphere) - ((direction vector :inline :offset-assert 44) - (color vector :inline :offset-assert 60) - (decay-start float :offset-assert 76) - (ambient-point-ratio float :offset-assert 80) - (brightness float :offset-assert 84) - (shadow uint32 :offset-assert 44) - (shadows UNKNOWN 5 :offset-assert 88) - (shadow-ambi float :offset-assert 88) - (shadow-dir0 float :offset-assert 92) - (shadow-dir1 float :offset-assert 96) - (shadow-dir2 float :offset-assert 100) - (shadow-dir3 float :offset-assert 104) + ((direction vector :inline :offset-assert 48) + (color vector :inline :offset-assert 64) + (decay-start float :offset-assert 80) + (ambient-point-ratio float :offset-assert 84) + (brightness float :offset-assert 88) + (shadow uint32 :offset 48) + (shadows float 5 :offset-assert 92) + (shadow-ambi float :offset 92) + (shadow-dir0 float :offset 96) + (shadow-dir1 float :offset 100) + (shadow-dir2 float :offset 104) + (shadow-dir3 float :offset 108) ) :method-count-assert 36 :size-assert #x70 :flag-assert #x2400000070 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type vector float editable-region) _type_) + (new (symbol type vector float editable-region) _type_) ;; 0 ) ) -|# -#| (deftype editable-entity (editable-point) - ((angles euler-angles :inline :offset-assert 44) - (idx int32 :offset-assert 60) + ((angles euler-angles :inline :offset-assert 48) + (idx int32 :offset-assert 64) ) :method-count-assert 37 :size-assert #x44 :flag-assert #x2500000044 (:methods + (new (symbol type vector float editable-region) _type_) ;; 0 (editable-entity-method-36 () none) ;; 36 ) ) -|# -#| (deftype editable-face (editable) - ((flags editable-flag :offset-assert 0) - (name string :offset-assert 4) ;; guessed by decompiler - (id uint32 :offset-assert 8) - (region editable-region :offset-assert 12) ;; guessed by decompiler - (owner pair :offset-assert 16) ;; guessed by decompiler - (prefix basic :offset-assert 20) - (length int32 :offset-assert 24) - (normal vector :inline :offset-assert 28) - (center vector :inline :offset-assert 44) - (vertex editable-point 6 :offset-assert 60) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ((length int32 :offset-assert 28) + (normal vector :inline :offset-assert 32) + (center vector :inline :offset-assert 48) + (vertex editable-point 6 :offset-assert 64) ;; guessed by decompiler ) :method-count-assert 38 :size-assert #x58 :flag-assert #x2600000058 (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type editable-region) _type_) + (new (symbol type editable-region) _type_) ;; 0 (editable-face-method-36 () none) ;; 36 (editable-face-method-37 () none) ;; 37 ) ) -|# -#| (deftype editable-plane (editable) - ((flags editable-flag :offset-assert 0) - (name string :offset-assert 4) ;; guessed by decompiler - (id uint32 :offset-assert 8) - (region editable-region :offset-assert 12) ;; guessed by decompiler - (owner pair :offset-assert 16) ;; guessed by decompiler - (prefix basic :offset-assert 20) - (length int32 :offset-assert 24) - (radius meters :offset-assert 28) ;; float - (vertex editable-point 2 :offset-assert 32) ;; guessed by decompiler - (UNKNOWN UNKNOWN :offset-assert -1) ;; field could not be read. + ((length int32 :offset-assert 28) + (radius meters :offset-assert 32) ;; float + (vertex editable-point 2 :offset-assert 36) ;; guessed by decompiler ) :method-count-assert 38 :size-assert #x2c :flag-assert #x260000002c (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type editable-region) _type_) + (new (symbol type editable-region) _type_) ;; 0 (editable-plane-method-36 () none) ;; 36 (editable-plane-method-37 () none) ;; 37 ) ) -|# -#| +(declare-type editable-player process-drawable) +(declare-type editable-array basic) (deftype editable-player (process-drawable) ((current editable-array :offset-assert 200) ;; guessed by decompiler (current-command uint32 :offset-assert 204) @@ -39137,11 +39281,11 @@ (light-names basic :offset-assert 224) (external-cam-mode symbol :offset-assert 228) ;; guessed by decompiler (command editable-command 6 :offset-assert 232) ;; guessed by decompiler - (close-menu-time uint64 :offset-assert 256) ;; time-frame + (close-menu-time time-frame :offset-assert 256) ;; time-frame (mouse-pos vector :inline :offset-assert 272) (mouse-end vector :inline :offset-assert 288) (manipulator manipulator :inline :offset-assert 304) - (mouse-box UNKNOWN 2 :offset-assert 480) + (mouse-box vector 2 :inline :offset-assert 480) (mouse-hit vector :inline :offset-assert 512) (mouse-normal vector :inline :offset-assert 528) (float-variable float :offset-assert 544) @@ -39160,15 +39304,13 @@ (editable-player-method-23 () none) ;; 23 ) ) -|# -#| (deftype editable-work (basic) ((num-found int16 :offset-assert 4) (last-found int16 :offset-assert 6) (last-x float :offset-assert 8) (last-y float :offset-assert 12) - (hide basic :offset-assert 16) + (hide symbol :offset-assert 16) (found editable 256 :offset-assert 20) ;; guessed by decompiler (dists uint32 256 :offset-assert 1044) ;; guessed by decompiler ) @@ -39176,14 +39318,13 @@ :size-assert #x814 :flag-assert #x900000814 ) -|# -;; (define-extern *editable-temp-id* object) ;; int -;; (define-extern *editable-default-name* object) -;; (define-extern editable-command->string function) ;; (function editable-command string) -;; (define-extern editable-filter->string function) ;; (function editable-filter basic string) -;; (define-extern *editable-work* object) ;; editable-work -;; (define-extern *editable* object) ;; (pointer editable-player) +(define-extern *editable-temp-id* int) +(define-extern *editable-default-name* string) +(define-extern editable-command->string (function editable-command string)) +(define-extern editable-filter->string (function editable-filter basic string)) +(define-extern *editable-work* editable-work) +(define-extern *editable* (pointer editable-player)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; editable ;; @@ -39210,10 +39351,10 @@ ;; (define-extern get-light-value function) ;; (define-extern set-light-value function) ;; (define-extern keybd-set-time-of-day! function) -;; (define-extern editable-player-init function) ;; (function symbol none :behavior editable-player) +(define-extern editable-player-init (function symbol none :behavior editable-player)) ;; (define-extern set-editable-name function) ;; (define-extern select-editable-by-name function) -;; (define-extern *editable-menu-context* object) ;; debug-menu-context +(define-extern *editable-menu-context* debug-menu-context) ;; (define-extern editable-menu-command function) ;; (function int none) ;; (define-extern editable-menu-command-no-close function) ;; (function int none) ;; (define-extern dm-region-tree-pick-func function) ;; (function symbol debug-menu-msg symbol) @@ -39231,7 +39372,30 @@ ;; mysql-nav-graph ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++mysql-nav-graph:mysql-save-flag +(defenum mysql-save-flag + :type uint32 + :bitfield #t + (delete 1) + (update 2) + (insert 3) + ) +;; ---mysql-nav-graph:mysql-save-flag + +;; +++mysql-nav-graph:nav-node-flag +(defenum nav-node-flag + "This string value is stored in their SQL database" + :type uint32 + :bitfield #t + (visited 0) + (blocked 1) + (pedestrian 2) + (selected 3) + (hidden 4) + ) +;; ---mysql-nav-graph:nav-node-flag + +(declare-type mysql-nav-edge structure) (deftype mysql-nav-node (structure) ((mysql-save-flag mysql-save-flag :offset-assert 0) ;; guessed by decompiler (runtime-id uint32 :offset-assert 4) @@ -39258,9 +39422,7 @@ (mysql-nav-node-method-10 () none) ;; 10 ;; (temp-edge-size (_type_) int) ) ) -|# -#| (deftype mysql-nav-node-array (inline-array-class) ((data mysql-nav-node :dynamic :offset-assert 16) ;; guessed by decompiler ) @@ -39268,9 +39430,45 @@ :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| +;; +++mysql-nav-graph:nav-directionality +(defenum nav-directionality + :type uint32 + :bitfield #f + (default 0) + (directed 1) + (bi_directional 2) + ) +;; ---mysql-nav-graph:nav-directionality + +;; +++mysql-nav-graph:nav-clock-mask +(defenum nav-clock-mask + "This string value is stored in their SQL database" + :type uint32 + :bitfield #t + (phase-1 0) + (phase-1a 1) + (phase-2 2) + (phase-2a 3) + (phase-3 4) + (phase-3a 5) + (phase-4 6) + (phase-4a 7) + ) +;; ---mysql-nav-graph:nav-clock-mask + +;; +++mysql-nav-graph:nav-clock-type +(defenum nav-clock-type + "This string value is stored in their SQL database" + :type uint32 + :bitfield #f + (no-clock 0) + (clock2 1) + (clock3 2) + (clock4 3) + ) +;; ---mysql-nav-graph:nav-clock-type + (deftype mysql-nav-edge (structure) ((mysql-save-flag mysql-save-flag :offset-assert 0) ;; guessed by decompiler (runtime-id uint32 :offset-assert 4) @@ -39292,6 +39490,7 @@ (width float :offset-assert 68) (minimap_edge_flag int32 :offset-assert 72) ;; nav-minimap-edge-flag ) + :allow-misaligned :method-count-assert 10 :size-assert #x4c :flag-assert #xa0000004c @@ -39299,19 +39498,15 @@ (mysql-nav-edge-method-9 () none) ;; 9 ;; (exec-sql! (_type_) symbol) ) ) -|# -#| (deftype mysql-nav-edge-array (inline-array-class) - ((data mysql-nav-edge :dynamic :offset-assert 16) ;; guessed by decompiler + ((data mysql-nav-edge :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype mysql-nav-visnode (structure) ((mysql-save-flag mysql-save-flag :offset-assert 0) ;; guessed by decompiler (runtime-node-id int32 :offset-assert 4) @@ -39328,19 +39523,15 @@ (mysql-nav-visnode-method-9 () none) ;; 9 ;; (exec-sql! (_type_) symbol) ) ) -|# -#| (deftype mysql-nav-visnode-array (inline-array-class) - ((data mysql-nav-visnode :dynamic :offset-assert 16) ;; guessed by decompiler + ((data mysql-nav-visnode :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype mysql-nav-pov-conn (structure) ((runtime-node-id-1 int32 :offset-assert 0) (runtime-node-id-2 int32 :offset-assert 4) @@ -39349,9 +39540,7 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype mysql-nav-graph-level-info (structure) ((level symbol :offset-assert 0) ;; guessed by decompiler (level-id uint32 :offset-assert 4) @@ -39359,13 +39548,12 @@ (branch-count int32 :offset-assert 12) (to-link-count int32 :offset-assert 16) ) + :allow-misaligned :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype mysql-nav-graph (basic) ((nav_graph_id uint32 :offset-assert 4) (graph-type basic :offset-assert 8) @@ -39376,7 +39564,7 @@ (pov-conn-array-length int32 :offset-assert 28) (level-info-array-length int32 :offset-assert 32) (level-info-last-lookup int32 :offset-assert 36) - (level-info-array mysql-nav-graph-level-info 32 :offset-assert 40) ;; guessed by decompiler + (level-info-array mysql-nav-graph-level-info 32 :inline :offset-assert 40) ;; guessed by decompiler ) :method-count-assert 24 :size-assert #x428 @@ -39400,14 +39588,11 @@ (mysql-nav-graph-method-23 () none) ;; 23 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-graph-editor ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-graph-command (structure) ((com-type uint32 :offset-assert 0) (id int32 :offset-assert 4) @@ -39418,19 +39603,15 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype nav-graph-command-array (inline-array-class) - ((data nav-graph-command :dynamic :offset-assert 16) ;; guessed by decompiler + ((data nav-graph-command :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype nav-graph-editor (process) ((nav-graph mysql-nav-graph :offset-assert 128) ;; guessed by decompiler (mode symbol :offset-assert 132) ;; guessed by decompiler @@ -39464,6 +39645,23 @@ :method-count-assert 68 :size-assert #x1cc :flag-assert #x44015001cc + (:state-methods + move-node ;; 14 + move-plane ;; 15 + create ;; 16 + edit-edge ;; 17 + create-edge ;; 18 + adjust-plane ;; 19 + adjust-it ;; 20 + adjust-minimap ;; 21 + adjust-node-angle ;; 22 + adjust-node-radius ;; 23 + adjust-edge-visibility ;; 24 + adjust-edge-width ;; 25 + adjust-edge-density ;; 26 + draw-closest-minimap ;; 27 + create-pov ;; 28 + ) (:methods (nav-graph-editor-method-29 () none) ;; 29 ;; (nav-graph-editor-method-29 (_type_ string string string) none) (nav-graph-editor-method-30 () none) ;; 30 ;; (nav-graph-editor-method-30 (_type_ int) symbol) @@ -39505,32 +39703,14 @@ (nav-graph-editor-method-66 () none) ;; 66 (nav-graph-editor-method-67 () none) ;; 67 ) - (:state-methods - create-pov ;; 28, old: (nav-graph-editor-method-28 (_type_) none) - create ;; 16, old: (create () _type_ :state) - move-node ;; 14, old: (move-node () _type_ :state) - draw-closest-minimap ;; 27, old: (draw-closest-minimap () _type_ :state) - adjust-plane ;; 19, old: (adjust-plane () _type_ :state) - move-plane ;; 15, old: (move-plane () _type_ :state) - create-edge ;; 18, old: (create-edge () _type_ :state) - edit-edge ;; 17, old: (edit-edge () _type_ :state) - adjust-edge-visibility ;; 24, old: (adjust-edge-visibility () _type_ :state) - adjust-node-angle ;; 22, old: (adjust-node-angle () _type_ :state) - adjust-node-radius ;; 23, old: (adjust-node-radius () _type_ :state) - adjust-edge-width ;; 25, old: (adjust-edge-width () _type_ :state) - adjust-edge-density ;; 26, old: (adjust-edge-density () _type_ :state) - adjust-it ;; 20, old: (adjust-it () _type_ :state) - adjust-minimap ;; 21, old: (adjust-minimap () _type_ :state) - ) ) -|# -;; (define-extern *nav-graph-editor* object) ;; (pointer nav-graph-editor) +(define-extern *nav-graph-editor* (pointer nav-graph-editor)) ;; (define-extern get-node-draw-position function) ;; (define-extern nav-graph-editor-init-by-other function) ;; (function string none :behavior nav-graph-editor) -;; (define-extern run-nav-graph-editor function) ;; (function symbol (pointer process)) -;; (define-extern get-nav-graph-editor function) ;; (function nav-graph-editor) -;; (define-extern exit-nav-graph-editor function) ;; (function none) +(define-extern run-nav-graph-editor (function symbol (pointer process))) +(define-extern get-nav-graph-editor (function nav-graph-editor)) +(define-extern exit-nav-graph-editor (function none)) ;; (define-extern nav-graph-set-level function) ;; (define-extern set-minimap-edge-flag function) ;; (function nav-minimap-edge-flag uint) ;; (define-extern set-vehicle-edit-mode function) ;; (function symbol none) @@ -39547,17 +39727,14 @@ ;; vector-array is already defined! -#| (deftype int16-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data int16 :dynamic :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype nav-mesh-poly (structure) ((poly-id uint32 :offset-assert 0) (flags uint32 :offset-assert 4) @@ -39568,6 +39745,7 @@ :size-assert #x10 :flag-assert #xf00000010 (:methods + (new (symbol type) _type_) ;; 0 (nav-mesh-poly-method-9 () none) ;; 9 (nav-mesh-poly-method-10 () none) ;; 10 (nav-mesh-poly-method-11 () none) ;; 11 @@ -39576,50 +39754,42 @@ (nav-mesh-poly-method-14 () none) ;; 14 ) ) -|# -#| (deftype nav-mesh-poly-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data nav-mesh-poly :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype nav-mesh-tri-quad (structure) - ((indices UNKNOWN 4 :offset-assert 0) + ((indices int32 4 :offset-assert 0) (poly uint32 :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype nav-mesh-tri-quad-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data nav-mesh-tri-quad :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype nav-mesh-editable (structure) ((flags uint32 :offset-assert 0) (verts basic :offset-assert 4) (tris basic :offset-assert 8) - (quads basic :offset-assert 12) + (quads nav-mesh-tri-quad-array :offset-assert 12) (navmesh-id uint32 :offset-assert 16) (idx uint32 :offset-assert 20) - (level-name basic :offset-assert 24) + (level-name symbol :offset-assert 24) (level-id uint32 :offset-assert 28) - (polys basic :offset-assert 32) + (polys nav-mesh-poly-array :offset-assert 32) (selected-poly uint32 :offset-assert 36) ) :method-count-assert 19 @@ -39638,19 +39808,15 @@ (nav-mesh-editable-method-18 () none) ;; 18 ) ) -|# -#| (deftype nav-mesh-editable-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data nav-mesh-editable :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype nav-mesh-editor-undo (structure) ((current-nav-mesh nav-mesh-editable :offset-assert 0) (selected-poly uint32 :offset-assert 4) @@ -39662,22 +39828,19 @@ :size-assert #x14 :flag-assert #xa00000014 (:methods + (new (symbol type) _type_) ;; 0 (nav-mesh-editor-undo-method-9 () none) ;; 9 ) ) -|# -#| (deftype nav-mesh-editor-undo-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data nav-mesh-editor-undo :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype nav-mesh-editor (process-drawable) ((close-menu-time uint64 :offset-assert 200) (external-cam-mode basic :offset-assert 208) @@ -39723,9 +39886,8 @@ (nav-mesh-editor-method-27 () none) ;; 27 ) ) -|# -;; (define-extern *nav-mesh-editor* object) +(define-extern *nav-mesh-editor* nav-mesh-editor) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-mesh-editor ;; @@ -39765,37 +39927,35 @@ ;; (define-extern nav-mesh-editor-set-level function) ;; (define-extern nav-set-lev function) ;; (define-extern nav-set-flag function) -;; (define-extern nav-mesh-editor-init function) +(define-extern nav-mesh-editor-init (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bug-report ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bug-report (process) - ((bug-number UNKNOWN 5 :offset-assert 128) + ((bug-number uint32 5 :offset-assert 128) (digit uint32 :offset-assert 148) - (state-time uint64 :offset-assert 152) - (next-down uint64 :offset-assert 160) + (state-time time-frame :offset-assert 152) + (next-down time-frame :offset-assert 160) ) :method-count-assert 17 :size-assert #xa8 :flag-assert #x11003000a8 - (:methods - (bug-report-method-15 () none) ;; 15 - (bug-report-method-16 () none) ;; 16 - ) (:state-methods idle ;; 14 ) + (:methods + (bug-report-method-15 (_type_) none) ;; 15 + (bug-report-method-16 (_type_) none) ;; 16 + ) ) -|# -;; (define-extern *continue-bug-report* continue-point) -;; (define-extern *bug-report* object) -;; (define-extern bug-report-init function) -;; (define-extern bug-report-stop function) -;; (define-extern bug-report-start function) +(define-extern *continue-bug-report* continue-point) +(define-extern *bug-report* (pointer bug-report)) +(define-extern bug-report-init (function object :behavior bug-report)) +(define-extern bug-report-stop (function none)) +(define-extern bug-report-start (function none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sampler ;; @@ -39812,108 +39972,110 @@ ;; default-menu ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *debug-menu-context* object) ;; debug-menu-context -;; (define-extern *dm-cam-mode-interpolation* object) ;; int -;; (define-extern dm-cam-mode-func function) ;; (function (state camera-slave) debug-menu-msg object) -;; (define-extern dm-cam-mode-default function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-cam-settings-default function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-cam-settings-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-cam-settings-func-int function) ;; (function int debug-menu-msg int int int) -;; (define-extern dm-cam-externalize function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-cam-setting-float function) ;; (function float debug-menu-msg float float float) -;; (define-extern dm-cam-render-float function) ;; (function int debug-menu-msg float float float) -;; (define-extern dm-subdiv-float function) ;; (function symbol debug-menu-msg float float float) -;; (define-extern dm-subdiv-int function) ;; (function symbol debug-menu-msg int int int) -;; (define-extern dm-select-race-path function) ;; (function object debug-menu-msg int int) -;; (define-extern dm-setting-language function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-setting-subtitle-language function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-setting-audio-language function) -;; (define-extern dm-setting-stereo-mode function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-current-continue function) ;; (function string debug-menu-msg symbol) -;; (define-extern dm-subdiv-draw-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-scissor-subdiv-draw-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-foreground-subdiv-draw-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-col-rend-on-func function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-col-rend-outline-func function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-col-rend-back-face-func function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-col-rend-normals-func function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-col-rend-ghost-hidden-func function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-col-rend-track-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-col-rend-show-only-toggle-func function) ;; (function uint debug-menu-msg symbol) -;; (define-extern dm-col-rend-show-only-set-func function) ;; (function uint debug-menu-msg symbol) -;; (define-extern dm-col-rend-cspec-toggle function) ;; (function uint debug-menu-msg symbol) -;; (define-extern dm-col-rend-size function) ;; (function object debug-menu-msg float float) -;; (define-extern dm-col-rend-cam-dist function) ;; (function object debug-menu-msg float float) -;; (define-extern dm-ocean-height-func function) ;; (function ocean-height-hack debug-menu-msg symbol) -;; (define-extern dm-ocean-subdiv-draw-func function) ;; (function object debug-menu-msg symbol) -;; (define-extern dm-time-of-day-func function) ;; (function dm-time-of-day-setting debug-menu-msg symbol) -;; (define-extern dm-time-of-day-func2 function) ;; (function symbol debug-menu-msg object) -;; (define-extern dm-time-of-day-palette-func function) ;; (function dm-time-of-day-palette-settings debug-menu-msg symbol) -;; (define-extern dm-boolean-toggle-pick-func function) ;; (function symbol debug-menu-msg object) -;; (define-extern dm-time-of-day-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-stats-memory-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-actor-marks-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-debug-actor-lod-dist function) -;; (define-extern dm-select-race-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-compact-actor-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-actor-vis-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-game-mode-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-game-feature-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-game-vehicle-toggle-pick-func function) -;; (define-extern dm-game-secret-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern display-scene-control-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern display-scene-control-set-pick-func function) ;; (function scene-controls debug-menu-msg symbol) -;; (define-extern display-bot-marks-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern display-bot-marks-set-pick-func function) ;; (function bot-marks-controls debug-menu-msg symbol) -;; (define-extern display-race-marks-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern display-race-marks-set-pick-func function) ;; (function race-marks-controls debug-menu-msg symbol) -;; (define-extern dm-vu1-user-toggle-pick-func function) ;; (function vu1-renderer-mask debug-menu-msg symbol) -;; (define-extern dm-vu1-user-all-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-vu1-user-none-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-texture-user-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-texture-user-set-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-strip-lines-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern dm-strip-lines-set-pick-func function) ;; (function strip-lines-controls debug-menu-msg symbol) -;; (define-extern dm-edit-instance-toggle-pick-func function) ;; (function int debug-menu-msg symbol) -;; (define-extern all-texture-tweak-adjust function) ;; (function texture-page-dir float none) -;; (define-extern dm-float-field-tie-rvanish-func function) ;; (function symbol debug-menu-msg float float float) -;; (define-extern dm-float-field-tie-vanish-far-func function) ;; (function symbol debug-menu-msg float float float) -;; (define-extern dm-bug-report-output-pick-func function) ;; (function symbol debug-menu-msg symbol) -;; (define-extern dm-bug-report-report-pick-func function) ;; (function symbol debug-menu-msg none) -;; (define-extern debug-menu-node texture_animator = nullptr; // todo tex anim { auto p = scoped_prof("render-inits"); - // for now, for any unset renderers, just set them to an EmptyBucketRenderer. + + m_blit_displays = + init_bucket_renderer("blit", BucketCategory::OTHER, BucketId::BLIT_START); + + // 4 + init_bucket_renderer("tex-lcom-sky-pre", BucketCategory::TEX, + BucketId::TEX_LCOM_SKY_PRE, texture_animator); + + // 10 + for (int i = 0; i < LEVEL_MAX; i++) { +#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx)) + // 10 + init_bucket_renderer( + fmt::format("tex-l{}-tfrag", i), BucketCategory::TEX, + GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_TFRAG, BucketId::TEX_L1_TFRAG, i), + texture_animator); + // 11 + init_bucket_renderer( + fmt::format("tfrag-l{}-tfrag", i), BucketCategory::TFRAG, + GET_BUCKET_ID_FOR_LIST(BucketId::TFRAG_L0_TFRAG, BucketId::TFRAG_L1_TFRAG, i), + std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, i, anim_slot_array()); + Tie3* tie = init_bucket_renderer( + fmt::format("tie-l{}-tfrag", i), BucketCategory::TIE, + GET_BUCKET_ID_FOR_LIST(BucketId::TIE_L0_TFRAG, BucketId::TIE_L1_TFRAG, i), i); + init_bucket_renderer( + fmt::format("etie-l{}-tfrag", i), BucketCategory::TIE, + GET_BUCKET_ID_FOR_LIST(BucketId::ETIE_L0_TFRAG, BucketId::ETIE_L1_TFRAG, i), tie, + tfrag3::TieCategory::NORMAL_ENVMAP); + + // 17 + init_bucket_renderer( + fmt::format("merc-l{}-tfrag", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_TFRAG, BucketId::MERC_L1_TFRAG, i), m_merc2); + + init_bucket_renderer( + fmt::format("tex-l{}-shrub", i), BucketCategory::TEX, + GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_SHRUB, BucketId::TEX_L1_SHRUB, i), + m_texture_animator); + init_bucket_renderer( + fmt::format("shrub-l{}-shrub", i), BucketCategory::SHRUB, + GET_BUCKET_ID_FOR_LIST(BucketId::SHRUB_L0_SHRUB, BucketId::SHRUB_L1_SHRUB, i)); + init_bucket_renderer( + fmt::format("merc-l{}-shrub", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_SHRUB, BucketId::MERC_L1_SHRUB, i), m_merc2); + + // 230 + init_bucket_renderer( + fmt::format("tex-l{}-alpha", i), BucketCategory::TEX, + GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_ALPHA, BucketId::TEX_L1_ALPHA, i), + m_texture_animator); + init_bucket_renderer( + fmt::format("tfrag-t-l{}-alpha", i), BucketCategory::TFRAG, + GET_BUCKET_ID_FOR_LIST(BucketId::TFRAG_L0_ALPHA, BucketId::TFRAG_L1_ALPHA, i), + std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, i, anim_slot_array()); + init_bucket_renderer( + fmt::format("tie-t-l{}-alpha", i), BucketCategory::TIE, + GET_BUCKET_ID_FOR_LIST(BucketId::TIE_L0_ALPHA, BucketId::TIE_L1_ALPHA, i), tie, + tfrag3::TieCategory::TRANS); + init_bucket_renderer( + fmt::format("etie-l{}-alpha", i), BucketCategory::TIE, + GET_BUCKET_ID_FOR_LIST(BucketId::ETIE_L0_ALPHA, BucketId::ETIE_L1_ALPHA, i), tie, + tfrag3::TieCategory::TRANS_ENVMAP); + init_bucket_renderer( + fmt::format("merc-l{}-alpha", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_ALPHA, BucketId::MERC_L1_ALPHA, i), m_merc2); + init_bucket_renderer( + fmt::format("tie-w-l{}-water", i), BucketCategory::TIE, + GET_BUCKET_ID_FOR_LIST(BucketId::TIE_L0_WATER, BucketId::TIE_L1_WATER, i), tie, + tfrag3::TieCategory::WATER); + init_bucket_renderer( + fmt::format("etie-l{}-water", i), BucketCategory::TIE, + GET_BUCKET_ID_FOR_LIST(BucketId::ETIE_L0_WATER, BucketId::ETIE_L1_WATER, i), tie, + tfrag3::TieCategory::WATER_ENVMAP); + } + + // 340 + init_bucket_renderer("tex-lcom-tfrag", BucketCategory::TEX, + BucketId::TEX_LCOM_TFRAG, texture_animator); + init_bucket_renderer("merc-lcom-tfrag", BucketCategory::MERC, + BucketId::MERC_LCOM_TFRAG, m_merc2); + // 345 + init_bucket_renderer("tex-lcom-shrub", BucketCategory::TEX, + BucketId::TEX_LCOM_SHRUB, texture_animator); + init_bucket_renderer("merc-lcom-shrub", BucketCategory::MERC, + BucketId::MERC_LCOM_SHRUB, m_merc2); + // 351 + for (int i = 0; i < LEVEL_MAX; i++) { +#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx)) + init_bucket_renderer( + fmt::format("tex-l{}-pris", i), BucketCategory::TEX, + GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_PRIS, BucketId::TEX_L1_PRIS, i), + texture_animator); + init_bucket_renderer( + fmt::format("tex-l{}-pris2", i), BucketCategory::TEX, + GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_PRIS2, BucketId::TEX_L1_PRIS2, i), + texture_animator); + + init_bucket_renderer( + fmt::format("merc-l{}-pris", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_PRIS, BucketId::MERC_L1_PRIS, i), m_merc2); + + init_bucket_renderer( + fmt::format("merc-l{}-pris2", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_PRIS2, BucketId::MERC_L1_PRIS2, i), m_merc2); + } + + // 401 + init_bucket_renderer("tex-lcom-pris", BucketCategory::TEX, + BucketId::TEX_LCOM_PRIS, texture_animator); + init_bucket_renderer("merc-lcom-pris", BucketCategory::MERC, + BucketId::MERC_LCOM_PRIS, m_merc2); + + // 461 + init_bucket_renderer("tex-lcom-sky-post", BucketCategory::TEX, + BucketId::TEX_LCOM_SKY_POST, texture_animator); + + // 463 + for (int i = 0; i < LEVEL_MAX; i++) { +#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx)) + // 463 + init_bucket_renderer( + fmt::format("tex-l{}-water", i), BucketCategory::TEX, + GET_BUCKET_ID_FOR_LIST(BucketId::TEX_L0_WATER, BucketId::TEX_L1_WATER, i), + texture_animator); + init_bucket_renderer( + fmt::format("merc-l{}-water", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_WATER, BucketId::MERC_L1_WATER, i), m_merc2); + // 466 + init_bucket_renderer( + fmt::format("tfrag-l{}-water", i), BucketCategory::TFRAG, + GET_BUCKET_ID_FOR_LIST(BucketId::TFRAG_L0_WATER, BucketId::TFRAG_L1_WATER, i), + std::vector{tfrag3::TFragmentTreeKind::WATER}, false, i, anim_slot_array()); + } + + // 563 + init_bucket_renderer("tex-lcom-water", BucketCategory::TEX, + BucketId::TEX_LCOM_WATER, texture_animator); + init_bucket_renderer("merc-lcom-water", BucketCategory::MERC, + BucketId::MERC_LCOM_WATER, m_merc2); + + // 568 + init_bucket_renderer("tex-sprite", BucketCategory::TEX, + BucketId::TEX_SPRITE, texture_animator); + init_bucket_renderer("particles", BucketCategory::SPRITE, BucketId::PARTICLES); + // 575 + init_bucket_renderer("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP, + texture_animator); + + init_bucket_renderer("debug-no-zbuf1", BucketCategory::OTHER, + BucketId::DEBUG_NO_ZBUF1, m_texture_animator, true); + // 578 + init_bucket_renderer("tex-hud-hud-alpha", BucketCategory::TEX, + BucketId::TEX_HUD_HUD_ALPHA, texture_animator); + + // init_bucket_renderer("tex-hud-hud-alpha", BucketCategory::TEX, + // BucketId::TEX_HUD_HUD_ALPHA, texture_animator); + + // 583 + init_bucket_renderer("debug", BucketCategory::OTHER, BucketId::DEBUG, 0x8000); + // 584 + init_bucket_renderer("debug-no-zbuf2", BucketCategory::OTHER, + BucketId::DEBUG_NO_ZBUF2, 0x8000); + init_bucket_renderer("debug-menu", BucketCategory::OTHER, BucketId::DEBUG_MENU, + 0x8000); + + // for any unset renderers, just set them to an EmptyBucketRenderer. for (size_t i = 0; i < m_bucket_renderers.size(); i++) { if (!m_bucket_renderers[i]) { init_bucket_renderer(fmt::format("bucket-{}", i), @@ -1083,6 +1248,43 @@ void OpenGLRenderer::dispatch_buckets_jak2(DmaFollower dma, // TODO ending data. } +void OpenGLRenderer::dispatch_buckets_jak3(DmaFollower dma, + ScopedProfilerNode& prof, + bool sync_after_buckets) { + // The first thing the DMA chain should be a call to a common default-registers chain. + // this chain resets the state of the GS. After this is buckets + m_category_times.fill(0); + + m_render_state.buckets_base = dma.current_tag_offset(); // starts at 0 in jak 2 + m_render_state.next_bucket = m_render_state.buckets_base + 16; + m_render_state.bucket_for_vis_copy = (int)jak3::BucketId::BUCKET_2; + m_render_state.num_vis_to_copy = jak3::LEVEL_MAX; + + for (size_t bucket_id = 0; bucket_id < m_bucket_renderers.size(); bucket_id++) { + auto& renderer = m_bucket_renderers[bucket_id]; + auto bucket_prof = prof.make_scoped_child(renderer->name_and_id()); + g_current_renderer = renderer->name_and_id(); + // lg::info("Render: {} start", g_current_renderer); + renderer->render(dma, &m_render_state, bucket_prof); + if (sync_after_buckets) { + auto pp = scoped_prof("finish"); + glFinish(); + } + + // lg::info("Render: {} end", g_current_renderer); + // should have ended at the start of the next chain + ASSERT(dma.current_tag_offset() == m_render_state.next_bucket); + m_render_state.next_bucket += 16; + vif_interrupt_callback(bucket_id + 1); + m_category_times[(int)m_bucket_categories[bucket_id]] += bucket_prof.get_elapsed_time(); + + // TODO: collision renderer + } + vif_interrupt_callback(m_bucket_renderers.size()); + + // TODO ending data. +} + /*! * This function finds buckets and dispatches them to the appropriate part. */ @@ -1100,6 +1302,9 @@ void OpenGLRenderer::dispatch_buckets(DmaFollower dma, case GameVersion::Jak2: dispatch_buckets_jak2(dma, prof, sync_after_buckets); break; + case GameVersion::Jak3: + dispatch_buckets_jak3(dma, prof, sync_after_buckets); + break; default: ASSERT(false); } diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.h b/game/graphics/opengl_renderer/OpenGLRenderer.h index ce883bee47..db9a4633db 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.h +++ b/game/graphics/opengl_renderer/OpenGLRenderer.h @@ -46,7 +46,7 @@ struct RenderOptions { bool internal_res_screenshot = false; std::string screenshot_path; - float pmode_alp_register = 0.f; + float pmode_alp_register = 1.f; // when enabled, does a `glFinish()` after each major rendering pass. This blocks until the GPU // is done working, making it easier to profile GPU utilization. @@ -75,6 +75,7 @@ class OpenGLRenderer { void dispatch_buckets(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets); void dispatch_buckets_jak1(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets); void dispatch_buckets_jak2(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets); + void dispatch_buckets_jak3(DmaFollower dma, ScopedProfilerNode& prof, bool sync_after_buckets); void do_pcrtc_effects(float alp, SharedRenderState* render_state, ScopedProfilerNode& prof); void blit_display(); diff --git a/game/graphics/opengl_renderer/background/TFragment.cpp b/game/graphics/opengl_renderer/background/TFragment.cpp index a4efc78286..73260e0d65 100644 --- a/game/graphics/opengl_renderer/background/TFragment.cpp +++ b/game/graphics/opengl_renderer/background/TFragment.cpp @@ -99,7 +99,6 @@ void TFragment::render(DmaFollower& dma, if (m_my_id == render_state->bucket_for_vis_copy && dma.current_tag_vifcode1().kind == VifCode::Kind::PC_PORT) { DmaTransfer transfers[20]; - for (int i = 0; i < render_state->num_vis_to_copy; i++) { transfers[i] = dma.read_and_advance(); auto next0 = dma.read_and_advance(); diff --git a/game/graphics/opengl_renderer/background/Tie3.cpp b/game/graphics/opengl_renderer/background/Tie3.cpp index 51dc589451..4baea30232 100644 --- a/game/graphics/opengl_renderer/background/Tie3.cpp +++ b/game/graphics/opengl_renderer/background/Tie3.cpp @@ -319,7 +319,7 @@ bool Tie3::set_up_common_data_from_dma(DmaFollower& dma, SharedRenderState* rend memcpy(&m_wind_data, wind_data.data, sizeof(WindWork)); } - if (render_state->version == GameVersion::Jak2) { + if (render_state->version >= GameVersion::Jak2) { // jak 2 proto visibility auto proto_mask_data = dma.read_and_advance(); m_common_data.proto_vis_data = proto_mask_data.data; diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 2a35e29dba..00bf6b9d3b 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -414,6 +414,657 @@ enum class BucketId { namespace jak3 { enum class BucketId { + BUCKET_2 = 2, + BLIT_START = 3, + TEX_LCOM_SKY_PRE = 4, + + TEX_L0_TFRAG = 10, + TFRAG_L0_TFRAG = 11, + TIE_L0_TFRAG = 12, + ETIE_L0_TFRAG = 13, + TFRAG_SCISSOR_L0_TFRAG = 14, + TIE_SCISSOR_L0_TFRAG = 15, + ETIE_SCISSOR_L0_TFRAG = 16, + MERC_L0_TFRAG = 17, + EMERC_L0_TFRAG = 18, + GMERC_L0_TFRAG = 19, + TIE_VANISH_L0_TFRAG = 20, + GMERC2_L0_TFRAG = 21, + + TEX_L1_TFRAG = 22, + TFRAG_L1_TFRAG = 23, + TIE_L1_TFRAG = 24, + ETIE_L1_TFRAG = 25, + TFRAG_SCISSOR_L1_TFRAG = 26, + TIE_SCISSOR_L1_TFRAG = 27, + ETIE_SCISSOR_L1_TFRAG = 28, + MERC_L1_TFRAG = 29, + EMERC_L1_TFRAG = 30, + GMERC_L1_TFRAG = 31, + TIE_VANISH_L1_TFRAG = 32, + GMERC2_L1_TFRAG = 33, + + TEX_L2_TFRAG = 34, + TFRAG_L2_TFRAG = 35, + TIE_L2_TFRAG = 36, + ETIE_L2_TFRAG = 37, + TFRAG_SCISSOR_L2_TFRAG = 38, + TIE_SCISSOR_L2_TFRAG = 39, + ETIE_SCISSOR_L2_TFRAG = 40, + MERC_L2_TFRAG = 41, + EMERC_L2_TFRAG = 42, + GMERC_L2_TFRAG = 43, + TIE_VANISH_L2_TFRAG = 44, + GMERC2_L2_TFRAG = 45, + + TEX_L3_TFRAG = 46, + TFRAG_L3_TFRAG = 47, + TIE_L3_TFRAG = 48, + ETIE_L3_TFRAG = 49, + TFRAG_SCISSOR_L3_TFRAG = 50, + TIE_SCISSOR_L3_TFRAG = 51, + ETIE_SCISSOR_L3_TFRAG = 52, + MERC_L3_TFRAG = 53, + EMERC_L3_TFRAG = 54, + GMERC_L3_TFRAG = 55, + TIE_VANISH_L3_TFRAG = 56, + GMERC2_L3_TFRAG = 57, + + TEX_L4_TFRAG = 58, + TFRAG_L4_TFRAG = 59, + TIE_L4_TFRAG = 60, + ETIE_L4_TFRAG = 61, + TFRAG_SCISSOR_L4_TFRAG = 62, + TIE_SCISSOR_L4_TFRAG = 63, + ETIE_SCISSOR_L4_TFRAG = 64, + MERC_L4_TFRAG = 65, + EMERC_L4_TFRAG = 66, + GMERC_L4_TFRAG = 67, + TIE_VANISH_L4_TFRAG = 68, + GMERC2_L4_TFRAG = 69, + + TEX_L5_TFRAG = 70, + TFRAG_L5_TFRAG = 71, + TIE_L5_TFRAG = 72, + ETIE_L5_TFRAG = 73, + TFRAG_SCISSOR_L5_TFRAG = 74, + TIE_SCISSOR_L5_TFRAG = 75, + ETIE_SCISSOR_L5_TFRAG = 76, + MERC_L5_TFRAG = 77, + EMERC_L5_TFRAG = 78, + GMERC_L5_TFRAG = 79, + TIE_VANISH_L5_TFRAG = 80, + GMERC2_L5_TFRAG = 81, + + TEX_L6_TFRAG = 82, + TFRAG_L6_TFRAG = 83, + TIE_L6_TFRAG = 84, + ETIE_L6_TFRAG = 85, + TFRAG_SCISSOR_L6_TFRAG = 86, + TIE_SCISSOR_L6_TFRAG = 87, + ETIE_SCISSOR_L6_TFRAG = 88, + MERC_L6_TFRAG = 89, + EMERC_L6_TFRAG = 90, + GMERC_L6_TFRAG = 91, + TIE_VANISH_L6_TFRAG = 92, + GMERC2_L6_TFRAG = 93, + + TEX_L7_TFRAG = 94, + TFRAG_L7_TFRAG = 95, + TIE_L7_TFRAG = 96, + ETIE_L7_TFRAG = 97, + TFRAG_SCISSOR_L7_TFRAG = 98, + TIE_SCISSOR_L7_TFRAG = 99, + ETIE_SCISSOR_L7_TFRAG = 100, + MERC_L7_TFRAG = 101, + EMERC_L7_TFRAG = 102, + GMERC_L7_TFRAG = 103, + TIE_VANISH_L7_TFRAG = 104, + GMERC2_L7_TFRAG = 105, + + TEX_L8_TFRAG = 106, + TFRAG_L8_TFRAG = 107, + TIE_L8_TFRAG = 108, + ETIE_L8_TFRAG = 109, + TFRAG_SCISSOR_L8_TFRAG = 110, + TIE_SCISSOR_L8_TFRAG = 111, + ETIE_SCISSOR_L8_TFRAG = 112, + MERC_L8_TFRAG = 113, + EMERC_L8_TFRAG = 114, + GMERC_L8_TFRAG = 115, + TIE_VANISH_L8_TFRAG = 116, + GMERC2_L8_TFRAG = 117, + + TEX_L9_TFRAG = 118, + TFRAG_L9_TFRAG = 119, + TIE_L9_TFRAG = 120, + ETIE_L9_TFRAG = 121, + TFRAG_SCISSOR_L9_TFRAG = 122, + TIE_SCISSOR_L9_TFRAG = 123, + ETIE_SCISSOR_L9_TFRAG = 124, + MERC_L9_TFRAG = 125, + EMERC_L9_TFRAG = 126, + GMERC_L9_TFRAG = 127, + TIE_VANISH_L9_TFRAG = 128, + GMERC2_L9_TFRAG = 129, + + TEX_L0_SHRUB = 130, + SHRUB_L0_SHRUB = 131, + SHRUB_NEAR_L0_SHRUB = 132, + BILLBOARD_L0_SHRUB = 133, + SHRUB_VANISH_L0_SHRUB = 134, + SHRUB_NEAR_TRANS_L0_SHRUB = 135, + MERC_L0_SHRUB = 136, + EMERC_L0_SHRUB = 137, + GMERC_L0_SHRUB = 138, + GMERC2_L0_SHRUB = 139, + + TEX_L1_SHRUB = 140, + SHRUB_L1_SHRUB = 141, + SHRUB_NEAR_L1_SHRUB = 142, + BILLBOARD_L1_SHRUB = 143, + SHRUB_VANISH_L1_SHRUB = 144, + SHRUB_NEAR_TRANS_L1_SHRUB = 145, + MERC_L1_SHRUB = 146, + EMERC_L1_SHRUB = 147, + GMERC_L1_SHRUB = 148, + GMERC2_L1_SHRUB = 149, + + TEX_L2_SHRUB = 150, + SHRUB_L2_SHRUB = 151, + SHRUB_NEAR_L2_SHRUB = 152, + BILLBOARD_L2_SHRUB = 153, + SHRUB_VANISH_L2_SHRUB = 154, + SHRUB_NEAR_TRANS_L2_SHRUB = 155, + MERC_L2_SHRUB = 156, + EMERC_L2_SHRUB = 157, + GMERC_L2_SHRUB = 158, + GMERC2_L2_SHRUB = 159, + + TEX_L3_SHRUB = 160, + SHRUB_L3_SHRUB = 161, + SHRUB_NEAR_L3_SHRUB = 162, + BILLBOARD_L3_SHRUB = 163, + SHRUB_VANISH_L3_SHRUB = 164, + SHRUB_NEAR_TRANS_L3_SHRUB = 165, + MERC_L3_SHRUB = 166, + EMERC_L3_SHRUB = 167, + GMERC_L3_SHRUB = 168, + GMERC2_L3_SHRUB = 169, + + TEX_L4_SHRUB = 170, + SHRUB_L4_SHRUB = 171, + SHRUB_NEAR_L4_SHRUB = 172, + BILLBOARD_L4_SHRUB = 173, + SHRUB_VANISH_L4_SHRUB = 174, + SHRUB_NEAR_TRANS_L4_SHRUB = 175, + MERC_L4_SHRUB = 176, + EMERC_L4_SHRUB = 177, + GMERC_L4_SHRUB = 178, + GMERC2_L4_SHRUB = 179, + + TEX_L5_SHRUB = 180, + SHRUB_L5_SHRUB = 181, + SHRUB_NEAR_L5_SHRUB = 182, + BILLBOARD_L5_SHRUB = 183, + SHRUB_VANISH_L5_SHRUB = 184, + SHRUB_NEAR_TRANS_L5_SHRUB = 185, + MERC_L5_SHRUB = 186, + EMERC_L5_SHRUB = 187, + GMERC_L5_SHRUB = 188, + GMERC2_L5_SHRUB = 189, + + TEX_L6_SHRUB = 190, + SHRUB_L6_SHRUB = 191, + SHRUB_NEAR_L6_SHRUB = 192, + BILLBOARD_L6_SHRUB = 193, + SHRUB_VANISH_L6_SHRUB = 194, + SHRUB_NEAR_TRANS_L6_SHRUB = 195, + MERC_L6_SHRUB = 196, + EMERC_L6_SHRUB = 197, + GMERC_L6_SHRUB = 198, + GMERC2_L6_SHRUB = 199, + + TEX_L7_SHRUB = 200, + SHRUB_L7_SHRUB = 201, + SHRUB_NEAR_L7_SHRUB = 202, + BILLBOARD_L7_SHRUB = 203, + SHRUB_VANISH_L7_SHRUB = 204, + SHRUB_NEAR_TRANS_L7_SHRUB = 205, + MERC_L7_SHRUB = 206, + EMERC_L7_SHRUB = 207, + GMERC_L7_SHRUB = 208, + GMERC2_L7_SHRUB = 209, + + TEX_L8_SHRUB = 210, + SHRUB_L8_SHRUB = 211, + SHRUB_NEAR_L8_SHRUB = 212, + BILLBOARD_L8_SHRUB = 213, + SHRUB_VANISH_L8_SHRUB = 214, + SHRUB_NEAR_TRANS_L8_SHRUB = 215, + MERC_L8_SHRUB = 216, + EMERC_L8_SHRUB = 217, + GMERC_L8_SHRUB = 218, + GMERC2_L8_SHRUB = 219, + + TEX_L9_SHRUB = 220, + SHRUB_L9_SHRUB = 221, + SHRUB_NEAR_L9_SHRUB = 222, + BILLBOARD_L9_SHRUB = 223, + SHRUB_VANISH_L9_SHRUB = 224, + SHRUB_NEAR_TRANS_L9_SHRUB = 225, + MERC_L9_SHRUB = 226, + EMERC_L9_SHRUB = 227, + GMERC_L9_SHRUB = 228, + GMERC2_L9_SHRUB = 229, + + TEX_L0_ALPHA = 230, + TFRAG_L0_ALPHA = 231, + TIE_L0_ALPHA = 232, + ETIE_L0_ALPHA = 233, + MERC_L0_ALPHA = 234, + EMERC_L0_ALPHA = 235, + GMERC_L0_ALPHA = 236, + TFRAG_SCISSOR_L0_ALPHA = 237, + TIE_SCISSOR_L0_ALPHA = 238, + ETIE_SCISSOR_L0_ALPHA = 239, + GMERC2_L0_ALPHA = 240, + + TEX_L1_ALPHA = 241, + TFRAG_L1_ALPHA = 242, + TIE_L1_ALPHA = 243, + ETIE_L1_ALPHA = 244, + MERC_L1_ALPHA = 245, + EMERC_L1_ALPHA = 246, + GMERC_L1_ALPHA = 247, + TFRAG_SCISSOR_L1_ALPHA = 248, + TIE_SCISSOR_L1_ALPHA = 249, + ETIE_SCISSOR_L1_ALPHA = 250, + GMERC2_L1_ALPHA = 251, + + TEX_L2_ALPHA = 252, + TFRAG_L2_ALPHA = 253, + TIE_L2_ALPHA = 254, + ETIE_L2_ALPHA = 255, + MERC_L2_ALPHA = 256, + EMERC_L2_ALPHA = 257, + GMERC_L2_ALPHA = 258, + TFRAG_SCISSOR_L2_ALPHA = 259, + TIE_SCISSOR_L2_ALPHA = 260, + ETIE_SCISSOR_L2_ALPHA = 261, + GMERC2_L2_ALPHA = 262, + + TEX_L3_ALPHA = 263, + TFRAG_L3_ALPHA = 264, + TIE_L3_ALPHA = 265, + ETIE_L3_ALPHA = 266, + MERC_L3_ALPHA = 267, + EMERC_L3_ALPHA = 268, + GMERC_L3_ALPHA = 269, + TFRAG_SCISSOR_L3_ALPHA = 270, + TIE_SCISSOR_L3_ALPHA = 271, + ETIE_SCISSOR_L3_ALPHA = 272, + GMERC2_L3_ALPHA = 273, + + TEX_L4_ALPHA = 274, + TFRAG_L4_ALPHA = 275, + TIE_L4_ALPHA = 276, + ETIE_L4_ALPHA = 277, + MERC_L4_ALPHA = 278, + EMERC_L4_ALPHA = 279, + GMERC_L4_ALPHA = 280, + TFRAG_SCISSOR_L4_ALPHA = 281, + TIE_SCISSOR_L4_ALPHA = 282, + ETIE_SCISSOR_L4_ALPHA = 283, + GMERC2_L4_ALPHA = 284, + + TEX_L5_ALPHA = 285, + TFRAG_L5_ALPHA = 286, + TIE_L5_ALPHA = 287, + ETIE_L5_ALPHA = 288, + MERC_L5_ALPHA = 289, + EMERC_L5_ALPHA = 290, + GMERC_L5_ALPHA = 291, + TFRAG_SCISSOR_L5_ALPHA = 292, + TIE_SCISSOR_L5_ALPHA = 293, + ETIE_SCISSOR_L5_ALPHA = 294, + GMERC2_L5_ALPHA = 295, + + TEX_L6_ALPHA = 296, + TFRAG_L6_ALPHA = 297, + TIE_L6_ALPHA = 298, + ETIE_L6_ALPHA = 299, + MERC_L6_ALPHA = 300, + EMERC_L6_ALPHA = 301, + GMERC_L6_ALPHA = 302, + TFRAG_SCISSOR_L6_ALPHA = 303, + TIE_SCISSOR_L6_ALPHA = 304, + ETIE_SCISSOR_L6_ALPHA = 305, + GMERC2_L6_ALPHA = 306, + + TEX_L7_ALPHA = 307, + TFRAG_L7_ALPHA = 308, + TIE_L7_ALPHA = 309, + ETIE_L7_ALPHA = 310, + MERC_L7_ALPHA = 311, + EMERC_L7_ALPHA = 312, + GMERC_L7_ALPHA = 313, + TFRAG_SCISSOR_L7_ALPHA = 314, + TIE_SCISSOR_L7_ALPHA = 315, + ETIE_SCISSOR_L7_ALPHA = 316, + GMERC2_L7_ALPHA = 317, + + TEX_L8_ALPHA = 318, + TFRAG_L8_ALPHA = 319, + TIE_L8_ALPHA = 320, + ETIE_L8_ALPHA = 321, + MERC_L8_ALPHA = 322, + EMERC_L8_ALPHA = 323, + GMERC_L8_ALPHA = 324, + TFRAG_SCISSOR_L8_ALPHA = 325, + TIE_SCISSOR_L8_ALPHA = 326, + ETIE_SCISSOR_L8_ALPHA = 327, + GMERC2_L8_ALPHA = 328, + + TEX_L9_ALPHA = 329, + TFRAG_L9_ALPHA = 330, + TIE_L9_ALPHA = 331, + ETIE_L9_ALPHA = 332, + MERC_L9_ALPHA = 333, + EMERC_L9_ALPHA = 334, + GMERC_L9_ALPHA = 335, + TFRAG_SCISSOR_L9_ALPHA = 336, + TIE_SCISSOR_L9_ALPHA = 337, + ETIE_SCISSOR_L9_ALPHA = 338, + GMERC2_L9_ALPHA = 339, + + TEX_LCOM_TFRAG = 340, + MERC_LCOM_TFRAG = 341, + EMERC_LCOM_TFRAG = 342, + GMERC_LCOM_TFRAG = 343, + GMERC2_LCOM_TFRAG = 344, + + TEX_LCOM_SHRUB = 345, + MERC_LCOM_SHRUB = 346, + EMERC_LCOM_SHRUB = 347, + GMERC_LCOM_SHRUB = 348, + GMERC2_LCOM_SHRUB = 349, + + SHADOW = 350, + + TEX_L0_PRIS = 351, + MERC_L0_PRIS = 352, + EMERC_L0_PRIS = 353, + GMERC_L0_PRIS = 354, + GMERC2_L0_PRIS = 355, + + TEX_L1_PRIS = 356, + MERC_L1_PRIS = 357, + EMERC_L1_PRIS = 358, + GMERC_L1_PRIS = 359, + GMERC2_L1_PRIS = 360, + + TEX_L2_PRIS = 361, + MERC_L2_PRIS = 362, + EMERC_L2_PRIS = 363, + GMERC_L2_PRIS = 364, + GMERC2_L2_PRIS = 365, + + TEX_L3_PRIS = 366, + MERC_L3_PRIS = 367, + EMERC_L3_PRIS = 368, + GMERC_L3_PRIS = 369, + GMERC2_L3_PRIS = 370, + + TEX_L4_PRIS = 371, + MERC_L4_PRIS = 372, + EMERC_L4_PRIS = 373, + GMERC_L4_PRIS = 374, + GMERC2_L4_PRIS = 375, + + TEX_L5_PRIS = 376, + MERC_L5_PRIS = 377, + EMERC_L5_PRIS = 378, + GMERC_L5_PRIS = 379, + GMERC2_L5_PRIS = 380, + + TEX_L6_PRIS = 381, + MERC_L6_PRIS = 382, + EMERC_L6_PRIS = 383, + GMERC_L6_PRIS = 384, + GMERC2_L6_PRIS = 385, + + TEX_L7_PRIS = 386, + MERC_L7_PRIS = 387, + EMERC_L7_PRIS = 388, + GMERC_L7_PRIS = 389, + GMERC2_L7_PRIS = 390, + + TEX_L8_PRIS = 391, + MERC_L8_PRIS = 392, + EMERC_L8_PRIS = 393, + GMERC_L8_PRIS = 394, + GMERC2_L8_PRIS = 395, + + TEX_L9_PRIS = 396, + MERC_L9_PRIS = 397, + EMERC_L9_PRIS = 398, + GMERC_L9_PRIS = 399, + GMERC2_L9_PRIS = 400, + + TEX_LCOM_PRIS = 401, + MERC_LCOM_PRIS = 402, + EMERC_LCOM_PRIS = 403, + GMERC_LCOM_PRIS = 404, + GMERC2_LCOM_PRIS = 405, + + TEX_L0_PRIS2 = 406, + MERC_L0_PRIS2 = 407, + EMERC_L0_PRIS2 = 408, + GMERC_L0_PRIS2 = 409, + GMERC2_L0_PRIS2 = 410, + + TEX_L1_PRIS2 = 411, + MERC_L1_PRIS2 = 412, + EMERC_L1_PRIS2 = 413, + GMERC_L1_PRIS2 = 414, + GMERC2_L1_PRIS2 = 415, + + TEX_L2_PRIS2 = 416, + MERC_L2_PRIS2 = 417, + EMERC_L2_PRIS2 = 418, + GMERC_L2_PRIS2 = 419, + GMERC2_L2_PRIS2 = 420, + + TEX_L3_PRIS2 = 421, + MERC_L3_PRIS2 = 422, + EMERC_L3_PRIS2 = 423, + GMERC_L3_PRIS2 = 424, + GMERC2_L3_PRIS2 = 425, + + TEX_L4_PRIS2 = 426, + MERC_L4_PRIS2 = 427, + EMERC_L4_PRIS2 = 428, + GMERC_L4_PRIS2 = 429, + GMERC2_L4_PRIS2 = 430, + + TEX_L5_PRIS2 = 431, + MERC_L5_PRIS2 = 432, + EMERC_L5_PRIS2 = 433, + GMERC_L5_PRIS2 = 434, + GMERC2_L5_PRIS2 = 435, + + TEX_L6_PRIS2 = 436, + MERC_L6_PRIS2 = 437, + EMERC_L6_PRIS2 = 438, + GMERC_L6_PRIS2 = 439, + GMERC2_L6_PRIS2 = 440, + + TEX_L7_PRIS2 = 441, + MERC_L7_PRIS2 = 442, + EMERC_L7_PRIS2 = 443, + GMERC_L7_PRIS2 = 444, + GMERC2_L7_PRIS2 = 445, + + TEX_L8_PRIS2 = 446, + MERC_L8_PRIS2 = 447, + EMERC_L8_PRIS2 = 448, + GMERC_L8_PRIS2 = 449, + GMERC2_L8_PRIS2 = 450, + + TEX_L9_PRIS2 = 451, + MERC_L9_PRIS2 = 452, + EMERC_L9_PRIS2 = 453, + GMERC_L9_PRIS2 = 454, + GMERC2_L9_PRIS2 = 455, + + TEX_LCOM_PRIS2 = 456, + MERC_LCOM_PRIS2 = 457, + EMERC_LCOM_PRIS2 = 458, + GMERC_LCOM_PRIS2 = 459, + GMERC2_LCOM_PRIS2 = 460, + + TEX_LCOM_SKY_POST = 461, + BUCKET462 = 462, + + TEX_L0_WATER = 463, + MERC_L0_WATER = 464, + GMERC_L0_WATER = 465, + TFRAG_L0_WATER = 466, + TIE_L0_WATER = 467, + ETIE_L0_WATER = 468, + TIE_SCISSOR_L0_WATER = 469, + TFRAG_SCISSOR_L0_WATER = 470, + ETIE_SCISSOR_L0_WATER = 471, + GMERC2_L0_WATER = 472, + + TEX_L1_WATER = 473, + MERC_L1_WATER = 474, + GMERC_L1_WATER = 475, + TFRAG_L1_WATER = 476, + TIE_L1_WATER = 477, + ETIE_L1_WATER = 478, + TIE_SCISSOR_L1_WATER = 479, + TFRAG_SCISSOR_L1_WATER = 480, + ETIE_SCISSOR_L1_WATER = 481, + GMERC2_L1_WATER = 482, + + TEX_L2_WATER = 483, + MERC_L2_WATER = 484, + GMERC_L2_WATER = 485, + TFRAG_L2_WATER = 486, + TIE_L2_WATER = 487, + ETIE_L2_WATER = 488, + TIE_SCISSOR_L2_WATER = 489, + TFRAG_SCISSOR_L2_WATER = 490, + ETIE_SCISSOR_L2_WATER = 491, + GMERC2_L2_WATER = 492, + + TEX_L3_WATER = 493, + MERC_L3_WATER = 494, + GMERC_L3_WATER = 495, + TFRAG_L3_WATER = 496, + TIE_L3_WATER = 497, + ETIE_L3_WATER = 498, + TIE_SCISSOR_L3_WATER = 499, + TFRAG_SCISSOR_L3_WATER = 500, + ETIE_SCISSOR_L3_WATER = 501, + GMERC2_L3_WATER = 502, + + TEX_L4_WATER = 503, + MERC_L4_WATER = 504, + GMERC_L4_WATER = 505, + TFRAG_L4_WATER = 506, + TIE_L4_WATER = 507, + ETIE_L4_WATER = 508, + TIE_SCISSOR_L4_WATER = 509, + TFRAG_SCISSOR_L4_WATER = 510, + ETIE_SCISSOR_L4_WATER = 511, + GMERC2_L4_WATER = 512, + + TEX_L5_WATER = 513, + MERC_L5_WATER = 514, + GMERC_L5_WATER = 515, + TFRAG_L5_WATER = 516, + TIE_L5_WATER = 517, + ETIE_L5_WATER = 518, + TIE_SCISSOR_L5_WATER = 519, + TFRAG_SCISSOR_L5_WATER = 520, + ETIE_SCISSOR_L5_WATER = 521, + GMERC2_L5_WATER = 522, + + TEX_L6_WATER = 523, + MERC_L6_WATER = 524, + GMERC_L6_WATER = 525, + TFRAG_L6_WATER = 526, + TIE_L6_WATER = 527, + ETIE_L6_WATER = 528, + TIE_SCISSOR_L6_WATER = 529, + TFRAG_SCISSOR_L6_WATER = 530, + ETIE_SCISSOR_L6_WATER = 531, + GMERC2_L6_WATER = 532, + + TEX_L7_WATER = 533, + MERC_L7_WATER = 534, + GMERC_L7_WATER = 535, + TFRAG_L7_WATER = 536, + TIE_L7_WATER = 537, + ETIE_L7_WATER = 538, + TIE_SCISSOR_L7_WATER = 539, + TFRAG_SCISSOR_L7_WATER = 540, + ETIE_SCISSOR_L7_WATER = 541, + GMERC2_L7_WATER = 542, + + TEX_L8_WATER = 543, + MERC_L8_WATER = 544, + GMERC_L8_WATER = 545, + TFRAG_L8_WATER = 546, + TIE_L8_WATER = 547, + ETIE_L8_WATER = 548, + TIE_SCISSOR_L8_WATER = 549, + TFRAG_SCISSOR_L8_WATER = 550, + ETIE_SCISSOR_L8_WATER = 551, + GMERC2_L8_WATER = 552, + + TEX_L9_WATER = 553, + MERC_L9_WATER = 554, + GMERC_L9_WATER = 555, + TFRAG_L9_WATER = 556, + TIE_L9_WATER = 557, + ETIE_L9_WATER = 558, + TIE_SCISSOR_L9_WATER = 559, + TFRAG_SCISSOR_L9_WATER = 560, + ETIE_SCISSOR_L9_WATER = 561, + GMERC2_L9_WATER = 562, + + TEX_LCOM_WATER = 563, + MERC_LCOM_WATER = 564, + GMERC_LCOM_WATER = 565, + GMERC2_LCOM_WATER = 566, + BUCKET567 = 567, + + TEX_SPRITE = 568, + GENERIC_SPRITE_1 = 569, + PARTICLES = 570, + GENERIC_SPRITE_2 = 571, + SHADOW2 = 572, + SHADOW3 = 573, + GENERIC_SPRITE_3 = 574, + + TEX_WARP = 575, + GENERIC_WARP = 576, + + DEBUG_NO_ZBUF1 = 577, + TEX_HUD_HUD_ALPHA = 578, + HUD_DRAW_HUD_ALPHA = 579, + TEX_HUD_PRIS2 = 580, + HUD_DRAW_PRIS2 = 581, + BUCKET582 = 582, + DEBUG = 583, + DEBUG_NO_ZBUF2 = 584, + DEBUG_MENU = 585, + BUCKET586 = 586, + MAX_BUCKETS = 587, }; } diff --git a/game/graphics/opengl_renderer/foreground/Merc2.cpp b/game/graphics/opengl_renderer/foreground/Merc2.cpp index 9c7c3032c2..15c12d15dc 100644 --- a/game/graphics/opengl_renderer/foreground/Merc2.cpp +++ b/game/graphics/opengl_renderer/foreground/Merc2.cpp @@ -949,7 +949,7 @@ void Merc2::handle_merc_chain(DmaFollower& dma, auto init = dma.read_and_advance(); int skip_count = 2; - if (render_state->version == GameVersion::Jak2) { + if (render_state->version >= GameVersion::Jak2) { skip_count = 1; } diff --git a/game/graphics/opengl_renderer/sprite/Sprite3.cpp b/game/graphics/opengl_renderer/sprite/Sprite3.cpp index 173b6abe78..7a1a846b6b 100644 --- a/game/graphics/opengl_renderer/sprite/Sprite3.cpp +++ b/game/graphics/opengl_renderer/sprite/Sprite3.cpp @@ -170,7 +170,8 @@ void Sprite3::handle_sprite_frame_setup(DmaFollower& dma, memcpy(&jak1_data, frame_data.data, sizeof(SpriteFrameDataJak1)); m_frame_data.from_jak1(jak1_data); } break; - case GameVersion::Jak2: { + case GameVersion::Jak2: + case GameVersion::Jak3: { render_state->shaders[ShaderId::SPRITE3].activate(); auto frame_data = dma.read_and_advance(); ASSERT(frame_data.size_bytes == (int)sizeof(SpriteFrameData)); // very cool @@ -392,6 +393,7 @@ void Sprite3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedPr render_jak1(dma, render_state, prof); break; case GameVersion::Jak2: + case GameVersion::Jak3: render_jak2(dma, render_state, prof); break; default: diff --git a/game/graphics/opengl_renderer/sprite/Sprite3_Distort.cpp b/game/graphics/opengl_renderer/sprite/Sprite3_Distort.cpp index 0769282e99..ec8c839393 100644 --- a/game/graphics/opengl_renderer/sprite/Sprite3_Distort.cpp +++ b/game/graphics/opengl_renderer/sprite/Sprite3_Distort.cpp @@ -212,6 +212,7 @@ void Sprite3::distort_dma(GameVersion version, DmaFollower& dma, ScopedProfilerN expect_th = 8; break; case GameVersion::Jak2: + case GameVersion::Jak3: expect_zbp = 0x130; expect_th = 9; break; @@ -424,7 +425,7 @@ void Sprite3::distort_setup_instanced(ScopedProfilerNode& /*prof*/) { for (int res = 3; res < 12; res++) { int entry_index = m_sprite_distorter_sine_tables.ientry[res - 3].x() - 352; - ASSERT_MSG(entry_index >= 0, "weird sprite_distort startup crash happened again!"); + // ASSERT_MSG(entry_index >= 0, "weird sprite_distort startup crash happened again!"); for (int i = 0; i < res; i++) { math::Vector3f vf06 = m_sprite_distorter_sine_tables.entry[entry_index++].xyz(); diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index 1c85c93807..0c09444851 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -73,7 +73,7 @@ struct GraphicsData { FrameLimiter frame_limiter; Timer engine_timer; double last_engine_time = 1. / 60.; - float pmode_alp = 0.f; + float pmode_alp = 1.f; std::string imgui_log_filename, imgui_filename; GameVersion version; diff --git a/game/graphics/texture/TexturePool.cpp b/game/graphics/texture/TexturePool.cpp index 7e73d2a64a..c5a8518f23 100644 --- a/game/graphics/texture/TexturePool.cpp +++ b/game/graphics/texture/TexturePool.cpp @@ -400,6 +400,8 @@ PcTextureId TexturePool::allocate_pc_port_texture(GameVersion version) { return PcTextureId(get_jak1_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++); case GameVersion::Jak2: return PcTextureId(get_jak2_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++); + case GameVersion::Jak3: + return PcTextureId(get_jak3_tpage_dir().size() - 1, m_next_pc_texture_to_allocate++); default: ASSERT_NOT_REACHED(); } diff --git a/game/kernel/jak3/fileio.cpp b/game/kernel/jak3/fileio.cpp index 4d4445b721..f62172228b 100644 --- a/game/kernel/jak3/fileio.cpp +++ b/game/kernel/jak3/fileio.cpp @@ -105,12 +105,14 @@ char* MakeFileName(int type, const char* name, int new_string) { // plain GOAL data object file case DATA_FILE_TYPE: // 0x20 - sprintf(buf, "%sfinal/%s.go", prefix, name); + // sprintf(buf, "%sfinal/%s.go", prefix, name); + sprintf(buf, "%sout/jak3/obj/%s.go", prefix, name); break; // texture page case TX_PAGE_FILE_TYPE: // 0x21 - sprintf(buf, "%sdata/texture-page%d/%s.go", prefix, TX_PAGE_VERSION, name); + // sprintf(buf, "%sdata/texture-page%d/%s.go", prefix, TX_PAGE_VERSION, name); + sprintf(buf, "%sout/jak3/obj/%s.go", prefix, name); break; // joint animation @@ -145,7 +147,8 @@ char* MakeFileName(int type, const char* name, int new_string) { // Everybody's favorite "art group" file. Container of different art. case ART_GROUP_FILE_TYPE: // 0x30 - sprintf(buf, "%sfinal/art-group%d/%s-ag.go", prefix, ART_FILE_VERSION, name); + // sprintf(buf, "%sfinal/art-group%d/%s-ag.go", prefix, ART_FILE_VERSION, name); + sprintf(buf, "%sout/jak3/obj/%s.go", prefix, name); break; // GOAL data object file containing visibility data. This likely contained the visibility data diff --git a/game/kernel/jak3/klink.cpp b/game/kernel/jak3/klink.cpp index cae87bb142..928422b13a 100644 --- a/game/kernel/jak3/klink.cpp +++ b/game/kernel/jak3/klink.cpp @@ -147,9 +147,9 @@ void link_control::jak3_begin(Ptr object_file, m_flags = flags; u16 version = l_hdr->core.version; - if (version == 4) { + if (version == 4 || version == 2) { // it's a v4 produced by opengoal... lets just try using jak2's linker - m_version = 4; + m_version = version; printf("got version 4, falling back to jak1/jak2\n"); jak1_jak2_begin(object_file, name, size, heap, flags); return; @@ -275,7 +275,7 @@ uint32_t link_control::jak3_work() { ASSERT(!m_opengoal); *(u32*)(((u8*)m_link_hdr) - 4) = *((s7 + jak3_symbols::FIX_SYM_LINK_BLOCK - 1).cast()); rv = jak3_work_v5(); - } else if (m_version == 4) { + } else if (m_version == 4 || m_version == 2) { // Note: this is a bit of a hack. Jak 3 doesn't support v2/v4. But, OpenGOAL generates data // objects in this format. We will just try reusing the jak 2 v2/v4 linker here and see if it // works. See corresponding call to jak1_jak2_begin in begin. @@ -741,6 +741,7 @@ void link_control::jak3_finish(bool jump_from_c_to_goal) { *EnableMethodSet = *EnableMethodSet + m_keep_debug; + // printf("finish %s\n", m_object_name); if (m_opengoal) { // setup mips2c functions const auto& it = Mips2C::gMips2CLinkCallbacks[GameVersion::Jak3].find(m_object_name); @@ -824,11 +825,24 @@ u32 link_busy() { void link_reset() { saved_link_control.m_busy = 0; } -uint64_t link_begin(u64* /*args*/) { - ASSERT_NOT_REACHED(); +uint64_t link_begin(u64* args) { + saved_link_control.jak3_begin(Ptr(args[0]), Ptr(args[1]).c(), args[2], + Ptr(args[3]), args[4]); + auto work_result = saved_link_control.jak3_work(); + // if we managed to finish in one shot, take care of calling finish + if (work_result) { + // called from goal + saved_link_control.jak3_finish(false); + } + return work_result != 0; } uint64_t link_resume() { - ASSERT_NOT_REACHED(); + auto work_result = saved_link_control.jak3_work(); + if (work_result) { + // called from goal + saved_link_control.jak3_finish(false); + } + return work_result != 0; } // Note: update_goal_fns changed to skip the hashtable lookup since symlink2/symlink3 are now fixed diff --git a/game/kernel/jak3/kmachine.cpp b/game/kernel/jak3/kmachine.cpp index 58a133ab78..0cb301f2d8 100644 --- a/game/kernel/jak3/kmachine.cpp +++ b/game/kernel/jak3/kmachine.cpp @@ -303,11 +303,13 @@ int ShutdownMachine() { } u32 KeybdGetData(u32 /*_mouse*/) { - ASSERT_NOT_REACHED(); + return 0; + // ASSERT_NOT_REACHED(); } u32 MouseGetData(u32 /*_mouse*/) { - ASSERT_NOT_REACHED(); + // ASSERT_NOT_REACHED(); + return 0; } /*! diff --git a/game/kernel/jak3/kscheme.cpp b/game/kernel/jak3/kscheme.cpp index 0676f43da2..634d617ffb 100644 --- a/game/kernel/jak3/kscheme.cpp +++ b/game/kernel/jak3/kscheme.cpp @@ -664,6 +664,9 @@ Ptr> intern_from_c_ht(const char* name) { */ Ptr> find_symbol_from_c(uint16_t sym_id, const char* name) { #ifdef JAK3_HASH_TABLE + if (!strcmp(name, "_empty_")) { + return (s7 + S7_OFF_FIX_SYM_EMPTY_PAIR).cast>(); + } return find_symbol_from_c_ht(name); #endif // sign extend @@ -733,6 +736,9 @@ Ptr> find_symbol_from_c(uint16_t sym_id, const char* name) { */ Ptr> intern_from_c(int sym_id, int flags, const char* name) { #ifdef JAK3_HASH_TABLE + if (!strcmp(name, "_empty_")) { + return (s7 + S7_OFF_FIX_SYM_EMPTY_PAIR).cast>(); + } return intern_from_c_ht(name); #endif // first, look up the symbol. diff --git a/game/mips2c/jak3_functions/collide_cache.cpp b/game/mips2c/jak3_functions/collide_cache.cpp new file mode 100644 index 0000000000..f0f5da2a41 --- /dev/null +++ b/game/mips2c/jak3_functions/collide_cache.cpp @@ -0,0 +1,1891 @@ +// cppcheck-suppress-file unusedLabels +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_10_collide_shape_prim_mesh { +struct Cache { + void* cheat_mode; // *cheat-mode* + void* display_capture_mode; // *display-capture-mode* + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* debug; // debug + void* format; // format + void* print_exceeded_max_cache_tris; // print-exceeded-max-cache-tris +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + // nop // sll r0, r0, 0 + c->lwu(s3, 60, s5); // lwu s3, 60(s5) + c->daddiu(v1, gp, 108); // daddiu v1, gp, 108 + c->lwu(a0, 4, gp); // lwu a0, 4(gp) + bc = c->sgpr64(s3) == c->sgpr64(s7); // beq s3, s7, L92 + // nop // sll r0, r0, 0 + if (bc) {goto block_18;} // branch non-likely + + c->addiu(a1, r0, 100); // addiu a1, r0, 100 + c->dsll(a2, a0, 1); // dsll a2, a0, 1 + bc = c->sgpr64(a0) == c->sgpr64(a1); // beq a0, a1, L89 + c->daddu(a0, a2, a0); // daddu a0, a2, a0 + if (bc) {goto block_11;} // branch non-likely + + c->dsll(a0, a0, 4); // dsll a0, a0, 4 + c->daddu(s4, v1, a0); // daddu s4, v1, a0 + c->mov64(a0, s3); // or a0, s3, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 72, v1); // lwu t9, 72(v1) + c->lwu(v1, 0, s5); // lwu v1, 0(s5) + c->lwu(v1, 136, v1); // lwu v1, 136(v1) + c->lwu(v1, 128, v1); // lwu v1, 128(v1) + c->lb(a1, 8, s5); // lb a1, 8(s5) + c->dsll(a1, a1, 5); // dsll a1, a1, 5 + c->daddu(v1, v1, a1); // daddu v1, v1, a1 + c->lwu(v1, 28, v1); // lwu v1, 28(v1) + c->daddu(a1, r0, v1); // daddu a1, r0, v1 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwu(a1, 4, gp); // lwu a1, 4(gp) + c->addiu(a2, r0, 460); // addiu a2, r0, 460 + c->lwu(v1, 0, gp); // lwu v1, 0(gp) + c->dsll32(a0, a1, 0); // dsll32 a0, a1, 0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf1, a0); // qmtc2.i vf1, a0 + // nop // sll r0, r0, 0 + c->dsubu(a0, a2, v1); // dsubu a0, a2, v1 + c->dsll(t2, v1, 6); // dsll t2, v1, 6 + bc = ((s64)c->sgpr64(a0)) < 0; // bltz a0, L90 + c->daddiu(a3, s3, 28); // daddiu a3, s3, 28 + if (bc) {goto block_12;} // branch non-likely + + c->mov64(a0, v1); // or a0, v1, r0 + c->lwu(t0, 4, s3); // lwu t0, 4(s3) + c->daddiu(t3, gp, 4908); // daddiu t3, gp, 4908 + c->lq(t1, 60, gp); // lq t1, 60(gp) + c->daddu(t2, t3, t2); // daddu t2, t3, t2 + c->lq(t3, 76, gp); // lq t3, 76(gp) + get_fake_spad_addr2(t4, cache.fake_scratchpad_data, 0, c);// lui t4, 28672 + c->lwu(t5, 8, gp); // lwu t5, 8(gp) + c->vsub(DEST::zw, vf1, vf0, vf0); // vsub.zw vf1, vf0, vf0 + // nop // sll r0, r0, 0 + +block_4: + bc = c->sgpr64(t0) == 0; // beq t0, r0, L88 + c->lbu(t6, 0, a3); // lbu t6, 0(a3) + if (bc) {goto block_9;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->lbu(t7, 1, a3); // lbu t7, 1(a3) + c->dsll(t9, t6, 5); // dsll t9, t6, 5 + c->lbu(t6, 2, a3); // lbu t6, 2(a3) + c->dsll(t8, t7, 5); // dsll t8, t7, 5 + c->daddu(t7, t9, t4); // daddu t7, t9, t4 + c->dsll(t6, t6, 5); // dsll t6, t6, 5 + // nop // sll r0, r0, 0 + c->daddu(t8, t8, t4); // daddu t8, t8, t4 + c->lq(ra, 16, t7); // lq ra, 16(t7) + c->daddu(t6, t6, t4); // daddu t6, t6, t4 + c->lq(s2, 16, t8); // lq s2, 16(t8) + c->pminw(s3, ra, s2); // pminw s3, ra, s2 + c->lq(t9, 16, t6); // lq t9, 16(t6) + c->pmaxw(ra, ra, s2); // pmaxw ra, ra, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminw(s3, s3, t9); // pminw s3, s3, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxw(t9, ra, t9); // pmaxw t9, ra, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(ra, s3, t3); // pcgtw ra, s3, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(s3, t1, t9); // pcgtw s3, t1, t9 + c->lwu(t9, 4, a3); // lwu t9, 4(a3) + c->por(ra, ra, s3); // por ra, ra, s3 + c->lq(t7, 0, t7); // lq t7, 0(t7) + c->ppach(ra, r0, ra); // ppach ra, r0, ra + c->lq(t8, 0, t8); // lq t8, 0(t8) + c->dsll(ra, ra, 16); // dsll ra, ra, 16 + c->lq(t6, 0, t6); // lq t6, 0(t6) + bc = c->sgpr64(ra) != 0; // bne ra, r0, L87 + c->daddiu(a3, a3, 8); // daddiu a3, a3, 8 + if (bc) {goto block_4;} // branch non-likely + + bc = c->sgpr64(v1) == c->sgpr64(a2); // beq v1, a2, L90 + c->sqc2(vf1, 48, t2); // sqc2 vf1, 48(t2) + if (bc) {goto block_12;} // branch non-likely + + c->and_(ra, t9, t5); // and ra, t9, t5 + c->sw(t9, 48, t2); // sw t9, 48(t2) + c->sw(s5, 52, t2); // sw s5, 52(t2) + c->sh(a1, 56, t2); // sh a1, 56(t2) + bc = c->sgpr64(ra) != 0; // bne ra, r0, L87 + c->sq(t7, 0, t2); // sq t7, 0(t2) + if (bc) {goto block_4;} // branch non-likely + + // nop // sll r0, r0, 0 + c->sq(t8, 16, t2); // sq t8, 16(t2) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->sq(t6, 32, t2); // sq t6, 32(t2) + //beq r0, r0, L87 // beq r0, r0, L87 + c->daddiu(t2, t2, 64); // daddiu t2, t2, 64 + goto block_4; // branch always + + +block_9: + c->dsubu(a3, v1, a0); // dsubu a3, v1, a0 + c->lwu(t0, 4, gp); // lwu t0, 4(gp) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L92 + c->lq(a1, 12, s5); // lq a1, 12(s5) + if (bc) {goto block_18;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lq(a2, 28, s5); // lq a2, 28(s5) + // nop // sll r0, r0, 0 + c->sq(r0, 32, s4); // sq r0, 32(s4) + // nop // sll r0, r0, 0 + c->sh(a3, 42, s4); // sh a3, 42(s4) + // nop // sll r0, r0, 0 + c->sw(gp, 32, s4); // sw gp, 32(s4) + // nop // sll r0, r0, 0 + c->sw(s5, 36, s4); // sw s5, 36(s4) + // nop // sll r0, r0, 0 + c->sh(a0, 40, s4); // sh a0, 40(s4) + c->daddiu(a0, t0, 1); // daddiu a0, t0, 1 + c->sq(a1, 0, s4); // sq a1, 0(s4) + // nop // sll r0, r0, 0 + c->sq(a2, 16, s4); // sq a2, 16(s4) + // nop // sll r0, r0, 0 + c->sw(a0, 4, gp); // sw a0, 4(gp) + //beq r0, r0, L92 // beq r0, r0, L92 + c->sw(v1, 0, gp); // sw v1, 0(gp) + goto block_18; // branch always + + +block_11: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L185 // daddiu a1, fp, L185 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Exceeded max number of collide-cache prims!\n"); + //beq r0, r0, L92 // beq r0, r0, L92 + // nop // sll r0, r0, 0 + goto block_18; // branch always + + +block_12: + c->load_symbol2(v1, cache.cheat_mode); // lw v1, *cheat-mode*(s7) + c->load_symbol_addr(a0, cache.debug); // daddiu a0, s7, debug + c->dsubu(v1, v1, a0); // dsubu v1, v1, a0 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + c->movn(a0, s7, v1); // movn a0, s7, v1 + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a0))) {// beql s7, a0, L91 + c->mov64(v1, a0); // or v1, a0, r0 + goto block_16; + } + +// block_14: + c->load_symbol2(v1, cache.display_capture_mode); // lw v1, *display-capture-mode*(s7) + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L91 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_16;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_16: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L92 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_18;} // branch non-likely + + c->load_symbol2(t9, cache.print_exceeded_max_cache_tris);// lw t9, print-exceeded-max-cache-tris(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_18: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.cheat_mode = intern_from_c(-1, 0, "*cheat-mode*").c(); + cache.display_capture_mode = intern_from_c(-1, 0, "*display-capture-mode*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.debug = intern_from_c(-1, 0, "debug").c(); + cache.format = intern_from_c(-1, 0, "format").c(); + cache.print_exceeded_max_cache_tris = intern_from_c(-1, 0, "print-exceeded-max-cache-tris").c(); + gLinkedFunctionTable.reg("(method 10 collide-shape-prim-mesh)", execute, 256); +} + +} // namespace method_10_collide_shape_prim_mesh +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_10_collide_shape_prim_sphere { +struct Cache { + void* format; // format +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -16); // daddiu sp, sp, -16 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + // nop // sll r0, r0, 0 + c->daddiu(t0, a1, 108); // daddiu t0, a1, 108 + c->lwu(a3, 4, a1); // lwu a3, 4(a1) + c->addiu(t1, r0, 100); // addiu t1, r0, 100 + c->lq(v1, 12, a0); // lq v1, 12(a0) + c->dsll(t2, a3, 1); // dsll t2, a3, 1 + c->lq(a2, 28, a0); // lq a2, 28(a0) + bc = c->sgpr64(a3) == c->sgpr64(t1); // beq a3, t1, L84 + c->daddu(t1, t2, a3); // daddu t1, t2, a3 + if (bc) {goto block_2;} // branch non-likely + + c->dsll(t1, t1, 4); // dsll t1, t1, 4 + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->daddiu(a3, a3, 1); // daddiu a3, a3, 1 + c->sq(r0, 32, t0); // sq r0, 32(t0) + // nop // sll r0, r0, 0 + c->sw(a0, 36, t0); // sw a0, 36(t0) + // nop // sll r0, r0, 0 + c->sq(v1, 0, t0); // sq v1, 0(t0) + // nop // sll r0, r0, 0 + c->sq(a2, 16, t0); // sq a2, 16(t0) + // nop // sll r0, r0, 0 + c->sw(a3, 4, a1); // sw a3, 4(a1) + // nop // sll r0, r0, 0 + c->sw(a1, 32, t0); // sw a1, 32(t0) + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L85 // beq r0, r0, L85 + // nop // sll r0, r0, 0 + goto block_3; // branch always + + +block_2: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L185 // daddiu a1, fp, L185 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Exceeded max number of collide-cache prims!\n"); + +block_3: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.format = intern_from_c(-1, 0, "format").c(); + gLinkedFunctionTable.reg("(method 10 collide-shape-prim-sphere)", execute, 128); +} + +} // namespace method_10_collide_shape_prim_sphere +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_10_collide_shape_prim_group { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -112); // daddiu sp, sp, -112 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 16, sp); // sq s1, 16(sp) + c->sq(s2, 32, sp); // sq s2, 32(sp) + c->sq(s3, 48, sp); // sq s3, 48(sp) + c->sq(s4, 64, sp); // sq s4, 64(sp) + c->sq(s5, 80, sp); // sq s5, 80(sp) + c->sq(gp, 96, sp); // sq gp, 96(sp) + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s5, a0); // or s5, a0, r0 + c->lbu(s4, 60, a0); // lbu s4, 60(a0) + // nop // sll r0, r0, 0 + c->lq(s3, 60, gp); // lq s3, 60(gp) + // nop // sll r0, r0, 0 + c->lq(s2, 76, gp); // lq s2, 76(gp) + // nop // sll r0, r0, 0 + c->lwu(s1, 92, gp); // lwu s1, 92(gp) + +block_1: + bc = c->sgpr64(s4) == 0; // beq s4, r0, L82 + c->daddiu(s5, s5, 80); // daddiu s5, s5, 80 + if (bc) {goto block_5;} // branch non-likely + + +block_2: + c->daddiu(s4, s4, -1); // daddiu s4, s4, -1 + c->lqc2(vf1, 12, s5); // lqc2 vf1, 12(s5) + // nop // sll r0, r0, 0 + c->lwu(v1, 28, s5); // lwu v1, 28(s5) + c->vsub_bc(DEST::xyzw, BC::w, vf2, vf1, vf1); // vsubw.xyzw vf2, vf1, vf1 + c->and_(v1, s1, v1); // and v1, s1, v1 + c->vadd_bc(DEST::xyzw, BC::w, vf3, vf1, vf1); // vaddw.xyzw vf3, vf1, vf1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L80 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->vftoi0(DEST::xyzw, vf4, vf2); // vftoi0.xyzw vf4, vf2 + c->vftoi0(DEST::xyzw, vf5, vf3); // vftoi0.xyzw vf5, vf3 + c->mov128_gpr_vf(a0, vf4); // qmfc2.i a0, vf4 + c->mov128_gpr_vf(v1, vf5); // qmfc2.i v1, vf5 + c->pcgtw(a0, a0, s2); // pcgtw a0, a0, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(v1, s3, v1); // pcgtw v1, s3, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(v1, a0, v1); // por v1, a0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(v1, r0, v1); // ppach v1, r0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(v1, v1, 16); // dsll v1, v1, 16 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L80 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 56, v1); // lwu t9, 56(v1) + c->mov64(a1, gp); // or a1, gp, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(s4) != 0; // bne s4, r0, L81 + c->daddiu(s5, s5, 80); // daddiu s5, s5, 80 + if (bc) {goto block_2;} // branch non-likely + + +block_5: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 96, sp); // lq gp, 96(sp) + c->lq(s5, 80, sp); // lq s5, 80(sp) + c->lq(s4, 64, sp); // lq s4, 64(sp) + c->lq(s3, 48, sp); // lq s3, 48(sp) + c->lq(s2, 32, sp); // lq s2, 32(sp) + c->lq(s1, 16, sp); // lq s1, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 112); // daddiu sp, sp, 112 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 10 collide-shape-prim-group)", execute, 128); +} + +} // namespace method_10_collide_shape_prim_group +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_11_collide_shape_prim_mesh { +struct Cache { + void* cheat_mode; // *cheat-mode* + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* debug; // debug + void* format; // format + void* print_exceeded_max_cache_tris; // print-exceeded-max-cache-tris +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s3, a2); // or s3, a2, r0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwu(s2, 60, s5); // lwu s2, 60(s5) + c->daddiu(v1, gp, 108); // daddiu v1, gp, 108 + c->lwu(a0, 4, gp); // lwu a0, 4(gp) + bc = c->sgpr64(s2) == c->sgpr64(s7); // beq s2, s7, L62 + // nop // sll r0, r0, 0 + if (bc) {goto block_14;} // branch non-likely + + c->addiu(a1, r0, 100); // addiu a1, r0, 100 + c->dsll(a2, a0, 1); // dsll a2, a0, 1 + bc = c->sgpr64(a0) == c->sgpr64(a1); // beq a0, a1, L60 + c->daddu(a0, a2, a0); // daddu a0, a2, a0 + if (bc) {goto block_11;} // branch non-likely + + c->dsll(a0, a0, 4); // dsll a0, a0, 4 + c->daddu(s4, v1, a0); // daddu s4, v1, a0 + c->mov64(a0, s2); // or a0, s2, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 76, v1); // lwu t9, 76(v1) + c->lwu(v1, 0, s5); // lwu v1, 0(s5) + c->lwu(v1, 136, v1); // lwu v1, 136(v1) + c->lwu(v1, 128, v1); // lwu v1, 128(v1) + c->lb(a1, 8, s5); // lb a1, 8(s5) + c->dsll(a1, a1, 5); // dsll a1, a1, 5 + c->daddu(v1, v1, a1); // daddu v1, v1, a1 + c->lwu(v1, 28, v1); // lwu v1, 28(v1) + c->daddu(a1, r0, v1); // daddu a1, r0, v1 + c->daddiu(a2, s3, 288); // daddiu a2, s3, 288 + get_fake_spad_addr2(a3, cache.fake_scratchpad_data, 0, c);// lui a3, 28672 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + // nop // sll r0, r0, 0 + c->lwu(a0, 4, gp); // lwu a0, 4(gp) + c->addiu(a1, r0, 460); // addiu a1, r0, 460 + c->lwu(v1, 0, gp); // lwu v1, 0(gp) + c->dsll32(a0, a0, 0); // dsll32 a0, a0, 0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf1, a0); // qmtc2.i vf1, a0 + // nop // sll r0, r0, 0 + c->dsubu(a0, a1, v1); // dsubu a0, a1, v1 + c->dsll(t1, v1, 6); // dsll t1, v1, 6 + bc = ((s64)c->sgpr64(a0)) < 0; // bltz a0, L61 + c->daddiu(a2, s2, 28); // daddiu a2, s2, 28 + if (bc) {goto block_12;} // branch non-likely + + c->mov64(a0, v1); // or a0, v1, r0 + c->lwu(a3, 4, s2); // lwu a3, 4(s2) + c->daddiu(t2, gp, 4908); // daddiu t2, gp, 4908 + c->lq(t0, 368, s3); // lq t0, 368(s3) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->lq(t2, 384, s3); // lq t2, 384(s3) + get_fake_spad_addr2(t3, cache.fake_scratchpad_data, 0, c);// lui t3, 28672 + c->lwu(t4, 8, gp); // lwu t4, 8(gp) + c->vsub(DEST::zw, vf1, vf0, vf0); // vsub.zw vf1, vf0, vf0 + // nop // sll r0, r0, 0 + +block_4: + bc = c->sgpr64(a3) == 0; // beq a3, r0, L59 + c->lbu(t5, 0, a2); // lbu t5, 0(a2) + if (bc) {goto block_9;} // branch non-likely + + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + c->lbu(t6, 1, a2); // lbu t6, 1(a2) + c->dsll(t8, t5, 5); // dsll t8, t5, 5 + c->lbu(t5, 2, a2); // lbu t5, 2(a2) + c->dsll(t7, t6, 5); // dsll t7, t6, 5 + c->daddu(t6, t8, t3); // daddu t6, t8, t3 + c->dsll(t5, t5, 5); // dsll t5, t5, 5 + // nop // sll r0, r0, 0 + c->daddu(t7, t7, t3); // daddu t7, t7, t3 + c->lq(t9, 16, t6); // lq t9, 16(t6) + c->daddu(t5, t5, t3); // daddu t5, t5, t3 + c->lq(s3, 16, t7); // lq s3, 16(t7) + // nop // sll r0, r0, 0 + c->lq(t8, 16, t5); // lq t8, 16(t5) + c->pminw(ra, t9, s3); // pminw ra, t9, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxw(t9, t9, s3); // pmaxw t9, t9, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminw(ra, ra, t8); // pminw ra, ra, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxw(t8, t9, t8); // pmaxw t8, t9, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(t9, ra, t2); // pcgtw t9, ra, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(ra, t0, t8); // pcgtw ra, t0, t8 + c->lwu(t8, 4, a2); // lwu t8, 4(a2) + c->por(t9, t9, ra); // por t9, t9, ra + c->lq(t6, 0, t6); // lq t6, 0(t6) + c->ppach(t9, r0, t9); // ppach t9, r0, t9 + c->lq(t7, 0, t7); // lq t7, 0(t7) + c->dsll(t9, t9, 16); // dsll t9, t9, 16 + c->lq(t5, 0, t5); // lq t5, 0(t5) + bc = c->sgpr64(t9) != 0; // bne t9, r0, L58 + c->daddiu(a2, a2, 8); // daddiu a2, a2, 8 + if (bc) {goto block_4;} // branch non-likely + + bc = c->sgpr64(v1) == c->sgpr64(a1); // beq v1, a1, L61 + c->sqc2(vf1, 48, t1); // sqc2 vf1, 48(t1) + if (bc) {goto block_12;} // branch non-likely + + c->and_(t9, t8, t4); // and t9, t8, t4 + c->sw(t8, 48, t1); // sw t8, 48(t1) + // nop // sll r0, r0, 0 + c->sw(s5, 52, t1); // sw s5, 52(t1) + bc = c->sgpr64(t9) != 0; // bne t9, r0, L58 + c->sq(t6, 0, t1); // sq t6, 0(t1) + if (bc) {goto block_4;} // branch non-likely + + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->sq(t7, 16, t1); // sq t7, 16(t1) + // nop // sll r0, r0, 0 + c->sq(t5, 32, t1); // sq t5, 32(t1) + //beq r0, r0, L58 // beq r0, r0, L58 + c->daddiu(t1, t1, 64); // daddiu t1, t1, 64 + goto block_4; // branch always + + +block_9: + c->dsubu(a3, v1, a0); // dsubu a3, v1, a0 + c->lwu(t0, 4, gp); // lwu t0, 4(gp) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L62 + c->lq(a1, 12, s5); // lq a1, 12(s5) + if (bc) {goto block_14;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lq(a2, 28, s5); // lq a2, 28(s5) + // nop // sll r0, r0, 0 + c->sq(r0, 32, s4); // sq r0, 32(s4) + // nop // sll r0, r0, 0 + c->sh(a3, 42, s4); // sh a3, 42(s4) + // nop // sll r0, r0, 0 + c->sw(gp, 32, s4); // sw gp, 32(s4) + // nop // sll r0, r0, 0 + c->sw(s5, 36, s4); // sw s5, 36(s4) + // nop // sll r0, r0, 0 + c->sh(a0, 40, s4); // sh a0, 40(s4) + c->daddiu(a0, t0, 1); // daddiu a0, t0, 1 + c->sq(a1, 0, s4); // sq a1, 0(s4) + // nop // sll r0, r0, 0 + c->sq(a2, 16, s4); // sq a2, 16(s4) + // nop // sll r0, r0, 0 + c->sw(a0, 4, gp); // sw a0, 4(gp) + //beq r0, r0, L62 // beq r0, r0, L62 + c->sw(v1, 0, gp); // sw v1, 0(gp) + goto block_14; // branch always + + +block_11: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L185 // daddiu a1, fp, L185 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Exceeded max number of collide-cache prims!\n"); + //beq r0, r0, L62 // beq r0, r0, L62 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + +block_12: + c->load_symbol_addr(v1, cache.debug); // daddiu v1, s7, debug + c->load_symbol2(a0, cache.cheat_mode); // lw a0, *cheat-mode*(s7) + bc = c->sgpr64(a0) != c->sgpr64(v1); // bne a0, v1, L62 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_14;} // branch non-likely + + c->load_symbol2(t9, cache.print_exceeded_max_cache_tris);// lw t9, print-exceeded-max-cache-tris(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_14: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.cheat_mode = intern_from_c(-1, 0, "*cheat-mode*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.debug = intern_from_c(-1, 0, "debug").c(); + cache.format = intern_from_c(-1, 0, "format").c(); + cache.print_exceeded_max_cache_tris = intern_from_c(-1, 0, "print-exceeded-max-cache-tris").c(); + gLinkedFunctionTable.reg("(method 11 collide-shape-prim-mesh)", execute, 128); +} + +} // namespace method_11_collide_shape_prim_mesh +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_11_collide_shape_prim_sphere { +struct Cache { + void* format; // format +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -16); // daddiu sp, sp, -16 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + // nop // sll r0, r0, 0 + c->daddiu(t0, a1, 108); // daddiu t0, a1, 108 + c->lwu(a3, 4, a1); // lwu a3, 4(a1) + c->addiu(t1, r0, 100); // addiu t1, r0, 100 + c->lq(v1, 12, a0); // lq v1, 12(a0) + c->dsll(t2, a3, 1); // dsll t2, a3, 1 + c->lq(a2, 28, a0); // lq a2, 28(a0) + bc = c->sgpr64(a3) == c->sgpr64(t1); // beq a3, t1, L55 + c->daddu(t1, t2, a3); // daddu t1, t2, a3 + if (bc) {goto block_2;} // branch non-likely + + c->dsll(t1, t1, 4); // dsll t1, t1, 4 + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->daddiu(a3, a3, 1); // daddiu a3, a3, 1 + c->sq(r0, 32, t0); // sq r0, 32(t0) + // nop // sll r0, r0, 0 + c->sw(a0, 36, t0); // sw a0, 36(t0) + // nop // sll r0, r0, 0 + c->sq(v1, 0, t0); // sq v1, 0(t0) + // nop // sll r0, r0, 0 + c->sq(a2, 16, t0); // sq a2, 16(t0) + // nop // sll r0, r0, 0 + c->sw(a3, 4, a1); // sw a3, 4(a1) + // nop // sll r0, r0, 0 + c->sw(a1, 32, t0); // sw a1, 32(t0) + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L56 // beq r0, r0, L56 + // nop // sll r0, r0, 0 + goto block_3; // branch always + + +block_2: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L185 // daddiu a1, fp, L185 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Exceeded max number of collide-cache prims!\n"); + +block_3: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.format = intern_from_c(-1, 0, "format").c(); + gLinkedFunctionTable.reg("(method 11 collide-shape-prim-sphere)", execute, 128); +} + +} // namespace method_11_collide_shape_prim_sphere +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_11_collide_shape_prim_group { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s5, a2); // or s5, a2, r0 + c->mov64(s4, a0); // or s4, a0, r0 + c->lbu(s3, 60, a0); // lbu s3, 60(a0) + // nop // sll r0, r0, 0 + c->lq(s2, 368, s5); // lq s2, 368(s5) + // nop // sll r0, r0, 0 + c->lq(s1, 384, s5); // lq s1, 384(s5) + // nop // sll r0, r0, 0 + c->lwu(s0, 92, gp); // lwu s0, 92(gp) + // nop // sll r0, r0, 0 + c->lqc2(vf28, 288, s5); // lqc2 vf28, 288(s5) + // nop // sll r0, r0, 0 + c->lqc2(vf29, 304, s5); // lqc2 vf29, 304(s5) + // nop // sll r0, r0, 0 + c->lqc2(vf30, 320, s5); // lqc2 vf30, 320(s5) + // nop // sll r0, r0, 0 + c->lqc2(vf31, 336, s5); // lqc2 vf31, 336(s5) + +block_1: + bc = c->sgpr64(s3) == 0; // beq s3, r0, L53 + c->daddiu(s4, s4, 80); // daddiu s4, s4, 80 + if (bc) {goto block_5;} // branch non-likely + + +block_2: + c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 + c->lqc2(vf1, 12, s4); // lqc2 vf1, 12(s4) + // nop // sll r0, r0, 0 + c->lwu(v1, 28, s4); // lwu v1, 28(s4) + c->vmula_bc(DEST::xyzw, BC::w, vf31, vf0); // vmulaw.xyzw acc, vf31, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf28, vf1); // vmaddax.xyzw acc, vf28, vf1 + c->and_(v1, s0, v1); // and v1, s0, v1 + c->vmadda_bc(DEST::xyzw, BC::y, vf29, vf1); // vmadday.xyzw acc, vf29, vf1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L51 + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf30, vf1); // vmaddz.xyzw vf10, vf30, vf1 + if (bc) {goto block_1;} // branch non-likely + + c->vsub_bc(DEST::xyz, BC::w, vf2, vf10, vf1); // vsubw.xyz vf2, vf10, vf1 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::xyz, BC::w, vf3, vf10, vf1); // vaddw.xyz vf3, vf10, vf1 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf4, vf2); // vftoi0.xyzw vf4, vf2 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf5, vf3); // vftoi0.xyzw vf5, vf3 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a0, vf4); // qmfc2.i a0, vf4 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(v1, vf5); // qmfc2.i v1, vf5 + // nop // sll r0, r0, 0 + c->pcgtw(a0, a0, s1); // pcgtw a0, a0, s1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(v1, s2, v1); // pcgtw v1, s2, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(v1, a0, v1); // por v1, a0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(v1, r0, v1); // ppach v1, r0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(v1, v1, 16); // dsll v1, v1, 16 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L51 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(a0, s4); // or a0, s4, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 60, v1); // lwu t9, 60(v1) + c->mov64(a1, gp); // or a1, gp, r0 + c->mov64(a2, s5); // or a2, s5, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(s3) != 0; // bne s3, r0, L52 + c->daddiu(s4, s4, 80); // daddiu s4, s4, 80 + if (bc) {goto block_2;} // branch non-likely + + +block_5: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 11 collide-shape-prim-group)", execute, 256); +} + +} // namespace method_11_collide_shape_prim_group +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_9_collide_cache_prim { +struct Cache { + void* moving_sphere_triangle_intersect; // moving-sphere-triangle-intersect +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -672); // daddiu sp, sp, -672 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 576, sp); // sq s1, 576(sp) + c->sq(s2, 592, sp); // sq s2, 592(sp) + c->sq(s3, 608, sp); // sq s3, 608(sp) + c->sq(s4, 624, sp); // sq s4, 624(sp) + c->sq(s5, 640, sp); // sq s5, 640(sp) + c->sq(gp, 656, sp); // sq gp, 656(sp) + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s5, a2); // or s5, a2, r0 + c->mov64(s4, a3); // or s4, a3, r0 + c->daddiu(s3, sp, 16); // daddiu s3, sp, 16 + // nop // sll r0, r0, 0 + c->mtc1(f0, r0); // mtc1 f0, r0 + c->sw(t1, 8, s3); // sw t1, 8(s3) + c->mtc1(f1, t0); // mtc1 f1, t0 + c->lhu(v1, 40, a0); // lhu v1, 40(a0) + // nop // sll r0, r0, 0 + c->lwu(a1, 32, a0); // lwu a1, 32(a0) + cop1_bc = c->fprs[f0] <= c->fprs[f1]; // c.le.s f0, f1 + c->dsll(v1, v1, 6); // dsll v1, v1, 6 + bc = cop1_bc; // bc1t L37 + c->daddiu(a1, a1, 4908); // daddiu a1, a1, 4908 + if (bc) {goto block_2;} // branch non-likely + + c->lui(a2, 16384); // lui a2, 16384 + c->mtc1(f1, a2); // mtc1 f1, a2 + +block_2: + c->daddu(s2, a1, v1); // daddu s2, a1, v1 + c->swc1(f1, 0, s3); // swc1 f1, 0(s3) + // nop // sll r0, r0, 0 + c->lhu(s1, 42, a0); // lhu s1, 42(a0) + // nop // sll r0, r0, 0 + c->swc1(f1, 4, s3); // swc1 f1, 4(s3) + +block_3: + bc = c->sgpr64(s1) == 0; // beq s1, r0, L40 + c->daddiu(s1, s1, -1); // daddiu s1, s1, -1 + if (bc) {goto block_14;} // branch non-likely + + c->load_symbol2(t9, cache.moving_sphere_triangle_intersect);// lw t9, moving-sphere-triangle-intersect(s7) + c->mov64(a0, s5); // or a0, s5, r0 + c->mov64(a1, s4); // or a1, s4, r0 + c->lwc1(f0, 12, s5); // lwc1 f0, 12(s5) + c->mfc1(a2, f0); // mfc1 a2, f0 + c->daddu(a3, r0, s2); // daddu a3, r0, s2 + c->daddiu(t0, s3, 64); // daddiu t0, s3, 64 + c->daddiu(t1, s3, 80); // daddiu t1, s3, 80 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + // nop // sll r0, r0, 0 + c->mtc1(f0, r0); // mtc1 f0, r0 + c->lqc2(vf1, 0, s4); // lqc2 vf1, 0(s4) + c->mtc1(f2, v1); // mtc1 f2, v1 + c->lwc1(f1, 0, s3); // lwc1 f1, 0(s3) + cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0 + c->lqc2(vf2, 80, s3); // lqc2 vf2, 80(s3) + if (cop1_bc) { // bc1tl L38 + c->daddiu(s2, s2, 64); // daddiu s2, s2, 64 + goto block_3; + } + +// block_6: + cop1_bc = c->fprs[f1] <= c->fprs[f2]; // c.le.s f1, f2 + c->lqc2(vf3, 64, s3); // lqc2 vf3, 64(s3) + if (cop1_bc) { // bc1tl L38 + c->daddiu(s2, s2, 64); // daddiu s2, s2, 64 + goto block_3; + } + +// block_8: + c->vmul(DEST::xyzw, vf5, vf1, vf2); // vmul.xyzw vf5, vf1, vf2 + c->lqc2(vf4, 0, s5); // lqc2 vf4, 0(s5) + // nop // sll r0, r0, 0 + c->lwu(v1, 8, s3); // lwu v1, 8(s3) + c->vsub(DEST::xyzw, vf7, vf4, vf3); // vsub.xyzw vf7, vf4, vf3 + c->andi(v1, v1, 1); // andi v1, v1, 1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L39 + c->vadd_bc(DEST::x, BC::y, vf5, vf5, vf5); // vaddy.x vf5, vf5, vf5 + if (bc) {goto block_13;} // branch non-likely + + c->vmul(DEST::xyzw, vf6, vf7, vf2); // vmul.xyzw vf6, vf7, vf2 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf5, vf5, vf5); // vaddz.x vf5, vf5, vf5 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::y, vf6, vf6, vf6); // vaddy.x vf6, vf6, vf6 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(v1, vf5); // qmfc2.i v1, vf5 + // nop // sll r0, r0, 0 + c->mtc1(f3, v1); // mtc1 f3, v1 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f0] <= c->fprs[f3]; // c.le.s f0, f3 + // nop // sll r0, r0, 0 + if (cop1_bc) { // bc1tl L38 + c->daddiu(s2, s2, 64); // daddiu s2, s2, 64 + goto block_3; + } + +// block_11: + c->vadd_bc(DEST::x, BC::z, vf6, vf6, vf6); // vaddz.x vf6, vf6, vf6 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(v1, vf6); // qmfc2.i v1, vf6 + // nop // sll r0, r0, 0 + c->mtc1(f4, v1); // mtc1 f4, v1 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f4] < c->fprs[f0]; // c.lt.s f4, f0 + // nop // sll r0, r0, 0 + if (cop1_bc) { // bc1tl L38 + c->daddiu(s2, s2, 64); // daddiu s2, s2, 64 + goto block_3; + } + +block_13: + c->lqc2(vf8, 0, s2); // lqc2 vf8, 0(s2) + c->lqc2(vf9, 16, s2); // lqc2 vf9, 16(s2) + c->lqc2(vf10, 32, s2); // lqc2 vf10, 32(s2) + c->lwu(v1, 48, s2); // lwu v1, 48(s2) + c->lw(a0, 52, s2); // lw a0, 52(s2) + c->swc1(f2, 0, s3); // swc1 f2, 0(s3) + c->sqc2(vf3, 48, gp); // sqc2 vf3, 48(gp) + c->sqc2(vf2, 64, gp); // sqc2 vf2, 64(gp) + c->sqc2(vf8, 0, gp); // sqc2 vf8, 0(gp) + c->sqc2(vf9, 16, gp); // sqc2 vf9, 16(gp) + c->sqc2(vf10, 32, gp); // sqc2 vf10, 32(gp) + c->sw(v1, 80, gp); // sw v1, 80(gp) + c->sw(a0, 84, gp); // sw a0, 84(gp) + //beq r0, r0, L38 // beq r0, r0, L38 + c->daddiu(s2, s2, 64); // daddiu s2, s2, 64 + goto block_3; // branch always + + +block_14: + c->lwc1(f1, 0, s3); // lwc1 f1, 0(s3) + c->lwc1(f5, 4, s3); // lwc1 f5, 4(s3) + cop1_bc = c->fprs[f1] == c->fprs[f5]; // c.eq.s f1, f5 + if (!cop1_bc) { // bc1fl L41 + c->mfc1(v0, f1); // mfc1 v0, f1 + goto block_17; + } + +// block_16: + c->lui(v0, -13122); // lui v0, -13122 + c->ori(v0, v0, 48160); // ori v0, v0, 48160 + +block_17: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 656, sp); // lq gp, 656(sp) + c->lq(s5, 640, sp); // lq s5, 640(sp) + c->lq(s4, 624, sp); // lq s4, 624(sp) + c->lq(s3, 608, sp); // lq s3, 608(sp) + c->lq(s2, 592, sp); // lq s2, 592(sp) + c->lq(s1, 576, sp); // lq s1, 576(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 672); // daddiu sp, sp, 672 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.moving_sphere_triangle_intersect = intern_from_c(-1, 0, "moving-sphere-triangle-intersect").c(); + gLinkedFunctionTable.reg("(method 9 collide-cache-prim)", execute, 1024); +} + +} // namespace method_9_collide_cache_prim +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_10_collide_cache_prim { +struct Cache { + void* moving_sphere_sphere_intersect; // moving-sphere-sphere-intersect +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + c->mov64(s3, a0); // or s3, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s5, a3); // or s5, a3, r0 + c->mov64(s2, t0); // or s2, t0, r0 + c->mov64(s4, t1); // or s4, t1, r0 + c->daddiu(s1, sp, 16); // daddiu s1, sp, 16 + c->load_symbol2(t9, cache.moving_sphere_sphere_intersect);// lw t9, moving-sphere-sphere-intersect(s7) + c->mov64(a0, a2); // or a0, a2, r0 + c->mov64(a1, s5); // or a1, s5, r0 + c->daddu(a2, r0, s3); // daddu a2, r0, s3 + c->mov64(a3, s1); // or a3, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f3, v0); // mtc1 f3, v0 + c->lui(v1, -13122); // lui v1, -13122 + c->ori(v1, v1, 48160); // ori v1, v1, 48160 + c->mtc1(f4, v1); // mtc1 f4, v1 + c->mtc1(f0, r0); // mtc1 f0, r0 + c->lqc2(vf4, 0, s1); // lqc2 vf4, 0(s1) + c->movs(f1, f3); // mov.s f1, f3 + c->lqc2(vf5, 0, s3); // lqc2 vf5, 0(s3) + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + c->vmove(DEST::xyzw, vf1, vf0); // vmove.xyzw vf1, vf0 + bc = cop1_bc; // bc1t L35 + c->mtc1(f2, s2); // mtc1 f2, s2 + if (bc) {goto block_11;} // branch non-likely + + cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0 + c->vsub(DEST::xyz, vf1, vf4, vf5); // vsub.xyz vf1, vf4, vf5 + bc = cop1_bc; // bc1t L32 + c->lwu(v1, 36, s3); // lwu v1, 36(s3) + if (bc) {goto block_4;} // branch non-likely + + cop1_bc = c->fprs[f2] <= c->fprs[f1]; // c.le.s f2, f1 + // nop // sll r0, r0, 0 + if (cop1_bc) { // bc1tl L35 + c->movs(f3, f4); // mov.s f3, f4 + goto block_11; + } + +block_4: + c->andi(a0, s4, 1); // andi a0, s4, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L33 + c->lqc2(vf15, 0, s5); // lqc2 vf15, 0(s5) + if (bc) {goto block_7;} // branch non-likely + + c->vmul(DEST::xyzw, vf16, vf15, vf1); // vmul.xyzw vf16, vf15, vf1 + c->vadd_bc(DEST::y, BC::x, vf16, vf16, vf16); // vaddx.y vf16, vf16, vf16 + c->vadd_bc(DEST::y, BC::z, vf16, vf16, vf16); // vaddz.y vf16, vf16, vf16 + c->mov128_gpr_vf(a0, vf16); // qmfc2.i a0, vf16 + if (((s64)c->sgpr64(a0)) >= 0) { // bgezl a0, L35 + c->movs(f3, f4); // mov.s f3, f4 + goto block_11; + } + +block_7: + // daddiu a0, fp, L181 // daddiu a0, fp, L181 + // .word 0x0 + // .word 0x45800000 + // .word 0x0 + // .word 0x3f800000 + // .word 0x0 + // .word 0xc5800000 + // .word 0x45800000 + // .word 0x3f800000 + // .word 0x0 + // .word 0xc5800000 + // .word 0xc5800000 + // .word 0x3f800000 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf12, vf1, vf1); // vmul.xyzw vf12, vf1, vf1 + c->sqc2(vf4, 48, gp); // sqc2 vf4, 48(gp) + c->vmula_bc(DEST::w, BC::x, vf0, vf12); // vmulax.w acc, vf0, vf12 + // c->lqc2(vf9, 0, a0); // lqc2 vf9, 0(a0) + c->vfs[9].vf.set_u32s(0, 0x45800000, 0, 0x3f800000); + c->vmadda_bc(DEST::w, BC::y, vf0, vf12); // vmadday.w acc, vf0, vf12 + // c->lqc2(vf10, 16, a0); // lqc2 vf10, 16(a0) + c->vfs[10].vf.set_u32s(0, 0xc5800000, 0x45800000, 0x3f800000); + c->vmadd_bc(DEST::w, BC::z, vf12, vf0, vf12); // vmaddz.w vf12, vf0, vf12 + // c->lqc2(vf11, 32, a0); // lqc2 vf11, 32(a0) + c->vfs[11].vf.set_u32s(0, 0xc5800000, 0xc5800000, 0x3f800000); + c->vrsqrt(vf0, BC::w, vf12, BC::w); // vrsqrt Q, vf0.w, vf12.w + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + c->lwu(a0, 60, v1); // lwu a0, 60(v1) + c->vmulq(DEST::xyz, vf1, vf1); // vmulq.xyz vf1, vf1, Q + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf14, vf1, vf1); // vmul.xyzw vf14, vf1, vf1 + c->sqc2(vf1, 64, gp); // sqc2 vf1, 64(gp) + c->vabs(DEST::xyzw, vf13, vf1); // vabs.xyzw vf13, vf1 + c->sw(a0, 80, gp); // sw a0, 80(gp) + c->vmove(DEST::xyzw, vf2, vf0); // vmove.xyzw vf2, vf0 + c->sw(v1, 84, gp); // sw v1, 84(gp) + c->vadd_bc(DEST::x, BC::y, vf14, vf14, vf14); // vaddy.x vf14, vf14, vf14 + c->mov128_gpr_vf(v1, vf13); // qmfc2.i v1, vf13 + if (((s64)c->sgpr64(v1)) == ((s64)0)) { // beql v1, r0, L34 + c->vadd_bc(DEST::x, BC::z, vf2, vf0, vf1); // vaddz.x vf2, vf0, vf1 + goto block_10; + } + +// block_9: + c->vsub_bc(DEST::x, BC::y, vf2, vf0, vf1); // vsuby.x vf2, vf0, vf1 + // nop // sll r0, r0, 0 + c->vrsqrt(vf0, BC::w, vf14, BC::x); // vrsqrt Q, vf0.w, vf14.x + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::x, vf2, vf0, vf1); // vaddx.y vf2, vf0, vf1 + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xy, vf2, vf2); // vmulq.xy vf2, vf2, Q + // nop // sll r0, r0, 0 + +block_10: + c->vopmula(vf1, vf2); // vopmula.xyz acc, vf1, vf2 + // nop // sll r0, r0, 0 + c->vopmsub(vf3, vf2, vf1); // vopmsub.xyz vf3, vf2, vf1 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf9); // vmaddax.xyzw acc, vf1, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf9); // vmadday.xyzw acc, vf2, vf9 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyz, BC::z, vf9, vf3, vf9); // vmaddz.xyz vf9, vf3, vf9 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf10); // vmaddax.xyzw acc, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf10); // vmadday.xyzw acc, vf2, vf10 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyz, BC::z, vf10, vf3, vf10); // vmaddz.xyz vf10, vf3, vf10 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf11); // vmaddax.xyzw acc, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf11); // vmadday.xyzw acc, vf2, vf11 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyz, BC::z, vf11, vf3, vf11); // vmaddz.xyz vf11, vf3, vf11 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf9, 0, gp); // sqc2 vf9, 0(gp) + // nop // sll r0, r0, 0 + c->sqc2(vf10, 16, gp); // sqc2 vf10, 16(gp) + // nop // sll r0, r0, 0 + c->sqc2(vf11, 32, gp); // sqc2 vf11, 32(gp) + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_11: + c->mfc1(v0, f3); // mfc1 v0, f3 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.moving_sphere_sphere_intersect = intern_from_c(-1, 0, "moving-sphere-sphere-intersect").c(); + gLinkedFunctionTable.reg("(method 10 collide-cache-prim)", execute, 256); +} + +} // namespace method_10_collide_cache_prim +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_17_collide_cache { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* collide_puss_work; // collide-puss-work + void* format; // format +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->mov64(gp, a1); // or gp, a1, r0 + get_fake_spad_addr2(s5, cache.fake_scratchpad_data, 0, c);// lui s5, 28672 + c->addiu(a3, r0, 64); // addiu a3, r0, 64 + c->lwu(a2, 116, gp); // lwu a2, 116(gp) + c->daddiu(v1, s5, 96); // daddiu v1, s5, 96 + c->lwu(a1, 112, gp); // lwu a1, 112(gp) + c->dsubu(a3, a2, a3); // dsubu a3, a2, a3 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(a3)) > 0; // bgtz a3, L26 + // nop // sll r0, r0, 0 + if (bc) {goto block_20;} // branch non-likely + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L19 + c->lqc2(vf1, 0, a1); // lqc2 vf1, 0(a1) + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->vsub_bc(DEST::xyz, BC::w, vf2, vf1, vf1); // vsubw.xyz vf2, vf1, vf1 + c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1) + c->vadd_bc(DEST::xyz, BC::w, vf3, vf1, vf1); // vaddw.xyz vf3, vf1, vf1 + c->daddiu(v1, v1, 48); // daddiu v1, v1, 48 + c->vftoi0(DEST::xyzw, vf4, vf2); // vftoi0.xyzw vf4, vf2 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf5, vf3); // vftoi0.xyzw vf5, vf3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf4, -32, v1); // sqc2 vf4, -32(v1) + // nop // sll r0, r0, 0 + c->sqc2(vf5, -16, v1); // sqc2 vf5, -16(v1) + +block_3: + bc = c->sgpr64(a2) == 0; // beq a2, r0, L19 + c->lqc2(vf1, 0, a1); // lqc2 vf1, 0(a1) + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->vsub_bc(DEST::xyz, BC::w, vf4, vf1, vf1); // vsubw.xyz vf4, vf1, vf1 + c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1) + c->vadd_bc(DEST::xyz, BC::w, vf5, vf1, vf1); // vaddw.xyz vf5, vf1, vf1 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyz, vf2, vf2, vf4); // vmini.xyz vf2, vf2, vf4 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyz, vf3, vf3, vf5); // vmax.xyz vf3, vf3, vf5 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf4, vf4); // vftoi0.xyzw vf4, vf4 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf5, vf5); // vftoi0.xyzw vf5, vf5 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf4, 16, v1); // sqc2 vf4, 16(v1) + // nop // sll r0, r0, 0 + c->sqc2(vf5, 32, v1); // sqc2 vf5, 32(v1) + //beq r0, r0, L18 // beq r0, r0, L18 + c->daddiu(v1, v1, 48); // daddiu v1, v1, 48 + goto block_3; // branch always + + +block_5: + c->vftoi0(DEST::xyzw, vf2, vf2); // vftoi0.xyzw vf2, vf2 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf2, 64, s5); // sqc2 vf2, 64(s5) + // nop // sll r0, r0, 0 + c->sqc2(vf3, 80, s5); // sqc2 vf3, 80(s5) + c->daddiu(s4, a0, 108); // daddiu s4, a0, 108 + c->lwu(s3, 100, gp); // lwu s3, 100(gp) + c->lw(s2, 4, a0); // lw s2, 4(a0) + //beq r0, r0, L25 // beq r0, r0, L25 + // nop // sll r0, r0, 0 + goto block_18; // branch always + + +block_6: + c->daddiu(s2, s2, -1); // daddiu s2, s2, -1 + c->lwu(v1, 16, s4); // lwu v1, 16(s4) + c->and_(v1, s3, v1); // and v1, s3, v1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L24 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_17;} // branch non-likely + + c->lwu(v1, 120, gp); // lwu v1, 120(gp) + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L21 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + goto block_10; + } + +// block_9: + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + c->lwu(a0, 24, s4); // lwu a0, 24(s4) + c->andi(a0, a0, 1); // andi a0, a0, 1 + c->movz(v1, s7, a0); // movz v1, s7, a0 + +block_10: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L24 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_17;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->lb(v1, 28, s4); // lb v1, 28(s4) + c->slt(v1, v1, r0); // slt v1, v1, r0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L22 + // nop // sll r0, r0, 0 + if (bc) {goto block_13;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->load_symbol2(v1, cache.collide_puss_work); // lw v1, collide-puss-work(s7) + c->lwu(t9, 52, v1); // lwu t9, 52(v1) + c->mov64(a1, s4); // or a1, s4, r0 + c->mov64(a2, gp); // or a2, gp, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->mov64(a0, v1); // or a0, v1, r0 + //beq r0, r0, L23 // beq r0, r0, L23 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + +block_13: + c->mov64(a0, s5); // or a0, s5, r0 + c->load_symbol2(v1, cache.collide_puss_work); // lw v1, collide-puss-work(s7) + c->lwu(t9, 56, v1); // lwu t9, 56(v1) + c->mov64(a1, s4); // or a1, s4, r0 + c->mov64(a2, gp); // or a2, gp, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->mov64(a0, v1); // or a0, v1, r0 + +block_14: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L24 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_17;} // branch non-likely + + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->mov64(v0, v1); // or v0, v1, r0 + //beq r0, r0, L28 // beq r0, r0, L28 + // nop // sll r0, r0, 0 + goto block_22; // branch always + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_17: + c->daddiu(s4, s4, 48); // daddiu s4, s4, 48 + +block_18: + bc = c->sgpr64(s2) != 0; // bne s2, r0, L20 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + //beq r0, r0, L27 // beq r0, r0, L27 + // nop // sll r0, r0, 0 + goto block_21; // branch always + + +block_20: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L180 // daddiu a1, fp, L180 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Exceeded max # of spheres in collide-cache::probe-using-spheres!\n"); + +block_21: + c->mov64(v0, s7); // or v0, s7, r0 + +block_22: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.collide_puss_work = intern_from_c(-1, 0, "collide-puss-work").c(); + cache.format = intern_from_c(-1, 0, "format").c(); + gLinkedFunctionTable.reg("(method 17 collide-cache)", execute, 128); +} + +} // namespace method_17_collide_cache +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_9_collide_puss_work { +struct Cache { + void* closest_pt_in_triangle; // closest-pt-in-triangle +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a2); // or s5, a2, r0 + // nop // sll r0, r0, 0 + c->lwu(a0, 32, a1); // lwu a0, 32(a1) + // nop // sll r0, r0, 0 + c->lhu(v1, 40, a1); // lhu v1, 40(a1) + c->daddiu(a0, a0, 4908); // daddiu a0, a0, 4908 + c->lhu(s4, 42, a1); // lhu s4, 42(a1) + c->dsll(v1, v1, 6); // dsll v1, v1, 6 + // nop // sll r0, r0, 0 + c->daddu(s3, a0, v1); // daddu s3, a0, v1 + // nop // sll r0, r0, 0 + +block_1: + bc = c->sgpr64(s4) == 0; // beq s4, r0, L15 + c->lqc2(vf1, 0, s3); // lqc2 vf1, 0(s3) + if (bc) {goto block_12;} // branch non-likely + + c->daddiu(s4, s4, -1); // daddiu s4, s4, -1 + c->lqc2(vf2, 16, s3); // lqc2 vf2, 16(s3) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, s3); // lqc2 vf3, 32(s3) + c->vsub(DEST::xyzw, vf4, vf2, vf1); // vsub.xyzw vf4, vf2, vf1 + c->lq(a1, 64, gp); // lq a1, 64(gp) + c->vsub(DEST::xyzw, vf5, vf3, vf1); // vsub.xyzw vf5, vf3, vf1 + c->lq(v1, 80, gp); // lq v1, 80(gp) + c->vmini(DEST::xyzw, vf6, vf1, vf2); // vmini.xyzw vf6, vf1, vf2 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf7, vf1, vf2); // vmax.xyzw vf7, vf1, vf2 + // nop // sll r0, r0, 0 + c->vopmula(vf4, vf5); // vopmula.xyz acc, vf4, vf5 + // nop // sll r0, r0, 0 + c->vmove(DEST::xyzw, vf8, vf0); // vmove.xyzw vf8, vf0 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf6, vf6, vf3); // vmini.xyzw vf6, vf6, vf3 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf7, vf7, vf3); // vmax.xyzw vf7, vf7, vf3 + // nop // sll r0, r0, 0 + c->vopmsub(vf8, vf5, vf4); // vopmsub.xyz vf8, vf5, vf4 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf6, vf6); // vftoi0.xyzw vf6, vf6 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf7, vf7); // vftoi0.xyzw vf7, vf7 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf9, vf8, vf8); // vmul.xyzw vf9, vf8, vf8 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a0, vf6); // qmfc2.i a0, vf6 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a2, vf7); // qmfc2.i a2, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::w, BC::x, vf0, vf9); // vmulax.w acc, vf0, vf9 + c->sqc2(vf6, 32, gp); // sqc2 vf6, 32(gp) + c->vmadda_bc(DEST::w, BC::y, vf0, vf9); // vmadday.w acc, vf0, vf9 + c->sqc2(vf7, 48, gp); // sqc2 vf7, 48(gp) + c->vmadd_bc(DEST::w, BC::z, vf9, vf0, vf9); // vmaddz.w vf9, vf0, vf9 + // nop // sll r0, r0, 0 + c->pcgtw(a1, a1, a2); // pcgtw a1, a1, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(v1, a0, v1); // pcgtw v1, a0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(v1, a1, v1); // por v1, a1, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->vrsqrt(vf0, BC::w, vf9, BC::w); // vrsqrt Q, vf0.w, vf9.w + // nop // sll r0, r0, 0 + c->ppach(v1, r0, v1); // ppach v1, r0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(v1, v1, 16); // dsll v1, v1, 16 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(v1)) != ((s64)0)) { // bnel v1, r0, L13 + c->daddiu(s3, s3, 64); // daddiu s3, s3, 64 + goto block_1; + } + +// block_4: + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf8, vf8); // vmulq.xyz vf8, vf8, Q + c->daddiu(s2, gp, 96); // daddiu s2, gp, 96 + // nop // sll r0, r0, 0 + c->lwu(s1, 116, s5); // lwu s1, 116(s5) + c->gprs[s0].du64[0] = 0; // or s0, r0, r0 + c->sqc2(vf8, 16, gp); // sqc2 vf8, 16(gp) + +block_5: + if (((s64)c->sgpr64(s0)) == ((s64)c->sgpr64(s1))) {// beql s0, s1, L13 + c->daddiu(s3, s3, 64); // daddiu s3, s3, 64 + goto block_1; + } + +// block_7: + c->daddiu(s0, s0, 1); // daddiu s0, s0, 1 + c->lq(a1, 16, s2); // lq a1, 16(s2) + // nop // sll r0, r0, 0 + c->lq(a2, 48, gp); // lq a2, 48(gp) + // nop // sll r0, r0, 0 + c->lq(v1, 32, s2); // lq v1, 32(s2) + // nop // sll r0, r0, 0 + c->lq(a0, 32, gp); // lq a0, 32(gp) + c->pcgtw(a1, a1, a2); // pcgtw a1, a1, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(v1, a0, v1); // pcgtw v1, a0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(v1, a1, v1); // por v1, a1, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(v1, r0, v1); // ppach v1, r0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(v1, v1, 16); // dsll v1, v1, 16 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(v1)) != ((s64)0)) { // bnel v1, r0, L14 + c->daddiu(s2, s2, 48); // daddiu s2, s2, 48 + goto block_5; + } + +// block_9: + c->load_symbol2(t9, cache.closest_pt_in_triangle);// lw t9, closest-pt-in-triangle(s7) + c->daddu(a0, r0, gp); // daddu a0, r0, gp + c->daddu(a1, r0, s2); // daddu a1, r0, s2 + c->daddu(a2, r0, s3); // daddu a2, r0, s3 + c->daddiu(a3, gp, 16); // daddiu a3, gp, 16 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lqc2(vf10, 0, gp); // lqc2 vf10, 0(gp) + c->lqc2(vf11, 0, s2); // lqc2 vf11, 0(s2) + c->daddiu(s2, s2, 48); // daddiu s2, s2, 48 + c->vsub(DEST::xyz, vf9, vf10, vf11); // vsub.xyz vf9, vf10, vf11 + c->vmul(DEST::w, vf11, vf11, vf11); // vmul.w vf11, vf11, vf11 + c->vmul(DEST::xyzw, vf9, vf9, vf9); // vmul.xyzw vf9, vf9, vf9 + c->vmula_bc(DEST::w, BC::x, vf0, vf9); // vmulax.w acc, vf0, vf9 + c->vmadda_bc(DEST::w, BC::y, vf0, vf9); // vmadday.w acc, vf0, vf9 + c->vmadd_bc(DEST::w, BC::z, vf9, vf0, vf9); // vmaddz.w vf9, vf0, vf9 + c->vsub(DEST::w, vf9, vf9, vf11); // vsub.w vf9, vf9, vf11 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + c->pcpyud(v1, v1, v1); // pcpyud v1, v1, v1 + if (((s64)c->sgpr64(v1)) > 0) { // bgtzl v1, L14 + // nop // sll r0, r0, 0 + goto block_5; + } + +// block_11: + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->mov64(v0, v1); // or v0, v1, r0 + //beq r0, r0, L16 // beq r0, r0, L16 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + +block_12: + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L16 // beq r0, r0, L16 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_14: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.closest_pt_in_triangle = intern_from_c(-1, 0, "closest-pt-in-triangle").c(); + gLinkedFunctionTable.reg("(method 9 collide-puss-work)", execute, 256); +} + +} // namespace method_9_collide_puss_work +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_10_collide_puss_work { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwu(v1, 116, a2); // lwu v1, 116(a2) + c->daddiu(a2, a0, 96); // daddiu a2, a0, 96 + c->lqc2(vf1, 0, a1); // lqc2 vf1, 0(a1) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L10 + c->lq(a1, 64, a0); // lq a1, 64(a0) + if (bc) {goto block_12;} // branch non-likely + + c->vmax_bc(DEST::xyzw, BC::w, vf4, vf0, vf0); // vmaxw.xyzw vf4, vf0, vf0 + c->lq(a3, 80, a0); // lq a3, 80(a0) + c->vsub_bc(DEST::xyz, BC::w, vf2, vf1, vf1); // vsubw.xyz vf2, vf1, vf1 + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + c->vadd_bc(DEST::xyz, BC::w, vf3, vf1, vf1); // vaddw.xyz vf3, vf1, vf1 + c->lqc2(vf5, 0, a2); // lqc2 vf5, 0(a2) + c->vftoi0(DEST::xyzw, vf2, vf2); // vftoi0.xyzw vf2, vf2 + c->lqc2(vf6, 48, a2); // lqc2 vf6, 48(a2) + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + c->lqc2(vf7, 96, a2); // lqc2 vf7, 96(a2) + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::w, BC::w, vf1, vf0, vf1); // vsubw.w vf1, vf0, vf1 + c->mov128_gpr_vf(t0, vf2); // qmfc2.i t0, vf2 + c->lqc2(vf8, 144, a2); // lqc2 vf8, 144(a2) + c->mov128_gpr_vf(t1, vf3); // qmfc2.i t1, vf3 + // nop // sll r0, r0, 0 + c->pcgtw(a1, a1, t1); // pcgtw a1, a1, t1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(a3, t0, a3); // pcgtw a3, t0, a3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(a1, a1, a3); // por a1, a1, a3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(a1, r0, a1); // ppach a1, r0, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(a1, a1, 16); // dsll a1, a1, 16 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L10 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + +block_2: + c->vsub(DEST::xyzw, vf9, vf5, vf1); // vsub.xyzw vf9, vf5, vf1 + c->daddiu(a2, a2, 192); // daddiu a2, a2, 192 + c->vsub(DEST::xyzw, vf10, vf6, vf1); // vsub.xyzw vf10, vf6, vf1 + c->lqc2(vf5, 0, a2); // lqc2 vf5, 0(a2) + c->vsub(DEST::xyzw, vf11, vf7, vf1); // vsub.xyzw vf11, vf7, vf1 + c->lqc2(vf6, 48, a2); // lqc2 vf6, 48(a2) + c->vsub(DEST::xyzw, vf12, vf8, vf1); // vsub.xyzw vf12, vf8, vf1 + c->lqc2(vf7, 96, a2); // lqc2 vf7, 96(a2) + c->vmul(DEST::xyzw, vf9, vf9, vf9); // vmul.xyzw vf9, vf9, vf9 + c->lqc2(vf8, 144, a2); // lqc2 vf8, 144(a2) + c->vmul(DEST::xyzw, vf10, vf10, vf10); // vmul.xyzw vf10, vf10, vf10 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf11, vf11, vf11); // vmul.xyzw vf11, vf11, vf11 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf12, vf12, vf12); // vmul.xyzw vf12, vf12, vf12 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf4, vf9); // vmulax.xyzw acc, vf4, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf4, vf9); // vmadday.xyzw acc, vf4, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf4, vf9); // vmaddaz.xyzw acc, vf4, vf9 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf9, vf4, vf9); // vmsubw.xyzw vf9, vf4, vf9 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf4, vf10); // vmulax.xyzw acc, vf4, vf10 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf4, vf10); // vmadday.xyzw acc, vf4, vf10 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf4, vf10); // vmaddaz.xyzw acc, vf4, vf10 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf10, vf4, vf10); // vmsubw.xyzw vf10, vf4, vf10 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a1, vf9); // qmfc2.i a1, vf9 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + bc = ((s64)c->sgpr64(a1)) <= 0; // blez a1, L9 + c->vmula_bc(DEST::xyzw, BC::x, vf4, vf11); // vmulax.xyzw acc, vf4, vf11 + if (bc) {goto block_11;} // branch non-likely + + bc = c->sgpr64(a0) == c->sgpr64(v1); // beq a0, v1, L10 + c->vmadda_bc(DEST::xyzw, BC::y, vf4, vf11); // vmadday.xyzw acc, vf4, vf11 + if (bc) {goto block_12;} // branch non-likely + + c->vmadda_bc(DEST::xyzw, BC::z, vf4, vf11); // vmaddaz.xyzw acc, vf4, vf11 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf11, vf4, vf11); // vmsubw.xyzw vf11, vf4, vf11 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a1, vf10); // qmfc2.i a1, vf10 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + bc = ((s64)c->sgpr64(a1)) <= 0; // blez a1, L9 + c->vmula_bc(DEST::xyzw, BC::x, vf4, vf12); // vmulax.xyzw acc, vf4, vf12 + if (bc) {goto block_11;} // branch non-likely + + bc = c->sgpr64(a0) == c->sgpr64(v1); // beq a0, v1, L10 + c->vmadda_bc(DEST::xyzw, BC::y, vf4, vf12); // vmadday.xyzw acc, vf4, vf12 + if (bc) {goto block_12;} // branch non-likely + + c->vmadda_bc(DEST::xyzw, BC::z, vf4, vf12); // vmaddaz.xyzw acc, vf4, vf12 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf12, vf4, vf12); // vmsubw.xyzw vf12, vf4, vf12 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a1, vf11); // qmfc2.i a1, vf11 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + bc = ((s64)c->sgpr64(a1)) <= 0; // blez a1, L9 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + bc = c->sgpr64(a0) == c->sgpr64(v1); // beq a0, v1, L10 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + c->mov128_gpr_vf(a1, vf12); // qmfc2.i a1, vf12 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + bc = ((s64)c->sgpr64(a1)) <= 0; // blez a1, L9 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + bc = c->sgpr64(a0) != c->sgpr64(v1); // bne a0, v1, L8 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + //beq r0, r0, L10 // beq r0, r0, L10 + // nop // sll r0, r0, 0 + goto block_12; // branch always + + +block_11: + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->mov64(v0, v1); // or v0, v1, r0 + //beq r0, r0, L11 // beq r0, r0, L11 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + +block_12: + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L11 // beq r0, r0, L11 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_14: + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 10 collide-puss-work)", execute, 256); +} + +} // namespace method_10_collide_puss_work +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/collide_edge_grab.cpp b/game/mips2c/jak3_functions/collide_edge_grab.cpp new file mode 100644 index 0000000000..815b5d0e67 --- /dev/null +++ b/game/mips2c/jak3_functions/collide_edge_grab.cpp @@ -0,0 +1,1691 @@ +// cppcheck-suppress-file unusedLabels +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_10_collide_edge_hold_list { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + // bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + // nop // sll r0, r0, 0 + c->daddiu(a2, a0, 1552); // daddiu a2, a0, 1552 + c->lwu(t0, 4, a0); // lwu t0, 4(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf1, 16, a1); // lqc2 vf1, 16(a1) + c->dsll(a3, t0, 4); // dsll a3, t0, 4 + c->lwu(v1, 8, a0); // lwu v1, 8(a0) + c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 + c->lwc1(f0, 4, a1); // lwc1 f0, 4(a1) + c->daddu(a2, a2, a3); // daddu a2, a2, a3 + c->sw(t0, 4, a0); // sw t0, 4(a0) + c->sqc2(vf1, 0, a2); // sqc2 vf1, 0(a2) + if (((s64)c->sgpr64(v1)) == ((s64)c->sgpr64(s7))) {// beql v1, s7, L96 + c->sw(a1, 8, a0); // sw a1, 8(a0) + goto block_10; + } + +// block_2: + c->lwc1(f1, 4, v1); // lwc1 f1, 4(v1) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + if (cop1_bc) { // bc1tl L97 + c->sw(a1, 8, a0); // sw a1, 8(a0) + goto block_11; + } + +// block_4: + c->mov64(a0, v1); // or a0, v1, r0 + +block_5: + c->lwu(v1, 0, v1); // lwu v1, 0(v1) + if (((s64)c->sgpr64(v1)) == ((s64)c->sgpr64(s7))) {// beql v1, s7, L98 + c->sw(a1, 0, a0); // sw a1, 0(a0) + goto block_12; + } + +// block_7: + c->lwc1(f1, 4, v1); // lwc1 f1, 4(v1) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + if (!cop1_bc) { // bc1fl L95 + c->mov64(a0, v1); // or a0, v1, r0 + goto block_5; + } + +// block_9: + c->sw(a1, 0, a0); // sw a1, 0(a0) + //beq r0, r0, L99 // beq r0, r0, L99 + c->sw(v1, 0, a1); // sw v1, 0(a1) + goto block_13; // branch always + + +block_10: + //beq r0, r0, L99 // beq r0, r0, L99 + c->sw(s7, 0, a1); // sw s7, 0(a1) + goto block_13; // branch always + + +block_11: + //beq r0, r0, L99 // beq r0, r0, L99 + c->sw(v1, 0, a1); // sw v1, 0(a1) + goto block_13; // branch always + + +block_12: + c->sw(s7, 0, a1); // sw s7, 0(a1) + +block_13: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 10 collide-edge-hold-list)", execute, 256); +} + +} // namespace method_10_collide_edge_hold_list +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_19_collide_edge_work { +struct Cache { + void* collide_edge_hold_list; // collide-edge-hold-list + void* collide_edge_work; // collide-edge-work +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -176); // daddiu sp, sp, -176 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 64, sp); // sq s0, 64(sp) + c->sq(s1, 80, sp); // sq s1, 80(sp) + c->sq(s2, 96, sp); // sq s2, 96(sp) + c->sq(s3, 112, sp); // sq s3, 112(sp) + c->sq(s4, 128, sp); // sq s4, 128(sp) + c->sq(s5, 144, sp); // sq s5, 144(sp) + c->sq(gp, 160, sp); // sq gp, 160(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a1); // or s5, a1, r0 + c->mov64(s4, a2); // or s4, a2, r0 + c->daddiu(s3, sp, 16); // daddiu s3, sp, 16 + c->sd(r0, 256, s4); // sd r0, 256(s4) + c->addiu(s2, r0, 16); // addiu s2, r0, 16 + +block_1: + bc = c->sgpr64(s2) == 0; // beq s2, r0, L92 + c->daddiu(s2, s2, -1); // daddiu s2, s2, -1 + if (bc) {goto block_25;} // branch non-likely + + c->lwu(s1, 8, s5); // lwu s1, 8(s5) + bc = c->sgpr64(s1) == c->sgpr64(s7); // beq s1, s7, L92 + // nop // sll r0, r0, 0 + if (bc) {goto block_25;} // branch non-likely + + c->mov64(a0, gp); // or a0, gp, r0 + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, collide-edge-work(s7) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->mov64(a1, s1); // or a1, s1, r0 + c->mov64(a2, s4); // or a2, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L87 + c->lwu(v1, 0, s1); // lwu v1, 0(s1) + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->mov64(v0, v1); // or v0, v1, r0 + //beq r0, r0, L93 // beq r0, r0, L93 + // nop // sll r0, r0, 0 + goto block_26; // branch always + + +block_5: + c->lb(s0, 8, s1); // lb s0, 8(s1) + c->sw(v1, 8, s5); // sw v1, 8(s5) + bc = ((s64)c->sgpr64(s0)) > 0; // bgtz s0, L90 + c->addiu(v1, r0, 2); // addiu v1, r0, 2 + if (bc) {goto block_17;} // branch non-likely + + if (((s64)c->sgpr64(s0)) < 0) { // bltzl s0, L91 + c->dsubu(s0, r0, s0); // dsubu s0, r0, s0 + goto block_21; + } + +// block_8: + c->dsll(v1, s0, 2); // dsll v1, s0, 2 + c->daddiu(a0, gp, 352); // daddiu a0, gp, 352 + c->daddu(v1, a0, v1); // daddu v1, a0, v1 + c->lw(v1, 0, v1); // lw v1, 0(v1) + c->mov128_vf_gpr(vf1, v1); // qmtc2.i vf1, v1 + c->lwu(a2, 12, s1); // lwu a2, 12(s1) + c->vmove(DEST::xyzw, vf5, vf0); // vmove.xyzw vf5, vf0 + c->lqc2(vf3, 16, s1); // lqc2 vf3, 16(s1) + c->vmove(DEST::xyzw, vf6, vf0); // vmove.xyzw vf6, vf0 + c->lqc2(vf4, 32, a2); // lqc2 vf4, 32(a2) + c->lwu(v1, 12, a2); // lwu v1, 12(a2) + c->vmul_bc(DEST::xyz, BC::x, vf2, vf4, vf1); // vmulx.xyz vf2, vf4, vf1 + c->vadd(DEST::xyz, vf5, vf3, vf2); // vadd.xyz vf5, vf3, vf2 + c->vsub(DEST::xyz, vf6, vf3, vf2); // vsub.xyz vf6, vf3, vf2 + c->lqc2(vf8, 0, v1); // lqc2 vf8, 0(v1) + c->sqc2(vf6, 16, s3); // sqc2 vf6, 16(s3) + c->sqc2(vf2, 32, s3); // sqc2 vf2, 32(s3) + c->sw(a2, 0, s3); // sw a2, 0(s3) + c->sw(s7, 4, s3); // sw s7, 4(s3) + c->vsub(DEST::xyz, vf9, vf8, vf5); // vsub.xyz vf9, vf8, vf5 + c->vmul(DEST::xyz, vf9, vf9, vf2); // vmul.xyz vf9, vf9, vf2 + c->vadd_bc(DEST::x, BC::y, vf9, vf9, vf9); // vaddy.x vf9, vf9, vf9 + c->vadd_bc(DEST::x, BC::z, vf9, vf9, vf9); // vaddz.x vf9, vf9, vf9 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L88 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + c->sqc2(vf5, 16, s1); // sqc2 vf5, 16(s1) + c->mov64(a0, gp); // or a0, gp, r0 + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, collide-edge-work(s7) + c->lwu(t9, 88, v1); // lwu t9, 88(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L88 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->load_symbol2(v1, cache.collide_edge_hold_list);// lw v1, collide-edge-hold-list(s7) + c->lwu(t9, 56, v1); // lwu t9, 56(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + c->sb(v1, 8, s1); // sb v1, 8(s1) + c->addiu(v1, r0, 32); // addiu v1, r0, 32 + c->lwu(a0, 0, s5); // lwu a0, 0(s5) + c->addiu(a1, r0, 48); // addiu a1, r0, 48 + bc = c->sgpr64(a0) == c->sgpr64(v1); // beq a0, v1, L86 + c->mult3(v1, a0, a1); // mult3 v1, a0, a1 + if (bc) {goto block_1;} // branch non-likely + + c->daddu(v1, v1, s5); // daddu v1, v1, s5 + c->sw(r0, 4, s3); // sw r0, 4(s3) + c->daddiu(s1, v1, 16); // daddiu s1, v1, 16 + +block_12: + c->lwu(a2, 0, s3); // lwu a2, 0(s3) + c->lqc2(vf6, 16, s3); // lqc2 vf6, 16(s3) + c->lqc2(vf2, 32, s3); // lqc2 vf2, 32(s3) + c->lwu(v1, 8, a2); // lwu v1, 8(a2) + c->lqc2(vf7, 0, v1); // lqc2 vf7, 0(v1) + c->vsub(DEST::xyz, vf9, vf6, vf7); // vsub.xyz vf9, vf6, vf7 + c->vmul(DEST::xyz, vf9, vf9, vf2); // vmul.xyz vf9, vf9, vf2 + c->vadd_bc(DEST::x, BC::y, vf9, vf9, vf9); // vaddy.x vf9, vf9, vf9 + c->vadd_bc(DEST::x, BC::z, vf9, vf9, vf9); // vaddz.x vf9, vf9, vf9 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->sqc2(vf6, 16, s1); // sqc2 vf6, 16(s1) + c->mov64(a0, gp); // or a0, gp, r0 + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, collide-edge-work(s7) + c->lwu(t9, 88, v1); // lwu t9, 88(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->load_symbol2(v1, cache.collide_edge_hold_list);// lw v1, collide-edge-hold-list(s7) + c->lwu(t9, 56, v1); // lwu t9, 56(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->lwu(v1, 4, s3); // lwu v1, 4(s3) + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L89 + c->lwu(v1, 0, s5); // lwu v1, 0(s5) + if (bc) {goto block_16;} // branch non-likely + + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->sw(v1, 0, s5); // sw v1, 0(s5) + +block_16: + c->addiu(v1, r0, -1); // addiu v1, r0, -1 + //beq r0, r0, L86 // beq r0, r0, L86 + c->sb(v1, 8, s1); // sb v1, 8(s1) + goto block_1; // branch always + + +block_17: + bc = c->sgpr64(s0) == c->sgpr64(v1); // beq s0, v1, L86 + c->lwu(a2, 12, s1); // lwu a2, 12(s1) + if (bc) {goto block_1;} // branch non-likely + + c->dsll(v1, s0, 2); // dsll v1, s0, 2 + c->daddiu(a0, gp, 352); // daddiu a0, gp, 352 + c->daddu(v1, a0, v1); // daddu v1, a0, v1 + c->lw(v1, 0, v1); // lw v1, 0(v1) + c->mov128_vf_gpr(vf1, v1); // qmtc2.i vf1, v1 + c->lqc2(vf3, 16, s1); // lqc2 vf3, 16(s1) + c->vmove(DEST::xyzw, vf5, vf0); // vmove.xyzw vf5, vf0 + c->lqc2(vf4, 32, a2); // lqc2 vf4, 32(a2) + c->lwu(v1, 12, a2); // lwu v1, 12(a2) + c->vmul_bc(DEST::xyz, BC::x, vf2, vf4, vf1); // vmulx.xyz vf2, vf4, vf1 + c->vadd(DEST::xyz, vf5, vf3, vf2); // vadd.xyz vf5, vf3, vf2 + c->lqc2(vf8, 0, v1); // lqc2 vf8, 0(v1) + c->vsub(DEST::xyz, vf9, vf8, vf5); // vsub.xyz vf9, vf8, vf5 + c->vmul(DEST::xyz, vf9, vf9, vf2); // vmul.xyz vf9, vf9, vf2 + c->vadd_bc(DEST::x, BC::y, vf9, vf9, vf9); // vaddy.x vf9, vf9, vf9 + c->vadd_bc(DEST::x, BC::z, vf9, vf9, vf9); // vaddz.x vf9, vf9, vf9 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->sqc2(vf5, 16, s1); // sqc2 vf5, 16(s1) + c->mov64(a0, gp); // or a0, gp, r0 + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, collide-edge-work(s7) + c->lwu(t9, 88, v1); // lwu t9, 88(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->load_symbol2(v1, cache.collide_edge_hold_list);// lw v1, collide-edge-hold-list(s7) + c->lwu(t9, 56, v1); // lwu t9, 56(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->daddiu(v1, s0, 1); // daddiu v1, s0, 1 + //beq r0, r0, L86 // beq r0, r0, L86 + c->sb(v1, 8, s1); // sb v1, 8(s1) + goto block_1; // branch always + + +block_21: + bc = c->sgpr64(s0) == c->sgpr64(v1); // beq s0, v1, L86 + c->lwu(a2, 12, s1); // lwu a2, 12(s1) + if (bc) {goto block_1;} // branch non-likely + + c->dsll(v1, s0, 2); // dsll v1, s0, 2 + c->daddiu(a0, gp, 352); // daddiu a0, gp, 352 + c->daddu(v1, a0, v1); // daddu v1, a0, v1 + c->lw(v1, 0, v1); // lw v1, 0(v1) + c->mov128_vf_gpr(vf1, v1); // qmtc2.i vf1, v1 + c->lqc2(vf3, 16, s1); // lqc2 vf3, 16(s1) + c->vmove(DEST::xyzw, vf6, vf0); // vmove.xyzw vf6, vf0 + c->lqc2(vf4, 32, a2); // lqc2 vf4, 32(a2) + c->lwu(v1, 8, a2); // lwu v1, 8(a2) + c->vmul_bc(DEST::xyz, BC::x, vf2, vf4, vf1); // vmulx.xyz vf2, vf4, vf1 + c->vsub(DEST::xyz, vf6, vf3, vf2); // vsub.xyz vf6, vf3, vf2 + c->lqc2(vf7, 0, v1); // lqc2 vf7, 0(v1) + c->vsub(DEST::xyz, vf9, vf6, vf7); // vsub.xyz vf9, vf6, vf7 + c->vmul(DEST::xyz, vf9, vf9, vf2); // vmul.xyz vf9, vf9, vf2 + c->vadd_bc(DEST::x, BC::y, vf9, vf9, vf9); // vaddy.x vf9, vf9, vf9 + c->vadd_bc(DEST::x, BC::z, vf9, vf9, vf9); // vaddz.x vf9, vf9, vf9 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->sqc2(vf6, 16, s1); // sqc2 vf6, 16(s1) + c->mov64(a0, gp); // or a0, gp, r0 + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, collide-edge-work(s7) + c->lwu(t9, 88, v1); // lwu t9, 88(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(a0, s5); // or a0, s5, r0 + c->load_symbol2(v1, cache.collide_edge_hold_list);// lw v1, collide-edge-hold-list(s7) + c->lwu(t9, 56, v1); // lwu t9, 56(v1) + c->mov64(a1, s1); // or a1, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->daddiu(v1, s0, 1); // daddiu v1, s0, 1 + c->dsubu(v1, r0, v1); // dsubu v1, r0, v1 + //beq r0, r0, L86 // beq r0, r0, L86 + c->sb(v1, 8, s1); // sb v1, 8(s1) + goto block_1; // branch always + + +block_25: + c->mov64(v0, s7); // or v0, s7, r0 + +block_26: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 160, sp); // lq gp, 160(sp) + c->lq(s5, 144, sp); // lq s5, 144(sp) + c->lq(s4, 128, sp); // lq s4, 128(sp) + c->lq(s3, 112, sp); // lq s3, 112(sp) + c->lq(s2, 96, sp); // lq s2, 96(sp) + c->lq(s1, 80, sp); // lq s1, 80(sp) + c->lq(s0, 64, sp); // lq s0, 64(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 176); // daddiu sp, sp, 176 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.collide_edge_hold_list = intern_from_c(-1, 0, "collide-edge-hold-list").c(); + cache.collide_edge_work = intern_from_c(-1, 0, "collide-edge-work").c(); + gLinkedFunctionTable.reg("(method 19 collide-edge-work)", execute, 256); +} + +} // namespace method_19_collide_edge_work +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_9_edge_grab_info { +struct Cache { + void* collide_cache; // *collide-cache* + void* collide_edge_work; // *collide-edge-work* + void* target; // *target* + void* edge_grabbed; // edge-grabbed + void* matrix; // matrix + void* send_event_function; // send-event-function + void* target_edge_grab_jump; // target-edge-grab-jump + void* vector_matrix; // vector-matrix*! + void* vector_normalize; // vector-normalize! +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -704); // daddiu sp, sp, -704 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s3, 640, sp); // sq s3, 640(sp) + c->sq(s4, 656, sp); // sq s4, 656(sp) + c->sq(s5, 672, sp); // sq s5, 672(sp) + c->sq(gp, 688, sp); // sq gp, 688(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, s7); // or s5, s7, r0 + c->daddiu(v1, gp, 384); // daddiu v1, gp, 384 + c->daddiu(a0, gp, 32); // daddiu a0, gp, 32 + c->lq(a0, 0, a0); // lq a0, 0(a0) + c->sq(a0, 0, v1); // sq a0, 0(v1) + c->lw(v1, 264, gp); // lw v1, 264(gp) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L46 + c->mov64(a0, s7); // or a0, s7, r0 + if (bc) {goto block_18;} // branch non-likely + + c->ld(a0, 272, gp); // ld a0, 272(gp) + c->subu(a1, a0, s7); // subu a1, a0, s7 + if (((s64)c->sgpr64(a1)) == ((s64)0)) { // beql a1, r0, L40 + c->mov64(a0, s7); // or a0, s7, r0 + goto block_6; + } + +// block_3: + c->sllv(a1, a0, r0); // sllv a1, a0, r0 + c->lwu(a1, 0, a1); // lwu a1, 0(a1) + c->lw(a2, 40, a1); // lw a2, 40(a1) + c->dsra32(a0, a0, 0); // dsra32 a0, a0, 0 + bc = c->sgpr64(a0) != c->sgpr64(a2); // bne a0, a2, L39 + c->mov64(a0, s7); // or a0, s7, r0 + if (bc) {goto block_5;} // branch non-likely + + c->mov64(a0, a1); // or a0, a1, r0 + +block_5: + c->mov64(a1, a0); // or a1, a0, r0 + +block_6: + bc = c->sgpr64(s7) != c->sgpr64(a0); // bne s7, a0, L41 + c->mov64(a1, s7); // or a1, s7, r0 + if (bc) {goto block_9;} // branch non-likely + + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L54 // beq r0, r0, L54 + // nop // sll r0, r0, 0 + goto block_34; // branch always + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_9: + c->daddu(s5, a0, v1); // daddu s5, a0, v1 + c->lwu(v1, 28, s5); // lwu v1, 28(s5) + bc = c->sgpr64(v1) != 0; // bne v1, r0, L42 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_12;} // branch non-likely + + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L54 // beq r0, r0, L54 + // nop // sll r0, r0, 0 + goto block_34; // branch always + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_12: + c->lwu(v1, 128, a0); // lwu v1, 128(a0) + c->lb(a0, 8, s5); // lb a0, 8(s5) + c->dsll(a0, a0, 5); // dsll a0, a0, 5 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lwu(v1, 28, v1); // lwu v1, 28(v1) + c->daddu(s4, r0, v1); // daddu s4, r0, v1 + c->addiu(s3, r0, 0); // addiu s3, r0, 0 + //beq r0, r0, L44 // beq r0, r0, L44 + // nop // sll r0, r0, 0 + goto block_14; // branch always + + +block_13: + c->load_symbol2(t9, cache.vector_matrix); // lw t9, vector-matrix*!(s7) + c->dsll(v1, s3, 4); // dsll v1, s3, 4 + c->daddu(v1, r0, v1); // daddu v1, r0, v1 + c->daddu(a0, v1, gp); // daddu a0, v1, gp + c->dsll(v1, s3, 4); // dsll v1, s3, 4 + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + c->daddu(a1, v1, gp); // daddu a1, v1, gp + c->mov64(a2, s4); // or a2, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + +block_14: + c->slti(v1, s3, 8); // slti v1, s3, 8 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L43 + // nop // sll r0, r0, 0 + if (bc) {goto block_13;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->lqc2(vf1, 48, gp); // lqc2 vf1, 48(gp) + c->lqc2(vf2, 64, gp); // lqc2 vf2, 64(gp) + c->lqc2(vf3, 80, gp); // lqc2 vf3, 80(gp) + c->vsub(DEST::xyzw, vf4, vf2, vf1); // vsub.xyzw vf4, vf2, vf1 + c->vsub(DEST::xyzw, vf5, vf3, vf1); // vsub.xyzw vf5, vf3, vf1 + c->vopmula(vf4, vf5); // vopmula.xyz acc, vf4, vf5 + c->vopmsub(vf6, vf5, vf4); // vopmsub.xyz vf6, vf5, vf4 + c->vmul(DEST::xyzw, vf7, vf6, vf6); // vmul.xyzw vf7, vf6, vf6 + c->vmula_bc(DEST::w, BC::x, vf0, vf7); // vmulax.w acc, vf0, vf7 + c->vmadda_bc(DEST::w, BC::y, vf0, vf7); // vmadday.w acc, vf0, vf7 + c->vmadd_bc(DEST::w, BC::z, vf7, vf0, vf7); // vmaddz.w vf7, vf0, vf7 + c->vrsqrt(vf0, BC::w, vf7, BC::w); // vrsqrt Q, vf0.w, vf7.w + c->lui(v1, 16180); // lui v1, 16180 + c->ori(v1, v1, 65012); // ori v1, v1, 65012 + c->mtc1(f1, v1); // mtc1 f1, v1 + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf6, vf6); // vmulq.xyz vf6, vf6, Q + c->mov128_gpr_vf(v1, vf6); // qmfc2.i v1, vf6 + c->dsra32(v1, v1, 0); // dsra32 v1, v1, 0 + c->mtc1(f2, v1); // mtc1 f2, v1 + cop1_bc = c->fprs[f2] < c->fprs[f1]; // c.lt.s f2, f1 + bc = !cop1_bc; // bc1f L45 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L54 // beq r0, r0, L54 + // nop // sll r0, r0, 0 + goto block_34; // branch always + + +block_17: + c->daddiu(v1, gp, 304); // daddiu v1, gp, 304 + c->load_symbol2(a0, cache.target); // lw a0, *target*(s7) + c->lwu(a0, 124, a0); // lwu a0, 124(a0) + c->lwu(a0, 464, a0); // lwu a0, 464(a0) + c->daddiu(a0, a0, 28); // daddiu a0, a0, 28 + c->lq(a0, 0, a0); // lq a0, 0(a0) + c->sq(a0, 0, v1); // sq a0, 0(v1) + c->load_symbol2(t9, cache.vector_normalize); // lw t9, vector-normalize!(s7) + c->daddiu(a0, gp, 320); // daddiu a0, gp, 320 + c->daddiu(v1, gp, 16); // daddiu v1, gp, 16 + c->daddu(a1, r0, gp); // daddu a1, r0, gp + c->lqc2(vf4, 0, v1); // lqc2 vf4, 0(v1) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->vsub(DEST::xyz, vf6, vf4, vf5); // vsub.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a0); // sqc2 vf6, 0(a0) + c->lui(a1, 16256); // lui a1, 16256 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(t9, cache.vector_normalize); // lw t9, vector-normalize!(s7) + c->daddiu(a0, gp, 288); // daddiu a0, gp, 288 + c->daddiu(v1, gp, 320); // daddiu v1, gp, 320 + c->daddiu(a1, gp, 304); // daddiu a1, gp, 304 + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1) + c->vopmula(vf1, vf2); // vopmula.xyz acc, vf1, vf2 + c->vopmsub(vf3, vf2, vf1); // vopmsub.xyz vf3, vf2, vf1 + c->sqc2(vf3, 0, a0); // sqc2 vf3, 0(a0) + c->lui(a1, 16256); // lui a1, 16256 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->daddiu(a1, gp, 320); // daddiu a1, gp, 320 + c->daddiu(v1, gp, 288); // daddiu v1, gp, 288 + c->daddiu(a0, gp, 304); // daddiu a0, gp, 304 + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->lqc2(vf2, 0, a0); // lqc2 vf2, 0(a0) + c->vopmula(vf1, vf2); // vopmula.xyz acc, vf1, vf2 + c->vopmsub(vf3, vf2, vf1); // vopmsub.xyz vf3, vf2, vf1 + c->sqc2(vf3, 0, a1); // sqc2 vf3, 0(a1) + c->daddiu(v1, gp, 336); // daddiu v1, gp, 336 + c->daddiu(a0, gp, 32); // daddiu a0, gp, 32 + c->lq(a0, 0, a0); // lq a0, 0(a0) + c->sq(a0, 0, v1); // sq a0, 0(v1) + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, *collide-edge-work*(s7) + c->daddiu(a0, gp, 288); // daddiu a0, gp, 288 + c->load_symbol2(a1, cache.matrix); // lw a1, matrix(s7) + c->lwu(t9, 52, a1); // lwu t9, 52(a1) + c->daddiu(a1, v1, 160); // daddiu a1, v1, 160 + c->daddiu(a2, v1, 480); // daddiu a2, v1, 480 + c->addiu(a3, r0, 12); // addiu a3, r0, 12 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(a0, v0); // or a0, v0, r0 + +block_18: + c->load_symbol2(v1, cache.collide_edge_work); // lw v1, *collide-edge-work*(s7) + c->daddiu(a1, sp, 16); // daddiu a1, sp, 16 + c->lui(a0, 4); // lui a0, 4 + c->load_symbol2(a2, cache.target); // lw a2, *target*(s7) + c->ld(a2, 196, a2); // ld a2, 196(a2) + c->and_(a0, a0, a2); // and a0, a0, a2 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L47 + // nop // sll r0, r0, 0 + if (bc) {goto block_20;} // branch non-likely + + c->mov64(a0, a1); // or a0, a1, r0 + c->daddiu(a2, v1, 160); // daddiu a2, v1, 160 + c->sw(a2, 112, a0); // sw a2, 112(a0) + c->addiu(a2, r0, 6); // addiu a2, r0, 6 + c->sw(a2, 116, a0); // sw a2, 116(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(v1, 156, v1); // lwu v1, 156(v1) + c->lwu(v1, 32, v1); // lwu v1, 32(v1) + c->sw(v1, 100, a0); // sw v1, 100(a0) + c->sw(s7, 88, a0); // sw s7, 88(a0) + c->sw(s7, 92, a0); // sw s7, 92(a0) + c->lui(v1, 2304); // lui v1, 2304 + c->ori(v1, v1, 17); // ori v1, v1, 17 + c->sw(v1, 96, a0); // sw v1, 96(a0) + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->sw(v1, 120, a0); // sw v1, 120(a0) + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + c->sw(v1, 352, a0); // sw v1, 352(a0) + //beq r0, r0, L50 // beq r0, r0, L50 + // nop // sll r0, r0, 0 + goto block_26; // branch always + + +block_20: + c->load_symbol2(a0, cache.target); // lw a0, *target*(s7) + c->lwu(a0, 68, a0); // lwu a0, 68(a0) + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a0))) {// beql s7, a0, L48 + c->mov64(a0, a0); // or a0, a0, r0 + goto block_23; + } + +// block_22: + c->load_symbol2(a0, cache.target); // lw a0, *target*(s7) + c->lwu(a0, 68, a0); // lwu a0, 68(a0) + c->lwu(a0, 0, a0); // lwu a0, 0(a0) + c->load_symbol_addr(a2, cache.target_edge_grab_jump);// daddiu a2, s7, target-edge-grab-jump + c->dsubu(a2, a0, a2); // dsubu a2, a0, a2 + c->daddiu(a0, s7, 4); // daddiu a0, s7, 4 + c->movn(a0, s7, a2); // movn a0, s7, a2 + +block_23: + bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L49 + // nop // sll r0, r0, 0 + if (bc) {goto block_25;} // branch non-likely + + c->mov64(a0, a1); // or a0, a1, r0 + c->daddiu(a2, v1, 256); // daddiu a2, v1, 256 + c->sw(a2, 112, a0); // sw a2, 112(a0) + c->addiu(a2, r0, 6); // addiu a2, r0, 6 + c->sw(a2, 116, a0); // sw a2, 116(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(v1, 156, v1); // lwu v1, 156(v1) + c->lwu(v1, 32, v1); // lwu v1, 32(v1) + c->sw(v1, 100, a0); // sw v1, 100(a0) + c->sw(s7, 88, a0); // sw s7, 88(a0) + c->sw(s7, 92, a0); // sw s7, 92(a0) + c->lui(v1, 2304); // lui v1, 2304 + c->ori(v1, v1, 17); // ori v1, v1, 17 + c->sw(v1, 96, a0); // sw v1, 96(a0) + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->sw(v1, 120, a0); // sw v1, 120(a0) + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + c->sw(v1, 352, a0); // sw v1, 352(a0) + //beq r0, r0, L50 // beq r0, r0, L50 + // nop // sll r0, r0, 0 + goto block_26; // branch always + + +block_25: + c->mov64(a0, a1); // or a0, a1, r0 + c->daddiu(a2, v1, 160); // daddiu a2, v1, 160 + c->sw(a2, 112, a0); // sw a2, 112(a0) + c->addiu(a2, r0, 6); // addiu a2, r0, 6 + c->sw(a2, 116, a0); // sw a2, 116(a0) + c->lwu(v1, 4, v1); // lwu v1, 4(v1) + c->lwu(v1, 156, v1); // lwu v1, 156(v1) + c->lwu(v1, 32, v1); // lwu v1, 32(v1) + c->sw(v1, 100, a0); // sw v1, 100(a0) + c->sw(s7, 88, a0); // sw s7, 88(a0) + c->sw(s7, 92, a0); // sw s7, 92(a0) + c->lui(v1, 2304); // lui v1, 2304 + c->ori(v1, v1, 17); // ori v1, v1, 17 + c->sw(v1, 96, a0); // sw v1, 96(a0) + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->sw(v1, 120, a0); // sw v1, 120(a0) + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + c->sw(v1, 352, a0); // sw v1, 352(a0) + +block_26: + c->load_symbol2(a0, cache.collide_cache); // lw a0, *collide-cache*(s7) + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 60, v1); // lwu t9, 60(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L51 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_29;} // branch non-likely + + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L54 // beq r0, r0, L54 + // nop // sll r0, r0, 0 + goto block_34; // branch always + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_29: + bc = c->sgpr64(s7) == c->sgpr64(s5); // beq s7, s5, L53 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_33;} // branch non-likely + + c->lwu(v1, 0, s5); // lwu v1, 0(s5) + c->daddiu(a1, sp, 560); // daddiu a1, sp, 560 + c->mov64(a0, s6); // or a0, s6, r0 + bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L52 + c->mov64(a2, s7); // or a2, s7, r0 + if (bc) {goto block_32;} // branch non-likely + + c->lwu(a2, 24, a0); // lwu a2, 24(a0) + +block_32: + c->sw(a2, 8, a1); // sw a2, 8(a1) + c->addiu(a0, r0, 1); // addiu a0, r0, 1 + c->sw(a0, 68, a1); // sw a0, 68(a1) + c->load_symbol_addr(a0, cache.edge_grabbed); // daddiu a0, s7, edge-grabbed + c->sw(a0, 64, a1); // sw a0, 64(a1) + c->sd(gp, 16, a1); // sd gp, 16(a1) + c->load_symbol2(t9, cache.send_event_function); // lw t9, send-event-function(s7) + c->lwu(a0, 136, v1); // lwu a0, 136(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_33: + c->daddiu(v0, s7, 4); // daddiu v0, s7, #t + +block_34: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 688, sp); // lq gp, 688(sp) + c->lq(s5, 672, sp); // lq s5, 672(sp) + c->lq(s4, 656, sp); // lq s4, 656(sp) + c->lq(s3, 640, sp); // lq s3, 640(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 704); // daddiu sp, sp, 704 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.collide_cache = intern_from_c(-1, 0, "*collide-cache*").c(); + cache.collide_edge_work = intern_from_c(-1, 0, "*collide-edge-work*").c(); + cache.target = intern_from_c(-1, 0, "*target*").c(); + cache.edge_grabbed = intern_from_c(-1, 0, "edge-grabbed").c(); + cache.matrix = intern_from_c(-1, 0, "matrix").c(); + cache.send_event_function = intern_from_c(-1, 0, "send-event-function").c(); + cache.target_edge_grab_jump = intern_from_c(-1, 0, "target-edge-grab-jump").c(); + cache.vector_matrix = intern_from_c(-1, 0, "vector-matrix*!").c(); + cache.vector_normalize = intern_from_c(-1, 0, "vector-normalize!").c(); + gLinkedFunctionTable.reg("(method 9 edge-grab-info)", execute, 1024); +} + +} // namespace method_9_edge_grab_info +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_17_collide_edge_work { +struct Cache { + void* format; // format +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -32); // daddiu sp, sp, -32 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->sq(gp, 16, sp); // sq gp, 16(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->lui(v1, 16180); // lui v1, 16180 + c->ori(v1, v1, 65012); // ori v1, v1, 65012 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lwu(v1, 392, gp); // lwu v1, 392(gp) + // nop // sll r0, r0, 0 + c->addiu(a0, r0, 896); // addiu a0, r0, 896 + c->lwu(t3, 0, gp); // lwu t3, 0(gp) + c->addiu(a1, r0, 0); // addiu a1, r0, 0 + c->daddiu(a2, gp, 6320); // daddiu a2, gp, 6320 + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + c->lwu(t0, 0, t3); // lwu t0, 0(t3) + c->gprs[t1].du64[0] = 0; // or t1, r0, r0 + c->lq(t2, 96, gp); // lq t2, 96(gp) + c->daddiu(t3, t3, 4908); // daddiu t3, t3, 4908 + c->lq(t4, 112, gp); // lq t4, 112(gp) + +block_1: + bc = c->sgpr64(t0) == 0; // beq t0, r0, L35 + c->lwu(t5, 48, t3); // lwu t5, 48(t3) + if (bc) {goto block_14;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->lqc2(vf1, 0, t3); // lqc2 vf1, 0(t3) + c->and_(t6, t5, a0); // and t6, t5, a0 + c->lqc2(vf2, 16, t3); // lqc2 vf2, 16(t3) + bc = c->sgpr64(t6) == c->sgpr64(a1); // beq t6, a1, L34 + c->lqc2(vf3, 32, t3); // lqc2 vf3, 32(t3) + if (bc) {goto block_5;} // branch non-likely + + if (((s64)c->sgpr64(t6)) != ((s64)c->sgpr64(a3))) {// bnel t6, a3, L33 + c->daddiu(t3, t3, 64); // daddiu t3, t3, 64 + goto block_1; + } + +block_5: + c->and_(t6, t5, v1); // and t6, t5, v1 + c->vmini(DEST::xyzw, vf7, vf1, vf2); // vmini.xyzw vf7, vf1, vf2 + bc = c->sgpr64(t6) != 0; // bne t6, r0, L33 + c->vmax(DEST::xyzw, vf8, vf1, vf2); // vmax.xyzw vf8, vf1, vf2 + if (bc) {goto block_1;} // branch non-likely + + c->vsub(DEST::xyz, vf4, vf2, vf1); // vsub.xyz vf4, vf2, vf1 + // nop // sll r0, r0, 0 + c->vsub(DEST::xyz, vf5, vf3, vf1); // vsub.xyz vf5, vf3, vf1 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf7, vf7, vf3); // vmini.xyzw vf7, vf7, vf3 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf8, vf8, vf3); // vmax.xyzw vf8, vf8, vf3 + // nop // sll r0, r0, 0 + c->vopmula(vf4, vf5); // vopmula.xyz acc, vf4, vf5 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf7, vf7); // vftoi0.xyzw vf7, vf7 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf8, vf8); // vftoi0.xyzw vf8, vf8 + // nop // sll r0, r0, 0 + c->vopmsub(vf6, vf5, vf4); // vopmsub.xyz vf6, vf5, vf4 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t7, vf7); // qmfc2.i t7, vf7 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t6, vf8); // qmfc2.i t6, vf8 + // nop // sll r0, r0, 0 + c->pcgtw(t7, t7, t4); // pcgtw t7, t7, t4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->vmul(DEST::xyzw, vf9, vf6, vf6); // vmul.xyzw vf9, vf6, vf6 + // nop // sll r0, r0, 0 + c->pcgtw(t6, t2, t6); // pcgtw t6, t2, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(t6, t7, t6); // por t6, t7, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(t6, r0, t6); // ppach t6, r0, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(t6, t6, 16); // dsll t6, t6, 16 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(t6)) != ((s64)0)) { // bnel t6, r0, L33 + c->daddiu(t3, t3, 64); // daddiu t3, t3, 64 + goto block_1; + } + +// block_8: + c->vmula_bc(DEST::w, BC::x, vf0, vf9); // vmulax.w acc, vf0, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::w, BC::y, vf0, vf9); // vmadday.w acc, vf0, vf9 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::w, BC::z, vf9, vf0, vf9); // vmaddz.w vf9, vf0, vf9 + // nop // sll r0, r0, 0 + c->vrsqrt(vf0, BC::w, vf9, BC::w); // vrsqrt Q, vf0.w, vf9.w + // nop // sll r0, r0, 0 + c->dsll32(t5, t5, 8); // dsll32 t5, t5, 8 + c->dsrl32(t5, t5, 26); // dsrl32 t5, t5, 26 + c->addiu(t6, r0, 2); // addiu t6, r0, 2 + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf6, vf6); // vmulq.xyz vf6, vf6, Q + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t7, vf6); // qmfc2.i t7, vf6 + // nop // sll r0, r0, 0 + c->dsra32(t7, t7, 0); // dsra32 t7, t7, 0 + // nop // sll r0, r0, 0 + c->mtc1(f1, t7); // mtc1 f1, t7 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + c->addiu(t7, r0, 48); // addiu t7, r0, 48 + if (cop1_bc) { // bc1tl L33 + c->daddiu(t3, t3, 64); // daddiu t3, t3, 64 + goto block_1; + } + +// block_10: + if (((s64)c->sgpr64(t5)) == ((s64)c->sgpr64(t6))) {// beql t5, t6, L33 + c->daddiu(t3, t3, 64); // daddiu t3, t3, 64 + goto block_1; + } + +// block_12: + bc = c->sgpr64(t1) == c->sgpr64(t7); // beq t1, t7, L36 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + c->daddiu(t1, t1, 1); // daddiu t1, t1, 1 + c->sw(t3, 0, a2); // sw t3, 0(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf6, 16, a2); // sqc2 vf6, 16(a2) + c->daddiu(a2, a2, 32); // daddiu a2, a2, 32 + // nop // sll r0, r0, 0 + //beq r0, r0, L33 // beq r0, r0, L33 + c->daddiu(t3, t3, 64); // daddiu t3, t3, 64 + goto block_1; // branch always + + +block_14: + //beq r0, r0, L37 // beq r0, r0, L37 + c->sw(t1, 16, gp); // sw t1, 16(gp) + goto block_16; // branch always + + +block_15: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L119 // daddiu a1, fp, L119 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Exceeded max # of grabbable tris!\n"); + c->addiu(v1, r0, 48); // addiu v1, r0, 48 + c->sw(v1, 16, gp); // sw v1, 16(gp) + +block_16: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + c->lq(gp, 16, sp); // lq gp, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 32); // daddiu sp, sp, 32 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.format = intern_from_c(-1, 0, "format").c(); + gLinkedFunctionTable.reg("(method 17 collide-edge-work)", execute, 512); +} + +} // namespace method_17_collide_edge_work +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_16_collide_edge_work { +struct Cache { + void* format; // format +} cache; + +void sub_l20_b15(ExecutionContext* c) { + bool bc = false; + bool cop1_bc = false; +// block_15: + c->mov64(t4, t1); // or t4, t1, r0 + c->lwu(t3, 12, a0); // lwu t3, 12(a0) + c->dsll32(t4, t4, 0); // dsll32 t4, t4, 0 + c->gprs[t5].du64[0] = 0; // or t5, r0, r0 + c->or_(t6, t4, t2); // or t6, t4, t2 + c->daddiu(t4, a0, 1712); // daddiu t4, a0, 1712 + +block_16: + bc = c->sgpr64(t5) == c->sgpr64(t3); // beq t5, t3, L22 + c->ld(t7, 8, t4); // ld t7, 8(t4) + if (bc) {goto block_20;} // branch non-likely + + c->daddiu(t5, t5, 1); // daddiu t5, t5, 1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(t6)) != ((s64)c->sgpr64(t7))) {// bnel t6, t7, L21 + c->daddiu(t4, t4, 48); // daddiu t4, t4, 48 + goto block_16; + } + +// block_19: + //beq r0, r0, L24 // beq r0, r0, L24 + c->sw(r0, 0, t4); // sw r0, 0(t4) + goto block_26; // branch always + + +block_20: + c->addiu(t5, r0, 96); // addiu t5, r0, 96 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(t3)) == ((s64)c->sgpr64(t5))) {// beql t3, t5, L24 + c->mov64(t4, s7); // or t4, s7, r0 + goto block_26; + } + +// block_22: + c->daddiu(t3, t3, 1); // daddiu t3, t3, 1 + c->sw(s7, 0, t4); // sw s7, 0(t4) + // nop // sll r0, r0, 0 + c->sw(t1, 8, t4); // sw t1, 8(t4) + // nop // sll r0, r0, 0 + c->sw(t2, 12, t4); // sw t2, 12(t4) + // nop // sll r0, r0, 0 + c->sw(a1, 4, t4); // sw a1, 4(t4) + // nop // sll r0, r0, 0 + c->sw(t3, 12, a0); // sw t3, 12(a0) + c->vmove(DEST::xyzw, vf13, vf0); // vmove.xyzw vf13, vf0 + c->lqc2(vf16, 0, t1); // lqc2 vf16, 0(t1) + // nop // sll r0, r0, 0 + c->lqc2(vf17, 0, t2); // lqc2 vf17, 0(t2) + c->vsub(DEST::xyzw, vf18, vf17, vf16); // vsub.xyzw vf18, vf17, vf16 + // nop // sll r0, r0, 0 + c->vsub(DEST::xyzw, vf19, vf1, vf16); // vsub.xyzw vf19, vf1, vf16 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf20, vf18, vf18); // vmul.xyzw vf20, vf18, vf18 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::x, BC::z, vf13, vf0, vf18); // vsubz.x vf13, vf0, vf18 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::y, vf20, vf20, vf20); // vaddy.x vf20, vf20, vf20 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::z, BC::x, vf13, vf0, vf18); // vaddx.z vf13, vf0, vf18 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf20, vf20, vf20); // vaddz.x vf20, vf20, vf20 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf15, vf13, vf19); // vmul.xyzw vf15, vf13, vf19 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf14, vf13, vf13); // vmul.xyzw vf14, vf13, vf13 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf15, vf15, vf15); // vaddz.x vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf14, vf14, vf14); // vaddz.x vf14, vf14, vf14 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf15); // qmfc2.i t2, vf15 + // nop // sll r0, r0, 0 + c->vrsqrt(vf0, BC::w, vf14, BC::x); // vrsqrt Q, vf0.w, vf14.x + // nop // sll r0, r0, 0 + c->mtc1(f3, t2); // mtc1 f3, t2 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f4] < c->fprs[f2]; // c.lt.s f4, f2 + // nop // sll r0, r0, 0 + bc = cop1_bc; // bc1t L23 + // nop // sll r0, r0, 0 + if (bc) {goto block_25;} // branch non-likely + + cop1_bc = c->fprs[f3] < c->fprs[f4]; // c.lt.s f3, f4 + // nop // sll r0, r0, 0 + if (cop1_bc) { // bc1tl L24 + c->sw(r0, 0, t4); // sw r0, 0(t4) + goto block_26; + } + +block_25: + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf13, vf13); // vmulq.xyz vf13, vf13, Q + // nop // sll r0, r0, 0 + // nop // vnop + // nop // sll r0, r0, 0 + // nop // vnop + // nop // sll r0, r0, 0 + c->vrsqrt(vf0, BC::w, vf20, BC::x); // vrsqrt Q, vf0.w, vf20.x + // nop // sll r0, r0, 0 + c->vmul_bc(DEST::w, BC::w, vf18, vf0, vf0); // vmulw.w vf18, vf0, vf0 + c->sqc2(vf13, 16, t4); // sqc2 vf13, 16(t4) + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyz, vf18, vf18); // vmulq.xyz vf18, vf18, Q + // nop // sll r0, r0, 0 + // nop // vnop + // nop // sll r0, r0, 0 + // nop // vnop + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf18, 32, t4); // sqc2 vf18, 32(t4) + +block_26: + ; + //jr ra // jr ra + // nop // sll r0, r0, 0 + // goto end_of_function; // return +} + +void sub_l25_b27(ExecutionContext* c) { + bool bc = false; + bool cop1_bc = false; + c->gprs[t2].du64[0] = 0; // or t2, r0, r0 + c->lwu(t1, 8, a0); // lwu t1, 8(a0) + c->daddiu(t0, a0, 688); // daddiu t0, a0, 688 + // nop // sll r0, r0, 0 + +block_28: + bc = c->sgpr64(t2) == c->sgpr64(t1); // beq t2, t1, L27 + c->lqc2(vf9, 0, t0); // lqc2 vf9, 0(t0) + if (bc) {goto block_37;} // branch non-likely + + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + c->lqc2(vf10, 16, t0); // lqc2 vf10, 16(t0) + c->vsub(DEST::xyzw, vf9, vf9, vf8); // vsub.xyzw vf9, vf9, vf8 + c->lqc2(vf11, 32, t0); // lqc2 vf11, 32(t0) + c->vsub(DEST::xyzw, vf10, vf10, vf8); // vsub.xyzw vf10, vf10, vf8 + c->lqc2(vf12, 48, t0); // lqc2 vf12, 48(t0) + c->vsub(DEST::xyzw, vf11, vf11, vf8); // vsub.xyzw vf11, vf11, vf8 + // nop // sll r0, r0, 0 + c->vsub(DEST::xyzw, vf12, vf12, vf8); // vsub.xyzw vf12, vf12, vf8 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf9, vf9, vf9); // vmul.xyzw vf9, vf9, vf9 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf10, vf10, vf10); // vmul.xyzw vf10, vf10, vf10 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf11, vf11, vf11); // vmul.xyzw vf11, vf11, vf11 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf12, vf12, vf12); // vmul.xyzw vf12, vf12, vf12 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::y, vf9, vf9, vf9); // vaddy.x vf9, vf9, vf9 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::y, vf10, vf10, vf10); // vaddy.x vf10, vf10, vf10 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::y, vf11, vf11, vf11); // vaddy.x vf11, vf11, vf11 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::y, vf12, vf12, vf12); // vaddy.x vf12, vf12, vf12 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf9, vf9, vf9); // vaddz.x vf9, vf9, vf9 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf10, vf10, vf10); // vaddz.x vf10, vf10, vf10 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf11, vf11, vf11); // vaddz.x vf11, vf11, vf11 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::x, BC::z, vf12, vf12, vf12); // vaddz.x vf12, vf12, vf12 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t3, vf9); // qmfc2.i t3, vf9 + // nop // sll r0, r0, 0 + c->mtc1(f1, t3); // mtc1 f1, t3 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f1] <= c->fprs[f0]; // c.le.s f1, f0 + // nop // sll r0, r0, 0 + bc = cop1_bc; // bc1t L28 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + bc = c->sgpr64(t2) == c->sgpr64(t1); // beq t2, t1, L27 + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + if (bc) {goto block_37;} // branch non-likely + + c->mov128_gpr_vf(t3, vf10); // qmfc2.i t3, vf10 + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + c->mtc1(f1, t3); // mtc1 f1, t3 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f1] <= c->fprs[f0]; // c.le.s f1, f0 + // nop // sll r0, r0, 0 + bc = cop1_bc; // bc1t L28 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + bc = c->sgpr64(t2) == c->sgpr64(t1); // beq t2, t1, L27 + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + if (bc) {goto block_37;} // branch non-likely + + c->mov128_gpr_vf(t3, vf11); // qmfc2.i t3, vf11 + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + c->mtc1(f1, t3); // mtc1 f1, t3 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f1] <= c->fprs[f0]; // c.le.s f1, f0 + // nop // sll r0, r0, 0 + bc = cop1_bc; // bc1t L28 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + bc = c->sgpr64(t2) == c->sgpr64(t1); // beq t2, t1, L27 + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + if (bc) {goto block_37;} // branch non-likely + + c->mov128_gpr_vf(t3, vf12); // qmfc2.i t3, vf12 + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + c->mtc1(f1, t3); // mtc1 f1, t3 + // nop // sll r0, r0, 0 + cop1_bc = c->fprs[f1] <= c->fprs[f0]; // c.le.s f1, f0 + // nop // sll r0, r0, 0 + bc = cop1_bc; // bc1t L28 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + //beq r0, r0, L26 // beq r0, r0, L26 + c->daddiu(t0, t0, 16); // daddiu t0, t0, 16 + goto block_28; // branch always + + +block_37: + c->addiu(t2, r0, 64); // addiu t2, r0, 64 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(t2)) == ((s64)c->sgpr64(t1))) {// beql t2, t1, L28 + c->mov64(t0, s7); // or t0, s7, r0 + goto block_40; + } + +// block_39: + c->daddiu(t1, t1, 1); // daddiu t1, t1, 1 + c->sqc2(vf8, 0, t0); // sqc2 vf8, 0(t0) + // nop // sll r0, r0, 0 + c->sw(t1, 8, a0); // sw t1, 8(a0) + +block_40: + ; + //jr ra // jr ra + // nop // sll r0, r0, 0 + // goto end_of_function; // return +} + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // bool cop1_bc = false; + c->daddiu(sp, sp, -16); // daddiu sp, sp, -16 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sd(fp, 8, sp); // sd fp, 8(sp) + c->mov64(fp, t9); // or fp, t9, r0 + c->lui(v1, 17617); // lui v1, 17617 + c->ori(v1, v1, 46871); // ori v1, v1, 46871 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lwc1(f4, 404, a0); // lwc1 f4, 404(a0) + // nop // sll r0, r0, 0 + c->mtc1(f2, r0); // mtc1 f2, r0 + c->lwu(a1, 4, a0); // lwu a1, 4(a0) + // nop // sll r0, r0, 0 + c->lwu(v1, 16, a0); // lwu v1, 16(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf1, 12, a1); // lqc2 vf1, 12(a1) + c->daddiu(a1, a0, 6320); // daddiu a1, a0, 6320 + c->lqc2(vf6, 64, a0); // lqc2 vf6, 64(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf7, 80, a0); // lqc2 vf7, 80(a0) + c->vmove(DEST::xyzw, vf2, vf1); // vmove.xyzw vf2, vf1 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::y, vf1, vf0, vf6); // vaddy.y vf1, vf0, vf6 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::y, BC::y, vf2, vf0, vf7); // vaddy.y vf2, vf0, vf7 + // nop // sll r0, r0, 0 + +block_1: + bc = c->sgpr64(v1) == 0; // beq v1, r0, L31 + c->lwu(t0, 0, a1); // lwu t0, 0(a1) + if (bc) {goto block_43;} // branch non-likely + + c->daddiu(v1, v1, -1); // daddiu v1, v1, -1 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf3, 0, t0); // lqc2 vf3, 0(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf4, 16, t0); // lqc2 vf4, 16(t0) + // nop // sll r0, r0, 0 + c->lqc2(vf5, 32, t0); // lqc2 vf5, 32(t0) + // Unknown instr: bgezal r0, L25 + c->vmove(DEST::xyzw, vf8, vf3); // vmove.xyzw vf8, vf3 + // if (bc) {goto block_27;} // branch non-likely + sub_l25_b27(c); + + bc = c->sgpr64(t0) == c->sgpr64(s7); // beq t0, s7, L29 + c->mov64(a2, t0); // or a2, t0, r0 + if (bc) {goto block_41;} // branch non-likely + + // Unknown instr: bgezal r0, L25 + c->vmove(DEST::xyzw, vf8, vf4); // vmove.xyzw vf8, vf4 + // if (bc) {goto block_27;} // branch non-likely + sub_l25_b27(c); + + bc = c->sgpr64(t0) == c->sgpr64(s7); // beq t0, s7, L29 + c->mov64(a3, t0); // or a3, t0, r0 + if (bc) {goto block_41;} // branch non-likely + + // Unknown instr: bgezal r0, L25 + c->vmove(DEST::xyzw, vf8, vf5); // vmove.xyzw vf8, vf5 + // if (bc) {goto block_27;} // branch non-likely + sub_l25_b27(c); + + bc = c->sgpr64(t0) == c->sgpr64(s7); // beq t0, s7, L29 + c->mov64(t0, t0); // or t0, t0, r0 + if (bc) {goto block_41;} // branch non-likely + + c->mov64(t1, a2); // or t1, a2, r0 + // nop // sll r0, r0, 0 + // Unknown instr: bgezal r0, L20 + c->mov64(t2, a3); // or t2, a3, r0 + // if (bc) {goto block_15;} // branch non-likely + sub_l20_b15(c); + + bc = c->sgpr64(t4) == c->sgpr64(s7); // beq t4, s7, L30 + c->mov64(t1, a3); // or t1, a3, r0 + if (bc) {goto block_42;} // branch non-likely + + // Unknown instr: bgezal r0, L20 + c->mov64(t2, t0); // or t2, t0, r0 + // if (bc) {goto block_15;} // branch non-likely + sub_l20_b15(c); + + bc = c->sgpr64(t4) == c->sgpr64(s7); // beq t4, s7, L30 + c->mov64(t1, t0); // or t1, t0, r0 + if (bc) {goto block_42;} // branch non-likely + + // Unknown instr: bgezal r0, L20 + c->mov64(t2, a2); // or t2, a2, r0 + // if (bc) {goto block_15;} // branch non-likely + sub_l20_b15(c); + + bc = c->sgpr64(t1) == c->sgpr64(s7); // beq t1, s7, L30 + // nop // sll r0, r0, 0 + if (bc) {goto block_42;} // branch non-likely + + //beq r0, r0, L19 // beq r0, r0, L19 + c->daddiu(a1, a1, 32); // daddiu a1, a1, 32 + goto block_1; // branch always + +block_41: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L118 // daddiu a1, fp, L118 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Too many edge verts found in edge grab!\n"); + //beq r0, r0, L31 // beq r0, r0, L31 + // nop // sll r0, r0, 0 + goto block_43; // branch always + + +block_42: + c->load_symbol2(t9, cache.format); // lw t9, format(s7) + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + // daddiu a1, fp, L117 // daddiu a1, fp, L117 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + printf("ERROR: Too many edges found in edge grab!\n"); + +block_43: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->ld(fp, 8, sp); // ld fp, 8(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.format = intern_from_c(-1, 0, "format").c(); + gLinkedFunctionTable.reg("(method 16 collide-edge-work)", execute, 512); +} + +} // namespace method_16_collide_edge_work +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_18_collide_edge_work { +struct Cache { + void* vector_vector_distance; // vector-vector-distance +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + float acc; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s3, 16, sp); // sq s3, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s5, 48, sp); // sq s5, 48(sp) + c->sq(gp, 64, sp); // sq gp, 64(sp) + c->swc1(f30, 80, sp); // swc1 f30, 80(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a1); // or s5, a1, r0 + // nop // sll r0, r0, 0 + c->lqc2(vf1, 16, s5); // lqc2 vf1, 16(s5) + // nop // sll r0, r0, 0 + c->lq(a0, 96, gp); // lq a0, 96(gp) + // nop // sll r0, r0, 0 + c->lq(a3, 112, gp); // lq a3, 112(gp) + c->vftoi0(DEST::xyzw, vf2, vf1); // vftoi0.xyzw vf2, vf1 + c->lwu(v1, 4, gp); // lwu v1, 4(gp) + c->mov128_gpr_vf(a1, vf2); // qmfc2.i a1, vf2 + c->lqc2(vf3, 16, a2); // lqc2 vf3, 16(a2) + c->pcgtw(a3, a1, a3); // pcgtw a3, a1, a3 + c->lqc2(vf4, 368, gp); // lqc2 vf4, 368(gp) + c->pcgtw(a0, a0, a1); // pcgtw a0, a0, a1 + c->lqc2(vf5, 12, v1); // lqc2 vf5, 12(v1) + c->por(v1, a3, a0); // por v1, a3, a0 + c->lwc1(f0, 396, gp); // lwc1 f0, 396(gp) + c->ppach(v1, r0, v1); // ppach v1, r0, v1 + c->lwc1(f1, 400, gp); // lwc1 f1, 400(gp) + c->dsll(v1, v1, 16); // dsll v1, v1, 16 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L10 + c->lqc2(vf6, 144, gp); // lqc2 vf6, 144(gp) + if (bc) {goto block_24;} // branch non-likely + + c->vmul_bc(DEST::xyzw, BC::x, vf10, vf3, vf4); // vmulx.xyzw vf10, vf3, vf4 + c->lqc2(vf11, 128, gp); // lqc2 vf11, 128(gp) + c->vadd(DEST::xyzw, vf10, vf10, vf1); // vadd.xyzw vf10, vf10, vf1 + c->vsub(DEST::xyzw, vf7, vf5, vf10); // vsub.xyzw vf7, vf5, vf10 + c->vmul(DEST::xyzw, vf7, vf7, vf7); // vmul.xyzw vf7, vf7, vf7 + c->vadd_bc(DEST::x, BC::z, vf7, vf7, vf7); // vaddz.x vf7, vf7, vf7 + c->mov128_gpr_vf(v1, vf7); // qmfc2.i v1, vf7 + c->mtc1(f2, v1); // mtc1 f2, v1 + cop1_bc = c->fprs[f0] < c->fprs[f2]; // c.lt.s f0, f2 + bc = cop1_bc; // bc1t L10 + // nop // sll r0, r0, 0 + if (bc) {goto block_24;} // branch non-likely + + c->vsub(DEST::xyzw, vf8, vf1, vf5); // vsub.xyzw vf8, vf1, vf5 + c->vmul(DEST::xyzw, vf7, vf8, vf8); // vmul.xyzw vf7, vf8, vf8 + c->vadd_bc(DEST::x, BC::z, vf7, vf7, vf7); // vaddz.x vf7, vf7, vf7 + c->vrsqrt(vf0, BC::w, vf7, BC::x); // vrsqrt Q, vf0.w, vf7.x + // nop // sll r0, r0, 0 + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xz, vf8, vf8); // vmulq.xz vf8, vf8, Q + c->vmul(DEST::xyzw, vf9, vf8, vf6); // vmul.xyzw vf9, vf8, vf6 + c->vadd_bc(DEST::x, BC::z, vf9, vf9, vf9); // vaddz.x vf9, vf9, vf9 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + c->mtc1(f3, v1); // mtc1 f3, v1 + cop1_bc = c->fprs[f3] < c->fprs[f1]; // c.lt.s f3, f1 + bc = cop1_bc; // bc1t L10 + // nop // sll r0, r0, 0 + if (bc) {goto block_24;} // branch non-likely + + c->vsub(DEST::xyzw, vf7, vf11, vf1); // vsub.xyzw vf7, vf11, vf1 + c->sqc2(vf1, 16, s5); // sqc2 vf1, 16(s5) + c->vmul(DEST::xyzw, vf7, vf7, vf7); // vmul.xyzw vf7, vf7, vf7 + c->sb(r0, 8, s5); // sb r0, 8(s5) + c->sqc2(vf10, 32, s5); // sqc2 vf10, 32(s5) + c->vadd_bc(DEST::x, BC::z, vf7, vf7, vf7); // vaddz.x vf7, vf7, vf7 + c->sw(a2, 12, s5); // sw a2, 12(s5) + c->mov128_gpr_vf(v1, vf7); // qmfc2.i v1, vf7 + c->sw(v1, 4, s5); // sw v1, 4(s5) + c->ld(v1, 384, gp); // ld v1, 384(gp) + c->andi(v1, v1, 2); // andi v1, v1, 2 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L8 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_20;} // branch non-likely + + c->lwu(s3, 12, s5); // lwu s3, 12(s5) + c->lwu(s4, 408, gp); // lwu s4, 408(gp) + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f30, v1); // mtc1 f30, v1 + c->load_symbol2(t9, cache.vector_vector_distance);// lw t9, vector-vector-distance(s7) + c->lwu(v1, 8, s3); // lwu v1, 8(s3) + c->daddu(a0, r0, v1); // daddu a0, r0, v1 + c->daddu(a1, r0, s4); // daddu a1, r0, s4 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + cop1_bc = c->fprs[f0] < c->fprs[f30]; // c.lt.s f0, f30 + bc = cop1_bc; // bc1t L4 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_6;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_6: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L7 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_18; + } + +// block_8: + c->load_symbol2(t9, cache.vector_vector_distance);// lw t9, vector-vector-distance(s7) + c->lwu(v1, 12, s3); // lwu v1, 12(s3) + c->daddu(a0, r0, v1); // daddu a0, r0, v1 + c->daddu(a1, r0, s4); // daddu a1, r0, s4 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + cop1_bc = c->fprs[f0] < c->fprs[f30]; // c.lt.s f0, f30 + bc = cop1_bc; // bc1t L5 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_10;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_10: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L7 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_18; + } + +// block_12: + c->load_symbol2(t9, cache.vector_vector_distance);// lw t9, vector-vector-distance(s7) + c->lwu(v1, 8, s3); // lwu v1, 8(s3) + c->daddu(a0, r0, v1); // daddu a0, r0, v1 + c->daddiu(a1, s4, 16); // daddiu a1, s4, 16 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + cop1_bc = c->fprs[f0] < c->fprs[f30]; // c.lt.s f0, f30 + bc = cop1_bc; // bc1t L6 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_14;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_14: + if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L7 + c->mov64(v1, v1); // or v1, v1, r0 + goto block_18; + } + +// block_16: + c->load_symbol2(t9, cache.vector_vector_distance);// lw t9, vector-vector-distance(s7) + c->lwu(v1, 12, s3); // lwu v1, 12(s3) + c->daddu(a0, r0, v1); // daddu a0, r0, v1 + c->daddiu(a1, s4, 16); // daddiu a1, s4, 16 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + cop1_bc = c->fprs[f0] < c->fprs[f30]; // c.lt.s f0, f30 + bc = cop1_bc; // bc1t L7 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + if (bc) {goto block_18;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + +block_18: + bc = c->sgpr64(s7) != c->sgpr64(v1); // bne s7, v1, L8 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_20;} // branch non-likely + + //beq r0, r0, L10 // beq r0, r0, L10 + // nop // sll r0, r0, 0 + goto block_24; // branch always + + +block_20: + c->ld(v1, 384, gp); // ld v1, 384(gp) + c->andi(v1, v1, 4); // andi v1, v1, 4 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L9 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_23;} // branch non-likely + + c->lwu(v1, 12, s5); // lwu v1, 12(s5) + c->daddiu(a0, v1, 16); // daddiu a0, v1, 16 + c->daddiu(v1, gp, 144); // daddiu v1, gp, 144 + c->lwc1(f0, 0, a0); // lwc1 f0, 0(a0) + c->lwc1(f1, 4, a0); // lwc1 f1, 4(a0) + c->lwc1(f2, 8, a0); // lwc1 f2, 8(a0) + c->lwc1(f3, 0, v1); // lwc1 f3, 0(v1) + c->lwc1(f4, 4, v1); // lwc1 f4, 4(v1) + c->lwc1(f5, 8, v1); // lwc1 f5, 8(v1) + // Unknown instr: mula.s f0, f3 + acc = c->fprs[f0] * c->fprs[f3]; + // Unknown instr: madda.s f1, f4 + acc += c->fprs[f1] * c->fprs[f4]; + // Unknown instr: madd.s f0, f2, f5 + c->fprs[f0] = acc + c->fprs[f2] * c->fprs[f5]; + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->abss(f0, f0); // abs.s f0, f0 + c->lui(v1, 16179); // lui v1, 16179 + c->ori(v1, v1, 13107); // ori v1, v1, 13107 + c->mtc1(f1, v1); // mtc1 f1, v1 + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + bc = !cop1_bc; // bc1f L9 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_23;} // branch non-likely + + //beq r0, r0, L10 // beq r0, r0, L10 + // nop // sll r0, r0, 0 + goto block_24; // branch always + + +block_23: + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->mov64(v0, v1); // or v0, v1, r0 + //beq r0, r0, L11 // beq r0, r0, L11 + // nop // sll r0, r0, 0 + goto block_26; // branch always + + +block_24: + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L11 // beq r0, r0, L11 + // nop // sll r0, r0, 0 + goto block_26; // branch always + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_26: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lwc1(f30, 80, sp); // lwc1 f30, 80(sp) + c->lq(gp, 64, sp); // lq gp, 64(sp) + c->lq(s5, 48, sp); // lq s5, 48(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s3, 16, sp); // lq s3, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.vector_vector_distance = intern_from_c(-1, 0, "vector-vector-distance").c(); + gLinkedFunctionTable.reg("(method 18 collide-edge-work)", execute, 256); +} + +} // namespace method_18_collide_edge_work +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/collide_hash.cpp b/game/mips2c/jak3_functions/collide_hash.cpp new file mode 100644 index 0000000000..f2cbdde9a9 --- /dev/null +++ b/game/mips2c/jak3_functions/collide_hash.cpp @@ -0,0 +1,1541 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_11_collide_hash { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + //beq r0, r0, L91 // beq r0, r0, L91 + // nop // sll r0, r0, 0 + goto block_2; // branch always + + +block_1: + c->dsll(a1, v1, 4); // dsll a1, v1, 4 + get_fake_spad_addr2(t0, cache.fake_scratchpad_data, 0, c);// lui t0, 28672 + c->daddu(a1, a1, t0); // daddu a1, a1, t0 + c->sq(r0, 0, a1); // sq r0, 0(a1) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + +block_2: + c->lwu(a1, 8, a0); // lwu a1, 8(a0) + c->slt(a1, v1, a1); // slt a1, v1, a1 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L90 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + // nop // sll r0, r0, 0 + c->lw(v1, 72, a0); // lw v1, 72(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf1, 28, a0); // lqc2 vf1, 28(a0) + c->lui(a1, 1); // lui a1, 1 + c->lqc2(vf2, 128, a3); // lqc2 vf2, 128(a3) + c->ori(a1, a1, 257); // ori a1, a1, 257 + c->lqc2(vf3, 144, a3); // lqc2 vf3, 144(a3) + c->dsubu(v1, v1, a1); // dsubu v1, v1, a1 + c->lqc2(vf4, 44, a0); // lqc2 vf4, 44(a0) + c->vsub(DEST::xyzw, vf2, vf2, vf1); // vsub.xyzw vf2, vf2, vf1 + c->lq(a1, 160, a3); // lq a1, 160(a3) + c->vsub(DEST::xyzw, vf3, vf3, vf1); // vsub.xyzw vf3, vf3, vf1 + c->lq(t0, 176, a3); // lq t0, 176(a3) + c->pextlb(v1, r0, v1); // pextlb v1, r0, v1 + c->lq(t1, 60, a0); // lq t1, 60(a0) + c->pextlh(v1, r0, v1); // pextlh v1, r0, v1 + c->lq(t2, 76, a0); // lq t2, 76(a0) + c->pcgtw(t0, t1, t0); // pcgtw t0, t1, t0 + c->vmul(DEST::xyzw, vf2, vf2, vf4); // vmul.xyzw vf2, vf2, vf4 + c->pcgtw(a1, a1, t2); // pcgtw a1, a1, t2 + c->vmul(DEST::xyzw, vf3, vf3, vf4); // vmul.xyzw vf3, vf3, vf4 + c->por(a1, t0, a1); // por a1, t0, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(a1, r0, a1); // ppach a1, r0, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(a1, a1, 16); // dsll a1, a1, 16 + c->vftoi0(DEST::xyzw, vf2, vf2); // vftoi0.xyzw vf2, vf2 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L98 + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + if (bc) {goto block_16;} // branch non-likely + + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf2); // qmfc2.i t0, vf2 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a1, vf3); // qmfc2.i a1, vf3 + c->pmaxw(t0, t0, r0); // pmaxw t0, t0, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxw(a1, a1, r0); // pmaxw a1, a1, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminw(t0, t0, v1); // pminw t0, t0, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminw(v1, a1, v1); // pminw v1, a1, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->sq(t0, 400, a3); // sq t0, 400(a3) + // nop // sll r0, r0, 0 + c->sq(v1, 416, a3); // sq v1, 416(a3) + c->addiu(v1, r0, 4); // addiu v1, r0, 4 + c->lbu(a1, 72, a0); // lbu a1, 72(a0) + c->multu3(a1, a1, v1); // multu3 a1, a1, v1 + c->lbu(t0, 74, a0); // lbu t0, 74(a0) + c->multu3(t0, t0, a1); // multu3 t0, t0, a1 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + c->lw(t2, 400, a3); // lw t2, 400(a3) + c->dsubu(t1, t1, t2); // dsubu t1, t1, t2 + c->lw(t2, 416, a3); // lw t2, 416(a3) + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->lw(t3, 404, a3); // lw t3, 404(a3) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lw(t3, 420, a3); // lw t3, 420(a3) + c->daddu(t4, t2, t3); // daddu t4, t2, t3 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->lw(t3, 408, a3); // lw t3, 408(a3) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lw(t3, 424, a3); // lw t3, 424(a3) + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->lwu(t3, 40, a0); // lwu t3, 40(a0) + c->lw(t5, 400, a3); // lw t5, 400(a3) + c->mult3(t5, t5, v1); // mult3 t5, t5, v1 + c->lw(t6, 404, a3); // lw t6, 404(a3) + c->mult3(t6, t6, t0); // mult3 t6, t6, t0 + c->daddu(t5, t5, t6); // daddu t5, t5, t6 + c->lw(t6, 408, a3); // lw t6, 408(a3) + c->mult3(t6, t6, a1); // mult3 t6, t6, a1 + c->daddu(t5, t5, t6); // daddu t5, t5, t6 + c->daddu(t3, t3, t5); // daddu t3, t3, t5 + c->mov64(t4, t4); // or t4, t4, r0 + // nop // sll r0, r0, 0 + +block_5: + c->mov64(t5, t2); // or t5, t2, r0 + c->mov64(t6, t3); // or t6, t3, r0 + +block_6: + c->mov64(t7, t1); // or t7, t1, r0 + c->mov64(t8, t6); // or t8, t6, r0 + +block_7: + // nop // sll r0, r0, 0 + c->lhu(t9, 0, t8); // lhu t9, 0(t8) + // nop // sll r0, r0, 0 + c->lw(ra, 56, a0); // lw ra, 56(a0) + c->sll(gp, t9, 3); // sll gp, t9, 3 + c->lhu(t9, 2, t8); // lhu t9, 2(t8) + bc = c->sgpr64(t9) == 0; // beq t9, r0, L97 + c->daddu(ra, gp, ra); // daddu ra, gp, ra + if (bc) {goto block_13;} // branch non-likely + + +block_8: + get_fake_spad_addr2(s5, cache.fake_scratchpad_data, 0, c);// lui s5, 28672 + c->lw(s2, 0, ra); // lw s2, 0(ra) + c->addiu(s4, r0, 1); // addiu s4, r0, 1 + c->lw(gp, 4, ra); // lw gp, 4(ra) + c->andi(s3, s2, 7); // andi s3, s2, 7 + c->sra(s2, s2, 3); // sra s2, s2, 3 + c->daddu(s5, s2, s5); // daddu s5, s2, s5 + c->lqc2(vf8, 12, gp); // lqc2 vf8, 12(gp) + c->sllv(s4, s4, s3); // sllv s4, s4, s3 + c->lb(s3, 0, s5); // lb s3, 0(s5) + c->and_(s2, s3, s4); // and s2, s3, s4 + c->daddiu(t9, t9, -1); // daddiu t9, t9, -1 + bc = c->sgpr64(s2) != 0; // bne s2, r0, L96 + c->or_(s4, s3, s4); // or s4, s3, s4 + if (bc) {goto block_12;} // branch non-likely + + c->vsub_bc(DEST::xyzw, BC::w, vf2, vf8, vf8); // vsubw.xyzw vf2, vf8, vf8 + c->sb(s4, 0, s5); // sb s4, 0(s5) + c->vadd_bc(DEST::xyzw, BC::w, vf3, vf8, vf8); // vaddw.xyzw vf3, vf8, vf8 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf2, vf2); // vftoi0.xyzw vf2, vf2 + c->lq(s5, 160, a3); // lq s5, 160(a3) + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + c->lq(s3, 176, a3); // lq s3, 176(a3) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s2, vf2); // qmfc2.i s2, vf2 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s4, vf3); // qmfc2.i s4, vf3 + c->pcgtw(s3, s2, s3); // pcgtw s3, s2, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(s5, s5, s4); // pcgtw s5, s5, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(s5, s3, s5); // por s5, s3, s5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(s5, r0, s5); // ppach s5, r0, s5 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(s5, s5, 16); // dsll s5, s5, 16 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s5) != 0; // bne s5, r0, L96 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(s4, 0, a2); // lw s4, 0(a2) + c->daddiu(s3, s4, -256); // daddiu s3, s4, -256 + c->sll(s5, s4, 3); // sll s5, s4, 3 + bc = ((s64)c->sgpr64(s3)) >= 0; // bgez s3, L98 + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + if (bc) {goto block_16;} // branch non-likely + + c->daddu(s5, s5, a2); // daddu s5, s5, a2 + c->sw(s4, 0, a2); // sw s4, 0(a2) + // nop // sll r0, r0, 0 + c->sw(s7, 20, s5); // sw s7, 20(s5) + // nop // sll r0, r0, 0 + c->sw(gp, 16, s5); // sw gp, 16(s5) + +block_12: + bc = ((s64)c->sgpr64(t9)) > 0; // bgtz t9, L95 + c->daddiu(ra, ra, 8); // daddiu ra, ra, 8 + if (bc) {goto block_8;} // branch non-likely + + +block_13: + c->daddiu(t7, t7, -1); // daddiu t7, t7, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t7) != 0; // bne t7, r0, L94 + c->daddu(t8, t8, v1); // daddu t8, t8, v1 + if (bc) {goto block_7;} // branch non-likely + + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t5) != 0; // bne t5, r0, L93 + c->daddu(t6, t6, a1); // daddu t6, t6, a1 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t4, t4, -1); // daddiu t4, t4, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t4) != 0; // bne t4, r0, L92 + c->daddu(t3, t3, t0); // daddu t3, t3, t0 + if (bc) {goto block_5;} // branch non-likely + + +block_16: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("(method 11 collide-hash)", execute, 256); +} + +} // namespace method_11_collide_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_12_collide_hash { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -112); // daddiu sp, sp, -112 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 16, sp); // sq s1, 16(sp) + c->sq(s2, 32, sp); // sq s2, 32(sp) + c->sq(s3, 48, sp); // sq s3, 48(sp) + c->sq(s4, 64, sp); // sq s4, 64(sp) + c->sq(s5, 80, sp); // sq s5, 80(sp) + c->sq(gp, 96, sp); // sq gp, 96(sp) + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + //beq r0, r0, L81 // beq r0, r0, L81 + // nop // sll r0, r0, 0 + goto block_2; // branch always + + +block_1: + c->dsll(a1, v1, 4); // dsll a1, v1, 4 + get_fake_spad_addr2(t0, cache.fake_scratchpad_data, 0, c);// lui t0, 28672 + c->daddu(a1, a1, t0); // daddu a1, a1, t0 + c->sq(r0, 0, a1); // sq r0, 0(a1) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + +block_2: + c->lwu(a1, 8, a0); // lwu a1, 8(a0) + c->slt(a1, v1, a1); // slt a1, v1, a1 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L80 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lw(v1, 72, a0); // lw v1, 72(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 28, a0); // lqc2 vf2, 28(a0) + c->lui(a1, 1); // lui a1, 1 + c->lqc2(vf3, 128, a3); // lqc2 vf3, 128(a3) + c->ori(a1, a1, 257); // ori a1, a1, 257 + c->lqc2(vf4, 144, a3); // lqc2 vf4, 144(a3) + c->dsubu(v1, v1, a1); // dsubu v1, v1, a1 + c->lqc2(vf5, 44, a0); // lqc2 vf5, 44(a0) + c->vsub(DEST::xyzw, vf3, vf3, vf2); // vsub.xyzw vf3, vf3, vf2 + c->lq(a1, 160, a3); // lq a1, 160(a3) + c->vsub(DEST::xyzw, vf4, vf4, vf2); // vsub.xyzw vf4, vf4, vf2 + c->lq(t0, 176, a3); // lq t0, 176(a3) + c->pextlb(v1, r0, v1); // pextlb v1, r0, v1 + c->lq(t1, 60, a0); // lq t1, 60(a0) + c->pextlh(v1, r0, v1); // pextlh v1, r0, v1 + c->lq(t2, 76, a0); // lq t2, 76(a0) + c->pcgtw(t0, t1, t0); // pcgtw t0, t1, t0 + c->vmul(DEST::xyzw, vf3, vf3, vf5); // vmul.xyzw vf3, vf3, vf5 + c->pcgtw(a1, a1, t2); // pcgtw a1, a1, t2 + c->vmul(DEST::xyzw, vf4, vf4, vf5); // vmul.xyzw vf4, vf4, vf5 + c->por(a1, t0, a1); // por a1, t0, a1 + c->lqc2(vf10, 256, a3); // lqc2 vf10, 256(a3) + c->ppach(a1, r0, a1); // ppach a1, r0, a1 + c->lqc2(vf11, 272, a3); // lqc2 vf11, 272(a3) + c->dsll(a1, a1, 16); // dsll a1, a1, 16 + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L88 + c->vftoi0(DEST::xyzw, vf4, vf4); // vftoi0.xyzw vf4, vf4 + if (bc) {goto block_19;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lqc2(vf8, 208, a3); // lqc2 vf8, 208(a3) + // nop // sll r0, r0, 0 + c->lqc2(vf9, 224, a3); // lqc2 vf9, 224(a3) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf3); // qmfc2.i t0, vf3 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a1, vf4); // qmfc2.i a1, vf4 + c->pmaxw(t0, t0, r0); // pmaxw t0, t0, r0 + c->lqc2(vf6, 12, a0); // lqc2 vf6, 12(a0) + c->pmaxw(a1, a1, r0); // pmaxw a1, a1, r0 + c->lqc2(vf7, 240, a3); // lqc2 vf7, 240(a3) + c->pminw(t0, t0, v1); // pminw t0, t0, v1 + c->vmax_bc(DEST::xyzw, BC::w, vf1, vf0, vf0); // vmaxw.xyzw vf1, vf0, vf0 + c->pminw(v1, a1, v1); // pminw v1, a1, v1 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->sq(t0, 400, a3); // sq t0, 400(a3) + // nop // sll r0, r0, 0 + c->sq(v1, 416, a3); // sq v1, 416(a3) + c->addiu(v1, r0, 4); // addiu v1, r0, 4 + c->lbu(a1, 72, a0); // lbu a1, 72(a0) + c->multu3(a1, a1, v1); // multu3 a1, a1, v1 + c->lbu(t0, 74, a0); // lbu t0, 74(a0) + c->multu3(t0, t0, a1); // multu3 t0, t0, a1 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + c->lw(t2, 400, a3); // lw t2, 400(a3) + c->dsubu(t1, t1, t2); // dsubu t1, t1, t2 + c->lw(t2, 416, a3); // lw t2, 416(a3) + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->lw(t3, 404, a3); // lw t3, 404(a3) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lw(t3, 420, a3); // lw t3, 420(a3) + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->addiu(t3, r0, 1); // addiu t3, r0, 1 + c->lw(t4, 408, a3); // lw t4, 408(a3) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lw(t4, 424, a3); // lw t4, 424(a3) + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lwu(t4, 40, a0); // lwu t4, 40(a0) + c->lw(t5, 400, a3); // lw t5, 400(a3) + c->mult3(t5, t5, v1); // mult3 t5, t5, v1 + c->lw(t6, 404, a3); // lw t6, 404(a3) + c->mult3(t6, t6, t0); // mult3 t6, t6, t0 + c->daddu(t5, t5, t6); // daddu t5, t5, t6 + c->lw(t6, 408, a3); // lw t6, 408(a3) + c->mult3(t6, t6, a1); // mult3 t6, t6, a1 + c->daddu(t5, t5, t6); // daddu t5, t5, t6 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->mov64(t5, t2); // or t5, t2, r0 + // nop // sll r0, r0, 0 + +block_5: + c->mov64(t6, t3); // or t6, t3, r0 + c->mov64(t7, t4); // or t7, t4, r0 + +block_6: + c->mov64(t8, t1); // or t8, t1, r0 + c->mov64(t9, t7); // or t9, t7, r0 + +block_7: + c->dsubu(s3, t1, t8); // dsubu s3, t1, t8 + c->lw(s2, 400, a3); // lw s2, 400(a3) + c->dsubu(s5, t2, t5); // dsubu s5, t2, t5 + c->lw(s4, 404, a3); // lw s4, 404(a3) + c->dsubu(ra, t3, t6); // dsubu ra, t3, t6 + c->lw(gp, 408, a3); // lw gp, 408(a3) + c->daddu(s3, s3, s2); // daddu s3, s3, s2 + c->sw(r0, 444, a3); // sw r0, 444(a3) + c->daddu(s5, s5, s4); // daddu s5, s5, s4 + c->sw(s3, 432, a3); // sw s3, 432(a3) + c->daddu(ra, ra, gp); // daddu ra, ra, gp + c->sw(s5, 436, a3); // sw s5, 436(a3) + // nop // sll r0, r0, 0 + c->sw(ra, 440, a3); // sw ra, 440(a3) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 432, a3); // lqc2 vf3, 432(a3) + c->vitof0(DEST::xyzw, vf3, vf3); // vitof0.xyzw vf3, vf3 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf3, vf6); // vmula.xyzw acc, vf3, vf6 + // nop // sll r0, r0, 0 + c->vmadda(DEST::xyzw, vf1, vf2); // vmadda.xyzw acc, vf1, vf2 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf3, vf1, vf10); // vmsubw.xyzw vf3, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadda(DEST::xyzw, vf1, vf6); // vmadda.xyzw acc, vf1, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf4, vf1, vf10); // vmaddw.xyzw vf4, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf7, vf3); // vmula.xyzw acc, vf7, vf3 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf7, vf8); // vmsuba.xyzw acc, vf7, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf13, vf1, vf10); // vmsub.xyzw vf13, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf15, vf1, vf11); // vmadd.xyzw vf15, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf7, vf4); // vmula.xyzw acc, vf7, vf4 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf7, vf8); // vmsuba.xyzw acc, vf7, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf14, vf1, vf11); // vmsub.xyzw vf14, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf16, vf1, vf10); // vmadd.xyzw vf16, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf13, vf13, vf14); // vmax.xyzw vf13, vf13, vf14 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf15, vf15, vf16); // vmini.xyzw vf15, vf15, vf16 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::y, vf13, vf13, vf13); // vmaxy.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::y, vf15, vf15, vf15); // vminiy.xyzw vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::z, vf13, vf13, vf13); // vmaxz.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::z, vf15, vf15, vf15); // vminiz.xyzw vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vftoi4(DEST::xyzw, vf13, vf13); // vftoi4.xyzw vf13, vf13 + // nop // sll r0, r0, 0 + c->vftoi4(DEST::xyzw, vf15, vf15); // vftoi4.xyzw vf15, vf15 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s5, vf13); // qmfc2.i s5, vf13 + c->addiu(s4, r0, 4096); // addiu s4, r0, 4096 + c->mov128_gpr_vf(ra, vf15); // qmfc2.i ra, vf15 + c->subu(gp, ra, s5); // subu gp, ra, s5 + c->subu(s5, s4, s5); // subu s5, s4, s5 + bc = ((s64)c->sgpr64(gp)) < 0; // bltz gp, L87 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + bc = ((s64)c->sgpr64(s5)) < 0; // bltz s5, L87 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + bc = ((s64)c->sgpr64(ra)) < 0; // bltz ra, L87 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lhu(ra, 0, t9); // lhu ra, 0(t9) + // nop // sll r0, r0, 0 + c->lw(gp, 56, a0); // lw gp, 56(a0) + c->sll(s5, ra, 3); // sll s5, ra, 3 + c->lhu(ra, 2, t9); // lhu ra, 2(t9) + bc = c->sgpr64(ra) == 0; // beq ra, r0, L87 + c->daddu(gp, s5, gp); // daddu gp, s5, gp + if (bc) {goto block_16;} // branch non-likely + + +block_11: + get_fake_spad_addr2(s4, cache.fake_scratchpad_data, 0, c);// lui s4, 28672 + c->lw(s1, 0, gp); // lw s1, 0(gp) + c->addiu(s3, r0, 1); // addiu s3, r0, 1 + c->lw(s5, 4, gp); // lw s5, 4(gp) + c->andi(s2, s1, 7); // andi s2, s1, 7 + c->sra(s1, s1, 3); // sra s1, s1, 3 + c->daddu(s4, s1, s4); // daddu s4, s1, s4 + c->lqc2(vf12, 12, s5); // lqc2 vf12, 12(s5) + c->sllv(s3, s3, s2); // sllv s3, s3, s2 + c->lb(s2, 0, s4); // lb s2, 0(s4) + c->and_(s1, s2, s3); // and s1, s2, s3 + c->daddiu(ra, ra, -1); // daddiu ra, ra, -1 + bc = c->sgpr64(s1) != 0; // bne s1, r0, L86 + c->or_(s3, s2, s3); // or s3, s2, s3 + if (bc) {goto block_15;} // branch non-likely + + c->vmula(DEST::xyzw, vf9, vf12); // vmula.xyzw acc, vf9, vf12 + c->sb(s3, 0, s4); // sb s3, 0(s4) + c->vmsub(DEST::xyzw, vf13, vf9, vf8); // vmsub.xyzw vf13, vf9, vf8 + // nop // sll r0, r0, 0 + c->vmul_bc(DEST::xyzw, BC::w, vf14, vf1, vf7); // vmulw.xyzw vf14, vf1, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf1, vf12); // vmulaw.xyzw acc, vf1, vf12 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf15, vf1, vf10); // vmaddw.xyzw vf15, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf13, vf7); // vmulaw.xyzw acc, vf13, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf13); // vmadday.xyzw acc, vf14, vf13 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf13, vf14, vf13); // vmaddz.xyzw vf13, vf14, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::w, vf13, vf13, vf0); // vminiw.xyzw vf13, vf13, vf0 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::x, vf13, vf13, vf0); // vmaxx.xyzw vf13, vf13, vf0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf9, vf13); // vmulax.xyzw acc, vf9, vf13 + // nop // sll r0, r0, 0 + c->vmadda(DEST::xyzw, vf1, vf8); // vmadda.xyzw acc, vf1, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf13, vf1, vf12); // vmsub.xyzw vf13, vf1, vf12 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf13, vf13, vf13); // vmul.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf0, vf0); // vmulax.xyzw acc, vf0, vf0 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf15, vf15); // vmsuba.xyzw acc, vf15, vf15 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf13); // vmaddax.xyzw acc, vf1, vf13 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf1, vf13); // vmadday.xyzw acc, vf1, vf13 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf13, vf1, vf13); // vmaddz.xyzw vf13, vf1, vf13 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s4, vf13); // qmfc2.i s4, vf13 + bc = ((s64)c->sgpr64(s4)) > 0; // bgtz s4, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(s3, 0, a2); // lw s3, 0(a2) + c->daddiu(s2, s3, -256); // daddiu s2, s3, -256 + c->sll(s4, s3, 3); // sll s4, s3, 3 + bc = ((s64)c->sgpr64(s2)) >= 0; // bgez s2, L88 + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + if (bc) {goto block_19;} // branch non-likely + + c->daddu(s4, s4, a2); // daddu s4, s4, a2 + c->sw(s3, 0, a2); // sw s3, 0(a2) + // nop // sll r0, r0, 0 + c->sw(s7, 20, s4); // sw s7, 20(s4) + // nop // sll r0, r0, 0 + c->sw(s5, 16, s4); // sw s5, 16(s4) + +block_15: + bc = ((s64)c->sgpr64(ra)) > 0; // bgtz ra, L85 + c->daddiu(gp, gp, 8); // daddiu gp, gp, 8 + if (bc) {goto block_11;} // branch non-likely + + +block_16: + c->daddiu(t8, t8, -1); // daddiu t8, t8, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t8) != 0; // bne t8, r0, L84 + c->daddu(t9, t9, v1); // daddu t9, t9, v1 + if (bc) {goto block_7;} // branch non-likely + + c->daddiu(t6, t6, -1); // daddiu t6, t6, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t6) != 0; // bne t6, r0, L83 + c->daddu(t7, t7, a1); // daddu t7, t7, a1 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t5) != 0; // bne t5, r0, L82 + c->daddu(t4, t4, t0); // daddu t4, t4, t0 + if (bc) {goto block_5;} // branch non-likely + + +block_19: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 96, sp); // lq gp, 96(sp) + c->lq(s5, 80, sp); // lq s5, 80(sp) + c->lq(s4, 64, sp); // lq s4, 64(sp) + c->lq(s3, 48, sp); // lq s3, 48(sp) + c->lq(s2, 32, sp); // lq s2, 32(sp) + c->lq(s1, 16, sp); // lq s1, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 112); // daddiu sp, sp, 112 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("(method 12 collide-hash)", execute, 256); +} + +} // namespace method_12_collide_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace fill_bg_using_box_new { +struct Cache { + void* cheat_mode; // *cheat-mode* + void* collide_stats; // *collide-stats* + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* debug; // debug + void* print_exceeded_max_cache_tris; // print-exceeded-max-cache-tris +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + // nop // sll r0, r0, 0 + c->lw(v1, 40, a1); // lw v1, 40(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf1, 44, a1); // lqc2 vf1, 44(a1) + c->lui(a3, 1); // lui a3, 1 + c->lqc2(vf2, 128, a2); // lqc2 vf2, 128(a2) + c->ori(a3, a3, 257); // ori a3, a3, 257 + c->lqc2(vf3, 144, a2); // lqc2 vf3, 144(a2) + c->dsubu(v1, v1, a3); // dsubu v1, v1, a3 + c->lqc2(vf6, 60, a1); // lqc2 vf6, 60(a1) + c->vsub(DEST::xyzw, vf2, vf2, vf1); // vsub.xyzw vf2, vf2, vf1 + c->lq(a3, 160, a2); // lq a3, 160(a2) + c->vsub(DEST::xyzw, vf3, vf3, vf1); // vsub.xyzw vf3, vf3, vf1 + c->lq(t0, 176, a2); // lq t0, 176(a2) + c->pextlb(v1, r0, v1); // pextlb v1, r0, v1 + c->lq(t1, 76, a1); // lq t1, 76(a1) + c->pextlh(v1, r0, v1); // pextlh v1, r0, v1 + c->lq(t2, 92, a1); // lq t2, 92(a1) + c->pcgtw(t0, t1, t0); // pcgtw t0, t1, t0 + c->vftoi0(DEST::xyzw, vf4, vf2); // vftoi0.xyzw vf4, vf2 + c->pcgtw(a3, a3, t2); // pcgtw a3, a3, t2 + c->vftoi0(DEST::xyzw, vf5, vf3); // vftoi0.xyzw vf5, vf3 + c->por(a3, t0, a3); // por a3, t0, a3 + c->vmul(DEST::xyzw, vf2, vf2, vf6); // vmul.xyzw vf2, vf2, vf6 + c->ppach(a3, r0, a3); // ppach a3, r0, a3 + c->vmul(DEST::xyzw, vf3, vf3, vf6); // vmul.xyzw vf3, vf3, vf6 + c->dsll(t0, a3, 16); // dsll t0, a3, 16 + c->mov128_gpr_vf(a3, vf4); // qmfc2.i a3, vf4 + bc = c->sgpr64(t0) != 0; // bne t0, r0, L75 + c->mov128_gpr_vf(t0, vf5); // qmfc2.i t0, vf5 + if (bc) {goto block_17;} // branch non-likely + + c->vftoi0(DEST::xyzw, vf2, vf2); // vftoi0.xyzw vf2, vf2 + c->psraw(a3, a3, 4); // psraw a3, a3, 4 + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + c->psraw(t0, t0, 4); // psraw t0, t0, 4 + // nop // sll r0, r0, 0 + c->sq(a3, 368, a2); // sq a3, 368(a2) + // nop // sll r0, r0, 0 + c->sq(t0, 384, a2); // sq t0, 384(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf2); // qmfc2.i t0, vf2 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf3); // qmfc2.i a3, vf3 + c->pmaxw(t0, t0, r0); // pmaxw t0, t0, r0 + c->lqc2(vf10, 448, a2); // lqc2 vf10, 448(a2) + c->pmaxw(a3, a3, r0); // pmaxw a3, a3, r0 + c->lqc2(vf11, 464, a2); // lqc2 vf11, 464(a2) + c->pminw(t0, t0, v1); // pminw t0, t0, v1 + c->lqc2(vf12, 480, a2); // lqc2 vf12, 480(a2) + c->pminw(v1, a3, v1); // pminw v1, a3, v1 + c->lqc2(vf13, 496, a2); // lqc2 vf13, 496(a2) + // nop // sll r0, r0, 0 + c->sq(t0, 400, a2); // sq t0, 400(a2) + // nop // sll r0, r0, 0 + c->sq(v1, 416, a2); // sq v1, 416(a2) + c->addiu(v1, r0, 4); // addiu v1, r0, 4 + c->lbu(a3, 40, a1); // lbu a3, 40(a1) + c->multu3(t8, a3, v1); // multu3 t8, a3, v1 + c->lbu(a3, 42, a1); // lbu a3, 42(a1) + c->multu3(t6, a3, t8); // multu3 t6, a3, t8 + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->lw(t0, 400, a2); // lw t0, 400(a2) + c->dsubu(a3, a3, t0); // dsubu a3, a3, t0 + c->lw(t0, 416, a2); // lw t0, 416(a2) + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->addiu(t0, r0, 1); // addiu t0, r0, 1 + c->lw(t1, 404, a2); // lw t1, 404(a2) + c->dsubu(t0, t0, t1); // dsubu t0, t0, t1 + c->lw(t1, 420, a2); // lw t1, 420(a2) + c->daddu(t1, t0, t1); // daddu t1, t0, t1 + c->addiu(t0, r0, 1); // addiu t0, r0, 1 + c->lw(t2, 408, a2); // lw t2, 408(a2) + c->dsubu(t0, t0, t2); // dsubu t0, t0, t2 + c->lw(t2, 424, a2); // lw t2, 424(a2) + c->daddu(t0, t0, t2); // daddu t0, t0, t2 + c->lwu(t2, 8, a1); // lwu t2, 8(a1) + c->lw(t3, 400, a2); // lw t3, 400(a2) + c->mult3(t3, t3, v1); // mult3 t3, t3, v1 + c->lw(t4, 404, a2); // lw t4, 404(a2) + c->mult3(t4, t4, t6); // mult3 t4, t4, t6 + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lw(t4, 408, a2); // lw t4, 408(a2) + c->mult3(t4, t4, t8); // mult3 t4, t4, t8 + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->daddu(t7, t2, t3); // daddu t7, t2, t3 + c->mov64(t1, t1); // or t1, t1, r0 + // nop // sll r0, r0, 0 + +block_2: + c->mov64(t5, t0); // or t5, t0, r0 + c->mov64(t9, t7); // or t9, t7, r0 + // nop // sll r0, r0, 0 + c->sw(t7, 524, a2); // sw t7, 524(a2) + // nop // sll r0, r0, 0 + c->sw(t6, 528, a2); // sw t6, 528(a2) + +block_3: + c->mov64(t6, a3); // or t6, a3, r0 + c->mov64(t7, t9); // or t7, t9, r0 + // nop // sll r0, r0, 0 + c->sw(t9, 532, a2); // sw t9, 532(a2) + // nop // sll r0, r0, 0 + c->sw(t8, 536, a2); // sw t8, 536(a2) + +block_4: + // nop // sll r0, r0, 0 + c->lhu(ra, 0, t7); // lhu ra, 0(t7) + // nop // sll r0, r0, 0 + c->lw(gp, 104, a1); // lw gp, 104(a1) + // nop // sll r0, r0, 0 + c->lhu(t8, 2, t7); // lhu t8, 2(t7) + // nop // sll r0, r0, 0 + c->lw(t9, 72, a1); // lw t9, 72(a1) + bc = c->sgpr64(t8) == 0; // beq t8, r0, L74 + c->daddu(ra, ra, gp); // daddu ra, ra, gp + if (bc) {goto block_13;} // branch non-likely + + +block_5: + get_fake_spad_addr2(gp, cache.fake_scratchpad_data, 0, c);// lui gp, 28672 + c->lbu(s4, 0, ra); // lbu s4, 0(ra) + c->addiu(s3, r0, 1); // addiu s3, r0, 1 + c->andi(s2, s4, 7); // andi s2, s4, 7 + c->sra(s5, s4, 3); // sra s5, s4, 3 + c->sll(s4, s4, 2); // sll s4, s4, 2 + c->daddu(s5, s5, gp); // daddu s5, s5, gp + c->daddu(s4, s4, t9); // daddu s4, s4, t9 + c->sllv(s3, s3, s2); // sllv s3, s3, s2 + c->lb(s2, 0, s5); // lb s2, 0(s5) + // nop // sll r0, r0, 0 + c->lbu(s0, 3, s4); // lbu s0, 3(s4) + c->and_(s1, s2, s3); // and s1, s2, s3 + c->daddiu(t8, t8, -1); // daddiu t8, t8, -1 + bc = c->sgpr64(s1) != 0; // bne s1, r0, L73 + c->lw(s1, 4, a1); // lw s1, 4(a1) + if (bc) {goto block_12;} // branch non-likely + + c->dsll(s0, s0, 2); // dsll s0, s0, 2 + c->or_(s3, s2, s3); // or s3, s2, s3 + c->daddu(s2, s0, s1); // daddu s2, s0, s1 + c->sb(s3, 0, s5); // sb s3, 0(s5) + // nop // sll r0, r0, 0 + c->lwu(s5, 0, s2); // lwu s5, 0(s2) + // nop // sll r0, r0, 0 + c->lwu(s2, 96, a2); // lwu s2, 96(a2) + // nop // sll r0, r0, 0 + c->lw(s3, 88, a1); // lw s3, 88(a1) + c->and_(s2, s2, s5); // and s2, s2, s5 + c->lbu(s1, 0, s4); // lbu s1, 0(s4) + bc = c->sgpr64(s2) != 0; // bne s2, r0, L73 + c->lbu(s2, 1, s4); // lbu s2, 1(s4) + if (bc) {goto block_12;} // branch non-likely + + c->sll(s1, s1, 1); // sll s1, s1, 1 + c->lbu(s4, 2, s4); // lbu s4, 2(s4) + c->sll(s0, s1, 1); // sll s0, s1, 1 + c->sll(s2, s2, 1); // sll s2, s2, 1 + c->daddu(s1, s1, s0); // daddu s1, s1, s0 + c->sll(s0, s2, 1); // sll s0, s2, 1 + c->sll(s4, s4, 1); // sll s4, s4, 1 + c->daddu(s0, s2, s0); // daddu s0, s2, s0 + c->sll(v0, s4, 1); // sll v0, s4, 1 + c->daddu(s2, s1, s3); // daddu s2, s1, s3 + c->daddu(s4, s4, v0); // daddu s4, s4, v0 + c->daddu(s1, s0, s3); // daddu s1, s0, s3 + c->daddu(s4, s4, s3); // daddu s4, s4, s3 + c->ldr(t2, 0, s2); // ldr t2, 0(s2) + // nop // sll r0, r0, 0 + c->ldl(t2, 7, s2); // ldl t2, 7(s2) + // nop // sll r0, r0, 0 + c->ldr(t3, 0, s1); // ldr t3, 0(s1) + // nop // sll r0, r0, 0 + c->ldl(t3, 7, s1); // ldl t3, 7(s1) + // nop // sll r0, r0, 0 + c->ldr(t4, 0, s4); // ldr t4, 0(s4) + c->pextlh(t2, r0, t2); // pextlh t2, r0, t2 + c->ldl(t4, 7, s4); // ldl t4, 7(s4) + c->pextlh(t3, r0, t3); // pextlh t3, r0, t3 + c->lq(s4, 368, a2); // lq s4, 368(a2) + c->pextlh(t4, r0, t4); // pextlh t4, r0, t4 + c->lq(s3, 384, a2); // lq s3, 384(a2) + c->pminw(s1, t2, t3); // pminw s1, t2, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxw(s2, t2, t3); // pmaxw s2, t2, t3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pminw(s1, s1, t4); // pminw s1, s1, t4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pmaxw(s2, s2, t4); // pmaxw s2, s2, t4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(s3, s1, s3); // pcgtw s3, s1, s3 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(s4, s4, s2); // pcgtw s4, s4, s2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(s4, s3, s4); // por s4, s3, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->ppach(s4, r0, s4); // ppach s4, r0, s4 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(s4, s4, 16); // dsll s4, s4, 16 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s4) != 0; // bne s4, r0, L73 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + c->psllw(t2, t2, 4); // psllw t2, t2, 4 + c->lw(s4, 2048, gp); // lw s4, 2048(gp) + c->psllw(t3, t3, 4); // psllw t3, t3, 4 + c->mov128_vf_gpr(vf7, t2); // qmtc2.i vf7, t2 + c->psllw(t4, t4, 4); // psllw t4, t4, 4 + c->mov128_vf_gpr(vf8, t3); // qmtc2.i vf8, t3 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf9, t4); // qmtc2.i vf9, t4 + c->vitof0(DEST::xyzw, vf7, vf7); // vitof0.xyzw vf7, vf7 + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->vitof0(DEST::xyzw, vf8, vf8); // vitof0.xyzw vf8, vf8 + c->sw(s4, 2048, gp); // sw s4, 2048(gp) + c->vitof0(DEST::xyzw, vf9, vf9); // vitof0.xyzw vf9, vf9 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf7, vf7, vf1); // vadd.xyzw vf7, vf7, vf1 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf8, vf8, vf1); // vadd.xyzw vf8, vf8, vf1 + c->lwu(gp, 512, a2); // lwu gp, 512(a2) + c->vadd(DEST::xyzw, vf9, vf9, vf1); // vadd.xyzw vf9, vf9, vf1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(gp) == c->sgpr64(s7); // beq gp, s7, L72 + // nop // sll r0, r0, 0 + if (bc) {goto block_10;} // branch non-likely + + c->vmula_bc(DEST::xyzw, BC::x, vf10, vf7); // vmulax.xyzw acc, vf10, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf11, vf7); // vmadday.xyzw acc, vf11, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf12, vf7); // vmaddaz.xyzw acc, vf12, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf7, vf13, vf0); // vmaddw.xyzw vf7, vf13, vf0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf10, vf8); // vmulax.xyzw acc, vf10, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf11, vf8); // vmadday.xyzw acc, vf11, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf12, vf8); // vmaddaz.xyzw acc, vf12, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf8, vf13, vf0); // vmaddw.xyzw vf8, vf13, vf0 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf10, vf9); // vmulax.xyzw acc, vf10, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf11, vf9); // vmadday.xyzw acc, vf11, vf9 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf12, vf9); // vmaddaz.xyzw acc, vf12, vf9 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf9, vf13, vf0); // vmaddw.xyzw vf9, vf13, vf0 + // nop // sll r0, r0, 0 + +block_10: + c->pextlw(gp, gp, s5); // pextlw gp, gp, s5 + c->lw(s4, 0, a0); // lw s4, 0(a0) + // nop // sll r0, r0, 0 + c->daddiu(s5, a0, 4908); // daddiu s5, a0, 4908 + c->daddiu(s3, s4, -460); // daddiu s3, s4, -460 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(s3)) >= 0; // bgez s3, L76 + c->dsll(s3, s4, 6); // dsll s3, s4, 6 + if (bc) {goto block_18;} // branch non-likely + + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->daddu(s5, s5, s3); // daddu s5, s5, s3 + // nop // sll r0, r0, 0 + c->sw(s4, 0, a0); // sw s4, 0(a0) + // nop // sll r0, r0, 0 + c->sq(gp, 48, s5); // sq gp, 48(s5) + // nop // sll r0, r0, 0 + c->sqc2(vf7, 0, s5); // sqc2 vf7, 0(s5) + // nop // sll r0, r0, 0 + c->sqc2(vf8, 16, s5); // sqc2 vf8, 16(s5) + // nop // sll r0, r0, 0 + c->sqc2(vf9, 32, s5); // sqc2 vf9, 32(s5) + +block_12: + bc = ((s64)c->sgpr64(t8)) > 0; // bgtz t8, L71 + c->daddiu(ra, ra, 1); // daddiu ra, ra, 1 + if (bc) {goto block_5;} // branch non-likely + + +block_13: + c->daddiu(t6, t6, -1); // daddiu t6, t6, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t6) != 0; // bne t6, r0, L70 + c->daddu(t7, t7, v1); // daddu t7, t7, v1 + if (bc) {goto block_4;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t6, 532, a2); // lw t6, 532(a2) + // nop // sll r0, r0, 0 + c->lw(t8, 536, a2); // lw t8, 536(a2) + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t5) != 0; // bne t5, r0, L69 + c->daddu(t9, t6, t8); // daddu t9, t6, t8 + if (bc) {goto block_3;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t5, 524, a2); // lw t5, 524(a2) + // nop // sll r0, r0, 0 + c->lw(t6, 528, a2); // lw t6, 528(a2) + c->daddiu(t1, t1, -1); // daddiu t1, t1, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t1) != 0; // bne t1, r0, L68 + c->daddu(t7, t5, t6); // daddu t7, t5, t6 + if (bc) {goto block_2;} // branch non-likely + + c->load_symbol2(v1, cache.collide_stats); // lw v1, *collide-stats*(s7) + c->lwu(v1, 12, v1); // lwu v1, 12(v1) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->load_symbol2(a0, cache.collide_stats); // lw a0, *collide-stats*(s7) + c->sw(v1, 12, a0); // sw v1, 12(a0) + +block_17: + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L78 // beq r0, r0, L78 + // nop // sll r0, r0, 0 + goto block_21; // branch always + + +block_18: + c->load_symbol_addr(v1, cache.debug); // daddiu v1, s7, debug + c->load_symbol2(a0, cache.cheat_mode); // lw a0, *cheat-mode*(s7) + bc = c->sgpr64(a0) != c->sgpr64(v1); // bne a0, v1, L77 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_20;} // branch non-likely + + c->load_symbol2(t9, cache.print_exceeded_max_cache_tris);// lw t9, print-exceeded-max-cache-tris(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_20: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_21: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.cheat_mode = intern_from_c(-1, 0, "*cheat-mode*").c(); + cache.collide_stats = intern_from_c(-1, 0, "*collide-stats*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.debug = intern_from_c(-1, 0, "debug").c(); + cache.print_exceeded_max_cache_tris = intern_from_c(-1, 0, "print-exceeded-max-cache-tris").c(); + gLinkedFunctionTable.reg("fill-bg-using-box-new", execute, 256); +} + +} // namespace fill_bg_using_box_new +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace fill_bg_using_line_sphere_new { +struct Cache { + void* cheat_mode; // *cheat-mode* + void* collide_stats; // *collide-stats* + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* debug; // debug + void* print_exceeded_max_cache_tris; // print-exceeded-max-cache-tris +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + // nop // sll r0, r0, 0 + c->lw(v1, 40, a1); // lw v1, 40(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 44, a1); // lqc2 vf2, 44(a1) + c->lui(a3, 1); // lui a3, 1 + c->lqc2(vf3, 128, a2); // lqc2 vf3, 128(a2) + c->ori(a3, a3, 257); // ori a3, a3, 257 + c->lqc2(vf4, 144, a2); // lqc2 vf4, 144(a2) + c->dsubu(v1, v1, a3); // dsubu v1, v1, a3 + c->lqc2(vf5, 60, a1); // lqc2 vf5, 60(a1) + c->vsub(DEST::xyzw, vf3, vf3, vf2); // vsub.xyzw vf3, vf3, vf2 + c->lq(a3, 160, a2); // lq a3, 160(a2) + c->vsub(DEST::xyzw, vf4, vf4, vf2); // vsub.xyzw vf4, vf4, vf2 + c->lq(t0, 176, a2); // lq t0, 176(a2) + c->pextlb(v1, r0, v1); // pextlb v1, r0, v1 + c->lq(t1, 76, a1); // lq t1, 76(a1) + c->pextlh(v1, r0, v1); // pextlh v1, r0, v1 + c->lq(t2, 92, a1); // lq t2, 92(a1) + c->pcgtw(t0, t1, t0); // pcgtw t0, t1, t0 + c->vmul(DEST::xyzw, vf3, vf3, vf5); // vmul.xyzw vf3, vf3, vf5 + c->pcgtw(a3, a3, t2); // pcgtw a3, a3, t2 + c->vmul(DEST::xyzw, vf4, vf4, vf5); // vmul.xyzw vf4, vf4, vf5 + c->por(a3, t0, a3); // por a3, t0, a3 + c->lqc2(vf10, 256, a2); // lqc2 vf10, 256(a2) + c->ppach(a3, r0, a3); // ppach a3, r0, a3 + c->lqc2(vf11, 272, a2); // lqc2 vf11, 272(a2) + c->dsll(a3, a3, 16); // dsll a3, a3, 16 + c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L63 + c->vftoi0(DEST::xyzw, vf4, vf4); // vftoi0.xyzw vf4, vf4 + if (bc) {goto block_22;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lqc2(vf8, 208, a2); // lqc2 vf8, 208(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf9, 224, a2); // lqc2 vf9, 224(a2) + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t0, vf3); // qmfc2.i t0, vf3 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf4); // qmfc2.i a3, vf4 + c->pmaxw(t0, t0, r0); // pmaxw t0, t0, r0 + c->lqc2(vf6, 28, a1); // lqc2 vf6, 28(a1) + c->pmaxw(a3, a3, r0); // pmaxw a3, a3, r0 + c->lqc2(vf7, 240, a2); // lqc2 vf7, 240(a2) + c->pminw(t0, t0, v1); // pminw t0, t0, v1 + c->vmax_bc(DEST::xyzw, BC::w, vf1, vf0, vf0); // vmaxw.xyzw vf1, vf0, vf0 + c->pminw(v1, a3, v1); // pminw v1, a3, v1 + c->lqc2(vf23, 448, a2); // lqc2 vf23, 448(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf24, 464, a2); // lqc2 vf24, 464(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf25, 480, a2); // lqc2 vf25, 480(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf26, 496, a2); // lqc2 vf26, 496(a2) + // nop // sll r0, r0, 0 + c->sq(t0, 400, a2); // sq t0, 400(a2) + // nop // sll r0, r0, 0 + c->sq(v1, 416, a2); // sq v1, 416(a2) + c->vsub(DEST::xyzw, vf8, vf8, vf2); // vsub.xyzw vf8, vf8, vf2 + // nop // sll r0, r0, 0 + c->addiu(t8, r0, 4); // addiu t8, r0, 4 + c->lbu(v1, 40, a1); // lbu v1, 40(a1) + c->multu3(t9, v1, t8); // multu3 t9, v1, t8 + c->lbu(v1, 42, a1); // lbu v1, 42(a1) + c->multu3(t6, v1, t9); // multu3 t6, v1, t9 + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + c->lw(a3, 400, a2); // lw a3, 400(a2) + c->dsubu(v1, v1, a3); // dsubu v1, v1, a3 + c->lw(a3, 416, a2); // lw a3, 416(a2) + c->daddu(v1, v1, a3); // daddu v1, v1, a3 + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->lw(t0, 404, a2); // lw t0, 404(a2) + c->dsubu(a3, a3, t0); // dsubu a3, a3, t0 + c->lw(t0, 420, a2); // lw t0, 420(a2) + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->addiu(t0, r0, 1); // addiu t0, r0, 1 + c->lw(t1, 408, a2); // lw t1, 408(a2) + c->dsubu(t0, t0, t1); // dsubu t0, t0, t1 + c->lw(t1, 424, a2); // lw t1, 424(a2) + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->lwu(t1, 8, a1); // lwu t1, 8(a1) + c->lw(t2, 400, a2); // lw t2, 400(a2) + c->mult3(t2, t2, t8); // mult3 t2, t2, t8 + c->lw(t3, 404, a2); // lw t3, 404(a2) + c->mult3(t3, t3, t6); // mult3 t3, t3, t6 + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->lw(t3, 408, a2); // lw t3, 408(a2) + c->mult3(t3, t3, t9); // mult3 t3, t3, t9 + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->daddu(t7, t1, t2); // daddu t7, t1, t2 + c->mov64(t1, a3); // or t1, a3, r0 + // nop // sll r0, r0, 0 + +block_2: + c->mov64(t2, t0); // or t2, t0, r0 + c->mov64(ra, t7); // or ra, t7, r0 + // nop // sll r0, r0, 0 + c->sw(t7, 524, a2); // sw t7, 524(a2) + // nop // sll r0, r0, 0 + c->sw(t6, 528, a2); // sw t6, 528(a2) + +block_3: + c->mov64(t6, v1); // or t6, v1, r0 + c->mov64(t7, ra); // or t7, ra, r0 + // nop // sll r0, r0, 0 + c->sw(ra, 532, a2); // sw ra, 532(a2) + // nop // sll r0, r0, 0 + c->sw(t9, 536, a2); // sw t9, 536(a2) + +block_4: + // nop // sll r0, r0, 0 + c->sw(t8, 520, a2); // sw t8, 520(a2) + c->dsubu(s5, v1, t6); // dsubu s5, v1, t6 + c->lw(s4, 400, a2); // lw s4, 400(a2) + c->dsubu(ra, a3, t1); // dsubu ra, a3, t1 + c->lw(gp, 404, a2); // lw gp, 404(a2) + c->dsubu(t8, t0, t2); // dsubu t8, t0, t2 + c->lw(t9, 408, a2); // lw t9, 408(a2) + c->daddu(s5, s5, s4); // daddu s5, s5, s4 + c->sw(r0, 444, a2); // sw r0, 444(a2) + c->daddu(ra, ra, gp); // daddu ra, ra, gp + c->sw(s5, 432, a2); // sw s5, 432(a2) + c->daddu(t8, t8, t9); // daddu t8, t8, t9 + c->sw(ra, 436, a2); // sw ra, 436(a2) + // nop // sll r0, r0, 0 + c->sw(t8, 440, a2); // sw t8, 440(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 432, a2); // lqc2 vf3, 432(a2) + c->vitof0(DEST::xyzw, vf3, vf3); // vitof0.xyzw vf3, vf3 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf3, vf6); // vmula.xyzw acc, vf3, vf6 + // nop // sll r0, r0, 0 + c->vmsub_bc(DEST::xyzw, BC::w, vf3, vf1, vf10); // vmsubw.xyzw vf3, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadda(DEST::xyzw, vf1, vf6); // vmadda.xyzw acc, vf1, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf4, vf1, vf10); // vmaddw.xyzw vf4, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf7, vf3); // vmula.xyzw acc, vf7, vf3 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf7, vf8); // vmsuba.xyzw acc, vf7, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf13, vf1, vf10); // vmsub.xyzw vf13, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf15, vf1, vf11); // vmadd.xyzw vf15, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf7, vf4); // vmula.xyzw acc, vf7, vf4 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf7, vf8); // vmsuba.xyzw acc, vf7, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf14, vf1, vf11); // vmsub.xyzw vf14, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf16, vf1, vf10); // vmadd.xyzw vf16, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf13, vf13, vf14); // vmax.xyzw vf13, vf13, vf14 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf15, vf15, vf16); // vmini.xyzw vf15, vf15, vf16 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::y, vf13, vf13, vf13); // vmaxy.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::y, vf15, vf15, vf15); // vminiy.xyzw vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::z, vf13, vf13, vf13); // vmaxz.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::z, vf15, vf15, vf15); // vminiz.xyzw vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vftoi12(DEST::xyzw, vf13, vf13); // vftoi12.xyzw vf13, vf13 + // nop // sll r0, r0, 0 + c->vftoi12(DEST::xyzw, vf15, vf15); // vftoi12.xyzw vf15, vf15 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(ra, vf13); // qmfc2.i ra, vf13 + c->addiu(gp, r0, 4096); // addiu gp, r0, 4096 + c->mov128_gpr_vf(t8, vf15); // qmfc2.i t8, vf15 + c->subu(t9, t8, ra); // subu t9, t8, ra + c->subu(ra, gp, ra); // subu ra, gp, ra + bc = ((s64)c->sgpr64(t9)) < 0; // bltz t9, L62 + // nop // sll r0, r0, 0 + if (bc) {goto block_18;} // branch non-likely + + bc = ((s64)c->sgpr64(ra)) < 0; // bltz ra, L62 + // nop // sll r0, r0, 0 + if (bc) {goto block_18;} // branch non-likely + + bc = ((s64)c->sgpr64(t8)) < 0; // bltz t8, L62 + // nop // sll r0, r0, 0 + if (bc) {goto block_18;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lhu(ra, 0, t7); // lhu ra, 0(t7) + // nop // sll r0, r0, 0 + c->lw(gp, 104, a1); // lw gp, 104(a1) + // nop // sll r0, r0, 0 + c->lhu(t8, 2, t7); // lhu t8, 2(t7) + // nop // sll r0, r0, 0 + c->lw(t9, 72, a1); // lw t9, 72(a1) + bc = c->sgpr64(t8) == 0; // beq t8, r0, L62 + c->daddu(ra, ra, gp); // daddu ra, ra, gp + if (bc) {goto block_18;} // branch non-likely + + +block_8: + get_fake_spad_addr2(gp, cache.fake_scratchpad_data, 0, c);// lui gp, 28672 + c->lbu(s4, 0, ra); // lbu s4, 0(ra) + c->addiu(s3, r0, 1); // addiu s3, r0, 1 + c->andi(s2, s4, 7); // andi s2, s4, 7 + c->sra(s5, s4, 3); // sra s5, s4, 3 + c->sll(s4, s4, 2); // sll s4, s4, 2 + c->daddu(s5, s5, gp); // daddu s5, s5, gp + c->daddu(s4, s4, t9); // daddu s4, s4, t9 + c->sllv(s3, s3, s2); // sllv s3, s3, s2 + c->lb(s2, 0, s5); // lb s2, 0(s5) + // nop // sll r0, r0, 0 + c->lbu(s0, 3, s4); // lbu s0, 3(s4) + c->and_(s1, s2, s3); // and s1, s2, s3 + c->daddiu(t8, t8, -1); // daddiu t8, t8, -1 + bc = c->sgpr64(s1) != 0; // bne s1, r0, L61 + c->lw(s1, 4, a1); // lw s1, 4(a1) + if (bc) {goto block_17;} // branch non-likely + + c->dsll(s0, s0, 2); // dsll s0, s0, 2 + c->or_(s3, s2, s3); // or s3, s2, s3 + c->daddu(s2, s0, s1); // daddu s2, s0, s1 + c->sb(s3, 0, s5); // sb s3, 0(s5) + // nop // sll r0, r0, 0 + c->lwu(s5, 0, s2); // lwu s5, 0(s2) + // nop // sll r0, r0, 0 + c->lwu(s2, 96, a2); // lwu s2, 96(a2) + // nop // sll r0, r0, 0 + c->lw(s3, 88, a1); // lw s3, 88(a1) + c->and_(s2, s2, s5); // and s2, s2, s5 + c->lbu(s1, 0, s4); // lbu s1, 0(s4) + bc = c->sgpr64(s2) != 0; // bne s2, r0, L61 + c->lbu(s2, 1, s4); // lbu s2, 1(s4) + if (bc) {goto block_17;} // branch non-likely + + c->sll(s1, s1, 1); // sll s1, s1, 1 + c->lbu(s4, 2, s4); // lbu s4, 2(s4) + c->sll(s0, s1, 1); // sll s0, s1, 1 + c->sll(s2, s2, 1); // sll s2, s2, 1 + c->daddu(s1, s1, s0); // daddu s1, s1, s0 + c->sll(s0, s2, 1); // sll s0, s2, 1 + c->sll(s4, s4, 1); // sll s4, s4, 1 + c->daddu(s0, s2, s0); // daddu s0, s2, s0 + c->sll(v0, s4, 1); // sll v0, s4, 1 + c->daddu(s2, s1, s3); // daddu s2, s1, s3 + c->daddu(s1, s4, v0); // daddu s1, s4, v0 + c->daddu(s4, s0, s3); // daddu s4, s0, s3 + c->daddu(s3, s1, s3); // daddu s3, s1, s3 + c->ldr(t3, 0, s2); // ldr t3, 0(s2) + // nop // sll r0, r0, 0 + c->ldl(t3, 7, s2); // ldl t3, 7(s2) + // nop // sll r0, r0, 0 + c->ldr(t4, 0, s4); // ldr t4, 0(s4) + c->pextlh(t3, r0, t3); // pextlh t3, r0, t3 + c->ldl(t4, 7, s4); // ldl t4, 7(s4) + c->psllw(t3, t3, 4); // psllw t3, t3, 4 + c->ldr(t5, 0, s3); // ldr t5, 0(s3) + c->pextlh(t4, r0, t4); // pextlh t4, r0, t4 + c->ldl(t5, 7, s3); // ldl t5, 7(s3) + c->psllw(t4, t4, 4); // psllw t4, t4, 4 + c->mov128_vf_gpr(vf17, t3); // qmtc2.i vf17, t3 + c->pextlh(t5, r0, t5); // pextlh t5, r0, t5 + c->mov128_vf_gpr(vf18, t4); // qmtc2.i vf18, t4 + c->psllw(t5, t5, 4); // psllw t5, t5, 4 + c->lw(s4, 2048, gp); // lw s4, 2048(gp) + c->mov128_vf_gpr(vf19, t5); // qmtc2.i vf19, t5 + // nop // sll r0, r0, 0 + c->vitof0(DEST::xyzw, vf17, vf17); // vitof0.xyzw vf17, vf17 + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->vitof0(DEST::xyzw, vf18, vf18); // vitof0.xyzw vf18, vf18 + c->sw(s4, 2048, gp); // sw s4, 2048(gp) + c->vitof0(DEST::xyzw, vf19, vf19); // vitof0.xyzw vf19, vf19 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf3, vf17, vf18); // vmini.xyzw vf3, vf17, vf18 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf4, vf17, vf18); // vmax.xyzw vf4, vf17, vf18 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf17, vf17, vf2); // vadd.xyzw vf17, vf17, vf2 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf18, vf18, vf2); // vadd.xyzw vf18, vf18, vf2 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf3, vf3, vf19); // vmini.xyzw vf3, vf3, vf19 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf4, vf4, vf19); // vmax.xyzw vf4, vf4, vf19 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf19, vf19, vf2); // vadd.xyzw vf19, vf19, vf2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::xyzw, BC::w, vf3, vf3, vf10); // vsubw.xyzw vf3, vf3, vf10 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::xyzw, BC::w, vf4, vf4, vf10); // vaddw.xyzw vf4, vf4, vf10 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf7, vf3); // vmula.xyzw acc, vf7, vf3 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf7, vf8); // vmsuba.xyzw acc, vf7, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf13, vf1, vf10); // vmsub.xyzw vf13, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf15, vf1, vf11); // vmadd.xyzw vf15, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmula(DEST::xyzw, vf7, vf4); // vmula.xyzw acc, vf7, vf4 + // nop // sll r0, r0, 0 + c->vmsuba(DEST::xyzw, vf7, vf8); // vmsuba.xyzw acc, vf7, vf8 + // nop // sll r0, r0, 0 + c->vmsub(DEST::xyzw, vf14, vf1, vf11); // vmsub.xyzw vf14, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmadd(DEST::xyzw, vf16, vf1, vf10); // vmadd.xyzw vf16, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf23, vf17); // vmulax.xyzw acc, vf23, vf17 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf24, vf17); // vmadday.xyzw acc, vf24, vf17 + // nop // sll r0, r0, 0 + c->vmax(DEST::xyzw, vf13, vf13, vf14); // vmax.xyzw vf13, vf13, vf14 + // nop // sll r0, r0, 0 + c->vmini(DEST::xyzw, vf15, vf15, vf16); // vmini.xyzw vf15, vf15, vf16 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf25, vf17); // vmaddaz.xyzw acc, vf25, vf17 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf20, vf26, vf0); // vmaddw.xyzw vf20, vf26, vf0 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::y, vf13, vf13, vf13); // vmaxy.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::y, vf15, vf15, vf15); // vminiy.xyzw vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf23, vf18); // vmulax.xyzw acc, vf23, vf18 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf24, vf18); // vmadday.xyzw acc, vf24, vf18 + // nop // sll r0, r0, 0 + c->vmax_bc(DEST::xyzw, BC::z, vf13, vf13, vf13); // vmaxz.xyzw vf13, vf13, vf13 + // nop // sll r0, r0, 0 + c->vmini_bc(DEST::xyzw, BC::z, vf15, vf15, vf15); // vminiz.xyzw vf15, vf15, vf15 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::z, vf25, vf18); // vmaddaz.xyzw acc, vf25, vf18 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf21, vf26, vf0); // vmaddw.xyzw vf21, vf26, vf0 + // nop // sll r0, r0, 0 + c->vftoi12(DEST::xyzw, vf13, vf13); // vftoi12.xyzw vf13, vf13 + // nop // sll r0, r0, 0 + c->vftoi12(DEST::xyzw, vf15, vf15); // vftoi12.xyzw vf15, vf15 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::x, vf23, vf19); // vmulax.xyzw acc, vf23, vf19 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf24, vf19); // vmadday.xyzw acc, vf24, vf19 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(s3, vf13); // qmfc2.i s3, vf13 + c->addiu(s2, r0, 4096); // addiu s2, r0, 4096 + c->mov128_gpr_vf(s4, vf15); // qmfc2.i s4, vf15 + c->subu(gp, s4, s3); // subu gp, s4, s3 + c->subu(s3, s2, s3); // subu s3, s2, s3 + bc = ((s64)c->sgpr64(gp)) < 0; // bltz gp, L61 + c->lwu(gp, 512, a2); // lwu gp, 512(a2) + if (bc) {goto block_17;} // branch non-likely + + bc = ((s64)c->sgpr64(s3)) < 0; // bltz s3, L61 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + bc = ((s64)c->sgpr64(s4)) < 0; // bltz s4, L61 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + c->pextlw(s5, gp, s5); // pextlw s5, gp, s5 + c->lw(s3, 0, a0); // lw s3, 0(a0) + // nop // sll r0, r0, 0 + c->daddiu(s4, a0, 4908); // daddiu s4, a0, 4908 + c->daddiu(s2, s3, -460); // daddiu s2, s3, -460 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(s2)) >= 0; // bgez s2, L64 + c->dsll(s2, s3, 6); // dsll s2, s3, 6 + if (bc) {goto block_23;} // branch non-likely + + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->daddu(s4, s4, s2); // daddu s4, s4, s2 + bc = c->sgpr64(gp) == c->sgpr64(s7); // beq gp, s7, L60 + c->sw(s3, 0, a0); // sw s3, 0(a0) + if (bc) {goto block_16;} // branch non-likely + + c->vmadda_bc(DEST::xyzw, BC::z, vf25, vf19); // vmaddaz.xyzw acc, vf25, vf19 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::w, vf22, vf26, vf0); // vmaddw.xyzw vf22, vf26, vf0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sq(s5, 48, s4); // sq s5, 48(s4) + // nop // sll r0, r0, 0 + c->sqc2(vf20, 0, s4); // sqc2 vf20, 0(s4) + // nop // sll r0, r0, 0 + c->sqc2(vf21, 16, s4); // sqc2 vf21, 16(s4) + //beq r0, r0, L61 // beq r0, r0, L61 + c->sqc2(vf22, 32, s4); // sqc2 vf22, 32(s4) + goto block_17; // branch always + + +block_16: + // nop // sll r0, r0, 0 + c->sq(s5, 48, s4); // sq s5, 48(s4) + // nop // sll r0, r0, 0 + c->sqc2(vf17, 0, s4); // sqc2 vf17, 0(s4) + // nop // sll r0, r0, 0 + c->sqc2(vf18, 16, s4); // sqc2 vf18, 16(s4) + // nop // sll r0, r0, 0 + c->sqc2(vf19, 32, s4); // sqc2 vf19, 32(s4) + +block_17: + bc = ((s64)c->sgpr64(t8)) > 0; // bgtz t8, L59 + c->daddiu(ra, ra, 1); // daddiu ra, ra, 1 + if (bc) {goto block_8;} // branch non-likely + + +block_18: + // nop // sll r0, r0, 0 + c->lw(t8, 520, a2); // lw t8, 520(a2) + c->daddiu(t6, t6, -1); // daddiu t6, t6, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t6) != 0; // bne t6, r0, L58 + c->daddu(t7, t7, t8); // daddu t7, t7, t8 + if (bc) {goto block_4;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t6, 532, a2); // lw t6, 532(a2) + // nop // sll r0, r0, 0 + c->lw(t9, 536, a2); // lw t9, 536(a2) + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t2) != 0; // bne t2, r0, L57 + c->daddu(ra, t6, t9); // daddu ra, t6, t9 + if (bc) {goto block_3;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lw(t2, 524, a2); // lw t2, 524(a2) + // nop // sll r0, r0, 0 + c->lw(t6, 528, a2); // lw t6, 528(a2) + c->daddiu(t1, t1, -1); // daddiu t1, t1, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t1) != 0; // bne t1, r0, L56 + c->daddu(t7, t2, t6); // daddu t7, t2, t6 + if (bc) {goto block_2;} // branch non-likely + + c->load_symbol2(v1, cache.collide_stats); // lw v1, *collide-stats*(s7) + c->lwu(v1, 12, v1); // lwu v1, 12(v1) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->load_symbol2(a0, cache.collide_stats); // lw a0, *collide-stats*(s7) + c->sw(v1, 12, a0); // sw v1, 12(a0) + +block_22: + c->mov64(v0, s7); // or v0, s7, r0 + //beq r0, r0, L66 // beq r0, r0, L66 + // nop // sll r0, r0, 0 + goto block_26; // branch always + + +block_23: + c->load_symbol_addr(v1, cache.debug); // daddiu v1, s7, debug + c->load_symbol2(a0, cache.cheat_mode); // lw a0, *cheat-mode*(s7) + bc = c->sgpr64(a0) != c->sgpr64(v1); // bne a0, v1, L65 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_25;} // branch non-likely + + c->load_symbol2(t9, cache.print_exceeded_max_cache_tris);// lw t9, print-exceeded-max-cache-tris(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_25: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_26: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.cheat_mode = intern_from_c(-1, 0, "*cheat-mode*").c(); + cache.collide_stats = intern_from_c(-1, 0, "*collide-stats*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.debug = intern_from_c(-1, 0, "debug").c(); + cache.print_exceeded_max_cache_tris = intern_from_c(-1, 0, "print-exceeded-max-cache-tris").c(); + gLinkedFunctionTable.reg("fill-bg-using-line-sphere-new", execute, 256); +} + +} // namespace fill_bg_using_line_sphere_new +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/collide_mesh.cpp b/game/mips2c/jak3_functions/collide_mesh.cpp new file mode 100644 index 0000000000..001bbf796e --- /dev/null +++ b/game/mips2c/jak3_functions/collide_mesh.cpp @@ -0,0 +1,719 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_12_collide_mesh { +struct Cache { + void* closest_pt_in_triangle; // closest-pt-in-triangle +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -160); // daddiu sp, sp, -160 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 64, sp); // sq s1, 64(sp) + c->sq(s2, 80, sp); // sq s2, 80(sp) + c->sq(s3, 96, sp); // sq s3, 96(sp) + c->sq(s4, 112, sp); // sq s4, 112(sp) + c->sq(s5, 128, sp); // sq s5, 128(sp) + c->sq(gp, 144, sp); // sq gp, 144(sp) + c->mov64(gp, a2); // or gp, a2, r0 + c->mov64(s5, a3); // or s5, a3, r0 + c->mov64(s3, t0); // or s3, t0, r0 + c->daddiu(s4, sp, 16); // daddiu s4, sp, 16 + c->lui(v1, 17141); // lui v1, 17141 + c->ori(v1, v1, 49807); // ori v1, v1, 49807 + // nop // sll r0, r0, 0 + c->mov64(s2, a1); // or s2, a1, r0 + c->lqc2(vf3, 0, s5); // lqc2 vf3, 0(s5) + c->mov128_vf_gpr(vf14, v1); // qmtc2.i vf14, v1 + c->lwu(s1, 4, a0); // lwu s1, 4(a0) + c->vadd_bc(DEST::w, BC::x, vf3, vf3, vf14); // vaddx.w vf3, vf3, vf14 + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::xyzw, BC::w, vf12, vf3, vf3); // vsubw.xyzw vf12, vf3, vf3 + // nop // sll r0, r0, 0 + c->vadd_bc(DEST::xyzw, BC::w, vf13, vf3, vf3); // vaddw.xyzw vf13, vf3, vf3 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf12, vf12); // vftoi0.xyzw vf12, vf12 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf13, vf13); // vftoi0.xyzw vf13, vf13 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(v1, vf12); // qmfc2.i v1, vf12 + c->sqc2(vf12, 16, s4); // sqc2 vf12, 16(s4) + c->mov128_gpr_vf(a0, vf13); // qmfc2.i a0, vf13 + c->sqc2(vf13, 32, s4); // sqc2 vf13, 32(s4) + +block_1: + bc = c->sgpr64(s1) == 0; // beq s1, r0, L34 + c->lwu(a2, 60, s2); // lwu a2, 60(s2) + if (bc) {goto block_14;} // branch non-likely + + c->addiu(a3, r0, 896); // addiu a3, r0, 896 + c->addiu(a1, r0, 0); // addiu a1, r0, 0 + c->and_(a2, a2, a3); // and a2, a2, a3 + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + bc = c->sgpr64(a2) == c->sgpr64(a1); // beq a2, a1, L32 + c->daddiu(s1, s1, -1); // daddiu s1, s1, -1 + if (bc) {goto block_5;} // branch non-likely + + if (((s64)c->sgpr64(a2)) != ((s64)c->sgpr64(a3))) {// bnel a2, a3, L31 + c->daddiu(s2, s2, 96); // daddiu s2, s2, 96 + goto block_1; + } + +block_5: + // nop // sll r0, r0, 0 + c->lq(a2, 64, s2); // lq a2, 64(s2) + // nop // sll r0, r0, 0 + c->lq(a1, 80, s2); // lq a1, 80(s2) + c->pcgtw(a2, a2, a0); // pcgtw a2, a2, a0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcgtw(a1, v1, a1); // pcgtw a1, v1, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->por(a1, a2, a1); // por a1, a2, a1 + // nop // sll r0, r0, 0 + c->ppach(a1, r0, a1); // ppach a1, r0, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->dsll(a1, a1, 16); // dsll a1, a1, 16 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(a1)) != ((s64)0)) { // bnel a1, r0, L31 + c->daddiu(s2, s2, 96); // daddiu s2, s2, 96 + goto block_1; + } + +// block_7: + c->load_symbol2(t9, cache.closest_pt_in_triangle);// lw t9, closest-pt-in-triangle(s7) + c->daddu(a0, r0, s4); // daddu a0, r0, s4 + c->mov64(a1, s5); // or a1, s5, r0 + c->daddu(a2, r0, s2); // daddu a2, r0, s2 + c->daddiu(a3, s2, 48); // daddiu a3, s2, 48 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lqc2(vf2, 0, s4); // lqc2 vf2, 0(s4) + c->lqc2(vf3, 0, s5); // lqc2 vf3, 0(s5) + c->lqc2(vf1, 48, s2); // lqc2 vf1, 48(s2) + c->lq(v1, 16, s4); // lq v1, 16(s4) + c->lq(a0, 32, s4); // lq a0, 32(s4) + c->vsub(DEST::xyzw, vf4, vf3, vf2); // vsub.xyzw vf4, vf3, vf2 + c->lwu(a1, 60, s2); // lwu a1, 60(s2) + c->vmul(DEST::xyzw, vf5, vf4, vf1); // vmul.xyzw vf5, vf4, vf1 + c->lqc2(vf7, 0, s2); // lqc2 vf7, 0(s2) + c->vmul(DEST::xyzw, vf6, vf4, vf4); // vmul.xyzw vf6, vf4, vf4 + c->lqc2(vf8, 16, s2); // lqc2 vf8, 16(s2) + c->vmove(DEST::w, vf1, vf0); // vmove.w vf1, vf0 + c->lqc2(vf9, 32, s2); // lqc2 vf9, 32(s2) + c->vadd_bc(DEST::y, BC::x, vf5, vf5, vf5); // vaddx.y vf5, vf5, vf5 + c->daddiu(s2, s2, 96); // daddiu s2, s2, 96 + c->vadd_bc(DEST::x, BC::y, vf6, vf6, vf6); // vaddy.x vf6, vf6, vf6 + c->mtc1(f5, s3); // mtc1 f5, s3 + c->vadd_bc(DEST::y, BC::z, vf5, vf5, vf5); // vaddz.y vf5, vf5, vf5 + c->lui(a2, 17141); // lui a2, 17141 + c->ori(a2, a2, 49807); // ori a2, a2, 49807 + c->mtc1(f3, a2); // mtc1 f3, a2 + c->vadd_bc(DEST::x, BC::z, vf6, vf6, vf6); // vaddz.x vf6, vf6, vf6 + c->lui(a2, -15232); // lui a2, -15232 + c->mtc1(f4, a2); // mtc1 f4, a2 + c->vsqrt(vf6, BC::x); // vsqrt Q, vf6.x + c->mov128_gpr_vf(a2, vf5); // qmfc2.i a2, vf5 + c->vwaitq(); // vwaitq + c->lwc1(f1, 12, s5); // lwc1 f1, 12(s5) + c->vaddq(DEST::x, vf6, vf0); // vaddq.x vf6, vf0, Q + c->vmove(DEST::xyzw, vf10, vf6); // vmove.xyzw vf10, vf6 + if (((s64)c->sgpr64(a2)) < 0) { // bltzl a2, L33 + c->vsub(DEST::xyzw, vf10, vf0, vf10); // vsub.xyzw vf10, vf0, vf10 + goto block_9; + } + +block_9: + c->mov128_gpr_vf(a2, vf10); // qmfc2.i a2, vf10 + c->mtc1(f2, a2); // mtc1 f2, a2 + c->subs(f2, f2, f1); // sub.s f2, f2, f1 + cop1_bc = c->fprs[f5] < c->fprs[f2]; // c.lt.s f5, f2 + bc = cop1_bc; // bc1t L31 + c->vdiv(vf0, BC::w, vf6, BC::x); // vdiv Q, vf0.w, vf6.x + if (bc) {goto block_1;} // branch non-likely + + cop1_bc = c->fprs[f3] <= c->fprs[f2]; // c.le.s f3, f2 + bc = cop1_bc; // bc1t L31 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + cop1_bc = c->fprs[f2] <= c->fprs[f4]; // c.le.s f2, f4 + bc = cop1_bc; // bc1t L31 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->vwaitq(); // vwaitq + // nop // sll r0, r0, 0 + c->vmulq(DEST::xyzw, vf11, vf4); // vmulq.xyzw vf11, vf4, Q + c->lui(a2, 16180); // lui a2, 16180 + c->ori(a2, a2, 65012); // ori a2, a2, 65012 + c->mtc1(f6, a2); // mtc1 f6, a2 + c->vmul(DEST::xyzw, vf5, vf11, vf1); // vmul.xyzw vf5, vf11, vf1 + c->vadd_bc(DEST::x, BC::y, vf5, vf5, vf5); // vaddy.x vf5, vf5, vf5 + c->vadd_bc(DEST::x, BC::z, vf5, vf5, vf5); // vaddz.x vf5, vf5, vf5 + c->mov128_gpr_vf(a2, vf5); // qmfc2.i a2, vf5 + c->mtc1(f7, a2); // mtc1 f7, a2 + cop1_bc = c->fprs[f7] < c->fprs[f6]; // c.lt.s f7, f6 + bc = cop1_bc; // bc1t L31 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mfc1(s3, f2); // mfc1 s3, f2 + c->sqc2(vf7, 0, gp); // sqc2 vf7, 0(gp) + c->sqc2(vf8, 16, gp); // sqc2 vf8, 16(gp) + c->sqc2(vf9, 32, gp); // sqc2 vf9, 32(gp) + c->sqc2(vf2, 48, gp); // sqc2 vf2, 48(gp) + c->sqc2(vf1, 64, gp); // sqc2 vf1, 64(gp) + //beq r0, r0, L31 // beq r0, r0, L31 + c->sw(a1, 80, gp); // sw a1, 80(gp) + goto block_1; // branch always + + +block_14: + c->mov64(v0, s3); // or v0, s3, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 144, sp); // lq gp, 144(sp) + c->lq(s5, 128, sp); // lq s5, 128(sp) + c->lq(s4, 112, sp); // lq s4, 112(sp) + c->lq(s3, 96, sp); // lq s3, 96(sp) + c->lq(s2, 80, sp); // lq s2, 80(sp) + c->lq(s1, 64, sp); // lq s1, 64(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 160); // daddiu sp, sp, 160 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.closest_pt_in_triangle = intern_from_c(-1, 0, "closest-pt-in-triangle").c(); + gLinkedFunctionTable.reg("(method 12 collide-mesh)", execute, 256); +} + +} // namespace method_12_collide_mesh +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_14_collide_mesh { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwu(v1, 12, a0); // lwu v1, 12(a0) + // nop // sll r0, r0, 0 + c->lwu(a0, 8, a0); // lwu a0, 8(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf1, 0, a1); // lqc2 vf1, 0(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 16, a1); // lqc2 vf2, 16(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, a1); // lqc2 vf3, 32(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf4, 48, a1); // lqc2 vf4, 48(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf5, 0, v1); // lqc2 vf5, 0(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf6, 16, v1); // lqc2 vf6, 16(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf7, 32, v1); // lqc2 vf7, 32(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf8, 48, v1); // lqc2 vf8, 48(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->lqc2(vf9, 64, v1); // lqc2 vf9, 64(v1) + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf5); // vmaddax.xyzw acc, vf1, vf5 + c->lqc2(vf10, 80, v1); // lqc2 vf10, 80(v1) + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf5); // vmadday.xyzw acc, vf2, vf5 + c->lqc2(vf11, 96, v1); // lqc2 vf11, 96(v1) + c->vmadd_bc(DEST::xyzw, BC::z, vf5, vf3, vf5); // vmaddz.xyzw vf5, vf3, vf5 + c->lqc2(vf12, 112, v1); // lqc2 vf12, 112(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf6); // vmaddax.xyzw acc, vf1, vf6 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf6); // vmadday.xyzw acc, vf2, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf6, vf3, vf6); // vmaddz.xyzw vf6, vf3, vf6 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf7); // vmaddax.xyzw acc, vf1, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf7); // vmadday.xyzw acc, vf2, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf7, vf3, vf7); // vmaddz.xyzw vf7, vf3, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf8); // vmaddax.xyzw acc, vf1, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf8); // vmadday.xyzw acc, vf2, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf8, vf3, vf8); // vmaddz.xyzw vf8, vf3, vf8 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf13, vf5); // vftoi0.xyzw vf13, vf5 + c->sqc2(vf5, 0, a2); // sqc2 vf5, 0(a2) + c->vftoi0(DEST::xyzw, vf14, vf6); // vftoi0.xyzw vf14, vf6 + c->sqc2(vf6, 32, a2); // sqc2 vf6, 32(a2) + c->vftoi0(DEST::xyzw, vf15, vf7); // vftoi0.xyzw vf15, vf7 + c->sqc2(vf7, 64, a2); // sqc2 vf7, 64(a2) + c->vftoi0(DEST::xyzw, vf16, vf8); // vftoi0.xyzw vf16, vf8 + c->sqc2(vf8, 96, a2); // sqc2 vf8, 96(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf13, 16, a2); // sqc2 vf13, 16(a2) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->sqc2(vf14, 48, a2); // sqc2 vf14, 48(a2) + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + c->sqc2(vf15, 80, a2); // sqc2 vf15, 80(a2) + bc = ((s64)c->sgpr64(a0)) <= 0; // blez a0, L25 + c->sqc2(vf16, 112, a2); // sqc2 vf16, 112(a2) + if (bc) {goto block_3;} // branch non-likely + + +block_1: + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->lqc2(vf5, 0, v1); // lqc2 vf5, 0(v1) + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf9); // vmaddax.xyzw acc, vf1, vf9 + c->lqc2(vf6, 16, v1); // lqc2 vf6, 16(v1) + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf9); // vmadday.xyzw acc, vf2, vf9 + c->lqc2(vf7, 32, v1); // lqc2 vf7, 32(v1) + c->vmadd_bc(DEST::xyzw, BC::z, vf9, vf3, vf9); // vmaddz.xyzw vf9, vf3, vf9 + c->lqc2(vf8, 48, v1); // lqc2 vf8, 48(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf10); // vmaddax.xyzw acc, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf10); // vmadday.xyzw acc, vf2, vf10 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf3, vf10); // vmaddz.xyzw vf10, vf3, vf10 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf11); // vmaddax.xyzw acc, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf11); // vmadday.xyzw acc, vf2, vf11 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf3, vf11); // vmaddz.xyzw vf11, vf3, vf11 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf12); // vmaddax.xyzw acc, vf1, vf12 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf12); // vmadday.xyzw acc, vf2, vf12 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf12, vf3, vf12); // vmaddz.xyzw vf12, vf3, vf12 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf17, vf9); // vftoi0.xyzw vf17, vf9 + c->sqc2(vf9, 128, a2); // sqc2 vf9, 128(a2) + c->vftoi0(DEST::xyzw, vf18, vf10); // vftoi0.xyzw vf18, vf10 + c->sqc2(vf10, 160, a2); // sqc2 vf10, 160(a2) + c->vftoi0(DEST::xyzw, vf19, vf11); // vftoi0.xyzw vf19, vf11 + c->sqc2(vf11, 192, a2); // sqc2 vf11, 192(a2) + c->vftoi0(DEST::xyzw, vf20, vf12); // vftoi0.xyzw vf20, vf12 + c->sqc2(vf12, 224, a2); // sqc2 vf12, 224(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf17, 144, a2); // sqc2 vf17, 144(a2) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->sqc2(vf18, 176, a2); // sqc2 vf18, 176(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf19, 208, a2); // sqc2 vf19, 208(a2) + bc = ((s64)c->sgpr64(a0)) <= 0; // blez a0, L25 + c->sqc2(vf20, 240, a2); // sqc2 vf20, 240(a2) + if (bc) {goto block_3;} // branch non-likely + + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->lqc2(vf9, 64, v1); // lqc2 vf9, 64(v1) + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf5); // vmaddax.xyzw acc, vf1, vf5 + c->lqc2(vf10, 80, v1); // lqc2 vf10, 80(v1) + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf5); // vmadday.xyzw acc, vf2, vf5 + c->lqc2(vf11, 96, v1); // lqc2 vf11, 96(v1) + c->vmadd_bc(DEST::xyzw, BC::z, vf5, vf3, vf5); // vmaddz.xyzw vf5, vf3, vf5 + c->lqc2(vf12, 112, v1); // lqc2 vf12, 112(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->daddiu(a2, a2, 256); // daddiu a2, a2, 256 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf6); // vmaddax.xyzw acc, vf1, vf6 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf6); // vmadday.xyzw acc, vf2, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf6, vf3, vf6); // vmaddz.xyzw vf6, vf3, vf6 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf7); // vmaddax.xyzw acc, vf1, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf7); // vmadday.xyzw acc, vf2, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf7, vf3, vf7); // vmaddz.xyzw vf7, vf3, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf8); // vmaddax.xyzw acc, vf1, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf8); // vmadday.xyzw acc, vf2, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf8, vf3, vf8); // vmaddz.xyzw vf8, vf3, vf8 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf13, vf5); // vftoi0.xyzw vf13, vf5 + c->sqc2(vf5, 0, a2); // sqc2 vf5, 0(a2) + c->vftoi0(DEST::xyzw, vf14, vf6); // vftoi0.xyzw vf14, vf6 + c->sqc2(vf6, 32, a2); // sqc2 vf6, 32(a2) + c->vftoi0(DEST::xyzw, vf15, vf7); // vftoi0.xyzw vf15, vf7 + c->sqc2(vf7, 64, a2); // sqc2 vf7, 64(a2) + c->vftoi0(DEST::xyzw, vf16, vf8); // vftoi0.xyzw vf16, vf8 + c->sqc2(vf8, 96, a2); // sqc2 vf8, 96(a2) + // nop // sll r0, r0, 0 + c->sqc2(vf13, 16, a2); // sqc2 vf13, 16(a2) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->sqc2(vf14, 48, a2); // sqc2 vf14, 48(a2) + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + c->sqc2(vf15, 80, a2); // sqc2 vf15, 80(a2) + bc = ((s64)c->sgpr64(a0)) > 0; // bgtz a0, L24 + c->sqc2(vf16, 112, a2); // sqc2 vf16, 112(a2) + if (bc) {goto block_1;} // branch non-likely + + +block_3: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 14 collide-mesh)", execute, 256); +} + +} // namespace method_14_collide_mesh +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_15_collide_mesh { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwu(v1, 12, a0); // lwu v1, 12(a0) + // nop // sll r0, r0, 0 + c->lwu(a0, 8, a0); // lwu a0, 8(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf1, 0, a1); // lqc2 vf1, 0(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf2, 16, a1); // lqc2 vf2, 16(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf3, 32, a1); // lqc2 vf3, 32(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf4, 48, a1); // lqc2 vf4, 48(a1) + // nop // sll r0, r0, 0 + c->lqc2(vf13, 0, a2); // lqc2 vf13, 0(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf14, 16, a2); // lqc2 vf14, 16(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf15, 32, a2); // lqc2 vf15, 32(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf16, 48, a2); // lqc2 vf16, 48(a2) + // nop // sll r0, r0, 0 + c->lqc2(vf5, 0, v1); // lqc2 vf5, 0(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf6, 16, v1); // lqc2 vf6, 16(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf7, 32, v1); // lqc2 vf7, 32(v1) + // nop // sll r0, r0, 0 + c->lqc2(vf8, 48, v1); // lqc2 vf8, 48(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->lqc2(vf9, 64, v1); // lqc2 vf9, 64(v1) + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf5); // vmaddax.xyzw acc, vf1, vf5 + c->lqc2(vf10, 80, v1); // lqc2 vf10, 80(v1) + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf5); // vmadday.xyzw acc, vf2, vf5 + c->lqc2(vf11, 96, v1); // lqc2 vf11, 96(v1) + c->vmadd_bc(DEST::xyzw, BC::z, vf5, vf3, vf5); // vmaddz.xyzw vf5, vf3, vf5 + c->lqc2(vf12, 112, v1); // lqc2 vf12, 112(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf6); // vmaddax.xyzw acc, vf1, vf6 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf6); // vmadday.xyzw acc, vf2, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf6, vf3, vf6); // vmaddz.xyzw vf6, vf3, vf6 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf7); // vmaddax.xyzw acc, vf1, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf7); // vmadday.xyzw acc, vf2, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf7, vf3, vf7); // vmaddz.xyzw vf7, vf3, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf8); // vmaddax.xyzw acc, vf1, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf8); // vmadday.xyzw acc, vf2, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf8, vf3, vf8); // vmaddz.xyzw vf8, vf3, vf8 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + c->sqc2(vf5, 0, a3); // sqc2 vf5, 0(a3) + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf5); // vmaddax.xyzw acc, vf13, vf5 + c->sqc2(vf6, 32, a3); // sqc2 vf6, 32(a3) + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf5); // vmadday.xyzw acc, vf14, vf5 + c->sqc2(vf7, 64, a3); // sqc2 vf7, 64(a3) + c->vmadd_bc(DEST::xyzw, BC::z, vf5, vf15, vf5); // vmaddz.xyzw vf5, vf15, vf5 + c->sqc2(vf8, 96, a3); // sqc2 vf8, 96(a3) + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf6); // vmaddax.xyzw acc, vf13, vf6 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf6); // vmadday.xyzw acc, vf14, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf6, vf15, vf6); // vmaddz.xyzw vf6, vf15, vf6 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf7); // vmaddax.xyzw acc, vf13, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf7); // vmadday.xyzw acc, vf14, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf7, vf15, vf7); // vmaddz.xyzw vf7, vf15, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf8); // vmaddax.xyzw acc, vf13, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf8); // vmadday.xyzw acc, vf14, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf8, vf15, vf8); // vmaddz.xyzw vf8, vf15, vf8 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf5, vf5); // vftoi0.xyzw vf5, vf5 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf6, vf6); // vftoi0.xyzw vf6, vf6 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf7, vf7); // vftoi0.xyzw vf7, vf7 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf8, vf8); // vftoi0.xyzw vf8, vf8 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf5, 16, a3); // sqc2 vf5, 16(a3) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->sqc2(vf6, 48, a3); // sqc2 vf6, 48(a3) + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + c->sqc2(vf7, 80, a3); // sqc2 vf7, 80(a3) + bc = ((s64)c->sgpr64(a0)) <= 0; // blez a0, L22 + c->sqc2(vf8, 112, a3); // sqc2 vf8, 112(a3) + if (bc) {goto block_3;} // branch non-likely + + +block_1: + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->lqc2(vf5, 0, v1); // lqc2 vf5, 0(v1) + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf9); // vmaddax.xyzw acc, vf1, vf9 + c->lqc2(vf6, 16, v1); // lqc2 vf6, 16(v1) + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf9); // vmadday.xyzw acc, vf2, vf9 + c->lqc2(vf7, 32, v1); // lqc2 vf7, 32(v1) + c->vmadd_bc(DEST::xyzw, BC::z, vf9, vf3, vf9); // vmaddz.xyzw vf9, vf3, vf9 + c->lqc2(vf8, 48, v1); // lqc2 vf8, 48(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf10); // vmaddax.xyzw acc, vf1, vf10 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf10); // vmadday.xyzw acc, vf2, vf10 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf3, vf10); // vmaddz.xyzw vf10, vf3, vf10 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf11); // vmaddax.xyzw acc, vf1, vf11 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf11); // vmadday.xyzw acc, vf2, vf11 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf3, vf11); // vmaddz.xyzw vf11, vf3, vf11 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf12); // vmaddax.xyzw acc, vf1, vf12 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf12); // vmadday.xyzw acc, vf2, vf12 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf12, vf3, vf12); // vmaddz.xyzw vf12, vf3, vf12 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + c->sqc2(vf9, 128, a3); // sqc2 vf9, 128(a3) + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf9); // vmaddax.xyzw acc, vf13, vf9 + c->sqc2(vf10, 160, a3); // sqc2 vf10, 160(a3) + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf9); // vmadday.xyzw acc, vf14, vf9 + c->sqc2(vf11, 192, a3); // sqc2 vf11, 192(a3) + c->vmadd_bc(DEST::xyzw, BC::z, vf9, vf15, vf9); // vmaddz.xyzw vf9, vf15, vf9 + c->sqc2(vf12, 224, a3); // sqc2 vf12, 224(a3) + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf10); // vmaddax.xyzw acc, vf13, vf10 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf10); // vmadday.xyzw acc, vf14, vf10 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf10, vf15, vf10); // vmaddz.xyzw vf10, vf15, vf10 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf11); // vmaddax.xyzw acc, vf13, vf11 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf11); // vmadday.xyzw acc, vf14, vf11 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf11, vf15, vf11); // vmaddz.xyzw vf11, vf15, vf11 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf12); // vmaddax.xyzw acc, vf13, vf12 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf12); // vmadday.xyzw acc, vf14, vf12 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf12, vf15, vf12); // vmaddz.xyzw vf12, vf15, vf12 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf9, vf9); // vftoi0.xyzw vf9, vf9 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf10, vf10); // vftoi0.xyzw vf10, vf10 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf11, vf11); // vftoi0.xyzw vf11, vf11 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf12, vf12); // vftoi0.xyzw vf12, vf12 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf9, 144, a3); // sqc2 vf9, 144(a3) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->sqc2(vf10, 176, a3); // sqc2 vf10, 176(a3) + // nop // sll r0, r0, 0 + c->sqc2(vf11, 208, a3); // sqc2 vf11, 208(a3) + bc = ((s64)c->sgpr64(a0)) <= 0; // blez a0, L22 + c->sqc2(vf12, 240, a3); // sqc2 vf12, 240(a3) + if (bc) {goto block_3;} // branch non-likely + + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->lqc2(vf9, 64, v1); // lqc2 vf9, 64(v1) + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf5); // vmaddax.xyzw acc, vf1, vf5 + c->lqc2(vf10, 80, v1); // lqc2 vf10, 80(v1) + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf5); // vmadday.xyzw acc, vf2, vf5 + c->lqc2(vf11, 96, v1); // lqc2 vf11, 96(v1) + c->vmadd_bc(DEST::xyzw, BC::z, vf5, vf3, vf5); // vmaddz.xyzw vf5, vf3, vf5 + c->lqc2(vf12, 112, v1); // lqc2 vf12, 112(v1) + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + c->daddiu(a3, a3, 256); // daddiu a3, a3, 256 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf6); // vmaddax.xyzw acc, vf1, vf6 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf6); // vmadday.xyzw acc, vf2, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf6, vf3, vf6); // vmaddz.xyzw vf6, vf3, vf6 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf7); // vmaddax.xyzw acc, vf1, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf7); // vmadday.xyzw acc, vf2, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf7, vf3, vf7); // vmaddz.xyzw vf7, vf3, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf4, vf0); // vmulaw.xyzw acc, vf4, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf8); // vmaddax.xyzw acc, vf1, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf8); // vmadday.xyzw acc, vf2, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf8, vf3, vf8); // vmaddz.xyzw vf8, vf3, vf8 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + c->sqc2(vf5, 0, a3); // sqc2 vf5, 0(a3) + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf5); // vmaddax.xyzw acc, vf13, vf5 + c->sqc2(vf6, 32, a3); // sqc2 vf6, 32(a3) + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf5); // vmadday.xyzw acc, vf14, vf5 + c->sqc2(vf7, 64, a3); // sqc2 vf7, 64(a3) + c->vmadd_bc(DEST::xyzw, BC::z, vf5, vf15, vf5); // vmaddz.xyzw vf5, vf15, vf5 + c->sqc2(vf8, 96, a3); // sqc2 vf8, 96(a3) + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf6); // vmaddax.xyzw acc, vf13, vf6 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf6); // vmadday.xyzw acc, vf14, vf6 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf6, vf15, vf6); // vmaddz.xyzw vf6, vf15, vf6 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf7); // vmaddax.xyzw acc, vf13, vf7 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf7); // vmadday.xyzw acc, vf14, vf7 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf7, vf15, vf7); // vmaddz.xyzw vf7, vf15, vf7 + // nop // sll r0, r0, 0 + c->vmula_bc(DEST::xyzw, BC::w, vf16, vf0); // vmulaw.xyzw acc, vf16, vf0 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::x, vf13, vf8); // vmaddax.xyzw acc, vf13, vf8 + // nop // sll r0, r0, 0 + c->vmadda_bc(DEST::xyzw, BC::y, vf14, vf8); // vmadday.xyzw acc, vf14, vf8 + // nop // sll r0, r0, 0 + c->vmadd_bc(DEST::xyzw, BC::z, vf8, vf15, vf8); // vmaddz.xyzw vf8, vf15, vf8 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf5, vf5); // vftoi0.xyzw vf5, vf5 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf6, vf6); // vftoi0.xyzw vf6, vf6 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf7, vf7); // vftoi0.xyzw vf7, vf7 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf8, vf8); // vftoi0.xyzw vf8, vf8 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sqc2(vf5, 16, a3); // sqc2 vf5, 16(a3) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->sqc2(vf6, 48, a3); // sqc2 vf6, 48(a3) + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + c->sqc2(vf7, 80, a3); // sqc2 vf7, 80(a3) + bc = ((s64)c->sgpr64(a0)) > 0; // bgtz a0, L21 + c->sqc2(vf8, 112, a3); // sqc2 vf8, 112(a3) + if (bc) {goto block_1;} // branch non-likely + + +block_3: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 15 collide-mesh)", execute, 256); +} + +} // namespace method_15_collide_mesh +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/foreground.cpp b/game/mips2c/jak3_functions/foreground.cpp index b674a44964..4177276409 100644 --- a/game/mips2c/jak3_functions/foreground.cpp +++ b/game/mips2c/jak3_functions/foreground.cpp @@ -327,6 +327,23 @@ struct Cache { void* merc_global_stats; // *merc-global-stats* } cache; +struct MercEffectBucketInfo { + u8 color_fade[4]; + u8 merc_path; + u8 ignore_alpha; + u8 disable_draw; + u8 disable_envmap; +}; + +struct MercBucketInfo { + u8 lights[0x70]; + u32 needs_clip; + u32 mercprime; + u32 mercneric; + MercEffectBucketInfo effects[64]; +}; +static_assert(sizeof(MercBucketInfo) == 0x27c); + // TODO: hack this up for pc merc rendering. u64 execute(void* ctxt) { auto* c = (ExecutionContext*)ctxt; @@ -341,6 +358,7 @@ u64 execute(void* ctxt) { c->sq(s4, 80, sp); // sq s4, 80(sp) c->sq(s5, 96, sp); // sq s5, 96(sp) c->sq(gp, 112, sp); // sq gp, 112(sp) + const MercBucketInfo* mbi = (const MercBucketInfo*)(g_ee_main_mem + c->sgpr64(t1)); c->mov64(t7, a3); // or t7, a3, r0 c->mov64(v1, t0); // or v1, t0, r0 c->lui(t0, 4096); // lui t0, 4096 @@ -444,6 +462,23 @@ u64 execute(void* ctxt) { c->sw(a3, 12, a2); // sw a3, 12(a2) c->srl(s0, s0, 2); // srl s0, s0, 2 c->sq(t1, 16, a2); // sq t1, 16(a2) + + // pc hack + { + u16 use_pc_merc_bits = 0; + u16 ignore_alpha_bits = 0; + for (int i = 0; i < 16; i++) { + if (!mbi->effects[i].disable_draw) { + use_pc_merc_bits |= (1 << i); + } + if (mbi->effects[i].ignore_alpha) { + ignore_alpha_bits |= (1 << i); + } + } + memcpy(g_ee_main_mem + c->sgpr64(a2) + 28, &use_pc_merc_bits, 2); + memcpy(g_ee_main_mem + c->sgpr64(a2) + 30, &ignore_alpha_bits, 2); + } + c->xor_(t3, t3, s0); // xor t3, t3, s0 c->sq(t3, 48, a2); // sq t3, 48(a2) c->xor_(t3, t3, s0); // xor t3, t3, s0 @@ -500,6 +535,21 @@ u64 execute(void* ctxt) { c->sw(a3, 28, a2); // sw a3, 28(a2) c->daddiu(a2, a2, 144); // daddiu a2, a2, 144 + // PC ADD BONUS DATA (bonus!) + { + // 10 qw test + u64 dmatag = 5 | (1 << 28); + memcpy(g_ee_main_mem + c->sgpr64(a2), &dmatag, 8); + u32 vif = (0b1001 << 24); + memcpy(g_ee_main_mem + c->sgpr64(a2) + 8, &vif, 4); + + for (int i = 0; i < 16; i++) { + memcpy(g_ee_main_mem + c->sgpr64(a2) + 16 + i * 4, mbi->effects[i].color_fade, 4); + } + + c->gprs[a2].du32[0] += 6 * 16; + } + block_8: bc = c->sgpr64(s3) == 0; // beq s3, r0, L116 c->addiu(s2, r0, 128); // addiu s2, r0, 128 @@ -513,6 +563,10 @@ u64 execute(void* ctxt) { c->sq(t5, 0, a2); // sq t5, 0(a2) c->lbu(s0, 1, gp); // lbu s0, 1(gp) c->daddiu(gp, gp, 2); // daddiu gp, gp, 2 + + // HACK for PC PORT: stash the source matrix number in the unused bits of nop viftag. + c->sb(a3, 8, a2); + c->lbu(a3, 0, gp); // lbu a3, 0(gp) c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 c->sb(s0, 12, a2); // sb s0, 12(a2) diff --git a/game/mips2c/jak3_functions/sparticle.cpp b/game/mips2c/jak3_functions/sparticle.cpp new file mode 100644 index 0000000000..33bbd8857b --- /dev/null +++ b/game/mips2c/jak3_functions/sparticle.cpp @@ -0,0 +1,712 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace sp_process_block_2d { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* add_to_sprite_aux_list; // add-to-sprite-aux-list + void* sp_free_particle; // sp-free-particle + void* sp_orbiter; // sp-orbiter + void* sp_relaunch_particle_2d; // sp-relaunch-particle-2d +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -128); // daddiu sp, sp, -128 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 16, sp); // sq s0, 16(sp) + c->sq(s1, 32, sp); // sq s1, 32(sp) + c->sq(s2, 48, sp); // sq s2, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s4, 80, sp); // sq s4, 80(sp) + c->sq(s5, 96, sp); // sq s5, 96(sp) + c->sq(gp, 112, sp); // sq gp, 112(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a1); // or s5, a1, r0 + c->mov64(s4, a2); // or s4, a2, r0 + c->mov64(s1, a3); // or s1, a3, r0 + c->mov64(s3, t0); // or s3, t0, r0 + c->mov64(s2, t1); // or s2, t1, r0 + +block_1: + c->lb(v1, 128, s5); // lb v1, 128(s5) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L97 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + c->lb(a0, 129, s5); // lb a0, 129(s5) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->dsll(a0, a0, 4); // dsll a0, a0, 4 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lqc2(vf9, 0, v1); // lqc2 vf9, 0(v1) + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + c->andi(s0, v1, 255); // andi s0, v1, 255 + bc = c->sgpr64(s0) != 0; // bne s0, r0, L87 + // nop // sll r0, r0, 0 + if (bc) {goto block_9;} // branch non-likely + + c->lw(v1, 104, s5); // lw v1, 104(s5) + // nop // sll r0, r0, 0 + c->andi(v1, v1, 32896); // andi v1, v1, 32896 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_5;} // branch non-likely + + c->load_symbol2(t9, cache.add_to_sprite_aux_list);// lw t9, add-to-sprite-aux-list(s7) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a1, s5); // or a1, s5, r0 + c->mov64(a2, s4); // or a2, s4, r0 + c->mov64(a3, s1); // or a3, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + +block_5: + c->lw(v1, 100, s5); // lw v1, 100(s5) + c->addiu(a0, r0, -1); // addiu a0, r0, -1 + bc = c->sgpr64(v1) == c->sgpr64(a0); // beq v1, a0, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(v1) == 0; // beq v1, r0, L96 + // nop // sll r0, r0, 0 + if (bc) {goto block_31;} // branch non-likely + + +block_7: + c->lw(a0, 104, s5); // lw a0, 104(s5) + c->andi(v1, a0, 32); // andi v1, a0, 32 + c->xor_(a0, a0, v1); // xor a0, a0, v1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L97 + c->sw(a0, 104, s5); // sw a0, 104(s5) + if (bc) {goto block_32;} // branch non-likely + + c->lw(v1, 124, s5); // lw v1, 124(s5) + //beq r0, r0, L97 // beq r0, r0, L97 + c->sw(v1, 44, s4); // sw v1, 44(s4) + goto block_32; // branch always + + +block_9: + c->lw(v1, 100, s5); // lw v1, 100(s5) + c->addiu(a0, r0, -1); // addiu a0, r0, -1 + bc = c->sgpr64(v1) == c->sgpr64(a0); // beq v1, a0, L88 + c->dsubu(a0, v1, s0); // dsubu a0, v1, s0 + if (bc) {goto block_12;} // branch non-likely + + bc = c->sgpr64(v1) == 0; // beq v1, r0, L96 + c->pmaxw(v1, a0, r0); // pmaxw v1, a0, r0 + if (bc) {goto block_31;} // branch non-likely + + c->sw(v1, 100, s5); // sw v1, 100(s5) + +block_12: + c->lw(v1, 104, s5); // lw v1, 104(s5) + c->andi(a0, v1, 32); // andi a0, v1, 32 + c->xor_(v1, v1, a0); // xor v1, v1, a0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L89 + c->sw(v1, 104, s5); // sw v1, 104(s5) + if (bc) {goto block_14;} // branch non-likely + + c->lw(a0, 124, s5); // lw a0, 124(s5) + c->sw(a0, 44, s4); // sw a0, 44(s4) + +block_14: + c->lw(t9, 112, s5); // lw t9, 112(s5) + c->andi(v1, v1, 32896); // andi v1, v1, 32896 + c->load_symbol2(a0, cache.add_to_sprite_aux_list);// lw a0, add-to-sprite-aux-list(s7) + c->movn(t9, a0, v1); // movn t9, a0, v1 + bc = c->sgpr64(t9) == 0; // beq t9, r0, L90 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + c->daddiu(sp, sp, -80); // daddiu sp, sp, -80 + c->sq(gp, 0, sp); // sq gp, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s1, 48, sp); // sq s1, 48(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a1, s5); // or a1, s5, r0 + c->mov64(a2, s4); // or a2, s4, r0 + c->mov64(a3, s1); // or a3, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->jalr(call_addr); // jalr ra, t9 + c->lq(gp, 0, sp); // lq gp, 0(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s1, 48, sp); // lq s1, 48(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->daddiu(sp, sp, 80); // daddiu sp, sp, 80 + +block_16: + c->lw(a1, 120, s5); // lw a1, 120(s5) + c->lw(v1, 116, s5); // lw v1, 116(s5) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L91 + c->dsubu(a0, v1, s0); // dsubu a0, v1, s0 + if (bc) {goto block_19;} // branch non-likely + + c->daddiu(v1, a0, -1); // daddiu v1, a0, -1 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L91 + c->sw(a0, 116, s5); // sw a0, 116(s5) + if (bc) {goto block_19;} // branch non-likely + + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sq(gp, 0, sp); // sq gp, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s1, 48, sp); // sq s1, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s2, 80, sp); // sq s2, 80(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a3, s4); // or a3, s4, r0 + c->mov64(a2, s5); // or a2, s5, r0 + c->load_symbol2(t9, cache.sp_relaunch_particle_2d);// lw t9, sp-relaunch-particle-2d(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lq(gp, 0, sp); // lq gp, 0(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s1, 48, sp); // lq s1, 48(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 80, sp); // lq s2, 80(sp) + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + +block_19: + c->lqc2(vf1, 0, s4); // lqc2 vf1, 0(s4) + c->lqc2(vf2, 16, s4); // lqc2 vf2, 16(s4) + c->lqc2(vf3, 32, s4); // lqc2 vf3, 32(s4) + c->lqc2(vf4, 16, s5); // lqc2 vf4, 16(s5) + c->lqc2(vf5, 32, s5); // lqc2 vf5, 32(s5) + c->lqc2(vf6, 48, s5); // lqc2 vf6, 48(s5) + c->lqc2(vf7, 64, s5); // lqc2 vf7, 64(s5) + c->lwc1(f0, 96, s5); // lwc1 f0, 96(s5) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->vmul_bc(DEST::xyzw, BC::z, vf7, vf7, vf9); // vmulz.xyzw vf7, vf7, vf9 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L92 + c->vadd(DEST::xyz, vf4, vf4, vf7); // vadd.xyz vf4, vf4, vf7 + if (bc) {goto block_21;} // branch non-likely + + c->mov128_vf_gpr(vf8, v1); // qmtc2.i vf8, v1 + c->vsub_bc(DEST::w, BC::x, vf8, vf0, vf8); // vsubx.w vf8, vf0, vf8 + c->vmul_bc(DEST::xyzw, BC::w, vf8, vf8, vf9); // vmulw.xyzw vf8, vf8, vf9 + c->vsub_bc(DEST::w, BC::w, vf8, vf0, vf8); // vsubw.w vf8, vf0, vf8 + c->vmul_bc(DEST::xyz, BC::w, vf4, vf4, vf8); // vmulw.xyz vf4, vf4, vf8 + +block_21: + c->vmul_bc(DEST::xyzw, BC::y, vf10, vf4, vf9); // vmuly.xyzw vf10, vf4, vf9 + c->vmul_bc(DEST::xyzw, BC::y, vf11, vf5, vf9); // vmuly.xyzw vf11, vf5, vf9 + c->vmul_bc(DEST::xyzw, BC::y, vf12, vf6, vf9); // vmuly.xyzw vf12, vf6, vf9 + c->vadd(DEST::xyzw, vf1, vf1, vf10); // vadd.xyzw vf1, vf1, vf10 + c->vadd(DEST::zw, vf2, vf2, vf11); // vadd.zw vf2, vf2, vf11 + c->vadd(DEST::xyzw, vf3, vf3, vf12); // vadd.xyzw vf3, vf3, vf12 + c->vmax_bc(DEST::xyzw, BC::x, vf3, vf3, vf0); // vmaxx.xyzw vf3, vf3, vf0 + c->sqc2(vf4, 16, s5); // sqc2 vf4, 16(s5) + c->sqc2(vf1, 0, s4); // sqc2 vf1, 0(s4) + c->sqc2(vf2, 16, s4); // sqc2 vf2, 16(s4) + c->sqc2(vf3, 32, s4); // sqc2 vf3, 32(s4) + c->lwc1(f0, 24, s4); // lwc1 f0, 24(s4) + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->mfc1(v1, f0); // mfc1 v1, f0 + c->dsll32(v1, v1, 16); // dsll32 v1, v1, 16 + c->dsra32(v1, v1, 16); // dsra32 v1, v1, 16 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->cvtsw(f0, f0); // cvt.s.w f0, f0 + c->swc1(f0, 24, s4); // swc1 f0, 24(s4) + c->lw(v1, 104, s5); // lw v1, 104(s5) + c->andi(v1, v1, 64); // andi v1, v1, 64 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L93 + c->load_symbol2(t9, cache.sp_orbiter); // lw t9, sp-orbiter(s7) + if (bc) {goto block_23;} // branch non-likely + + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sq(gp, 0, sp); // sq gp, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s1, 48, sp); // sq s1, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a1, s5); // or a1, s5, r0 + c->mov64(a2, s4); // or a2, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sq(s2, 80, sp); // sq s2, 80(sp) + c->jalr(call_addr); // jalr ra, t9 + c->lq(gp, 0, sp); // lq gp, 0(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s1, 48, sp); // lq s1, 48(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 80, sp); // lq s2, 80(sp) + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + +block_23: + c->lq(v1, 32, s4); // lq v1, 32(s4) + c->lw(a0, 104, s5); // lw a0, 104(s5) + c->andi(a1, a0, 2); // andi a1, a0, 2 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L94 + c->andi(a1, a0, 4); // andi a1, a0, 4 + if (bc) {goto block_26;} // branch non-likely + + bc = c->sgpr64(v1) != 0; // bne v1, r0, L94 + c->pextuw(t4, v1, r0); // pextuw t4, v1, r0 + if (bc) {goto block_26;} // branch non-likely + + bc = c->sgpr64(t4) == 0; // beq t4, r0, L96 + // nop // sll r0, r0, 0 + if (bc) {goto block_31;} // branch non-likely + + +block_26: + bc = c->sgpr64(a1) == 0; // beq a1, r0, L95 + c->andi(a0, a0, 1); // andi a0, a0, 1 + if (bc) {goto block_28;} // branch non-likely + + c->pcpyud(t4, v1, r0); // pcpyud t4, v1, r0 + c->pexew(t4, t4); // pexew t4, t4 + bc = ((s64)c->sgpr64(t4)) <= 0; // blez t4, L96 + // nop // sll r0, r0, 0 + if (bc) {goto block_31;} // branch non-likely + + +block_28: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L97 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + c->mov128_gpr_vf(v1, vf1); // qmfc2.i v1, vf1 + c->pcpyud(v1, v1, r0); // pcpyud v1, v1, r0 + c->pexew(v1, v1); // pexew v1, v1 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L96 + c->mov128_gpr_vf(v1, vf2); // qmfc2.i v1, vf2 + if (bc) {goto block_31;} // branch non-likely + + c->pcpyud(v1, v1, r0); // pcpyud v1, v1, r0 + c->pexew(v1, v1); // pexew v1, v1 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L97 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + +block_31: + c->load_symbol2(t9, cache.sp_free_particle); // lw t9, sp-free-particle(s7) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a1, s1); // or a1, s1, r0 + c->mov64(a2, s5); // or a2, s5, r0 + c->mov64(a3, s4); // or a3, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + +block_32: + c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 + c->daddiu(s5, s5, 144); // daddiu s5, s5, 144 + c->daddiu(s4, s4, 48); // daddiu s4, s4, 48 + bc = c->sgpr64(s3) != 0; // bne s3, r0, L84 + c->daddiu(s1, s1, 1); // daddiu s1, s1, 1 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v0, s1); // or v0, s1, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 112, sp); // lq gp, 112(sp) + c->lq(s5, 96, sp); // lq s5, 96(sp) + c->lq(s4, 80, sp); // lq s4, 80(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 48, sp); // lq s2, 48(sp) + c->lq(s1, 32, sp); // lq s1, 32(sp) + c->lq(s0, 16, sp); // lq s0, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 128); // daddiu sp, sp, 128 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.add_to_sprite_aux_list = intern_from_c(-1, 0, "add-to-sprite-aux-list").c(); + cache.sp_free_particle = intern_from_c(-1, 0, "sp-free-particle").c(); + cache.sp_orbiter = intern_from_c(-1, 0, "sp-orbiter").c(); + cache.sp_relaunch_particle_2d = intern_from_c(-1, 0, "sp-relaunch-particle-2d").c(); + gLinkedFunctionTable.reg("sp-process-block-2d", execute, 256); +} + +} // namespace sp_process_block_2d +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace sp_process_block_3d { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* quaternion; // quaternion*! + void* quaternion_normalize; // quaternion-normalize! + void* sp_free_particle; // sp-free-particle + void* sp_relaunch_particle_3d; // sp-relaunch-particle-3d +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -176); // daddiu sp, sp, -176 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 64, sp); // sq s0, 64(sp) + c->sq(s1, 80, sp); // sq s1, 80(sp) + c->sq(s2, 96, sp); // sq s2, 96(sp) + c->sq(s3, 112, sp); // sq s3, 112(sp) + c->sq(s4, 128, sp); // sq s4, 128(sp) + c->sq(s5, 144, sp); // sq s5, 144(sp) + c->sq(gp, 160, sp); // sq gp, 160(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a1); // or s5, a1, r0 + c->mov64(s4, a2); // or s4, a2, r0 + c->mov64(s0, a3); // or s0, a3, r0 + c->mov64(s3, t0); // or s3, t0, r0 + c->mov64(s2, t1); // or s2, t1, r0 + c->daddiu(s1, sp, 16); // daddiu s1, sp, 16 + c->sq(r0, 0, s1); // sq r0, 0(s1) + +block_1: + c->lb(v1, 128, s5); // lb v1, 128(s5) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L82 + // nop // sll r0, r0, 0 + if (bc) {goto block_33;} // branch non-likely + + c->lb(a0, 129, s5); // lb a0, 129(s5) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->dsll(a0, a0, 4); // dsll a0, a0, 4 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lqc2(vf16, 0, v1); // lqc2 vf16, 0(v1) + c->mov128_gpr_vf(v1, vf16); // qmfc2.i v1, vf16 + c->andi(v1, v1, 255); // andi v1, v1, 255 + c->sq(v1, 32, sp); // sq v1, 32(sp) + c->lq(v1, 32, sp); // lq v1, 32(sp) + bc = c->sgpr64(v1) != 0; // bne v1, r0, L70 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + c->lw(v1, 100, s5); // lw v1, 100(s5) + c->addiu(a0, r0, -1); // addiu a0, r0, -1 + bc = c->sgpr64(v1) == c->sgpr64(a0); // beq v1, a0, L69 + // nop // sll r0, r0, 0 + if (bc) {goto block_5;} // branch non-likely + + bc = c->sgpr64(v1) == 0; // beq v1, r0, L81 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + +block_5: + c->lw(a0, 104, s5); // lw a0, 104(s5) + c->andi(v1, a0, 32); // andi v1, a0, 32 + c->xor_(a0, a0, v1); // xor a0, a0, v1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L82 + c->sw(a0, 104, s5); // sw a0, 104(s5) + if (bc) {goto block_33;} // branch non-likely + + c->lw(v1, 124, s5); // lw v1, 124(s5) + //beq r0, r0, L82 // beq r0, r0, L82 + c->sw(v1, 44, s4); // sw v1, 44(s4) + goto block_33; // branch always + + +block_7: + c->lw(v1, 100, s5); // lw v1, 100(s5) + c->addiu(a0, r0, -1); // addiu a0, r0, -1 + bc = c->sgpr64(v1) == c->sgpr64(a0); // beq v1, a0, L71 + c->lq(a0, 32, sp); // lq a0, 32(sp) + if (bc) {goto block_10;} // branch non-likely + + c->dsubu(a0, v1, a0); // dsubu a0, v1, a0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L81 + c->pmaxw(v1, a0, r0); // pmaxw v1, a0, r0 + if (bc) {goto block_32;} // branch non-likely + + c->sw(v1, 100, s5); // sw v1, 100(s5) + +block_10: + c->lw(a0, 104, s5); // lw a0, 104(s5) + c->andi(v1, a0, 32); // andi v1, a0, 32 + c->xor_(a0, a0, v1); // xor a0, a0, v1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L72 + c->sw(a0, 104, s5); // sw a0, 104(s5) + if (bc) {goto block_12;} // branch non-likely + + c->lw(v1, 124, s5); // lw v1, 124(s5) + c->sw(v1, 44, s4); // sw v1, 44(s4) + +block_12: + c->lw(t9, 112, s5); // lw t9, 112(s5) + bc = c->sgpr64(t9) == 0; // beq t9, r0, L73 + // nop // sll r0, r0, 0 + if (bc) {goto block_14;} // branch non-likely + + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sq(gp, 0, sp); // sq gp, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s0, 48, sp); // sq s0, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a1, s5); // or a1, s5, r0 + c->mov64(a2, s4); // or a2, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sq(s2, 80, sp); // sq s2, 80(sp) + c->jalr(call_addr); // jalr ra, t9 + c->lq(gp, 0, sp); // lq gp, 0(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s0, 48, sp); // lq s0, 48(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 80, sp); // lq s2, 80(sp) + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + +block_14: + c->lw(a1, 120, s5); // lw a1, 120(s5) + c->lw(v1, 116, s5); // lw v1, 116(s5) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L74 + c->lq(a0, 32, sp); // lq a0, 32(sp) + if (bc) {goto block_17;} // branch non-likely + + c->dsubu(v1, v1, a0); // dsubu v1, v1, a0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L74 + c->sw(v1, 116, s5); // sw v1, 116(s5) + if (bc) {goto block_17;} // branch non-likely + + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sq(gp, 0, sp); // sq gp, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s0, 48, sp); // sq s0, 48(sp) + c->sq(s3, 64, sp); // sq s3, 64(sp) + c->sq(s2, 80, sp); // sq s2, 80(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a3, s4); // or a3, s4, r0 + c->mov64(a2, s5); // or a2, s5, r0 + c->load_symbol2(t9, cache.sp_relaunch_particle_3d);// lw t9, sp-relaunch-particle-3d(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lq(gp, 0, sp); // lq gp, 0(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s0, 48, sp); // lq s0, 48(sp) + c->lq(s3, 64, sp); // lq s3, 64(sp) + c->lq(s2, 80, sp); // lq s2, 80(sp) + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + +block_17: + c->lqc2(vf8, 0, s4); // lqc2 vf8, 0(s4) + c->lqc2(vf9, 16, s4); // lqc2 vf9, 16(s4) + c->lqc2(vf10, 32, s4); // lqc2 vf10, 32(s4) + c->lqc2(vf11, 16, s5); // lqc2 vf11, 16(s5) + c->lqc2(vf12, 32, s5); // lqc2 vf12, 32(s5) + c->lqc2(vf13, 48, s5); // lqc2 vf13, 48(s5) + c->lqc2(vf14, 64, s5); // lqc2 vf14, 64(s5) + c->lwc1(f0, 96, s5); // lwc1 f0, 96(s5) + c->mfc1(v1, f0); // mfc1 v1, f0 + c->vmul_bc(DEST::xyzw, BC::z, vf14, vf14, vf16); // vmulz.xyzw vf14, vf14, vf16 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L75 + c->vadd(DEST::xyz, vf11, vf11, vf14); // vadd.xyz vf11, vf11, vf14 + if (bc) {goto block_19;} // branch non-likely + + c->mov128_vf_gpr(vf15, v1); // qmtc2.i vf15, v1 + c->vsub_bc(DEST::w, BC::x, vf15, vf0, vf15); // vsubx.w vf15, vf0, vf15 + c->vmul_bc(DEST::xyzw, BC::w, vf15, vf15, vf16); // vmulw.xyzw vf15, vf15, vf16 + c->vsub_bc(DEST::w, BC::w, vf15, vf0, vf15); // vsubw.w vf15, vf0, vf15 + c->vmul_bc(DEST::xyz, BC::w, vf11, vf11, vf15); // vmulw.xyz vf11, vf11, vf15 + +block_19: + c->vmul_bc(DEST::xyzw, BC::y, vf17, vf11, vf16); // vmuly.xyzw vf17, vf11, vf16 + c->vmul_bc(DEST::xyzw, BC::y, vf18, vf12, vf16); // vmuly.xyzw vf18, vf12, vf16 + c->vmul_bc(DEST::xyzw, BC::y, vf19, vf13, vf16); // vmuly.xyzw vf19, vf13, vf16 + c->vadd(DEST::xyzw, vf8, vf8, vf17); // vadd.xyzw vf8, vf8, vf17 + c->vadd_bc(DEST::w, BC::w, vf9, vf9, vf18); // vaddw.w vf9, vf9, vf18 + c->vadd(DEST::xyzw, vf10, vf10, vf19); // vadd.xyzw vf10, vf10, vf19 + c->vmax_bc(DEST::xyzw, BC::x, vf10, vf10, vf0); // vmaxx.xyzw vf10, vf10, vf0 + c->sqc2(vf11, 16, s5); // sqc2 vf11, 16(s5) + c->sqc2(vf8, 0, s4); // sqc2 vf8, 0(s4) + c->sqc2(vf9, 16, s4); // sqc2 vf9, 16(s4) + c->sqc2(vf10, 32, s4); // sqc2 vf10, 32(s4) + c->mov64(v1, s1); // or v1, s1, r0 + c->mov64(a0, s4); // or a0, s4, r0 + c->lwc1(f0, 16, a0); // lwc1 f0, 16(a0) + c->lwc1(f1, 20, a0); // lwc1 f1, 20(a0) + c->lwc1(f2, 24, a0); // lwc1 f2, 24(a0) + c->swc1(f0, 0, v1); // swc1 f0, 0(v1) + c->swc1(f1, 4, v1); // swc1 f1, 4(v1) + c->swc1(f2, 8, v1); // swc1 f2, 8(v1) + c->lui(a0, 16256); // lui a0, 16256 + c->mtc1(f3, a0); // mtc1 f3, a0 + c->muls(f2, f2, f2); // mul.s f2, f2, f2 + c->subs(f2, f3, f2); // sub.s f2, f3, f2 + c->muls(f1, f1, f1); // mul.s f1, f1, f1 + c->subs(f1, f2, f1); // sub.s f1, f2, f1 + c->muls(f0, f0, f0); // mul.s f0, f0, f0 + c->subs(f0, f1, f0); // sub.s f0, f1, f0 + c->sqrts(f0, f0); // sqrt.s f0, f0 + c->swc1(f0, 12, v1); // swc1 f0, 12(v1) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->lq(v1, 32, sp); // lq v1, 32(sp) + c->mov64(v1, v1); // or v1, v1, r0 + c->sq(v1, 48, sp); // sq v1, 48(sp) + +block_20: + c->load_symbol2(t9, cache.quaternion); // lw t9, quaternion*!(s7) + c->mov64(a0, s1); // or a0, s1, r0 + c->mov64(a1, s1); // or a1, s1, r0 + c->daddiu(a2, s5, 80); // daddiu a2, s5, 80 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lq(v1, 48, sp); // lq v1, 48(sp) + c->daddiu(v1, v1, -10); // daddiu v1, v1, -10 + c->sq(v1, 48, sp); // sq v1, 48(sp) + // nop // sll r0, r0, 0 + c->lq(v1, 48, sp); // lq v1, 48(sp) + bc = ((s64)c->sgpr64(v1)) > 0; // bgtz v1, L76 + // nop // sll r0, r0, 0 + if (bc) {goto block_20;} // branch non-likely + + c->load_symbol2(t9, cache.quaternion_normalize); // lw t9, quaternion-normalize!(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(a0, s4); // or a0, s4, r0 + c->mov64(v1, s1); // or v1, s1, r0 + c->lwc1(f0, 12, v1); // lwc1 f0, 12(v1) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L77 + // nop // sll r0, r0, 0 + if (bc) {goto block_23;} // branch non-likely + + c->lqc2(vf1, 16, a0); // lqc2 vf1, 16(a0) + c->lqc2(vf2, 0, v1); // lqc2 vf2, 0(v1) + c->vsub(DEST::xyz, vf1, vf0, vf2); // vsub.xyz vf1, vf0, vf2 + c->sqc2(vf1, 16, a0); // sqc2 vf1, 16(a0) + c->mov128_gpr_vf(a0, vf1); // qmfc2.i a0, vf1 + //beq r0, r0, L78 // beq r0, r0, L78 + // nop // sll r0, r0, 0 + goto block_24; // branch always + + +block_23: + c->lqc2(vf1, 16, a0); // lqc2 vf1, 16(a0) + c->lqc2(vf2, 0, v1); // lqc2 vf2, 0(v1) + c->vadd(DEST::xyz, vf1, vf0, vf2); // vadd.xyz vf1, vf0, vf2 + c->sqc2(vf1, 16, a0); // sqc2 vf1, 16(a0) + c->mov128_gpr_vf(a0, vf1); // qmfc2.i a0, vf1 + +block_24: + c->mov128_gpr_vf(v1, vf10); // qmfc2.i v1, vf10 + c->lw(a0, 104, s5); // lw a0, 104(s5) + c->andi(a1, a0, 2); // andi a1, a0, 2 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L79 + c->andi(a1, a0, 4); // andi a1, a0, 4 + if (bc) {goto block_27;} // branch non-likely + + bc = c->sgpr64(v1) != 0; // bne v1, r0, L79 + c->pextuw(a2, v1, r0); // pextuw a2, v1, r0 + if (bc) {goto block_27;} // branch non-likely + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L81 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + +block_27: + bc = c->sgpr64(a1) == 0; // beq a1, r0, L80 + c->andi(a0, a0, 1); // andi a0, a0, 1 + if (bc) {goto block_29;} // branch non-likely + + c->pcpyud(v1, v1, r0); // pcpyud v1, v1, r0 + c->pexew(v1, v1); // pexew v1, v1 + bc = ((s64)c->sgpr64(v1)) <= 0; // blez v1, L81 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + +block_29: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L82 + // nop // sll r0, r0, 0 + if (bc) {goto block_33;} // branch non-likely + + c->mov128_gpr_vf(v1, vf8); // qmfc2.i v1, vf8 + c->pcpyud(v1, v1, r0); // pcpyud v1, v1, r0 + c->pexew(v1, v1); // pexew v1, v1 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L81 + c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9 + if (bc) {goto block_32;} // branch non-likely + + c->pcpyud(v1, v1, r0); // pcpyud v1, v1, r0 + c->pexew(v1, v1); // pexew v1, v1 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L82 + // nop // sll r0, r0, 0 + if (bc) {goto block_33;} // branch non-likely + + +block_32: + c->load_symbol2(t9, cache.sp_free_particle); // lw t9, sp-free-particle(s7) + c->mov64(a0, gp); // or a0, gp, r0 + c->mov64(a1, s0); // or a1, s0, r0 + c->mov64(a2, s5); // or a2, s5, r0 + c->mov64(a3, s4); // or a3, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + +block_33: + c->daddiu(s3, s3, -1); // daddiu s3, s3, -1 + c->daddiu(s5, s5, 144); // daddiu s5, s5, 144 + c->daddiu(s4, s4, 48); // daddiu s4, s4, 48 + bc = c->sgpr64(s3) != 0; // bne s3, r0, L68 + c->daddiu(s0, s0, 1); // daddiu s0, s0, 1 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v0, s0); // or v0, s0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 160, sp); // lq gp, 160(sp) + c->lq(s5, 144, sp); // lq s5, 144(sp) + c->lq(s4, 128, sp); // lq s4, 128(sp) + c->lq(s3, 112, sp); // lq s3, 112(sp) + c->lq(s2, 96, sp); // lq s2, 96(sp) + c->lq(s1, 80, sp); // lq s1, 80(sp) + c->lq(s0, 64, sp); // lq s0, 64(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 176); // daddiu sp, sp, 176 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.quaternion = intern_from_c(-1, 0, "quaternion*!").c(); + cache.quaternion_normalize = intern_from_c(-1, 0, "quaternion-normalize!").c(); + cache.sp_free_particle = intern_from_c(-1, 0, "sp-free-particle").c(); + cache.sp_relaunch_particle_3d = intern_from_c(-1, 0, "sp-relaunch-particle-3d").c(); + gLinkedFunctionTable.reg("sp-process-block-3d", execute, 512); +} + +} // namespace sp_process_block_3d +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/sparticle_launcher.cpp b/game/mips2c/jak3_functions/sparticle_launcher.cpp new file mode 100644 index 0000000000..a35200d0d0 --- /dev/null +++ b/game/mips2c/jak3_functions/sparticle_launcher.cpp @@ -0,0 +1,1560 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace sp_init_fields { +struct Cache { + void* part_id_table; // *part-id-table* + void* sp_temp; // *sp-temp* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->mov64(v1, a0); // or v1, a0, r0 + c->mov64(v1, a2); // or v1, a2, r0 + c->mov64(v1, a3); // or v1, a3, r0 + c->mov64(v1, t0); // or v1, t0, r0 + // nop // sll r0, r0, 0 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->mov64(v0, a1); // or v0, a1, r0 + +block_1: + c->lh(a1, 0, v0); // lh a1, 0(v0) + // nop // sll r0, r0, 0 + c->dsubu(a1, a1, a2); // dsubu a1, a1, a2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + if (((s64)c->sgpr64(a1)) < 0) { // bltzl a1, L350 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + goto block_1; + } + +// block_3: + c->dsubu(a1, a2, a3); // dsubu a1, a2, a3 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(a1)) >= 0; // bgez a1, L366 + // nop // sll r0, r0, 0 + if (bc) {goto block_47;} // branch non-likely + + +block_4: + c->lh(a1, 0, v0); // lh a1, 0(v0) + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) != c->sgpr64(a2); // bne a1, a2, L364 + c->vrget(DEST::xyzw, vf1); // vrget.xyzw vf1 + if (bc) {goto block_44;} // branch non-likely + + c->vsqrt(vf1, BC::x); // vsqrt Q, vf1.x + c->lh(a1, 2, v0); // lh a1, 2(v0) + c->vaddq(DEST::x, vf2, vf0); // vaddq.x vf2, vf0, Q + c->lw(t2, 8, v0); // lw t2, 8(v0) + c->addiu(v1, r0, 7); // addiu v1, r0, 7 + bc = c->sgpr64(a2) == c->sgpr64(v1); // beq a2, v1, L353 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + if (bc) {goto block_19;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L354 + c->addiu(t1, r0, 2); // addiu t1, r0, 2 + if (bc) {goto block_21;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L358 + c->addiu(t1, r0, 7); // addiu t1, r0, 7 + if (bc) {goto block_31;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L356 + c->addiu(t1, r0, 3); // addiu t1, r0, 3 + if (bc) {goto block_26;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L359 + c->addiu(t1, r0, 5); // addiu t1, r0, 5 + if (bc) {goto block_34;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L361 + c->addiu(t1, r0, 6); // addiu t1, r0, 6 + if (bc) {goto block_38;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L362 + c->addiu(t1, r0, 4); // addiu t1, r0, 4 + if (bc) {goto block_40;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L363 + c->addiu(t1, r0, 8); // addiu t1, r0, 8 + if (bc) {goto block_42;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L360 + // nop // sll r0, r0, 0 + if (bc) {goto block_36;} // branch non-likely + + bc = c->sgpr64(t2) == 0; // beq t2, r0, L352 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + c->vrxor(vf2, BC::w); // vrxorw vf2 + c->lw(t1, 12, v0); // lw t1, 12(v0) + c->vrnext(DEST::xyzw, vf1); // vrnext.xyzw vf1 + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->vsub_bc(DEST::xyzw, BC::w, vf1, vf1, vf0); // vsubw.xyzw vf1, vf1, vf0 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t2); // qmtc2.i vf2, t2 + // nop // sll r0, r0, 0 + c->vitof0(DEST::xyzw, vf2, vf2); // vitof0.xyzw vf2, vf2 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf1, vf1); // vftoi0.xyzw vf1, vf1 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf1); // qmfc2.i t2, vf1 + // nop // sll r0, r0, 0 + c->mult3(t2, t2, t1); // mult3 t2, t2, t1 + // nop // sll r0, r0, 0 + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t2, 0, a0); // sw t2, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_17: + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_19: + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_21: + bc = c->sgpr64(t2) == 0; // beq t2, r0, L355 + c->vrxor(vf2, BC::w); // vrxorw vf2 + if (bc) {goto block_24;} // branch non-likely + + c->vrnext(DEST::xyzw, vf1); // vrnext.xyzw vf1 + c->lw(t1, 12, v0); // lw t1, 12(v0) + c->vsub_bc(DEST::xyzw, BC::w, vf1, vf1, vf0); // vsubw.xyzw vf1, vf1, vf0 + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->mov128_vf_gpr(vf2, t2); // qmtc2.i vf2, t2 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t1); // qmtc2.i vf2, t1 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t3); // qmtc2.i vf2, t3 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf1, vf1, vf2); // vadd.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf1); // qmfc2.i t2, vf1 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t2, 0, a0); // sw t2, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_24: + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_26: + bc = c->sgpr64(t2) == 0; // beq t2, r0, L357 + c->vrxor(vf2, BC::w); // vrxorw vf2 + if (bc) {goto block_29;} // branch non-likely + + c->vrnext(DEST::xyzw, vf1); // vrnext.xyzw vf1 + c->lw(t1, 12, v0); // lw t1, 12(v0) + c->vsub_bc(DEST::xyzw, BC::w, vf1, vf1, vf0); // vsubw.xyzw vf1, vf1, vf0 + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->mov128_vf_gpr(vf2, t2); // qmtc2.i vf2, t2 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t1); // qmtc2.i vf2, t1 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t3); // qmtc2.i vf2, t3 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf1, vf1, vf2); // vadd.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf1); // qmfc2.i t2, vf1 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t2, 0, a0); // sw t2, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + c->store_symbol2(t2, cache.sp_temp); // sw t2, *sp-temp*(s7) + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_29: + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + c->store_symbol2(t3, cache.sp_temp); // sw t3, *sp-temp*(s7) + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_31: + bc = c->sgpr64(t2) == 0; // beq t2, r0, L355 + c->vrxor(vf2, BC::w); // vrxorw vf2 + if (bc) {goto block_24;} // branch non-likely + + c->vrnext(DEST::xyzw, vf1); // vrnext.xyzw vf1 + c->lw(t1, 12, v0); // lw t1, 12(v0) + c->vsub_bc(DEST::xyzw, BC::w, vf1, vf1, vf0); // vsubw.xyzw vf1, vf1, vf0 + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + c->mov128_vf_gpr(vf2, t2); // qmtc2.i vf2, t2 + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->vitof0(DEST::xyzw, vf2, vf2); // vitof0.xyzw vf2, vf2 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf1, vf1); // vftoi0.xyzw vf1, vf1 + // nop // sll r0, r0, 0 + c->vitof0(DEST::xyzw, vf1, vf1); // vitof0.xyzw vf1, vf1 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t1); // qmtc2.i vf2, t1 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyzw, vf1, vf1, vf2); // vmul.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_vf_gpr(vf2, t3); // qmtc2.i vf2, t3 + // nop // sll r0, r0, 0 + c->vadd(DEST::xyzw, vf1, vf1, vf2); // vadd.xyzw vf1, vf1, vf2 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(t2, vf1); // qmfc2.i t2, vf1 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t2, 0, a0); // sw t2, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_34: + c->lw(t1, 4, v0); // lw t1, 4(v0) + // nop // sll r0, r0, 0 + c->dsll(t1, t1, 2); // dsll t1, t1, 2 + // nop // sll r0, r0, 0 + c->daddu(t1, t1, a0); // daddu t1, t1, a0 + // nop // sll r0, r0, 0 + c->lw(t3, 0, t1); // lw t3, 0(t1) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_36: + // nop // sll r0, r0, 0 + c->lw(t1, 4, v0); // lw t1, 4(v0) + c->dsll(t1, t1, 2); // dsll t1, t1, 2 + // nop // sll r0, r0, 0 + c->daddu(t1, t1, a0); // daddu t1, t1, a0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1) + // nop // sll r0, r0, 0 + c->lwc1(f1, 12, v0); // lwc1 f1, 12(v0) + c->cvtsw(f2, f2); // cvt.s.w f2, f2 + // nop // sll r0, r0, 0 + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + // nop // sll r0, r0, 0 + c->cvtws(f1, f1); // cvt.w.s f1, f1 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->swc1(f1, 0, a0); // swc1 f1, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_38: + c->lw(t1, 4, v0); // lw t1, 4(v0) + // nop // sll r0, r0, 0 + c->lw(t3, -1, t1); // lw t3, -1(t1) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_40: + c->load_symbol2(t1, cache.part_id_table); // lw t1, *part-id-table*(s7) + // nop // sll r0, r0, 0 + c->lw(t3, 4, v0); // lw t3, 4(v0) + // nop // sll r0, r0, 0 + c->dsll(t3, t3, 2); // dsll t3, t3, 2 + c->daddiu(t1, t1, 12); // daddiu t1, t1, 12 + c->daddu(t3, t3, t1); // daddu t3, t3, t1 + // nop // sll r0, r0, 0 + c->lw(t2, 0, t3); // lw t2, 0(t3) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t2, 0, a0); // sw t2, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_42: + c->lw(t3, 4, v0); // lw t3, 4(v0) + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->sw(t3, 0, a0); // sw t3, 0(a0) + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + c->daddiu(v0, v0, 16); // daddiu v0, v0, 16 + if (bc) {goto block_4;} // branch non-likely + + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_44: + if (((s64)c->sgpr64(t0)) != ((s64)c->sgpr64(s7))) {// bnel t0, s7, L365 + c->sw(r0, 0, a0); // sw r0, 0(a0) + goto block_46; + } + +block_46: + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + c->daddiu(a0, a0, 4); // daddiu a0, a0, 4 + bc = c->sgpr64(a2) != c->sgpr64(a3); // bne a2, a3, L351 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + +block_47: + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.part_id_table = intern_from_c(-1, 0, "*part-id-table*").c(); + cache.sp_temp = intern_from_c(-1, 0, "*sp-temp*").c(); + gLinkedFunctionTable.reg("sp-init-fields!", execute, 256); +} + +} // namespace sp_init_fields +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace particle_adgif { +struct Cache { + void* particle_adgif_cache; // *particle-adgif-cache* + void* particle_setup_adgif; // particle-setup-adgif +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + c->dsra(a3, a1, 20); // dsra a3, a1, 20 + c->load_symbol2(t1, cache.particle_adgif_cache); // lw t1, *particle-adgif-cache*(s7) + c->dsra(t0, a1, 8); // dsra t0, a1, 8 + c->lw(t2, 0, t1); // lw t2, 0(t1) + c->xor_(a3, a3, t0); // xor a3, a3, t0 + c->lhu(v1, 4, t1); // lhu v1, 4(t1) + c->andi(a3, a3, 65535); // andi a3, a3, 65535 + c->lw(t4, 8, t1); // lw t4, 8(t1) + bc = c->sgpr64(v1) == c->sgpr64(a3); // beq v1, a3, L343 + c->daddiu(t3, t1, 12); // daddiu t3, t1, 12 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(t2) == 0; // beq t2, r0, L342 + c->daddiu(t4, t1, 172); // daddiu t4, t1, 172 + if (bc) {goto block_4;} // branch non-likely + + +block_2: + c->lhu(v1, 0, t3); // lhu v1, 0(t3) + c->daddiu(t3, t3, 2); // daddiu t3, t3, 2 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == c->sgpr64(a3); // beq v1, a3, L343 + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(t2) != 0; // bne t2, r0, L341 + c->daddiu(t4, t4, 80); // daddiu t4, t4, 80 + if (bc) {goto block_2;} // branch non-likely + + +block_4: + c->daddiu(sp, sp, -16); // daddiu sp, sp, -16 + c->lw(v1, 0, t1); // lw v1, 0(t1) + c->daddiu(v1, v1, -80); // daddiu v1, v1, -80 + c->sw(a0, 0, sp); // sw a0, 0(sp) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L344 + c->daddiu(v1, v1, 81); // daddiu v1, v1, 81 + if (bc) {goto block_8;} // branch non-likely + + c->sh(a3, 0, t3); // sh a3, 0(t3) + // nop // sll r0, r0, 0 + c->sw(t4, 4, sp); // sw t4, 4(sp) + c->mov64(a0, t4); // or a0, t4, r0 + c->load_symbol2(t9, cache.particle_setup_adgif); // lw t9, particle-setup-adgif(s7) + // nop // sll r0, r0, 0 + c->sw(ra, 8, sp); // sw ra, 8(sp) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sw(v1, 0, t1); // sw v1, 0(t1) + c->jalr(call_addr); // jalr ra, t9 + // nop // sll r0, r0, 0 + c->lw(v1, 8, t4); // lw v1, 8(t4) + c->lw(a0, 0, sp); // lw a0, 0(sp) + // nop // sll r0, r0, 0 + c->lw(t4, 4, sp); // lw t4, 4(sp) + c->andi(v1, v1, 1024); // andi v1, v1, 1024 + c->lw(ra, 8, sp); // lw ra, 8(sp) + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L343 + c->lw(v1, 0, t1); // lw v1, 0(t1) + if (bc) {goto block_7;} // branch non-likely + + c->daddiu(v1, v1, -1); // daddiu v1, v1, -1 + c->sw(v1, 0, t1); // sw v1, 0(t1) + +block_7: + c->lqc2(vf16, 0, t4); // lqc2 vf16, 0(t4) + c->lqc2(vf17, 16, t4); // lqc2 vf17, 16(t4) + c->lqc2(vf18, 32, t4); // lqc2 vf18, 32(t4) + c->lqc2(vf19, 48, t4); // lqc2 vf19, 48(t4) + c->lqc2(vf20, 64, t4); // lqc2 vf20, 64(t4) + c->sqc2(vf16, 0, a0); // sqc2 vf16, 0(a0) + c->sqc2(vf17, 16, a0); // sqc2 vf17, 16(a0) + c->sqc2(vf18, 32, a0); // sqc2 vf18, 32(a0) + c->sqc2(vf19, 48, a0); // sqc2 vf19, 48(a0) + c->sqc2(vf20, 64, a0); // sqc2 vf20, 64(a0) + c->sw(t4, 8, t1); // sw t4, 8(t1) + c->sh(a3, 4, t1); // sh a3, 4(t1) + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + +block_8: + c->sw(t4, 4, sp); // sw t4, 4(sp) + // nop // sll r0, r0, 0 + c->load_symbol2(t9, cache.particle_setup_adgif); // lw t9, particle-setup-adgif(s7) + // nop // sll r0, r0, 0 + c->sw(ra, 8, sp); // sw ra, 8(sp) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lw(t4, 4, sp); // lw t4, 4(sp) + // nop // sll r0, r0, 0 + c->lw(ra, 8, sp); // lw ra, 8(sp) + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.particle_adgif_cache = intern_from_c(-1, 0, "*particle-adgif-cache*").c(); + cache.particle_setup_adgif = intern_from_c(-1, 0, "particle-setup-adgif").c(); + gLinkedFunctionTable.reg("particle-adgif", execute, 128); +} + +} // namespace particle_adgif +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace sp_launch_particles_var { +struct Cache { + void* level; // *level* + void* sp_launcher_enable; // *sp-launcher-enable* + void* sp_launcher_lock; // *sp-launcher-lock* + void* time_of_day_context; // *time-of-day-context* + void* active; // active + void* add_to_sprite_aux_list; // add-to-sprite-aux-list + void* cos; // cos + void* new_sound_id; // new-sound-id + void* particle_adgif; // particle-adgif + void* quaternion_axis_angle; // quaternion-axis-angle! + void* sin; // sin + void* sound_play_by_spec; // sound-play-by-spec + void* sp_adjust_launch; // sp-adjust-launch + void* sp_euler_convert; // sp-euler-convert + void* sp_get_particle; // sp-get-particle + void* sp_init_fields; // sp-init-fields! + void* sp_queue_launch; // sp-queue-launch + void* sp_rotate_system; // sp-rotate-system +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + u16 vis[16]; + c->mov64(v1, a0); // or v1, a0, r0 + c->mov64(v1, a1); // or v1, a1, r0 + c->mov64(v1, a2); // or v1, a2, r0 + c->mov64(v1, a3); // or v1, a3, r0 + c->mov64(v1, t0); // or v1, t0, r0 + c->mov64(v1, t1); // or v1, t1, r0 + // nop // sll r0, r0, 0 + c->daddiu(sp, sp, -304); // daddiu sp, sp, -304 + // nop // sll r0, r0, 0 + c->load_symbol2(v1, cache.sp_launcher_enable); // lw v1, *sp-launcher-enable*(s7) + c->sw(ra, 0, sp); // sw ra, 0(sp) + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L292 + c->sq(s0, 16, sp); // sq s0, 16(sp) + if (bc) {goto block_6;} // branch non-likely + + c->load_symbol2(v1, cache.sp_launcher_lock); // lw v1, *sp-launcher-lock*(s7) + c->sq(s1, 32, sp); // sq s1, 32(sp) + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L294 + c->sq(s2, 48, sp); // sq s2, 48(sp) + if (bc) {goto block_8;} // branch non-likely + + bc = c->sgpr64(a3) != c->sgpr64(s7); // bne a3, s7, L293 + c->lui(v1, 16256); // lui v1, 16256 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(t0) != c->sgpr64(s7); // bne t0, s7, L293 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(t1) != c->sgpr64(v1); // bne t1, v1, L293 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + c->load_symbol2(t9, cache.sp_queue_launch); // lw t9, sp-queue-launch(s7) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lw(ra, 0, sp); // lw ra, 0(sp) + // nop // sll r0, r0, 0 + +block_6: + //jr ra // jr ra + c->daddiu(sp, sp, 304); // daddiu sp, sp, 304 + goto end_of_function; // return + + +block_7: + c->sd(r0, 2, r0); // sd r0, 2(r0) + // nop // sll r0, r0, 0 + +block_8: + c->sq(s3, 240, sp); // sq s3, 240(sp) + // nop // sll r0, r0, 0 + c->sq(s4, 256, sp); // sq s4, 256(sp) + // nop // sll r0, r0, 0 + c->sq(s5, 272, sp); // sq s5, 272(sp) + // nop // sll r0, r0, 0 + c->sq(s6, 288, sp); // sq s6, 288(sp) + c->sqc2(vf0, 128, sp); // sqc2 vf0, 128(sp) + c->lwu(v1, 8, s6); // lwu v1, 8(s6) + c->lh(v1, 0, v1); // lh v1, 0(v1) + vis[14] = c->gpr_src(v1).du16[0]; // ctc2.i vi14, v1 + // nop // sll r0, r0, 0 + c->lqc2(vf30, 0, a2); // lqc2 vf30, 0(a2) + c->sqc2(vf30, 80, sp); // sqc2 vf30, 80(sp) + c->lqc2(vf30, 16, a2); // lqc2 vf30, 16(a2) + c->sqc2(vf30, 96, sp); // sqc2 vf30, 96(sp) + c->lqc2(vf30, 32, a2); // lqc2 vf30, 32(a2) + c->sqc2(vf30, 112, sp); // sqc2 vf30, 112(sp) + c->lqc2(vf30, 48, a2); // lqc2 vf30, 48(a2) + c->mtc1(f1, t1); // mtc1 f1, t1 + c->sqc2(vf30, 64, sp); // sqc2 vf30, 64(sp) + c->lui(v1, 17279); // lui v1, 17279 + c->mov64(s3, a0); // or s3, a0, r0 + c->mov128_vf_gpr(vf31, v1); // qmtc2.i vf31, v1 + c->mov64(s4, a1); // or s4, a1, r0 + c->lw(s6, 24, s3); // lw s6, 24(s3) + c->mov64(s0, a3); // or s0, a3, r0 + c->mov64(s1, t0); // or s1, t0, r0 + c->lw(a1, 8, a1); // lw a1, 8(a1) + c->daddiu(a0, sp, 160); // daddiu a0, sp, 160 + c->addiu(a2, r0, 0); // addiu a2, r0, 0 + c->addiu(a3, r0, 8); // addiu a3, r0, 8 + c->load_symbol2(t9, cache.sp_init_fields); // lw t9, sp-init-fields!(s7) + c->daddiu(t0, s7, 4); // daddiu t0, s7, 4 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->sw(v0, 12, sp); // sw v0, 12(sp) + // nop // sll r0, r0, 0 + c->lwc1(f2, 180, sp); // lwc1 f2, 180(sp) + // nop // sll r0, r0, 0 + bc = c->sgpr64(s0) == c->sgpr64(s7); // beq s0, s7, L295 + c->muls(f1, f2, f1); // mul.s f1, f2, f1 + if (bc) {goto block_11;} // branch non-likely + + c->lwc1(f2, 24, s0); // lwc1 f2, 24(s0) + // nop // sll r0, r0, 0 + c->adds(f2, f2, f1); // add.s f2, f2, f1 + // nop // sll r0, r0, 0 + c->swc1(f2, 24, s0); // swc1 f2, 24(s0) + // nop // sll r0, r0, 0 + c->cvtws(f2, f2); // cvt.w.s f2, f2 + // nop // sll r0, r0, 0 + c->sw(s1, 32, s0); // sw s1, 32(s0) + // nop // sll r0, r0, 0 + c->mfc1(v1, f2); // mfc1 v1, f2 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L323 + // nop // sll r0, r0, 0 + if (bc) {goto block_76;} // branch non-likely + + //beq r0, r0, L296 // beq r0, r0, L296 + // nop // sll r0, r0, 0 + goto block_12; // branch always + + +block_11: + // nop // sll r0, r0, 0 + c->lwc1(f2, 0, s4); // lwc1 f2, 0(s4) + // nop // sll r0, r0, 0 + c->adds(f2, f2, f1); // add.s f2, f2, f1 + // nop // sll r0, r0, 0 + c->swc1(f2, 0, s4); // swc1 f2, 0(s4) + // nop // sll r0, r0, 0 + c->cvtws(f2, f2); // cvt.w.s f2, f2 + // nop // sll r0, r0, 0 + c->mfc1(v1, f2); // mfc1 v1, f2 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L323 + // nop // sll r0, r0, 0 + if (bc) {goto block_76;} // branch non-likely + + +block_12: + c->addiu(a1, r0, 0); // addiu a1, r0, 0 + c->mov64(a2, s7); // or a2, s7, r0 + bc = c->sgpr64(s1) == c->sgpr64(s7); // beq s1, s7, L297 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + c->lw(v1, 12, s1); // lw v1, 12(s1) + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L297 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + c->lh(v1, 6, v1); // lh v1, 6(v1) + c->andi(a0, v1, 4); // andi a0, v1, 4 + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->movn(a1, a3, a0); // movn a1, a3, a0 + c->andi(a0, v1, 8); // andi a0, v1, 8 + c->movn(a2, s0, a0); // movn a2, s0, a0 + // nop // sll r0, r0, 0 + +block_15: + c->load_symbol2(t9, cache.sp_get_particle); // lw t9, sp-get-particle(s7) + c->mov64(a0, s3); // or a0, s3, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + bc = c->sgpr64(v0) == c->sgpr64(s7); // beq v0, s7, L323 + c->mov64(s2, v0); // or s2, v0, r0 + if (bc) {goto block_76;} // branch non-likely + + c->daddiu(a0, sp, 192); // daddiu a0, sp, 192 + c->lw(a1, 12, sp); // lw a1, 12(sp) + c->addiu(a2, r0, 9); // addiu a2, r0, 9 + c->addiu(a3, r0, 22); // addiu a3, r0, 22 + c->load_symbol2(t9, cache.sp_init_fields); // lw t9, sp-init-fields!(s7) + c->daddiu(t0, s7, 4); // daddiu t0, s7, 4 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->daddiu(a0, s2, 12); // daddiu a0, s2, 12 + c->mov64(a1, v0); // or a1, v0, r0 + c->addiu(a2, r0, 23); // addiu a2, r0, 23 + c->addiu(a3, r0, 52); // addiu a3, r0, 52 + call_addr = c->gprs[t9].du32[0]; // function call: + c->daddiu(t0, s7, 4); // daddiu t0, s7, 4 + c->jalr(call_addr); // jalr ra, t9 + c->sw(v0, 144, sp); // sw v0, 144(sp) + // nop // sll r0, r0, 0 + c->lw(s5, 104, s2); // lw s5, 104(s2) + // nop // sll r0, r0, 0 + c->andi(v1, s5, 8); // andi v1, s5, 8 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L298 + // nop // sll r0, r0, 0 + if (bc) {goto block_18;} // branch non-likely + + c->ori(s5, s5, 16384); // ori s5, s5, 16384 + // nop // sll r0, r0, 0 + c->sw(s5, 104, s2); // sw s5, 104(s2) + // nop // sll r0, r0, 0 + +block_18: + bc = c->sgpr64(s6) != c->sgpr64(s7); // bne s6, s7, L301 + // nop // sll r0, r0, 0 + if (bc) {goto block_26;} // branch non-likely + + bc = c->sgpr64(s1) == c->sgpr64(s7); // beq s1, s7, L299 + // nop // sll r0, r0, 0 + if (bc) {goto block_24;} // branch non-likely + + c->lw(v1, 12, s1); // lw v1, 12(s1) + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L299 + // nop // sll r0, r0, 0 + if (bc) {goto block_24;} // branch non-likely + + c->lh(v1, 6, v1); // lh v1, 6(v1) + c->andi(v1, v1, 4); // andi v1, v1, 4 + c->mov64(a0, s5); // or a0, s5, r0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L299 + c->lb(v1, 28, s1); // lb v1, 28(s1) + if (bc) {goto block_24;} // branch non-likely + + c->andi(a1, a0, 32768); // andi a1, a0, 32768 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L300 + // nop // sll r0, r0, 0 + if (bc) {goto block_25;} // branch non-likely + + c->andi(a0, a0, 128); // andi a0, a0, 128 + c->addiu(a1, r0, 1); // addiu a1, r0, 1 + c->movn(v1, a1, a0); // movn v1, a1, a0 + // nop // sll r0, r0, 0 + //beq r0, r0, L300 // beq r0, r0, L300 + c->sw(v1, 212, sp); // sw v1, 212(sp) + goto block_25; // branch always + + +block_24: + c->andi(v1, s5, 16384); // andi v1, s5, 16384 + // nop // sll r0, r0, 0 + c->dsra(v1, v1, 14); // dsra v1, v1, 14 + // nop // sll r0, r0, 0 + c->sw(v1, 212, sp); // sw v1, 212(sp) + // nop // sll r0, r0, 0 + +block_25: + c->lwc1(f2, 216, sp); // lwc1 f2, 216(sp) + // nop // sll r0, r0, 0 + c->cvtws(f2, f2); // cvt.w.s f2, f2 + // nop // sll r0, r0, 0 + c->mfc1(v1, f2); // mfc1 v1, f2 + // nop // sll r0, r0, 0 + c->dsll32(v1, v1, 16); // dsll32 v1, v1, 16 + // nop // sll r0, r0, 0 + c->dsra32(v1, v1, 16); // dsra32 v1, v1, 16 + // nop // sll r0, r0, 0 + c->mtc1(f2, v1); // mtc1 f2, v1 + // nop // sll r0, r0, 0 + c->cvtsw(f2, f2); // cvt.s.w f2, f2 + // nop // sll r0, r0, 0 + c->swc1(f2, 216, sp); // swc1 f2, 216(sp) + // nop // sll r0, r0, 0 + +block_26: + c->andi(v1, s5, 128); // andi v1, s5, 128 + c->lqc2(vf4, 224, sp); // lqc2 vf4, 224(sp) + bc = c->sgpr64(v1) != 0; // bne v1, r0, L302 + c->vmini_bc(DEST::xyz, BC::x, vf4, vf4, vf31); // vminix.xyz vf4, vf4, vf31 + if (bc) {goto block_28;} // branch non-likely + + // nop // sll r0, r0, 0 + c->vftoi0(DEST::xyzw, vf4, vf4); // vftoi0.xyzw vf4, vf4 + // nop // sll r0, r0, 0 + c->vitof0(DEST::xyzw, vf4, vf4); // vitof0.xyzw vf4, vf4 + c->addiu(v1, r0, -2); // addiu v1, r0, -2 + c->mov128_gpr_vf(a0, vf4); // qmfc2.i a0, vf4 + c->and_(a0, a0, v1); // and a0, a0, v1 + c->andi(v1, s5, 16384); // andi v1, s5, 16384 + c->sra(v1, v1, 14); // sra v1, v1, 14 + // nop // sll r0, r0, 0 + c->or_(a0, a0, v1); // or a0, a0, v1 + // nop // sll r0, r0, 0 + c->sq(a0, 224, sp); // sq a0, 224(sp) + // nop // sll r0, r0, 0 + +block_28: + c->gprs[v1].du64[0] = vis[14]; // cfc2.i v1, vi14 + c->sb(v1, 129, s2); // sb v1, 129(s2) + bc = c->sgpr64(s1) == c->sgpr64(s7); // beq s1, s7, L303 + c->andi(v1, s5, 64); // andi v1, s5, 64 + if (bc) {goto block_31;} // branch non-likely + + c->lwu(a0, 16, s1); // lwu a0, 16(s1) + c->lwu(a0, 8, a0); // lwu a0, 8(a0) + c->lh(a0, 0, a0); // lh a0, 0(a0) + c->sb(a0, 129, s2); // sb a0, 129(s2) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L303 + c->lw(a0, 192, sp); // lw a0, 192(sp) + if (bc) {goto block_31;} // branch non-likely + + c->load_symbol2(t9, cache.cos); // lw t9, cos(s7) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(a1, v0); // or a1, v0, r0 + c->lw(a0, 192, sp); // lw a0, 192(sp) + c->load_symbol2(t9, cache.sin); // lw t9, sin(s7) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->ori(v1, r0, 32768); // ori v1, r0, 32768 + c->dsll(v1, v1, 16); // dsll v1, v1, 16 + c->lw(a0, 200, sp); // lw a0, 200(sp) + c->xor_(a3, v0, v1); // xor a3, v0, v1 + c->sw(a0, 8, s2); // sw a0, 8(s2) + c->gprs[a2].du64[0] = 0; // or a2, r0, r0 + c->lw(t0, 196, sp); // lw t0, 196(sp) + c->load_symbol2(t9, cache.quaternion_axis_angle); // lw t9, quaternion-axis-angle!(s7) + c->daddiu(a0, s2, 80); // daddiu a0, s2, 80 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lw(v1, 16, s0); // lw v1, 16(s0) + // nop // sll r0, r0, 0 + c->lw(v1, 0, v1); // lw v1, 0(v1) + // nop // sll r0, r0, 0 + c->sw(v1, 108, s2); // sw v1, 108(s2) + // nop // sll r0, r0, 0 + +block_31: + c->sw(s7, 136, s2); // sw s7, 136(s2) + // nop // sll r0, r0, 0 + bc = c->sgpr64(s0) == c->sgpr64(s7); // beq s0, s7, L307 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + c->lw(a0, 0, s0); // lw a0, 0(s0) + // nop // sll r0, r0, 0 + c->lw(a1, 24, a0); // lw a1, 24(a0) + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) == 0; // beq a1, r0, L307 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + c->lw(a2, 0, s1); // lw a2, 0(s1) + c->daddiu(a3, s1, 108); // daddiu a3, s1, 108 + +block_34: + c->lw(v1, 0, a3); // lw v1, 0(a3) + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->lw(v1, 0, v1); // lw v1, 0(v1) + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != c->sgpr64(a1); // bne v1, a1, L306 + c->lh(v1, 4, a3); // lh v1, 4(a3) + if (bc) {goto block_39;} // branch non-likely + + c->andi(a0, v1, 1); // andi a0, v1, 1 + c->ori(v1, v1, 1); // ori v1, v1, 1 + bc = c->sgpr64(a0) != 0; // bne a0, r0, L306 + // nop // sll r0, r0, 0 + if (bc) {goto block_39;} // branch non-likely + + c->sh(v1, 4, a3); // sh v1, 4(a3) + // nop // sll r0, r0, 0 + c->lw(v1, 0, s2); // lw v1, 0(s2) + // nop // sll r0, r0, 0 + c->sw(v1, 8, a3); // sw v1, 8(a3) + c->mov64(a0, s7); // or a0, s7, r0 + if (((s64)c->sgpr64(s6)) != ((s64)c->sgpr64(s7))) {// bnel s6, s7, L305 + c->lw(a0, 0, s2); // lw a0, 0(s2) + goto block_38; + } + +block_38: + c->sw(a0, 12, a3); // sw a0, 12(a3) + // nop // sll r0, r0, 0 + c->sw(s2, 16, a3); // sw s2, 16(a3) + // nop // sll r0, r0, 0 + c->sw(a3, 136, s2); // sw a3, 136(s2) + // nop // sll r0, r0, 0 + //beq r0, r0, L307 // beq r0, r0, L307 + // nop // sll r0, r0, 0 + goto block_40; // branch always + + +block_39: + bc = c->sgpr64(a2) != 0; // bne a2, r0, L304 + c->daddiu(a3, a3, 48); // daddiu a3, a3, 48 + if (bc) {goto block_34;} // branch non-likely + + +block_40: + c->lw(a2, 144, sp); // lw a2, 144(sp) + c->daddiu(a0, sp, 192); // daddiu a0, sp, 192 + c->lh(v1, 0, a2); // lh v1, 0(a2) + c->mov64(a1, s2); // or a1, s2, r0 + c->load_symbol2(t9, cache.sp_adjust_launch); // lw t9, sp-adjust-launch(s7) + c->daddiu(v1, v1, -64); // daddiu v1, v1, -64 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L308 + c->daddiu(a3, sp, 80); // daddiu a3, sp, 80 + if (bc) {goto block_42;} // branch non-likely + + call_addr = c->gprs[t9].du32[0]; // function call: + c->mov64(t0, s6); // or t0, s6, r0 + c->jalr(call_addr); // jalr ra, t9 + +block_42: + bc = c->sgpr64(s6) == c->sgpr64(s7); // beq s6, s7, L309 + // nop // sll r0, r0, 0 + if (bc) {goto block_44;} // branch non-likely + + c->load_symbol2(t9, cache.sp_euler_convert); // lw t9, sp-euler-convert(s7) + c->daddiu(a0, sp, 192); // daddiu a0, sp, 192 + call_addr = c->gprs[t9].du32[0]; // function call: + c->mov64(a1, s2); // or a1, s2, r0 + c->jalr(call_addr); // jalr ra, t9 + +block_44: + bc = c->sgpr64(s0) == c->sgpr64(s7); // beq s0, s7, L310 + // nop // sll r0, r0, 0 + if (bc) {goto block_48;} // branch non-likely + + c->lw(a2, 12, s0); // lw a2, 12(s0) + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) == c->sgpr64(s7); // beq a2, s7, L310 + c->daddiu(a0, sp, 192); // daddiu a0, sp, 192 + if (bc) {goto block_48;} // branch non-likely + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L310 + c->mov64(a1, s2); // or a1, s2, r0 + if (bc) {goto block_48;} // branch non-likely + + c->load_symbol2(t9, cache.sp_rotate_system); // lw t9, sp-rotate-system(s7) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + +block_48: + c->lqc2(vf4, 192, sp); // lqc2 vf4, 192(sp) + // nop // sll r0, r0, 0 + c->vadd(DEST::xyz, vf4, vf4, vf30); // vadd.xyz vf4, vf4, vf30 + c->lw(a0, 4, s2); // lw a0, 4(s2) + c->lw(a1, 160, sp); // lw a1, 160(sp) + // nop // sll r0, r0, 0 + c->load_symbol2(t9, cache.particle_adgif); // lw t9, particle-adgif(s7) + // nop // sll r0, r0, 0 + c->sqc2(vf4, 192, sp); // sqc2 vf4, 192(sp) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lw(a2, 4, s2); // lw a2, 4(s2) + c->lui(a3, 256); // lui a3, 256 + c->lw(v1, 64, a2); // lw v1, 64(a2) + c->andi(a0, s5, 16); // andi a0, s5, 16 + c->addiu(a1, r0, 66); // addiu a1, r0, 66 + // nop // sll r0, r0, 0 + c->movn(v1, a1, a0); // movn v1, a1, a0 + c->andi(a0, s5, 8); // andi a0, s5, 8 + c->addiu(a1, r0, 72); // addiu a1, r0, 72 + // nop // sll r0, r0, 0 + c->movn(v1, a1, a0); // movn v1, a1, a0 + c->andi(a0, s5, 256); // andi a0, s5, 256 + c->sw(v1, 64, a2); // sw v1, 64(a2) + c->ori(a1, a3, 304); // ori a1, a3, 304 + if (((s64)c->sgpr64(a0)) != ((s64)0)) { // bnel a0, r0, L311 + c->sd(a1, 48, a2); // sd a1, 48(a2) + goto block_50; + } + +block_50: + c->lw(t9, 172, sp); // lw t9, 172(sp) + c->mov64(a1, s2); // or a1, s2, r0 + c->mov64(a0, s3); // or a0, s3, r0 + c->mov64(t0, s0); // or t0, s0, r0 + bc = c->sgpr64(t9) == 0; // beq t9, r0, L312 + c->daddiu(a2, sp, 192); // daddiu a2, sp, 192 + if (bc) {goto block_52;} // branch non-likely + + call_addr = c->gprs[t9].du32[0]; // function call: + c->mov64(a3, s4); // or a3, s4, r0 + c->jalr(call_addr); // jalr ra, t9 + +block_52: + c->lw(a0, 184, sp); // lw a0, 184(sp) + // nop // sll r0, r0, 0 + c->lwc1(f2, 4, s4); // lwc1 f2, 4(s4) + c->lui(a1, 16256); // lui a1, 16256 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L313 + // nop // sll r0, r0, 0 + if (bc) {goto block_55;} // branch non-likely + + c->lwc1(f3, 4, a0); // lwc1 f3, 4(a0) + // nop // sll r0, r0, 0 + c->adds(f2, f2, f3); // add.s f2, f2, f3 + // nop // sll r0, r0, 0 + c->swc1(f2, 4, s4); // swc1 f2, 4(s4) + c->mtc1(f3, a1); // mtc1 f3, a1 + c->subs(f2, f2, f3); // sub.s f2, f2, f3 + // nop // sll r0, r0, 0 + c->mfc1(a1, f2); // mfc1 a1, f2 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(a1)) < 0; // bltz a1, L313 + c->load_symbol2(t9, cache.new_sound_id); // lw t9, new-sound-id(s7) + if (bc) {goto block_55;} // branch non-likely + + c->sw(a1, 4, s4); // sw a1, 4(s4) + // nop // sll r0, r0, 0 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lw(a0, 184, sp); // lw a0, 184(sp) + c->mov64(a1, v0); // or a1, v0, r0 + c->load_symbol2(t9, cache.sound_play_by_spec); // lw t9, sound-play-by-spec(s7) + c->daddiu(a2, sp, 64); // daddiu a2, sp, 64 + call_addr = c->gprs[t9].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, t9 + +block_55: + c->addiu(a0, r0, 4); // addiu a0, r0, 4 + c->andi(v1, s5, 128); // andi v1, s5, 128 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L314 + c->dsubu(a0, r0, a0); // dsubu a0, r0, a0 + if (bc) {goto block_57;} // branch non-likely + + c->load_symbol2(v1, cache.add_to_sprite_aux_list);// lw v1, add-to-sprite-aux-list(s7) + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + // nop // sll r0, r0, 0 + c->and_(s5, s5, a0); // and s5, s5, a0 + c->sw(r0, 236, sp); // sw r0, 236(sp) + // nop // sll r0, r0, 0 + c->sw(r0, 60, s2); // sw r0, 60(s2) + // nop // sll r0, r0, 0 + c->lw(v1, 208, sp); // lw v1, 208(sp) + c->addiu(a0, r0, 3); // addiu a0, r0, 3 + c->pmaxw(v1, v1, a0); // pmaxw v1, v1, a0 + c->addiu(a0, r0, 11); // addiu a0, r0, 11 + c->pminw(v1, v1, a0); // pminw v1, v1, a0 + // nop // sll r0, r0, 0 + c->sw(v1, 208, sp); // sw v1, 208(sp) + // nop // sll r0, r0, 0 + +block_57: + c->addiu(v1, r0, 10); // addiu v1, r0, 10 + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + //beq r0, r0, L318 // beq r0, r0, L318 + // nop // sll r0, r0, 0 + goto block_66; // branch always + + +block_58: + c->addiu(a1, r0, 5424); // addiu a1, r0, 5424 + c->mult3(a1, a1, a0); // mult3 a1, a1, a0 + c->daddiu(a1, a1, 320); // daddiu a1, a1, 320 + c->load_symbol2(a2, cache.level); // lw a2, *level*(s7) + c->daddu(a1, a1, a2); // daddu a1, a1, a2 + c->load_symbol_addr(a2, cache.active); // daddiu a2, s7, active + c->lwu(a3, 16, a1); // lwu a3, 16(a1) + bc = c->sgpr64(a3) != c->sgpr64(a2); // bne a3, a2, L317 + c->mov64(a2, s7); // or a2, s7, r0 + if (bc) {goto block_65;} // branch non-likely + + c->lwu(a2, 44, a1); // lwu a2, 44(a1) + c->slt(a2, s4, a2); // slt a2, s4, a2 + c->daddiu(a3, s7, 4); // daddiu a3, s7, 4 + c->movn(a3, s7, a2); // movn a3, s7, a2 + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(a3))) {// beql s7, a3, L316 + c->mov64(a2, a3); // or a2, a3, r0 + goto block_62; + } + +// block_61: + c->lwu(a2, 48, a1); // lwu a2, 48(a1) + c->slt(a3, s4, a2); // slt a3, s4, a2 + c->daddiu(a2, s7, 4); // daddiu a2, s7, 4 + c->movz(a2, s7, a3); // movz a2, s7, a3 + +block_62: + bc = c->sgpr64(s7) == c->sgpr64(a2); // beq s7, a2, L317 + c->mov64(a2, s7); // or a2, s7, r0 + if (bc) {goto block_65;} // branch non-likely + + c->lw(v1, 12, a1); // lw v1, 12(a1) + c->mov64(s7, s7); // or s7, s7, r0 + //beq r0, r0, L319 // beq r0, r0, L319 + // nop // sll r0, r0, 0 + goto block_68; // branch always + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_65: + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + +block_66: + c->load_symbol2(a1, cache.level); // lw a1, *level*(s7) + c->lw(a1, 0, a1); // lw a1, 0(a1) + c->slt(a1, a0, a1); // slt a1, a0, a1 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L315 + // nop // sll r0, r0, 0 + if (bc) {goto block_58;} // branch non-likely + + c->mov64(a0, s7); // or a0, s7, r0 + +block_68: + c->dsll(v1, v1, 9); // dsll v1, v1, 9 + c->or_(s5, s5, v1); // or s5, s5, v1 + // nop // sll r0, r0, 0 + c->andi(v1, s5, 8320); // andi v1, s5, 8320 + c->addiu(a0, r0, 8192); // addiu a0, r0, 8192 + bc = c->sgpr64(v1) != c->sgpr64(a0); // bne v1, a0, L320 + c->load_symbol2(a0, cache.time_of_day_context); // lw a0, *time-of-day-context*(s7) + if (bc) {goto block_70;} // branch non-likely + + c->lqc2(vf4, 124, a0); // lqc2 vf4, 124(a0) + // nop // sll r0, r0, 0 + c->lqc2(vf5, 224, sp); // lqc2 vf5, 224(sp) + // nop // sll r0, r0, 0 + c->lqc2(vf6, 48, s2); // lqc2 vf6, 48(s2) + // nop // sll r0, r0, 0 + c->vmul(DEST::xyz, vf5, vf5, vf4); // vmul.xyz vf5, vf5, vf4 + // nop // sll r0, r0, 0 + c->vmul(DEST::xyz, vf6, vf6, vf4); // vmul.xyz vf6, vf6, vf4 + // nop // sll r0, r0, 0 + c->sqc2(vf5, 224, sp); // sqc2 vf5, 224(sp) + // nop // sll r0, r0, 0 + //beq r0, r0, L321 // beq r0, r0, L321 + c->sqc2(vf6, 48, s2); // sqc2 vf6, 48(s2) + goto block_72; // branch always + + +block_70: + // nop // sll r0, r0, 0 + c->andi(v1, s5, 128); // andi v1, s5, 128 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L321 + c->lqc2(vf5, 224, sp); // lqc2 vf5, 224(sp) + if (bc) {goto block_72;} // branch non-likely + + c->lqc2(vf6, 48, s2); // lqc2 vf6, 48(s2) + // nop // sll r0, r0, 0 + c->sqc2(vf5, 224, sp); // sqc2 vf5, 224(sp) + // nop // sll r0, r0, 0 + c->sqc2(vf6, 48, s2); // sqc2 vf6, 48(s2) + // nop // sll r0, r0, 0 + +block_72: + c->mov64(v1, s1); // or v1, s1, r0 + c->dsubu(a0, s1, s7); // dsubu a0, s1, s7 + c->movz(v1, r0, a0); // movz v1, r0, a0 + // nop // sll r0, r0, 0 + c->sw(v1, 132, s2); // sw v1, 132(s2) + // nop // sll r0, r0, 0 + c->lw(v1, 0, s2); // lw v1, 0(s2) + // nop // sll r0, r0, 0 + c->lqc2(vf4, 192, sp); // lqc2 vf4, 192(sp) + // nop // sll r0, r0, 0 + c->lqc2(vf5, 208, sp); // lqc2 vf5, 208(sp) + // nop // sll r0, r0, 0 + c->lqc2(vf6, 224, sp); // lqc2 vf6, 224(sp) + // nop // sll r0, r0, 0 + c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1) + // nop // sll r0, r0, 0 + c->sqc2(vf5, 16, v1); // sqc2 vf5, 16(v1) + // nop // sll r0, r0, 0 + c->vsub_bc(DEST::w, BC::w, vf6, vf0, vf0); // vsubw.w vf6, vf0, vf0 + // nop // sll r0, r0, 0 + c->sqc2(vf6, 32, v1); // sqc2 vf6, 32(v1) + // nop // sll r0, r0, 0 + c->ori(s5, s5, 32); // ori s5, s5, 32 + c->lw(a0, 236, sp); // lw a0, 236(sp) + c->sw(s5, 104, s2); // sw s5, 104(s2) + // nop // sll r0, r0, 0 + c->sw(a0, 124, s2); // sw a0, 124(s2) + // nop // sll r0, r0, 0 + bc = c->sgpr64(s0) == c->sgpr64(s7); // beq s0, s7, L322 + c->lui(v1, 16256); // lui v1, 16256 + if (bc) {goto block_75;} // branch non-likely + + c->lwc1(f2, 24, s0); // lwc1 f2, 24(s0) + c->mtc1(f3, v1); // mtc1 f3, v1 + c->subs(f2, f2, f3); // sub.s f2, f2, f3 + // nop // sll r0, r0, 0 + c->swc1(f2, 24, s0); // swc1 f2, 24(s0) + c->cvtws(f2, f2); // cvt.w.s f2, f2 + c->mfc1(v1, f2); // mfc1 v1, f2 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L296 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + //beq r0, r0, L323 // beq r0, r0, L323 + // nop // sll r0, r0, 0 + goto block_76; // branch always + + +block_75: + c->lwc1(f2, 0, s4); // lwc1 f2, 0(s4) + c->mtc1(f3, v1); // mtc1 f3, v1 + c->subs(f2, f2, f3); // sub.s f2, f2, f3 + // nop // sll r0, r0, 0 + c->swc1(f2, 0, s4); // swc1 f2, 0(s4) + c->cvtws(f2, f2); // cvt.w.s f2, f2 + c->mfc1(v1, f2); // mfc1 v1, f2 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L296 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + +block_76: + c->lw(ra, 0, sp); // lw ra, 0(sp) + // nop // sll r0, r0, 0 + c->lq(s0, 16, sp); // lq s0, 16(sp) + // nop // sll r0, r0, 0 + c->lq(s1, 32, sp); // lq s1, 32(sp) + // nop // sll r0, r0, 0 + c->lq(s2, 48, sp); // lq s2, 48(sp) + // nop // sll r0, r0, 0 + c->lq(s3, 240, sp); // lq s3, 240(sp) + // nop // sll r0, r0, 0 + c->lq(s4, 256, sp); // lq s4, 256(sp) + // nop // sll r0, r0, 0 + c->lq(s5, 272, sp); // lq s5, 272(sp) + // nop // sll r0, r0, 0 + c->lq(s6, 288, sp); // lq s6, 288(sp) + // nop // sll r0, r0, 0 + //jr ra // jr ra + c->daddiu(sp, sp, 304); // daddiu sp, sp, 304 + goto end_of_function; // return + + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.level = intern_from_c(-1, 0, "*level*").c(); + cache.sp_launcher_enable = intern_from_c(-1, 0, "*sp-launcher-enable*").c(); + cache.sp_launcher_lock = intern_from_c(-1, 0, "*sp-launcher-lock*").c(); + cache.time_of_day_context = intern_from_c(-1, 0, "*time-of-day-context*").c(); + cache.active = intern_from_c(-1, 0, "active").c(); + cache.add_to_sprite_aux_list = intern_from_c(-1, 0, "add-to-sprite-aux-list").c(); + cache.cos = intern_from_c(-1, 0, "cos").c(); + cache.new_sound_id = intern_from_c(-1, 0, "new-sound-id").c(); + cache.particle_adgif = intern_from_c(-1, 0, "particle-adgif").c(); + cache.quaternion_axis_angle = intern_from_c(-1, 0, "quaternion-axis-angle!").c(); + cache.sin = intern_from_c(-1, 0, "sin").c(); + cache.sound_play_by_spec = intern_from_c(-1, 0, "sound-play-by-spec").c(); + cache.sp_adjust_launch = intern_from_c(-1, 0, "sp-adjust-launch").c(); + cache.sp_euler_convert = intern_from_c(-1, 0, "sp-euler-convert").c(); + cache.sp_get_particle = intern_from_c(-1, 0, "sp-get-particle").c(); + cache.sp_init_fields = intern_from_c(-1, 0, "sp-init-fields!").c(); + cache.sp_queue_launch = intern_from_c(-1, 0, "sp-queue-launch").c(); + cache.sp_rotate_system = intern_from_c(-1, 0, "sp-rotate-system").c(); + gLinkedFunctionTable.reg("sp-launch-particles-var", execute, 512); +} + +} // namespace sp_launch_particles_var +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace sparticle_motion_blur { +struct Cache { + void* math_camera; // *math-camera* + void* atan; // atan +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + uint32_t Clipping = 0; + c->daddiu(sp, sp, -80); // daddiu sp, sp, -80 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s3, 16, sp); // sq s3, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s5, 48, sp); // sq s5, 48(sp) + c->sq(gp, 64, sp); // sq gp, 64(sp) + c->mov64(s3, a1); // or s3, a1, r0 + c->mov64(gp, a2); // or gp, a2, r0 + c->ori(a0, r0, 65535); // ori a0, r0, 65535 + c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7) + c->dsll32(a1, a0, 16); // dsll32 a1, a0, 16 + c->lq(a0, 16, s3); // lq a0, 16(s3) + c->lqc2(vf1, 0, gp); // lqc2 vf1, 0(gp) + c->pceqw(a2, a0, r0); // pceqw a2, a0, r0 + c->lqc2(vf24, 572, v1); // lqc2 vf24, 572(v1) + c->ppach(a2, r0, a2); // ppach a2, r0, a2 + c->lqc2(vf25, 588, v1); // lqc2 vf25, 588(v1) + c->or_(a1, a2, a1); // or a1, a2, a1 + c->lqc2(vf26, 604, v1); // lqc2 vf26, 604(v1) + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->lqc2(vf27, 620, v1); // lqc2 vf27, 620(v1) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L72 + c->mov128_vf_gpr(vf4, a0); // qmtc2.i vf4, a0 + if (bc) {goto block_5;} // branch non-likely + + c->lui(a0, 16896); // lui a0, 16896 + c->lqc2(vf30, 812, v1); // lqc2 vf30, 812(v1) + c->lqc2(vf29, 780, v1); // lqc2 vf29, 780(v1) + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf1); // vmulax.xyzw acc, vf24, vf1 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf1); // vmadday.xyzw acc, vf25, vf1 + c->vmadda_bc(DEST::xyzw, BC::z, vf26, vf1); // vmaddaz.xyzw acc, vf26, vf1 + c->vmadd_bc(DEST::xyzw, BC::w, vf10, vf27, vf0); // vmaddw.xyzw vf10, vf27, vf0 + c->mov128_vf_gpr(vf5, a0); // qmtc2.i vf5, a0 + c->vmul(DEST::xyzw, vf12, vf10, vf29); // vmul.xyzw vf12, vf10, vf29 + c->vmula_bc(DEST::xyzw, BC::w, vf1, vf0); // vmulaw.xyzw acc, vf1, vf0 + c->vmadd_bc(DEST::xyzw, BC::x, vf1, vf4, vf5); // vmaddx.xyzw vf1, vf4, vf5 + c->vdiv(vf0, BC::w, vf12, BC::w); // vdiv Q, vf0.w, vf12.w + Clipping = c->clip(vf12, vf12, Clipping); // Unknown instr: vclip.xyz vf12, vf12 + c->vmula_bc(DEST::xyzw, BC::x, vf24, vf1); // vmulax.xyzw acc, vf24, vf1 + c->vmadda_bc(DEST::xyzw, BC::y, vf25, vf1); // vmadday.xyzw acc, vf25, vf1 + c->vmadda_bc(DEST::xyzw, BC::z, vf26, vf1); // vmaddaz.xyzw acc, vf26, vf1 + c->vmadd_bc(DEST::xyzw, BC::w, vf11, vf27, vf0); // vmaddw.xyzw vf11, vf27, vf0 + c->vwaitq(); // vwaitq + c->gprs[v1].du64[0] = Clipping; // cfc2.i v1, Clipping + c->vmulq(DEST::xyz, vf10, vf10); // vmulq.xyz vf10, vf10, Q + c->vmul(DEST::xyzw, vf13, vf11, vf29); // vmul.xyzw vf13, vf11, vf29 + c->andi(v1, v1, 63); // andi v1, v1, 63 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L72 + c->vadd(DEST::xyzw, vf10, vf10, vf30); // vadd.xyzw vf10, vf10, vf30 + if (bc) {goto block_5;} // branch non-likely + + c->vdiv(vf0, BC::w, vf13, BC::w); // vdiv Q, vf0.w, vf13.w + Clipping = c->clip(vf13, vf13, Clipping); // Unknown instr: vclip.xyz vf13, vf13 + c->vmax_bc(DEST::w, BC::x, vf10, vf10, vf0); // vmaxx.w vf10, vf10, vf0 + c->vftoi4(DEST::xyzw, vf2, vf10); // vftoi4.xyzw vf2, vf10 + c->vwaitq(); // vwaitq + c->vmulq(DEST::xyz, vf11, vf11); // vmulq.xyz vf11, vf11, Q + c->gprs[v1].du64[0] = Clipping; // cfc2.i v1, Clipping + c->vitof0(DEST::xyzw, vf6, vf2); // vitof0.xyzw vf6, vf2 + c->vadd(DEST::xyzw, vf11, vf11, vf30); // vadd.xyzw vf11, vf11, vf30 + c->andi(v1, v1, 63); // andi v1, v1, 63 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L72 + c->vdiv(vf0, BC::w, vf6, BC::z); // vdiv Q, vf0.w, vf6.z + if (bc) {goto block_5;} // branch non-likely + + c->vmax_bc(DEST::w, BC::x, vf11, vf11, vf0); // vmaxx.w vf11, vf11, vf0 + c->vadd_bc(DEST::x, BC::w, vf9, vf0, vf0); // vaddw.x vf9, vf0, vf0 + c->vftoi4(DEST::xyzw, vf3, vf11); // vftoi4.xyzw vf3, vf11 + c->vitof0(DEST::xyzw, vf7, vf3); // vitof0.xyzw vf7, vf3 + c->vsub(DEST::xy, vf8, vf7, vf6); // vsub.xy vf8, vf7, vf6 + c->mov128_gpr_vf(s4, vf8); // qmfc2.i s4, vf8 + c->dsra32(s5, s4, 0); // dsra32 s5, s4, 0 + c->vmulq(DEST::x, vf9, vf9); // vmulq.x vf9, vf9, Q + c->load_symbol2(t9, cache.atan); // lw t9, atan(s7) + c->mov64(a0, s4); // or a0, s4, r0 + c->mov64(a1, s5); // or a1, s5, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(a0, v0); // or a0, v0, r0 + c->lw(v1, 12, s3); // lw v1, 12(s3) + c->lui(a1, -14720); // lui a1, -14720 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->mtc1(f1, a0); // mtc1 f1, a0 + c->adds(f0, f0, f1); // add.s f0, f0, f1 + c->swc1(f0, 24, gp); // swc1 f0, 24(gp) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L73 + c->mov128_gpr_vf(a0, vf9); // qmfc2.i a0, vf9 + if (bc) {goto block_7;} // branch non-likely + + c->mtc1(f2, a0); // mtc1 f2, a0 + c->lui(a0, 16256); // lui a0, 16256 + c->mtc1(f1, r0); // mtc1 f1, r0 + c->lui(a1, 13702); // lui a1, 13702 + c->ori(a1, a1, 14269); // ori a1, a1, 14269 + c->lui(a2, 13337); // lui a2, 13337 + c->ori(a2, a2, 25670); // ori a2, a2, 25670 + c->mtc1(f0, a0); // mtc1 f0, a0 + c->mtc1(f3, a1); // mtc1 f3, a1 + c->mtc1(f4, a2); // mtc1 f4, a2 + c->subs(f2, f2, f3); // sub.s f2, f2, f3 + c->subs(f3, f4, f3); // sub.s f3, f4, f3 + c->divs(f2, f2, f3); // div.s f2, f2, f3 + c->mtc1(f3, s4); // mtc1 f3, s4 + c->mtc1(f4, s5); // mtc1 f4, s5 + // Unknown instr: mula.s f3, f3 + // Unknown instr: madd.s f3, f4, f4 + { + float f3 = c->fprs[3]; + float f4 = c->fprs[4]; + c->fprs[3] = (f3 * f3) + (f4 * f4); + } + c->maxs(f2, f2, f1); // max.s f2, f2, f1 + c->sqrts(f1, f3); // sqrt.s f1, f3 + c->mins(f2, f2, f0); // min.s f2, f2, f0 + c->lui(a0, 16448); // lui a0, 16448 + c->subs(f0, f0, f2); // sub.s f0, f0, f2 + c->lui(a1, 16000); // lui a1, 16000 + c->mtc1(f3, a0); // mtc1 f3, a0 + c->mtc1(f5, a1); // mtc1 f5, a1 + c->mtc1(f4, v1); // mtc1 f4, v1 + // Unknown instr: mula.s f0, f3 + // Unknown instr: madd.s f0, f2, f5 + { + float f0 = c->fprs[0]; + float f2 = c->fprs[2]; + float f3 = c->fprs[3]; + float f5 = c->fprs[5]; + c->fprs[0] = (f0 * f3) + (f2 * f5); + } + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + c->muls(f0, f0, f4); // mul.s f0, f0, f4 + //beq r0, r0, L73 // beq r0, r0, L73 + c->swc1(f0, 12, gp); // swc1 f0, 12(gp) + goto block_7; // branch always + + +block_5: + c->lwc1(f0, 12, s3); // lwc1 f0, 12(s3) + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1 + bc = cop1_bc; // bc1t L73 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 12, gp); // swc1 f0, 12(gp) + c->mfc1(v1, f0); // mfc1 v1, f0 + +block_7: + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 64, sp); // lq gp, 64(sp) + c->lq(s5, 48, sp); // lq s5, 48(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s3, 16, sp); // lq s3, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 80); // daddiu sp, sp, 80 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.math_camera = intern_from_c(-1, 0, "*math-camera*").c(); + cache.atan = intern_from_c(-1, 0, "atan").c(); + gLinkedFunctionTable.reg("sparticle-motion-blur", execute, 128); +} + +} // namespace sparticle_motion_blur +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/jak3_functions/spatial_hash.cpp b/game/mips2c/jak3_functions/spatial_hash.cpp new file mode 100644 index 0000000000..0010e2b156 --- /dev/null +++ b/game/mips2c/jak3_functions/spatial_hash.cpp @@ -0,0 +1,2566 @@ +// cppcheck-suppress-file unusedLabels +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_18_grid_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->lh(v1, 10, a0); // lh v1, 10(a0) + c->lb(a3, 24, a0); // lb a3, 24(a0) + c->mult3(a3, a3, v1); // mult3 a3, a3, v1 + c->lb(t0, 26, a0); // lb t0, 26(a0) + c->mult3(t0, t0, a3); // mult3 t0, t0, a3 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + c->lb(t2, 0, a1); // lb t2, 0(a1) + c->dsubu(t1, t1, t2); // dsubu t1, t1, t2 + c->lb(t2, 3, a1); // lb t2, 3(a1) + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->lb(t3, 2, a1); // lb t3, 2(a1) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lb(t3, 5, a1); // lb t3, 5(a1) + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->addiu(t3, r0, 1); // addiu t3, r0, 1 + c->lb(t4, 1, a1); // lb t4, 1(a1) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lb(t4, 4, a1); // lb t4, 4(a1) + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lb(t4, 0, a1); // lb t4, 0(a1) + c->mult3(t4, t4, v1); // mult3 t4, t4, v1 + c->lb(t5, 1, a1); // lb t5, 1(a1) + c->mult3(t5, t5, t0); // mult3 t5, t5, t0 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->lb(a1, 2, a1); // lb a1, 2(a1) + c->mult3(a1, a1, a3); // mult3 a1, a1, a3 + c->daddu(a1, t4, a1); // daddu a1, t4, a1 + c->dsra(t4, a2, 3); // dsra t4, a2, 3 + c->daddu(a1, a1, t4); // daddu a1, a1, t4 + c->daddu(a1, r0, a1); // daddu a1, r0, a1 + c->lwu(a0, 28, a0); // lwu a0, 28(a0) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->addiu(a1, r0, 1); // addiu a1, r0, 1 + c->andi(a2, a2, 7); // andi a2, a2, 7 + if (((s64)c->sgpr64(a2)) >= 0) { // bgezl a2, L191 + c->dsllv(a1, a1, a2); // dsllv a1, a1, a2 + goto block_3; + } + +// block_2: + c->dsubu(a2, r0, a2); // dsubu a2, r0, a2 + c->dsrav(a1, a1, a2); // dsrav a1, a1, a2 + +block_3: + c->mov64(a2, t3); // or a2, t3, r0 + // nop // sll r0, r0, 0 + +block_4: + c->mov64(t3, t2); // or t3, t2, r0 + c->mov64(t4, a0); // or t4, a0, r0 + +block_5: + c->mov64(t5, t1); // or t5, t1, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_6: + // nop // sll r0, r0, 0 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + // nop // sll r0, r0, 0 + c->or_(t7, t7, a1); // or t7, t7, a1 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sb(t7, 0, t6); // sb t7, 0(t6) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L194 + c->daddu(t6, t6, v1); // daddu t6, t6, v1 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L193 + c->daddu(t4, t4, a3); // daddu t4, t4, a3 + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L192 + c->daddu(a0, a0, t0); // daddu a0, a0, t0 + if (bc) {goto block_4;} // branch non-likely + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 18 grid-hash)", execute, 128); +} + +} // namespace method_18_grid_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_19_grid_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->lh(v1, 10, a0); // lh v1, 10(a0) + c->lb(a3, 24, a0); // lb a3, 24(a0) + c->mult3(a3, a3, v1); // mult3 a3, a3, v1 + c->lb(t0, 26, a0); // lb t0, 26(a0) + c->mult3(t0, t0, a3); // mult3 t0, t0, a3 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + c->lb(t2, 0, a1); // lb t2, 0(a1) + c->dsubu(t1, t1, t2); // dsubu t1, t1, t2 + c->lb(t2, 3, a1); // lb t2, 3(a1) + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->lb(t3, 2, a1); // lb t3, 2(a1) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lb(t3, 5, a1); // lb t3, 5(a1) + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->addiu(t3, r0, 1); // addiu t3, r0, 1 + c->lb(t4, 1, a1); // lb t4, 1(a1) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lb(t4, 4, a1); // lb t4, 4(a1) + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lb(t4, 0, a1); // lb t4, 0(a1) + c->mult3(t4, t4, v1); // mult3 t4, t4, v1 + c->lb(t5, 1, a1); // lb t5, 1(a1) + c->mult3(t5, t5, t0); // mult3 t5, t5, t0 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->lb(a1, 2, a1); // lb a1, 2(a1) + c->mult3(a1, a1, a3); // mult3 a1, a1, a3 + c->daddu(a1, t4, a1); // daddu a1, t4, a1 + c->dsra(t4, a2, 3); // dsra t4, a2, 3 + c->daddu(a1, a1, t4); // daddu a1, a1, t4 + c->daddu(a1, r0, a1); // daddu a1, r0, a1 + c->lwu(a0, 28, a0); // lwu a0, 28(a0) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->addiu(a1, r0, 1); // addiu a1, r0, 1 + c->andi(a2, a2, 7); // andi a2, a2, 7 + if (((s64)c->sgpr64(a2)) >= 0) { // bgezl a2, L186 + c->dsllv(a1, a1, a2); // dsllv a1, a1, a2 + goto block_3; + } + +// block_2: + c->dsubu(a2, r0, a2); // dsubu a2, r0, a2 + c->dsrav(a1, a1, a2); // dsrav a1, a1, a2 + +block_3: + c->nor(a1, a1, r0); // nor a1, a1, r0 + c->mov64(a2, t3); // or a2, t3, r0 + +block_4: + c->mov64(t3, t2); // or t3, t2, r0 + c->mov64(t4, a0); // or t4, a0, r0 + +block_5: + c->mov64(t5, t1); // or t5, t1, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_6: + // nop // sll r0, r0, 0 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + // nop // sll r0, r0, 0 + c->and_(t7, t7, a1); // and t7, t7, a1 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sb(t7, 0, t6); // sb t7, 0(t6) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L189 + c->daddu(t6, t6, v1); // daddu t6, t6, v1 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L188 + c->daddu(t4, t4, a3); // daddu t4, t4, a3 + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L187 + c->daddu(a0, a0, t0); // daddu a0, a0, t0 + if (bc) {goto block_4;} // branch non-likely + + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 19 grid-hash)", execute, 128); +} + +} // namespace method_19_grid_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_20_grid_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -48); // daddiu sp, sp, -48 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(gp, 32, sp); // sq gp, 32(sp) + c->lh(v1, 10, a0); // lh v1, 10(a0) + c->lb(a3, 24, a0); // lb a3, 24(a0) + c->mult3(a3, v1, a3); // mult3 a3, v1, a3 + c->lb(t0, 26, a0); // lb t0, 26(a0) + c->mult3(t0, a3, t0); // mult3 t0, a3, t0 + c->lb(t1, 3, a1); // lb t1, 3(a1) + c->lb(t2, 0, a1); // lb t2, 0(a1) + c->dsubu(t1, t1, t2); // dsubu t1, t1, t2 + c->lb(t2, 5, a1); // lb t2, 5(a1) + c->lb(t3, 2, a1); // lb t3, 2(a1) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lb(t3, 4, a1); // lb t3, 4(a1) + c->lb(t4, 1, a1); // lb t4, 1(a1) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lb(t4, 0, a1); // lb t4, 0(a1) + c->mult3(t4, t4, v1); // mult3 t4, t4, v1 + c->lb(t5, 1, a1); // lb t5, 1(a1) + c->mult3(t5, t5, t0); // mult3 t5, t5, t0 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->lb(a1, 2, a1); // lb a1, 2(a1) + c->mult3(a1, a1, a3); // mult3 a1, a1, a3 + c->daddu(a1, t4, a1); // daddu a1, t4, a1 + c->daddu(a1, r0, a1); // daddu a1, r0, a1 + c->lwu(a0, 28, a0); // lwu a0, 28(a0) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sq(r0, 0, a2); // sq r0, 0(a2) + c->sq(r0, 16, a2); // sq r0, 16(a2) + c->mov64(a1, t3); // or a1, t3, r0 + // nop // sll r0, r0, 0 + +block_1: + c->mov64(t3, t2); // or t3, t2, r0 + c->mov64(t4, a0); // or t4, a0, r0 + +block_2: + c->mov64(t5, t1); // or t5, t1, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_3: + c->slti(t8, v1, 9); // slti t8, v1, 9 + c->mov64(t7, v1); // or t7, v1, r0 + bc = c->sgpr64(t8) != 0; // bne t8, r0, L183 + c->mov64(t8, a2); // or t8, a2, r0 + if (bc) {goto block_6;} // branch non-likely + + +block_4: + c->mov64(ra, t8); // or ra, t8, r0 + c->ldr(t9, 0, t6); // ldr t9, 0(t6) + c->daddiu(t8, t8, 8); // daddiu t8, t8, 8 + c->ldl(t9, 7, t6); // ldl t9, 7(t6) + c->daddiu(t7, t7, -8); // daddiu t7, t7, -8 + c->ld(s5, 0, ra); // ld s5, 0(ra) + c->slti(gp, t7, 8); // slti gp, t7, 8 + c->or_(t9, s5, t9); // or t9, s5, t9 + c->daddiu(t6, t6, 8); // daddiu t6, t6, 8 + c->sd(t9, 0, ra); // sd t9, 0(ra) + bc = c->sgpr64(gp) == 0; // beq gp, r0, L182 + c->gprs[t9].du64[0] = 0; // or t9, r0, r0 + if (bc) {goto block_4;} // branch non-likely + + bc = c->sgpr64(t7) == 0; // beq t7, r0, L184 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + +block_6: + // nop // sll r0, r0, 0 + c->ld(ra, 0, t8); // ld ra, 0(t8) + // nop // sll r0, r0, 0 + c->ldr(t9, 0, t6); // ldr t9, 0(t6) + // nop // sll r0, r0, 0 + c->ldl(t9, 7, t6); // ldl t9, 7(t6) + c->daddu(t6, t6, t7); // daddu t6, t6, t7 + c->or_(t7, ra, t9); // or t7, ra, t9 + // nop // sll r0, r0, 0 + c->sd(t7, 0, t8); // sd t7, 0(t8) + +block_7: + bc = ((s64)c->sgpr64(t5)) > 0; // bgtz t5, L181 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + if (bc) {goto block_3;} // branch non-likely + + c->daddu(t4, t4, a3); // daddu t4, t4, a3 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t3)) > 0; // bgtz t3, L180 + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + if (bc) {goto block_2;} // branch non-likely + + c->daddu(a0, a0, t0); // daddu a0, a0, t0 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(a1)) > 0; // bgtz a1, L179 + c->daddiu(a1, a1, -1); // daddiu a1, a1, -1 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v0, a2); // or v0, a2, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 32, sp); // lq gp, 32(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 48); // daddiu sp, sp, 48 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 20 grid-hash)", execute, 128); +} + +} // namespace method_20_grid_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_22_grid_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + // bool bc = false; + u32 call_addr = 0; + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lq(v1, 0, a2); // lq v1, 0(a2) + c->mov128_vf_gpr(vf1, v1); // qmtc2.i vf1, v1 + c->lq(v1, 12, a0); // lq v1, 12(a0) + c->mov128_vf_gpr(vf5, v1); // qmtc2.i vf5, v1 + c->vsub_bc(DEST::xyzw, BC::w, vf3, vf1, vf1); // vsubw.xyzw vf3, vf1, vf1 + c->vadd_bc(DEST::xyzw, BC::w, vf2, vf1, vf1); // vaddw.xyzw vf2, vf1, vf1 + c->lq(v1, 28, a0); // lq v1, 28(a0) + c->mov128_vf_gpr(vf4, v1); // qmtc2.i vf4, v1 + c->vmr32(DEST::xyzw, vf4, vf4); // vmr32.xyzw vf4, vf4 + c->vsub(DEST::xyzw, vf6, vf3, vf4); // vsub.xyzw vf6, vf3, vf4 + c->vsub(DEST::xyzw, vf7, vf2, vf4); // vsub.xyzw vf7, vf2, vf4 + c->vmul(DEST::xyzw, vf6, vf6, vf5); // vmul.xyzw vf6, vf6, vf5 + c->vmul(DEST::xyzw, vf7, vf7, vf5); // vmul.xyzw vf7, vf7, vf5 + c->vftoi0(DEST::xyz, vf6, vf6); // vftoi0.xyz vf6, vf6 + c->vftoi0(DEST::xyz, vf7, vf7); // vftoi0.xyz vf7, vf7 + c->nor(v1, r0, r0); // nor v1, r0, r0 + c->lw(a0, 24, a0); // lw a0, 24(a0) + c->sll(a2, a0, 8); // sll a2, a0, 8 + c->lui(a0, 1); // lui a0, 1 + c->srl(a2, a2, 8); // srl a2, a2, 8 + c->ori(a0, a0, 257); // ori a0, a0, 257 + c->dsubu(a0, a2, a0); // dsubu a0, a2, a0 + // nop // sll r0, r0, 0 + c->pextlb(a0, r0, a0); // pextlb a0, r0, a0 + // nop // sll r0, r0, 0 + c->pextlh(a0, r0, a0); // pextlh a0, r0, a0 + // nop // sll r0, r0, 0 + c->mov128_gpr_vf(a3, vf6); // qmfc2.i a3, vf6 + c->mov128_gpr_vf(a2, vf7); // qmfc2.i a2, vf7 + c->pmaxw(a3, a3, r0); // pmaxw a3, a3, r0 + c->pmaxw(a2, a2, r0); // pmaxw a2, a2, r0 + c->pminw(a3, a3, a0); // pminw a3, a3, a0 + c->pminw(a0, a2, a0); // pminw a0, a2, a0 + c->ppach(a2, r0, a3); // ppach a2, r0, a3 + c->ppach(a3, r0, a0); // ppach a3, r0, a0 + c->ppacb(a0, r0, a2); // ppacb a0, r0, a2 + c->ppacb(a2, r0, a3); // ppacb a2, r0, a3 + c->dsll(a2, a2, 24); // dsll a2, a2, 24 + c->or_(a0, a0, a2); // or a0, a0, a2 + c->dsll32(v1, v1, 16); // dsll32 v1, v1, 16 + c->ld(a2, 0, a1); // ld a2, 0(a1) + c->and_(v1, a2, v1); // and v1, a2, v1 + c->or_(v1, v1, a0); // or v1, v1, a0 + c->sd(v1, 0, a1); // sd v1, 0(a1) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 22 grid-hash)", execute, 128); +} + +} // namespace method_22_grid_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_28_sphere_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -48); // daddiu sp, sp, -48 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(gp, 32, sp); // sq gp, 32(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 112, v1); // lwu t9, 112(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->addiu(s5, r0, 0); // addiu s5, r0, 0 + //beq r0, r0, L110 // beq r0, r0, L110 + // nop // sll r0, r0, 0 + goto block_11; // branch always + + +block_1: + c->lwu(v1, 84, gp); // lwu v1, 84(gp) + c->dsll(a0, s5, 4); // dsll a0, s5, 4 + c->daddu(a2, v1, a0); // daddu a2, v1, a0 + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(a1, gp, 4); // daddiu a1, gp, 4 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->mov64(t1, gp); // or t1, gp, r0 + c->daddiu(t2, gp, 4); // daddiu t2, gp, 4 + c->mov64(a3, s5); // or a3, s5, r0 + c->lh(v1, 10, t1); // lh v1, 10(t1) + c->lb(a0, 24, t1); // lb a0, 24(t1) + c->mult3(a0, a0, v1); // mult3 a0, a0, v1 + c->lb(a1, 26, t1); // lb a1, 26(t1) + c->mult3(a1, a1, a0); // mult3 a1, a1, a0 + c->addiu(a2, r0, 1); // addiu a2, r0, 1 + c->lb(t0, 0, t2); // lb t0, 0(t2) + c->dsubu(a2, a2, t0); // dsubu a2, a2, t0 + c->lb(t0, 3, t2); // lb t0, 3(t2) + c->daddu(a2, a2, t0); // daddu a2, a2, t0 + c->addiu(t0, r0, 1); // addiu t0, r0, 1 + c->lb(t3, 2, t2); // lb t3, 2(t2) + c->dsubu(t0, t0, t3); // dsubu t0, t0, t3 + c->lb(t3, 5, t2); // lb t3, 5(t2) + c->daddu(t0, t0, t3); // daddu t0, t0, t3 + c->addiu(t3, r0, 1); // addiu t3, r0, 1 + c->lb(t4, 1, t2); // lb t4, 1(t2) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lb(t4, 4, t2); // lb t4, 4(t2) + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lb(t4, 0, t2); // lb t4, 0(t2) + c->mult3(t4, t4, v1); // mult3 t4, t4, v1 + c->lb(t5, 1, t2); // lb t5, 1(t2) + c->mult3(t5, t5, a1); // mult3 t5, t5, a1 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->lb(t2, 2, t2); // lb t2, 2(t2) + c->mult3(t2, t2, a0); // mult3 t2, t2, a0 + c->daddu(t2, t4, t2); // daddu t2, t4, t2 + c->dsra(t4, a3, 3); // dsra t4, a3, 3 + c->daddu(t2, t2, t4); // daddu t2, t2, t4 + c->daddu(t2, r0, t2); // daddu t2, r0, t2 + c->lwu(t1, 28, t1); // lwu t1, 28(t1) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->andi(a3, a3, 7); // andi a3, a3, 7 + if (((s64)c->sgpr64(a3)) >= 0) { // bgezl a3, L106 + c->dsllv(a3, t2, a3); // dsllv a3, t2, a3 + goto block_4; + } + +// block_3: + c->dsubu(a3, r0, a3); // dsubu a3, r0, a3 + c->dsrav(a3, t2, a3); // dsrav a3, t2, a3 + +block_4: + c->mov64(t2, t3); // or t2, t3, r0 + +block_5: + c->mov64(t3, t0); // or t3, t0, r0 + c->mov64(t4, t1); // or t4, t1, r0 + +block_6: + c->mov64(t5, a2); // or t5, a2, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_7: + // nop // sll r0, r0, 0 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + // nop // sll r0, r0, 0 + c->or_(t7, t7, a3); // or t7, t7, a3 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sb(t7, 0, t6); // sb t7, 0(t6) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L109 + c->daddu(t6, t6, v1); // daddu t6, t6, v1 + if (bc) {goto block_7;} // branch non-likely + + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L108 + c->daddu(t4, t4, a0); // daddu t4, t4, a0 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t2) != 0; // bne t2, r0, L107 + c->daddu(t1, t1, a1); // daddu t1, t1, a1 + if (bc) {goto block_5;} // branch non-likely + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + +block_11: + c->lh(v1, 56, gp); // lh v1, 56(gp) + c->slt(v1, s5, v1); // slt v1, s5, v1 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L105 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 32, sp); // lq gp, 32(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 48); // daddiu sp, sp, 48 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 28 sphere-hash)", execute, 128); +} + +} // namespace method_28_sphere_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_32_sphere_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -48); // daddiu sp, sp, -48 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(gp, 32, sp); // sq gp, 32(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a2); // or gp, a2, r0 + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(v1, s5, 4); // daddiu v1, s5, 4 + c->mov64(a2, a1); // or a2, a1, r0 + c->mov64(a1, v1); // or a1, v1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->mov64(t0, s5); // or t0, s5, r0 + c->daddiu(t1, s5, 4); // daddiu t1, s5, 4 + c->lh(v1, 10, t0); // lh v1, 10(t0) + c->lb(a0, 24, t0); // lb a0, 24(t0) + c->mult3(a0, a0, v1); // mult3 a0, a0, v1 + c->lb(a1, 26, t0); // lb a1, 26(t0) + c->mult3(a1, a1, a0); // mult3 a1, a1, a0 + c->addiu(a2, r0, 1); // addiu a2, r0, 1 + c->lb(a3, 0, t1); // lb a3, 0(t1) + c->dsubu(a2, a2, a3); // dsubu a2, a2, a3 + c->lb(a3, 3, t1); // lb a3, 3(t1) + c->daddu(a2, a2, a3); // daddu a2, a2, a3 + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->lb(t2, 2, t1); // lb t2, 2(t1) + c->dsubu(a3, a3, t2); // dsubu a3, a3, t2 + c->lb(t2, 5, t1); // lb t2, 5(t1) + c->daddu(a3, a3, t2); // daddu a3, a3, t2 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->lb(t3, 1, t1); // lb t3, 1(t1) + c->dsubu(t2, t2, t3); // dsubu t2, t2, t3 + c->lb(t3, 4, t1); // lb t3, 4(t1) + c->daddu(t2, t2, t3); // daddu t2, t2, t3 + c->lb(t3, 0, t1); // lb t3, 0(t1) + c->mult3(t3, t3, v1); // mult3 t3, t3, v1 + c->lb(t4, 1, t1); // lb t4, 1(t1) + c->mult3(t4, t4, a1); // mult3 t4, t4, a1 + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lb(t1, 2, t1); // lb t1, 2(t1) + c->mult3(t1, t1, a0); // mult3 t1, t1, a0 + c->daddu(t1, t3, t1); // daddu t1, t3, t1 + c->dsra(t3, gp, 3); // dsra t3, gp, 3 + c->daddu(t1, t1, t3); // daddu t1, t1, t3 + c->daddu(t1, r0, t1); // daddu t1, r0, t1 + c->lwu(t0, 28, t0); // lwu t0, 28(t0) + c->daddu(t0, t1, t0); // daddu t0, t1, t0 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + c->andi(t3, gp, 7); // andi t3, gp, 7 + if (((s64)c->sgpr64(t3)) >= 0) { // bgezl t3, L90 + c->dsllv(t1, t1, t3); // dsllv t1, t1, t3 + goto block_3; + } + +// block_2: + c->dsubu(t3, r0, t3); // dsubu t3, r0, t3 + c->dsrav(t1, t1, t3); // dsrav t1, t1, t3 + +block_3: + c->nor(t1, t1, r0); // nor t1, t1, r0 + c->mov64(t2, t2); // or t2, t2, r0 + // nop // sll r0, r0, 0 + +block_4: + c->mov64(t3, a3); // or t3, a3, r0 + c->mov64(t4, t0); // or t4, t0, r0 + +block_5: + c->mov64(t5, a2); // or t5, a2, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_6: + // nop // sll r0, r0, 0 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + // nop // sll r0, r0, 0 + c->and_(t7, t7, t1); // and t7, t7, t1 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sb(t7, 0, t6); // sb t7, 0(t6) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L93 + c->daddu(t6, t6, v1); // daddu t6, t6, v1 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L92 + c->daddu(t4, t4, a0); // daddu t4, t4, a0 + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t2) != 0; // bne t2, r0, L91 + c->daddu(t0, t0, a1); // daddu t0, t0, a1 + if (bc) {goto block_4;} // branch non-likely + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 32, sp); // lq gp, 32(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 48); // daddiu sp, sp, 48 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 32 sphere-hash)", execute, 128); +} + +} // namespace method_32_sphere_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_29_sphere_hash { +struct Cache { + void* perf_stats; // *perf-stats* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -64); // daddiu sp, sp, -64 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s4, 16, sp); // sq s4, 16(sp) + c->sq(s5, 32, sp); // sq s5, 32(sp) + c->sq(gp, 48, sp); // sq gp, 48(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + c->lwu(a1, 4, v1); // lwu a1, 4(v1) + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->sw(a1, 4, v1); // sw a1, 4(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L82 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtpc pcr0, r0 + // Unknown instr: mtpc pcr1, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtc0 Perf, a0 + // Unknown instr: sync.l + // Unknown instr: sync.p + +block_2: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(a1, s5, 4); // daddiu a1, s5, 4 + c->daddu(a2, r0, gp); // daddu a2, r0, gp + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->lwu(v1, 0, s5); // lwu v1, 0(s5) + c->daddiu(s4, v1, 12); // daddiu s4, v1, 12 + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->daddiu(a1, s5, 4); // daddiu a1, s5, 4 + c->mov64(a2, s4); // or a2, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->sh(r0, 20, gp); // sh r0, 20(gp) + c->lh(v1, 10, s5); // lh v1, 10(s5) + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + +block_3: + c->dsll(a1, a0, 3); // dsll a1, a0, 3 + c->lbu(a2, 0, s4); // lbu a2, 0(s4) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L87 + // nop // sll r0, r0, 0 + if (bc) {goto block_13;} // branch non-likely + + +block_4: + c->andi(a3, a2, 1); // andi a3, a2, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) == 0; // beq a3, r0, L86 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + c->lwu(a3, 84, s5); // lwu a3, 84(s5) + c->dsll(t0, a1, 4); // dsll t0, a1, 4 + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->lbu(t0, 24, gp); // lbu t0, 24(gp) + c->lwc1(f0, 12, a3); // lwc1 f0, 12(a3) + c->mfc1(t1, f0); // mfc1 t1, f0 + c->and_(t0, t0, t1); // and t0, t0, t1 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->mov64(t0, s7); // or t0, s7, r0 + c->lwc1(f3, 0, gp); // lwc1 f3, 0(gp) + c->lwc1(f1, 8, gp); // lwc1 f1, 8(gp) + c->lwc1(f4, 0, a3); // lwc1 f4, 0(a3) + c->lwc1(f2, 8, a3); // lwc1 f2, 8(a3) + c->lwc1(f0, 12, gp); // lwc1 f0, 12(gp) + c->subs(f3, f4, f3); // sub.s f3, f4, f3 + c->subs(f1, f2, f1); // sub.s f1, f2, f1 + c->mtc1(f2, r0); // mtc1 f2, r0 + // Unknown instr: mula.s f3, f3 + // Unknown instr: madd.s f1, f1, f1 + c->fprs[f1] = (c->fprs[f3] * c->fprs[f3]) + (c->fprs[f1] * c->fprs[f1]); + cop1_bc = c->fprs[f2] < c->fprs[f1]; // c.lt.s f2, f1 + bc = !cop1_bc; // bc1f L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->lwc1(f2, 4, gp); // lwc1 f2, 4(gp) + c->lwc1(f3, 4, a3); // lwc1 f3, 4(a3) + c->subs(f3, f3, f2); // sub.s f3, f3, f2 + c->lwc1(f2, 16, gp); // lwc1 f2, 16(gp) + c->abss(f3, f3); // abs.s f3, f3 + cop1_bc = c->fprs[f3] < c->fprs[f2]; // c.lt.s f3, f2 + bc = !cop1_bc; // bc1f L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->lwc1(f2, 12, a3); // lwc1 f2, 12(a3) + c->adds(f0, f2, f0); // add.s f0, f2, f0 + c->muls(f0, f0, f0); // mul.s f0, f0, f0 + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + bc = !cop1_bc; // bc1f L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->lh(a3, 20, gp); // lh a3, 20(gp) + c->lh(t0, 22, gp); // lh t0, 22(gp) + c->slt(a3, a3, t0); // slt a3, a3, t0 + bc = c->sgpr64(a3) == 0; // beq a3, r0, L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->mov64(a3, s7); // or a3, s7, r0 + c->lwu(a3, 28, gp); // lwu a3, 28(gp) + c->lh(t0, 20, gp); // lh t0, 20(gp) + c->daddu(a3, a3, t0); // daddu a3, a3, t0 + c->sb(a1, 0, a3); // sb a1, 0(a3) + c->lh(a3, 20, gp); // lh a3, 20(gp) + c->daddiu(a3, a3, 1); // daddiu a3, a3, 1 + c->sh(a3, 20, gp); // sh a3, 20(gp) + +block_11: + c->gprs[a3].du64[0] = 0; // or a3, r0, r0 + // nop // sll r0, r0, 0 + +block_12: + c->dsra(a2, a2, 1); // dsra a2, a2, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L84 + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + if (bc) {goto block_4;} // branch non-likely + + +block_13: + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->slt(a1, a0, v1); // slt a1, a0, v1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L83 + // nop // sll r0, r0, 0 + if (bc) {goto block_3;} // branch non-likely + + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L88 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mfpc a0, pcr0 + c->lwu(a1, 32, v1); // lwu a1, 32(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 32, v1); // sw a0, 32(v1) + // Unknown instr: mfpc a0, pcr1 + c->lwu(a1, 36, v1); // lwu a1, 36(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 36, v1); // sw a0, 36(v1) + +block_16: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 48, sp); // lq gp, 48(sp) + c->lq(s5, 32, sp); // lq s5, 32(sp) + c->lq(s4, 16, sp); // lq s4, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 64); // daddiu sp, sp, 64 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.perf_stats = intern_from_c(-1, 0, "*perf-stats*").c(); + gLinkedFunctionTable.reg("(method 29 sphere-hash)", execute, 128); +} + +} // namespace method_29_sphere_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_30_sphere_hash { +struct Cache { + void* perf_stats; // *perf-stats* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->mov64(s4, a0); // or s4, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s5, a2); // or s5, a2, r0 + c->mov64(s3, a3); // or s3, a3, r0 + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + c->lwu(a1, 4, v1); // lwu a1, 4(v1) + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->sw(a1, 4, v1); // sw a1, 4(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L70 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtpc pcr0, r0 + // Unknown instr: mtpc pcr1, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtc0 Perf, a0 + // Unknown instr: sync.l + // Unknown instr: sync.p + +block_2: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->mov64(a0, s4); // or a0, s4, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(a1, s4, 4); // daddiu a1, s4, 4 + c->mov64(a2, gp); // or a2, gp, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->lwu(v1, 0, s4); // lwu v1, 0(s4) + c->daddiu(v1, v1, 12); // daddiu v1, v1, 12 + c->sw(v1, 16, sp); // sw v1, 16(sp) + c->mov64(a0, s4); // or a0, s4, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->daddiu(a1, s4, 4); // daddiu a1, s4, 4 + c->lwu(a2, 16, sp); // lwu a2, 16(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->addiu(v1, r0, -1); // addiu v1, r0, -1 + bc = c->sgpr64(s3) == c->sgpr64(v1); // beq s3, v1, L72 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->dsra(v1, s3, 3); // dsra v1, s3, 3 + c->andi(a1, s3, 7); // andi a1, s3, 7 + c->addiu(a0, r0, 1); // addiu a0, r0, 1 + if (((s64)c->sgpr64(a1)) >= 0) { // bgezl a1, L71 + c->dsllv(a0, a0, a1); // dsllv a0, a0, a1 + goto block_6; + } + +// block_5: + c->dsubu(a1, r0, a1); // dsubu a1, r0, a1 + c->dsrav(a0, a0, a1); // dsrav a0, a0, a1 + +block_6: + c->nor(a0, a0, r0); // nor a0, a0, r0 + c->lwu(a1, 16, sp); // lwu a1, 16(sp) + c->daddu(a1, a1, v1); // daddu a1, a1, v1 + c->lbu(a1, 0, a1); // lbu a1, 0(a1) + c->and_(a0, a1, a0); // and a0, a1, a0 + c->lwu(a1, 16, sp); // lwu a1, 16(sp) + c->daddu(v1, a1, v1); // daddu v1, a1, v1 + c->sb(a0, 0, v1); // sb a0, 0(v1) + +block_7: + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->sw(v1, 20, sp); // sw v1, 20(sp) + c->sw(s4, 24, sp); // sw s4, 24(sp) + c->lwu(v1, 24, sp); // lwu v1, 24(sp) + c->lh(v1, 10, v1); // lh v1, 10(v1) + c->lwu(a0, 16, sp); // lwu a0, 16(sp) + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + +block_8: + c->dsll(a2, a1, 3); // dsll a2, a1, 3 + c->lbu(a3, 0, a0); // lbu a3, 0(a0) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L78 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + +block_9: + c->andi(t0, a3, 1); // andi t0, a3, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L77 + // nop // sll r0, r0, 0 + if (bc) {goto block_14;} // branch non-likely + + c->lwu(t0, 24, sp); // lwu t0, 24(sp) + c->lwu(t0, 84, t0); // lwu t0, 84(t0) + c->dsll(t1, a2, 4); // dsll t1, a2, 4 + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->sw(t0, 28, sp); // sw t0, 28(sp) + c->lwu(t0, 28, sp); // lwu t0, 28(sp) + c->lwc1(f0, 12, t0); // lwc1 f0, 12(t0) + c->mfc1(t0, f0); // mfc1 t0, f0 + c->and_(t0, s5, t0); // and t0, s5, t0 + bc = c->sgpr64(t0) != 0; // bne t0, r0, L75 + c->mov64(t0, s7); // or t0, s7, r0 + if (bc) {goto block_12;} // branch non-likely + + //beq r0, r0, L76 // beq r0, r0, L76 + // nop // sll r0, r0, 0 + goto block_13; // branch always + + +block_12: + c->lwc1(f0, 0, gp); // lwc1 f0, 0(gp) + c->lwu(t0, 28, sp); // lwu t0, 28(sp) + c->lwc1(f1, 0, t0); // lwc1 f1, 0(t0) + c->lwc1(f2, 4, gp); // lwc1 f2, 4(gp) + c->lwu(t0, 28, sp); // lwu t0, 28(sp) + c->lwc1(f2, 4, t0); // lwc1 f2, 4(t0) + c->lwc1(f2, 8, gp); // lwc1 f2, 8(gp) + c->lwu(t0, 28, sp); // lwu t0, 28(sp) + c->lwc1(f3, 8, t0); // lwc1 f3, 8(t0) + c->subs(f0, f1, f0); // sub.s f0, f1, f0 + c->subs(f1, f3, f2); // sub.s f1, f3, f2 + c->subs(f2, f3, f2); // sub.s f2, f3, f2 + // Unknown instr: mula.s f0, f0 + // Unknown instr: madda.s f1, f1 + // Unknown instr: madd.s f0, f2, f2 + c->fprs[f0] = (c->fprs[f2] * c->fprs[f2]) + (c->fprs[f1] * c->fprs[f1]) + (c->fprs[f0] * c->fprs[f0]); + c->lwu(t0, 28, sp); // lwu t0, 28(sp) + c->lwc1(f1, 12, t0); // lwc1 f1, 12(t0) + c->lwc1(f2, 12, gp); // lwc1 f2, 12(gp) + c->adds(f1, f1, f2); // add.s f1, f1, f2 + c->muls(f1, f1, f1); // mul.s f1, f1, f1 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = cop1_bc; // bc1t L79 + // nop // sll r0, r0, 0 + if (bc) {goto block_17;} // branch non-likely + + +block_13: + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + // nop // sll r0, r0, 0 + +block_14: + c->dsra(a3, a3, 1); // dsra a3, a3, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L74 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + if (bc) {goto block_9;} // branch non-likely + + +block_15: + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + c->slt(a2, a1, v1); // slt a2, a1, v1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L73 + // nop // sll r0, r0, 0 + if (bc) {goto block_8;} // branch non-likely + + c->sw(s7, 20, sp); // sw s7, 20(sp) + +block_17: + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L80 + // nop // sll r0, r0, 0 + if (bc) {goto block_19;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mfpc a0, pcr0 + c->lwu(a1, 32, v1); // lwu a1, 32(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 32, v1); // sw a0, 32(v1) + // Unknown instr: mfpc a0, pcr1 + c->lwu(a1, 36, v1); // lwu a1, 36(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 36, v1); // sw a0, 36(v1) + +block_19: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lwu(v0, 20, sp); // lwu v0, 20(sp) + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.perf_stats = intern_from_c(-1, 0, "*perf-stats*").c(); + gLinkedFunctionTable.reg("(method 30 sphere-hash)", execute, 128); +} + +} // namespace method_30_sphere_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_31_sphere_hash { +struct Cache { + void* perf_stats; // *perf-stats* + void* vector_vector_distance_squared; // vector-vector-distance-squared +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -192); // daddiu sp, sp, -192 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s0, 80, sp); // sq s0, 80(sp) + c->sq(s1, 96, sp); // sq s1, 96(sp) + c->sq(s2, 112, sp); // sq s2, 112(sp) + c->sq(s3, 128, sp); // sq s3, 128(sp) + c->sq(s4, 144, sp); // sq s4, 144(sp) + c->sq(s5, 160, sp); // sq s5, 160(sp) + c->sq(gp, 176, sp); // sq gp, 176(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, t0); // or s5, t0, r0 + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + c->lwu(t0, 4, v1); // lwu t0, 4(v1) + c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 + c->sw(t0, 4, v1); // sw t0, 4(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L59 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtpc pcr0, r0 + // Unknown instr: mtpc pcr1, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtc0 Perf, a0 + // Unknown instr: sync.l + // Unknown instr: sync.p + +block_2: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->sw(a1, 16, sp); // sw a1, 16(sp) + c->sw(a2, 20, sp); // sw a2, 20(sp) + c->mtc1(f0, a3); // mtc1 f0, a3 + c->swc1(f0, 24, sp); // swc1 f0, 24(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 108, v1); // lwu t9, 108(v1) + c->daddiu(a1, gp, 4); // daddiu a1, gp, 4 + c->lwu(a2, 16, sp); // lwu a2, 16(sp) + c->lwu(a3, 20, sp); // lwu a3, 20(sp) + c->lwc1(f0, 24, sp); // lwc1 f0, 24(sp) + c->mfc1(t0, f0); // mfc1 t0, f0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->lwu(v1, 0, gp); // lwu v1, 0(gp) + c->daddiu(v1, v1, 12); // daddiu v1, v1, 12 + c->sw(v1, 28, sp); // sw v1, 28(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->daddiu(a1, gp, 4); // daddiu a1, gp, 4 + c->lwu(a2, 28, sp); // lwu a2, 28(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->addiu(v1, r0, -1); // addiu v1, r0, -1 + bc = c->sgpr64(s5) == c->sgpr64(v1); // beq s5, v1, L61 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->dsra(v1, s5, 3); // dsra v1, s5, 3 + c->andi(a1, s5, 7); // andi a1, s5, 7 + c->addiu(a0, r0, 1); // addiu a0, r0, 1 + if (((s64)c->sgpr64(a1)) >= 0) { // bgezl a1, L60 + c->dsllv(a0, a0, a1); // dsllv a0, a0, a1 + goto block_6; + } + +// block_5: + c->dsubu(a1, r0, a1); // dsubu a1, r0, a1 + c->dsrav(a0, a0, a1); // dsrav a0, a0, a1 + +block_6: + c->nor(a0, a0, r0); // nor a0, a0, r0 + c->lwu(a1, 28, sp); // lwu a1, 28(sp) + c->daddu(a1, a1, v1); // daddu a1, a1, v1 + c->lbu(a1, 0, a1); // lbu a1, 0(a1) + c->and_(a0, a1, a0); // and a0, a1, a0 + c->lwu(a1, 28, sp); // lwu a1, 28(sp) + c->daddu(v1, a1, v1); // daddu v1, a1, v1 + c->sb(a0, 0, v1); // sb a0, 0(v1) + +block_7: + c->daddiu(v1, s7, 4); // daddiu v1, s7, #t + c->sw(v1, 48, sp); // sw v1, 48(sp) + c->daddiu(v1, sp, 32); // daddiu v1, sp, 32 + c->sw(v1, 52, sp); // sw v1, 52(sp) + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 56, sp); // swc1 f0, 56(sp) + c->lwu(v1, 20, sp); // lwu v1, 20(sp) + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->vadd_bc(DEST::x, BC::w, vf2, vf0, vf0); // vaddw.x vf2, vf0, vf0 + c->vmul(DEST::xyzw, vf1, vf1, vf1); // vmul.xyzw vf1, vf1, vf1 + c->vmula_bc(DEST::x, BC::x, vf2, vf1); // vmulax.x acc, vf2, vf1 + c->vmadda_bc(DEST::x, BC::y, vf2, vf1); // vmadday.x acc, vf2, vf1 + c->vmadd_bc(DEST::x, BC::z, vf1, vf2, vf1); // vmaddz.x vf1, vf2, vf1 + c->mov128_gpr_vf(v1, vf1); // qmfc2.i v1, vf1 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + bc = !cop1_bc; // bc1f L62 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_9;} // branch non-likely + + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f1, v1); // mtc1 f1, v1 + c->divs(f0, f1, f0); // div.s f0, f1, f0 + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 56, sp); // swc1 f0, 56(sp) + c->mfc1(v1, f0); // mfc1 v1, f0 + +block_9: + c->lh(s5, 10, gp); // lh s5, 10(gp) + c->lwu(s4, 28, sp); // lwu s4, 28(sp) + c->gprs[s3].du64[0] = 0; // or s3, r0, r0 + +block_10: + c->dsll(s2, s3, 3); // dsll s2, s3, 3 + c->lbu(s1, 0, s4); // lbu s1, 0(s4) + bc = c->sgpr64(s1) == 0; // beq s1, r0, L66 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // branch non-likely + + +block_11: + c->andi(v1, s1, 1); // andi v1, s1, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L65 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + c->lwu(v1, 84, gp); // lwu v1, 84(gp) + c->dsll(a0, s2, 4); // dsll a0, s2, 4 + c->daddu(s0, v1, a0); // daddu s0, v1, a0 + c->daddiu(v1, sp, 64); // daddiu v1, sp, 64 + c->mov64(a2, v1); // or a2, v1, r0 + c->mov64(a0, s0); // or a0, s0, r0 + c->lwu(a1, 16, sp); // lwu a1, 16(sp) + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->vsub(DEST::xyz, vf6, vf4, vf5); // vsub.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->lwu(a0, 20, sp); // lwu a0, 20(sp) + c->lwc1(f0, 0, a0); // lwc1 f0, 0(a0) + c->lwc1(f1, 4, a0); // lwc1 f1, 4(a0) + c->lwc1(f2, 8, a0); // lwc1 f2, 8(a0) + c->lwc1(f3, 0, v1); // lwc1 f3, 0(v1) + c->lwc1(f4, 4, v1); // lwc1 f4, 4(v1) + c->lwc1(f5, 8, v1); // lwc1 f5, 8(v1) + // Unknown instr: mula.s f0, f3 + // Unknown instr: madda.s f1, f4 + // Unknown instr: madd.s f0, f2, f5 + c->fprs[f0] = (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]) + (c->fprs[f0] * c->fprs[f3]); + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lwc1(f1, 56, sp); // lwc1 f1, 56(sp) + c->muls(f1, f0, f1); // mul.s f1, f0, f1 + c->mtc1(f0, r0); // mtc1 f0, r0 + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f2, v1); // mtc1 f2, v1 + c->mins(f1, f2, f1); // min.s f1, f2, f1 + c->maxs(f0, f0, f1); // max.s f0, f0, f1 + c->lwu(v1, 52, sp); // lwu v1, 52(sp) + c->lwu(a0, 16, sp); // lwu a0, 16(sp) + c->lwu(a1, 20, sp); // lwu a1, 20(sp) + c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1) + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1) + c->load_symbol2(t9, cache.vector_vector_distance_squared);// lw t9, vector-vector-distance-squared(s7) + c->lwu(a0, 52, sp); // lwu a0, 52(sp) + c->mov64(a1, s0); // or a1, s0, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->lwc1(f1, 24, sp); // lwc1 f1, 24(sp) + c->lwc1(f2, 12, s0); // lwc1 f2, 12(s0) + c->adds(f1, f1, f2); // add.s f1, f1, f2 + c->muls(f1, f1, f1); // mul.s f1, f1, f1 + c->mfc1(v1, f1); // mfc1 v1, f1 + c->mtc1(f1, v1); // mtc1 f1, v1 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L65 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_15;} // branch non-likely + + //beq r0, r0, L67 // beq r0, r0, L67 + // nop // sll r0, r0, 0 + goto block_18; // branch always + + // nop // sll r0, r0, 0 + +block_15: + c->dsra(s1, s1, 1); // dsra s1, s1, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s1) != 0; // bne s1, r0, L64 + c->daddiu(s2, s2, 1); // daddiu s2, s2, 1 + if (bc) {goto block_11;} // branch non-likely + + +block_16: + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->slt(v1, s3, s5); // slt v1, s3, s5 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L63 + // nop // sll r0, r0, 0 + if (bc) {goto block_10;} // branch non-likely + + c->sw(s7, 48, sp); // sw s7, 48(sp) + +block_18: + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L68 + // nop // sll r0, r0, 0 + if (bc) {goto block_20;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mfpc a0, pcr0 + c->lwu(a1, 32, v1); // lwu a1, 32(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 32, v1); // sw a0, 32(v1) + // Unknown instr: mfpc a0, pcr1 + c->lwu(a1, 36, v1); // lwu a1, 36(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 36, v1); // sw a0, 36(v1) + +block_20: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lwu(v0, 48, sp); // lwu v0, 48(sp) + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 176, sp); // lq gp, 176(sp) + c->lq(s5, 160, sp); // lq s5, 160(sp) + c->lq(s4, 144, sp); // lq s4, 144(sp) + c->lq(s3, 128, sp); // lq s3, 128(sp) + c->lq(s2, 112, sp); // lq s2, 112(sp) + c->lq(s1, 96, sp); // lq s1, 96(sp) + c->lq(s0, 80, sp); // lq s0, 80(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 192); // daddiu sp, sp, 192 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.perf_stats = intern_from_c(-1, 0, "*perf-stats*").c(); + cache.vector_vector_distance_squared = intern_from_c(-1, 0, "vector-vector-distance-squared").c(); + gLinkedFunctionTable.reg("(method 31 sphere-hash)", execute, 256); +} + +} // namespace method_31_sphere_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_32_spatial_hash { +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -48); // daddiu sp, sp, -48 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s5, 16, sp); // sq s5, 16(sp) + c->sq(gp, 32, sp); // sq gp, 32(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a2); // or s5, a2, r0 + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(v1, gp, 4); // daddiu v1, gp, 4 + c->mov64(a2, a1); // or a2, a1, r0 + c->mov64(a1, v1); // or a1, v1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->mov64(t1, gp); // or t1, gp, r0 + c->daddiu(t2, gp, 4); // daddiu t2, gp, 4 + c->mov64(t0, s5); // or t0, s5, r0 + c->lh(v1, 10, t1); // lh v1, 10(t1) + c->lb(a0, 24, t1); // lb a0, 24(t1) + c->mult3(a0, a0, v1); // mult3 a0, a0, v1 + c->lb(a1, 26, t1); // lb a1, 26(t1) + c->mult3(a1, a1, a0); // mult3 a1, a1, a0 + c->addiu(a2, r0, 1); // addiu a2, r0, 1 + c->lb(a3, 0, t2); // lb a3, 0(t2) + c->dsubu(a2, a2, a3); // dsubu a2, a2, a3 + c->lb(a3, 3, t2); // lb a3, 3(t2) + c->daddu(a2, a2, a3); // daddu a2, a2, a3 + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->lb(t3, 2, t2); // lb t3, 2(t2) + c->dsubu(a3, a3, t3); // dsubu a3, a3, t3 + c->lb(t3, 5, t2); // lb t3, 5(t2) + c->daddu(a3, a3, t3); // daddu a3, a3, t3 + c->addiu(t3, r0, 1); // addiu t3, r0, 1 + c->lb(t4, 1, t2); // lb t4, 1(t2) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lb(t4, 4, t2); // lb t4, 4(t2) + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lb(t4, 0, t2); // lb t4, 0(t2) + c->mult3(t4, t4, v1); // mult3 t4, t4, v1 + c->lb(t5, 1, t2); // lb t5, 1(t2) + c->mult3(t5, t5, a1); // mult3 t5, t5, a1 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->lb(t2, 2, t2); // lb t2, 2(t2) + c->mult3(t2, t2, a0); // mult3 t2, t2, a0 + c->daddu(t2, t4, t2); // daddu t2, t4, t2 + c->dsra(t4, t0, 3); // dsra t4, t0, 3 + c->daddu(t2, t2, t4); // daddu t2, t2, t4 + c->daddu(t2, r0, t2); // daddu t2, r0, t2 + c->lwu(t1, 28, t1); // lwu t1, 28(t1) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->andi(t0, t0, 7); // andi t0, t0, 7 + if (((s64)c->sgpr64(t0)) >= 0) { // bgezl t0, L45 + c->dsllv(t0, t2, t0); // dsllv t0, t2, t0 + goto block_3; + } + +// block_2: + c->dsubu(t0, r0, t0); // dsubu t0, r0, t0 + c->dsrav(t0, t2, t0); // dsrav t0, t2, t0 + +block_3: + c->nor(t0, t0, r0); // nor t0, t0, r0 + c->mov64(t2, t3); // or t2, t3, r0 + +block_4: + c->mov64(t3, a3); // or t3, a3, r0 + c->mov64(t4, t1); // or t4, t1, r0 + +block_5: + c->mov64(t5, a2); // or t5, a2, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_6: + // nop // sll r0, r0, 0 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + // nop // sll r0, r0, 0 + c->and_(t7, t7, t0); // and t7, t7, t0 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sb(t7, 0, t6); // sb t7, 0(t6) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L48 + c->daddu(t6, t6, v1); // daddu t6, t6, v1 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L47 + c->daddu(t4, t4, a0); // daddu t4, t4, a0 + if (bc) {goto block_5;} // branch non-likely + + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t2) != 0; // bne t2, r0, L46 + c->daddu(t1, t1, a1); // daddu t1, t1, a1 + if (bc) {goto block_4;} // branch non-likely + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->dsll(v1, s5, 4); // dsll v1, s5, 4 + c->lwu(a0, 100, gp); // lwu a0, 100(gp) + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->sw(s7, 0, v1); // sw s7, 0(v1) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 32, sp); // lq gp, 32(sp) + c->lq(s5, 16, sp); // lq s5, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 48); // daddiu sp, sp, 48 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + gLinkedFunctionTable.reg("(method 32 spatial-hash)", execute, 128); +} + +} // namespace method_32_spatial_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_38_spatial_hash { +struct Cache { + void* mem_copy; // mem-copy! +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(s4, a2); // or s4, a2, r0 + c->lh(gp, 56, s5); // lh gp, 56(s5) + c->lh(v1, 88, s5); // lh v1, 88(s5) + c->slt(v1, gp, v1); // slt v1, gp, v1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L37 + // nop // sll r0, r0, 0 + if (bc) {goto block_11;} // branch non-likely + + c->lwu(v1, 84, s5); // lwu v1, 84(s5) + c->dsll(a0, gp, 4); // dsll a0, gp, 4 + c->daddu(s3, v1, a0); // daddu s3, v1, a0 + c->lwu(v1, 100, s5); // lwu v1, 100(s5) + c->dsll(a0, gp, 4); // dsll a0, gp, 4 + c->daddu(s2, v1, a0); // daddu s2, v1, a0 + c->load_symbol2(t9, cache.mem_copy); // lw t9, mem-copy!(s7) + c->mov64(a0, s3); // or a0, s3, r0 + c->addiu(a2, r0, 16); // addiu a2, r0, 16 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->sw(s4, 0, s2); // sw s4, 0(s2) + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(a1, s5, 4); // daddiu a1, s5, 4 + c->mov64(a2, s3); // or a2, s3, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->mov64(t1, s5); // or t1, s5, r0 + c->daddiu(t2, s5, 4); // daddiu t2, s5, 4 + c->mov64(a3, gp); // or a3, gp, r0 + c->lh(v1, 10, t1); // lh v1, 10(t1) + c->lb(a0, 24, t1); // lb a0, 24(t1) + c->mult3(a0, a0, v1); // mult3 a0, a0, v1 + c->lb(a1, 26, t1); // lb a1, 26(t1) + c->mult3(a1, a1, a0); // mult3 a1, a1, a0 + c->addiu(a2, r0, 1); // addiu a2, r0, 1 + c->lb(t0, 0, t2); // lb t0, 0(t2) + c->dsubu(a2, a2, t0); // dsubu a2, a2, t0 + c->lb(t0, 3, t2); // lb t0, 3(t2) + c->daddu(a2, a2, t0); // daddu a2, a2, t0 + c->addiu(t0, r0, 1); // addiu t0, r0, 1 + c->lb(t3, 2, t2); // lb t3, 2(t2) + c->dsubu(t0, t0, t3); // dsubu t0, t0, t3 + c->lb(t3, 5, t2); // lb t3, 5(t2) + c->daddu(t0, t0, t3); // daddu t0, t0, t3 + c->addiu(t3, r0, 1); // addiu t3, r0, 1 + c->lb(t4, 1, t2); // lb t4, 1(t2) + c->dsubu(t3, t3, t4); // dsubu t3, t3, t4 + c->lb(t4, 4, t2); // lb t4, 4(t2) + c->daddu(t3, t3, t4); // daddu t3, t3, t4 + c->lb(t4, 0, t2); // lb t4, 0(t2) + c->mult3(t4, t4, v1); // mult3 t4, t4, v1 + c->lb(t5, 1, t2); // lb t5, 1(t2) + c->mult3(t5, t5, a1); // mult3 t5, t5, a1 + c->daddu(t4, t4, t5); // daddu t4, t4, t5 + c->lb(t2, 2, t2); // lb t2, 2(t2) + c->mult3(t2, t2, a0); // mult3 t2, t2, a0 + c->daddu(t2, t4, t2); // daddu t2, t4, t2 + c->dsra(t4, a3, 3); // dsra t4, a3, 3 + c->daddu(t2, t2, t4); // daddu t2, t2, t4 + c->daddu(t2, r0, t2); // daddu t2, r0, t2 + c->lwu(t1, 28, t1); // lwu t1, 28(t1) + c->daddu(t1, t2, t1); // daddu t1, t2, t1 + c->addiu(t2, r0, 1); // addiu t2, r0, 1 + c->andi(a3, a3, 7); // andi a3, a3, 7 + if (((s64)c->sgpr64(a3)) >= 0) { // bgezl a3, L33 + c->dsllv(a3, t2, a3); // dsllv a3, t2, a3 + goto block_4; + } + +// block_3: + c->dsubu(a3, r0, a3); // dsubu a3, r0, a3 + c->dsrav(a3, t2, a3); // dsrav a3, t2, a3 + +block_4: + c->mov64(t2, t3); // or t2, t3, r0 + +block_5: + c->mov64(t3, t0); // or t3, t0, r0 + c->mov64(t4, t1); // or t4, t1, r0 + +block_6: + c->mov64(t5, a2); // or t5, a2, r0 + c->mov64(t6, t4); // or t6, t4, r0 + +block_7: + // nop // sll r0, r0, 0 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + // nop // sll r0, r0, 0 + c->or_(t7, t7, a3); // or t7, t7, a3 + c->daddiu(t5, t5, -1); // daddiu t5, t5, -1 + c->sb(t7, 0, t6); // sb t7, 0(t6) + bc = c->sgpr64(t5) != 0; // bne t5, r0, L36 + c->daddu(t6, t6, v1); // daddu t6, t6, v1 + if (bc) {goto block_7;} // branch non-likely + + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L35 + c->daddu(t4, t4, a0); // daddu t4, t4, a0 + if (bc) {goto block_6;} // branch non-likely + + c->daddiu(t2, t2, -1); // daddiu t2, t2, -1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t2) != 0; // bne t2, r0, L34 + c->daddu(t1, t1, a1); // daddu t1, t1, a1 + if (bc) {goto block_5;} // branch non-likely + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lh(v1, 56, s5); // lh v1, 56(s5) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->sh(v1, 56, s5); // sh v1, 56(s5) + //beq r0, r0, L38 // beq r0, r0, L38 + // nop // sll r0, r0, 0 + goto block_12; // branch always + + +block_11: + c->addiu(gp, r0, -1); // addiu gp, r0, -1 + c->mov64(v1, gp); // or v1, gp, r0 + +block_12: + c->mov64(v0, gp); // or v0, gp, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.mem_copy = intern_from_c(-1, 0, "mem-copy!").c(); + gLinkedFunctionTable.reg("(method 38 spatial-hash)", execute, 128); +} + +} // namespace method_38_spatial_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_35_spatial_hash { +struct Cache { + void* perf_stats; // *perf-stats* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -112); // daddiu sp, sp, -112 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s3, 48, sp); // sq s3, 48(sp) + c->sq(s4, 64, sp); // sq s4, 64(sp) + c->sq(s5, 80, sp); // sq s5, 80(sp) + c->sq(gp, 96, sp); // sq gp, 96(sp) + c->mov64(s5, a0); // or s5, a0, r0 + c->mov64(gp, a1); // or gp, a1, r0 + c->mov64(s4, a2); // or s4, a2, r0 + c->mov64(s3, a3); // or s3, a3, r0 + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + c->lwu(a1, 4, v1); // lwu a1, 4(v1) + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->sw(a1, 4, v1); // sw a1, 4(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L26 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtpc pcr0, r0 + // Unknown instr: mtpc pcr1, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtc0 Perf, a0 + // Unknown instr: sync.l + // Unknown instr: sync.p + +block_2: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 104, v1); // lwu t9, 104(v1) + c->daddiu(a1, s5, 4); // daddiu a1, s5, 4 + c->mov64(a2, gp); // or a2, gp, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->lwu(v1, 0, s5); // lwu v1, 0(s5) + c->daddiu(v1, v1, 12); // daddiu v1, v1, 12 + c->sw(v1, 16, sp); // sw v1, 16(sp) + c->mov64(a0, s5); // or a0, s5, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->daddiu(a1, s5, 4); // daddiu a1, s5, 4 + c->lwu(a2, 16, sp); // lwu a2, 16(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->sd(r0, 24, sp); // sd r0, 24(sp) + c->sw(s5, 32, sp); // sw s5, 32(sp) + c->sw(s4, 36, sp); // sw s4, 36(sp) + c->sd(s3, 40, sp); // sd s3, 40(sp) + c->lwu(v1, 32, sp); // lwu v1, 32(sp) + c->lh(v1, 10, v1); // lh v1, 10(v1) + c->lwu(a0, 16, sp); // lwu a0, 16(sp) + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + // nop // sll r0, r0, 0 + +block_3: + c->dsll(a2, a1, 3); // dsll a2, a1, 3 + c->lbu(a3, 0, a0); // lbu a3, 0(a0) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L30 + // nop // sll r0, r0, 0 + if (bc) {goto block_9;} // branch non-likely + + +block_4: + c->andi(t0, a3, 1); // andi t0, a3, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L29 + // nop // sll r0, r0, 0 + if (bc) {goto block_8;} // branch non-likely + + c->lwu(t0, 32, sp); // lwu t0, 32(sp) + c->lwu(t0, 84, t0); // lwu t0, 84(t0) + c->dsll(t1, a2, 4); // dsll t1, a2, 4 + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->mov64(t1, gp); // or t1, gp, r0 + c->mov64(t2, t0); // or t2, t0, r0 + c->lqc2(vf2, 0, t1); // lqc2 vf2, 0(t1) + c->lqc2(vf3, 0, t2); // lqc2 vf3, 0(t2) + c->vsub(DEST::xyzw, vf1, vf3, vf2); // vsub.xyzw vf1, vf3, vf2 + c->vmul(DEST::xyzw, vf1, vf1, vf1); // vmul.xyzw vf1, vf1, vf1 + c->vadd_bc(DEST::x, BC::y, vf1, vf1, vf1); // vaddy.x vf1, vf1, vf1 + c->vadd_bc(DEST::x, BC::z, vf1, vf1, vf1); // vaddz.x vf1, vf1, vf1 + c->mov128_gpr_vf(t1, vf1); // qmfc2.i t1, vf1 + c->mtc1(f0, t1); // mtc1 f0, t1 + c->lwc1(f1, 12, gp); // lwc1 f1, 12(gp) + c->lwc1(f2, 12, t0); // lwc1 f2, 12(t0) + c->adds(f1, f1, f2); // add.s f1, f1, f2 + c->muls(f1, f1, f1); // mul.s f1, f1, f1 + c->mfc1(t0, f1); // mfc1 t0, f1 + c->mtc1(f1, t0); // mtc1 f1, t0 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L29 + c->mov64(t0, s7); // or t0, s7, r0 + if (bc) {goto block_8;} // branch non-likely + + c->ld(t0, 24, sp); // ld t0, 24(sp) + c->ld(t1, 40, sp); // ld t1, 40(sp) + c->slt(t0, t0, t1); // slt t0, t0, t1 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L29 + c->mov64(t0, s7); // or t0, s7, r0 + if (bc) {goto block_8;} // branch non-likely + + c->dsll(t0, a2, 4); // dsll t0, a2, 4 + c->lwu(t1, 32, sp); // lwu t1, 32(sp) + c->lwu(t1, 100, t1); // lwu t1, 100(t1) + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->lwu(t0, 0, t0); // lwu t0, 0(t0) + c->lwu(t1, 36, sp); // lwu t1, 36(sp) + c->ld(t2, 24, sp); // ld t2, 24(sp) + c->dsll(t2, t2, 2); // dsll t2, t2, 2 + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->sw(t0, 0, t1); // sw t0, 0(t1) + c->ld(t0, 24, sp); // ld t0, 24(sp) + c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 + c->sd(t0, 24, sp); // sd t0, 24(sp) + // nop // sll r0, r0, 0 + +block_8: + c->dsra(a3, a3, 1); // dsra a3, a3, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L28 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + if (bc) {goto block_4;} // branch non-likely + + +block_9: + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + c->slt(a2, a1, v1); // slt a2, a1, v1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L27 + // nop // sll r0, r0, 0 + if (bc) {goto block_3;} // branch non-likely + + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L31 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mfpc a0, pcr0 + c->lwu(a1, 32, v1); // lwu a1, 32(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 32, v1); // sw a0, 32(v1) + // Unknown instr: mfpc a0, pcr1 + c->lwu(a1, 36, v1); // lwu a1, 36(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 36, v1); // sw a0, 36(v1) + +block_12: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->ld(v0, 24, sp); // ld v0, 24(sp) + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 96, sp); // lq gp, 96(sp) + c->lq(s5, 80, sp); // lq s5, 80(sp) + c->lq(s4, 64, sp); // lq s4, 64(sp) + c->lq(s3, 48, sp); // lq s3, 48(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 112); // daddiu sp, sp, 112 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.perf_stats = intern_from_c(-1, 0, "*perf-stats*").c(); + gLinkedFunctionTable.reg("(method 35 spatial-hash)", execute, 256); +} + +} // namespace method_35_spatial_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_36_spatial_hash { +struct Cache { + void* vector_vector_distance_squared; // vector-vector-distance-squared +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -208); // daddiu sp, sp, -208 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 112, sp); // sq s1, 112(sp) + c->sq(s2, 128, sp); // sq s2, 128(sp) + c->sq(s3, 144, sp); // sq s3, 144(sp) + c->sq(s4, 160, sp); // sq s4, 160(sp) + c->sq(s5, 176, sp); // sq s5, 176(sp) + c->sq(gp, 192, sp); // sq gp, 192(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, t2); // or s5, t2, r0 + c->sw(a1, 16, sp); // sw a1, 16(sp) + c->sw(a2, 20, sp); // sw a2, 20(sp) + c->mtc1(f0, a3); // mtc1 f0, a3 + c->swc1(f0, 24, sp); // swc1 f0, 24(sp) + c->sw(t0, 28, sp); // sw t0, 28(sp) + c->sd(t1, 32, sp); // sd t1, 32(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 108, v1); // lwu t9, 108(v1) + c->daddiu(a1, gp, 4); // daddiu a1, gp, 4 + c->lwu(a2, 16, sp); // lwu a2, 16(sp) + c->lwu(a3, 20, sp); // lwu a3, 20(sp) + c->lwc1(f0, 24, sp); // lwc1 f0, 24(sp) + c->mfc1(t0, f0); // mfc1 t0, f0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->lwu(v1, 0, gp); // lwu v1, 0(gp) + c->daddiu(v1, v1, 12); // daddiu v1, v1, 12 + c->sw(v1, 40, sp); // sw v1, 40(sp) + c->mov64(a0, gp); // or a0, gp, r0 + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->daddiu(a1, gp, 4); // daddiu a1, gp, 4 + c->lwu(a2, 40, sp); // lwu a2, 40(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->addiu(v1, r0, -1); // addiu v1, r0, -1 + bc = c->sgpr64(s5) == c->sgpr64(v1); // beq s5, v1, L19 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_5;} // branch non-likely + + c->dsra(v1, s5, 3); // dsra v1, s5, 3 + c->andi(a1, s5, 7); // andi a1, s5, 7 + c->addiu(a0, r0, 1); // addiu a0, r0, 1 + if (((s64)c->sgpr64(a1)) >= 0) { // bgezl a1, L18 + c->dsllv(a0, a0, a1); // dsllv a0, a0, a1 + goto block_4; + } + +// block_3: + c->dsubu(a1, r0, a1); // dsubu a1, r0, a1 + c->dsrav(a0, a0, a1); // dsrav a0, a0, a1 + +block_4: + c->nor(a0, a0, r0); // nor a0, a0, r0 + c->lwu(a1, 40, sp); // lwu a1, 40(sp) + c->daddu(a1, a1, v1); // daddu a1, a1, v1 + c->lbu(a1, 0, a1); // lbu a1, 0(a1) + c->and_(a0, a1, a0); // and a0, a1, a0 + c->lwu(a1, 40, sp); // lwu a1, 40(sp) + c->daddu(v1, a1, v1); // daddu v1, a1, v1 + c->sb(a0, 0, v1); // sb a0, 0(v1) + +block_5: + c->sd(r0, 64, sp); // sd r0, 64(sp) + c->daddiu(v1, sp, 48); // daddiu v1, sp, 48 + c->sw(v1, 72, sp); // sw v1, 72(sp) + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 76, sp); // swc1 f0, 76(sp) + c->lwu(v1, 20, sp); // lwu v1, 20(sp) + c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1) + c->vadd_bc(DEST::x, BC::w, vf2, vf0, vf0); // vaddw.x vf2, vf0, vf0 + c->vmul(DEST::xyzw, vf1, vf1, vf1); // vmul.xyzw vf1, vf1, vf1 + c->vmula_bc(DEST::x, BC::x, vf2, vf1); // vmulax.x acc, vf2, vf1 + c->vmadda_bc(DEST::x, BC::y, vf2, vf1); // vmadday.x acc, vf2, vf1 + c->vmadd_bc(DEST::x, BC::z, vf1, vf2, vf1); // vmaddz.x vf1, vf2, vf1 + c->mov128_gpr_vf(v1, vf1); // qmfc2.i v1, vf1 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->mtc1(f1, r0); // mtc1 f1, r0 + cop1_bc = c->fprs[f1] < c->fprs[f0]; // c.lt.s f1, f0 + bc = !cop1_bc; // bc1f L20 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f1, v1); // mtc1 f1, v1 + c->divs(f0, f1, f0); // div.s f0, f1, f0 + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 76, sp); // swc1 f0, 76(sp) + c->mfc1(v1, f0); // mfc1 v1, f0 + +block_7: + c->lh(s5, 10, gp); // lh s5, 10(gp) + c->lwu(s4, 40, sp); // lwu s4, 40(sp) + c->gprs[s3].du64[0] = 0; // or s3, r0, r0 + // nop // sll r0, r0, 0 + +block_8: + c->dsll(s2, s3, 3); // dsll s2, s3, 3 + c->lbu(s1, 0, s4); // lbu s1, 0(s4) + bc = c->sgpr64(s1) == 0; // beq s1, r0, L24 + // nop // sll r0, r0, 0 + if (bc) {goto block_14;} // branch non-likely + + +block_9: + c->andi(v1, s1, 1); // andi v1, s1, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L23 + // nop // sll r0, r0, 0 + if (bc) {goto block_13;} // branch non-likely + + c->lwu(v1, 84, gp); // lwu v1, 84(gp) + c->dsll(a0, s2, 4); // dsll a0, s2, 4 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->sw(v1, 80, sp); // sw v1, 80(sp) + c->daddiu(v1, sp, 96); // daddiu v1, sp, 96 + c->mov64(a2, v1); // or a2, v1, r0 + c->lwu(a0, 80, sp); // lwu a0, 80(sp) + c->lwu(a1, 16, sp); // lwu a1, 16(sp) + c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0) + c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1) + c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0 + c->vsub(DEST::xyz, vf6, vf4, vf5); // vsub.xyz vf6, vf4, vf5 + c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2) + c->lwu(a0, 20, sp); // lwu a0, 20(sp) + c->lwc1(f0, 0, a0); // lwc1 f0, 0(a0) + c->lwc1(f1, 4, a0); // lwc1 f1, 4(a0) + c->lwc1(f2, 8, a0); // lwc1 f2, 8(a0) + c->lwc1(f3, 0, v1); // lwc1 f3, 0(v1) + c->lwc1(f4, 4, v1); // lwc1 f4, 4(v1) + c->lwc1(f5, 8, v1); // lwc1 f5, 8(v1) + // Unknown instr: mula.s f0, f3 + // Unknown instr: madda.s f1, f4 + // Unknown instr: madd.s f0, f2, f5 + c->fprs[f0] = (c->fprs[f0] * c->fprs[f3]) + (c->fprs[f1] * c->fprs[f4]) + (c->fprs[f2] * c->fprs[f5]); + c->mfc1(v1, f0); // mfc1 v1, f0 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->lwc1(f1, 76, sp); // lwc1 f1, 76(sp) + c->muls(f1, f0, f1); // mul.s f1, f0, f1 + c->mtc1(f0, r0); // mtc1 f0, r0 + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f2, v1); // mtc1 f2, v1 + c->mins(f1, f2, f1); // min.s f1, f2, f1 + c->maxs(f0, f0, f1); // max.s f0, f0, f1 + c->lwu(v1, 72, sp); // lwu v1, 72(sp) + c->lwu(a0, 16, sp); // lwu a0, 16(sp) + c->lwu(a1, 20, sp); // lwu a1, 20(sp) + c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1) + c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0) + c->mfc1(a0, f0); // mfc1 a0, f0 + c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0 + c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0 + c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3 + c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0 + c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1) + c->load_symbol2(t9, cache.vector_vector_distance_squared);// lw t9, vector-vector-distance-squared(s7) + c->lwu(a0, 72, sp); // lwu a0, 72(sp) + c->lwu(a1, 80, sp); // lwu a1, 80(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mtc1(f0, v0); // mtc1 f0, v0 + c->lwc1(f1, 24, sp); // lwc1 f1, 24(sp) + c->lwu(v1, 80, sp); // lwu v1, 80(sp) + c->lwc1(f2, 12, v1); // lwc1 f2, 12(v1) + c->adds(f1, f1, f2); // add.s f1, f1, f2 + c->muls(f1, f1, f1); // mul.s f1, f1, f1 + c->mfc1(v1, f1); // mfc1 v1, f1 + c->mtc1(f1, v1); // mtc1 f1, v1 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L23 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_13;} // branch non-likely + + c->ld(v1, 64, sp); // ld v1, 64(sp) + c->ld(a0, 32, sp); // ld a0, 32(sp) + c->slt(v1, v1, a0); // slt v1, v1, a0 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L23 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_13;} // branch non-likely + + c->dsll(v1, s2, 4); // dsll v1, s2, 4 + c->lwu(a0, 100, gp); // lwu a0, 100(gp) + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lwu(v1, 0, v1); // lwu v1, 0(v1) + c->lwu(a0, 28, sp); // lwu a0, 28(sp) + c->ld(a1, 64, sp); // ld a1, 64(sp) + c->dsll(a1, a1, 2); // dsll a1, a1, 2 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + c->sw(v1, 0, a0); // sw v1, 0(a0) + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->ld(v1, 64, sp); // ld v1, 64(sp) + c->daddiu(v1, v1, 1); // daddiu v1, v1, 1 + c->sd(v1, 64, sp); // sd v1, 64(sp) + // nop // sll r0, r0, 0 + +block_13: + c->dsra(s1, s1, 1); // dsra s1, s1, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(s1) != 0; // bne s1, r0, L22 + c->daddiu(s2, s2, 1); // daddiu s2, s2, 1 + if (bc) {goto block_9;} // branch non-likely + + +block_14: + c->daddiu(s3, s3, 1); // daddiu s3, s3, 1 + c->daddiu(s4, s4, 1); // daddiu s4, s4, 1 + c->slt(v1, s3, s5); // slt v1, s3, s5 + // nop // sll r0, r0, 0 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L21 + // nop // sll r0, r0, 0 + if (bc) {goto block_8;} // branch non-likely + + c->ld(v0, 64, sp); // ld v0, 64(sp) + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 192, sp); // lq gp, 192(sp) + c->lq(s5, 176, sp); // lq s5, 176(sp) + c->lq(s4, 160, sp); // lq s4, 160(sp) + c->lq(s3, 144, sp); // lq s3, 144(sp) + c->lq(s2, 128, sp); // lq s2, 128(sp) + c->lq(s1, 112, sp); // lq s1, 112(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 208); // daddiu sp, sp, 208 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.vector_vector_distance_squared = intern_from_c(-1, 0, "vector-vector-distance-squared").c(); + gLinkedFunctionTable.reg("(method 36 spatial-hash)", execute, 256); +} + +} // namespace method_36_spatial_hash +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace method_34_spatial_hash { +struct Cache { + void* perf_stats; // *perf-stats* +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + bool cop1_bc = false; + c->daddiu(sp, sp, -64); // daddiu sp, sp, -64 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(gp, 48, sp); // sq gp, 48(sp) + c->mov64(gp, a1); // or gp, a1, r0 + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a1, 28, v1); // lwu a1, 28(v1) + c->lwu(t0, 4, v1); // lwu t0, 4(v1) + c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 + c->sw(t0, 4, v1); // sw t0, 4(v1) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L3 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtpc pcr0, r0 + // Unknown instr: mtpc pcr1, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mtc0 Perf, a1 + // Unknown instr: sync.l + // Unknown instr: sync.p + +block_2: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->mov64(v1, a0); // or v1, a0, r0 + c->daddiu(a1, a0, 4); // daddiu a1, a0, 4 + c->daddu(t0, r0, gp); // daddu t0, r0, gp + c->daddiu(t1, gp, 16); // daddiu t1, gp, 16 + c->addiu(t2, r0, 0); // addiu t2, r0, 0 + //beq r0, r0, L5 // beq r0, r0, L5 + // nop // sll r0, r0, 0 + goto block_4; // branch always + + +block_3: + c->mtc1(f0, r0); // mtc1 f0, r0 + c->dsll(t3, t2, 2); // dsll t3, t2, 2 + c->daddu(t3, t3, t0); // daddu t3, t3, t0 + c->lwc1(f1, 0, t3); // lwc1 f1, 0(t3) + c->dsll(t3, t2, 2); // dsll t3, t2, 2 + c->daddu(t3, t3, v1); // daddu t3, t3, v1 + c->lwc1(f2, 32, t3); // lwc1 f2, 32(t3) + c->subs(f1, f1, f2); // sub.s f1, f1, f2 + c->dsll(t3, t2, 2); // dsll t3, t2, 2 + c->daddu(t3, t3, v1); // daddu t3, t3, v1 + c->lwc1(f2, 12, t3); // lwc1 f2, 12(t3) + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + c->daddu(t3, t2, v1); // daddu t3, t2, v1 + c->lb(t3, 24, t3); // lb t3, 24(t3) + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + c->mtc1(f2, t3); // mtc1 f2, t3 + c->cvtsw(f2, f2); // cvt.s.w f2, f2 + c->mins(f1, f1, f2); // min.s f1, f1, f2 + c->maxs(f0, f0, f1); // max.s f0, f0, f1 + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->mfc1(t3, f0); // mfc1 t3, f0 + c->daddu(t4, t2, a1); // daddu t4, t2, a1 + c->sb(t3, 0, t4); // sb t3, 0(t4) + c->mtc1(f0, r0); // mtc1 f0, r0 + c->dsll(t3, t2, 2); // dsll t3, t2, 2 + c->daddu(t3, t3, t1); // daddu t3, t3, t1 + c->lwc1(f1, 0, t3); // lwc1 f1, 0(t3) + c->dsll(t3, t2, 2); // dsll t3, t2, 2 + c->daddu(t3, t3, v1); // daddu t3, t3, v1 + c->lwc1(f2, 32, t3); // lwc1 f2, 32(t3) + c->subs(f1, f1, f2); // sub.s f1, f1, f2 + c->dsll(t3, t2, 2); // dsll t3, t2, 2 + c->daddu(t3, t3, v1); // daddu t3, t3, v1 + c->lwc1(f2, 12, t3); // lwc1 f2, 12(t3) + c->muls(f1, f1, f2); // mul.s f1, f1, f2 + c->daddu(t3, t2, v1); // daddu t3, t2, v1 + c->lb(t3, 24, t3); // lb t3, 24(t3) + c->daddiu(t3, t3, -1); // daddiu t3, t3, -1 + c->mtc1(f2, t3); // mtc1 f2, t3 + c->cvtsw(f2, f2); // cvt.s.w f2, f2 + c->mins(f1, f1, f2); // min.s f1, f1, f2 + c->maxs(f0, f0, f1); // max.s f0, f0, f1 + c->cvtws(f0, f0); // cvt.w.s f0, f0 + c->mfc1(t3, f0); // mfc1 t3, f0 + c->daddu(t4, t2, a1); // daddu t4, t2, a1 + c->sb(t3, 3, t4); // sb t3, 3(t4) + c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 + +block_4: + c->slti(t3, t2, 3); // slti t3, t2, 3 + bc = c->sgpr64(t3) != 0; // bne t3, r0, L4 + // nop // sll r0, r0, 0 + if (bc) {goto block_3;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->mov64(v1, s7); // or v1, s7, r0 + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lwu(v1, 0, a0); // lwu v1, 0(a0) + c->daddiu(v1, v1, 12); // daddiu v1, v1, 12 + c->sw(v1, 16, sp); // sw v1, 16(sp) + c->sw(a0, 20, sp); // sw a0, 20(sp) + c->sw(a2, 24, sp); // sw a2, 24(sp) + c->sd(a3, 32, sp); // sd a3, 32(sp) + c->lwu(a0, 20, sp); // lwu a0, 20(sp) + c->lwu(v1, -4, a0); // lwu v1, -4(a0) + c->lwu(t9, 96, v1); // lwu t9, 96(v1) + c->lwu(v1, 20, sp); // lwu v1, 20(sp) + c->daddiu(a1, v1, 4); // daddiu a1, v1, 4 + c->lwu(a2, 16, sp); // lwu a2, 16(sp) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + c->sd(r0, 40, sp); // sd r0, 40(sp) + c->lwu(v1, 20, sp); // lwu v1, 20(sp) + c->lh(v1, 10, v1); // lh v1, 10(v1) + c->lwu(a0, 16, sp); // lwu a0, 16(sp) + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + +block_6: + c->dsll(a2, a1, 3); // dsll a2, a1, 3 + c->lbu(a3, 0, a0); // lbu a3, 0(a0) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L15 + // nop // sll r0, r0, 0 + if (bc) {goto block_34;} // branch non-likely + + +block_7: + c->andi(t0, a3, 1); // andi t0, a3, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L14 + // nop // sll r0, r0, 0 + if (bc) {goto block_33;} // branch non-likely + + c->lwu(t0, 20, sp); // lwu t0, 20(sp) + c->lwu(t0, 84, t0); // lwu t0, 84(t0) + c->dsll(t1, a2, 4); // dsll t1, a2, 4 + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->lwc1(f0, 0, t0); // lwc1 f0, 0(t0) + c->lwc1(f1, 12, t0); // lwc1 f1, 12(t0) + c->adds(f0, f0, f1); // add.s f0, f0, f1 + c->lwc1(f1, 0, gp); // lwc1 f1, 0(gp) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L8 + c->daddiu(t1, s7, 4); // daddiu t1, s7, 4 + if (bc) {goto block_10;} // branch non-likely + + c->mov64(t1, s7); // or t1, s7, r0 + +block_10: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(t1))) {// beql s7, t1, L13 + c->mov64(t0, t1); // or t0, t1, r0 + goto block_30; + } + +// block_12: + c->lwc1(f0, 16, gp); // lwc1 f0, 16(gp) + c->lwc1(f1, 0, t0); // lwc1 f1, 0(t0) + c->lwc1(f2, 12, t0); // lwc1 f2, 12(t0) + c->subs(f1, f1, f2); // sub.s f1, f1, f2 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L9 + c->daddiu(t1, s7, 4); // daddiu t1, s7, 4 + if (bc) {goto block_14;} // branch non-likely + + c->mov64(t1, s7); // or t1, s7, r0 + +block_14: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(t1))) {// beql s7, t1, L13 + c->mov64(t0, t1); // or t0, t1, r0 + goto block_30; + } + +// block_16: + c->lwc1(f0, 4, t0); // lwc1 f0, 4(t0) + c->lwc1(f1, 12, t0); // lwc1 f1, 12(t0) + c->adds(f0, f0, f1); // add.s f0, f0, f1 + c->lwc1(f1, 4, gp); // lwc1 f1, 4(gp) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L10 + c->daddiu(t1, s7, 4); // daddiu t1, s7, 4 + if (bc) {goto block_18;} // branch non-likely + + c->mov64(t1, s7); // or t1, s7, r0 + +block_18: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(t1))) {// beql s7, t1, L13 + c->mov64(t0, t1); // or t0, t1, r0 + goto block_30; + } + +// block_20: + c->lwc1(f0, 20, gp); // lwc1 f0, 20(gp) + c->lwc1(f1, 4, t0); // lwc1 f1, 4(t0) + c->lwc1(f2, 12, t0); // lwc1 f2, 12(t0) + c->subs(f1, f1, f2); // sub.s f1, f1, f2 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L11 + c->daddiu(t1, s7, 4); // daddiu t1, s7, 4 + if (bc) {goto block_22;} // branch non-likely + + c->mov64(t1, s7); // or t1, s7, r0 + +block_22: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(t1))) {// beql s7, t1, L13 + c->mov64(t0, t1); // or t0, t1, r0 + goto block_30; + } + +// block_24: + c->lwc1(f0, 8, t0); // lwc1 f0, 8(t0) + c->lwc1(f1, 12, t0); // lwc1 f1, 12(t0) + c->adds(f0, f0, f1); // add.s f0, f0, f1 + c->lwc1(f1, 8, gp); // lwc1 f1, 8(gp) + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L12 + c->daddiu(t1, s7, 4); // daddiu t1, s7, 4 + if (bc) {goto block_26;} // branch non-likely + + c->mov64(t1, s7); // or t1, s7, r0 + +block_26: + if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(t1))) {// beql s7, t1, L13 + c->mov64(t0, t1); // or t0, t1, r0 + goto block_30; + } + +// block_28: + c->lwc1(f0, 24, gp); // lwc1 f0, 24(gp) + c->lwc1(f1, 8, t0); // lwc1 f1, 8(t0) + c->lwc1(f2, 12, t0); // lwc1 f2, 12(t0) + c->subs(f1, f1, f2); // sub.s f1, f1, f2 + cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1 + bc = !cop1_bc; // bc1f L13 + c->daddiu(t0, s7, 4); // daddiu t0, s7, 4 + if (bc) {goto block_30;} // branch non-likely + + c->mov64(t0, s7); // or t0, s7, r0 + +block_30: + bc = c->sgpr64(s7) == c->sgpr64(t0); // beq s7, t0, L14 + c->mov64(t0, s7); // or t0, s7, r0 + if (bc) {goto block_33;} // branch non-likely + + c->ld(t0, 40, sp); // ld t0, 40(sp) + c->ld(t1, 32, sp); // ld t1, 32(sp) + c->slt(t0, t0, t1); // slt t0, t0, t1 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L14 + c->mov64(t0, s7); // or t0, s7, r0 + if (bc) {goto block_33;} // branch non-likely + + c->dsll(t0, a2, 4); // dsll t0, a2, 4 + c->lwu(t1, 20, sp); // lwu t1, 20(sp) + c->lwu(t1, 100, t1); // lwu t1, 100(t1) + c->daddu(t0, t0, t1); // daddu t0, t0, t1 + c->lwu(t0, 0, t0); // lwu t0, 0(t0) + c->lwu(t1, 24, sp); // lwu t1, 24(sp) + c->ld(t2, 40, sp); // ld t2, 40(sp) + c->dsll(t2, t2, 2); // dsll t2, t2, 2 + c->daddu(t1, t1, t2); // daddu t1, t1, t2 + c->sw(t0, 0, t1); // sw t0, 0(t1) + c->ld(t0, 40, sp); // ld t0, 40(sp) + c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 + c->sd(t0, 40, sp); // sd t0, 40(sp) + +block_33: + c->dsra(a3, a3, 1); // dsra a3, a3, 1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L7 + c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 + if (bc) {goto block_7;} // branch non-likely + + +block_34: + c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 + c->daddiu(a0, a0, 1); // daddiu a0, a0, 1 + c->slt(a2, a1, v1); // slt a2, a1, v1 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L6 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + c->load_symbol2(v1, cache.perf_stats); // lw v1, *perf-stats*(s7) + c->daddiu(v1, v1, 116); // daddiu v1, v1, 116 + c->lwu(a0, 28, v1); // lwu a0, 28(v1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L16 + // nop // sll r0, r0, 0 + if (bc) {goto block_37;} // branch non-likely + + // Unknown instr: mtc0 Perf, r0 + // Unknown instr: sync.l + // Unknown instr: sync.p + // Unknown instr: mfpc a0, pcr0 + c->lwu(a1, 32, v1); // lwu a1, 32(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 32, v1); // sw a0, 32(v1) + // Unknown instr: mfpc a0, pcr1 + c->lwu(a1, 36, v1); // lwu a1, 36(v1) + c->daddu(a0, a1, a0); // daddu a0, a1, a0 + c->sw(a0, 36, v1); // sw a0, 36(v1) + +block_37: + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->ld(v0, 40, sp); // ld v0, 40(sp) + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 48, sp); // lq gp, 48(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 64); // daddiu sp, sp, 64 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.perf_stats = intern_from_c(-1, 0, "*perf-stats*").c(); + gLinkedFunctionTable.reg("(method 34 spatial-hash)", execute, 128); +} + +} // namespace method_34_spatial_hash +} // namespace Mips2C \ No newline at end of file diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index 11849b3e18..dd6da855d9 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -291,7 +291,50 @@ namespace foreground_merc { extern void link(); } namespace foreground_generic_merc { extern void link(); } namespace live_func_curve { extern void link(); } namespace birth_func_curve { extern void link(); } - +namespace method_11_collide_hash { extern void link(); } +namespace method_12_collide_hash { extern void link(); } +namespace fill_bg_using_box_new { extern void link(); } +namespace fill_bg_using_line_sphere_new { extern void link(); } +namespace method_12_collide_mesh { extern void link(); } +namespace method_14_collide_mesh { extern void link(); } +namespace method_15_collide_mesh { extern void link(); } +namespace method_10_collide_shape_prim_mesh { extern void link(); } +namespace method_10_collide_shape_prim_sphere { extern void link(); } +namespace method_10_collide_shape_prim_group { extern void link(); } +namespace method_11_collide_shape_prim_mesh { extern void link(); } +namespace method_11_collide_shape_prim_sphere { extern void link(); } +namespace method_11_collide_shape_prim_group { extern void link(); } +namespace method_9_collide_cache_prim { extern void link(); } +namespace method_10_collide_cache_prim { extern void link(); } +namespace method_17_collide_cache { extern void link(); } +namespace method_9_collide_puss_work { extern void link(); } +namespace method_10_collide_puss_work { extern void link(); } +namespace method_10_collide_edge_hold_list { extern void link(); } +namespace method_19_collide_edge_work { extern void link(); } +namespace method_9_edge_grab_info { extern void link(); } +namespace method_17_collide_edge_work { extern void link(); } +namespace method_16_collide_edge_work { extern void link(); } +namespace method_18_collide_edge_work { extern void link(); } +namespace method_18_grid_hash { extern void link(); } +namespace method_19_grid_hash { extern void link(); } +namespace method_20_grid_hash { extern void link(); } +namespace method_22_grid_hash { extern void link(); } +namespace method_28_sphere_hash { extern void link(); } +namespace method_32_sphere_hash { extern void link(); } +namespace method_29_sphere_hash { extern void link(); } +namespace method_30_sphere_hash { extern void link(); } +namespace method_31_sphere_hash { extern void link(); } +namespace method_32_spatial_hash { extern void link(); } +namespace method_38_spatial_hash { extern void link(); } +namespace method_35_spatial_hash { extern void link(); } +namespace method_36_spatial_hash { extern void link(); } +namespace method_34_spatial_hash { extern void link(); } +namespace sparticle_motion_blur { extern void link(); } +namespace sp_launch_particles_var { extern void link(); } +namespace particle_adgif { extern void link(); } +namespace sp_init_fields { extern void link(); } +namespace sp_process_block_2d { extern void link(); } +namespace sp_process_block_3d { extern void link(); } } // clang-format on @@ -488,6 +531,37 @@ PerGameVersion>> gMips2C {jak3::foreground_check_longest_edge_asm::link, jak3::foreground_generic_merc::link, jak3::foreground_merc::link}}, {"particle-curves", {jak3::live_func_curve::link, jak3::birth_func_curve::link}}, + {"collide-hash", + {jak3::method_11_collide_hash::link, jak3::method_12_collide_hash::link, + jak3::fill_bg_using_box_new::link, jak3::fill_bg_using_line_sphere_new::link}}, + {"collide-mesh", + {jak3::method_12_collide_mesh::link, jak3::method_14_collide_mesh::link, + jak3::method_15_collide_mesh::link, jak3::method_10_collide_shape_prim_mesh::link}}, + {"collide-cache", + {jak3::method_10_collide_shape_prim_mesh::link, + jak3::method_10_collide_shape_prim_sphere::link, + jak3::method_10_collide_shape_prim_group::link, + jak3::method_11_collide_shape_prim_mesh::link, + jak3::method_11_collide_shape_prim_sphere::link, + jak3::method_11_collide_shape_prim_group::link, jak3::method_9_collide_cache_prim::link, + jak3::method_10_collide_cache_prim::link, jak3::method_17_collide_cache::link, + jak3::method_9_collide_puss_work::link, jak3::method_10_collide_puss_work::link}}, + {"collide-edge-grab", + {jak3::method_10_collide_edge_hold_list::link, jak3::method_19_collide_edge_work::link, + jak3::method_9_edge_grab_info::link, jak3::method_17_collide_edge_work::link, + jak3::method_16_collide_edge_work::link, jak3::method_18_collide_edge_work::link}}, + {"spatial-hash", + {jak3::method_18_grid_hash::link, jak3::method_19_grid_hash::link, + jak3::method_20_grid_hash::link, jak3::method_22_grid_hash::link, + jak3::method_28_sphere_hash::link, jak3::method_32_sphere_hash::link, + jak3::method_29_sphere_hash::link, jak3::method_30_sphere_hash::link, + jak3::method_31_sphere_hash::link, jak3::method_32_spatial_hash::link, + jak3::method_38_spatial_hash::link, jak3::method_35_spatial_hash::link, + jak3::method_36_spatial_hash::link, jak3::method_34_spatial_hash::link}}, + {"sparticle-launcher", + {jak3::sparticle_motion_blur::link, jak3::sp_launch_particles_var::link, + jak3::particle_adgif::link, jak3::sp_init_fields::link}}, + {"sparticle", {jak3::sp_process_block_2d::link, jak3::sp_process_block_3d::link}}, }}; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { diff --git a/game/overlord/jak1/iso.cpp b/game/overlord/jak1/iso.cpp index 38a7ed82cd..aa706e63b5 100644 --- a/game/overlord/jak1/iso.cpp +++ b/game/overlord/jak1/iso.cpp @@ -73,6 +73,7 @@ s32 iso_thread; s32 dgo_thread; s32 str_thread; s32 play_thread; +constexpr int kRpcBuffSize = sizeof(RPC_Dgo_Cmd); static RPC_Dgo_Cmd sRPCBuff[1]; DgoCommand sLoadDGO; // renamed from scmd to sLoadDGO in Jak 2 @@ -281,7 +282,8 @@ u32 DGOThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, kRpcBuffSize, nullptr, + nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/jak1/ramdisk.cpp b/game/overlord/jak1/ramdisk.cpp index b98cdcbb21..f29805840b 100644 --- a/game/overlord/jak1/ramdisk.cpp +++ b/game/overlord/jak1/ramdisk.cpp @@ -34,7 +34,8 @@ u32 gMemSize; // Total memory of RAMDISK u32 gMemFreeAtStart; // Memory free after allocation of RAMDISK uint8_t* gMem; // Allocation for RAMDISK uint8_t* gRamdiskRAM; // Also allocation for RAMDISK -uint8_t gRPCBuf[40]; // Buffer for RAMDISK RPC handler +constexpr int kRamdiskBufferSize = 40; +uint8_t gRPCBuf[kRamdiskBufferSize]; // Buffer for RAMDISK RPC handler // Each file stored in the ramdisk has a file record: struct RamdiskFileRecord { @@ -100,8 +101,8 @@ u32 Thread_Server() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, RAMDISK_RPC_ID[g_game_version], RPC_Ramdisk, gRPCBuf, nullptr, nullptr, - &dq); + sceSifRegisterRpc(&serve, RAMDISK_RPC_ID[g_game_version], RPC_Ramdisk, gRPCBuf, + kRamdiskBufferSize, nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/jak1/srpc.cpp b/game/overlord/jak1/srpc.cpp index 407c71b80f..a52bc63cc7 100644 --- a/game/overlord/jak1/srpc.cpp +++ b/game/overlord/jak1/srpc.cpp @@ -31,8 +31,9 @@ using namespace iop; namespace jak1 { constexpr int SRPC_MESSAGE_SIZE = 0x50; +constexpr int SRPC_MESSAGE_COUNT = 128; static uint8_t gLoaderBuf[SRPC_MESSAGE_SIZE]; -static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * 128]; +static uint8_t gPlayerBuf[SRPC_MESSAGE_SIZE * SRPC_MESSAGE_COUNT]; static u32 gInfoEE = 0; // EE address where we should send info on each frame. s16 gFlava; u32 gFreeMem = 0; @@ -62,8 +63,8 @@ u32 Thread_Player() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, nullptr, nullptr, - &dq); + sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, + SRPC_MESSAGE_SIZE * SRPC_MESSAGE_COUNT, nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -79,8 +80,8 @@ u32 Thread_Loader() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, nullptr, nullptr, - &dq); + sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, + SRPC_MESSAGE_SIZE, nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/jak1/stream.cpp b/game/overlord/jak1/stream.cpp index 11f45b7bef..3a47c0957c 100644 --- a/game/overlord/jak1/stream.cpp +++ b/game/overlord/jak1/stream.cpp @@ -24,7 +24,9 @@ using namespace iop; namespace jak1 { +constexpr int kStrBufSize = sizeof(RPC_Str_Cmd_Jak1); static RPC_Str_Cmd_Jak1 sSTRBuf; +constexpr int kPlayBufSize = 2 * sizeof(RPC_Play_Cmd_Jak1); static RPC_Play_Cmd_Jak1 sPLAYBuf[2]; void* RPC_STR(unsigned int fno, void* _cmd, int y); @@ -66,7 +68,8 @@ u32 STRThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, kStrBufSize, nullptr, + nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -79,7 +82,8 @@ u32 PLAYThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, kPlayBufSize, nullptr, + nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/jak2/iso.cpp b/game/overlord/jak2/iso.cpp index 56b74f495c..127f246fce 100644 --- a/game/overlord/jak2/iso.cpp +++ b/game/overlord/jak2/iso.cpp @@ -49,6 +49,7 @@ int ext_resume = 0; CmdDgo sLoadDgo; // renamed from scmd to sLoadDGO in Jak 2 static RPC_Dgo_Cmd sRPCBuff[1]; +constexpr int kRpcBuffSize = sizeof(RPC_Dgo_Cmd); VagDir gVagDir; /// The main buffer used for reading data and doing blzo decompression. @@ -1097,7 +1098,8 @@ u32 DGOThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, DGO_RPC_ID[g_game_version], RPC_DGO, sRPCBuff, kRpcBuffSize, nullptr, + nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/jak2/srpc.cpp b/game/overlord/jak2/srpc.cpp index 188b1a9948..1dd4b180a5 100644 --- a/game/overlord/jak2/srpc.cpp +++ b/game/overlord/jak2/srpc.cpp @@ -24,8 +24,10 @@ static const char* languages[] = {"ENG", "FRE", "GER", "SPA", "ITA", "JAP", "KOR static u32 gInfoEE = 0; static u32 IopTicks = 0; static SoundIopInfo info; -static uint8_t gPlayerBuf[0x50 * 128]; -static uint8_t gLoaderBuf[0x50]; +constexpr int kPlayerBufSize = 0x50 * 128; +static uint8_t gPlayerBuf[kPlayerBufSize]; +constexpr int kLoaderBufSize = 0x50; +static uint8_t gLoaderBuf[kLoaderBufSize]; void srpc_init_globals() {} @@ -575,8 +577,8 @@ u32 Thread_Player() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, nullptr, nullptr, - &dq); + sceSifRegisterRpc(&serve, PLAYER_RPC_ID[g_game_version], RPC_Player, gPlayerBuf, kPlayerBufSize, + nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; @@ -590,8 +592,8 @@ u32 Thread_Loader() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, nullptr, nullptr, - &dq); + sceSifRegisterRpc(&serve, LOADER_RPC_ID[g_game_version], RPC_Loader, gLoaderBuf, kLoaderBufSize, + nullptr, nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/overlord/jak2/stream.cpp b/game/overlord/jak2/stream.cpp index e2c48453be..e702263cf0 100644 --- a/game/overlord/jak2/stream.cpp +++ b/game/overlord/jak2/stream.cpp @@ -19,8 +19,12 @@ using namespace iop; namespace jak2 { +constexpr int kStrBufSize = sizeof(RPC_Str_Cmd_Jak2); static RPC_Str_Cmd_Jak2 sSTRBuf; -static RPC_Play_Cmd_Jak2 sPLAYBuf[2]; // called sRPCBuf2 +// the size has been increased to 4 to fit jak3. This is a total hack, since the structures +// are probably just completely different. +constexpr int kPlayBufSize = 4 * sizeof(RPC_Play_Cmd_Jak2); +static RPC_Play_Cmd_Jak2 sPLAYBuf[4]; // called sRPCBuf2 struct CacheEntry { FileRecord* fr = nullptr; @@ -337,7 +341,8 @@ u32 STRThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, STR_RPC_ID[g_game_version], RPC_STR, &sSTRBuf, kStrBufSize, nullptr, + nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); @@ -351,7 +356,8 @@ u32 PLAYThread() { CpuDisableIntr(); sceSifInitRpc(0); sceSifSetRpcQueue(&dq, GetThreadId()); - sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, nullptr, nullptr, &dq); + sceSifRegisterRpc(&serve, PLAY_RPC_ID[g_game_version], RPC_PLAY, sPLAYBuf, kPlayBufSize, nullptr, + nullptr, &dq); CpuEnableIntr(); sceSifRpcLoop(&dq); return 0; diff --git a/game/sce/iop.cpp b/game/sce/iop.cpp index fff38a8f14..2784c9fa42 100644 --- a/game/sce/iop.cpp +++ b/game/sce/iop.cpp @@ -133,12 +133,14 @@ void sceSifRegisterRpc(sceSifServeData* serve, unsigned int request, sceSifRpcFunc func, void* buff, + int buff_size, sceSifRpcFunc cfunc, void* cbuff, sceSifQueueData* qd) { serve->command = request; serve->func = func; serve->buff = buff; + serve->buff_size = buff_size; (void)cfunc; (void)cbuff; ASSERT(!cfunc); diff --git a/game/sce/iop.h b/game/sce/iop.h index 165e8f7074..50a06088c1 100644 --- a/game/sce/iop.h +++ b/game/sce/iop.h @@ -39,6 +39,8 @@ struct sceSifServeData { unsigned int command; // the RPC ID sceSifRpcFunc func; void* buff; + // added + int buff_size = 0; }; struct sceSifQueueData { @@ -116,6 +118,7 @@ void sceSifRegisterRpc(sceSifServeData* serve, unsigned int request, sceSifRpcFunc func, void* buff, + int buff_size, sceSifRpcFunc cfunc, void* cbuff, sceSifQueueData* qd); diff --git a/game/system/IOP_Kernel.cpp b/game/system/IOP_Kernel.cpp index 171956af25..10ce6e88fa 100644 --- a/game/system/IOP_Kernel.cpp +++ b/game/system/IOP_Kernel.cpp @@ -2,6 +2,7 @@ #include +#include "common/log/log.h" #include "common/util/Assert.h" #include "common/util/FileUtil.h" @@ -337,6 +338,11 @@ void IOP_Kernel::sif_rpc(s32 rpcChannel, ASSERT(rec->cmd.finished && rec->cmd.started); // step 3 - memcpy! + if (rec->qd->serve_data->buff_size < sendSize) { + lg::die( + "Buffer overflow in EE -> IOP RPC. channel {}, fno {}, requested size {}, buffer size {}\n", + rpcChannel, fno, sendSize, rec->qd->serve_data->buff_size); + } memcpy(rec->qd->serve_data->buff, sendBuff, sendSize); // step 4 - setup command diff --git a/goal_src/jak3/dgos/arenacst.gd b/goal_src/jak3/dgos/arenacst.gd index 378a7a260b..c43b3b8818 100644 --- a/goal_src/jak3/dgos/arenacst.gd +++ b/goal_src/jak3/dgos/arenacst.gd @@ -1,5 +1,5 @@ ("ARENACST.DGO" - ("tpage-1484.o" + ("tpage-1484.go" "tpage-1245.go" "tpage-1248.go" "tpage-1246.go" @@ -14,5 +14,5 @@ "blue-gun-mod-one-ag.go" "wstd-gate-pass-ag.go" "yellow-barrel-ag.go" - "arenacst.o" + "arenacst.go" )) diff --git a/goal_src/jak3/dgos/cfa.gd b/goal_src/jak3/dgos/cfa.gd index 0e8b94aaac..d3bb3e4773 100644 --- a/goal_src/jak3/dgos/cfa.gd +++ b/goal_src/jak3/dgos/cfa.gd @@ -17,5 +17,5 @@ "farm-beetree-ag.go" "farm-small-cabbage-ag.go" "farm-sprinkler-barrels-ag.go" - "ctyfarma-vis.o" + "ctyfarma-vis.go" )) diff --git a/goal_src/jak3/dgos/cfb.gd b/goal_src/jak3/dgos/cfb.gd index 6e78b96ccb..281b70bde4 100644 --- a/goal_src/jak3/dgos/cfb.gd +++ b/goal_src/jak3/dgos/cfb.gd @@ -16,5 +16,5 @@ "farm-beetree-ag.go" "farm-small-cabbage-ag.go" "farm-sprinkler-barrels-ag.go" - "ctyfarmb-vis.o" + "ctyfarmb-vis.go" )) diff --git a/goal_src/jak3/dgos/cgb.gd b/goal_src/jak3/dgos/cgb.gd index f7e305663b..896516f5c7 100644 --- a/goal_src/jak3/dgos/cgb.gd +++ b/goal_src/jak3/dgos/cgb.gd @@ -10,5 +10,5 @@ "city-flitter-ag.go" "com-airlock-outer-ag.go" "battle-amulet-ag.go" - "ctygenb-vis.o" + "ctygenb-vis.go" )) diff --git a/goal_src/jak3/dgos/cia.gd b/goal_src/jak3/dgos/cia.gd index f3609aeed2..d3bb64fcc5 100644 --- a/goal_src/jak3/dgos/cia.gd +++ b/goal_src/jak3/dgos/cia.gd @@ -11,5 +11,5 @@ "com-airlock-outer-ag.go" "ctyinda-evil-streetlamp-ag.go" "vin-door-ctyinda-ag.go" - "ctyinda-vis.o" + "ctyinda-vis.go" )) diff --git a/goal_src/jak3/dgos/cib.gd b/goal_src/jak3/dgos/cib.gd index 164e9f7cb7..009a145feb 100644 --- a/goal_src/jak3/dgos/cib.gd +++ b/goal_src/jak3/dgos/cib.gd @@ -7,5 +7,5 @@ "tpage-184.go" "tpage-181.go" "krimson-wall-ag.go" - "ctyindb-vis.o" + "ctyindb-vis.go" )) diff --git a/goal_src/jak3/dgos/citycast.gd b/goal_src/jak3/dgos/citycast.gd index 4f74df1680..dece3548ce 100644 --- a/goal_src/jak3/dgos/citycast.gd +++ b/goal_src/jak3/dgos/citycast.gd @@ -1,10 +1,10 @@ ("CITYCAST.DGO" - ("tpage-2094.o" + ("tpage-2094.go" "tpage-2095.go" "daxter-highres-ag.go" "jakc-highres-ag.go" "torn-highres-ag.go" "palmpilot-b-ag.go" "particleman-ag.go" - "citycast.o" + "citycast.go" )) diff --git a/goal_src/jak3/dgos/comba.gd b/goal_src/jak3/dgos/comba.gd index 782a11a9f5..45563db6c4 100644 --- a/goal_src/jak3/dgos/comba.gd +++ b/goal_src/jak3/dgos/comba.gd @@ -46,5 +46,5 @@ "kidmedallion-ag.go" "particleman-ag.go" "security-wall-ag.go" - "comba.o" + "comba.go" )) diff --git a/goal_src/jak3/dgos/combb.gd b/goal_src/jak3/dgos/combb.gd index 0d6b9f781b..a70197c685 100644 --- a/goal_src/jak3/dgos/combb.gd +++ b/goal_src/jak3/dgos/combb.gd @@ -1,4 +1,4 @@ ("COMBB.DGO" - ("tpage-2189.o" - "combb.o" + ("tpage-2189.go" + "combb.go" )) diff --git a/goal_src/jak3/dgos/combc.gd b/goal_src/jak3/dgos/combc.gd index e953bda6a9..205f559c69 100644 --- a/goal_src/jak3/dgos/combc.gd +++ b/goal_src/jak3/dgos/combc.gd @@ -1,4 +1,4 @@ ("COMBC.DGO" - ("tpage-2191.o" - "combc.o" + ("tpage-2191.go" + "combc.go" )) diff --git a/goal_src/jak3/dgos/combd.gd b/goal_src/jak3/dgos/combd.gd index 3d9ad1965a..830dc7958b 100644 --- a/goal_src/jak3/dgos/combd.gd +++ b/goal_src/jak3/dgos/combd.gd @@ -1,4 +1,4 @@ ("COMBD.DGO" - ("tpage-2199.o" - "combd.o" + ("tpage-2199.go" + "combd.go" )) diff --git a/goal_src/jak3/dgos/combe.gd b/goal_src/jak3/dgos/combe.gd index 9ad20b7a74..45951a7e4f 100644 --- a/goal_src/jak3/dgos/combe.gd +++ b/goal_src/jak3/dgos/combe.gd @@ -1,4 +1,4 @@ ("COMBE.DGO" - ("tpage-2599.o" - "combe.o" + ("tpage-2599.go" + "combe.go" )) diff --git a/goal_src/jak3/dgos/combn.gd b/goal_src/jak3/dgos/combn.gd index df14680119..1223cce53f 100644 --- a/goal_src/jak3/dgos/combn.gd +++ b/goal_src/jak3/dgos/combn.gd @@ -1,7 +1,7 @@ ("COMBN.DGO" - ("tpage-2210.o" + ("tpage-2210.go" "tpage-2595.go" "tpage-2211.go" "min-elevator-ag.go" - "combn.o" + "combn.go" )) diff --git a/goal_src/jak3/dgos/combx.gd b/goal_src/jak3/dgos/combx.gd index 1f70ade938..31fe1f5f9f 100644 --- a/goal_src/jak3/dgos/combx.gd +++ b/goal_src/jak3/dgos/combx.gd @@ -9,5 +9,5 @@ "pecker-ingame-ag.go" "jakc-highres-ag.go" "tpl-elevator-ag.go" - "combx.o" + "combx.go" )) diff --git a/goal_src/jak3/dgos/cpo.gd b/goal_src/jak3/dgos/cpo.gd index 347a21b27c..806c725746 100644 --- a/goal_src/jak3/dgos/cpo.gd +++ b/goal_src/jak3/dgos/cpo.gd @@ -12,5 +12,5 @@ "mecha-daxter-ag.go" "air-train-ag.go" "hip-door-a-ag.go" - "ctyport-vis.o" + "ctyport-vis.go" )) diff --git a/goal_src/jak3/dgos/cta.gd b/goal_src/jak3/dgos/cta.gd index 46b6727a5a..73fce5d419 100644 --- a/goal_src/jak3/dgos/cta.gd +++ b/goal_src/jak3/dgos/cta.gd @@ -7,5 +7,5 @@ "tpage-133.go" "tpage-131.go" "des-burning-bush-ag.go" - "ctysluma-vis.o" + "ctysluma-vis.go" )) diff --git a/goal_src/jak3/dgos/ctb.gd b/goal_src/jak3/dgos/ctb.gd index b8c0026f2d..647c09d6b2 100644 --- a/goal_src/jak3/dgos/ctb.gd +++ b/goal_src/jak3/dgos/ctb.gd @@ -6,5 +6,5 @@ "tpage-162.go" "tpage-159.go" "cty-door-ag.go" - "ctyslumb-vis.o" + "ctyslumb-vis.go" )) diff --git a/goal_src/jak3/dgos/ctc.gd b/goal_src/jak3/dgos/ctc.gd index 90abcd95fa..ded5951b26 100644 --- a/goal_src/jak3/dgos/ctc.gd +++ b/goal_src/jak3/dgos/ctc.gd @@ -9,5 +9,5 @@ "cty-door-ag.go" "cty-elevator-ag.go" "ctyslumc-flag-ag.go" - "ctyslumc-vis.o" + "ctyslumc-vis.go" )) diff --git a/goal_src/jak3/dgos/ctycara.gd b/goal_src/jak3/dgos/ctycara.gd index 7772a39e3f..333ed566c9 100644 --- a/goal_src/jak3/dgos/ctycara.gd +++ b/goal_src/jak3/dgos/ctycara.gd @@ -1,7 +1,7 @@ ("CTYCARA.DGO" - ("tpage-948.o" + ("tpage-948.go" "carc-ag.go" "cara-ag.go" "carb-ag.go" - "ctycara.o" + "ctycara.go" )) diff --git a/goal_src/jak3/dgos/ctycarb.gd b/goal_src/jak3/dgos/ctycarb.gd index fc0632bc7d..3a6875a006 100644 --- a/goal_src/jak3/dgos/ctycarb.gd +++ b/goal_src/jak3/dgos/ctycarb.gd @@ -1,7 +1,7 @@ ("CTYCARB.DGO" - ("tpage-949.o" + ("tpage-949.go" "bikec-ag.go" "bikeb-ag.go" "bikea-ag.go" - "ctycarb.o" + "ctycarb.go" )) diff --git a/goal_src/jak3/dgos/ctycarc.gd b/goal_src/jak3/dgos/ctycarc.gd index b5756cd5bc..6f0a0bd78c 100644 --- a/goal_src/jak3/dgos/ctycarc.gd +++ b/goal_src/jak3/dgos/ctycarc.gd @@ -1,6 +1,6 @@ ("CTYCARC.DGO" - ("tpage-950.o" + ("tpage-950.go" "tpage-951.go" "hellcat-ag.go" - "ctycarc.o" + "ctycarc.go" )) diff --git a/goal_src/jak3/dgos/ctycarkg.gd b/goal_src/jak3/dgos/ctycarkg.gd index 2517f79724..be2215e69d 100644 --- a/goal_src/jak3/dgos/ctycarkg.gd +++ b/goal_src/jak3/dgos/ctycarkg.gd @@ -1,3 +1,3 @@ ("CTYCARKG.DGO" - ("ctycarkg.o" + ("ctycarkg.go" )) diff --git a/goal_src/jak3/dgos/ctypepa.gd b/goal_src/jak3/dgos/ctypepa.gd index f5225a9784..813b473134 100644 --- a/goal_src/jak3/dgos/ctypepa.gd +++ b/goal_src/jak3/dgos/ctypepa.gd @@ -1,7 +1,7 @@ ("CTYPEPA.DGO" - ("tpage-956.o" + ("tpage-956.go" "citizen-fat-ag.go" "citizen-norm-ag.go" "citizen-chick-ag.go" - "ctypepa.o" + "ctypepa.go" )) diff --git a/goal_src/jak3/dgos/ctypepb.gd b/goal_src/jak3/dgos/ctypepb.gd index 95f037e451..31c988b01f 100644 --- a/goal_src/jak3/dgos/ctypepb.gd +++ b/goal_src/jak3/dgos/ctypepb.gd @@ -1,5 +1,5 @@ ("CTYPEPB.DGO" - ("tpage-958.o" + ("tpage-958.go" "predator-ag.go" - "ctypepb.o" + "ctypepb.go" )) diff --git a/goal_src/jak3/dgos/ctypepc.gd b/goal_src/jak3/dgos/ctypepc.gd index cdf86f6cad..a1576a14e8 100644 --- a/goal_src/jak3/dgos/ctypepc.gd +++ b/goal_src/jak3/dgos/ctypepc.gd @@ -1,3 +1,3 @@ ("CTYPEPC.DGO" - ("ctypepc.o" + ("ctypepc.go" )) diff --git a/goal_src/jak3/dgos/ctypesa.gd b/goal_src/jak3/dgos/ctypesa.gd index 16c50131ee..bab2deb105 100644 --- a/goal_src/jak3/dgos/ctypesa.gd +++ b/goal_src/jak3/dgos/ctypesa.gd @@ -1,8 +1,8 @@ ("CTYPESA.DGO" - ("tpage-957.o" + ("tpage-957.go" "crimson-guard-ag.go" "shield-sphere-explode-ag.go" "shield-sphere-distort-ag.go" "shield-sphere-ag.go" - "ctypesa.o" + "ctypesa.go" )) diff --git a/goal_src/jak3/dgos/ctypesb.gd b/goal_src/jak3/dgos/ctypesb.gd index 71c1cf2782..bc3de4373a 100644 --- a/goal_src/jak3/dgos/ctypesb.gd +++ b/goal_src/jak3/dgos/ctypesb.gd @@ -4,5 +4,5 @@ "tpage-1758.go" "city-grunt-ag.go" "city-flitter-ag.go" - "ctypesb.o" + "ctypesb.go" )) diff --git a/goal_src/jak3/dgos/ctypesc.gd b/goal_src/jak3/dgos/ctypesc.gd index 702a9d4e56..73fc49e536 100644 --- a/goal_src/jak3/dgos/ctypesc.gd +++ b/goal_src/jak3/dgos/ctypesc.gd @@ -7,5 +7,5 @@ "spydroid-ag.go" "kg-flying-turret-ag.go" "kg-debris-ag.go" - "ctypesc.o" + "ctypesc.go" )) diff --git a/goal_src/jak3/dgos/cwi.gd b/goal_src/jak3/dgos/cwi.gd index e62cb7d361..10c97fd124 100644 --- a/goal_src/jak3/dgos/cwi.gd +++ b/goal_src/jak3/dgos/cwi.gd @@ -101,5 +101,5 @@ "searchlight-ag.go" "burning-bush-ag.go" "security-wall-ag.go" - "ctywide-vis.o" + "ctywide-vis.go" )) diff --git a/goal_src/jak3/dgos/desa.gd b/goal_src/jak3/dgos/desa.gd index 5f2730878c..71c6ae43f0 100644 --- a/goal_src/jak3/dgos/desa.gd +++ b/goal_src/jak3/dgos/desa.gd @@ -1,7 +1,7 @@ ("DESA.DGO" - ("tpage-1372.o" + ("tpage-1372.go" "tpage-3309.go" "tpage-1579.go" "jakc-scarf-ag.go" - "deserta-vis.o" + "deserta-vis.go" )) diff --git a/goal_src/jak3/dgos/desb.gd b/goal_src/jak3/dgos/desb.gd index 3d1208a929..75e7fd4e66 100644 --- a/goal_src/jak3/dgos/desb.gd +++ b/goal_src/jak3/dgos/desb.gd @@ -1,8 +1,8 @@ ("DESB.DGO" - ("tpage-1377.o" + ("tpage-1377.go" "tpage-1378.go" "tpage-1379.go" "wascity-airlock-ag.go" "air-train-ag.go" - "desertb-vis.o" + "desertb-vis.go" )) diff --git a/goal_src/jak3/dgos/desbattl.gd b/goal_src/jak3/dgos/desbattl.gd index 4124c194d4..328073feaa 100644 --- a/goal_src/jak3/dgos/desbattl.gd +++ b/goal_src/jak3/dgos/desbattl.gd @@ -17,5 +17,5 @@ "scorpion-gun-ag.go" "quantum-reflector-ag.go" "mh-flyer-missile-ag.go" - "desbattl.o" + "desbattl.go" )) diff --git a/goal_src/jak3/dgos/desbcst.gd b/goal_src/jak3/dgos/desbcst.gd index ce4fd8ee43..4ac1e05229 100644 --- a/goal_src/jak3/dgos/desbcst.gd +++ b/goal_src/jak3/dgos/desbcst.gd @@ -1,5 +1,5 @@ ("DESBCST.DGO" - ("tpage-2762.o" + ("tpage-2762.go" "tpage-2764.go" "tpage-2763.go" "daxter-highres-ag.go" @@ -11,5 +11,5 @@ "snake-wheel-fma-ag.go" "particleman-ag.go" "jakc-scarf-ag.go" - "desbcst.o" + "desbcst.go" )) diff --git a/goal_src/jak3/dgos/desboss1.gd b/goal_src/jak3/dgos/desboss1.gd index 293820cf90..e8ad341b23 100644 --- a/goal_src/jak3/dgos/desboss1.gd +++ b/goal_src/jak3/dgos/desboss1.gd @@ -19,5 +19,5 @@ "terraformer-mine-ag.go" "particleman-ag.go" "terraformer-target-ag.go" - "desboss1.o" + "desboss1.go" )) diff --git a/goal_src/jak3/dgos/desboss2.gd b/goal_src/jak3/dgos/desboss2.gd index ef4ddf0bf8..97d505bec0 100644 --- a/goal_src/jak3/dgos/desboss2.gd +++ b/goal_src/jak3/dgos/desboss2.gd @@ -13,5 +13,5 @@ "particleman-ag.go" "terraformer-laser-end-ag.go" "terraformer-laser-ag.go" - "desboss2.o" + "desboss2.go" )) diff --git a/goal_src/jak3/dgos/desc.gd b/goal_src/jak3/dgos/desc.gd index b3a699332d..b8d6802d41 100644 --- a/goal_src/jak3/dgos/desc.gd +++ b/goal_src/jak3/dgos/desc.gd @@ -1,5 +1,5 @@ ("DESC.DGO" - ("tpage-1371.o" + ("tpage-1371.go" "tpage-1573.go" - "desertc-vis.o" + "desertc-vis.go" )) diff --git a/goal_src/jak3/dgos/deschase.gd b/goal_src/jak3/dgos/deschase.gd index 2dccbd966d..d3273d4f7f 100644 --- a/goal_src/jak3/dgos/deschase.gd +++ b/goal_src/jak3/dgos/deschase.gd @@ -17,5 +17,5 @@ "interceptor-b-ag.go" "pre-artifact-a-ag.go" "catapult-target-ag.go" - "deschase.o" + "deschase.go" )) diff --git a/goal_src/jak3/dgos/desd.gd b/goal_src/jak3/dgos/desd.gd index 0f9a7ac015..e884dc3637 100644 --- a/goal_src/jak3/dgos/desd.gd +++ b/goal_src/jak3/dgos/desd.gd @@ -8,5 +8,5 @@ "tpage-3384.go" "des-cactus-b-ag.go" "des-cactus-a-ag.go" - "desertd-vis.o" + "desertd-vis.go" )) diff --git a/goal_src/jak3/dgos/dese.gd b/goal_src/jak3/dgos/dese.gd index e3eb963463..103485b59b 100644 --- a/goal_src/jak3/dgos/dese.gd +++ b/goal_src/jak3/dgos/dese.gd @@ -1,5 +1,5 @@ ("DESE.DGO" - ("tpage-1380.o" + ("tpage-1380.go" "tpage-1597.go" - "deserte-vis.o" + "deserte-vis.go" )) diff --git a/goal_src/jak3/dgos/deserrol.gd b/goal_src/jak3/dgos/deserrol.gd index 11e69b4232..5ff579da62 100644 --- a/goal_src/jak3/dgos/deserrol.gd +++ b/goal_src/jak3/dgos/deserrol.gd @@ -1,6 +1,6 @@ ("DESERROL.DGO" - ("tpage-3179.o" + ("tpage-3179.go" "tpage-3180.go" "errol-ag.go" - "deserrol.o" + "deserrol.go" )) diff --git a/goal_src/jak3/dgos/desf.gd b/goal_src/jak3/dgos/desf.gd index a4b5876f36..c839dfb449 100644 --- a/goal_src/jak3/dgos/desf.gd +++ b/goal_src/jak3/dgos/desf.gd @@ -6,5 +6,5 @@ "des-draw-bridge-ag.go" "des-jump-bridge-ag.go" "des-garage-door-ag.go" - "desertf-vis.o" + "desertf-vis.go" )) diff --git a/goal_src/jak3/dgos/desg.gd b/goal_src/jak3/dgos/desg.gd index 48a229d238..1301d2fec7 100644 --- a/goal_src/jak3/dgos/desg.gd +++ b/goal_src/jak3/dgos/desg.gd @@ -8,5 +8,5 @@ "desert-eggwall-ag.go" "des-cactus-obstacle-ag.go" "particleman-ag.go" - "desertg-vis.o" + "desertg-vis.go" )) diff --git a/goal_src/jak3/dgos/desh.gd b/goal_src/jak3/dgos/desh.gd index 292228b108..f545278e73 100644 --- a/goal_src/jak3/dgos/desh.gd +++ b/goal_src/jak3/dgos/desh.gd @@ -1,5 +1,5 @@ ("DESH.DGO" - ("tpage-1385.o" + ("tpage-1385.go" "tpage-1995.go" - "deserth-vis.o" + "deserth-vis.go" )) diff --git a/goal_src/jak3/dgos/deshover.gd b/goal_src/jak3/dgos/deshover.gd index fbf7f50a5f..eb35df4e55 100644 --- a/goal_src/jak3/dgos/deshover.gd +++ b/goal_src/jak3/dgos/deshover.gd @@ -19,5 +19,5 @@ "snake-wheel-fma-ag.go" "eco-crystal-dark-ag.go" "particleman-ag.go" - "deshover.o" + "deshover.go" )) diff --git a/goal_src/jak3/dgos/deshunt.gd b/goal_src/jak3/dgos/deshunt.gd index 5919211319..1ddccb109f 100644 --- a/goal_src/jak3/dgos/deshunt.gd +++ b/goal_src/jak3/dgos/deshunt.gd @@ -1,6 +1,6 @@ ("DESHUNT.DGO" - ("tpage-1809.o" + ("tpage-1809.go" "tpage-1808.go" "sig-highres-ag.go" - "deshunt.o" + "deshunt.go" )) diff --git a/goal_src/jak3/dgos/desinter.gd b/goal_src/jak3/dgos/desinter.gd index 876c7eb85f..1d041d160c 100644 --- a/goal_src/jak3/dgos/desinter.gd +++ b/goal_src/jak3/dgos/desinter.gd @@ -1,7 +1,7 @@ ("DESINTER.DGO" - ("tpage-1712.o" + ("tpage-1712.go" "tpage-1713.go" "interceptor-ag.go" "interceptor-b-ag.go" - "desinter.o" + "desinter.go" )) diff --git a/goal_src/jak3/dgos/desjump.gd b/goal_src/jak3/dgos/desjump.gd index 4a5a1ef0ce..4466854edc 100644 --- a/goal_src/jak3/dgos/desjump.gd +++ b/goal_src/jak3/dgos/desjump.gd @@ -9,5 +9,5 @@ "interceptor-ag.go" "wascity-airlock-debris-ag.go" "beam-generator-ag.go" - "desjump.o" + "desjump.go" )) diff --git a/goal_src/jak3/dgos/desliz.gd b/goal_src/jak3/dgos/desliz.gd index 49cc5bebf0..7ee2368881 100644 --- a/goal_src/jak3/dgos/desliz.gd +++ b/goal_src/jak3/dgos/desliz.gd @@ -14,5 +14,5 @@ "flut-saddle-ag.go" "snake-wheel-fma-ag.go" "particleman-ag.go" - "desliz.o" + "desliz.go" )) diff --git a/goal_src/jak3/dgos/desoasis.gd b/goal_src/jak3/dgos/desoasis.gd index 3901c5886d..7eb4ace940 100644 --- a/goal_src/jak3/dgos/desoasis.gd +++ b/goal_src/jak3/dgos/desoasis.gd @@ -22,5 +22,5 @@ "hellcat-ag.go" "interceptor-ag.go" "interceptor-b-ag.go" - "desoasis.o" + "desoasis.go" )) diff --git a/goal_src/jak3/dgos/desrace1.gd b/goal_src/jak3/dgos/desrace1.gd index b40d3e3039..a7d2b0a183 100644 --- a/goal_src/jak3/dgos/desrace1.gd +++ b/goal_src/jak3/dgos/desrace1.gd @@ -11,5 +11,5 @@ "pre-artifact-b-ag.go" "pre-artifact-c-ag.go" "was-artifact-ag.go" - "desrace1.o" + "desrace1.go" )) diff --git a/goal_src/jak3/dgos/desrace2.gd b/goal_src/jak3/dgos/desrace2.gd index d9e35c5947..a90ac66153 100644 --- a/goal_src/jak3/dgos/desrace2.gd +++ b/goal_src/jak3/dgos/desrace2.gd @@ -4,5 +4,5 @@ "tpage-1409.go" "interceptor-ag.go" "interceptor-b-ag.go" - "desrace2.o" + "desrace2.go" )) diff --git a/goal_src/jak3/dgos/desrally.gd b/goal_src/jak3/dgos/desrally.gd index 035a816e8a..d8d2bc9f18 100644 --- a/goal_src/jak3/dgos/desrally.gd +++ b/goal_src/jak3/dgos/desrally.gd @@ -16,5 +16,5 @@ "interceptor-ag.go" "interceptor-b-ag.go" "des-rally-bollard-ag.go" - "desrally.o" + "desrally.go" )) diff --git a/goal_src/jak3/dgos/desresc.gd b/goal_src/jak3/dgos/desresc.gd index ea9212ff3e..e78852e23a 100644 --- a/goal_src/jak3/dgos/desresc.gd +++ b/goal_src/jak3/dgos/desresc.gd @@ -47,5 +47,5 @@ "neo-satellite-b-ag.go" "eco-crystal-dark-ag.go" "neo-satellite-shield-ag.go" - "desresc.o" + "desresc.go" )) diff --git a/goal_src/jak3/dgos/desrescc.gd b/goal_src/jak3/dgos/desrescc.gd index 2e0ca43e73..4db37e5341 100644 --- a/goal_src/jak3/dgos/desrescc.gd +++ b/goal_src/jak3/dgos/desrescc.gd @@ -1,6 +1,6 @@ ("DESRESCC.DGO" - ("tpage-1717.o" + ("tpage-1717.go" "daxter-highres-ag.go" "jakc-highres-ag.go" - "desrescc.o" + "desrescc.go" )) diff --git a/goal_src/jak3/dgos/desrescg.gd b/goal_src/jak3/dgos/desrescg.gd index 25ee51e4e9..f8c95f6501 100644 --- a/goal_src/jak3/dgos/desrescg.gd +++ b/goal_src/jak3/dgos/desrescg.gd @@ -1,8 +1,8 @@ ("DESRESCG.DGO" - ("tpage-1715.o" + ("tpage-1715.go" "tpage-1716.go" "interceptor-ag.go" "desert-transport-ag.go" "interceptor-b-ag.go" - "desrescg.o" + "desrescg.go" )) diff --git a/goal_src/jak3/dgos/destrack.gd b/goal_src/jak3/dgos/destrack.gd index 638c9a2efa..5dffdd70d9 100644 --- a/goal_src/jak3/dgos/destrack.gd +++ b/goal_src/jak3/dgos/destrack.gd @@ -22,5 +22,5 @@ "des-train-barrier-ag.go" "des-train-stones-ag.go" "des-train-bollard-ag.go" - "destrack.o" + "destrack.go" )) diff --git a/goal_src/jak3/dgos/desw.gd b/goal_src/jak3/dgos/desw.gd index 5aa6760fe0..3d3dc78185 100644 --- a/goal_src/jak3/dgos/desw.gd +++ b/goal_src/jak3/dgos/desw.gd @@ -16,5 +16,5 @@ "light-eco-vent-ag.go" "terraformer-mine-ag.go" "desw-snake-stump-ag.go" - "deswalk-vis.o" + "deswalk-vis.go" )) diff --git a/goal_src/jak3/dgos/dst.gd b/goal_src/jak3/dgos/dst.gd index 15e4370554..e038b26e69 100644 --- a/goal_src/jak3/dgos/dst.gd +++ b/goal_src/jak3/dgos/dst.gd @@ -20,5 +20,5 @@ "tentacle-ag.go" "des-burning-bush-ag.go" "wascity-burning-bush-ag.go" - "desert-vis.o" + "desert-vis.go" )) diff --git a/goal_src/jak3/dgos/facb.gd b/goal_src/jak3/dgos/facb.gd index d8cface7a6..dd9c812145 100644 --- a/goal_src/jak3/dgos/facb.gd +++ b/goal_src/jak3/dgos/facb.gd @@ -17,5 +17,5 @@ "fac-gun-tower-turret-ag.go" "particleman-ag.go" "hemisplosion-ag.go" - "factoryb-vis.o" + "factoryb-vis.go" )) diff --git a/goal_src/jak3/dgos/facc.gd b/goal_src/jak3/dgos/facc.gd index fa1ecb7b97..aa42608fab 100644 --- a/goal_src/jak3/dgos/facc.gd +++ b/goal_src/jak3/dgos/facc.gd @@ -36,5 +36,5 @@ "fac-move-plat-a-ag.go" "fac-move-plat-b-ag.go" "fac-fire-torch-ag.go" - "factoryc-vis.o" + "factoryc-vis.go" )) diff --git a/goal_src/jak3/dgos/facd.gd b/goal_src/jak3/dgos/facd.gd index eba14a9eb1..ea14591e10 100644 --- a/goal_src/jak3/dgos/facd.gd +++ b/goal_src/jak3/dgos/facd.gd @@ -44,5 +44,5 @@ "shield-sphere-distort-ag.go" "fac-drop-plat-ag.go" "shield-sphere-ag.go" - "factoryd-vis.o" + "factoryd-vis.go" )) diff --git a/goal_src/jak3/dgos/factorya.gd b/goal_src/jak3/dgos/factorya.gd index 301f05f3b3..ea8fca1614 100644 --- a/goal_src/jak3/dgos/factorya.gd +++ b/goal_src/jak3/dgos/factorya.gd @@ -19,5 +19,5 @@ "fac-fma-breaking-bits-ag.go" "lfac-hanger-door-ag.go" "particleman-ag.go" - "factorya.o" + "factorya.go" )) diff --git a/goal_src/jak3/dgos/freecast.gd b/goal_src/jak3/dgos/freecast.gd index 8cbd91ea93..23ba154188 100644 --- a/goal_src/jak3/dgos/freecast.gd +++ b/goal_src/jak3/dgos/freecast.gd @@ -1,5 +1,5 @@ ("FREECAST.DGO" - ("tpage-1967.o" + ("tpage-1967.go" "tpage-1969.go" "tpage-1968.go" "pecker-highres-ag.go" @@ -9,5 +9,5 @@ "ashelin-highres-ag.go" "onin-highres-ag.go" "purple-two-ag.go" - "freecast.o" + "freecast.go" )) diff --git a/goal_src/jak3/dgos/freehq.gd b/goal_src/jak3/dgos/freehq.gd index 227f906c7e..033f084aca 100644 --- a/goal_src/jak3/dgos/freehq.gd +++ b/goal_src/jak3/dgos/freehq.gd @@ -11,5 +11,5 @@ "jakc-highres-ag.go" "torn-highres-ag.go" "freehq-sml-door-ag.go" - "freehq.o" + "freehq.go" )) diff --git a/goal_src/jak3/dgos/frsta.gd b/goal_src/jak3/dgos/frsta.gd index 34a8a568a7..7f847f5aee 100644 --- a/goal_src/jak3/dgos/frsta.gd +++ b/goal_src/jak3/dgos/frsta.gd @@ -34,5 +34,5 @@ "warp-telescope-ag.go" "for-pillar-ag.go" "particleman-ag.go" - "foresta-vis.o" + "foresta-vis.go" )) diff --git a/goal_src/jak3/dgos/frstb.gd b/goal_src/jak3/dgos/frstb.gd index 97a8b21c95..22cdad708a 100644 --- a/goal_src/jak3/dgos/frstb.gd +++ b/goal_src/jak3/dgos/frstb.gd @@ -1,10 +1,10 @@ ("FRSTB.DGO" - ("tpage-819.o" + ("tpage-819.go" "tpage-820.go" "tpage-1116.go" "tpage-1117.go" "tpage-821.go" "crimson-guard-ag.go" "transport-ag.go" - "forestb-vis.o" + "forestb-vis.go" )) diff --git a/goal_src/jak3/dgos/frstx.gd b/goal_src/jak3/dgos/frstx.gd index 49bb6f76b2..def183bae4 100644 --- a/goal_src/jak3/dgos/frstx.gd +++ b/goal_src/jak3/dgos/frstx.gd @@ -1,8 +1,8 @@ ("FRSTX.DGO" - ("tpage-1838.o" + ("tpage-1838.go" "tpage-1839.go" "tpage-3316.go" "tpage-3317.go" "com-airlock-inner-ag.go" - "forestx-vis.o" + "forestx-vis.go" )) diff --git a/goal_src/jak3/dgos/gga.gd b/goal_src/jak3/dgos/gga.gd index 68de8e5f03..2f56d93603 100644 --- a/goal_src/jak3/dgos/gga.gd +++ b/goal_src/jak3/dgos/gga.gd @@ -20,5 +20,5 @@ "fort-entry-gate-ag.go" "hip-door-a-ag.go" "particleman-ag.go" - "gungame-vis.o" + "gungame-vis.go" )) diff --git a/goal_src/jak3/dgos/gridcst.gd b/goal_src/jak3/dgos/gridcst.gd index 8742b04343..76ed45791b 100644 --- a/goal_src/jak3/dgos/gridcst.gd +++ b/goal_src/jak3/dgos/gridcst.gd @@ -1,5 +1,5 @@ ("GRIDCST.DGO" - ("tpage-2967.o" + ("tpage-2967.go" "tpage-2968.go" "daxter-highres-ag.go" "jakc-highres-ag.go" @@ -8,5 +8,5 @@ "cara-ag.go" "blue-gun-mod-three-ag.go" "particleman-ag.go" - "gridcst.o" + "gridcst.go" )) diff --git a/goal_src/jak3/dgos/gungame1.gd b/goal_src/jak3/dgos/gungame1.gd index 386f7399c8..fe8282b27c 100644 --- a/goal_src/jak3/dgos/gungame1.gd +++ b/goal_src/jak3/dgos/gungame1.gd @@ -1,5 +1,5 @@ ("GUNGAME1.DGO" - ("tpage-2274.o" + ("tpage-2274.go" "yellow-barrel-ag.go" - "gungame1.o" + "gungame1.go" )) diff --git a/goal_src/jak3/dgos/gungame2.gd b/goal_src/jak3/dgos/gungame2.gd index 8982cfde2b..bbb8da93f0 100644 --- a/goal_src/jak3/dgos/gungame2.gd +++ b/goal_src/jak3/dgos/gungame2.gd @@ -1,5 +1,5 @@ ("GUNGAME2.DGO" - ("tpage-2275.o" + ("tpage-2275.go" "red-gun-mod-three-ag.go" - "gungame2.o" + "gungame2.go" )) diff --git a/goal_src/jak3/dgos/halfpipe.gd b/goal_src/jak3/dgos/halfpipe.gd index 2b4cef874d..c0c276ea19 100644 --- a/goal_src/jak3/dgos/halfpipe.gd +++ b/goal_src/jak3/dgos/halfpipe.gd @@ -18,5 +18,5 @@ "urn-b-ag.go" "urn-c-ag.go" "urn-a-ag.go" - "halfpipe.o" + "halfpipe.go" )) diff --git a/goal_src/jak3/dgos/hga.gd b/goal_src/jak3/dgos/hga.gd index 962938427d..5bc8ea0c78 100644 --- a/goal_src/jak3/dgos/hga.gd +++ b/goal_src/jak3/dgos/hga.gd @@ -56,5 +56,5 @@ "des-glider-ring-ag.go" "tpl-glider-ag.go" "tpl-glider-broken-ag.go" - "hanga-vis.o" + "hanga-vis.go" )) diff --git a/goal_src/jak3/dgos/hgb.gd b/goal_src/jak3/dgos/hgb.gd index 915d76dd1f..30a239d5ed 100644 --- a/goal_src/jak3/dgos/hgb.gd +++ b/goal_src/jak3/dgos/hgb.gd @@ -1,4 +1,4 @@ ("HGB.DGO" - ("tpage-3028.o" - "hangb-vis.o" + ("tpage-3028.go" + "hangb-vis.go" )) diff --git a/goal_src/jak3/dgos/hhg.gd b/goal_src/jak3/dgos/hhg.gd index 291d21369e..2ed3825f76 100644 --- a/goal_src/jak3/dgos/hhg.gd +++ b/goal_src/jak3/dgos/hhg.gd @@ -10,5 +10,5 @@ "jakc-highres-ag.go" "hip-door-a-ag.go" "particleman-ag.go" - "hiphog-vis.o" + "hiphog-vis.go" )) diff --git a/goal_src/jak3/dgos/intpalrf.gd b/goal_src/jak3/dgos/intpalrf.gd index bc7946cc6e..89e4df5eed 100644 --- a/goal_src/jak3/dgos/intpalrf.gd +++ b/goal_src/jak3/dgos/intpalrf.gd @@ -1,6 +1,6 @@ ("INTPALRF.DGO" - ("tpage-428.o" + ("tpage-428.go" "tpage-429.go" "tpage-430.go" - "intpalrf.o" + "intpalrf.go" )) diff --git a/goal_src/jak3/dgos/introcst.gd b/goal_src/jak3/dgos/introcst.gd index e767bd9d33..4abc6874b6 100644 --- a/goal_src/jak3/dgos/introcst.gd +++ b/goal_src/jak3/dgos/introcst.gd @@ -18,5 +18,5 @@ "handcuffs-ag.go" "beacon-ag.go" "particleman-ag.go" - "introcst.o" + "introcst.go" )) diff --git a/goal_src/jak3/dgos/inttitle.gd b/goal_src/jak3/dgos/inttitle.gd index 6dc4477ab7..efb4270e63 100644 --- a/goal_src/jak3/dgos/inttitle.gd +++ b/goal_src/jak3/dgos/inttitle.gd @@ -1,4 +1,4 @@ ("INTTITLE.DGO" - ("tpage-1073.o" - "inttitle.o" + ("tpage-1073.go" + "inttitle.go" )) diff --git a/goal_src/jak3/dgos/ipf.gd b/goal_src/jak3/dgos/ipf.gd index 29c6ba357f..100a6ad648 100644 --- a/goal_src/jak3/dgos/ipf.gd +++ b/goal_src/jak3/dgos/ipf.gd @@ -18,5 +18,5 @@ "hellcat-lowres-fma-ag.go" "ctypal-cable-break-ag.go" "searchlight-ag.go" - "intpfall-vis.o" + "intpfall-vis.go" )) diff --git a/goal_src/jak3/dgos/lashelin.gd b/goal_src/jak3/dgos/lashelin.gd index 74812a7ce4..abfe61e418 100644 --- a/goal_src/jak3/dgos/lashelin.gd +++ b/goal_src/jak3/dgos/lashelin.gd @@ -1,5 +1,5 @@ ("LASHELIN.DGO" - ("tpage-1222.o" + ("tpage-1222.go" "ashelin-highres-ag.go" - "lashelin.o" + "lashelin.go" )) diff --git a/goal_src/jak3/dgos/lbbring1.gd b/goal_src/jak3/dgos/lbbring1.gd index 0918d63ed3..76f4276b50 100644 --- a/goal_src/jak3/dgos/lbbring1.gd +++ b/goal_src/jak3/dgos/lbbring1.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-2767.go" - "lbbring1.o" + "lbbring1.go" )) diff --git a/goal_src/jak3/dgos/lbbring2.gd b/goal_src/jak3/dgos/lbbring2.gd index 330b329718..ffbad9c8fa 100644 --- a/goal_src/jak3/dgos/lbbring2.gd +++ b/goal_src/jak3/dgos/lbbring2.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-2858.go" - "lbbring2.o" + "lbbring2.go" )) diff --git a/goal_src/jak3/dgos/lbbring3.gd b/goal_src/jak3/dgos/lbbring3.gd index b9457934c4..ff0b793c7e 100644 --- a/goal_src/jak3/dgos/lbbring3.gd +++ b/goal_src/jak3/dgos/lbbring3.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-2859.go" - "lbbring3.o" + "lbbring3.go" )) diff --git a/goal_src/jak3/dgos/lbbring4.gd b/goal_src/jak3/dgos/lbbring4.gd index 8e89e4aad1..50f085c0d8 100644 --- a/goal_src/jak3/dgos/lbbring4.gd +++ b/goal_src/jak3/dgos/lbbring4.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-2906.go" - "lbbring4.o" + "lbbring4.go" )) diff --git a/goal_src/jak3/dgos/lbbring5.gd b/goal_src/jak3/dgos/lbbring5.gd index 7b96535a93..38e53839be 100644 --- a/goal_src/jak3/dgos/lbbring5.gd +++ b/goal_src/jak3/dgos/lbbring5.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-2940.go" - "lbbring5.o" + "lbbring5.go" )) diff --git a/goal_src/jak3/dgos/lbbring6.gd b/goal_src/jak3/dgos/lbbring6.gd index 35f8f47fff..c53cbb0b82 100644 --- a/goal_src/jak3/dgos/lbbring6.gd +++ b/goal_src/jak3/dgos/lbbring6.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-2954.go" - "lbbring6.o" + "lbbring6.go" )) diff --git a/goal_src/jak3/dgos/lbbsdrp1.gd b/goal_src/jak3/dgos/lbbsdrp1.gd index 2f7dcc710e..8c380e7d1b 100644 --- a/goal_src/jak3/dgos/lbbsdrp1.gd +++ b/goal_src/jak3/dgos/lbbsdrp1.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-3328.go" - "lbbsdrp1.o" + "lbbsdrp1.go" )) diff --git a/goal_src/jak3/dgos/lbbsdrp2.gd b/goal_src/jak3/dgos/lbbsdrp2.gd index ff58e0791c..3a69a3620b 100644 --- a/goal_src/jak3/dgos/lbbsdrp2.gd +++ b/goal_src/jak3/dgos/lbbsdrp2.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-3329.go" - "lbbsdrp2.o" + "lbbsdrp2.go" )) diff --git a/goal_src/jak3/dgos/lbbsdrp3.gd b/goal_src/jak3/dgos/lbbsdrp3.gd index 9f870662a9..cde69e48ba 100644 --- a/goal_src/jak3/dgos/lbbsdrp3.gd +++ b/goal_src/jak3/dgos/lbbsdrp3.gd @@ -2,5 +2,5 @@ ("des-bush-part.o" "des-bush.o" "tpage-3330.go" - "lbbsdrp3.o" + "lbbsdrp3.go" )) diff --git a/goal_src/jak3/dgos/lbbspid.gd b/goal_src/jak3/dgos/lbbspid.gd index acdc9c7144..72d07c3661 100644 --- a/goal_src/jak3/dgos/lbbspid.gd +++ b/goal_src/jak3/dgos/lbbspid.gd @@ -4,5 +4,5 @@ "egg-spider.o" "tpage-2664.go" "egg-spider-ag.go" - "lbbspid.o" + "lbbspid.go" )) diff --git a/goal_src/jak3/dgos/lbbspirt.gd b/goal_src/jak3/dgos/lbbspirt.gd index 5a27a90a98..225f31394d 100644 --- a/goal_src/jak3/dgos/lbbspirt.gd +++ b/goal_src/jak3/dgos/lbbspirt.gd @@ -1,5 +1,5 @@ ("LBBSPIRT.DGO" ("des-bush-part.o" "des-bush.o" - "lbbspirt.o" + "lbbspirt.go" )) diff --git a/goal_src/jak3/dgos/lbbsprt2.gd b/goal_src/jak3/dgos/lbbsprt2.gd index eb7e582ee2..575ee39ec9 100644 --- a/goal_src/jak3/dgos/lbbsprt2.gd +++ b/goal_src/jak3/dgos/lbbsprt2.gd @@ -1,5 +1,5 @@ ("LBBSPRT2.DGO" ("des-bush-part.o" "des-bush.o" - "lbbsprt2.o" + "lbbsprt2.go" )) diff --git a/goal_src/jak3/dgos/lbbsprt3.gd b/goal_src/jak3/dgos/lbbsprt3.gd index 8d71a993c3..3ee3f8d17f 100644 --- a/goal_src/jak3/dgos/lbbsprt3.gd +++ b/goal_src/jak3/dgos/lbbsprt3.gd @@ -1,5 +1,5 @@ ("LBBSPRT3.DGO" ("des-bush-part.o" "des-bush.o" - "lbbsprt3.o" + "lbbsprt3.go" )) diff --git a/goal_src/jak3/dgos/lbbtcha1.gd b/goal_src/jak3/dgos/lbbtcha1.gd index cff9a5fb11..4000277cb6 100644 --- a/goal_src/jak3/dgos/lbbtcha1.gd +++ b/goal_src/jak3/dgos/lbbtcha1.gd @@ -3,5 +3,5 @@ "des-bush-time-chase.o" "tpage-3378.go" "tpage-3325.go" - "lbbtcha1.o" + "lbbtcha1.go" )) diff --git a/goal_src/jak3/dgos/lbbtcha2.gd b/goal_src/jak3/dgos/lbbtcha2.gd index 584189db3b..6ebd71ecf5 100644 --- a/goal_src/jak3/dgos/lbbtcha2.gd +++ b/goal_src/jak3/dgos/lbbtcha2.gd @@ -3,5 +3,5 @@ "des-bush-time-chase.o" "tpage-3379.go" "tpage-3326.go" - "lbbtcha2.o" + "lbbtcha2.go" )) diff --git a/goal_src/jak3/dgos/lbbtcha3.gd b/goal_src/jak3/dgos/lbbtcha3.gd index 1e4dffb2f9..482b472d28 100644 --- a/goal_src/jak3/dgos/lbbtcha3.gd +++ b/goal_src/jak3/dgos/lbbtcha3.gd @@ -3,5 +3,5 @@ "des-bush-time-chase.o" "tpage-3380.go" "tpage-3327.go" - "lbbtcha3.o" + "lbbtcha3.go" )) diff --git a/goal_src/jak3/dgos/lbiped.gd b/goal_src/jak3/dgos/lbiped.gd index c44291b45f..2acb37c60e 100644 --- a/goal_src/jak3/dgos/lbiped.gd +++ b/goal_src/jak3/dgos/lbiped.gd @@ -8,5 +8,5 @@ "shield-sphere-explode-ag.go" "shield-sphere-distort-ag.go" "shield-sphere-ag.go" - "lbiped.o" + "lbiped.go" )) diff --git a/goal_src/jak3/dgos/lblowcst.gd b/goal_src/jak3/dgos/lblowcst.gd index 2c2d192969..5acf5d2f8a 100644 --- a/goal_src/jak3/dgos/lblowcst.gd +++ b/goal_src/jak3/dgos/lblowcst.gd @@ -11,5 +11,5 @@ "bt-sig-ag.go" "bt-jinx-ag.go" "cty-explode-barrel-ag.go" - "lblowcst.o" + "lblowcst.go" )) diff --git a/goal_src/jak3/dgos/lblowtkg.gd b/goal_src/jak3/dgos/lblowtkg.gd index 4d77dcb2db..030f088cf9 100644 --- a/goal_src/jak3/dgos/lblowtkg.gd +++ b/goal_src/jak3/dgos/lblowtkg.gd @@ -1,9 +1,9 @@ ("LBLOWTKG.DGO" - ("tpage-2977.o" + ("tpage-2977.go" "bt-wasp-ag.go" "bombbot-ag.go" "kg-flying-turret-ag.go" "cty-homing-missile-ag.go" "kg-debris-ag.go" - "lblowtkg.o" + "lblowtkg.go" )) diff --git a/goal_src/jak3/dgos/lblowtmh.gd b/goal_src/jak3/dgos/lblowtmh.gd index 5ebe6631c2..2fd67e78e0 100644 --- a/goal_src/jak3/dgos/lblowtmh.gd +++ b/goal_src/jak3/dgos/lblowtmh.gd @@ -1,6 +1,6 @@ ("LBLOWTMH.DGO" - ("tpage-2978.o" + ("tpage-2978.go" "bt-grunt-ag.go" "bt-roboguard-ag.go" - "lblowtmh.o" + "lblowtmh.go" )) diff --git a/goal_src/jak3/dgos/lbombbot.gd b/goal_src/jak3/dgos/lbombbot.gd index a41a129cc5..a9d0641903 100644 --- a/goal_src/jak3/dgos/lbombbot.gd +++ b/goal_src/jak3/dgos/lbombbot.gd @@ -8,5 +8,5 @@ "krimson-wall-break-ag.go" "bombbot-bomb-ag.go" "kg-debris-ag.go" - "lbombbot.o" + "lbombbot.go" )) diff --git a/goal_src/jak3/dgos/lcitysml.gd b/goal_src/jak3/dgos/lcitysml.gd index 897126b5b0..c50da2b24c 100644 --- a/goal_src/jak3/dgos/lcitysml.gd +++ b/goal_src/jak3/dgos/lcitysml.gd @@ -1,5 +1,5 @@ ("LCITYSML.DGO" - ("tpage-2605.o" + ("tpage-2605.go" "tpage-2606.go" - "lcitysml.o" + "lcitysml.go" )) diff --git a/goal_src/jak3/dgos/lctyass.gd b/goal_src/jak3/dgos/lctyass.gd index b524154e61..4fbd04fb65 100644 --- a/goal_src/jak3/dgos/lctyass.gd +++ b/goal_src/jak3/dgos/lctyass.gd @@ -7,5 +7,5 @@ "bombbot-ag.go" "bombbot-bomb-ag.go" "kg-debris-ag.go" - "lctyass.o" + "lctyass.go" )) diff --git a/goal_src/jak3/dgos/lctyblow.gd b/goal_src/jak3/dgos/lctyblow.gd index 955c17cbad..4b2e65e835 100644 --- a/goal_src/jak3/dgos/lctyblow.gd +++ b/goal_src/jak3/dgos/lctyblow.gd @@ -14,5 +14,5 @@ "tpage-2847.go" "hellcat-tower-ag.go" "kg-pickup-ag.go" - "lctyblow.o" + "lctyblow.go" )) diff --git a/goal_src/jak3/dgos/lctydest.gd b/goal_src/jak3/dgos/lctydest.gd index 376d13218d..f1e5877dc5 100644 --- a/goal_src/jak3/dgos/lctydest.gd +++ b/goal_src/jak3/dgos/lctydest.gd @@ -8,5 +8,5 @@ "mhcity-de-tower-egg-ag.go" "mhcity-puffer-large-ag.go" "mhcity-puffer-ag.go" - "lctydest.o" + "lctydest.go" )) diff --git a/goal_src/jak3/dgos/lctyhijk.gd b/goal_src/jak3/dgos/lctyhijk.gd index d54afa9267..3a8347c448 100644 --- a/goal_src/jak3/dgos/lctyhijk.gd +++ b/goal_src/jak3/dgos/lctyhijk.gd @@ -12,5 +12,5 @@ "cty-missile-launcher-ag.go" "kg-pickup-ag.go" "cty-homing-missile-ag.go" - "lctyhijk.o" + "lctyhijk.go" )) diff --git a/goal_src/jak3/dgos/lctypalt.gd b/goal_src/jak3/dgos/lctypalt.gd index 3e15115ff5..9ea03fa0bb 100644 --- a/goal_src/jak3/dgos/lctypalt.gd +++ b/goal_src/jak3/dgos/lctypalt.gd @@ -10,5 +10,5 @@ "assault-script.o" "assault-task.o" "tpage-3093.go" - "lctypalt.o" + "lctypalt.go" )) diff --git a/goal_src/jak3/dgos/lctypatk.gd b/goal_src/jak3/dgos/lctypatk.gd index b7e76a6368..29eba50a89 100644 --- a/goal_src/jak3/dgos/lctypatk.gd +++ b/goal_src/jak3/dgos/lctypatk.gd @@ -9,5 +9,5 @@ "cty-port-mine-ag.go" "ctyport-mine-ag.go" "cty-dax-missile-ag.go" - "lctypatk.o" + "lctypatk.go" )) diff --git a/goal_src/jak3/dgos/lctyprot.gd b/goal_src/jak3/dgos/lctyprot.gd index 84f37d651b..8456789e6a 100644 --- a/goal_src/jak3/dgos/lctyprot.gd +++ b/goal_src/jak3/dgos/lctyprot.gd @@ -10,5 +10,5 @@ "kg-robot-transport-ag.go" "cty-homing-missile-ag.go" "kg-robot-transport-bomb-ag.go" - "lctyprot.o" + "lctyprot.go" )) diff --git a/goal_src/jak3/dgos/lctysnpr.gd b/goal_src/jak3/dgos/lctysnpr.gd index ffa9a9c6c4..33fa8e52a2 100644 --- a/goal_src/jak3/dgos/lctysnpr.gd +++ b/goal_src/jak3/dgos/lctysnpr.gd @@ -13,5 +13,5 @@ "sew-floor-switch-ag.go" "cty-sniper-turret-reticle-ag.go" "cty-sniper-button-top-ag.go" - "lctysnpr.o" + "lctysnpr.go" )) diff --git a/goal_src/jak3/dgos/ldamklev.gd b/goal_src/jak3/dgos/ldamklev.gd index db999b353b..d27497b61b 100644 --- a/goal_src/jak3/dgos/ldamklev.gd +++ b/goal_src/jak3/dgos/ldamklev.gd @@ -1,7 +1,7 @@ ("LDAMKLEV.DGO" - ("tpage-1407.o" + ("tpage-1407.go" "tpage-1323.go" "kleever-highres-ag.go" "king-highres-ag.go" - "ldamklev.o" + "ldamklev.go" )) diff --git a/goal_src/jak3/dgos/ldampeck.gd b/goal_src/jak3/dgos/ldampeck.gd index 533b5f18b7..ebaac70675 100644 --- a/goal_src/jak3/dgos/ldampeck.gd +++ b/goal_src/jak3/dgos/ldampeck.gd @@ -1,7 +1,7 @@ ("LDAMPECK.DGO" - ("tpage-1086.o" + ("tpage-1086.go" "tpage-1087.go" "pecker-highres-ag.go" "king-highres-ag.go" - "ldampeck.o" + "ldampeck.go" )) diff --git a/goal_src/jak3/dgos/ldampksm.gd b/goal_src/jak3/dgos/ldampksm.gd index c68c449c35..6f68c74b05 100644 --- a/goal_src/jak3/dgos/ldampksm.gd +++ b/goal_src/jak3/dgos/ldampksm.gd @@ -1,8 +1,8 @@ ("LDAMPKSM.DGO" - ("tpage-1092.o" + ("tpage-1092.go" "tpage-1093.go" "pecker-highres-ag.go" "king-highres-ag.go" "seem-highres-ag.go" - "ldampksm.o" + "ldampksm.go" )) diff --git a/goal_src/jak3/dgos/ldamsig.gd b/goal_src/jak3/dgos/ldamsig.gd index dac4a88a7a..40386dd46c 100644 --- a/goal_src/jak3/dgos/ldamsig.gd +++ b/goal_src/jak3/dgos/ldamsig.gd @@ -1,7 +1,7 @@ ("LDAMSIG.DGO" - ("tpage-1089.o" + ("tpage-1089.go" "tpage-1088.go" "sig-highres-ag.go" "king-highres-ag.go" - "ldamsig.o" + "ldamsig.go" )) diff --git a/goal_src/jak3/dgos/ldax.gd b/goal_src/jak3/dgos/ldax.gd index 60d4f609b7..0fb0605d45 100644 --- a/goal_src/jak3/dgos/ldax.gd +++ b/goal_src/jak3/dgos/ldax.gd @@ -1,5 +1,5 @@ ("LDAX.DGO" - ("tpage-2130.o" + ("tpage-2130.go" "daxter-highres-ag.go" - "ldax.o" + "ldax.go" )) diff --git a/goal_src/jak3/dgos/ldesgcst.gd b/goal_src/jak3/dgos/ldesgcst.gd index 65308267a0..32ebfd9ef0 100644 --- a/goal_src/jak3/dgos/ldesgcst.gd +++ b/goal_src/jak3/dgos/ldesgcst.gd @@ -1,9 +1,9 @@ ("LDESGCST.DGO" - ("tpage-2660.o" + ("tpage-2660.go" "tpage-2662.go" "tpage-2661.go" "daxter-highres-ag.go" "jakc-highres-ag.go" "sig-highres-ag.go" - "ldesgcst.o" + "ldesgcst.go" )) diff --git a/goal_src/jak3/dgos/ldmpckgn.gd b/goal_src/jak3/dgos/ldmpckgn.gd index 5ba0c8e7cf..f2b219a126 100644 --- a/goal_src/jak3/dgos/ldmpckgn.gd +++ b/goal_src/jak3/dgos/ldmpckgn.gd @@ -1,8 +1,8 @@ ("LDMPCKGN.DGO" - ("tpage-2348.o" + ("tpage-2348.go" "tpage-2349.go" "pecker-highres-ag.go" "king-highres-ag.go" "gauntlets-ag.go" - "ldmpckgn.o" + "ldmpckgn.go" )) diff --git a/goal_src/jak3/dgos/lerrol.gd b/goal_src/jak3/dgos/lerrol.gd index a7947a342d..d70d1dbc19 100644 --- a/goal_src/jak3/dgos/lerrol.gd +++ b/goal_src/jak3/dgos/lerrol.gd @@ -1,3 +1,3 @@ ("LERROL.DGO" - ("lerrol.o" + ("lerrol.go" )) diff --git a/goal_src/jak3/dgos/lfacb.gd b/goal_src/jak3/dgos/lfacb.gd index 8d08c5a966..d807affae8 100644 --- a/goal_src/jak3/dgos/lfacb.gd +++ b/goal_src/jak3/dgos/lfacb.gd @@ -2,5 +2,5 @@ ("lfaccity-mood.o" "tpage-3401.go" "tpage-3402.go" - "lfacctyb-vis.o" + "lfacctyb-vis.go" )) diff --git a/goal_src/jak3/dgos/lfaccar.gd b/goal_src/jak3/dgos/lfaccar.gd index 5fbddde608..cfa636fe19 100644 --- a/goal_src/jak3/dgos/lfaccar.gd +++ b/goal_src/jak3/dgos/lfaccar.gd @@ -46,5 +46,5 @@ "tpage-2867.go" "faccar-ag.go" "vehicle-explosion-ag.go" - "lfaccar.o" + "lfaccar.go" )) diff --git a/goal_src/jak3/dgos/lfaccity.gd b/goal_src/jak3/dgos/lfaccity.gd index da1cdb1517..e3c1c7a67e 100644 --- a/goal_src/jak3/dgos/lfaccity.gd +++ b/goal_src/jak3/dgos/lfaccity.gd @@ -2,5 +2,5 @@ ("lfaccity-mood.o" "tpage-1950.go" "tpage-1951.go" - "lfaccity.o" + "lfaccity.go" )) diff --git a/goal_src/jak3/dgos/lfaco.gd b/goal_src/jak3/dgos/lfaco.gd index 1261bac5f9..4038f4a84d 100644 --- a/goal_src/jak3/dgos/lfaco.gd +++ b/goal_src/jak3/dgos/lfaco.gd @@ -1,5 +1,5 @@ ("LFACO.DGO" - ("tpage-3287.o" + ("tpage-3287.go" "tpage-3288.go" - "lfacout-vis.o" + "lfacout-vis.go" )) diff --git a/goal_src/jak3/dgos/lfacrm1.gd b/goal_src/jak3/dgos/lfacrm1.gd index 360e374990..459f82d79c 100644 --- a/goal_src/jak3/dgos/lfacrm1.gd +++ b/goal_src/jak3/dgos/lfacrm1.gd @@ -4,5 +4,5 @@ "tpage-2070.go" "lfac-hanger-door-ag.go" "cty-door-ag.go" - "lfacrm1.o" + "lfacrm1.go" )) diff --git a/goal_src/jak3/dgos/lfacrm2.gd b/goal_src/jak3/dgos/lfacrm2.gd index 32937b4e0b..ceee0ff071 100644 --- a/goal_src/jak3/dgos/lfacrm2.gd +++ b/goal_src/jak3/dgos/lfacrm2.gd @@ -9,5 +9,5 @@ "robo-hover-ag.go" "fac-elevator-a-ag.go" "kg-debris-ag.go" - "lfacrm2.o" + "lfacrm2.go" )) diff --git a/goal_src/jak3/dgos/lfactory.gd b/goal_src/jak3/dgos/lfactory.gd index 785378b3fd..9be1fb3ab1 100644 --- a/goal_src/jak3/dgos/lfactory.gd +++ b/goal_src/jak3/dgos/lfactory.gd @@ -44,5 +44,5 @@ "factorya-init.o" "jak-pilot+0-ag.go" "jak-pilot-hcar+0-ag.go" - "lfactory.o" + "lfactory.go" )) diff --git a/goal_src/jak3/dgos/lform.gd b/goal_src/jak3/dgos/lform.gd index 4b38812941..674c9a7aed 100644 --- a/goal_src/jak3/dgos/lform.gd +++ b/goal_src/jak3/dgos/lform.gd @@ -35,5 +35,5 @@ "neo-debris-ag.go" "shield-sphere-distort-ag.go" "shield-sphere-ag.go" - "lformach-vis.o" + "lformach-vis.go" )) diff --git a/goal_src/jak3/dgos/lforp.gd b/goal_src/jak3/dgos/lforp.gd index 028c2cd200..6f6564e291 100644 --- a/goal_src/jak3/dgos/lforp.gd +++ b/goal_src/jak3/dgos/lforp.gd @@ -8,5 +8,5 @@ "mh-plant-ag.go" "egg-spider-ag.go" "shoulder-plates-ag.go" - "lforplnt-vis.o" + "lforplnt-vis.go" )) diff --git a/goal_src/jak3/dgos/lforring.gd b/goal_src/jak3/dgos/lforring.gd index 47c6ed9419..81c317628e 100644 --- a/goal_src/jak3/dgos/lforring.gd +++ b/goal_src/jak3/dgos/lforring.gd @@ -1,4 +1,4 @@ ("LFORRING.DGO" - ("tpage-1358.o" - "lforring.o" + ("tpage-1358.go" + "lforring.go" )) diff --git a/goal_src/jak3/dgos/lfreeout.gd b/goal_src/jak3/dgos/lfreeout.gd index 400e3670d9..06c56b5b13 100644 --- a/goal_src/jak3/dgos/lfreeout.gd +++ b/goal_src/jak3/dgos/lfreeout.gd @@ -1,4 +1,4 @@ ("LFREEOUT.DGO" - ("tpage-3158.o" - "lfreeout.o" + ("tpage-3158.go" + "lfreeout.go" )) diff --git a/goal_src/jak3/dgos/lgunnorm.gd b/goal_src/jak3/dgos/lgunnorm.gd index 987a72808f..7a07aa9c4f 100644 --- a/goal_src/jak3/dgos/lgunnorm.gd +++ b/goal_src/jak3/dgos/lgunnorm.gd @@ -1,5 +1,5 @@ ("LGUNNORM.DGO" - ("tpage-3139.o" + ("tpage-3139.go" "tpage-3170.go" "gun-kg-target-ag.go" "gun-kg-target-bonus-ag.go" @@ -11,5 +11,5 @@ "gun-kg-target-b-ag.go" "gun-cit-b-ag.go" "gun-cit-c-ag.go" - "lgunnorm.o" + "lgunnorm.go" )) diff --git a/goal_src/jak3/dgos/lgunrnc.gd b/goal_src/jak3/dgos/lgunrnc.gd index 2cd59eb644..62d92270f0 100644 --- a/goal_src/jak3/dgos/lgunrnc.gd +++ b/goal_src/jak3/dgos/lgunrnc.gd @@ -1,5 +1,5 @@ ("LGUNRNC.DGO" - ("tpage-3171.o" + ("tpage-3171.go" "gun-rc-four-eyes-ag.go" "gun-rc-three-eyes-ag.go" "gun-rc-three-eyes-bonus-ag.go" @@ -7,5 +7,5 @@ "gun-rc-two-eyes-ag.go" "gun-rc-one-eye-ag.go" "gun-rachet-ag.go" - "lgunrnc.o" + "lgunrnc.go" )) diff --git a/goal_src/jak3/dgos/ljak.gd b/goal_src/jak3/dgos/ljak.gd index 2af11e2d3d..c3db6b274d 100644 --- a/goal_src/jak3/dgos/ljak.gd +++ b/goal_src/jak3/dgos/ljak.gd @@ -1,5 +1,5 @@ ("LJAK.DGO" - ("tpage-1527.o" + ("tpage-1527.go" "jak-highres-ag.go" - "ljak.o" + "ljak.go" )) diff --git a/goal_src/jak3/dgos/ljakc.gd b/goal_src/jak3/dgos/ljakc.gd index 938c019ebc..434593a646 100644 --- a/goal_src/jak3/dgos/ljakc.gd +++ b/goal_src/jak3/dgos/ljakc.gd @@ -1,6 +1,6 @@ ("LJAKC.DGO" - ("tpage-1466.o" + ("tpage-1466.go" "jakc-highres-ag.go" "red-gun-mod-two-ag.go" - "ljakc.o" + "ljakc.go" )) diff --git a/goal_src/jak3/dgos/ljakcklv.gd b/goal_src/jak3/dgos/ljakcklv.gd index 0cd786c0df..d21a4ad937 100644 --- a/goal_src/jak3/dgos/ljakcklv.gd +++ b/goal_src/jak3/dgos/ljakcklv.gd @@ -1,6 +1,6 @@ ("LJAKCKLV.DGO" - ("tpage-1542.o" + ("tpage-1542.go" "kleever-highres-ag.go" "jakc-highres-ag.go" - "ljakcklv.o" + "ljakcklv.go" )) diff --git a/goal_src/jak3/dgos/ljakklev.gd b/goal_src/jak3/dgos/ljakklev.gd index bf43749dd0..48a4ace725 100644 --- a/goal_src/jak3/dgos/ljakklev.gd +++ b/goal_src/jak3/dgos/ljakklev.gd @@ -1,6 +1,6 @@ ("LJAKKLEV.DGO" - ("tpage-1541.o" + ("tpage-1541.go" "kleever-highres-ag.go" "jak-highres-ag.go" - "ljakklev.o" + "ljakklev.go" )) diff --git a/goal_src/jak3/dgos/ljakndax.gd b/goal_src/jak3/dgos/ljakndax.gd index ad7a38c4e4..77e13677df 100644 --- a/goal_src/jak3/dgos/ljakndax.gd +++ b/goal_src/jak3/dgos/ljakndax.gd @@ -1,6 +1,6 @@ ("LJAKNDAX.DGO" - ("tpage-2362.o" + ("tpage-2362.go" "daxter-highres-ag.go" "jakc-highres-ag.go" - "ljakndax.o" + "ljakndax.go" )) diff --git a/goal_src/jak3/dgos/ljaksig.gd b/goal_src/jak3/dgos/ljaksig.gd index a36c53e96f..8b22d4503c 100644 --- a/goal_src/jak3/dgos/ljaksig.gd +++ b/goal_src/jak3/dgos/ljaksig.gd @@ -1,8 +1,8 @@ ("LJAKSIG.DGO" - ("tpage-1536.o" + ("tpage-1536.go" "tpage-1538.go" "tpage-1537.go" "sig-highres-ag.go" "jak-highres-ag.go" - "ljaksig.o" + "ljaksig.go" )) diff --git a/goal_src/jak3/dgos/ljinx.gd b/goal_src/jak3/dgos/ljinx.gd index 0dec3136d0..73036501d0 100644 --- a/goal_src/jak3/dgos/ljinx.gd +++ b/goal_src/jak3/dgos/ljinx.gd @@ -5,5 +5,5 @@ "jinx-ag.go" "krimson-wall-break-ag.go" "com-power-box-ag.go" - "ljinx.o" + "ljinx.go" )) diff --git a/goal_src/jak3/dgos/ljkcdmkl.gd b/goal_src/jak3/dgos/ljkcdmkl.gd index ef464f47d5..07073e621f 100644 --- a/goal_src/jak3/dgos/ljkcdmkl.gd +++ b/goal_src/jak3/dgos/ljkcdmkl.gd @@ -1,8 +1,8 @@ ("LJKCDMKL.DGO" - ("tpage-1810.o" + ("tpage-1810.go" "tpage-1811.go" "kleever-highres-ag.go" "jakc-highres-ag.go" "king-highres-ag.go" - "ljkcdmkl.o" + "ljkcdmkl.go" )) diff --git a/goal_src/jak3/dgos/ljkdmpk.gd b/goal_src/jak3/dgos/ljkdmpk.gd index b95ebacf33..2a9c82afe7 100644 --- a/goal_src/jak3/dgos/ljkdmpk.gd +++ b/goal_src/jak3/dgos/ljkdmpk.gd @@ -1,8 +1,8 @@ ("LJKDMPK.DGO" - ("tpage-1539.o" + ("tpage-1539.go" "tpage-1540.go" "pecker-highres-ag.go" "jakc-highres-ag.go" "king-highres-ag.go" - "ljkdmpk.o" + "ljkdmpk.go" )) diff --git a/goal_src/jak3/dgos/ljkdxvin.gd b/goal_src/jak3/dgos/ljkdxvin.gd index 482f553115..bf7a27a66d 100644 --- a/goal_src/jak3/dgos/ljkdxvin.gd +++ b/goal_src/jak3/dgos/ljkdxvin.gd @@ -1,9 +1,9 @@ ("LJKDXVIN.DGO" - ("tpage-2601.o" + ("tpage-2601.go" "tpage-2602.go" "daxter-highres-ag.go" "jakc-highres-ag.go" "vin-effect-ag.go" "particleman-ag.go" - "ljkdxvin.o" + "ljkdxvin.go" )) diff --git a/goal_src/jak3/dgos/ljkfeet.gd b/goal_src/jak3/dgos/ljkfeet.gd index f6ee9eb17a..2d03a83a98 100644 --- a/goal_src/jak3/dgos/ljkfeet.gd +++ b/goal_src/jak3/dgos/ljkfeet.gd @@ -1,5 +1,5 @@ ("LJKFEET.DGO" - ("tpage-2658.o" + ("tpage-2658.go" "jakc-feet-ag.go" - "ljkfeet.o" + "ljkfeet.go" )) diff --git a/goal_src/jak3/dgos/ljndklev.gd b/goal_src/jak3/dgos/ljndklev.gd index c0426ea941..bdc2acc5f3 100644 --- a/goal_src/jak3/dgos/ljndklev.gd +++ b/goal_src/jak3/dgos/ljndklev.gd @@ -1,7 +1,7 @@ ("LJNDKLEV.DGO" - ("tpage-1247.o" + ("tpage-1247.go" "daxter-highres-ag.go" "kleever-highres-ag.go" "jakc-highres-ag.go" - "ljndklev.o" + "ljndklev.go" )) diff --git a/goal_src/jak3/dgos/lkeira.gd b/goal_src/jak3/dgos/lkeira.gd index c99b664d37..a3beef4210 100644 --- a/goal_src/jak3/dgos/lkeira.gd +++ b/goal_src/jak3/dgos/lkeira.gd @@ -1,6 +1,6 @@ ("LKEIRA.DGO" - ("tpage-2131.o" + ("tpage-2131.go" "tpage-2132.go" "keira-highres-ag.go" - "lkeira.o" + "lkeira.go" )) diff --git a/goal_src/jak3/dgos/lkleever.gd b/goal_src/jak3/dgos/lkleever.gd index ea30108522..3eeb13e2e1 100644 --- a/goal_src/jak3/dgos/lkleever.gd +++ b/goal_src/jak3/dgos/lkleever.gd @@ -1,5 +1,5 @@ ("LKLEEVER.DGO" - ("tpage-1394.o" + ("tpage-1394.go" "kleever-highres-ag.go" - "lkleever.o" + "lkleever.go" )) diff --git a/goal_src/jak3/dgos/lmech.gd b/goal_src/jak3/dgos/lmech.gd index dea3493941..b02703c0cd 100644 --- a/goal_src/jak3/dgos/lmech.gd +++ b/goal_src/jak3/dgos/lmech.gd @@ -1,10 +1,10 @@ ("LMECH.DGO" - ("jak-mech+0-ag.o" + ("jak-mech+0-ag.go" "mech-part.o" "mech.o" "target-mech.o" "mech-states.o" "tpage-2955.go" "mech-ag.go" - "lmech.o" + "lmech.go" )) diff --git a/goal_src/jak3/dgos/lmhca.gd b/goal_src/jak3/dgos/lmhca.gd index cce6a23830..c03da1367d 100644 --- a/goal_src/jak3/dgos/lmhca.gd +++ b/goal_src/jak3/dgos/lmhca.gd @@ -1,4 +1,4 @@ ("LMHCA.DGO" - ("tpage-3142.o" - "lmhcitya-vis.o" + ("tpage-3142.go" + "lmhcitya-vis.go" )) diff --git a/goal_src/jak3/dgos/lmhcb.gd b/goal_src/jak3/dgos/lmhcb.gd index 32db84cd05..448c2eac61 100644 --- a/goal_src/jak3/dgos/lmhcb.gd +++ b/goal_src/jak3/dgos/lmhcb.gd @@ -1,4 +1,4 @@ ("LMHCB.DGO" - ("tpage-3141.o" - "lmhcityb-vis.o" + ("tpage-3141.go" + "lmhcityb-vis.go" )) diff --git a/goal_src/jak3/dgos/lnstcst.gd b/goal_src/jak3/dgos/lnstcst.gd index baf18a1b7e..6c2c117156 100644 --- a/goal_src/jak3/dgos/lnstcst.gd +++ b/goal_src/jak3/dgos/lnstcst.gd @@ -1,5 +1,5 @@ ("LNSTCST.DGO" - ("tpage-1766.o" + ("tpage-1766.go" "tpage-1768.go" "tpage-1767.go" "daxter-highres-ag.go" @@ -7,5 +7,5 @@ "sig-highres-ag.go" "desert-eggwall-break-ag.go" "scorpion-wheel-fma-ag.go" - "lnstcst.o" + "lnstcst.go" )) diff --git a/goal_src/jak3/dgos/lnstoa.gd b/goal_src/jak3/dgos/lnstoa.gd index 1d4c4507d1..a724882e16 100644 --- a/goal_src/jak3/dgos/lnstoa.gd +++ b/goal_src/jak3/dgos/lnstoa.gd @@ -1,5 +1,5 @@ ("LNSTOA.DGO" - ("tpage-1520.o" + ("tpage-1520.go" "tpage-1521.go" "tpage-1522.go" "nst-collapsing-stone-bridge-ag.go" @@ -8,5 +8,5 @@ "nst-metalhead-eggs-a-ag.go" "nst-metalhead-eggs-c-ag.go" "nst-metalhead-eggs-b-ag.go" - "lnstoba-vis.o" + "lnstoba-vis.go" )) diff --git a/goal_src/jak3/dgos/lnstobb.gd b/goal_src/jak3/dgos/lnstobb.gd index 922016a4a3..607c52948c 100644 --- a/goal_src/jak3/dgos/lnstobb.gd +++ b/goal_src/jak3/dgos/lnstobb.gd @@ -6,5 +6,5 @@ "mh-centipede-ag.go" "egg-spider-ag.go" "eco-crystal-light-ag.go" - "lnstobb.o" + "lnstobb.go" )) diff --git a/goal_src/jak3/dgos/lnstobc.gd b/goal_src/jak3/dgos/lnstobc.gd index 2747bdad44..774a47f4ad 100644 --- a/goal_src/jak3/dgos/lnstobc.gd +++ b/goal_src/jak3/dgos/lnstobc.gd @@ -1,3 +1,3 @@ ("LNSTOBC.DGO" - ("lnstobc.o" + ("lnstobc.go" )) diff --git a/goal_src/jak3/dgos/loninsim.gd b/goal_src/jak3/dgos/loninsim.gd index 76c61572a9..131af6b98d 100644 --- a/goal_src/jak3/dgos/loninsim.gd +++ b/goal_src/jak3/dgos/loninsim.gd @@ -1,5 +1,5 @@ ("LONINSIM.DGO" - ("tpage-3271.o" + ("tpage-3271.go" "onin-simple-ag.go" - "loninsim.o" + "loninsim.go" )) diff --git a/goal_src/jak3/dgos/loutro.gd b/goal_src/jak3/dgos/loutro.gd index a8e8d6d0e7..eb7873c5e0 100644 --- a/goal_src/jak3/dgos/loutro.gd +++ b/goal_src/jak3/dgos/loutro.gd @@ -1,5 +1,5 @@ ("LOUTRO.DGO" - ("tpage-2682.o" + ("tpage-2682.go" "tpage-2812.go" "tpage-2657.go" "daxter-highres-ag.go" @@ -7,5 +7,5 @@ "ottsel-veger-ag.go" "ottsel-leader-ag.go" "precursor-ship-ag.go" - "loutro.o" + "loutro.go" )) diff --git a/goal_src/jak3/dgos/loutro2.gd b/goal_src/jak3/dgos/loutro2.gd index 7ec58bdb6c..6b48cff585 100644 --- a/goal_src/jak3/dgos/loutro2.gd +++ b/goal_src/jak3/dgos/loutro2.gd @@ -1,10 +1,10 @@ ("LOUTRO2.DGO" - ("tpage-3069.o" + ("tpage-3069.go" "tpage-3070.go" "tpage-2746.go" "ottsel-daxpants-ag.go" "sig-highres-ag.go" "ottsel-dummy-ag.go" "ottsel-tess-ag.go" - "loutro2.o" + "loutro2.go" )) diff --git a/goal_src/jak3/dgos/loutro3.gd b/goal_src/jak3/dgos/loutro3.gd index 5ed79138f5..fd3284be25 100644 --- a/goal_src/jak3/dgos/loutro3.gd +++ b/goal_src/jak3/dgos/loutro3.gd @@ -1,7 +1,7 @@ ("LOUTRO3.DGO" - ("tpage-3273.o" + ("tpage-3273.go" "tpage-3274.go" "onin-simple-ag.go" "precursor-ship-door-ag.go" - "loutro3.o" + "loutro3.go" )) diff --git a/goal_src/jak3/dgos/lpatk.gd b/goal_src/jak3/dgos/lpatk.gd index c7aed77434..d0e05a5c3a 100644 --- a/goal_src/jak3/dgos/lpatk.gd +++ b/goal_src/jak3/dgos/lpatk.gd @@ -69,5 +69,5 @@ "neo-debris-ag.go" "shield-sphere-distort-ag.go" "shield-sphere-ag.go" - "lpattack-vis.o" + "lpattack-vis.go" )) diff --git a/goal_src/jak3/dgos/lpatkcs.gd b/goal_src/jak3/dgos/lpatkcs.gd index b542de4fce..db6f6a223e 100644 --- a/goal_src/jak3/dgos/lpatkcs.gd +++ b/goal_src/jak3/dgos/lpatkcs.gd @@ -1,9 +1,9 @@ ("LPATKCS.DGO" - ("tpage-2205.o" + ("tpage-2205.go" "tpage-1987.go" "tpage-2359.go" "daxter-highres-ag.go" "cty-dax-missile-launcher-ag.go" "particleman-ag.go" - "lpatkcs.o" + "lpatkcs.go" )) diff --git a/goal_src/jak3/dgos/lprecc.gd b/goal_src/jak3/dgos/lprecc.gd index 28d5b3e933..79d8b7559d 100644 --- a/goal_src/jak3/dgos/lprecc.gd +++ b/goal_src/jak3/dgos/lprecc.gd @@ -1,10 +1,10 @@ ("LPRECC.DGO" - ("tpage-2944.o" + ("tpage-2944.go" "tpage-2964.go" "tpage-3251.go" "precur-door-c-ag.go" "light-eco-vent-ag.go" "precur-door-a-ag.go" "precur-swingpole-pop-ag.go" - "lprecurc-vis.o" + "lprecurc-vis.go" )) diff --git a/goal_src/jak3/dgos/lprenme.gd b/goal_src/jak3/dgos/lprenme.gd index a8b04d9826..a1fac51e83 100644 --- a/goal_src/jak3/dgos/lprenme.gd +++ b/goal_src/jak3/dgos/lprenme.gd @@ -1,9 +1,9 @@ ("LPRENME.DGO" - ("tpage-2956.o" + ("tpage-2956.go" "neo-wasp-b-ag.go" "dm-ship-break-ag.go" "dm-ship-tent-brk-ag.go" "neo-debris-ag.go" "particleman-ag.go" - "lprenme.o" + "lprenme.go" )) diff --git a/goal_src/jak3/dgos/lptrl.gd b/goal_src/jak3/dgos/lptrl.gd index 4d0ebdcfa2..4b851b7719 100644 --- a/goal_src/jak3/dgos/lptrl.gd +++ b/goal_src/jak3/dgos/lptrl.gd @@ -1,5 +1,5 @@ ("LPTRL.DGO" - ("tpage-3280.o" + ("tpage-3280.go" "tpage-3279.go" "mantis-ag.go" "spyder-ag.go" @@ -8,5 +8,5 @@ "dark-eco-vent-ag.go" "light-eco-vent-ag.go" "dm-mine-spider-spawner-ag.go" - "lppatrol-vis.o" + "lppatrol-vis.go" )) diff --git a/goal_src/jak3/dgos/lsamos.gd b/goal_src/jak3/dgos/lsamos.gd index 66c74aef84..20545d817f 100644 --- a/goal_src/jak3/dgos/lsamos.gd +++ b/goal_src/jak3/dgos/lsamos.gd @@ -1,5 +1,5 @@ ("LSAMOS.DGO" - ("tpage-2133.o" + ("tpage-2133.go" "samos-highres-ag.go" - "lsamos.o" + "lsamos.go" )) diff --git a/goal_src/jak3/dgos/lseemwca.gd b/goal_src/jak3/dgos/lseemwca.gd index 5b1763f224..041fbb0160 100644 --- a/goal_src/jak3/dgos/lseemwca.gd +++ b/goal_src/jak3/dgos/lseemwca.gd @@ -1,5 +1,5 @@ ("LSEEMWCA.DGO" - ("tpage-2071.o" + ("tpage-2071.go" "seem-highres-ag.go" - "lseemwca.o" + "lseemwca.go" )) diff --git a/goal_src/jak3/dgos/lsig.gd b/goal_src/jak3/dgos/lsig.gd index 3812fdbaa1..fec4c79f18 100644 --- a/goal_src/jak3/dgos/lsig.gd +++ b/goal_src/jak3/dgos/lsig.gd @@ -1,6 +1,6 @@ ("LSIG.DGO" - ("tpage-1154.o" + ("tpage-1154.go" "tpage-1153.go" "sig-highres-ag.go" - "lsig.o" + "lsig.go" )) diff --git a/goal_src/jak3/dgos/lsigjakc.gd b/goal_src/jak3/dgos/lsigjakc.gd index 97d4971e0a..a4ade1482c 100644 --- a/goal_src/jak3/dgos/lsigjakc.gd +++ b/goal_src/jak3/dgos/lsigjakc.gd @@ -1,8 +1,8 @@ ("LSIGJAKC.DGO" - ("tpage-1449.o" + ("tpage-1449.go" "tpage-1451.go" "tpage-1450.go" "jakc-highres-ag.go" "sig-highres-ag.go" - "lsigjakc.o" + "lsigjakc.go" )) diff --git a/goal_src/jak3/dgos/lsigklv.gd b/goal_src/jak3/dgos/lsigklv.gd index ac2eb64df9..553d06c220 100644 --- a/goal_src/jak3/dgos/lsigklv.gd +++ b/goal_src/jak3/dgos/lsigklv.gd @@ -1,8 +1,8 @@ ("LSIGKLV.DGO" - ("tpage-2292.o" + ("tpage-2292.go" "tpage-2294.go" "tpage-2293.go" "kleever-highres-ag.go" "sig-highres-ag.go" - "lsigklv.o" + "lsigklv.go" )) diff --git a/goal_src/jak3/dgos/lsnkwhls.gd b/goal_src/jak3/dgos/lsnkwhls.gd index bd612f1f3a..110968eb4e 100644 --- a/goal_src/jak3/dgos/lsnkwhls.gd +++ b/goal_src/jak3/dgos/lsnkwhls.gd @@ -1,5 +1,5 @@ ("LSNKWHLS.DGO" - ("tpage-2588.o" + ("tpage-2588.go" "snake-wheel-fma-ag.go" - "lsnkwhls.o" + "lsnkwhls.go" )) diff --git a/goal_src/jak3/dgos/ltnfxhip.gd b/goal_src/jak3/dgos/ltnfxhip.gd index 849dde9d80..05252fa412 100644 --- a/goal_src/jak3/dgos/ltnfxhip.gd +++ b/goal_src/jak3/dgos/ltnfxhip.gd @@ -1,10 +1,10 @@ ("LTNFXHIP.DGO" - ("tpage-2312.o" + ("tpage-2312.go" "tpage-2311.go" "torn-highres-ag.go" "errol-effect-ag.go" "samos-effect-ag.go" "ashelin-effect-ag.go" "bomb-bot-movie-ag.go" - "ltnfxhip.o" + "ltnfxhip.go" )) diff --git a/goal_src/jak3/dgos/ltnjxhip.gd b/goal_src/jak3/dgos/ltnjxhip.gd index 4158b2ffa6..9b739b7212 100644 --- a/goal_src/jak3/dgos/ltnjxhip.gd +++ b/goal_src/jak3/dgos/ltnjxhip.gd @@ -1,5 +1,5 @@ ("LTNJXHIP.DGO" - ("tpage-2355.o" + ("tpage-2355.go" "tpage-2049.go" "tpage-2048.go" "torn-highres-ag.go" @@ -7,5 +7,5 @@ "purple-one-ag.go" "blue-gun-mod-three-ag.go" "cty-remote-ag.go" - "ltnjxhip.o" + "ltnjxhip.go" )) diff --git a/goal_src/jak3/dgos/ltorn.gd b/goal_src/jak3/dgos/ltorn.gd index 8c48cf4449..e0ea291bcb 100644 --- a/goal_src/jak3/dgos/ltorn.gd +++ b/goal_src/jak3/dgos/ltorn.gd @@ -1,5 +1,5 @@ ("LTORN.DGO" - ("tpage-1463.o" + ("tpage-1463.go" "torn-highres-ag.go" - "ltorn.o" + "ltorn.go" )) diff --git a/goal_src/jak3/dgos/ltornjnx.gd b/goal_src/jak3/dgos/ltornjnx.gd index 9ab91490e9..4f4a3034f6 100644 --- a/goal_src/jak3/dgos/ltornjnx.gd +++ b/goal_src/jak3/dgos/ltornjnx.gd @@ -1,6 +1,6 @@ ("LTORNJNX.DGO" - ("tpage-1479.o" + ("tpage-1479.go" "torn-highres-ag.go" "jinx-highres-ag.go" - "ltornjnx.o" + "ltornjnx.go" )) diff --git a/goal_src/jak3/dgos/ltornsam.gd b/goal_src/jak3/dgos/ltornsam.gd index 4dcbc64340..287dc29803 100644 --- a/goal_src/jak3/dgos/ltornsam.gd +++ b/goal_src/jak3/dgos/ltornsam.gd @@ -1,6 +1,6 @@ ("LTORNSAM.DGO" - ("tpage-1165.o" + ("tpage-1165.go" "samos-highres-ag.go" "torn-highres-ag.go" - "ltornsam.o" + "ltornsam.go" )) diff --git a/goal_src/jak3/dgos/ltowa.gd b/goal_src/jak3/dgos/ltowa.gd index 0cf9f620aa..9aefcfa5ca 100644 --- a/goal_src/jak3/dgos/ltowa.gd +++ b/goal_src/jak3/dgos/ltowa.gd @@ -1,5 +1,5 @@ ("LTOWA.DGO" - ("tpage-2644.o" + ("tpage-2644.go" "tpage-2910.go" "tpage-2645.go" "tpage-2646.go" @@ -8,5 +8,5 @@ "tow-large-plat-ag.go" "tow-spawner-ag.go" "tow-tentacle-ag.go" - "ltowera-vis.o" + "ltowera-vis.go" )) diff --git a/goal_src/jak3/dgos/ltowb.gd b/goal_src/jak3/dgos/ltowb.gd index b672741f5f..3b6e2de489 100644 --- a/goal_src/jak3/dgos/ltowb.gd +++ b/goal_src/jak3/dgos/ltowb.gd @@ -1,5 +1,5 @@ ("LTOWB.DGO" - ("tpage-2647.o" + ("tpage-2647.go" "tpage-2653.go" "tpage-2648.go" "tpage-2649.go" @@ -14,5 +14,5 @@ "tow-warp-effect-ag.go" "eco-crystal-dark-ag.go" "particleman-ag.go" - "ltowerb-vis.o" + "ltowerb-vis.go" )) diff --git a/goal_src/jak3/dgos/ltowcity.gd b/goal_src/jak3/dgos/ltowcity.gd index fa6318f4a9..a0082fdfd6 100644 --- a/goal_src/jak3/dgos/ltowcity.gd +++ b/goal_src/jak3/dgos/ltowcity.gd @@ -1,5 +1,5 @@ ("LTOWCITY.DGO" - ("tpage-2530.o" + ("tpage-2530.go" "tpage-2531.go" - "ltowcity.o" + "ltowcity.go" )) diff --git a/goal_src/jak3/dgos/ltrtwhls.gd b/goal_src/jak3/dgos/ltrtwhls.gd index ef216c4941..e5ba21bb41 100644 --- a/goal_src/jak3/dgos/ltrtwhls.gd +++ b/goal_src/jak3/dgos/ltrtwhls.gd @@ -1,5 +1,5 @@ ("LTRTWHLS.DGO" - ("tpage-2356.o" + ("tpage-2356.go" "turtle-wheel-fma-ag.go" - "ltrtwhls.o" + "ltrtwhls.go" )) diff --git a/goal_src/jak3/dgos/lvincst.gd b/goal_src/jak3/dgos/lvincst.gd index 8970af1876..b9c2cf4e14 100644 --- a/goal_src/jak3/dgos/lvincst.gd +++ b/goal_src/jak3/dgos/lvincst.gd @@ -1,5 +1,5 @@ ("LVINCST.DGO" - ("tpage-2869.o" + ("tpage-2869.go" "tpage-2870.go" "daxter-highres-ag.go" "jakc-highres-ag.go" @@ -8,5 +8,5 @@ "precursor-ag.go" "cipher-ag.go" "particleman-ag.go" - "lvincst.o" + "lvincst.go" )) diff --git a/goal_src/jak3/dgos/lwasbbv.gd b/goal_src/jak3/dgos/lwasbbv.gd index 1d20befbe8..ba9fa52c9d 100644 --- a/goal_src/jak3/dgos/lwasbbv.gd +++ b/goal_src/jak3/dgos/lwasbbv.gd @@ -1,4 +1,4 @@ ("LWASBBV.DGO" ("des-bbush-tasks.o" - "lwasbbv.o" + "lwasbbv.go" )) diff --git a/goal_src/jak3/dgos/lwassig.gd b/goal_src/jak3/dgos/lwassig.gd index 62e8471168..7d51574d5e 100644 --- a/goal_src/jak3/dgos/lwassig.gd +++ b/goal_src/jak3/dgos/lwassig.gd @@ -8,5 +8,5 @@ "tpage-1698.go" "tpage-1843.go" "sig-rider-ag.go" - "lwassig.o" + "lwassig.go" )) diff --git a/goal_src/jak3/dgos/lwlandm.gd b/goal_src/jak3/dgos/lwlandm.gd index 45a7d00517..834f3989ee 100644 --- a/goal_src/jak3/dgos/lwlandm.gd +++ b/goal_src/jak3/dgos/lwlandm.gd @@ -1,6 +1,6 @@ ("LWLANDM.DGO" - ("tpage-1550.o" + ("tpage-1550.go" "tpage-1551.go" "wlander-male-ag.go" - "lwlandm.o" + "lwlandm.go" )) diff --git a/goal_src/jak3/dgos/lwstdpck.gd b/goal_src/jak3/dgos/lwstdpck.gd index ae79d747bb..ce7b26e6c3 100644 --- a/goal_src/jak3/dgos/lwstdpck.gd +++ b/goal_src/jak3/dgos/lwstdpck.gd @@ -1,6 +1,6 @@ ("LWSTDPCK.DGO" - ("tpage-1367.o" + ("tpage-1367.go" "pecker-highres-ag.go" "jakc-highres-ag.go" - "lwstdpck.o" + "lwstdpck.go" )) diff --git a/goal_src/jak3/dgos/mhca.gd b/goal_src/jak3/dgos/mhca.gd index 0593186203..212e0347e1 100644 --- a/goal_src/jak3/dgos/mhca.gd +++ b/goal_src/jak3/dgos/mhca.gd @@ -19,5 +19,5 @@ "mhcity-vine-wriggler-big-ag.go" "mhcity-claw-finger-small-ag.go" "mhcity-twitch-blade-ag.go" - "mhcitya-vis.o" + "mhcitya-vis.go" )) diff --git a/goal_src/jak3/dgos/mhcb.gd b/goal_src/jak3/dgos/mhcb.gd index ec4301fa2e..87627e1fdf 100644 --- a/goal_src/jak3/dgos/mhcb.gd +++ b/goal_src/jak3/dgos/mhcb.gd @@ -17,5 +17,5 @@ "mhcity-vine-wriggler-big-ag.go" "mhcity-claw-finger-small-ag.go" "mhcity-twitch-blade-ag.go" - "mhcityb-vis.o" + "mhcityb-vis.go" )) diff --git a/goal_src/jak3/dgos/mhctycst.gd b/goal_src/jak3/dgos/mhctycst.gd index 6aea07953e..3fdc0772d0 100644 --- a/goal_src/jak3/dgos/mhctycst.gd +++ b/goal_src/jak3/dgos/mhctycst.gd @@ -1,9 +1,9 @@ ("MHCTYCST.DGO" - ("tpage-2367.o" + ("tpage-2367.go" "tpage-2379.go" "daxter-highres-ag.go" "darkjak-highres-ag.go" "mhcity-de-tower-egg-ag.go" "particleman-ag.go" - "mhctycst.o" + "mhctycst.go" )) diff --git a/goal_src/jak3/dgos/mia.gd b/goal_src/jak3/dgos/mia.gd index 473b63f4bb..058667867c 100644 --- a/goal_src/jak3/dgos/mia.gd +++ b/goal_src/jak3/dgos/mia.gd @@ -29,5 +29,5 @@ "min-elevator-ag.go" "min-boss-elev-ag.go" "min-bomb-train-debris-ag.go" - "minea-vis.o" + "minea-vis.go" )) diff --git a/goal_src/jak3/dgos/mib.gd b/goal_src/jak3/dgos/mib.gd index 60e46bd411..551d3c466b 100644 --- a/goal_src/jak3/dgos/mib.gd +++ b/goal_src/jak3/dgos/mib.gd @@ -1,5 +1,5 @@ ("MIB.DGO" - ("tpage-926.o" + ("tpage-926.go" "tpage-929.go" "tpage-928.go" "tpage-1856.go" @@ -18,5 +18,5 @@ "light-eco-vent-ag.go" "leggings-ag.go" "min-crane-switch-ag.go" - "mineb-vis.o" + "mineb-vis.go" )) diff --git a/goal_src/jak3/dgos/mic.gd b/goal_src/jak3/dgos/mic.gd index 6247ca3032..5986a49b7e 100644 --- a/goal_src/jak3/dgos/mic.gd +++ b/goal_src/jak3/dgos/mic.gd @@ -15,5 +15,5 @@ "min-falling-step-ag.go" "min-door-ag.go" "light-eco-vent-ag.go" - "minec-vis.o" + "minec-vis.go" )) diff --git a/goal_src/jak3/dgos/mined.gd b/goal_src/jak3/dgos/mined.gd index 4f598cf3e3..efeb2776fe 100644 --- a/goal_src/jak3/dgos/mined.gd +++ b/goal_src/jak3/dgos/mined.gd @@ -34,5 +34,5 @@ "particleman-ag.go" "cav-minecar-ag.go" "blue-two-upgrade-ag.go" - "mined.o" + "mined.go" )) diff --git a/goal_src/jak3/dgos/minee.gd b/goal_src/jak3/dgos/minee.gd index d1fdea08e7..07b4f49bc5 100644 --- a/goal_src/jak3/dgos/minee.gd +++ b/goal_src/jak3/dgos/minee.gd @@ -7,5 +7,5 @@ "jakc-highres-ag.go" "com-airlock-inner-ag.go" "sew-elevator-ag.go" - "minee.o" + "minee.go" )) diff --git a/goal_src/jak3/dgos/museum.gd b/goal_src/jak3/dgos/museum.gd index 65877abdc1..5ea263fa30 100644 --- a/goal_src/jak3/dgos/museum.gd +++ b/goal_src/jak3/dgos/museum.gd @@ -1,5 +1,5 @@ ("MUSEUM.DGO" - ("museum-anims+0-ag.o" + ("museum-anims+0-ag.go" "tpage-3296.go" "tpage-3310.go" "tpage-3297.go" @@ -13,5 +13,5 @@ "torn-highres-ag.go" "ashelin-highres-ag.go" "onin-highres-ag.go" - "museum.o" + "museum.go" )) diff --git a/goal_src/jak3/dgos/museum2.gd b/goal_src/jak3/dgos/museum2.gd index 3f1bc014aa..2467d551da 100644 --- a/goal_src/jak3/dgos/museum2.gd +++ b/goal_src/jak3/dgos/museum2.gd @@ -1,5 +1,5 @@ ("MUSEUM2.DGO" - ("museum-2-anims+0-ag.o" + ("museum-2-anims+0-ag.go" "tpage-3311.go" "tpage-3313.go" "tpage-3312.go" @@ -14,5 +14,5 @@ "ottsel-leader-ag.go" "ottsel-tess-ag.go" "jinx-highres-ag.go" - "museum2.o" + "museum2.go" )) diff --git a/goal_src/jak3/dgos/museum3.gd b/goal_src/jak3/dgos/museum3.gd index 46351e0fe1..bba5e6a191 100644 --- a/goal_src/jak3/dgos/museum3.gd +++ b/goal_src/jak3/dgos/museum3.gd @@ -1,5 +1,5 @@ ("MUSEUM3.DGO" - ("museum-3-anims+0-ag.o" + ("museum-3-anims+0-ag.go" "tpage-3360.go" "tpage-3362.go" "tpage-3361.go" @@ -10,5 +10,5 @@ "samos-highres-ag.go" "red-crimson-guard-highres-ag.go" "youngsamos-highres-ag.go" - "museum3.o" + "museum3.go" )) diff --git a/goal_src/jak3/dgos/museum3b.gd b/goal_src/jak3/dgos/museum3b.gd index 14f6177de7..b8d571330c 100644 --- a/goal_src/jak3/dgos/museum3b.gd +++ b/goal_src/jak3/dgos/museum3b.gd @@ -1,5 +1,5 @@ ("MUSEUM3B.DGO" - ("tpage-3415.o" + ("tpage-3415.go" "tpage-3416.go" "brutter-highres-ag.go" "krew-ag.go" @@ -8,5 +8,5 @@ "baron-highres-ag.go" "errol-highres-ag.go" "kid-highres-ag.go" - "museum3b.o" + "museum3b.go" )) diff --git a/goal_src/jak3/dgos/museum4.gd b/goal_src/jak3/dgos/museum4.gd index 7af91b28d9..dccd6db450 100644 --- a/goal_src/jak3/dgos/museum4.gd +++ b/goal_src/jak3/dgos/museum4.gd @@ -1,5 +1,5 @@ ("MUSEUM4.DGO" - ("tpage-3390.o" + ("tpage-3390.go" "tpage-3365.go" "tpage-3419.go" "tpage-3386.go" @@ -24,5 +24,5 @@ "warrior-ag.go" "minershort-ag.go" "flutflut-ag.go" - "museum4.o" + "museum4.go" )) diff --git a/goal_src/jak3/dgos/museum4b.gd b/goal_src/jak3/dgos/museum4b.gd index 6684e405bf..c905309d54 100644 --- a/goal_src/jak3/dgos/museum4b.gd +++ b/goal_src/jak3/dgos/museum4b.gd @@ -1,5 +1,5 @@ ("MUSEUM4B.DGO" - ("tpage-3417.o" + ("tpage-3417.go" "babak-ag.go" - "museum4b.o" + "museum4b.go" )) diff --git a/goal_src/jak3/dgos/nsa.gd b/goal_src/jak3/dgos/nsa.gd index 375eedf701..02401b5630 100644 --- a/goal_src/jak3/dgos/nsa.gd +++ b/goal_src/jak3/dgos/nsa.gd @@ -12,5 +12,5 @@ "tpage-446.go" "tpage-1072.go" "egg-spider-ag.go" - "nsta-vis.o" + "nsta-vis.go" )) diff --git a/goal_src/jak3/dgos/nsb.gd b/goal_src/jak3/dgos/nsb.gd index 1f72634768..6c64e653b7 100644 --- a/goal_src/jak3/dgos/nsb.gd +++ b/goal_src/jak3/dgos/nsb.gd @@ -1,5 +1,5 @@ ("NSB.DGO" - ("tpage-605.o" + ("tpage-605.go" "tpage-607.go" "tpage-606.go" "tpage-604.go" @@ -9,5 +9,5 @@ "nst-cocoon-b-ag.go" "nst-falling-stone-bridge-ag.go" "nst-falling-stone-bridge-goo-ag.go" - "nstb-vis.o" + "nstb-vis.go" )) diff --git a/goal_src/jak3/dgos/oasiscst.gd b/goal_src/jak3/dgos/oasiscst.gd index e46fc451be..1eed727570 100644 --- a/goal_src/jak3/dgos/oasiscst.gd +++ b/goal_src/jak3/dgos/oasiscst.gd @@ -1,5 +1,5 @@ ("OASISCST.DGO" - ("tpage-1600.o" + ("tpage-1600.go" "tpage-1601.go" "daxter-highres-ag.go" "jakc-highres-ag.go" @@ -7,5 +7,5 @@ "interceptor-wheel-fma-ag.go" "kidmedallion-ag.go" "particleman-ag.go" - "oasiscst.o" + "oasiscst.go" )) diff --git a/goal_src/jak3/dgos/onintent.gd b/goal_src/jak3/dgos/onintent.gd index 4130bf62f7..c264be6559 100644 --- a/goal_src/jak3/dgos/onintent.gd +++ b/goal_src/jak3/dgos/onintent.gd @@ -11,5 +11,5 @@ "jakc-highres-ag.go" "samos-highres-ag.go" "onin-highres-ag.go" - "onintent.o" + "onintent.go" )) diff --git a/goal_src/jak3/dgos/outcast3.gd b/goal_src/jak3/dgos/outcast3.gd index 1f415fbd76..081501dbd0 100644 --- a/goal_src/jak3/dgos/outcast3.gd +++ b/goal_src/jak3/dgos/outcast3.gd @@ -1,7 +1,7 @@ ("OUTCAST3.DGO" - ("tpage-3306.o" + ("tpage-3306.go" "tpage-3307.go" "torn-simple-ag.go" "keira-simple-ag.go" - "outcast3.o" + "outcast3.go" )) diff --git a/goal_src/jak3/dgos/outrocst.gd b/goal_src/jak3/dgos/outrocst.gd index 930b447017..05b86f3dbe 100644 --- a/goal_src/jak3/dgos/outrocst.gd +++ b/goal_src/jak3/dgos/outrocst.gd @@ -1,5 +1,5 @@ ("OUTROCST.DGO" - ("tpage-2596.o" + ("tpage-2596.go" "tpage-2597.go" "kleever-highres-ag.go" "pecker-highres-ag.go" @@ -9,5 +9,5 @@ "tess-highres-ag.go" "ashelin-highres-ag.go" "particleman-ag.go" - "outrocst.o" + "outrocst.go" )) diff --git a/goal_src/jak3/dgos/powergd.gd b/goal_src/jak3/dgos/powergd.gd index 0506597972..1f20a2e160 100644 --- a/goal_src/jak3/dgos/powergd.gd +++ b/goal_src/jak3/dgos/powergd.gd @@ -1,5 +1,5 @@ ("POWERGD.DGO" - ("tpage-2187.o" + ("tpage-2187.go" "tpage-2249.go" "tpage-3164.go" "tpage-3181.go" @@ -11,5 +11,5 @@ "pow-rings-ag.go" "switcher-ag.go" "grunt-head-ag.go" - "powergd.o" + "powergd.go" )) diff --git a/goal_src/jak3/dgos/preca.gd b/goal_src/jak3/dgos/preca.gd index 587c92b088..dd84cb717c 100644 --- a/goal_src/jak3/dgos/preca.gd +++ b/goal_src/jak3/dgos/preca.gd @@ -39,5 +39,5 @@ "shield-sphere-distort-ag.go" "precur-generator-d-gem-ag.go" "shield-sphere-ag.go" - "precura-vis.o" + "precura-vis.go" )) diff --git a/goal_src/jak3/dgos/precb.gd b/goal_src/jak3/dgos/precb.gd index 64390d9f41..bf618b72d0 100644 --- a/goal_src/jak3/dgos/precb.gd +++ b/goal_src/jak3/dgos/precb.gd @@ -1,5 +1,5 @@ ("PRECB.DGO" - ("tpage-2633.o" + ("tpage-2633.go" "tpage-2636.go" "precur-generator-b-ag.go" "precur-generator-c-ag.go" @@ -11,5 +11,5 @@ "shield-sphere-explode-ag.go" "shield-sphere-distort-ag.go" "shield-sphere-ag.go" - "precurb-vis.o" + "precurb-vis.go" )) diff --git a/goal_src/jak3/dgos/precc.gd b/goal_src/jak3/dgos/precc.gd index 149f2dbc81..281001db70 100644 --- a/goal_src/jak3/dgos/precc.gd +++ b/goal_src/jak3/dgos/precc.gd @@ -1,5 +1,5 @@ ("PRECC.DGO" - ("jak-pole+0-ag.o" + ("jak-pole+0-ag.go" "target-tube.o" "jak-tube+0-ag.go" "precurc-part.o" @@ -11,5 +11,5 @@ "precur-elevator-ag.go" "precur-door-a-ag.go" "precur-swingpole-pop-ag.go" - "precurc-vis.o" + "precurc-vis.go" )) diff --git a/goal_src/jak3/dgos/precd.gd b/goal_src/jak3/dgos/precd.gd index 8232f57cd0..ee9ebe78cc 100644 --- a/goal_src/jak3/dgos/precd.gd +++ b/goal_src/jak3/dgos/precd.gd @@ -49,5 +49,5 @@ "precur-planet-ag.go" "precur-bridge-g-blocks-break-ag.go" "particleman-ag.go" - "precurd-vis.o" + "precurd-vis.go" )) diff --git a/goal_src/jak3/dgos/raila.gd b/goal_src/jak3/dgos/raila.gd index b2f19e2b7d..f18cf89741 100644 --- a/goal_src/jak3/dgos/raila.gd +++ b/goal_src/jak3/dgos/raila.gd @@ -38,5 +38,5 @@ "comb-rail-rider-ag.go" "comb-energy-ring-ag.go" "vehicle-explosion-ag.go" - "raila.o" + "raila.go" )) diff --git a/goal_src/jak3/dgos/railb.gd b/goal_src/jak3/dgos/railb.gd index 29af864695..c7ad14df34 100644 --- a/goal_src/jak3/dgos/railb.gd +++ b/goal_src/jak3/dgos/railb.gd @@ -1,4 +1,4 @@ ("RAILB.DGO" - ("tpage-2487.o" - "railb.o" + ("tpage-2487.go" + "railb.go" )) diff --git a/goal_src/jak3/dgos/railb2.gd b/goal_src/jak3/dgos/railb2.gd index b0980c8512..7a8e8bfc66 100644 --- a/goal_src/jak3/dgos/railb2.gd +++ b/goal_src/jak3/dgos/railb2.gd @@ -1,4 +1,4 @@ ("RAILB2.DGO" - ("tpage-2708.o" - "railb2.o" + ("tpage-2708.go" + "railb2.go" )) diff --git a/goal_src/jak3/dgos/railc.gd b/goal_src/jak3/dgos/railc.gd index 0368e34b95..87099d6570 100644 --- a/goal_src/jak3/dgos/railc.gd +++ b/goal_src/jak3/dgos/railc.gd @@ -1,4 +1,4 @@ ("RAILC.DGO" - ("tpage-2484.o" - "railc.o" + ("tpage-2484.go" + "railc.go" )) diff --git a/goal_src/jak3/dgos/railcst.gd b/goal_src/jak3/dgos/railcst.gd index 6bd37be054..633cbbb030 100644 --- a/goal_src/jak3/dgos/railcst.gd +++ b/goal_src/jak3/dgos/railcst.gd @@ -1,5 +1,5 @@ ("RAILCST.DGO" - ("tpage-2711.o" + ("tpage-2711.go" "tpage-2512.go" "tpage-2904.go" "tpage-2513.go" @@ -20,5 +20,5 @@ "fma-gun-ag.go" "plat-fma-ag.go" "particleman-ag.go" - "railcst.o" + "railcst.go" )) diff --git a/goal_src/jak3/dgos/raild.gd b/goal_src/jak3/dgos/raild.gd index 60dc0e19bb..7cee89e477 100644 --- a/goal_src/jak3/dgos/raild.gd +++ b/goal_src/jak3/dgos/raild.gd @@ -1,6 +1,6 @@ ("RAILD.DGO" - ("tpage-2486.o" + ("tpage-2486.go" "blocking-plane-ag.go" "spotlight-ag.go" - "raild.o" + "raild.go" )) diff --git a/goal_src/jak3/dgos/raile.gd b/goal_src/jak3/dgos/raile.gd index e59f4b8531..f35f203a24 100644 --- a/goal_src/jak3/dgos/raile.gd +++ b/goal_src/jak3/dgos/raile.gd @@ -1,8 +1,8 @@ ("RAILE.DGO" - ("tpage-2485.o" + ("tpage-2485.go" "dummy1-ag.go" "dummy2-ag.go" "dummy3-ag.go" "dummy4-ag.go" - "raile.o" + "raile.go" )) diff --git a/goal_src/jak3/dgos/railf.gd b/goal_src/jak3/dgos/railf.gd index 6165fae85c..b7f3054486 100644 --- a/goal_src/jak3/dgos/railf.gd +++ b/goal_src/jak3/dgos/railf.gd @@ -1,4 +1,4 @@ ("RAILF.DGO" - ("tpage-2483.o" - "railf.o" + ("tpage-2483.go" + "railf.go" )) diff --git a/goal_src/jak3/dgos/railx.gd b/goal_src/jak3/dgos/railx.gd index a606525e3b..ec60b79b3b 100644 --- a/goal_src/jak3/dgos/railx.gd +++ b/goal_src/jak3/dgos/railx.gd @@ -7,5 +7,5 @@ "rail-gun-dark-ag.go" "rail-oracle-door-ag.go" "rail-oracle-eyes-ag.go" - "railx.o" + "railx.go" )) diff --git a/goal_src/jak3/dgos/rbct.gd b/goal_src/jak3/dgos/rbct.gd index 1ec703a7d8..d157a52f83 100644 --- a/goal_src/jak3/dgos/rbct.gd +++ b/goal_src/jak3/dgos/rbct.gd @@ -13,5 +13,5 @@ "rhino-wheel-fma-ag.go" "kidmedallion-ag.go" "particleman-ag.go" - "rublcst-vis.o" + "rublcst-vis.go" )) diff --git a/goal_src/jak3/dgos/ruba.gd b/goal_src/jak3/dgos/ruba.gd index 39ba392aa3..7aaa7d5cb6 100644 --- a/goal_src/jak3/dgos/ruba.gd +++ b/goal_src/jak3/dgos/ruba.gd @@ -1,5 +1,5 @@ ("RUBA.DGO" - ("tpage-2065.o" + ("tpage-2065.go" "tpage-2067.go" "tpage-2066.go" "tpage-2416.go" @@ -13,5 +13,5 @@ "rhino-wheel-fma-ag.go" "particleman-ag.go" "blocking-plane-ag.go" - "rubblea-vis.o" + "rubblea-vis.go" )) diff --git a/goal_src/jak3/dgos/ruba2.gd b/goal_src/jak3/dgos/ruba2.gd index 32e9ad1a2f..9ed2df7ff6 100644 --- a/goal_src/jak3/dgos/ruba2.gd +++ b/goal_src/jak3/dgos/ruba2.gd @@ -1,9 +1,9 @@ ("RUBA2.DGO" - ("tpage-2508.o" + ("tpage-2508.go" "tpage-2509.go" "tpage-2510.go" "rub-tower-ag.go" "rub-electric-gate-panel-b-ag.go" "rub-electric-gate-panel-a-ag.go" - "rubblea2-vis.o" + "rubblea2-vis.go" )) diff --git a/goal_src/jak3/dgos/rubb.gd b/goal_src/jak3/dgos/rubb.gd index 88dc04fc70..b5823ab682 100644 --- a/goal_src/jak3/dgos/rubb.gd +++ b/goal_src/jak3/dgos/rubb.gd @@ -1,5 +1,5 @@ ("RUBB.DGO" - ("tpage-2058.o" + ("tpage-2058.go" "tpage-2059.go" "tpage-2060.go" "rub-rhino-door-ag.go" @@ -7,5 +7,5 @@ "rub-electric-gate-panel-a-ag.go" "security-wall-ag.go" "spotlight-ag.go" - "rubbleb-vis.o" + "rubbleb-vis.go" )) diff --git a/goal_src/jak3/dgos/rubc.gd b/goal_src/jak3/dgos/rubc.gd index aa24827dda..fd857e39f6 100644 --- a/goal_src/jak3/dgos/rubc.gd +++ b/goal_src/jak3/dgos/rubc.gd @@ -1,10 +1,10 @@ ("RUBC.DGO" - ("tpage-2055.o" + ("tpage-2055.go" "tpage-2056.go" "tpage-2057.go" "rub-rhino-door-ag.go" "rub-tower-ag.go" "rub-electric-gate-panel-d-ag.go" "rub-electric-gate-panel-c-ag.go" - "rubblec-vis.o" + "rubblec-vis.go" )) diff --git a/goal_src/jak3/dgos/sea.gd b/goal_src/jak3/dgos/sea.gd index b8affe22d0..d96a46f712 100644 --- a/goal_src/jak3/dgos/sea.gd +++ b/goal_src/jak3/dgos/sea.gd @@ -52,5 +52,5 @@ "sew-elevator-ag.go" "kg-debris-ag.go" "particleman-ag.go" - "sewa-vis.o" + "sewa-vis.go" )) diff --git a/goal_src/jak3/dgos/seb.gd b/goal_src/jak3/dgos/seb.gd index f790ca1bb2..55193cf361 100644 --- a/goal_src/jak3/dgos/seb.gd +++ b/goal_src/jak3/dgos/seb.gd @@ -1,5 +1,5 @@ ("SEB.DGO" - ("tpage-742.o" + ("tpage-742.go" "tpage-753.go" "tpage-743.go" "kg-grunt-ag.go" @@ -9,5 +9,5 @@ "sew-float-plat-ag.go" "sew-floor-switch-ag.go" "kg-debris-ag.go" - "sewb-vis.o" + "sewb-vis.go" )) diff --git a/goal_src/jak3/dgos/sec.gd b/goal_src/jak3/dgos/sec.gd index 2806fb9f5e..2e45a9d9e5 100644 --- a/goal_src/jak3/dgos/sec.gd +++ b/goal_src/jak3/dgos/sec.gd @@ -1,5 +1,5 @@ ("SEC.DGO" - ("tpage-744.o" + ("tpage-744.go" "tpage-754.go" "tpage-745.go" "tpage-751.go" @@ -9,5 +9,5 @@ "com-airlock-outer-ag.go" "sew-laser-guard-ag.go" "kg-debris-ag.go" - "sewc-vis.o" + "sewc-vis.go" )) diff --git a/goal_src/jak3/dgos/sed.gd b/goal_src/jak3/dgos/sed.gd index 322771723c..e6d604bc5d 100644 --- a/goal_src/jak3/dgos/sed.gd +++ b/goal_src/jak3/dgos/sed.gd @@ -15,5 +15,5 @@ "sew-wall-switch-ag.go" "kg-debris-ag.go" "sew-slide-step-ag.go" - "sewd-vis.o" + "sewd-vis.go" )) diff --git a/goal_src/jak3/dgos/see.gd b/goal_src/jak3/dgos/see.gd index 1ce01db714..dea885aa16 100644 --- a/goal_src/jak3/dgos/see.gd +++ b/goal_src/jak3/dgos/see.gd @@ -1,5 +1,5 @@ ("SEE.DGO" - ("tpage-748.o" + ("tpage-748.go" "tpage-756.go" "tpage-749.go" "tpage-755.go" @@ -9,5 +9,5 @@ "kg-debris-ag.go" "sew-power-switch-ag.go" "sew-moving-step-b-ag.go" - "sewe-vis.o" + "sewe-vis.go" )) diff --git a/goal_src/jak3/dgos/sef.gd b/goal_src/jak3/dgos/sef.gd index 59a96a76a1..08b788576c 100644 --- a/goal_src/jak3/dgos/sef.gd +++ b/goal_src/jak3/dgos/sef.gd @@ -1,5 +1,5 @@ ("SEF.DGO" - ("tpage-757.o" + ("tpage-757.go" "tpage-759.go" "tpage-758.go" "com-airlock-outer-ag.go" @@ -7,5 +7,5 @@ "sew-poison-switch-ag.go" "sew-gas-step-ag.go" "sew-curved-door-ag.go" - "sewf-vis.o" + "sewf-vis.go" )) diff --git a/goal_src/jak3/dgos/seg.gd b/goal_src/jak3/dgos/seg.gd index 561bfdf175..40a2bb15c2 100644 --- a/goal_src/jak3/dgos/seg.gd +++ b/goal_src/jak3/dgos/seg.gd @@ -1,5 +1,5 @@ ("SEG.DGO" - ("tpage-1127.o" + ("tpage-1127.go" "tpage-1133.go" "tpage-1128.go" "tpage-1126.go" @@ -10,5 +10,5 @@ "sew-jump-pad-ag.go" "sew-move-plat-ag.go" "kg-debris-ag.go" - "sewg-vis.o" + "sewg-vis.go" )) diff --git a/goal_src/jak3/dgos/seh.gd b/goal_src/jak3/dgos/seh.gd index fec288a790..4873ab2ede 100644 --- a/goal_src/jak3/dgos/seh.gd +++ b/goal_src/jak3/dgos/seh.gd @@ -13,5 +13,5 @@ "sew-grate-plat-ag.go" "sew-move-plat-ag.go" "kg-debris-ag.go" - "sewh-vis.o" + "sewh-vis.go" )) diff --git a/goal_src/jak3/dgos/sei.gd b/goal_src/jak3/dgos/sei.gd index f9b0df0916..92d2564783 100644 --- a/goal_src/jak3/dgos/sei.gd +++ b/goal_src/jak3/dgos/sei.gd @@ -1,5 +1,5 @@ ("SEI.DGO" - ("tpage-1123.o" + ("tpage-1123.go" "tpage-1130.go" "tpage-1124.go" "tpage-1122.go" @@ -8,5 +8,5 @@ "sew-fence-gate-ag.go" "sew-floor-switch-ag.go" "sew-rove-plat-ag.go" - "sewi-vis.o" + "sewi-vis.go" )) diff --git a/goal_src/jak3/dgos/sej.gd b/goal_src/jak3/dgos/sej.gd index 32c900cd0a..46c9c426f3 100644 --- a/goal_src/jak3/dgos/sej.gd +++ b/goal_src/jak3/dgos/sej.gd @@ -1,5 +1,5 @@ ("SEJ.DGO" - ("tpage-1135.o" + ("tpage-1135.go" "tpage-1137.go" "tpage-1136.go" "tpage-1134.go" @@ -7,5 +7,5 @@ "com-airlock-outer-ag.go" "com-airlock-inner-ag.go" "kg-debris-ag.go" - "sewj-vis.o" + "sewj-vis.go" )) diff --git a/goal_src/jak3/dgos/sek.gd b/goal_src/jak3/dgos/sek.gd index 224094f6aa..4c62879ca6 100644 --- a/goal_src/jak3/dgos/sek.gd +++ b/goal_src/jak3/dgos/sek.gd @@ -1,9 +1,9 @@ ("SEK.DGO" - ("tpage-1121.o" + ("tpage-1121.go" "tpage-1784.go" "tpage-1783.go" "com-airlock-outer-ag.go" "com-airlock-inner-ag.go" "sew-curved-door-ag.go" - "sewk-vis.o" + "sewk-vis.go" )) diff --git a/goal_src/jak3/dgos/sel.gd b/goal_src/jak3/dgos/sel.gd index f3dc9610f1..cba5907e09 100644 --- a/goal_src/jak3/dgos/sel.gd +++ b/goal_src/jak3/dgos/sel.gd @@ -1,10 +1,10 @@ ("SEL.DGO" - ("tpage-1143.o" + ("tpage-1143.go" "tpage-1145.go" "tpage-1144.go" "tpage-1142.go" "neo-wasp-ag.go" "com-airlock-outer-ag.go" "com-airlock-inner-ag.go" - "sewl-vis.o" + "sewl-vis.go" )) diff --git a/goal_src/jak3/dgos/sem.gd b/goal_src/jak3/dgos/sem.gd index 171ad7aad5..d94d08efe3 100644 --- a/goal_src/jak3/dgos/sem.gd +++ b/goal_src/jak3/dgos/sem.gd @@ -1,5 +1,5 @@ ("SEM.DGO" - ("tpage-1138.o" + ("tpage-1138.go" "tpage-1141.go" "tpage-1139.go" "tpage-1140.go" @@ -8,5 +8,5 @@ "sew-fan-ag.go" "sew-jump-pad-ag.go" "sew-m-gate-ag.go" - "sewm-vis.o" + "sewm-vis.go" )) diff --git a/goal_src/jak3/dgos/sen.gd b/goal_src/jak3/dgos/sen.gd index bee1f697c2..736e22853e 100644 --- a/goal_src/jak3/dgos/sen.gd +++ b/goal_src/jak3/dgos/sen.gd @@ -1,5 +1,5 @@ ("SEN.DGO" - ("tpage-1971.o" + ("tpage-1971.go" "tpage-1973.go" "tpage-1972.go" "tpage-1970.go" @@ -8,5 +8,5 @@ "com-airlock-inner-ag.go" "sew-fan-ag.go" "sew-pipe-ag.go" - "sewn-vis.o" + "sewn-vis.go" )) diff --git a/goal_src/jak3/dgos/seo.gd b/goal_src/jak3/dgos/seo.gd index 97161d948b..b2ff8d4d05 100644 --- a/goal_src/jak3/dgos/seo.gd +++ b/goal_src/jak3/dgos/seo.gd @@ -1,9 +1,9 @@ ("SEO.DGO" - ("tpage-1925.o" + ("tpage-1925.go" "tpage-1927.go" "tpage-1926.go" "neo-wasp-ag.go" "com-airlock-outer-ag.go" "com-airlock-inner-ag.go" - "sewo-vis.o" + "sewo-vis.go" )) diff --git a/goal_src/jak3/dgos/slumbset.gd b/goal_src/jak3/dgos/slumbset.gd index 3dcc7b32c8..ff705b47aa 100644 --- a/goal_src/jak3/dgos/slumbset.gd +++ b/goal_src/jak3/dgos/slumbset.gd @@ -7,5 +7,5 @@ "daxter-highres-ag.go" "keira-highres-ag.go" "jakc-highres-ag.go" - "slumbset.o" + "slumbset.go" )) diff --git a/goal_src/jak3/dgos/sta.gd b/goal_src/jak3/dgos/sta.gd index 65fe3cb1be..e99950b524 100644 --- a/goal_src/jak3/dgos/sta.gd +++ b/goal_src/jak3/dgos/sta.gd @@ -7,5 +7,5 @@ "tpage-2514.go" "daxter-highres-ag.go" "light-eco-vent-ag.go" - "stadium-vis.o" + "stadium-vis.go" )) diff --git a/goal_src/jak3/dgos/staa.gd b/goal_src/jak3/dgos/staa.gd index 5ccd70adfc..51cd13c4ca 100644 --- a/goal_src/jak3/dgos/staa.gd +++ b/goal_src/jak3/dgos/staa.gd @@ -20,5 +20,5 @@ "tpage-2450.go" "stadium-sails-left-ag.go" "stadium-sails-right-ag.go" - "stadiuma-vis.o" + "stadiuma-vis.go" )) diff --git a/goal_src/jak3/dgos/stb.gd b/goal_src/jak3/dgos/stb.gd index 57f16e17d8..d222b71f9f 100644 --- a/goal_src/jak3/dgos/stb.gd +++ b/goal_src/jak3/dgos/stb.gd @@ -1,9 +1,9 @@ ("STB.DGO" - ("tpage-319.o" + ("tpage-319.go" "tpage-318.go" "tpage-1974.go" "tpage-317.go" "jakc-highres-ag.go" "rub-falling-step-ag.go" - "stadiumb-vis.o" + "stadiumb-vis.go" )) diff --git a/goal_src/jak3/dgos/tema.gd b/goal_src/jak3/dgos/tema.gd index 5a7357b8af..d5cbe3e57b 100644 --- a/goal_src/jak3/dgos/tema.gd +++ b/goal_src/jak3/dgos/tema.gd @@ -1,5 +1,5 @@ ("TEMA.DGO" - ("jak-pole+0-ag.o" + ("jak-pole+0-ag.go" "battle.o" "hover-formation-h.o" "hover-nav-control-h.o" @@ -57,5 +57,5 @@ "shield-sphere-distort-ag.go" "tpl-oracle-eye-ag.go" "shield-sphere-ag.go" - "templea-vis.o" + "templea-vis.go" )) diff --git a/goal_src/jak3/dgos/temb.gd b/goal_src/jak3/dgos/temb.gd index e779224584..89b81242d3 100644 --- a/goal_src/jak3/dgos/temb.gd +++ b/goal_src/jak3/dgos/temb.gd @@ -1,5 +1,5 @@ ("TEMB.DGO" - ("tpage-2617.o" + ("tpage-2617.go" "tpage-2628.go" "tpage-2625.go" "tpl-break-alcove-ag.go" @@ -13,5 +13,5 @@ "tpl-spindle-ag.go" "tpl-elec-swing-pole-ag.go" "tpl-oracle-eye-ag.go" - "templeb-vis.o" + "templeb-vis.go" )) diff --git a/goal_src/jak3/dgos/temc.gd b/goal_src/jak3/dgos/temc.gd index de32e08837..7810d65116 100644 --- a/goal_src/jak3/dgos/temc.gd +++ b/goal_src/jak3/dgos/temc.gd @@ -1,5 +1,5 @@ ("TEMC.DGO" - ("tpage-2620.o" + ("tpage-2620.go" "tpage-2706.go" "tpage-2626.go" "tpage-2627.go" @@ -7,5 +7,5 @@ "tpage-3041.go" "tpl-symbol-ag.go" "tpl-banner-b-ag.go" - "templec-vis.o" + "templec-vis.go" )) diff --git a/goal_src/jak3/dgos/temd.gd b/goal_src/jak3/dgos/temd.gd index ab06dc398f..3061a807ce 100644 --- a/goal_src/jak3/dgos/temd.gd +++ b/goal_src/jak3/dgos/temd.gd @@ -12,5 +12,5 @@ "light-eco-vent-ag.go" "tpl-elevator-ag.go" "tpl-bridge-debris-ag.go" - "templed-vis.o" + "templed-vis.go" )) diff --git a/goal_src/jak3/dgos/temp.gd b/goal_src/jak3/dgos/temp.gd index 829c376c2a..ceffeec6aa 100644 --- a/goal_src/jak3/dgos/temp.gd +++ b/goal_src/jak3/dgos/temp.gd @@ -1,5 +1,5 @@ ("TEMP.DGO" - ("tpage-3228.o" + ("tpage-3228.go" "precursor-ship-ag.go" - "temp.o" + "temp.go" )) diff --git a/goal_src/jak3/dgos/templee.gd b/goal_src/jak3/dgos/templee.gd index 81a56fff31..e26d9ff072 100644 --- a/goal_src/jak3/dgos/templee.gd +++ b/goal_src/jak3/dgos/templee.gd @@ -1,6 +1,6 @@ ("TEMPLEE.DGO" - ("tpage-2909.o" + ("tpage-2909.go" "veger-highres-ag.go" "seem-highres-ag.go" - "templee.o" + "templee.go" )) diff --git a/goal_src/jak3/dgos/temx.gd b/goal_src/jak3/dgos/temx.gd index 744a47909a..2ea19af5ff 100644 --- a/goal_src/jak3/dgos/temx.gd +++ b/goal_src/jak3/dgos/temx.gd @@ -11,5 +11,5 @@ "tpage-2169.go" "tpl-stone-break-ag.go" "tpl-inner-airlock-door-ag.go" - "templex-vis.o" + "templex-vis.go" )) diff --git a/goal_src/jak3/dgos/title.gd b/goal_src/jak3/dgos/title.gd index b89dd7c4bb..268287ddd6 100644 --- a/goal_src/jak3/dgos/title.gd +++ b/goal_src/jak3/dgos/title.gd @@ -1,16 +1,16 @@ ("TITLE.DGO" ("desert-dust-storm.o" - "0credits-tx.o" - "1credits-tx.o" - "2credits-tx.o" - "3credits-tx.o" - "4credits-tx.o" - "5credits-tx.o" - "6credits-tx.o" - "7credits-tx.o" - "8credits-tx.o" - "9credits-tx.o" - "10credits-tx.o" + "0credits-tx.go" + "1credits-tx.go" + "2credits-tx.go" + "3credits-tx.go" + "4credits-tx.go" + "5credits-tx.go" + "6credits-tx.go" + "7credits-tx.go" + "8credits-tx.go" + "9credits-tx.go" + "10credits-tx.go" "credits-h.o" "credits.o" "title-obs.o" @@ -18,5 +18,5 @@ "tpage-1854.go" "tpage-1324.go" "jakthreelogo-ag.go" - "title.o" + "title.go" )) diff --git a/goal_src/jak3/dgos/towb.gd b/goal_src/jak3/dgos/towb.gd index f8d697f58e..ffcbea7fb0 100644 --- a/goal_src/jak3/dgos/towb.gd +++ b/goal_src/jak3/dgos/towb.gd @@ -1,5 +1,5 @@ ("TOWB.DGO" - ("tpage-2650.o" + ("tpage-2650.go" "tpage-2948.go" "tpage-2652.go" "tpage-2651.go" @@ -10,5 +10,5 @@ "tow-energy-bridge-ag.go" "tow-tentacle-ag.go" "neo-debris-ag.go" - "towerb-vis.o" + "towerb-vis.go" )) diff --git a/goal_src/jak3/dgos/towera.gd b/goal_src/jak3/dgos/towera.gd index 20fbcf1c2e..a8f36ed11f 100644 --- a/goal_src/jak3/dgos/towera.gd +++ b/goal_src/jak3/dgos/towera.gd @@ -27,5 +27,5 @@ "neo-debris-ag.go" "shield-sphere-distort-ag.go" "shield-sphere-ag.go" - "towera.o" + "towera.go" )) diff --git a/goal_src/jak3/dgos/towerc.gd b/goal_src/jak3/dgos/towerc.gd index d05f1166b4..1bfecd467d 100644 --- a/goal_src/jak3/dgos/towerc.gd +++ b/goal_src/jak3/dgos/towerc.gd @@ -1,7 +1,7 @@ ("TOWERC.DGO" - ("tpage-2299.o" + ("tpage-2299.go" "tpage-2302.go" "daxter-highres-ag.go" "tow-break-ag.go" - "towerc.o" + "towerc.go" )) diff --git a/goal_src/jak3/dgos/towercst.gd b/goal_src/jak3/dgos/towercst.gd index 62bb7ce9e6..45c113efdf 100644 --- a/goal_src/jak3/dgos/towercst.gd +++ b/goal_src/jak3/dgos/towercst.gd @@ -1,5 +1,5 @@ ("TOWERCST.DGO" - ("tpage-3223.o" + ("tpage-3223.go" "tpage-2983.go" "tpage-3224.go" "tpage-3225.go" @@ -16,5 +16,5 @@ "tow-spawner-ag.go" "particleman-ag.go" "purple-three-ag.go" - "towercst.o" + "towercst.go" )) diff --git a/goal_src/jak3/dgos/vin.gd b/goal_src/jak3/dgos/vin.gd index 709700c235..5e145bc940 100644 --- a/goal_src/jak3/dgos/vin.gd +++ b/goal_src/jak3/dgos/vin.gd @@ -10,5 +10,5 @@ "warp-gate-ag.go" "vin-turbine-ag.go" "vin-door-ctyinda-ag.go" - "vinroom-vis.o" + "vinroom-vis.go" )) diff --git a/goal_src/jak3/dgos/voca.gd b/goal_src/jak3/dgos/voca.gd index d76754d2fb..dfd000b9c3 100644 --- a/goal_src/jak3/dgos/voca.gd +++ b/goal_src/jak3/dgos/voca.gd @@ -52,5 +52,5 @@ "vol-rising-step-c-ag.go" "vol-bouncer-ag.go" "vol-stone-lid-ag.go" - "volcanoa-vis.o" + "volcanoa-vis.go" )) diff --git a/goal_src/jak3/dgos/vocx.gd b/goal_src/jak3/dgos/vocx.gd index 4689808f82..35b85c93eb 100644 --- a/goal_src/jak3/dgos/vocx.gd +++ b/goal_src/jak3/dgos/vocx.gd @@ -26,5 +26,5 @@ "urn-c-ag.go" "urn-a-ag.go" "particleman-ag.go" - "volcanox.o" + "volcanox.go" )) diff --git a/goal_src/jak3/dgos/warpcast.gd b/goal_src/jak3/dgos/warpcast.gd index 15c9060f93..53135f9293 100644 --- a/goal_src/jak3/dgos/warpcast.gd +++ b/goal_src/jak3/dgos/warpcast.gd @@ -1,7 +1,7 @@ ("WARPCAST.DGO" - ("tpage-2270.o" + ("tpage-2270.go" "daxter-highres-ag.go" "jakc-highres-ag.go" "particleman-ag.go" - "warpcast.o" + "warpcast.go" )) diff --git a/goal_src/jak3/dgos/wasall.gd b/goal_src/jak3/dgos/wasall.gd index 4069e1114f..7b659b6326 100644 --- a/goal_src/jak3/dgos/wasall.gd +++ b/goal_src/jak3/dgos/wasall.gd @@ -58,5 +58,5 @@ "toad-ag.go" "rhino-ag.go" "vehicle-explosion-ag.go" - "wasall.o" + "wasall.go" )) diff --git a/goal_src/jak3/dgos/wascast.gd b/goal_src/jak3/dgos/wascast.gd index 02358e74e6..451b39c9cc 100644 --- a/goal_src/jak3/dgos/wascast.gd +++ b/goal_src/jak3/dgos/wascast.gd @@ -1,5 +1,5 @@ ("WASCAST.DGO" - ("tpage-1714.o" + ("tpage-1714.go" "tpage-2323.go" "daxter-highres-ag.go" "jakc-highres-ag.go" @@ -9,5 +9,5 @@ "eco-crystal-light-ag.go" "battle-amulet-ag.go" "particleman-ag.go" - "wascast.o" + "wascast.go" )) diff --git a/goal_src/jak3/dgos/waschase.gd b/goal_src/jak3/dgos/waschase.gd index d1dd00b355..77f72d9d4b 100644 --- a/goal_src/jak3/dgos/waschase.gd +++ b/goal_src/jak3/dgos/waschase.gd @@ -1,8 +1,8 @@ ("WASCHASE.DGO" - ("jak-kanga+0-ag.o" + ("jak-kanga+0-ag.go" "kanga-lizard.o" "tpage-1321.go" "tpage-1356.go" "kanga-lizard-ag.go" - "waschase.o" + "waschase.go" )) diff --git a/goal_src/jak3/dgos/wasdefen.gd b/goal_src/jak3/dgos/wasdefen.gd index a45091865f..02e5f52b85 100644 --- a/goal_src/jak3/dgos/wasdefen.gd +++ b/goal_src/jak3/dgos/wasdefen.gd @@ -1,8 +1,8 @@ ("WASDEFEN.DGO" - ("tpage-2527.o" + ("tpage-2527.go" "tpage-2224.go" "dm-robot-ag.go" "dm-missile-ag.go" "dm-debris-ag.go" - "wasdefen.o" + "wasdefen.go" )) diff --git a/goal_src/jak3/dgos/wasleapr.gd b/goal_src/jak3/dgos/wasleapr.gd index 4b37359be2..cc497f4920 100644 --- a/goal_src/jak3/dgos/wasleapr.gd +++ b/goal_src/jak3/dgos/wasleapr.gd @@ -15,5 +15,5 @@ "tpage-1707.go" "monk-ag.go" "flut-wild-ag.go" - "wasleapr.o" + "wasleapr.go" )) diff --git a/goal_src/jak3/dgos/waspala.gd b/goal_src/jak3/dgos/waspala.gd index 994cc4489b..647c6e6d9d 100644 --- a/goal_src/jak3/dgos/waspala.gd +++ b/goal_src/jak3/dgos/waspala.gd @@ -22,5 +22,5 @@ "urn-a-ag.go" "particleman-ag.go" "waspala-blocker-ag.go" - "waspala.o" + "waspala.go" )) diff --git a/goal_src/jak3/dgos/waspgame.gd b/goal_src/jak3/dgos/waspgame.gd index daeff40bc9..8d9298e3f5 100644 --- a/goal_src/jak3/dgos/waspgame.gd +++ b/goal_src/jak3/dgos/waspgame.gd @@ -6,5 +6,5 @@ "neo-satellite-fma-ag.go" "neo-satellite-game-ring-ag.go" "neo-satellite-ps-symbols-ag.go" - "waspgame.o" + "waspgame.go" )) diff --git a/goal_src/jak3/dgos/wasseem.gd b/goal_src/jak3/dgos/wasseem.gd index 83d2407e1e..bd1bcfc99c 100644 --- a/goal_src/jak3/dgos/wasseem.gd +++ b/goal_src/jak3/dgos/wasseem.gd @@ -1,5 +1,5 @@ ("WASSEEM.DGO" - ("tpage-1211.o" + ("tpage-1211.go" "tpage-1533.go" "tpage-1468.go" "tpage-1975.go" @@ -10,5 +10,5 @@ "neo-satellite-break-ag.go" "eco-crystal-dark-ag.go" "particleman-ag.go" - "wasseem.o" + "wasseem.go" )) diff --git a/goal_src/jak3/dgos/wasstada.gd b/goal_src/jak3/dgos/wasstada.gd index 5b51c04f89..a7e0d82534 100644 --- a/goal_src/jak3/dgos/wasstada.gd +++ b/goal_src/jak3/dgos/wasstada.gd @@ -17,5 +17,5 @@ "wstd-blocker-ag.go" "wstd-square-plat-b-ag.go" "wstd-square-plat-c-ag.go" - "wasstada.o" + "wasstada.go" )) diff --git a/goal_src/jak3/dgos/wasstadb.gd b/goal_src/jak3/dgos/wasstadb.gd index d1fc241cd6..bf47c14fd6 100644 --- a/goal_src/jak3/dgos/wasstadb.gd +++ b/goal_src/jak3/dgos/wasstadb.gd @@ -10,5 +10,5 @@ "wstd-trapdoor-ag.go" "wstd-flag-ag.go" "arena-token-ag.go" - "wasstadb.o" + "wasstadb.go" )) diff --git a/goal_src/jak3/dgos/wasstadc.gd b/goal_src/jak3/dgos/wasstadc.gd index 2bdce63b30..303b58ace7 100644 --- a/goal_src/jak3/dgos/wasstadc.gd +++ b/goal_src/jak3/dgos/wasstadc.gd @@ -18,5 +18,5 @@ "wstd-fight-plat-box-ag.go" "pre-artifact-b-ag.go" "pre-artifact-c-ag.go" - "wasstadc.o" + "wasstadc.go" )) diff --git a/goal_src/jak3/dgos/wca.gd b/goal_src/jak3/dgos/wca.gd index de4a8f5d47..dbffeeee89 100644 --- a/goal_src/jak3/dgos/wca.gd +++ b/goal_src/jak3/dgos/wca.gd @@ -22,5 +22,5 @@ "wascity-stad-door-ag.go" "market-basket-b-ag.go" "market-basket-a-ag.go" - "wascitya-vis.o" + "wascitya-vis.go" )) diff --git a/goal_src/jak3/dgos/wcaseem.gd b/goal_src/jak3/dgos/wcaseem.gd index ca8eebdb35..231b792f60 100644 --- a/goal_src/jak3/dgos/wcaseem.gd +++ b/goal_src/jak3/dgos/wcaseem.gd @@ -1,5 +1,5 @@ ("WCASEEM.DGO" - ("tpage-1812.o" + ("tpage-1812.go" "seem-highres-ag.go" - "wcaseem.o" + "wcaseem.go" )) diff --git a/goal_src/jak3/dgos/wcb.gd b/goal_src/jak3/dgos/wcb.gd index 2e42fdd66e..7aa7147fa9 100644 --- a/goal_src/jak3/dgos/wcb.gd +++ b/goal_src/jak3/dgos/wcb.gd @@ -36,5 +36,5 @@ "market-basket-a-ag.go" "wascity-awning-b-ag.go" "cty-fruit-stand-ag.go" - "wascityb-vis.o" + "wascityb-vis.go" )) diff --git a/goal_src/jak3/dgos/win.gd b/goal_src/jak3/dgos/win.gd index 4906e7a38c..f48d6d60ee 100644 --- a/goal_src/jak3/dgos/win.gd +++ b/goal_src/jak3/dgos/win.gd @@ -18,5 +18,5 @@ "tpage-1037.go" "des-cactus-b-ag.go" "des-cactus-a-ag.go" - "wasintro-vis.o" + "wasintro-vis.go" )) diff --git a/goal_src/jak3/dgos/wsd.gd b/goal_src/jak3/dgos/wsd.gd index 26927e803c..4464215e19 100644 --- a/goal_src/jak3/dgos/wsd.gd +++ b/goal_src/jak3/dgos/wsd.gd @@ -11,5 +11,5 @@ "interceptor-wheel-fma-ag.go" "wascity-airlock-small-ag.go" "particleman-ag.go" - "wasdoors-vis.o" + "wasdoors-vis.go" )) diff --git a/goal_src/jak3/dgos/wwd.gd b/goal_src/jak3/dgos/wwd.gd index 8b8949d92e..e23cec22d8 100644 --- a/goal_src/jak3/dgos/wwd.gd +++ b/goal_src/jak3/dgos/wwd.gd @@ -64,5 +64,5 @@ "wascity-flag-c-ag.go" "wascity-flag-a-ag.go" "wascity-wind-fan-ag.go" - "waswide-vis.o" + "waswide-vis.go" )) diff --git a/goal_src/jak3/engine/ai/enemy-h.gc b/goal_src/jak3/engine/ai/enemy-h.gc index 17d3f8bfde..6432813b1c 100644 --- a/goal_src/jak3/engine/ai/enemy-h.gc +++ b/goal_src/jak3/engine/ai/enemy-h.gc @@ -394,7 +394,7 @@ (rnd-chance? (_type_ float) symbol) (enemy-method-134 (_type_ float) symbol) (enemy-method-135 (_type_) none) - (set-ground-pat! (_type_ collide-query collide-spec float float float) pat-surface) + (set-ground-pat! (_type_ collide-query collide-spec float float float process) pat-surface) (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) (try-locate-ground (_type_ meters meters symbol collide-spec) symbol) (move-above-ground! (_type_ vector move-above-ground-params) none) diff --git a/goal_src/jak3/engine/ai/enemy.gc b/goal_src/jak3/engine/ai/enemy.gc index 9b7ed3641b..01e2e53f5f 100644 --- a/goal_src/jak3/engine/ai/enemy.gc +++ b/goal_src/jak3/engine/ai/enemy.gc @@ -777,8 +777,8 @@ (none) ) -(defmethod set-ground-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) - (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) +(defmethod set-ground-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) (let ((v0-1 (-> arg0 best-other-tri pat))) (set! (-> this root ground-pat) v0-1) v0-1 @@ -791,17 +791,9 @@ ) (defmethod try-locate-ground ((this enemy) (arg0 meters) (arg1 meters) (arg2 symbol) (arg3 collide-spec)) - (let* ((s4-0 (new 'stack-no-clear 'collide-query)) - (a0-1 this) - (t9-0 (method-of-object a0-1 set-ground-pat!)) - (v1-1 s4-0) - (t3-0 arg3) - (a3-1 arg0) - (t0-1 arg1) - (t1-0 1024.0) - ) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond - ((t9-0 a0-1 v1-1 t3-0 a3-1 t0-1 t1-0) + ((set-ground-pat! this s4-0 arg3 arg0 arg1 1024.0 (the-as process #f)) (let ((s5-1 (-> this root))) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> this root trans quad)) @@ -874,16 +866,9 @@ (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) - (let* ((s2-0 (new 'stack-no-clear 'collide-query)) - (t9-1 (method-of-object this set-ground-pat!)) - (a1-2 s2-0) - (a2-2 (-> arg1 gnd-collide-with)) - (a3-0 (-> arg1 popup)) - (t0-0 81920.0) - (t1-0 1024.0) - ) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) (cond - ((t9-1 this a1-2 a2-2 a3-0 t0-0 t1-0) + ((set-ground-pat! this s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s2-0 best-other-tri pat)) @@ -2309,18 +2294,18 @@ ) (set! (-> s5-1 quad) (-> gp-0 trans quad)) (vector-v++! s5-1 (-> gp-0 transv)) - (let* ((a0-6 gp-0) - (t9-4 (method-of-object a0-6 find-ground)) - (a2-1 (-> self enemy-info recover-gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (t9-4 a0-6 s4-1 a2-1 a3-0 t0-0 t1-0) - (when (>= (-> gp-0 gspot-pos y) (-> s5-1 y)) - (set! (-> s5-1 y) (-> gp-0 gspot-pos y)) - (vector-reset! (-> gp-0 transv)) - ) + (when (find-ground + gp-0 + s4-1 + (-> self enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + (when (>= (-> gp-0 gspot-pos y) (-> s5-1 y)) + (set! (-> s5-1 y) (-> gp-0 gspot-pos y)) + (vector-reset! (-> gp-0 transv)) ) ) (move-to-point! gp-0 s5-1) @@ -2362,15 +2347,8 @@ (defmethod on-ground? ((this enemy)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) - (let* ((a1-0 (new 'stack-no-clear 'collide-query)) - (v1-0 (-> this root)) - (t9-0 (method-of-object v1-0 find-ground)) - (a2-1 (-> this gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (t9-0 v1-0 a1-0 a2-1 a3-0 t0-0 t1-0) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (find-ground (-> this root) a1-0 (-> this gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f)) ) (>= (+ 409.6 (-> gp-0 gspot-pos y)) (-> gp-0 trans y)) ) @@ -2782,14 +2760,14 @@ (a1-0 (new 'stack-no-clear 'collide-query)) ) (if (or (< 0.0 (-> this root transv y)) (begin - (let* ((v1-3 gp-0) - (t9-0 (method-of-object v1-3 find-ground)) - (a2-1 (-> this enemy-info recover-gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (t9-0 v1-3 a1-0 a2-1 a3-0 t0-0 t1-0) + (find-ground + gp-0 + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) ) (let ((f0-2 (- (-> gp-0 trans y) (-> gp-0 gspot-pos y)))) (and (>= f0-2 -1228.8) (>= 6144.0 f0-2)) diff --git a/goal_src/jak3/engine/ai/traffic-h.gc b/goal_src/jak3/engine/ai/traffic-h.gc index 4f30b5d649..6ed17350d8 100644 --- a/goal_src/jak3/engine/ai/traffic-h.gc +++ b/goal_src/jak3/engine/ai/traffic-h.gc @@ -51,6 +51,9 @@ ) ;; ---traffic-h:traffic-type +(define-extern traffic-start (function none)) +(define-extern traffic-kill (function none)) + ;; DECOMP BEGINS (define *traffic-manager* (the-as traffic-manager #f)) diff --git a/goal_src/jak3/engine/anim/fma-sphere.gc b/goal_src/jak3/engine/anim/fma-sphere.gc index a7b2788514..2032d5a1a1 100644 --- a/goal_src/jak3/engine/anim/fma-sphere.gc +++ b/goal_src/jak3/engine/anim/fma-sphere.gc @@ -149,7 +149,7 @@ ) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> self root trans) (-> self sphere r) (new 'static 'rgba :r #x80 :g #x40 :a #x80) diff --git a/goal_src/jak3/engine/camera/cam-debug.gc b/goal_src/jak3/engine/camera/cam-debug.gc index d78bd4f336..da31051c08 100644 --- a/goal_src/jak3/engine/camera/cam-debug.gc +++ b/goal_src/jak3/engine/camera/cam-debug.gc @@ -9,3 +9,15 @@ ;; DECOMP BEGINS +;; TODO stubs +(defun cam-collision-record-save ((arg0 vector) (arg1 vector) (arg2 int) (arg3 symbol) (arg4 camera-slave)) + (none) + ) + +(defun cam-debug-add-los-tri ((arg0 (inline-array collide-cache-tri)) (arg1 vector) (arg2 vector)) + (none) + ) + +(defun cam-debug-reset-coll-tri () + (none) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/camera/cam-layout.gc b/goal_src/jak3/engine/camera/cam-layout.gc index bd0fc8ca04..512df3ae85 100644 --- a/goal_src/jak3/engine/camera/cam-layout.gc +++ b/goal_src/jak3/engine/camera/cam-layout.gc @@ -172,7 +172,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id bucket583) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) diff --git a/goal_src/jak3/engine/camera/cam-master.gc b/goal_src/jak3/engine/camera/cam-master.gc index 9e4416de39..abdd08ca09 100644 --- a/goal_src/jak3/engine/camera/cam-master.gc +++ b/goal_src/jak3/engine/camera/cam-master.gc @@ -995,7 +995,9 @@ (-> self local-down) (vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0) ) - (cam-master-effect) + (when (nonzero? cam-master-effect) ;; og:preserve-this not-yet-implemented check + (cam-master-effect) + ) ) ) :code (behavior () @@ -1057,7 +1059,9 @@ (let ((a1-4 (new-stack-vector0))) (tracking-spline-method-10 (-> self target-spline) a1-4) ) - (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) + (when (nonzero? group-rain-screend-drop) ;; og:preserve-this not-yet-implemented check + (set! (-> self water-drip) (create-launch-control group-rain-screend-drop self)) + ) (set! (-> self water-drip-time) (seconds -60)) (go cam-master-active) 0 diff --git a/goal_src/jak3/engine/camera/cam-start.gc b/goal_src/jak3/engine/camera/cam-start.gc index 3c0e4680d5..c23077e725 100644 --- a/goal_src/jak3/engine/camera/cam-start.gc +++ b/goal_src/jak3/engine/camera/cam-start.gc @@ -45,6 +45,4 @@ (none) ) -(format 0 "Skipping cam-start!!~%") -(format #t "Skipping cam-start!!~%") -;; (cam-start #f) +(cam-start #f) diff --git a/goal_src/jak3/engine/camera/cam-update.gc b/goal_src/jak3/engine/camera/cam-update.gc index 34e06253cb..71fe8351ab 100644 --- a/goal_src/jak3/engine/camera/cam-update.gc +++ b/goal_src/jak3/engine/camera/cam-update.gc @@ -212,8 +212,8 @@ ) (when (= a0-45 s3-0) (if (>= v1-95 0) - (add-debug-sphere #t (bucket-id bucket583) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :b #xff :a #x80)) - (add-debug-sphere #t (bucket-id bucket583) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :r #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :r #xff :a #x80)) ) ) ) @@ -245,7 +245,7 @@ (+! (-> a3-6 z) (the float (* (-> v1-109 back-box-max z) (the int (-> s4-1 bsp bsp-scale z))))) ) ) - (add-debug-box #t (bucket-id bucket583) a2-7 a3-6 (new 'static 'rgba :g #xff :b #xff :a #x80)) + (add-debug-box #t (bucket-id debug) a2-7 a3-6 (new 'static 'rgba :g #xff :b #xff :a #x80)) ) ) ) diff --git a/goal_src/jak3/engine/camera/camera-h.gc b/goal_src/jak3/engine/camera/camera-h.gc index 3f213b6d62..6cde45fbba 100644 --- a/goal_src/jak3/engine/camera/camera-h.gc +++ b/goal_src/jak3/engine/camera/camera-h.gc @@ -99,6 +99,9 @@ ;; cam-start (define-extern reset-cameras (function none)) +;; cam-interface +(define-extern camera-angle (function float)) + ;; DECOMP BEGINS (deftype cam-index (structure) diff --git a/goal_src/jak3/engine/collide/collide-cache-h.gc b/goal_src/jak3/engine/collide/collide-cache-h.gc index 6c2524d489..a6ac7ad902 100644 --- a/goal_src/jak3/engine/collide/collide-cache-h.gc +++ b/goal_src/jak3/engine/collide/collide-cache-h.gc @@ -17,6 +17,7 @@ (declare-type collide-cache-prim structure) (declare-type collide-using-spheres-params structure) (declare-type instance-tie structure) +(declare-type collide-list structure) ;; DECOMP BEGINS @@ -54,6 +55,7 @@ Contains a reference back to the source object (like a collide-shape or water-co (prim-index uint16 :overlay-at (-> extra-quad 8)) (user16 uint16 :overlay-at (-> extra-quad 10)) (user32 uint32 :overlay-at (-> extra-quad 12)) + (clear-flags uint128 :overlay-at (-> extra-quad 0)) ) ) @@ -74,8 +76,8 @@ This can represent a sphere, a triangle mesh, or a group of other primitives wit (prim-type prim-type :overlay-at (-> prim-core prim-type)) ) (:methods - (collide-cache-prim-method-9 () none) - (collide-cache-prim-method-10 () none) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) @@ -88,7 +90,9 @@ To use it, it must first be 'filled' with geometry. Then you can manually inspec The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything). It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'." ((num-tris int32) + (num-tris-u32 uint32 :overlay-at num-tris) (num-prims int32) + (num-prims-u32 uint32 :overlay-at num-prims) (ignore-mask pat-surface) (ignore-processes process 2) (collide-box bounding-box :inline) @@ -99,19 +103,19 @@ It is not useful for ollision queries against a specific foreground object, like (tris collide-cache-tri 461 :inline) ) (:methods - (collide-cache-method-9 () none) + (debug-draw (_type_) none) (fill-and-probe-using-line-sphere (_type_ collide-query) float) (fill-and-probe-using-spheres (_type_ collide-query) symbol) (fill-using-bounding-box (_type_ collide-query) none) (fill-using-line-sphere (_type_ collide-query) none) - (collide-cache-method-14 () none) - (collide-cache-method-15 () none) + (fill-using-spheres (_type_ collide-query) none) + (reset (_type_) none) (probe-using-line-sphere (_type_ collide-query) float) - (collide-cache-method-17 () none) - (collide-cache-method-18 () none) - (collide-cache-method-19 () none) - (collide-cache-method-20 () none) - (collide-cache-method-21 () none) + (probe-using-spheres (_type_ collide-query) symbol) + (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) + (fill-from-fg-boxes (_type_) none) + (fill-from-fg-line-sphere (_type_ collide-query) none) + (fill-from-water (_type_ water-control) none) (collide-cache-method-22 () none) (collide-cache-method-23 () none) (collide-cache-method-24 () none) diff --git a/goal_src/jak3/engine/collide/collide-cache.gc b/goal_src/jak3/engine/collide/collide-cache.gc index be8abab9e6..17a82ecfed 100644 --- a/goal_src/jak3/engine/collide/collide-cache.gc +++ b/goal_src/jak3/engine/collide/collide-cache.gc @@ -7,3 +7,885 @@ ;; DECOMP BEGINS +(defmethod reset ((this collide-cache)) + (set! (-> this num-tris) 0) + (set! (-> this num-prims) 0) + (set! (-> this ignore-processes 0) #f) + (set! (-> this ignore-processes 1) #f) + (set! *already-printed-exeeded-max-cache-tris* #f) + 0 + (none) + ) + +(defmethod fill-from-bg ((this collide-cache) + (arg0 (function collide-hash int collide-list collide-query int)) + (arg1 (function collide-cache collide-list collide-query none)) + (arg2 collide-query) + ) + (set! *already-printed-exeeded-max-cache-tris* #f) + (set! (-> *collide-list* num-items) 0) + (if *collide-list-boxes* + (add-debug-box + #t + (bucket-id debug) + (the-as vector (-> arg2 bbox)) + (-> arg2 bbox max) + (new 'static 'rgba :g #xff :b #xff :a #x80) + ) + ) + (dotimes (s3-0 (-> *level* length)) + (let ((v1-7 (-> *level* level s3-0))) + (if (= (-> v1-7 status) 'active) + (arg0 (-> v1-7 bsp collide-hash) 0 *collide-list* arg2) + ) + ) + ) + (if (> (-> *collide-list* num-items) 0) + (arg1 *collide-cache* *collide-list* arg2) + ) + 0 + (none) + ) + +;; WARN: Function (method 21 collide-cache) has a return type of none, but the expression builder found a return statement. +(defmethod fill-from-water ((this collide-cache) (arg0 water-control)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (if (or (not arg0) (zero? arg0)) + (return #f) + ) + (when (= (-> this num-prims) 100) + (if (and (= *cheat-mode* 'debug) (not *display-capture-mode*)) + (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") + ) + (return #f) + ) + (when (< 460 (+ (-> this num-tris) 2)) + (if (and (= *cheat-mode* 'debug) (not *display-capture-mode*)) + (print-exceeded-max-cache-tris) + ) + (return #f) + ) + (if (not (and (logtest? (-> arg0 flags) (water-flag active)) + (logtest? (-> arg0 flags) (water-flag can-ground)) + (logtest? (-> arg0 flags) (water-flag swim-ground under-water)) + (logtest? (water-flag over-water) (-> arg0 flags)) + (not (logtest? (water-flag jump-out) (-> arg0 flags))) + ) + ) + (return #f) + ) + (let ((v1-31 (-> arg0 collide-height))) + (.lvf vf1 (&-> this collide-box min quad)) + (.lvf vf3 (&-> this collide-box max quad)) + (let ((a2-6 (-> this num-prims-u32)) + (a3-4 (the-as (inline-array collide-cache-tri) (-> this tris (-> this num-tris)))) + ) + (.mov vf5 v1-31) + (.add.x.vf vf1 vf0 vf5 :mask #b10) + (set! (-> a3-4 0 clear-flags) (the-as uint128 0)) + (set! (-> a3-4 0 prim-index) a2-6) + (.add.x.vf vf3 vf0 vf5 :mask #b10) + (set! (-> a3-4 1 clear-flags) (the-as uint128 0)) + (set! (-> a3-4 1 prim-index) a2-6) + (.mov.vf vf2 vf1) + (.mov.vf vf4 vf1) + (.add.z.vf vf2 vf0 vf3 :mask #b100) + (.add.x.vf vf4 vf0 vf3 :mask #b1) + (.svf (&-> a3-4 0 vertex 0 quad) vf1) + (.svf (&-> a3-4 0 vertex 1 quad) vf2) + (.svf (&-> a3-4 0 vertex 2 quad) vf3) + (set! (-> a3-4 0 pat) (new 'static 'pat-surface :material (pat-material waterbottom) :nogrind #x1)) + (set! (-> a3-4 0 collide-ptr) arg0) + (.svf (&-> a3-4 1 vertex 0 quad) vf1) + (.svf (&-> a3-4 1 vertex 1 quad) vf3) + (.svf (&-> a3-4 1 vertex 2 quad) vf4) + (set! (-> a3-4 1 pat) (new 'static 'pat-surface :material (pat-material waterbottom))) + (set! (-> a3-4 1 collide-ptr) arg0) + ) + ) + (let ((v1-34 *collide-shape-prim-water*) + (a1-5 (-> this prims (-> this num-prims))) + ) + (set! (-> a1-5 first-tri) (the-as uint (-> this num-tris))) + (set! (-> a1-5 num-tris) (the-as uint 2)) + (set! (-> a1-5 prim) v1-34) + (set! (-> a1-5 ccache) this) + (set! (-> a1-5 prim-core world-sphere quad) (-> v1-34 prim-core world-sphere quad)) + (set! (-> a1-5 prim-core quad 1) (-> v1-34 prim-core quad 1)) + ) + (+! (-> this num-prims) 1) + (+! (-> this num-tris) 2) + 0 + (none) + ) + ) + +(defmethod fill-using-bounding-box ((this collide-cache) (arg0 collide-query)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (+! (-> *collide-stats* calls) 1) + (new 'static 'vector :x 0.5) + (nop!) + (let ((v1-4 (-> arg0 collide-with-s32))) + (nop!) + (let ((a0-2 (-> arg0 ignore-process0))) + (nop!) + (let ((a1-1 (-> arg0 ignore-process1))) + (nop!) + (let ((a2-0 (-> arg0 ignore-pat-s32))) + (nop!) + (.lvf vf1 (&-> arg0 bbox min quad)) + (nop!) + (.lvf vf2 (&-> arg0 bbox max quad)) + (nop!) + (set! (-> this ignore-processes 0) (the-as process a0-2)) + (nop!) + (set! (-> this ignore-processes 1) (the-as process a1-1)) + (.mov.vf vf1 vf0 :mask #b1000) + (nop!) + (.mov.vf vf2 vf0 :mask #b1000) + (set! (-> this ignore-mask) (the-as pat-surface a2-0)) + ) + ) + ) + (.ftoi.vf vf3 vf1) + (nop!) + (.ftoi.vf vf4 vf2) + (set! (-> this num-tris) 0) + (nop!) + (.svf (&-> this collide-box min quad) vf1) + (nop!) + (.svf (&-> this collide-box max quad) vf2) + (nop!) + (.svf (&-> this collide-box4w min quad) vf3) + (nop!) + (.svf (&-> this collide-box4w max quad) vf4) + (nop!) + (.svf (&-> arg0 bbox4w min quad) vf3) + (nop!) + (.svf (&-> arg0 bbox4w max quad) vf4) + (nop!) + (set! (-> this num-prims) 0) + (nop!) + (set! (-> this collide-with) (the-as collide-spec v1-4)) + ) + 0 + (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) + (fill-from-bg + this + (the-as + (function collide-hash int collide-list collide-query int) + (method-of-type collide-hash drawable-method-11) + ) + collide-list-fill-bg-using-box + arg0 + ) + (dotimes (s4-0 (-> *level* length)) + (let ((v1-15 (-> *level* level s4-0))) + (when (= (-> v1-15 status) 'active) + (let ((a0-6 (-> v1-15 bsp hfrag-drawable))) + (if (nonzero? a0-6) + (hfragment-method-17 (the-as hfragment a0-6) this arg0) + ) + ) + ) + ) + ) + (let ((a0-7 (-> this num-tris))) + (when (> a0-7 0) + (let ((v1-22 (-> this prims)) + (a1-9 *collide-shape-prim-backgnd*) + ) + (set! (-> v1-22 0 num-tris) (the-as uint a0-7)) + (set! (-> v1-22 0 prim) a1-9) + (set! (-> this num-prims) 1) + (set! (-> v1-22 0 first-tri) (the-as uint 0)) + (set! (-> v1-22 0 ccache) this) + (set! (-> v1-22 0 prim-core world-sphere quad) (-> a1-9 prim-core world-sphere quad)) + (set! (-> v1-22 0 prim-core quad 1) (-> a1-9 prim-core quad 1)) + ) + ) + ) + (+! (-> *collide-stats* output) (-> this num-tris)) + ) + (when (logtest? (-> arg0 collide-with) (collide-spec water)) + (let ((v1-29 (-> arg0 ignore-process0))) + (if v1-29 + (fill-from-water this (-> (the-as process-drawable v1-29) water)) + ) + ) + ) + (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) + (fill-from-fg-boxes this) + ) + 0 + (none) + ) + ) + +(defmethod fill-using-line-sphere ((this collide-cache) (arg0 collide-query)) + ;; og:preserve-this float -> uint + (local-vars (v1-11 uint) (v1-20 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf2 :class vf) + (vf20 :class vf) + (vf22 :class vf) + (vf23 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (+! (-> *collide-stats* calls) 1) + (let ((v1-3 0)) + (if (< (fabs (-> arg0 move-dist x)) 4096.0) + (+! v1-3 1) + ) + (if (< (fabs (-> arg0 move-dist y)) 4096.0) + (+! v1-3 1) + ) + (if (< (fabs (-> arg0 move-dist z)) 4096.0) + (+! v1-3 1) + ) + (when (< 1 v1-3) + (set-from-point-offset-pad! (-> arg0 bbox) (-> arg0 start-pos) (-> arg0 move-dist) (-> arg0 radius)) + (fill-using-bounding-box this arg0) + (b! #t cfg-55 :delay (nop!)) + (the-as none 0) + ) + ) + (nop!) + (let ((v1-10 (-> arg0 ignore-pat-s32))) + (nop!) + (let ((a0-14 (-> arg0 ignore-process0))) + (nop!) + (let ((a1-3 (-> arg0 ignore-process1))) + (nop!) + (let ((a2-1 (-> arg0 collide-with-s32))) + (nop!) + (.lvf vf9 (&-> arg0 exit-planes 0 quad)) + (nop!) + (.lvf vf3 (&-> arg0 move-dist quad)) + (nop!) + (.mov.vf vf13 vf0) + (nop!) + (.lvf vf1 (&-> arg0 start-pos quad)) + (.mul.vf vf8 vf3 vf3) + (nop!) + (.add.vf vf2 vf1 vf3) + (set! (-> this ignore-mask) (the-as pat-surface v1-10)) + (.add.y.vf vf8 vf8 vf8 :mask #b1) + (set! (-> this num-tris) 0) + (.min.vf vf4 vf1 vf2) + (set! (-> this num-prims) 0) + (.max.vf vf5 vf1 vf2) + (set! (-> this collide-with) (the-as collide-spec a2-1)) + ) + (.sub.w.vf vf10 vf0 vf9 :mask #b111) + (set! (-> this ignore-processes 0) (the-as process a0-14)) + (.add.z.vf vf8 vf8 vf8 :mask #b1) + (set! (-> this ignore-processes 1) (the-as process a1-3)) + ) + ) + ) + (.sub.w.vf vf4 vf4 vf9 :mask #b111) + (nop!) + (.add.w.vf vf5 vf5 vf9 :mask #b111) + (nop!) + (.ftoi.vf vf15 vf10) + (nop!) + (.isqrt.vf Q vf0 vf8 :fsf #b11 :ftf #b0) + (nop!) + (.add.w.vf vf11 vf0 vf9 :mask #b111) + (nop!) + (nop!) + (nop!) + (nop!) + (.svf (&-> arg0 local-box4w min quad) vf15) + (.ftoi.vf vf6 vf4) + (.svf (&-> this collide-box min quad) vf4) + (.ftoi.vf vf7 vf5) + (.svf (&-> this collide-box max quad) vf5) + (nop!) + (.svf (&-> arg0 bbox min quad) vf4) + (nop!) + (.svf (&-> arg0 bbox max quad) vf5) + (nop!) + (.svf (&-> this collide-box4w min quad) vf6) + (nop!) + (.svf (&-> this collide-box4w max quad) vf7) + (nop!) + (.svf (&-> arg0 bbox4w min quad) vf6) + (nop!) + (.svf (&-> arg0 bbox4w max quad) vf7) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (nop!) + (.mul.x.vf vf12 vf3 vf8) + (nop!) + (.nop.vf) + (nop!) + (.div.vf Q vf0 vf8 :fsf #b11 :ftf #b0) + (nop!) + (.mul.vf vf22 vf12 vf12) + (nop!) + (.abs.vf vf23 vf12) + (nop!) + (.add.y.vf vf22 vf22 vf22 :mask #b1) + (.mov v1-11 vf23) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (nop!) + (b! (zero? v1-11) cfg-12 :likely-delay (.add.z.vf vf13 vf0 vf12 :mask #b1)) + (.sub.y.vf vf13 vf0 vf12 :mask #b1) + (nop!) + (.isqrt.vf Q vf0 vf22 :fsf #b11 :ftf #b0) + (nop!) + (.add.x.vf vf13 vf0 vf12 :mask #b10) + (nop!) + (.wait.vf) + (nop!) + (.mul.vf vf13 vf13 Q :mask #b11) + (nop!) + (label cfg-12) + (.outer.product.a.vf acc vf12 vf13) + (nop!) + (.add.x.vf vf11 vf11 vf8 :mask #b1) + (nop!) + (.outer.product.b.vf vf14 vf13 vf12 acc) + (nop!) + (.ftoi.vf vf16 vf11) + (nop!) + (.mov.vf vf17 vf12) + (nop!) + (.mov.vf vf18 vf13) + (nop!) + (.mov.vf vf19 vf14) + (nop!) + (.mov.vf vf17 vf0 :mask #b1110) + (.svf (&-> arg0 local-box4w max quad) vf16) + (.mov.vf vf18 vf0 :mask #b1101) + (nop!) + (.mov.vf vf19 vf0 :mask #b1011) + (nop!) + (.add.x.vf vf17 vf17 vf13 :mask #b10) + (nop!) + (.add.y.vf vf18 vf18 vf12 :mask #b1) + (nop!) + (.add.z.vf vf19 vf19 vf12 :mask #b1) + (nop!) + (.add.x.vf vf17 vf17 vf14 :mask #b100) + (nop!) + (.add.y.vf vf18 vf18 vf14 :mask #b100) + (nop!) + (.add.z.vf vf19 vf19 vf13 :mask #b10) + (nop!) + (.mul.x.vf acc vf17 vf1) + (nop!) + (.add.mul.y.vf acc vf18 vf1 acc) + (.svf (&-> arg0 inv-mat rvec quad) vf17) + (.add.mul.z.vf vf20 vf19 vf1 acc) + (.svf (&-> arg0 inv-mat uvec quad) vf18) + (.sub.vf vf20 vf0 vf20) + (.svf (&-> arg0 inv-mat fvec quad) vf19) + (nop!) + (.svf (&-> arg0 inv-mat trans quad) vf20) + (set! (-> arg0 rlength x) (if (= (-> arg0 move-dist x) 0.0) + 0.0 + (/ 1.0 (-> arg0 move-dist x)) + ) + ) + (set! (-> arg0 rlength y) (if (= (-> arg0 move-dist y) 0.0) + 0.0 + (/ 1.0 (-> arg0 move-dist y)) + ) + ) + (set! (-> arg0 rlength z) (if (= (-> arg0 move-dist z) 0.0) + 0.0 + (/ 1.0 (-> arg0 move-dist z)) + ) + ) + (let ((f0-19 1.0)) + (.lvf vf1 (&-> (-> arg0 move-dist) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-20 vf1) + (set! (-> arg0 rlength w) (/ f0-19 v1-20)) + ) + (set! (-> arg0 exit-planes 0 x) (if (< 0.0 (-> arg0 move-dist x)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 0 y) (if (< 0.0 (-> arg0 move-dist y)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 0 z) (if (< 0.0 (-> arg0 move-dist z)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 1 x) (if (< (-> arg0 move-dist x) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 1 y) (if (< (-> arg0 move-dist y) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 1 z) (if (< (-> arg0 move-dist z) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) + (fill-from-bg + this + (the-as + (function collide-hash int collide-list collide-query int) + (method-of-type collide-hash drawable-method-12) + ) + collide-list-fill-bg-using-line-sphere + arg0 + ) + (dotimes (s4-0 (-> *level* length)) + (let ((v1-36 (-> *level* level s4-0))) + (when (= (-> v1-36 status) 'active) + (let ((a0-18 (-> v1-36 bsp hfrag-drawable))) + (if (nonzero? a0-18) + (hfragment-method-18 (the-as hfragment a0-18) this arg0) + ) + ) + ) + ) + ) + (let ((a0-19 (-> this num-tris))) + (when (> a0-19 0) + (let ((v1-43 (-> this prims)) + (a1-11 *collide-shape-prim-backgnd*) + ) + (set! (-> v1-43 0 num-tris) (the-as uint a0-19)) + (set! (-> v1-43 0 prim) a1-11) + (set! (-> this num-prims) 1) + (set! (-> v1-43 0 first-tri) (the-as uint 0)) + (set! (-> v1-43 0 ccache) this) + (set! (-> v1-43 0 prim-core world-sphere quad) (-> a1-11 prim-core world-sphere quad)) + (set! (-> v1-43 0 prim-core quad 1) (-> a1-11 prim-core quad 1)) + ) + ) + ) + (+! (-> *collide-stats* output) (-> this num-tris)) + ) + (when (logtest? (-> arg0 collide-with) (collide-spec water)) + (let ((a1-13 (-> (the-as process-drawable (-> arg0 ignore-process0)) water))) + (if (nonzero? a1-13) + (fill-from-water this a1-13) + ) + ) + ) + (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) + (fill-from-fg-line-sphere this arg0) + ) + 0 + (label cfg-55) + (none) + ) + ) + +(defmethod fill-from-fg-boxes ((this collide-cache)) + (let ((s5-0 (-> this collide-with))) + (set! *actor-list-length* 0) + (if (logtest? s5-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* (add-an-object *actor-hash* (-> this collide-box) *actor-list* 256)) + ) + (when (logtest? s5-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s5-0 (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w))) + ) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + (set! a0-2 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-13 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? s5-0 (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w))) + ) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + (set! a0-5 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s4-0 *actor-list-length*) + (let ((v1-26 (-> *actor-list* s4-0))) + (when (logtest? s5-0 (-> v1-26 root-prim prim-core collide-as)) + (let ((a0-13 (-> v1-26 process))) + (if (not (or (= a0-13 (-> this ignore-processes 0)) (= a0-13 (-> this ignore-processes 1)))) + (add-fg-prim-using-box (-> v1-26 root-prim) this) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod add-fg-prim-using-box ((this collide-shape-prim) (arg0 collide-cache)) + (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") + (none) + ) + +(defmethod-mips2c "(method 10 collide-shape-prim-mesh)" 10 collide-shape-prim-mesh) + +(defmethod-mips2c "(method 10 collide-shape-prim-sphere)" 10 collide-shape-prim-sphere) + +(defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group) + +(defmethod fill-from-fg-line-sphere ((this collide-cache) (arg0 collide-query)) + (local-vars (v1-9 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (-> arg0 collide-with))) + (set! *actor-list-length* 0) + (if (logtest? s4-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* (fill-actor-list-for-sphere + *actor-hash* + (-> arg0 start-pos) + (-> arg0 move-dist) + (-> arg0 radius) + *actor-list* + 256 + -1 + ) + ) + ) + (let ((f30-0 0.0) + (s3-0 (new 'stack-no-clear 'matrix)) + ) + (.lvf vf1 (&-> (-> arg0 move-dist) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-9 vf1) + (let ((f0-1 v1-9)) + (if (< 0.0 f0-1) + (set! f30-0 (/ 1.0 f0-1)) + ) + ) + (when (logtest? s4-0 (collide-spec player-list)) + (let ((v1-17 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s2-0 (-> v1-17 next0))) + (while (!= v1-17 (-> *collide-player-list* alive-list-end)) + (let* ((s1-0 (-> (the-as connection v1-17) param1)) + (v1-18 (-> (the-as collide-shape s1-0) root-prim)) + ) + (when (logtest? s4-0 (-> v1-18 prim-core collide-as)) + (let ((s0-0 (-> v1-18 prim-core))) + (vector-! (-> s3-0 uvec) (the-as vector s0-0) (-> arg0 start-pos)) + (let* ((f1-2 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0)) + (f0-6 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-6) + ) + (let ((f0-7 (vector-vector-distance-squared (-> s3-0 rvec) (the-as vector s0-0))) + (f1-5 (+ (-> arg0 radius) (-> s0-0 world-sphere w))) + ) + (when (< f0-7 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! v1-17 s2-0) + *collide-player-list* + (set! s2-0 (-> s2-0 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-spec hit-by-player-list)) + (let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s2-1 (-> v1-38 next0))) + (while (!= v1-38 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((s1-1 (-> (the-as connection v1-38) param1)) + (v1-39 (-> (the-as collide-shape s1-1) root-prim)) + ) + (when (logtest? s4-0 (-> v1-39 prim-core collide-as)) + (let ((s0-1 (-> v1-39 prim-core))) + (vector-! (-> s3-0 uvec) (the-as vector s0-1) (-> arg0 start-pos)) + (let* ((f1-8 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0)) + (f0-11 (fmax 0.0 (fmin 1.0 f1-8))) + ) + (vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-11) + ) + (let ((f0-12 (vector-vector-distance-squared (-> s3-0 rvec) (the-as vector s0-1))) + (f1-11 (+ (-> arg0 radius) (-> s0-1 world-sphere w))) + ) + (when (< f0-12 (* f1-11 f1-11)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! v1-38 s2-1) + *collide-hit-by-player-list* + (set! s2-1 (-> s2-1 next0)) + ) + ) + ) + ) + ) + (dotimes (s3-1 *actor-list-length*) + (let ((v1-58 (-> *actor-list* s3-1))) + (when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as)) + (let ((a0-37 (-> v1-58 process))) + (if (not (or (= a0-37 (-> this ignore-processes 0)) (= a0-37 (-> this ignore-processes 1)))) + (add-fg-prim-using-line-sphere (-> v1-58 root-prim) this arg0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod add-fg-prim-using-line-sphere ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) + (format + 0 + "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" + ) + (none) + ) + +(defmethod-mips2c "(method 11 collide-shape-prim-mesh)" 11 collide-shape-prim-mesh) + +(defmethod-mips2c "(method 11 collide-shape-prim-sphere)" 11 collide-shape-prim-sphere) + +(defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) + +(defmethod fill-and-probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) + (fill-using-line-sphere this arg0) + (probe-using-line-sphere this arg0) + ) + +(deftype collide-puls-work (structure) + ((ignore-pat pat-surface) + (bsphere sphere :inline) + (move-dist vector :inline) + ) + ) + + +(defmethod probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) + (rlet ((vf0 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-cache-tri))) + (.lvf vf4 (&-> arg0 exit-planes 0 quad)) + (.lvf vf3 (&-> arg0 start-pos quad)) + (.lvf vf2 (&-> arg0 move-dist quad)) + (set! (-> s5-0 vertex 0 x) (the-as float (-> arg0 ignore-pat))) + (.mul.w.vf vf3 vf0 vf4 :mask #b1000) + (.svf (&-> s5-0 vertex 2 quad) vf2) + (.svf (&-> s5-0 vertex 1 quad) vf3) + (let ((s4-0 (the-as object (-> this prims))) + (f30-0 -100000000.0) + ) + (countdown (s3-0 (-> this num-prims)) + (when (and (logtest? (-> arg0 collide-with) (-> (the-as collide-cache-prim s4-0) prim-core collide-as)) + (logtest? (-> arg0 action-mask) (-> (the-as collide-cache-prim s4-0) prim-core action)) + ) + (cond + ((>= (-> (the-as collide-cache-prim s4-0) prim-core prim-type) 0) + (let ((f0-0 ((method-of-type collide-cache-prim resolve-moving-sphere-tri) + (the-as collide-cache-prim s4-0) + (the-as collide-tri-result arg0) + (the-as collide-prim-core (-> s5-0 vertex 1)) + (-> s5-0 vertex 2) + f30-0 + (collide-action solid) + ) + ) + ) + (if (>= f0-0 0.0) + (set! f30-0 f0-0) + ) + ) + ) + (else + (when (not (logtest? (-> arg0 ignore-pat) + (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s4-0) prim)) pat) + ) + ) + (let ((f0-1 ((method-of-type collide-cache-prim resolve-moving-sphere-sphere) + (the-as collide-cache-prim s4-0) + (the-as collide-tri-result arg0) + (the-as collide-prim-core (-> s5-0 vertex 1)) + (-> s5-0 vertex 2) + f30-0 + (collide-action solid) + ) + ) + ) + (if (>= f0-1 0.0) + (set! f30-0 f0-1) + ) + ) + ) + ) + ) + ) + (set! s4-0 (-> (the-as (inline-array collide-cache-prim) s4-0) 1)) + ) + f30-0 + ) + ) + ) + ) + +(deftype lsmi-work (structure) + ((best-u float) + (orig-best-u float) + (action uint32) + (cquery collide-query :inline) + ) + ) + + +(defmethod-mips2c "(method 9 collide-cache-prim)" 9 collide-cache-prim) + +(defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) + +(defmethod fill-and-probe-using-spheres ((this collide-cache) (arg0 collide-query)) + (fill-using-spheres this arg0) + (probe-using-spheres this arg0) + ) + +(defmethod fill-using-spheres ((this collide-cache) (arg0 collide-query)) + (new 'stack-no-clear 'bounding-box) + (set-from-spheres! + (-> arg0 bbox) + (the-as (inline-array sphere) (-> arg0 best-dist)) + (the-as int (-> arg0 best-other-prim)) + ) + (fill-using-bounding-box this arg0) + (none) + ) + +(defmethod-mips2c "(method 17 collide-cache)" 17 collide-cache) + +(defmethod-mips2c "(method 9 collide-puss-work)" 9 collide-puss-work) + +(defmethod-mips2c "(method 10 collide-puss-work)" 10 collide-puss-work) + + diff --git a/goal_src/jak3/engine/collide/collide-debug.gc b/goal_src/jak3/engine/collide/collide-debug.gc index f2dbc74754..51c6bac1d8 100644 --- a/goal_src/jak3/engine/collide/collide-debug.gc +++ b/goal_src/jak3/engine/collide/collide-debug.gc @@ -7,3 +7,288 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(defmethod debug-draw ((this collide-cache)) + (let ((gp-0 (the-as object (-> this tris)))) + (countdown (s4-0 (-> this num-tris)) + (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64))) + (add-debug-flat-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> (the-as collide-cache-tri gp-0) vertex)) + (-> (the-as collide-cache-tri gp-0) vertex 1) + (-> (the-as collide-cache-tri gp-0) vertex 2) + t1-0 + ) + ) + (set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64)) + ) + ) + (let ((gp-1 (the-as object (-> this prims)))) + (countdown (s5-1 (-> this num-prims)) + (when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) -1) + (let ((t0-1 + (copy-and-set-field + (-> *pat-mode-info* + (-> (the-as collide-shape-prim-sphere (-> (the-as collide-shape-prim gp-1) prim-core action)) pat mode) + color + ) + a + 64 + ) + ) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> (the-as collide-cache-prim gp-1) prim-core)) + (-> (the-as collide-cache-prim gp-1) prim-core world-sphere w) + t0-1 + ) + ) + ) + (set! gp-1 (&+ (the-as collide-cache-prim gp-1) 48)) + ) + ) + (print-collide-cache-tri-count) + 0 + (none) + ) + +(deftype col-rend-filter (structure) + ((show-pat-set pat-surface) + (show-pat-clear pat-surface) + (event-mask uint32) + ) + ) + + +;; WARN: Return type mismatch symbol vs none. +(defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (set! (-> s4-0 rvec quad) (-> (math-camera-matrix) fvec quad)) + (vector-normalize! (-> s4-0 rvec) 1.0) + (let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris)))) + (countdown (s2-0 (-> *collide-cache* num-tris)) + (vector-3pt-cross! (-> s4-0 uvec) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1) (-> s3-1 vertex 2)) + (vector-normalize! (-> s4-0 uvec) 1.0) + (when (or (-> arg0 show-back-faces?) (>= 0.0 (vector-dot (-> s4-0 rvec) (-> s4-0 uvec)))) + (let ((v1-9 (-> s3-1 pat))) + (cond + ((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-9 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (the-as int (-> v1-9 event))))) + ) + (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64))) + (add-debug-flat-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + t1-0 + ) + ) + (if (-> arg0 outline?) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + (new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x80) + ) + ) + (when (-> arg0 show-normals?) + (vector+! (-> s4-0 fvec) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1)) + (vector+! (-> s4-0 fvec) (-> s4-0 fvec) (-> s3-1 vertex 2)) + (vector-float/! (-> s4-0 fvec) (-> s4-0 fvec) 3.0) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 fvec) + (-> s4-0 uvec) + (meters 0.75) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + ) + ) + ((-> arg0 ghost-hidden?) + (add-debug-flat-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + (new 'static 'rgba :r #x20 :g #x20 :b #x20 :a #x20) + ) + (if (-> arg0 outline?) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + (new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x10) + ) + ) + ) + ) + ) + ) + (&+! s3-1 64) + ) + ) + ) + (let ((s5-1 (the-as object (-> *collide-cache* prims)))) + (countdown (s4-1 (-> *collide-cache* num-prims)) + (when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) -1) + (let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat))) + (when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-37 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (the-as int (-> v1-37 event))))) + ) + (let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> (the-as collide-cache-prim s5-1) prim-core)) + (-> (the-as collide-cache-prim s5-1) prim-core world-sphere w) + t0-5 + ) + ) + ) + ) + ) + (set! s5-1 (&+ (the-as collide-cache-prim s5-1) 48)) + ) + ) + (none) + ) + +(defmethod draw ((this col-rend)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f30-0 (-> this bbox-radius))) + (let ((v1-0 (-> this track))) + (cond + ((zero? v1-0) + (set! (-> this bbox-center quad) (-> (target-pos 0) quad)) + (+! (-> this bbox-center y) (* 0.7 f30-0)) + ) + ((= v1-0 1) + (position-in-front-of-camera! + (-> this bbox-center) + (+ (-> this camera-to-bbox-dist) (-> this bbox-radius)) + 0.0 + ) + ) + ) + ) + (set! (-> s5-0 bbox min quad) (-> this bbox-center quad)) + (set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0)) + (set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0)) + (set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0)) + (set! (-> s5-0 bbox max quad) (-> this bbox-center quad)) + (+! (-> s5-0 bbox max x) f30-0) + (+! (-> s5-0 bbox max y) f30-0) + (+! (-> s5-0 bbox max z) f30-0) + ) + (let ((v1-9 -1)) + (let ((a0-9 (-> this cspec))) + (if (not (logtest? a0-9 (collide-spec crate))) + (set! v1-9 (logxor v1-9 1)) + ) + (if (not (logtest? a0-9 (collide-spec civilian))) + (set! v1-9 (logxor v1-9 64)) + ) + (if (not (logtest? a0-9 (collide-spec enemy))) + (set! v1-9 (logxor #x100000 v1-9)) + ) + (if (not (logtest? a0-9 (collide-spec obstacle))) + (set! v1-9 (logxor v1-9 2)) + ) + (if (not (logtest? a0-9 (collide-spec vehicle-sphere))) + (set! v1-9 (logand #x100743 v1-9)) + ) + ) + (set! (-> s5-0 collide-with) (the-as collide-spec v1-9)) + ) + (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface)) + (set! (-> s5-0 ignore-process0) #f) + (set! (-> s5-0 ignore-process1) #f) + (add-debug-box + #t + (bucket-id debug) + (the-as vector (-> s5-0 bbox)) + (-> s5-0 bbox max) + (if (logtest? (current-time) 128) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x20) + (new 'static 'rgba :a #x20) + ) + ) + (fill-using-bounding-box *collide-cache* s5-0) + ) + (let ((s5-1 (-> this show-only)) + (a1-17 (new 'stack 'col-rend-filter)) + ) + (when (nonzero? s5-1) + (cond + ((logtest? s5-1 8) + (set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :noboard #x1)) + ) + ((logtest? s5-1 16) + (set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1)) + ) + ((logtest? s5-1 32) + (set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1)) + (set! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nojak #x1 :board #x1)) + ) + (else + (if (logtest? s5-1 8192) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nolineofsight #x1)) + ) + (if (logtest? s5-1 1024) + (set! (-> a1-17 show-pat-set noentity) 1) + ) + (if (logtest? s5-1 64) + (set! (-> a1-17 show-pat-set noboard) 1) + ) + (if (logtest? s5-1 2048) + (set! (-> a1-17 show-pat-set nogrind) 1) + ) + (if (logtest? s5-1 128) + (set! (-> a1-17 show-pat-set nocamera) 1) + ) + (if (logtest? s5-1 4096) + (set! (-> a1-17 show-pat-set nojak) 1) + ) + (if (logtest? s5-1 256) + (set! (-> a1-17 show-pat-set noedge) 1) + ) + (if (logtest? s5-1 #x8000) + (set! (-> a1-17 show-pat-set nopilot) 1) + ) + (if (logtest? s5-1 512) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :noendlessfall #x1)) + ) + (if (logtest? s5-1 #x4000) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nomech #x1)) + ) + (if (logtest? #x10000 s5-1) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :noproj #x1)) + ) + (if (logtest? #x40000 s5-1) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :probe #x1)) + ) + (if (logtest? #x20000 s5-1) + (logior! (-> a1-17 event-mask) 64) + ) + ) + ) + ) + (col-rend-draw this a1-17) + ) + (none) + ) diff --git a/goal_src/jak3/engine/collide/collide-edge-grab-h.gc b/goal_src/jak3/engine/collide/collide-edge-grab-h.gc index 7837efd301..544b1ceaa6 100644 --- a/goal_src/jak3/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak3/engine/collide/collide-edge-grab-h.gc @@ -18,6 +18,8 @@ (declare-type collide-cache-tri structure) +(declare-type collide-edge-work structure) + ;; DECOMP BEGINS (deftype pilot-edge-grab-info (structure) @@ -53,7 +55,7 @@ ) (:methods (edge-grab-info-method-9 (_type_) symbol) - (edge-grab-info-method-10 () none) + (edge-grab-info-method-10 (_type_) none) ) ) @@ -74,7 +76,7 @@ (edge-vec-norm vector :inline) ) (:methods - (collide-edge-edge-method-9 () none) + (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) ) ) @@ -98,8 +100,8 @@ (attempts qword 32 :inline) ) (:methods - (collide-edge-hold-list-method-9 () none) - (collide-edge-hold-list-method-10 () none) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none) ) ) @@ -144,18 +146,18 @@ (hold-list collide-edge-hold-list :inline) ) (:methods - (collide-edge-work-method-9 () none) - (collide-edge-work-method-10 () none) - (collide-edge-work-method-11 () none) - (collide-edge-work-method-12 () none) - (collide-edge-work-method-13 () none) - (collide-edge-work-method-14 () none) - (collide-edge-work-method-15 () none) - (collide-edge-work-method-16 () none) - (collide-edge-work-method-17 () none) - (collide-edge-work-method-18 () none) - (collide-edge-work-method-19 () none) - (collide-edge-work-method-20 () none) + (search-for-edges (_type_ collide-edge-hold-list) none) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) none) + (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (get-best-hand-point (_type_ vector vector int) float) + (find-grabbable-edges (_type_) none) + (find-grabbable-tris (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ) ) diff --git a/goal_src/jak3/engine/collide/collide-edge-grab.gc b/goal_src/jak3/engine/collide/collide-edge-grab.gc index 9f33a2744a..4aa0b83196 100644 --- a/goal_src/jak3/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak3/engine/collide/collide-edge-grab.gc @@ -5,5 +5,726 @@ ;; name in dgo: collide-edge-grab ;; dgos: GAME +(define-extern *no-walk-surface* surface) + ;; DECOMP BEGINS +;; WARN: Function (method 28 target) has a return type of none, but the expression builder found a return statement. +(defmethod target-method-28 ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (set! (-> *edge-grab-info* found-edge?) #f) + (mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320) + (let ((s5-0 *collide-edge-work*)) + (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this))) + (set! (-> s5-0 num-verts) (the-as uint 0)) + (set! (-> s5-0 num-edges) (the-as uint 0)) + (set! (-> s5-0 num-tris) (the-as uint 0)) + (let ((v1-3 (-> this control))) + (set! (-> s5-0 ccache) arg0) + (.lvf vf1 (&-> s5-0 spec local-cache-fill-box min quad)) + (.lvf vf2 (&-> s5-0 spec local-cache-fill-box max quad)) + (set! (-> s5-0 cshape) v1-3) + (.lvf vf3 (&-> v1-3 trans quad)) + ) + (.add.vf vf1 vf1 vf3 :mask #b111) + (.add.vf vf2 vf2 vf3 :mask #b111) + (.svf (&-> s5-0 cache-fill-box min quad) vf1) + (.svf (&-> s5-0 cache-fill-box max quad) vf2) + (.lvf vf4 (&-> s5-0 spec local-within-reach-box min quad)) + (.lvf vf5 (&-> s5-0 spec local-within-reach-box max quad)) + (.add.vf vf4 vf4 vf3 :mask #b111) + (.add.vf vf5 vf5 vf3 :mask #b111) + (.ftoi.vf vf6 vf4) + (.ftoi.vf vf7 vf5) + (.svf (&-> s5-0 within-reach-box min quad) vf4) + (.svf (&-> s5-0 within-reach-box max quad) vf5) + (.svf (&-> s5-0 within-reach-box4w min quad) vf6) + (.svf (&-> s5-0 within-reach-box4w max quad) vf7) + (let ((s3-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-0 collide-with) (-> this control root-prim prim-core collide-with)) + (set! (-> s3-0 ignore-process0) this) + (set! (-> s3-0 ignore-process1) #f) + (set! (-> s3-0 ignore-pat) (-> s5-0 spec ignore-pat)) + (set! (-> s3-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> s3-0 bbox)) (the-as pointer (-> s5-0 cache-fill-box)) 32) + (fill-using-bounding-box arg0 s3-0) + ) + (find-grabbable-tris s5-0) + (when (nonzero? (-> s5-0 num-tris)) + (find-grabbable-edges s5-0) + (when (nonzero? (-> s5-0 num-edges)) + (set! (-> s5-0 search-pt quad) (-> this control midpoint-of-hands quad)) + (when (!= (-> *cpad-list* cpads (-> this control cpad number) stick0-speed) 0.0) + (set! (-> s5-0 search-dir-vec quad) (-> this control to-target-pt-xz quad)) + (search-for-edges s5-0 (-> s5-0 hold-list)) + (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) + (set! (-> *edge-grab-info* found-edge?) #t) + (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) + (send-event this 'edge-grab) + ) + (return #f) + ) + ) + (vector-z-quaternion! (-> s5-0 search-dir-vec) (-> this control quat-for-control)) + (search-for-edges s5-0 (-> s5-0 hold-list)) + (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) + (set! (-> *edge-grab-info* found-edge?) #t) + (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) + (send-event this 'edge-grab) + ) + ) + 0 + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Function (method 9 collide-edge-work) has a return type of none, but the expression builder found a return statement. +(defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) + (set! (-> arg0 num-allocs) (the-as uint 0)) + (set! (-> arg0 num-attempts) (the-as uint 0)) + (set! (-> arg0 head) #f) + (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) + (s3-0 (the-as collide-edge-edge (-> this edges))) + ) + (countdown (s2-0 (-> this num-edges)) + (when (not (-> s3-0 ignore)) + (compute-center-point! this s3-0 (-> s4-0 center-pt)) + (when (should-add-to-list? this s4-0 s3-0) + (add-to-list! arg0 s4-0) + (+! (-> arg0 num-allocs) 1) + (when (= (-> arg0 num-allocs) 32) + (format 0 "ERROR: Reached limit of edge grab hold items!~%") + (return #f) + ) + (&+! s4-0 48) + ) + ) + (&+! s3-0 48) + ) + ) + 0 + (none) + ) + +(defmethod-mips2c "(method 10 collide-edge-hold-list)" 10 collide-edge-hold-list) + +(deftype pbhp-stack-vars (structure) + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline) + ) + ) + + +(defmethod-mips2c "(method 19 collide-edge-work)" 19 collide-edge-work) + +;; WARN: Return type mismatch int vs symbol. +(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) + (local-vars (sv-656 vector) (sv-672 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((s2-0 (-> arg0 edge)) + (s1-0 (-> s2-0 etri ctri)) + (s4-0 (-> s1-0 prim-index)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 s0-0)) + (let ((v1-1 (-> arg0 center-pt))) + (let ((a0-1 (-> s2-0 edge-vec-norm))) + (let ((a2-2 1105.92)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-1 quad) vf6) + ) + (let ((f0-1 (get-best-hand-point this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (if (< 491.52 f0-1) + (return (the-as symbol #f)) + ) + ) + (set! sv-672 s0-0) + (set! sv-656 (-> arg0 center-pt)) + (let ((v0-2 (vector-negate! (new 'stack-no-clear 'vector) (-> s2-0 edge-vec-norm)))) + (let ((v1-8 1105.92)) + (.mov vf7 v1-8) + ) + (.lvf vf5 (&-> v0-2 quad)) + ) + (.lvf vf4 (&-> sv-656 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-672 quad) vf6) + (let ((f0-3 (get-best-hand-point this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (if (< 491.52 f0-3) + (return (the-as symbol #f)) + ) + ) + ) + (set! (-> arg1 tri-vertex 0 quad) (-> s1-0 vertex 0 quad)) + (set! (-> arg1 world-vertex 4 quad) (-> s1-0 vertex 1 quad)) + (set! (-> arg1 world-vertex 5 quad) (-> s1-0 vertex 2 quad)) + (set! (-> arg1 edge-tri-pat) (-> s1-0 pat)) + (set! (-> arg1 center-hold quad) (-> arg0 center-pt quad)) + (set! (-> arg1 world-vertex 0 quad) (-> s2-0 vertex-ptr 0 0 quad)) + (set! (-> arg1 world-vertex 1 quad) (-> s2-0 vertex-ptr 1 0 quad)) + (set! (-> arg1 hanging-matrix uvec quad) + (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal quad) + ) + (vector-normalize! + (vector-! (-> arg1 hanging-matrix fvec) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) + 1.0 + ) + (vector-normalize! + (vector-cross! + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix fvec) + (-> arg1 hanging-matrix uvec) + ) + 1.0 + ) + (vector-cross! + (-> arg1 hanging-matrix fvec) + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix uvec) + ) + (set! (-> arg1 hanging-matrix trans quad) (-> arg1 center-hold quad)) + (transform-vectors! + (-> arg1 hanging-matrix) + (-> this world-player-spheres) + (-> this spec local-player-spheres) + 12 + ) + (let ((a1-12 (new 'stack-no-clear 'collide-query))) + (let ((v1-28 a1-12)) + (set! (-> v1-28 best-dist) (the-as float (-> this world-player-spheres))) + (set! (-> v1-28 best-other-prim) (the-as collide-shape-prim 12)) + (set! (-> v1-28 collide-with) (-> this cshape root-prim prim-core collide-with)) + (set! (-> v1-28 ignore-process0) #f) + (set! (-> v1-28 ignore-process1) #f) + (set! (-> v1-28 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-28 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-28 action-mask) (collide-action solid)) + ) + (if (probe-using-spheres (-> this ccache) a1-12) + (return (the-as symbol #f)) + ) + ) + (set! (-> arg1 status) (the-as uint 0)) + (if (logtest? (-> this spec flags) (collide-edge-spec-flags find-adjacent-edge)) + (find-adjacent-edge this arg0 arg1) + ) + (let* ((v1-41 (the-as object (-> this ccache prims s4-0 prim))) + (a0-44 (-> (the-as collide-shape-prim v1-41) cshape)) + ) + (cond + (a0-44 + (set! (-> arg1 actor-cshape-prim-offset) (- (the-as int v1-41) (the-as uint (the-as int (-> a0-44 process))))) + (set! (-> arg1 actor-handle) (process->handle (-> a0-44 process))) + (let ((a1-19 + (-> a0-44 process node-list data (-> (the-as collide-shape-prim v1-41) transform-index) bone transform) + ) + (s5-1 (new 'stack-no-clear 'matrix)) + ) + (matrix-4x4-inverse! s5-1 a1-19) + (dotimes (s4-1 8) + (vector-matrix*! (-> arg1 local-vertex s4-1) (-> arg1 world-vertex s4-1) s5-1) + ) + ) + ) + (else + (set! (-> arg1 actor-cshape-prim-offset) 0) + (set! (-> arg1 actor-handle) (the-as handle #f)) + ) + ) + ) + ) + (the-as symbol 0) + ) + ) + +(deftype faei-stack-vars (structure) + ((hold-edge-vec-norm vector :inline) + (adj-edge-vec-norm vector :inline) + (found-left? symbol) + (left-dot float) + (found-right? symbol) + (right-dot float) + ) + ) + + +(defmethod no-collision-at-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'inline-array 'sphere 6)) + ) + (dotimes (s2-0 6) + ((method-of-type sphere new) (the-as symbol (-> s5-0 s2-0)) sphere) + ) + (set! (-> s4-0 uvec quad) + (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal quad) + ) + (vector-normalize! (vector-! (-> s4-0 fvec) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) 1.0) + (vector-normalize! (vector-cross! (-> s4-0 rvec) (-> s4-0 fvec) (-> s4-0 uvec)) 1.0) + (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) + (vector-average! (-> s4-0 trans) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) + (transform-vectors! s4-0 s5-0 (-> arg0 spec local-player-spheres) 6) + (let ((a1-11 (new 'stack-no-clear 'collide-query))) + (let ((v1-13 a1-11)) + (set! (-> v1-13 best-dist) (the-as float s5-0)) + (set! (-> v1-13 best-other-prim) (the-as collide-shape-prim 6)) + (set! (-> v1-13 collide-with) (-> arg0 cshape root-prim prim-core collide-with)) + (set! (-> v1-13 ignore-process0) #f) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-13 action-mask) (collide-action solid)) + ) + (not (probe-using-spheres (-> arg0 ccache) a1-11)) + ) + ) + ) + +(defmethod find-adjacent-edge ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) + (let ((s5-0 (new 'stack-no-clear 'faei-stack-vars))) + (let* ((v1-0 (-> arg0 edge)) + (s3-0 (-> v1-0 vertex-ptr 0 0)) + (s2-0 (-> v1-0 vertex-ptr 1 0)) + (s1-0 (the-as collide-edge-edge (-> this edges))) + ) + (set! (-> s5-0 found-left?) #f) + (set! (-> s5-0 found-right?) #f) + (vector-! (-> s5-0 hold-edge-vec-norm) s2-0 s3-0) + (vector-normalize! (-> s5-0 hold-edge-vec-norm) 1.0) + (countdown (s0-0 (-> this num-edges)) + (when (not (-> s1-0 ignore)) + (let ((v1-6 (-> s1-0 vertex-ptr 1 0))) + (when (= v1-6 s3-0) + (vector-! (-> s5-0 adj-edge-vec-norm) v1-6 (-> s1-0 vertex-ptr 0 0)) + (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) + (let ((f30-0 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) + (when (and (or (not (-> s5-0 found-left?)) (< (-> s5-0 left-dot) f30-0) (< -0.7 f30-0)) + (no-collision-at-edge s1-0 this arg1) + ) + (set! (-> s5-0 left-dot) f30-0) + (set! (-> s5-0 found-left?) #t) + (set! (-> arg1 adjacent-edge-left-vertex quad) (-> s1-0 vertex-ptr 0 0 quad)) + 0 + ) + ) + ) + ) + (let ((v1-18 (-> s1-0 vertex-ptr 0 0))) + (when (= v1-18 s2-0) + (vector-! (-> s5-0 adj-edge-vec-norm) (-> s1-0 vertex-ptr 1 0) v1-18) + (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) + (let ((f30-1 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) + (when (and (or (not (-> s5-0 found-right?)) (< (-> s5-0 right-dot) f30-1) (< -0.7 f30-1)) + (no-collision-at-edge s1-0 this arg1) + ) + (set! (-> s5-0 right-dot) f30-1) + (set! (-> s5-0 found-right?) #t) + (set! (-> arg1 adjacent-edge-right-vertex quad) (-> s1-0 vertex-ptr 1 0 quad)) + 0 + ) + ) + ) + ) + ) + (&+! s1-0 48) + ) + ) + (let ((v1-31 (-> arg1 status))) + (if (-> s5-0 found-left?) + (set! v1-31 (logior v1-31 1)) + ) + (if (-> s5-0 found-right?) + (set! v1-31 (logior v1-31 2)) + ) + (set! (-> arg1 status) v1-31) + ) + ) + 0 + (none) + ) + +(defmethod-mips2c "(method 9 edge-grab-info)" 9 edge-grab-info) + +(defmethod-mips2c "(method 17 collide-edge-work)" 17 collide-edge-work) + +(defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) + +(defmethod get-best-hand-point ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((f30-0 -1.0)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (dotimes (s1-0 (the-as int (-> this num-edges))) + (let ((v1-4 (-> this edges s1-0))) + (when (not (-> v1-4 ignore)) + (when (= (-> v1-4 etri ctri prim-index) arg2) + (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-4 vertex-ptr 0 0) (-> v1-4 vertex-ptr 1 0) s2-0))) + (when (or (< f30-0 0.0) (< f0-0 f30-0)) + (set! f30-0 f0-0) + (set! (-> arg0 quad) (-> s2-0 quad)) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +(defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) + +(defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) + (local-vars (v1-1 float) (v1-2 float) (v1-3 float)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.mov.vf vf7 vf0) + (.lvf vf1 (&-> this search-pt quad)) + (let ((f0-0 0.0)) + (let ((v1-0 (-> arg0 vertex-ptr 0)) + (a0-1 (-> arg0 vertex-ptr 1)) + ) + (.lvf vf2 (&-> v1-0 0 quad)) + (.lvf vf3 (&-> a0-1 0 quad)) + ) + (.sub.vf vf4 vf1 vf2) + (.sub.vf vf5 vf3 vf2) + (.mul.vf vf6 vf5 vf5) + (.add.z.vf vf6 vf6 vf6 :mask #b1) + (.sqrt.vf Q vf6 :ftf #b0) + (nop!) + (.wait.vf) + (nop!) + (.add.vf vf6 vf0 Q :mask #b1) + (.nop.vf) + (.mov v1-1 vf6) + (let ((f1-0 v1-1)) + (.div.vf Q vf0 vf6 :fsf #b11 :ftf #b0) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (.mul.x.vf vf9 vf5 vf8) + (.mov v1-2 vf8) + (.mul.vf vf10 vf9 vf4) + (.add.z.vf vf10 vf10 vf10 :mask #b1) + (let ((f2-0 v1-2)) + (.mov v1-3 vf10) + (let ((f3-0 v1-3)) + (b! (< f3-0 f0-0) cfg-4 :likely-delay (set! f3-0 f0-0)) + (b! (< f1-0 f3-0) cfg-4 :likely-delay (set! f3-0 f1-0)) + (label cfg-4) + (let ((v1-4 (* f3-0 f2-0))) + (.mov vf11 v1-4) + ) + ) + ) + ) + ) + (.mul.x.vf vf7 vf5 vf11 :mask #b111) + (.add.vf vf7 vf7 vf2 :mask #b111) + (.svf (&-> arg1 quad) vf7) + 0.0 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod edge-grab-info-method-10 ((this edge-grab-info)) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) + (new 'static 'rgba :r #xff :a #x60) + #f + (the-as rgba -1) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this center-hold) + (meters 0.05) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this left-hand-hold) + (meters 0.05) + (new 'static 'rgba :r #xff :g #xff :a #x60) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this right-hand-hold) + (meters 0.05) + (new 'static 'rgba :r #xff :g #xff :a #x60) + ) + (if (logtest? (-> this status) 1) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> this adjacent-edge-left-vertex) + (the-as vector (-> this world-vertex)) + (new 'static 'rgba :r #x80 :a #x60) + #f + (the-as rgba -1) + ) + ) + (if (logtest? (-> this status) 2) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> this world-vertex 1) + (-> this adjacent-edge-right-vertex) + (new 'static 'rgba :r #x80 :a #x60) + #f + (the-as rgba -1) + ) + ) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) + (new 'static 'rgba :r #xff :a #x30) + ) + (cond + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) + (format *stdcon* "grab: invalid handle~%") + ) + ) + (else + (format *stdcon* "grab: ground~%") + ) + ) + (none) + ) + +(defmethod debug-draw-edges ((this collide-edge-work)) + (local-vars (sv-32 (function _varargs_ object))) + (let ((gp-0 0)) + (dotimes (s4-0 (the-as int (-> this num-edges))) + (let* ((v1-3 (-> this edges s4-0)) + (a2-0 (-> v1-3 vertex-ptr 0 0)) + (a3-0 (-> v1-3 vertex-ptr 1 0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (vector+! s3-0 a2-0 a3-0) + (vector-float*! s3-0 s3-0 0.5) + (cond + ((-> v1-3 ignore) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + a2-0 + a3-0 + (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) + #f + (the-as rgba -1) + ) + (+! gp-0 1) + gp-0 + ) + (else + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + s3-0 + (-> v1-3 outward) + (meters 0.3) + (new 'static 'rgba :r #xff :a #x80) + ) + (let ((s2-0 add-debug-text-3d) + (s1-0 #t) + (s0-0 577) + ) + (set! sv-32 format) + (let ((a0-10 (clear *temp-string*)) + (a1-4 "~D") + (a2-2 s4-0) + ) + (sv-32 a0-10 a1-4 a2-2) + ) + (s2-0 s1-0 (the-as bucket-id s0-0) *temp-string* s3-0 (font-color white) (the-as vector2h #f)) + ) + ) + ) + ) + ) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) + ) + ) + +(defmethod debug-draw-sphere ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-verts))) + (let ((a2-0 (-> this verts s5-0))) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 0.2) (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this collide-edge-hold-list)) + (let ((s4-0 (-> this head)) + (s5-0 0) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 #t) + ) + (set! (-> s3-0 quad) (-> *target* control midpoint-of-hands quad)) + (while s4-0 + (+! s5-0 1) + (set! (-> s3-0 y) (-> s4-0 center-pt y)) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) s3-0 (meters 0.1) (new 'static 'rgba :a #x80)) + (cond + (s2-0 + (set! s2-0 #f) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 center-pt) + (meters 0.15) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 outward-pt) + (meters 0.1) + (new 'static 'rgba :r #xff :a #x80) + ) + ) + (else + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 center-pt) + (meters 0.15) + (new 'static 'rgba :r #x7f :g #x7f :a #x40) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 outward-pt) + (meters 0.1) + (new 'static 'rgba :r #x7f :a #x40) + ) + ) + ) + (set! s4-0 (-> s4-0 next)) + ) + ) + (format *stdcon* "hold list has ~D item(s)~%" s5-0) + ) + (dotimes (s5-1 (the-as int (-> this num-attempts))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> this attempts s5-1)) + (meters 0.1) + (new 'static 'rgba :a #x40) + ) + ) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) + ) + +(defmethod debug-draw-tris ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-tris))) + (let* ((v1-3 (-> this tris s5-0 ctri)) + (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) + ) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> v1-3 vertex)) + (-> v1-3 vertex 1) + (-> v1-3 vertex 2) + t1-0 + ) + ) + ) + 0 + (none) + ) + +(let ((v1-2 (new 'static 'surface + :name '*no-walk-surface* + :turnv 0.5 + :turnvf 0.5 + :turnvv 1.0 + :turnvvf 1.0 + :tiltv 1.0 + :tiltvf 1.0 + :tiltvv 1.0 + :tiltvvf 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 0.9 + :align-speed 1.0 + :flags (surface-flag no-turn-around turn-to-vel) + ) + ) + ) + (set! *no-walk-surface* v1-2) + (set! (-> v1-2 exit-hook) nothing) + (set! (-> v1-2 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-2 touch-hook) nothing) + (set! (-> v1-2 active-hook) nothing) + ) diff --git a/goal_src/jak3/engine/collide/collide-frag.gc b/goal_src/jak3/engine/collide/collide-frag.gc index b019d3d7bf..8af3e0a3c3 100644 --- a/goal_src/jak3/engine/collide/collide-frag.gc +++ b/goal_src/jak3/engine/collide/collide-frag.gc @@ -7,3 +7,96 @@ ;; DECOMP BEGINS +(defmethod login ((this drawable-tree-collide-fragment)) + "Initialize the object after it is loaded." + this + ) + +(defmethod draw ((this drawable-tree-collide-fragment)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + (when *display-render-collision* + (dotimes (s5-0 (-> this length)) + (draw (-> this data s5-0)) + ) + ) + 0 + (none) + ) + +(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) + arg1 + ) + +;; WARN: Return type mismatch int vs collide-fragment. +(defmethod mem-usage ((this collide-fragment) (usage memory-usage-block) (flags int)) + (let ((s5-0 (if (logtest? flags 1) + 55 + 51 + ) + ) + (s4-0 (-> this mesh)) + ) + (set! (-> usage data s5-0 name) "collide-fragment") + (+! (-> usage data s5-0 count) 1) + (let ((v1-9 (+ (asize-of this) (asize-of s4-0)))) + (+! (-> usage data s5-0 used) v1-9) + (+! (-> usage data s5-0 total) (logand -16 (+ v1-9 15))) + ) + (set! (-> usage data (+ s5-0 1) name) "collision-poly") + (+! (-> usage data (+ s5-0 1) count) (-> s4-0 poly-count)) + (let ((v1-20 (+ (-> s4-0 strip-data-len) (-> s4-0 poly-count)))) + (+! (-> usage data (+ s5-0 1) used) v1-20) + (+! (-> usage data (+ s5-0 1) total) v1-20) + ) + (set! (-> usage data (+ s5-0 2) name) "collision-vertex") + (+! (-> usage data (+ s5-0 2) count) (-> s4-0 vertex-count)) + (let ((v1-29 (* (-> s4-0 vertex-data-qwc) 16))) + (+! (-> usage data (+ s5-0 2) used) v1-29) + (let ((v0-2 (+ (-> usage data (+ s5-0 2) total) v1-29))) + (set! (-> usage data (+ s5-0 2) total) v0-2) + (the-as collide-fragment v0-2) + ) + ) + ) + ) + +(defmethod login ((this drawable-inline-array-collide-fragment)) + "Initialize the object after it is loaded." + this + ) + +(defmethod draw ((this collide-fragment)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + 0 + (none) + ) + +(defmethod draw ((this drawable-inline-array-collide-fragment)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) + (if (sphere-cull (-> s4-0 bsphere)) + (draw s4-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod mem-usage ((this drawable-inline-array-collide-fragment) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 1 (-> usage length))) + (set! (-> usage data 0 name) "drawable-group") + (+! (-> usage data 0 count) 1) + (let ((v1-5 32)) + (+! (-> usage data 0 used) v1-5) + (+! (-> usage data 0 total) (logand -16 (+ v1-5 15))) + ) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) usage flags) + ) + this + ) diff --git a/goal_src/jak3/engine/collide/collide-h.gc b/goal_src/jak3/engine/collide/collide-h.gc index 5302b789ef..94e41d3c16 100644 --- a/goal_src/jak3/engine/collide/collide-h.gc +++ b/goal_src/jak3/engine/collide/collide-h.gc @@ -16,7 +16,9 @@ This has both inputs from the user, and collision results." (ignore-process0 process-tree :overlay-at (-> ignore-processes 0)) (ignore-process1 process-tree :overlay-at (-> ignore-processes 1)) (ignore-pat pat-surface) + (ignore-pat-s32 int32 :overlay-at ignore-pat) (collide-with collide-spec) + (collide-with-s32 int32 :overlay-at collide-with) (overlay-params uint32 3 :offset 112) (bbox bounding-box :inline) (bbox4w bounding-box4w :inline) diff --git a/goal_src/jak3/engine/collide/collide-mesh-h.gc b/goal_src/jak3/engine/collide/collide-mesh-h.gc index 22b0654808..e637b7d7b4 100644 --- a/goal_src/jak3/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak3/engine/collide/collide-mesh-h.gc @@ -5,6 +5,9 @@ ;; name in dgo: collide-mesh-h ;; dgos: GAME +(declare-type collide-mesh-cache-tri structure) +(declare-type collide-shape-prim-mesh basic) + ;; DECOMP BEGINS (deftype collide-tri-result (structure) @@ -38,13 +41,13 @@ bound to the joint specified by `joint-id`." (tris collide-mesh-tri 1 :inline :offset 32) ) (:methods - (collide-mesh-method-9 () none) - (collide-mesh-method-10 () none) - (collide-mesh-method-11 () none) - (collide-mesh-method-12 () none) - (collide-mesh-method-13 () none) - (collide-mesh-method-14 () none) - (collide-mesh-method-15 () none) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none) ) ) @@ -62,7 +65,7 @@ bound to the joint specified by `joint-id`." (deftype collide-mesh-cache-entry (structure) "A foreground mesh collide cache entry." ((mat matrix :inline) - (tris collide-mesh-cache-tri :dynamic) + (tris collide-mesh-cache-tri :inline :dynamic) ) ) @@ -75,10 +78,10 @@ bound to the joint specified by `joint-id`." (data uint8 48000) ) (:methods - (collide-mesh-cache-method-9 () none) + (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) (is-id? (_type_ int) symbol) (next-id! (_type_) uint) - (collide-mesh-cache-method-12 () none) + (allocate! (_type_ int) collide-mesh-cache-entry) ) ) diff --git a/goal_src/jak3/engine/collide/collide-mesh.gc b/goal_src/jak3/engine/collide/collide-mesh.gc index 5a7cb38b2a..3bc37bbe39 100644 --- a/goal_src/jak3/engine/collide/collide-mesh.gc +++ b/goal_src/jak3/engine/collide/collide-mesh.gc @@ -7,3 +7,607 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this collide-mesh)) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) + ) + +;; WARN: Return type mismatch int vs collide-mesh. +(defmethod mem-usage ((this collide-mesh) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 83 (-> usage length))) + (set! (-> usage data 82 name) "collide-mesh") + (+! (-> usage data 82 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 82 used) v1-6) + (+! (-> usage data 82 total) (logand -16 (+ v1-6 15))) + ) + (set! (-> usage length) (max 83 (-> usage length))) + (set! (-> usage data 82 name) "collide-mesh") + (+! (-> usage data 82 count) 1) + (let ((v1-16 (* (-> this num-verts) 16))) + (+! (-> usage data 82 used) v1-16) + (+! (-> usage data 82 total) (logand -16 (+ v1-16 15))) + ) + (the-as collide-mesh 0) + ) + +(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (the-as object (-> this tris))) + (s4-0 (-> arg0 node-list data arg1 bone transform)) + ) + (countdown (s3-0 (-> this num-tris)) + (let ((a2-1 (new 'stack-no-clear 'vector)) + (a3-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + ) + (.lvf vf4 (&-> s4-0 rvec quad)) + (.lvf vf5 (&-> s4-0 uvec quad)) + (.lvf vf6 (&-> s4-0 fvec quad)) + (.lvf vf7 (&-> s4-0 trans quad)) + (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) + (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) + (.lvf vf3 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) + (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-mesh-tri s5-0) pat mode) color) a 16))) + (.mul.w.vf acc vf7 vf0) + (.add.mul.x.vf acc vf4 vf1 acc) + (.add.mul.y.vf acc vf5 vf1 acc) + (.add.mul.z.vf vf1 vf6 vf1 acc) + (.mul.w.vf acc vf7 vf0) + (.add.mul.x.vf acc vf4 vf2 acc) + (.add.mul.y.vf acc vf5 vf2 acc) + (.add.mul.z.vf vf2 vf6 vf2 acc) + (.mul.w.vf acc vf7 vf0) + (.add.mul.x.vf acc vf4 vf3 acc) + (.add.mul.y.vf acc vf5 vf3 acc) + (.add.mul.z.vf vf3 vf6 vf3 acc) + (.svf (&-> a2-1 quad) vf1) + (.svf (&-> a3-0 quad) vf2) + (.svf (&-> t0-0 quad) vf3) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf1) a2-1 a3-0 t0-0 t1-0) + ) + ) + (set! s5-0 (&+ (the-as collide-mesh-tri s5-0) 8)) + ) + ) + 0 + (none) + ) + ) + +(deftype sopt-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + + +(defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh) + +(deftype spat-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + + +(defmethod should-push-away-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float)) + (local-vars + (v1-0 uint128) + (a0-1 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a1-4 uint128) + (a1-7 pat-surface) + (a2-1 uint128) + (a2-2 uint128) + (a2-4 int) ;; og:preserve-this float -> int + (a2-5 float) + (a2-7 float) + (f0-0 float) + (f2-1 float) + (f3-0 float) + (f4-0 float) + ) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'spat-work))) + (nop!) + (let ((s3-0 arg0)) + (.lvf vf3 (&-> arg2 quad)) + (nop!) + (let ((s2-0 (-> this num-tris))) + (.sub.w.vf vf12 vf3 vf3) + (nop!) + (.add.w.vf vf13 vf3 vf3) + (nop!) + (.ftoi.vf vf12 vf12) + (nop!) + (.ftoi.vf vf13 vf13) + (nop!) + (.mov v1-0 vf12) + (.svf (&-> s4-0 sphere-bbox4w min quad) vf12) + (.mov a0-1 vf13) + (.svf (&-> s4-0 sphere-bbox4w max quad) vf13) + (until (>= a2-7 f4-0) + (until (> f0-0 f2-1) + (until (>= f3-0 f2-1) + (label cfg-1) + (b! (zero? s2-0) cfg-10 :delay (set! a2-1 (-> s3-0 bbox4w min quad))) + (+! s2-0 -1) + (let ((a1-1 (-> s3-0 bbox4w max quad))) + (.pcgtw a2-2 a2-1 a0-1) + (nop!) + (.pcgtw a1-2 v1-0 a1-1) + ) + (nop!) + (.por a1-3 a2-2 a1-2) + (nop!) + (.ppach a1-4 (the-as uint128 0) a1-3) + (nop!) + (let ((a1-5 (shl (the-as int a1-4) 16))) + (nop!) + ;; og:preserve-this + (b! (nonzero? a1-5) cfg-1 :likely-delay (set! s3-0 (&+ s3-0 96))) + ) + (closest-pt-in-triangle (-> s4-0 intersect) arg2 (the-as matrix (-> s3-0 vertex)) (-> s3-0 normal)) + (.lvf vf2 (&-> s4-0 intersect quad)) + (.lvf vf3 (&-> arg2 quad)) + (.lvf vf1 (&-> s3-0 normal quad)) + (set! v1-0 (-> s4-0 sphere-bbox4w min quad)) + (set! a0-1 (-> s4-0 sphere-bbox4w max quad)) + (.sub.vf vf4 vf3 vf2) + (set! a1-7 (-> s3-0 pat)) + (.mul.vf vf5 vf4 vf1) + (.lvf vf7 (&-> s3-0 vertex 0 quad)) + (.mul.vf vf6 vf4 vf4) + (.lvf vf8 (&-> s3-0 vertex 1 quad)) + (.mov.vf vf1 vf0 :mask #b1000) + (.lvf vf9 (&-> s3-0 vertex 2 quad)) + (.add.x.vf vf5 vf5 vf5 :mask #b10) + (&+! s3-0 96) + (.add.y.vf vf6 vf6 vf6 :mask #b1) + (set! f3-0 arg3) + (.add.z.vf vf5 vf5 vf5 :mask #b10) + (.add.z.vf vf6 vf6 vf6 :mask #b1) + (.sqrt.vf Q vf6 :ftf #b0) + (.mov a2-4 vf5) + (set! f0-0 0.0) + (.wait.vf) + (let ((f1-0 (-> arg2 w))) + (.add.vf vf6 vf0 Q :mask #b1) + (.mov.vf vf10 vf6) + (b! (< (the-as int a2-4) 0) cfg-6 :likely-delay (.sub.vf vf10 vf0 vf10)) + (label cfg-6) + (.mov a2-5 vf10) + (set! f2-1 (- a2-5 f1-0)) + ) + (.div.vf Q vf0 vf6 :fsf #b11 :ftf #b0) + ) + ) + (.wait.vf) + (nop!) + (.mul.vf vf11 vf4 Q) + (set! f4-0 0.707) + (.mul.vf vf5 vf11 vf1) + (.add.y.vf vf5 vf5 vf5 :mask #b1) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.mov a2-7 vf5) + ) + ) + ) + ) + (set! arg3 f2-1) + (.svf (&-> arg1 vertex 0 quad) vf7) + (.svf (&-> arg1 vertex 1 quad) vf8) + (.svf (&-> arg1 vertex 2 quad) vf9) + (.svf (&-> arg1 intersect quad) vf2) + (.svf (&-> arg1 normal quad) vf1) + (b! #t cfg-1 :delay (set! (-> arg1 pat) a1-7)) + (label cfg-10) + arg3 + ) + ) + +(defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh) + +(defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh) + +;; ERROR: Unsupported inline assembly instruction kind - [pxor v1, v1, a0] +;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] +;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] +;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] +(defmethod populate-for-prim-mesh ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) + (local-vars + (r0-0 uint128) + (v1-7 uint128) + (v1-8 uint128) + (v1-9 uint128) + (v1-11 uint128) + (a0-6 uint128) + (a0-8 uint128) + (a0-10 uint128) + (a0-11 uint128) + (a0-12 uint128) + ) + (let ((s5-0 (-> arg0 cshape process node-list data (-> arg0 transform-index) bone transform)) + (s4-0 (-> arg0 mesh-cache-entry)) + ) + (cond + ((= (-> arg0 mesh-cache-id) (-> this id)) + (let ((v1-6 (-> s5-0 rvec quad)) + (a0-4 (-> s4-0 mat rvec quad)) + ) + (.pxor v1-7 v1-6 a0-4) + ) + (let ((a0-5 (-> s5-0 uvec quad)) + (a1-1 (-> s4-0 mat uvec quad)) + ) + (.pxor a0-6 a0-5 a1-1) + ) + (.por v1-8 v1-7 a0-6) + (let ((a0-7 (-> s5-0 fvec quad)) + (a1-2 (-> s4-0 mat fvec quad)) + ) + (.pxor a0-8 a0-7 a1-2) + ) + (.por v1-9 v1-8 a0-8) + (let ((a0-9 (-> s5-0 trans quad)) + (a1-3 (-> s4-0 mat trans quad)) + ) + (.pxor a0-10 a0-9 a1-3) + ) + (.por a0-11 v1-9 a0-10) + (let ((v1-10 a0-11)) + (.pcpyud a0-12 a0-11 r0-0) + (.por v1-11 a0-12 v1-10) + ) + (when (nonzero? v1-11) + (set! (-> s4-0 mat rvec quad) (-> s5-0 rvec quad)) + (set! (-> s4-0 mat uvec quad) (-> s5-0 uvec quad)) + (set! (-> s4-0 mat fvec quad) (-> s5-0 fvec quad)) + (set! (-> s4-0 mat trans quad) (-> s5-0 trans quad)) + (unpack-mesh-to-cache! (-> arg0 mesh) (-> s4-0 tris) s5-0) + ) + ) + (else + (let ((v1-19 (-> arg0 mesh))) + (when v1-19 + (set! s4-0 (allocate! this (the-as int (+ (* (the-as uint 96) (-> v1-19 num-tris)) 64)))) + (set! (-> arg0 mesh-cache-entry) s4-0) + (cond + (s4-0 + (set! (-> arg0 mesh-cache-id) (-> this id)) + (set! (-> s4-0 mat rvec quad) (-> s5-0 rvec quad)) + (set! (-> s4-0 mat uvec quad) (-> s5-0 uvec quad)) + (set! (-> s4-0 mat fvec quad) (-> s5-0 fvec quad)) + (set! (-> s4-0 mat trans quad) (-> s5-0 trans quad)) + (unpack-mesh-to-cache! (-> arg0 mesh) (-> s4-0 tris) s5-0) + ) + (else + (set! (-> arg0 mesh-cache-id) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + ) + s4-0 + ) + ) + +;; WARN: Return type mismatch (pointer uint8) vs collide-mesh-cache-entry. +(defmethod allocate! ((this collide-mesh-cache) (arg0 int)) + (local-vars (a1-2 int) (a2-2 int)) + (let* ((v1-0 (+ arg0 15)) + (a1-1 (-> this used-size)) + (v1-1 (/ v1-0 16)) + (a3-0 (-> this data)) + (a2-0 (-> this max-size)) + (v1-2 (* v1-1 16)) + (a3-1 (&+ a3-0 a1-1)) + ) + (let ((t1-0 (- a2-0 (the-as uint v1-2))) + (t0-0 (-> this id)) + ) + (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) + (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) + ) + (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) + (label cfg-4) + (set! a1-2 v1-2) + (set! a3-1 (-> this data)) + (set! (-> this id) (the-as uint a2-2)) + (label cfg-5) + (set! (-> this used-size) (the-as uint a1-2)) + (let ((v0-0 a3-1)) + (b! #t cfg-7 :delay (nop!)) + (label cfg-6) + (format 0 "ERROR: Attempted to allocate something bigger than the entire mesh cache!~%") + (set! v0-0 (the-as (pointer uint8) #f)) + (label cfg-7) + (the-as collide-mesh-cache-entry v0-0) + ) + ) + ) + +;; ERROR: Failed load: (set! vf6 (l.vf (+ (the-as vector a3-0) 16))) at op 37 +(defmethod unpack-mesh-to-cache! ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) + (local-vars (t0-2 uint)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((t0-0 (scratchpad-object int)) ;; og:preserve-this + (v1-0 (-> this num-verts)) + ) + (nop!) + (let ((a3-0 (the-as object (-> this vertex-data)))) + (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 rvec quad))) + (nop!) + (.lvf vf2 (&-> arg1 uvec quad)) + (let ((t0-1 (+ t0-0 -64))) + (.lvf vf3 (&-> arg1 fvec quad)) + (nop!) + (.lvf vf4 (&-> arg1 trans quad)) + (nop!) + (.lvf vf5 (&-> (the-as (inline-array vector) a3-0) 0 quad)) + (nop!) + (.lvf vf6 (&-> (the-as (inline-array vector) a3-0) 1 quad)) + (nop!) + (.lvf vf7 (&-> (the-as (inline-array vector) a3-0) 2 quad)) + (nop!) + (.lvf vf8 (&-> (the-as (inline-array vector) a3-0) 3 quad)) + (label cfg-2) + (.mul.w.vf acc vf4 vf0) + (set! a3-0 (-> (the-as (inline-array vector) a3-0) 4)) + (.add.mul.x.vf acc vf1 vf5 acc) + (+! t0-1 64) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf vf9 vf3 vf5 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (.lvf vf5 (&-> (the-as vector a3-0) quad)) + (.add.mul.x.vf acc vf1 vf6 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf vf10 vf3 vf6 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + ;; og:preserve-this + (.lvf vf6 (&+ (the-as vector a3-0) 16)) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf11 vf3 vf7 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + ;; og:preserve-this + (.lvf vf7 (&+ (the-as vector a3-0) 32)) + (.add.mul.x.vf acc vf1 vf8 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf vf12 vf3 vf8 acc) + (nop!) + (nop!) + ;; og:preserve-this + (.lvf vf8 (&+ (the-as vector a3-0) 48)) + (+! v1-0 -4) + (.svf (&-> (the-as (inline-array vector) t0-1) 0 quad) vf9) + (nop!) + (.svf (&-> (the-as (inline-array vector) t0-1) 1 quad) vf10) + (nop!) + (.svf (&-> (the-as (inline-array vector) t0-1) 2 quad) vf11) + (b! (> (the-as int v1-0) 0) cfg-2 :delay (.svf (&-> (the-as (inline-array vector) t0-1) 3 quad) vf12)) + ) + ) + ) + (label cfg-3) + (let ((v1-1 (the-as object (-> this tris)))) + (nop!) + (let ((a2-1 (scratchpad-object int)) ;; og:preserve-this + (a0-1 (-> this num-tris)) + ) + (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 0))) + (let* ((a1-1 (-> arg0 -1)) + (a3-1 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 1)) + (t0-3 (* t0-2 16)) + (t2-0 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 2)) + (t1-0 (* a3-1 16)) + (a3-2 (the-as uint (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 pat))) + ) + (let* ((t2-1 (* t2-0 16)) + (t0-4 (+ t0-3 a2-1)) + (t1-1 (+ t1-0 a2-1)) + (t2-2 (+ t2-1 a2-1)) + ) + (label cfg-5) + (+! a0-1 -1) + (.lvf vf1 t0-4) + (set! v1-1 (&+ (the-as collide-mesh-tri v1-1) 8)) + (.lvf vf2 t1-1) + (&+! a1-1 96) + (.lvf vf3 t2-2) + (.sub.vf vf4 vf2 vf1) + (.svf (&-> a1-1 vertex 0 quad) vf1) + (.min.vf vf8 vf1 vf2) + (.svf (&-> a1-1 vertex 1 quad) vf2) + (.sub.vf vf5 vf3 vf1) + (.svf (&-> a1-1 vertex 2 quad) vf3) + (.max.vf vf9 vf1 vf2) + (let ((t1-2 (-> (the-as collide-mesh-tri v1-1) vertex-index 0))) + (.outer.product.a.vf acc vf4 vf5) + (let ((t2-3 (-> (the-as collide-mesh-tri v1-1) vertex-index 1))) + (.outer.product.b.vf vf6 vf5 vf4 acc) + (let ((t0-5 (-> (the-as collide-mesh-tri v1-1) vertex-index 2))) + (.mul.vf vf7 vf6 vf6) + (nop!) + (.min.vf vf8 vf8 vf3) + (let ((t1-3 (* t1-2 16))) + (.max.vf vf9 vf9 vf3) + (let ((t2-4 (* t2-3 16))) + (.mul.x.vf acc vf0 vf7 :mask #b1000) + (let ((t3-0 (* t0-5 16))) + (.add.mul.y.vf acc vf0 vf7 acc :mask #b1000) + (set! t0-4 (+ t1-3 a2-1)) + (.add.mul.z.vf vf7 vf0 vf7 acc :mask #b1000) + (set! t1-1 (+ t2-4 a2-1)) + (.isqrt.vf Q vf0 vf7 :fsf #b11 :ftf #b11) + (set! t2-2 (+ t3-0 a2-1)) + ) + ) + ) + ) + ) + ) + ) + (.ftoi.vf vf8 vf8) + (nop!) + (.ftoi.vf vf9 vf9) + (nop!) + (nop!) + (.svf (&-> a1-1 bbox4w min quad) vf8) + (.wait.vf) + (.svf (&-> a1-1 bbox4w max quad) vf9) + (.mul.vf vf6 vf6 Q :mask #b111) + (nop!) + (nop!) + (.svf (&-> a1-1 normal quad) vf6) + (nop!) + (set! (-> a1-1 pat) (the-as pat-surface a3-2)) + (b! (nonzero? a0-1) cfg-5 :delay (set! a3-2 (the-as uint (-> (the-as collide-mesh-tri v1-1) pat)))) + ) + ) + ) + (label cfg-6) + 0 + (none) + ) + ) + +(deftype oot-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + + +(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) + (local-vars + (v1-0 uint128) + (a0-1 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a1-4 uint128) + (a1-7 int) ;; og:preserve-this float -> int + (a2-1 uint128) + (a2-2 uint128) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'oot-work)) + (s4-0 arg0) + ) + (.lvf vf2 (&-> arg1 quad)) + (let ((s3-0 (-> this num-tris))) + (.sub.w.vf vf5 vf2 vf2) + (.add.w.vf vf6 vf2 vf2) + (.ftoi.vf vf5 vf5) + (.ftoi.vf vf6 vf6) + (.mov v1-0 vf5) + (.svf (&-> s5-0 sphere-bbox4w min quad) vf5) + (.mov a0-1 vf6) + (.svf (&-> s5-0 sphere-bbox4w max quad) vf6) + (label cfg-1) + (b! (zero? s3-0) cfg-7 :delay (set! a2-1 (-> s4-0 bbox4w min quad))) + (+! s3-0 -1) + ) + (let ((a1-1 (-> s4-0 bbox4w max quad))) + (.pcgtw a2-2 a2-1 a0-1) + (nop!) + (.pcgtw a1-2 v1-0 a1-1) + ) + (nop!) + (.por a1-3 a2-2 a1-2) + (nop!) + (.ppach a1-4 (the-as uint128 0) a1-3) + (nop!) + (let ((a1-5 (shl (the-as int a1-4) 16))) + (nop!) + ;; og:preserve-this + (b! (nonzero? a1-5) cfg-1 :likely-delay (set! s4-0 (&+ s4-0 96))) + ) + (closest-pt-in-triangle (-> s5-0 intersect) arg1 (the-as matrix (-> s4-0 vertex)) (-> s4-0 normal)) + (.lvf vf1 (&-> s5-0 intersect quad)) + (.lvf vf2 (&-> arg1 quad)) + (set! v1-0 (-> s5-0 sphere-bbox4w min quad)) + (set! a0-1 (-> s5-0 sphere-bbox4w max quad)) + (.sub.vf vf3 vf2 vf1) + (.mul.w.vf vf4 vf2 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (.add.w.vf vf3 vf0 vf3 :mask #b10) + (.mov a1-7 vf3) + ;; og:preserve-this + (b! (>= (the-as int a1-7) 0) cfg-1 :delay (set! s4-0 (&+ s4-0 96))) + ) + (return #t) + (label cfg-7) + #f + ) + ) diff --git a/goal_src/jak3/engine/collide/collide-probe.gc b/goal_src/jak3/engine/collide/collide-probe.gc index 5c14550481..653563b74c 100644 --- a/goal_src/jak3/engine/collide/collide-probe.gc +++ b/goal_src/jak3/engine/collide/collide-probe.gc @@ -5,5 +5,196 @@ ;; name in dgo: collide-probe ;; dgos: GAME +(define-extern probe-traverse-draw-node (function draw-node int none)) + ;; DECOMP BEGINS +(defun creates-new-method? ((arg0 type) (arg1 int)) + (let ((v1-1 (-> arg0 parent allocated-length))) + (-> arg0 allocated-length) + (>= arg1 (the-as int v1-1)) + ) + ) + +(defun overrides-parent-method? ((arg0 type) (arg1 int)) + (!= (-> arg0 method-table arg1) (-> arg0 parent method-table arg1)) + ) + +(defun describe-methods ((arg0 type)) + (let ((s5-0 (-> arg0 allocated-length))) + (dotimes (s4-0 (the-as int s5-0)) + (let ((s3-0 arg0)) + (format #t "~3d:~%" s4-0) + (while (!= s3-0 basic) + (cond + ((creates-new-method? s3-0 s4-0) + (format #t " created by ~s.~%" (symbol->string (-> s3-0 symbol))) + (set! s3-0 basic) + ) + ((overrides-parent-method? s3-0 s4-0) + (format #t " overridden by ~s.~%" (symbol->string (-> s3-0 symbol))) + (set! s3-0 (-> s3-0 parent)) + ) + (else + (set! s3-0 (-> s3-0 parent)) + ) + ) + ) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs none. +(defun indent-to ((arg0 int)) + (dotimes (s5-0 arg0) + (format #t " ") + ) + (none) + ) + +(defun probe-traverse-draw-node ((arg0 draw-node) (arg1 int)) + (indent-to arg1) + (format + #t + "[~08x] child-count: ~d, flags: ~d, dist: ~f, child: ~a~%" + arg0 + (-> arg0 child-count) + (-> arg0 flags) + (-> arg0 distance) + (-> arg0 child) + ) + (cond + ((nonzero? (-> arg0 flags)) + (let ((s4-0 (-> arg0 child))) + (dotimes (s3-0 (the-as int (-> arg0 child-count))) + (probe-traverse-draw-node (the-as draw-node (+ (the-as uint s4-0) (* s3-0 32))) (+ arg1 1)) + ) + ) + ) + (else + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun probe-traverse-inline-array-node ((arg0 drawable-inline-array-node) (arg1 int)) + (indent-to arg1) + (format #t "[~08x] drawable-inline-array-node: length = ~d~%" arg0 (-> arg0 length)) + (let ((s4-0 (-> arg0 length))) + (dotimes (s3-0 s4-0) + (indent-to arg1) + (format #t "(~3d) ~a~%" s3-0 (-> arg0 data s3-0)) + (if (= (-> arg0 data s3-0 type) draw-node) + (probe-traverse-draw-node (-> arg0 data s3-0) (+ arg1 1)) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun probe-traverse-collide-fragment ((arg0 drawable-tree-collide-fragment) (arg1 int)) + (indent-to arg1) + (format #t "[~08x] drawable-tree-collide-fragment: length = ~d~%" arg0 (-> arg0 length)) + (let ((s4-0 (-> arg0 length))) + (dotimes (s3-0 (+ s4-0 -1)) + (indent-to arg1) + (if (= (-> arg0 data s3-0 type) drawable-inline-array-node) + (probe-traverse-inline-array-node (the-as drawable-inline-array-node (-> arg0 data s3-0)) (+ arg1 1)) + (format #t "unknown: ~a~%" (-> arg0 data s3-0)) + ) + ) + ) + (none) + ) + +(deftype collide-probe-stack-elem (structure) + ((child uint32) + (count uint32) + ) + ) + + +(deftype collide-probe-stack (structure) + ((data collide-probe-stack-elem 1024 :inline) + ) + ) + + +(define *collide-probe-stack* (the-as collide-probe-stack (+ 4192 #x70000000))) + +(define collide-vu0-block (new 'static 'vu-function :length 90 :qlength 45)) + +(defun print-out ((arg0 int)) + (format *stdcon* "~d~%" arg0) + ) + +(defun collide-probe-instance-tie-collide-frags () + 0 + (none) + ) + +(defun distc ((arg0 vector) (arg1 vector)) + (let* ((f0-1 (- (-> arg0 x) (-> arg1 x))) + (f0-3 (* f0-1 f0-1)) + (f1-2 (- (-> arg0 z) (-> arg1 z))) + ) + (sqrtf (+ f0-3 (* f1-2 f1-2))) + ) + ) + +(defun interpolate ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let ((f0-1 (- arg3 arg1)) + (f1-2 (- arg4 arg2)) + (f3-1 (- arg0 arg1)) + ) + (+ arg2 (/ (* f3-1 f1-2) f0-1)) + ) + ) + +(defun misty-ambush-height ((arg0 vector)) + (let* ((a1-0 (new 'static 'vector :x -808960.0 :y 111656.96 :z 3924992.0)) + (f0-0 (distc arg0 a1-0)) + ) + (cond + ((< f0-0 52019.2) + 111656.96 + ) + ((>= 58982.4 f0-0) + (interpolate f0-0 52019.2 111656.96 58982.4 116776.96) + ) + ((>= 124436.48 f0-0) + (interpolate f0-0 58982.4 116776.96 124436.48 114688.0) + ) + ((>= 219217.92 f0-0) + (interpolate f0-0 124436.48 114688.0 219217.92 113254.4) + ) + (else + 113254.4 + ) + ) + ) + ) + +(defun misty-ambush-height-probe ((arg0 vector) (arg1 float)) + (let ((f0-0 (misty-ambush-height arg0))) + (cond + ((< f0-0 (-> arg0 y)) + (/ (- (-> arg0 y) f0-0) arg1) + ) + (else + (format 0 "WARNING: ~%height = ~f, pos.y = ~f" (* 0.00024414062 f0-0) (* 0.00024414062 (-> arg0 y))) + -1.0 + ) + ) + ) + ) + +(defun pke-collide-test () + 0 + (none) + ) diff --git a/goal_src/jak3/engine/collide/collide-shape-h.gc b/goal_src/jak3/engine/collide/collide-shape-h.gc index 742b96a06a..b48d52a485 100644 --- a/goal_src/jak3/engine/collide/collide-shape-h.gc +++ b/goal_src/jak3/engine/collide/collide-shape-h.gc @@ -152,7 +152,7 @@ (riders collide-rider 20 :inline) ) (:methods - (collide-rider-pool-method-9 () none) + (add-rider (_type_ handle) collide-rider) (prepare (_type_) none) ) ) @@ -242,17 +242,17 @@ ) (:methods (new (symbol type collide-shape uint int) _type_) - (collide-shape-prim-method-9 () none) - (collide-shape-prim-method-10 () none) - (collide-shape-prim-method-11 () none) - (collide-shape-prim-method-12 () none) - (collide-shape-prim-method-13 () none) + (debug-draw (_type_) none) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) (collide-shape-prim-method-14 () none) - (collide-shape-prim-method-15 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none) - (collide-shape-prim-method-17 () none) - (collide-shape-prim-method-18 () none) - (collide-shape-prim-method-19 () none) + (on-platform-test (_type_ collide-shape-prim collide-query float) none) + (should-push-away-test (_type_ collide-shape-prim collide-query) none) + (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) ) ) @@ -318,31 +318,31 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (new (symbol type process-drawable collide-list-enum) _type_) (move-by-vector! (_type_ vector) none) (move-to-point! (_type_ vector) none) - (collide-shape-method-30 () none) + (debug-draw (_type_) none) (fill-cache-for-shape (_type_ float collide-query) none) (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) - (collide-shape-method-33 () none) - (collide-shape-method-34 () none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) (detect-riders! (_type_) symbol) - (collide-shape-method-36 () none) + (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) (integrate-and-collide! (_type_ vector) none) (find-collision-meshes (_type_) none) - (collide-shape-method-39 () none) + (on-platform (_type_ collide-shape collide-query) symbol) (find-overlapping-shapes (_type_ overlaps-others-params) symbol) - (collide-shape-method-41 () none) - (collide-shape-method-42 () none) - (collide-shape-method-43 () none) + (shove-to-closest-point-on-path (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-query) symbol) + (pull-rider! (_type_ pull-rider-info) none) (pull-riders! (_type_) symbol) (do-push-aways (_type_) collide-spec) (update-transforms (_type_) none) (set-collide-with! (_type_ collide-spec) none) (set-collide-as! (_type_ collide-spec) none) - (collide-shape-method-49 () none) + (modify-collide-as! (_type_ int collide-spec collide-spec) none) (send-shoves (_type_ process touching-shapes-entry float float float) symbol) (above-ground? (_type_ collide-query vector collide-spec float float float) symbol) (water-info-init! (_type_ water-info collide-action) water-info) (iterate-prims (_type_ (function collide-shape-prim none)) none) - (collide-shape-method-54 () none) + (pusher-init (_type_) none) ) ) @@ -380,18 +380,18 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (find-ground (_type_ collide-query collide-spec float float float) symbol) + (find-ground (_type_ collide-query collide-spec float float float process) symbol) (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) - (collide-shape-moving-method-57 () none) - (collide-shape-moving-method-58 () none) - (collide-shape-moving-method-59 () none) - (collide-shape-moving-method-60 () none) + (integrate-no-collide! (_type_ vector) none) + (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) + (move-above-ground (_type_ vector move-above-ground-params) none) + (move-to-ground (_type_ float float symbol collide-spec) none) (move-to-ground-point (_type_ vector vector vector) none) (compute-acc-due-to-gravity (_type_ vector float) vector) (rbody-collision (_type_ rigid-body-control float) none) - (collide-shape-moving-method-64 () none) + (try-snap-to-surface (_type_ vector float float float) symbol) (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) - (collide-shape-moving-method-66 () none) + (step-collision! (_type_ vector vector float int) float) (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ) ) diff --git a/goal_src/jak3/engine/collide/collide-shape-rider.gc b/goal_src/jak3/engine/collide/collide-shape-rider.gc index 68e8b2ce3d..d41a66a21d 100644 --- a/goal_src/jak3/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak3/engine/collide/collide-shape-rider.gc @@ -7,3 +7,429 @@ ;; DECOMP BEGINS +(defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) + (let ((v1-0 arg1)) + (set! (-> v1-0 best-dist) 0.0) + (set! (-> v1-0 best-my-prim) #f) + (set! (-> v1-0 best-other-prim) #f) + ) + (set! (-> arg1 best-dist) 122.88) + (let ((s5-0 (-> this root-prim)) + (s4-0 (-> arg0 root-prim)) + ) + (when (and (logtest? (-> s5-0 prim-core collide-with) (-> s4-0 prim-core collide-as)) + (logtest? (-> s5-0 prim-core action) (collide-action rideable)) + (logtest? (-> s4-0 prim-core action) (collide-action can-ride)) + ) + (let ((f0-4 (- (- (vector-vector-distance (the-as vector (-> s5-0 prim-core)) (the-as vector (-> s4-0 prim-core))) + (-> s5-0 prim-core world-sphere w) + ) + (-> s4-0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-4 122.88) + (on-platform-test s5-0 s4-0 arg1 f0-4) + ) + ) + ) + ) + (< (-> arg1 best-dist) 122.88) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) + (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") + (none) + ) + +(defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) + (let ((s4-0 (-> arg0 prim-core collide-as)) + (s3-0 (-> this child 0)) + ) + (countdown (s2-0 (-> this num-children)) + (when (and (logtest? (-> s3-0 prim-core collide-with) s4-0) + (logtest? (-> s3-0 prim-core action) (collide-action rideable)) + ) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> s3-0 prim-core)) (the-as vector (-> arg0 prim-core))) + (-> s3-0 prim-core world-sphere w) + ) + (-> arg0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-2 122.88) + (on-platform-test s3-0 arg0 arg1 f0-2) + ) + ) + ) + (&+! s3-0 80) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch pat-surface vs none. +(defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) + (case (-> arg0 type) + ((collide-shape-prim-group) + (let ((s4-0 (-> this prim-core collide-with)) + (s3-0 (-> (the-as collide-shape-prim-group arg0) child 0)) + (s2-1 (the-as object (-> (the-as collide-shape-prim-group arg0) num-children))) + ) + (while (nonzero? (the-as uint s2-1)) + (set! s2-1 (+ (the-as uint s2-1) -1)) + (when (and (logtest? s4-0 (-> s3-0 prim-core collide-as)) + (logtest? (-> s3-0 prim-core action) (collide-action can-ride)) + ) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s3-0 prim-core))) + (-> this prim-core world-sphere w) + ) + (-> s3-0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-2 122.88) + (on-platform-test this s3-0 arg1 f0-2) + ) + ) + ) + (&+! s3-0 80) + ) + ) + ) + ((collide-shape-prim-sphere) + (let ((s3-1 (-> this mesh))) + (when s3-1 + (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* this))) + (when v1-13 + (let* ((s4-1 (new 'stack-no-clear 'collide-tri-result)) + (f0-4 (sphere-on-platform-test + s3-1 + (the-as collide-mesh-cache-tri (-> v1-13 tris)) + s4-1 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (when (< f0-4 (-> arg1 best-dist)) + (set! (-> arg1 best-dist) f0-4) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s4-1 vertex 0 quad)) + (set! (-> arg1 best-other-tri vertex 1 quad) (-> s4-1 vertex 1 quad)) + (set! (-> arg1 best-other-tri vertex 2 quad) (-> s4-1 vertex 2 quad)) + (set! (-> arg1 best-other-tri intersect quad) (-> s4-1 intersect quad)) + (set! (-> arg1 best-other-tri normal quad) (-> s4-1 normal quad)) + (set! (-> arg1 best-other-tri pat) (-> s4-1 pat)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod add-rider ((this collide-rider-pool) (arg0 handle)) + (let ((v1-0 (-> this alloc-count))) + (cond + ((< v1-0 20) + (let ((v0-0 (-> this riders v1-0))) + (set! (-> this alloc-count) (+ v1-0 1)) + (set! (-> v0-0 rider-handle) arg0) + (set! (-> v0-0 sticky-prim) #f) + v0-0 + ) + ) + (else + (format 0 "ERROR: *collide-rider-pool*: exceeded max # of riders!~%") + (the-as collide-rider #f) + ) + ) + ) + ) + +;; WARN: Return type mismatch joint-control-status vs symbol. +(defmethod detect-riders! ((this collide-shape)) + (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (set! (-> this num-riders) (the-as uint 0)) + (set! (-> this riders) (the-as (inline-array collide-rider) #f)) + (let* ((s4-0 (-> this root-prim)) + (s5-0 (-> s4-0 prim-core collide-with)) + ) + (set! *actor-list-length* 0) + (if (logtest? s5-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> s4-0 prim-core)) *actor-list* 256) + ) + ) + (when (logtest? s5-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-11 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s5-0 (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (-> s4-0 prim-core)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> s4-0 prim-core world-sphere w))) + ) + (when (< f0-0 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-11) + *collide-player-list* + (set! v1-11 (-> v1-11 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-19 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-13 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? s5-0 (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (-> s4-0 prim-core)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-14 world-sphere w) (-> s4-0 prim-core world-sphere w))) + ) + (when (< f0-1 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-19) + *collide-hit-by-player-list* + (set! v1-19 (-> v1-19 next0)) + ) + ) + ) + ) + (dotimes (s4-1 *actor-list-length*) + (let* ((s3-0 (-> *actor-list* s4-1)) + (v1-24 (-> s3-0 root-prim)) + ) + (when (logtest? s5-0 (-> v1-24 prim-core collide-as)) + (when (and (logtest? (-> v1-24 prim-core action) (collide-action can-ride)) + (!= (-> this process) (-> s3-0 process)) + ) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (when (on-platform this s3-0 s2-0) + (let ((s5-1 (add-rider *collide-rider-pool* (process->handle (-> s3-0 process))))) + (when s5-1 + (+! (-> this num-riders) 1) + (if (not (-> this riders)) + (set! (-> this riders) (the-as (inline-array collide-rider) s5-1)) + ) + (let ((a0-15 (-> s2-0 best-my-prim))) + (set! (-> s5-1 sticky-prim) a0-15) + (let ((s1-0 (-> this process node-list data (-> a0-15 transform-index) bone transform))) + (set! (-> s5-1 prim-ry) (matrix-y-angle s1-0)) + (let ((s2-1 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s2-1 s1-0) + (set! (-> s3-0 trans w) 1.0) + (vector-matrix*! (-> s5-1 rider-local-pos) (-> s3-0 trans) s2-1) + ) + ) + ) + (send-event (-> this process) 'ridden s5-1) + ) + ) + (set! s5-0 (-> this root-prim prim-core collide-with)) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-58 (-> this process skel))) + (the-as + symbol + (when (nonzero? v1-58) + (cond + ((or (> (-> this num-riders) 0) (logtest? (-> this root-prim prim-core action) (collide-action edge-grabbed))) + (set! v0-7 (logior (-> v1-58 status) (joint-control-status sync-math))) + (set! (-> v1-58 status) v0-7) + ) + (else + (set! v0-7 (logclear (-> v1-58 status) (joint-control-status sync-math))) + (set! (-> v1-58 status) v0-7) + ) + ) + v0-7 + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch int vs symbol. +(defmethod pull-riders! ((this collide-shape)) + (let ((s5-0 (-> this riders))) + (when s5-0 + (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) + (countdown (s3-0 (-> this num-riders)) + (let* ((v1-2 (-> s5-0 s3-0)) + (a0-1 (-> v1-2 rider-handle)) + ) + (when (handle->process a0-1) + (set! (-> s4-0 rider) v1-2) + (set! (-> s4-0 rider-cshape) + (the-as collide-shape-moving (-> (the-as process-drawable (-> a0-1 process 0)) root)) + ) + (let ((a0-5 (-> v1-2 sticky-prim))) + (when a0-5 + (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s1-0 (-> s4-0 rider-dest))) + (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) + ) + (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) + ) + (pull-rider! this s4-0) + ) + ) + ) + ) + ) + ) + ) + ) + (the-as symbol 0) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 rider-cshape))) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> gp-0 trans quad)) + (vector-! s2-0 (-> arg0 rider-dest) s3-0) + (cond + ((logtest? (-> this root-prim prim-core action) (collide-action pull-rider-can-collide)) + (let ((s1-0 (-> this root-prim prim-core collide-as))) + (set! (-> this root-prim prim-core collide-as) (collide-spec)) + (let ((a2-0 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) (-> gp-0 process)) + (set! (-> a2-0 ignore-process1) #f) + (set! (-> a2-0 ignore-pat) (-> gp-0 pat-ignore-mask)) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-for-shape gp-0 (+ 8192.0 (vector-length s2-0)) a2-0) + ) + (set! (-> this root-prim prim-core collide-as) s1-0) + ) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (set! (-> s1-1 quad) (-> s2-0 quad)) + (let ((v1-19 s1-1)) + (.lvf vf1 (&-> s1-1 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-19 quad) vf1) + ) + (cond + ((type? gp-0 collide-shape-moving) + (let ((s2-1 (-> gp-0 status))) + (integrate-and-collide! gp-0 s1-1) + (set! (-> gp-0 status) s2-1) + ) + ) + (else + (integrate-and-collide! gp-0 s1-1) + ) + ) + ) + ) + (else + (move-by-vector! gp-0 s2-0) + ) + ) + (when (type? gp-0 collide-shape-moving) + (let ((v1-26 (new 'stack-no-clear 'vector))) + (vector-! v1-26 (-> gp-0 trans) s3-0) + (vector-float*! + (-> gp-0 rider-last-move) + v1-26 + (* (-> pp clock frames-per-second) (-> this process clock clock-ratio)) + ) + ) + (let ((f0-5 (vector-length (-> gp-0 rider-last-move)))) + (if (< (-> this rider-max-momentum) f0-5) + (vector-normalize! (-> gp-0 rider-last-move) (-> this rider-max-momentum)) + ) + ) + (set! (-> gp-0 rider-time) (-> gp-0 process clock frame-counter)) + ) + ) + (let ((f0-7 (-> arg0 rider-delta-ry))) + (if (!= f0-7 0.0) + (send-event (-> gp-0 process) 'rotate-y-angle f0-7) + ) + ) + ) + (none) + ) + ) + ) diff --git a/goal_src/jak3/engine/collide/collide-shape.gc b/goal_src/jak3/engine/collide/collide-shape.gc index 6656bddb80..0b39d5d785 100644 --- a/goal_src/jak3/engine/collide/collide-shape.gc +++ b/goal_src/jak3/engine/collide/collide-shape.gc @@ -5,5 +5,3040 @@ ;; name in dgo: collide-shape ;; dgos: GAME +(deftype do-push-aways-work (structure) + "Added" + ((cquery collide-query :inline) + (push-vel vector :inline) + (vec33 vector :inline :offset 560) + (cspec collide-spec :offset 576) + ) + ) + ;; DECOMP BEGINS +;; WARN: Return type mismatch collide-shape vs none. +(defmethod pusher-init ((this collide-shape)) + (when (logtest? (collide-spec pusher) (-> this root-prim prim-core collide-as)) + (let ((v1-3 (the-as process-tree (-> this process)))) + (while (not (logtest? (-> v1-3 mask) (process-mask process-tree))) + (set! v1-3 (ppointer->process (-> v1-3 parent))) + ) + (if (!= v1-3 *pusher-pool*) + (change-parent (-> this process) *pusher-pool*) + ) + ) + ) + (none) + ) + +(defmethod should-push-away ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) + (local-vars (v1-2 uint) (v1-3 float) (a2-2 uint) (a3-2 uint)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg1)) + (set! (-> v1-0 best-dist) 0.0) + (set! (-> v1-0 best-my-prim) #f) + (set! (-> v1-0 best-other-prim) #f) + ) + (let ((a0-1 (-> this root-prim)) + (a1-1 (-> arg0 root-prim)) + ) + (let ((a3-0 (-> a0-1 prim-core collide-with)) + (t0-0 (-> a1-1 prim-core collide-as)) + (v1-1 (-> a0-1 prim-core action)) + ) + (let ((a2-1 (-> a1-1 prim-core action))) + (b! (not (logtest? a3-0 t0-0)) cfg-8 :delay (set! a3-2 (the-as uint (logand a2-1 1)))) + (b! (zero? a3-2) cfg-8 :delay (set! a2-2 (the-as uint (logand a2-1 16)))) + ) + (b! (nonzero? a2-2) cfg-8 :delay (set! v1-2 (the-as uint (logand v1-1 1)))) + ) + (b! (zero? v1-2) cfg-8 :delay (nop!)) + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.lvf vf2 (&-> a1-1 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf5 vf3 vf4 :mask #b1000) + (let ((f0-1 0.0)) + (.add.w.vf vf5 vf0 vf5 :mask #b1) + (.mov v1-3 vf5) + (b! (<= f0-1 v1-3) cfg-8) + ) + (should-push-away-test a0-1 a1-1 arg1) + ) + (let ((v0-1 (< (-> arg1 best-dist) 0.0))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (set! v0-1 #f) + (label cfg-9) + v0-1 + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod should-push-away-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) + (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") + (none) + ) + +(defmethod should-push-away-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query)) + (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((s4-0 (the-as collide-shape-prim this)) + (s3-0 (-> this num-children)) + ) + (nop!) + (let ((v1-0 (-> arg0 prim-core collide-as))) + (nop!) + (.lvf vf1 (&-> arg0 prim-core world-sphere quad)) + (until (> f0-0 a0-3) + (until (nonzero? a0-2) + (label cfg-1) + ;; og:preserve-this + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (&+ s4-0 80))) + (+! s3-0 -1) + (let ((a1-1 (-> s4-0 prim-core collide-with))) + (nop!) + (let ((a0-1 (-> s4-0 prim-core action)) + (a1-2 (logand a1-1 v1-0)) + ) + (set! a0-2 (logand a0-1 (collide-action solid))) + (b! (zero? a1-2) cfg-1 :delay (.lvf vf2 (&-> s4-0 prim-core world-sphere quad))) + ) + ) + ) + (.sub.vf vf3 vf2 vf1) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (set! f0-0 0.0) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + ) + (should-push-away-test s4-0 arg0 arg1) + (set! v1-0 (-> arg0 prim-core collide-as)) + ) + ) + (b! #t cfg-1 :delay (.lvf vf1 (&-> arg0 prim-core world-sphere quad))) + (label cfg-6) + 0 + (none) + ) + ) + +(defmethod should-push-away-a-group-test ((this collide-shape-prim) (arg0 collide-shape-prim-group) (arg1 collide-query)) + (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((s4-0 (the-as object arg0)) + (s3-0 (-> arg0 num-children)) + ) + (nop!) + (let ((v1-0 (-> this prim-core collide-with))) + (nop!) + (.lvf vf2 (&-> this prim-core world-sphere quad)) + (until (> f0-0 a0-3) + (until (nonzero? a0-2) + (label cfg-1) + ;; og:preserve-this + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (&+ (the-as collide-shape-prim s4-0) 80))) + (+! s3-0 -1) + (let ((a1-1 (-> (the-as collide-shape-prim s4-0) prim-core collide-as))) + (nop!) + (let ((a0-1 (-> (the-as collide-shape-prim s4-0) prim-core action)) + (a1-2 (logand v1-0 a1-1)) + ) + (set! a0-2 (logand a0-1 (collide-action solid))) + (b! (zero? a1-2) cfg-1 :delay (.lvf vf1 (&-> (the-as collide-shape-prim s4-0) prim-core world-sphere quad))) + ) + ) + ) + (.sub.vf vf3 vf2 vf1) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (set! f0-0 0.0) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + ) + (should-push-away-test this (the-as collide-shape-prim s4-0) arg1) + (set! v1-0 (-> this prim-core collide-with)) + ) + ) + (b! #t cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) + (label cfg-6) + 0 + (none) + ) + ) + +(defmethod should-push-away-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((zero? v1-0) + (should-push-away-a-group-test this (the-as collide-shape-prim-group arg0) arg1) + ) + (else + (b! (> v1-0 0) cfg-8 :delay (nop!)) + (let ((s2-0 (-> this mesh))) + (b! (not s2-0) cfg-7 :delay (empty-form)) + (let ((v1-4 (populate-for-prim-mesh *collide-mesh-cache* this))) + (b! (not v1-4) cfg-7 :delay (empty-form)) + (let ((s5-0 (new 'stack-no-clear 'collide-tri-result))) + (let ((f0-1 (should-push-away-test + s2-0 + (the-as collide-mesh-cache-tri (-> v1-4 tris)) + s5-0 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (b! (>= f0-1 (-> arg1 best-dist)) cfg-7 :delay #f) + (set! (-> arg1 best-dist) f0-1) + ) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s5-0 vertex 0 quad)) + (set! (-> arg1 best-other-tri vertex 1 quad) (-> s5-0 vertex 1 quad)) + (set! (-> arg1 best-other-tri vertex 2 quad) (-> s5-0 vertex 2 quad)) + (set! (-> arg1 best-other-tri intersect quad) (-> s5-0 intersect quad)) + (set! (-> arg1 best-other-tri normal quad) (-> s5-0 normal quad)) + (set! (-> arg1 best-other-tri pat) (-> s5-0 pat)) + ) + ) + ) + (label cfg-7) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (format 0 "ERROR: Attempted unsupported mesh -> mesh test in collide-shape-prim::should-push-away-test!~%") + ) + ) + ) + (label cfg-9) + 0 + (none) + ) + +(defmethod should-push-away-test ((this collide-shape-prim-sphere) (arg0 collide-shape-prim) (arg1 collide-query)) + (local-vars (v1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((zero? v1-0) + (should-push-away-a-group-test this (the-as collide-shape-prim-group arg0) arg1) + ) + (else + (b! (> v1-0 0) cfg-5 :delay (nop!)) + (.lvf vf1 (&-> this prim-core world-sphere quad)) + (.lvf vf2 (&-> arg0 prim-core world-sphere quad)) + (.sub.vf vf3 vf2 vf1 :mask #b111) + (.add.w.vf vf5 vf1 vf2 :mask #b1000) + (.mul.vf vf4 vf3 vf3 :mask #b111) + (.mul.x.vf acc vf0 vf4 :mask #b1000) + (.add.mul.y.vf acc vf0 vf4 acc :mask #b1000) + (.add.mul.z.vf vf4 vf0 vf4 acc :mask #b1000) + (.sqrt.vf Q vf4 :ftf #b11) + (.mov.vf vf3 vf0 :mask #b1000) + (.add.w.vf vf5 vf0 vf5 :mask #b1) + (let ((f2-0 (-> arg1 best-dist))) + (.wait.vf) + (nop!) + (.add.vf vf4 vf0 Q :mask #b1) + (.sub.x.vf vf6 vf4 vf5 :mask #b1) + (.mul.x.vf vf3 vf3 vf4 :mask #b111) + (.mov v1-3 vf6) + (let ((f1-0 v1-3)) + (b! (<= f2-0 f1-0) cfg-9) + (let ((v1-4 (-> this pat))) + (set! (-> arg1 best-dist) f1-0) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (.svf (&-> arg1 best-other-tri normal quad) vf3) + (set! (-> arg1 best-other-tri pat) v1-4) + ) + ) + ) + (let ((s3-0 (-> arg1 best-other-tri normal)) + (s4-1 (-> arg1 best-other-tri intersect)) + ) + (vector-float*! s4-1 s3-0 (-> this prim-core world-sphere w)) + (vector+! s4-1 s4-1 (the-as vector (-> this prim-core))) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s4-1 quad)) + (point-in-plane-<-point+normal! (-> arg1 best-other-tri vertex 1) s4-1 s3-0) + (let* ((a0-8 (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (-> arg1 best-other-tri vertex 1) + (the-as vector (-> arg1 best-other-tri)) + ) + 1.0 + ) + ) + (v1-11 (vector-cross! (new 'stack-no-clear 'vector) s3-0 a0-8)) + (a0-9 (-> arg1 best-other-tri vertex 2)) + ) + (let ((a1-7 4096.0)) + (.mov vf7 a1-7) + ) + (.lvf vf5 (&-> v1-11 quad)) + (.lvf vf4 (&-> s4-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-9 quad) vf6) + ) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-5) + (let ((s2-0 (-> (the-as collide-shape-prim-mesh arg0) mesh))) + (when s2-0 + (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* (the-as collide-shape-prim-mesh arg0)))) + (when v1-13 + (let* ((s3-1 (new 'stack-no-clear 'collide-tri-result)) + (f0-3 (should-push-away-test + s2-0 + (the-as collide-mesh-cache-tri (-> v1-13 tris)) + s3-1 + (the-as vector (-> this prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (when (< f0-3 (-> arg1 best-dist)) + (set! (-> arg1 best-dist) f0-3) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (let ((s4-2 (-> arg1 best-other-tri normal))) + (vector-! s4-2 (-> s3-1 intersect) (the-as vector (-> this prim-core))) + (vector-normalize! s4-2 1.0) + (let ((s3-2 (-> arg1 best-other-tri intersect))) + (vector-float*! s3-2 s4-2 (-> this prim-core world-sphere w)) + (vector+! s3-2 s3-2 (the-as vector (-> this prim-core))) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s3-2 quad)) + (point-in-plane-<-point+normal! (-> arg1 best-other-tri vertex 1) s3-2 s4-2) + (let* ((a0-23 (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (-> arg1 best-other-tri vertex 1) + (the-as vector (-> arg1 best-other-tri)) + ) + 1.0 + ) + ) + (v1-23 (vector-cross! (new 'stack-no-clear 'vector) s4-2 a0-23)) + (a0-24 (-> arg1 best-other-tri vertex 2)) + ) + (let ((a1-18 4096.0)) + (.mov vf7 a1-18) + ) + (.lvf vf5 (&-> v1-23 quad)) + (.lvf vf4 (&-> s3-2 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-24 quad) vf6) + ) + ) + ) + (set! (-> arg1 best-other-tri pat) (-> this pat)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-9) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") + (none) + ) + +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (let* ((gp-0 (new 'stack-no-clear 'collide-tri-result)) + (f0-1 (resolve-moving-sphere-tri + arg1 + gp-0 + (-> this prim-core) + (-> arg0 move-dist) + (-> arg0 best-dist) + (-> this prim-core action) + ) + ) + ) + (when (>= f0-1 0.0) + (let ((v1-3 (-> arg1 prim-core action)) + (a0-2 (-> this prim-core action)) + (a2-2 (-> arg1 prim)) + ) + (let* ((v1-4 (logand a0-2 v1-3)) + (a0-3 (-> this cshape)) + (a1-2 (logand v1-4 (collide-action solid))) + (v1-5 (-> a2-2 cshape)) + ) + (b! (zero? a1-2) cfg-6 :delay (nop!)) + (b! (= v1-5 #f) cfg-5 :likely-delay (set! a2-2 (the-as collide-shape-prim #f))) + (b! (logtest? (-> a0-3 penetrate-using) (-> v1-5 penetrated-by)) cfg-6 :delay (nop!)) + (label cfg-5) + (.lvf vf3 (&-> gp-0 vertex 0 quad)) + (.lvf vf4 (&-> gp-0 vertex 1 quad)) + (.lvf vf5 (&-> gp-0 vertex 2 quad)) + (.lvf vf1 (&-> gp-0 intersect quad)) + (.lvf vf2 (&-> gp-0 normal quad)) + (let ((a0-6 (-> gp-0 pat)) + (a1-4 (-> gp-0 collide-ptr)) + ) + (set! (-> arg0 best-dist) f0-1) + (.svf (&-> arg0 best-other-tri vertex 0 quad) vf3) + (.svf (&-> arg0 best-other-tri vertex 1 quad) vf4) + (.svf (&-> arg0 best-other-tri vertex 2 quad) vf5) + (.svf (&-> arg0 best-other-tri intersect quad) vf1) + (.svf (&-> arg0 best-other-tri normal quad) vf2) + (set! (-> arg0 best-other-tri pat) a0-6) + (set! (-> arg0 best-other-tri collide-ptr) a1-4) + ) + (set! (-> arg0 best-other-prim) a2-2) + (set! (-> arg0 best-my-prim) this) + (label cfg-6) + (b! (not v1-5) cfg-8 :delay (empty-form)) + ) + (add-touching-prims + *touching-list* + this + a2-2 + f0-1 + (the-as collide-tri-result #f) + (the-as collide-tri-result (-> gp-0 vertex)) + ) + ) + ) + ) + (label cfg-8) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") + (none) + ) + +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) + (let ((s4-0 (-> arg1 prim-core collide-as)) + (s3-0 (-> this child 0)) + ) + (countdown (s2-0 (-> this num-children)) + (if (logtest? (-> s3-0 prim-core collide-with) s4-0) + (collide-with-collide-cache-prim-mesh s3-0 arg0 arg1) + ) + (&+! s3-0 80) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") + (none) + ) + +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (let* ((gp-0 (new 'stack-no-clear 'collide-tri-result)) + (f0-1 (resolve-moving-sphere-sphere + arg1 + gp-0 + (-> this prim-core) + (-> arg0 move-dist) + (-> arg0 best-dist) + (-> arg1 prim-core action) + ) + ) + ) + (b! (< f0-1 0.0) cfg-5 :delay #f) + (let ((v1-3 (-> arg1 prim-core action)) + (a0-2 (-> this prim-core action)) + (a2-2 (-> arg1 prim)) + ) + (let* ((a0-3 (logand a0-2 v1-3)) + (v1-4 (-> this cshape)) + (a1-2 (logand a0-3 (collide-action solid))) + (a0-4 (-> a2-2 cshape)) + ) + (b! (zero? a1-2) cfg-4 :delay (nop!)) + (b! (logtest? (-> v1-4 penetrate-using) (-> a0-4 penetrated-by)) cfg-4 :delay (nop!)) + ) + (.lvf vf3 (&-> gp-0 vertex 0 quad)) + (.lvf vf4 (&-> gp-0 vertex 1 quad)) + (.lvf vf5 (&-> gp-0 vertex 2 quad)) + (.lvf vf1 (&-> gp-0 intersect quad)) + (.lvf vf2 (&-> gp-0 normal quad)) + (let ((v1-7 (-> gp-0 pat)) + (a0-6 (-> gp-0 collide-ptr)) + ) + (set! (-> arg0 best-dist) f0-1) + (.svf (&-> arg0 best-other-tri vertex 0 quad) vf3) + (.svf (&-> arg0 best-other-tri vertex 1 quad) vf4) + (.svf (&-> arg0 best-other-tri vertex 2 quad) vf5) + (.svf (&-> arg0 best-other-tri intersect quad) vf1) + (.svf (&-> arg0 best-other-tri normal quad) vf2) + (set! (-> arg0 best-other-tri pat) v1-7) + (set! (-> arg0 best-other-tri collide-ptr) a0-6) + ) + (set! (-> arg0 best-other-prim) a2-2) + (set! (-> arg0 best-my-prim) this) + (label cfg-4) + (add-touching-prims + *touching-list* + this + a2-2 + f0-1 + (the-as collide-tri-result #f) + (the-as collide-tri-result (-> gp-0 vertex)) + ) + ) + ) + (label cfg-5) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") + (none) + ) + +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) + (let ((s4-0 (-> arg1 prim-core collide-as)) + (s3-0 (-> this child 0)) + ) + (countdown (s2-0 (-> this num-children)) + (if (logtest? (-> s3-0 prim-core collide-with) s4-0) + (collide-with-collide-cache-prim-sphere s3-0 arg0 arg1) + ) + (&+! s3-0 80) + ) + ) + 0 + (none) + ) + +(defun find-ground-point ((arg0 control-info) (arg1 vector) (arg2 float) (arg3 float)) + (local-vars (sv-560 int)) + (let* ((f0-0 819.2) + (v1-1 (-> arg0 transv)) + (f30-0 (if (< f0-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) + (vector-y-angle (-> arg0 transv)) + (y-angle arg0) + ) + ) + (s2-0 (-> arg0 trans)) + (s1-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s1-0 collide-with) (-> arg0 root-prim prim-core collide-with)) + (set! (-> s1-0 ignore-process0) (-> arg0 process)) + (set! (-> s1-0 ignore-process1) #f) + (set! (-> s1-0 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> s1-0 action-mask) (collide-action solid)) + (set! (-> arg1 w) 0.0) + (dotimes (v1-9 3) + (set! (-> s1-0 bbox min data v1-9) (- (-> s2-0 data v1-9) arg3)) + (set! (-> s1-0 bbox max data v1-9) (+ (-> s2-0 data v1-9) arg3)) + ) + (set! (-> s1-0 bbox min y) (+ -40960.0 (-> s2-0 y))) + (set! (-> s1-0 bbox max y) (+ 20480.0 (-> s2-0 y))) + (fill-using-bounding-box *collide-cache* s1-0) + (vector+! (-> s1-0 start-pos) s2-0 (new 'static 'vector :y 20480.0 :w 1.0)) + (let ((v1-16 s1-0)) + (set! (-> v1-16 radius) 2048.0) + (set! (-> v1-16 collide-with) (-> arg0 root-prim prim-core collide-with)) + (set! (-> v1-16 ignore-process0) (-> arg0 process)) + (set! (-> v1-16 ignore-process1) #f) + (set! (-> v1-16 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> v1-16 action-mask) (collide-action solid)) + ) + (dotimes (s0-0 8) + (let ((f28-0 (+ f30-0 (if (not (logtest? s0-0 1)) + (* 8192.0 (the float (/ s0-0 2))) + (* -8192.0 (the float (/ s0-0 2))) + ) + ) + ) + ) + (set! sv-560 0) + (let ((f26-0 arg3)) + (set-vector! (-> s1-0 move-dist) 0.0 0.0 arg3 1.0) + (vector-rotate-y! (-> s1-0 move-dist) (-> s1-0 move-dist) f28-0) + (if (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0) + (set! f26-0 (+ -6144.0 (vector-vector-xz-distance s2-0 (-> s1-0 best-other-tri intersect)))) + ) + (let ((f24-0 arg2)) + (while (>= f26-0 f24-0) + (set-vector! (-> s1-0 start-pos) 0.0 0.0 f24-0 1.0) + (vector-rotate-y! (-> s1-0 start-pos) (-> s1-0 start-pos) f28-0) + (vector+! (-> s1-0 start-pos) s2-0 (-> s1-0 start-pos)) + (set! (-> s1-0 start-pos y) (+ 20480.0 (-> s2-0 y))) + (set-vector! (-> s1-0 move-dist) 0.0 -61440.0 0.0 1.0) + (let ((v1-33 s1-0)) + (set! (-> v1-33 radius) 10240.0) + (set! (-> v1-33 collide-with) (-> arg0 root-prim prim-core collide-with)) + (set! (-> v1-33 ignore-process0) (-> arg0 process)) + (set! (-> v1-33 ignore-process1) #f) + (set! (-> v1-33 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> v1-33 action-mask) (collide-action solid)) + ) + (when (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0) + (cond + ((and (or (= (-> s1-0 best-other-tri pat mode) (pat-mode ground)) + (= (-> s1-0 best-other-tri pat mode) (pat-mode halfpipe)) + ) + (and (= (-> s1-0 best-other-tri pat event) (pat-event none)) (< 0.7 (-> s1-0 best-other-tri normal y))) + ) + (set! (-> arg1 quad) (-> s1-0 best-other-tri intersect quad)) + (set! sv-560 (+ sv-560 1)) + (if (>= sv-560 2) + (return arg1) + ) + ) + ((and (= (-> s1-0 best-other-tri pat mode) (pat-mode wall)) + (< (+ 4096.0 (-> s2-0 y)) (-> s1-0 best-other-tri intersect y)) + ) + (goto cfg-38) + ) + ) + ) + (set! f24-0 (+ 4096.0 f24-0)) + ) + ) + ) + ) + (label cfg-38) + ) + ) + (the-as vector #f) + ) + +;; WARN: Return type mismatch object vs none. +(defun target-attack-up ((arg0 target) (arg1 symbol) (arg2 symbol)) + (when (send-event arg0 arg1 #f (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg2) + (test #t) + ) + ) + ) + (let ((s3-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) 8192.0 40960.0))) + (set! s3-0 (cond + (s3-0 + (empty) + s3-0 + ) + (else + (-> arg0 control last-trans-on-ground) + ) + ) + ) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans))) + (f0-3 8192.0) + (f1-0 40960.0) + (v1-8 s2-1) + (f30-0 (fmax f0-3 (fmin f1-0 (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z))))))) + ) + (cond + ((< (fabs + (vector-dot + (-> arg0 control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans)) + ) + ) + 40960.0 + ) + (vector-xz-normalize! s2-1 f30-0) + (send-event + arg0 + arg1 + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg2) + (vector s2-1) + (shove-up + (+ (lerp-scale 4096.0 16384.0 f30-0 4096.0 40960.0) (fmax 0.0 (- (-> s3-0 y) (-> arg0 control trans y)))) + ) + (angle 'up) + ) + ) + ) + ) + (else + (send-event + arg0 + arg1 + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg2) + (vector + (-> (new 'static 'attack-info :trans (new 'static 'vector :y 40960.0 :w 1.0) :speed (the-as float #x68a)) + trans + ) + ) + (shove-up (meters 10)) + (angle 'up) + (control 1.0) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch int vs cshape-reaction-flags. +(defmethod react-to-pat! ((this collide-shape-moving) (arg0 pat-surface)) + (let ((s5-0 0)) + (set! (-> this cur-pat) arg0) + (set! (-> this poly-pat) arg0) + (case (-> arg0 material) + (((pat-material ice)) + (set! (-> this surf) *ice-surface*) + ) + (((pat-material gravel)) + (set! (-> this surf) *gravel-surface*) + ) + (((pat-material quicksand)) + (set! (-> this surf) *quicksand-surface*) + ) + (((pat-material mhshroom)) + (set! (-> this surf) *mushroom-surface*) + ) + (((pat-material tube)) + (set! (-> this surf) *no-walk-surface*) + ) + (else + (set! (-> this surf) *standard-ground-surface*) + ) + ) + (when (nonzero? (-> arg0 event)) + (case (-> arg0 event) + (((pat-event slide)) + (set! (-> this surf) *gravel-surface*) + (send-event (-> this process) 'slide) + ) + (((pat-event slippery)) + (set! (-> this surf) *gravel-surface*) + ) + (((pat-event rail)) + (let* ((s4-0 (-> this process)) + (a0-15 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if (and a0-15 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-15) focus-status)))) + (set! (-> this surf) *rail-surface*) + ) + ) + ) + (((pat-event deadly)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'deadly) + (shove-up (meters 3)) + ) + ) + ) + ) + (((pat-event burn)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'burn) + (shove-up (meters 3)) + ) + ) + ) + ) + (((pat-event deadlyup)) + (set! s5-0 (logior s5-0 #x4000)) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'deadlyup) + ) + (((pat-event shockup)) + (set! s5-0 (logior s5-0 #x4000)) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'shockup) + ) + (((pat-event burnup)) + (when (not (focus-test? (the-as process-focusable (-> this process)) pilot)) + (set! s5-0 (logior s5-0 #x4000)) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'burnup) + ) + ) + (((pat-event melt)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'melt)) + ) + ) + ) + (((pat-event fry)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 4.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'fry)) + ) + ) + ) + (((pat-event slime)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 4.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'slime)) + ) + ) + ) + (((pat-event endlessfall)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'endlessfall) + ) + ) + ) + ) + (((pat-event shock)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock)) + ) + ) + ) + (((pat-event lip)) + (send-event (-> this process) 'lip 'lip) + ) + (((pat-event lipramp)) + (send-event (-> this process) 'lip 'lipramp) + ) + (((pat-event hang)) + (send-event (-> this process) 'change-mode 'hang #f) + ) + ) + ) + (the-as cshape-reaction-flags s5-0) + ) + ) + +(defun collide-shape-moving-angle-set! ((arg0 collide-shape-moving) (arg1 vector) (arg2 vector)) + (set! (-> arg0 surface-normal quad) (-> arg1 quad)) + (set! (-> arg0 surface-angle) (vector-dot arg1 (-> arg0 dynam gravity-normal))) + (set! (-> arg0 poly-angle) (vector-dot (-> arg0 poly-normal) (-> arg0 dynam gravity-normal))) + (set! (-> arg0 touch-angle) + (fmax + (-> arg0 touch-angle) + (vector-dot arg1 (vector-normalize! (vector-negate! (new-stack-vector0) arg2) 1.0)) + ) + ) + 0 + (none) + ) + +(defun cshape-reaction-update-state ((arg0 control-info) (arg1 collide-query) (arg2 vector)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 collide-status) (sv-96 symbol)) + (set! sv-48 (new-stack-vector0)) + (set! sv-52 (new-stack-vector0)) + (set! sv-56 (collide-status)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (react-to-pat! arg0 (-> arg1 best-other-tri pat)) + (vector-! sv-48 (the-as vector (-> arg1 best-my-prim prim-core)) (-> arg1 best-other-tri intersect)) + (cond + ((and (= (-> arg1 best-dist) 0.0) + (< (vector-length sv-48) (+ -40.96 (-> arg1 best-my-prim prim-core world-sphere w))) + ) + (set! (-> sv-48 quad) (-> arg1 best-other-tri normal quad)) + (set! (-> arg0 coverage) 0.0) + ) + (else + (set! (-> sv-48 w) 1.0) + (vector-normalize! sv-48 1.0) + (set! (-> arg0 coverage) (vector-dot sv-48 (-> arg1 best-other-tri normal))) + (when (< (-> arg0 coverage) 0.0) + (set! (-> arg0 coverage) 0.0) + (vector-flatten! sv-48 sv-48 (-> arg1 best-other-tri normal)) + (vector-normalize! sv-48 1.0) + ) + ) + ) + (let ((v1-25 (-> sv-48 quad))) + (set! (-> sv-52 quad) v1-25) + ) + (if (= (-> arg1 best-dist) 0.0) + (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-52 6.0)) + ) + (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (collide-shape-moving-angle-set! arg0 sv-52 arg2) + (if (< (-> arg0 poly-angle) -0.2) + (set! sv-56 (logior sv-56 (collide-status touch-ceiling))) + ) + (set! sv-96 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) + (set! sv-56 (logior sv-56 (collide-status touch-surface))) + (if (-> arg1 best-other-prim) + (set! sv-56 (logior sv-56 (collide-status touch-actor))) + ) + (cond + (sv-96 + (set! sv-56 (logior sv-56 (collide-status touch-wall))) + (set! (-> arg0 cur-pat mode) 1) + ) + (else + (set! sv-56 (logior sv-56 (collide-status on-surface))) + (set! (-> arg0 local-normal quad) (-> sv-52 quad)) + ) + ) + (when (and (not sv-96) (>= (-> arg0 coverage) 0.9)) + (set! sv-56 (logior sv-56 (collide-status on-ground))) + (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (when (!= (-> arg0 poly-pat mode) (pat-mode wall)) + (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) + (set! (-> arg0 ground-touch-point quad) (-> arg1 best-other-tri intersect quad)) + ) + ) + (when (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) + (set! sv-56 (logior sv-56 (collide-status impact-surface))) + (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) + ) + (logior! (-> arg0 status) sv-56) + 0 + (none) + ) + +(defun cshape-reaction-default ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> arg3 quad)) + (when (and (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) + (not (logtest? (-> arg0 status) (collide-status touch-wall))) + ) + (let ((f0-1 (- 1.0 (-> arg0 surf impact-fric)))) + (when (< f0-1 1.0) + (let ((v1-9 (new-stack-vector0)) + (f1-3 (vector-dot (-> arg0 dynam gravity-normal) a1-1)) + ) + 0.0 + (vector-! v1-9 a1-1 (vector-float*! v1-9 (-> arg0 dynam gravity-normal) f1-3)) + (let* ((f2-2 (vector-length v1-9)) + (f3-0 f2-2) + ) + (if (< f1-3 0.0) + (set! f1-3 (* f1-3 f0-1)) + ) + (vector+! + a1-1 + (vector-float*! a1-1 (-> arg0 dynam gravity-normal) f1-3) + (vector-float*! v1-9 v1-9 (/ f2-2 f3-0)) + ) + ) + ) + ) + ) + ) + (vector-reflect-flat! arg2 a1-1 (-> arg0 surface-normal)) + ) + (-> arg0 status) + ) + +(defun cshape-reaction-just-move ((arg0 control-info) (arg1 collide-query) (arg2 vector)) + (vector-reset! arg2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (let ((v1-5 4)) + (if (-> arg1 best-other-prim) + (set! v1-5 (logior v1-5 32)) + ) + (let ((v0-1 (logior (-> arg0 status) v1-5))) + (set! (-> arg0 status) v0-1) + v0-1 + ) + ) + ) + +(defmethod step-collision! ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) + (local-vars (sv-592 int)) + (let ((s5-0 (new 'stack 'collide-query)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! s2-0 arg1 (* arg2 (seconds-per-frame))) + (set! (-> s5-0 move-dist quad) (-> s2-0 quad)) + (set! (-> s5-0 best-dist) -100000000.0) + (set! (-> s5-0 best-my-prim) #f) + (set! (-> s5-0 best-other-prim) #f) + (let* ((s1-1 (-> this root-prim)) + (v1-5 *collide-cache*) + (s0-0 (the-as collide-cache-prim (-> v1-5 prims))) + ) + (set! sv-592 (-> v1-5 num-prims)) + (while (nonzero? sv-592) + (set! sv-592 (+ sv-592 -1)) + (when (logtest? (-> s1-1 prim-core collide-with) (-> s0-0 prim-core collide-as)) + (if (>= (-> s0-0 prim-core prim-type) 0) + (collide-with-collide-cache-prim-mesh s1-1 s5-0 s0-0) + (collide-with-collide-cache-prim-sphere s1-1 s5-0 s0-0) + ) + ) + (&+! s0-0 48) + ) + ) + (let ((f30-0 (-> s5-0 best-dist))) + (set! f30-0 (cond + ((>= f30-0 0.0) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (if *display-collision-marks* + (set! (-> s2-1 quad) (-> arg1 quad)) + ) + (set! (-> this prev-status) ((-> this reaction) (the-as control-info this) s5-0 arg0 arg1)) + (when *display-collision-marks* + (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-other-tri pat mode) hilite-color))) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s5-0 best-other-tri)) + (-> s5-0 best-other-tri vertex 1) + (-> s5-0 best-other-tri vertex 2) + t1-0 + ) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 best-other-tri intersect) + s2-1 + (meters 0.00007324219) + (new 'static 'rgba :r #xff :g #xa0 :a #x80) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 best-other-tri intersect) + arg0 + (meters 0.00007324219) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + (if (= (-> this process type) target) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 best-other-tri intersect) + (-> this surface-normal) + (meters 0.5) + (-> *pat-mode-info* (-> this cur-pat mode) hilite-color) + ) + ) + ) + ) + f30-0 + ) + (else + (set! (-> this reaction-flag) (cshape-reaction-flags)) + ((-> this no-reaction) this s5-0 arg0 arg1) + (set! (-> this prev-status) (collide-status)) + (move-by-vector! this s2-0) + (set! (-> arg0 quad) (-> arg1 quad)) + 1.0 + ) + ) + ) + f30-0 + ) + ) + ) + +(defmethod integrate-and-collide! ((this collide-shape) (arg0 vector)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((t9-0 (method-of-object this move-by-vector!)) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-1 quad) vf1) + (t9-0 this v1-1) + ) + (none) + ) + ) + +(defmethod integrate-and-collide! ((this collide-shape-moving) (arg0 vector)) + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (let ((f30-0 1.0) + (s4-0 0) + ) + (while (and (< 0.05 f30-0) (and (< s4-0 (the-as int (-> this max-iteration-count))) + (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) + ) + ) + (let ((f28-0 (step-collision! this arg0 arg0 f30-0 s4-0))) + (update-from-step-size *touching-list* f28-0) + (set! f30-0 (- f30-0 (* f28-0 f30-0))) + ) + (+! s4-0 1) + ) + ) + 0 + (none) + ) + +(defmethod integrate-and-collide! ((this control-info) (arg0 vector)) + (stopwatch-start (the-as stopwatch (&-> *collide-stats* junk 1))) + (when (< 1638400.0 (vector-length arg0)) + (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) + (vector-reset! arg0) + ) + (set! (-> this old-anim-collide-offset-world quad) (-> this anim-collide-offset-world quad)) + (vector-matrix*! + (-> this anim-collide-offset-world) + (-> this anim-collide-offset-local) + (-> this ctrl-orientation) + ) + (vector-! + (-> this anim-collide-offset-delta-world) + (-> this anim-collide-offset-world) + (-> this old-anim-collide-offset-world) + ) + (let ((a1-6 (vector-! (new 'stack-no-clear 'vector) (-> this draw-offset) (-> this anim-collide-offset-world)))) + (vector-seek! (-> this cspace-offset) a1-6 (* 16384.0 (seconds-per-frame))) + ) + (let ((a1-8 (vector+float*! + (new-stack-vector0) + (-> this collide-extra-velocity) + (-> this anim-collide-offset-delta-world) + 60.0 + ) + ) + ) + (when (< 0.0 (vector-length a1-8)) + (let ((s2-0 (-> this max-iteration-count)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> arg0 quad)) + (let ((s4-0 (-> this status))) + (let ((t9-4 (method-of-type collide-shape-moving integrate-and-collide!))) + (t9-4 this a1-8) + ) + (set! (-> this max-iteration-count) s2-0) + (set! (-> arg0 quad) (-> s3-0 quad)) + (logior! (-> this status) s4-0) + ) + ) + ) + ) + (let ((s3-1 (new-stack-vector0))) + (set! (-> s3-1 quad) (-> arg0 quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> arg0 quad)) + (let ((t9-5 (method-of-type collide-shape-moving integrate-and-collide!))) + (t9-5 this s3-1) + ) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 quad) (-> s4-1 quad)) + (let ((s2-1 (new-stack-vector0))) + (set! (-> s2-1 quad) (-> s3-1 quad)) + (let ((v1-32 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> this dynam gravity-normal) s1-0))) + 0.0 + (vector-! v1-32 s1-0 (vector-float*! v1-32 (-> this dynam gravity-normal) f0-6)) + ) + (let* ((f0-7 (vector-length v1-32)) + (f1-4 f0-7) + (f2-0 0.0) + ) + (vector+! + s1-0 + (vector-float*! s1-0 (-> this dynam gravity-normal) f2-0) + (vector-float*! v1-32 v1-32 (/ f0-7 f1-4)) + ) + ) + ) + (let ((v1-33 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> this dynam gravity-normal) s2-1))) + 0.0 + (vector-! v1-33 s2-1 (vector-float*! v1-33 (-> this dynam gravity-normal) f0-10)) + ) + (let* ((f0-11 (vector-length v1-33)) + (f1-6 f0-11) + (f2-1 0.0) + ) + (vector+! + s2-1 + (vector-float*! s2-1 (-> this dynam gravity-normal) f2-1) + (vector-float*! v1-33 v1-33 (/ f0-11 f1-6)) + ) + ) + ) + (vector-normalize! s1-0 1.0) + (vector-normalize! s2-1 1.0) + (let ((f0-14 (vector-dot s1-0 s2-1))) + (cond + ((and (!= (vector-length (-> this target-transv)) 0.0) + (if (logtest? (-> this status) (collide-status touch-wall)) + (< f0-14 0.9999) + (< f0-14 0.95) + ) + ) + (seek! (-> this blocked-factor) 1.0 (* 4.0 (seconds-per-frame))) + (seek! + (-> this blocked-in-air-factor) + (if (= (-> this mod-surface mode) 'air) + 1.0 + 0.0 + ) + (* 4.0 (seconds-per-frame)) + ) + (logior! (-> this status) (collide-status blocked)) + ) + (else + (seek! (-> this blocked-factor) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame))) + ) + ) + ) + ) + ) + (set! (-> arg0 quad) (-> s3-1 quad)) + (if (and (logtest? (-> this status) (collide-status on-surface)) + (and (not (logtest? (-> this status) (collide-status touch-wall blocked))) + (< (vector-length (-> this btransv)) (vector-length s4-1)) + ) + ) + (set! (-> this btransv quad) (-> s4-1 quad)) + ) + ) + ) + (let ((v1-67 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this align-xz-vel) 1.0)) + (f0-32 (vector-length (-> this align-xz-vel))) + ) + (set! (-> this zx-vel-frac) (if (= f0-32 0.0) + 0.0 + (fmax 0.0 (/ (vector-dot (-> this transv) v1-67) f0-32)) + ) + ) + ) + (stopwatch-stop (the-as stopwatch (&-> *collide-stats* junk 1))) + 0 + (none) + ) + +(defmethod try-snap-to-surface ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> this trans quad)) + (vector-normalize-copy! (-> this trans) arg0 arg1) + (vector+! (-> this trans) (-> this trans) gp-0) + (update-transforms this) + (vector-normalize-copy! s2-0 arg0 (- arg2 arg1)) + (let ((v1-4 s2-0)) + (.lvf vf1 (&-> s2-0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-4 quad) vf1) + ) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (let ((f30-0 (step-collision! this s2-0 s2-0 1.0 0))) + (update-from-step-size *touching-list* f30-0) + (cond + ((< f30-0 1.0) + (let ((s1-1 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s1-1 arg0 1.0) + (vector-! s2-1 (-> this trans) gp-0) + (when (< (vector-dot s1-1 s2-1) arg3) + (vector-normalize-copy! s2-1 arg0 arg3) + (vector+! s2-1 s2-1 gp-0) + (move-to-point! this s2-1) + ) + ) + #t + ) + (else + (move-to-point! this gp-0) + #f + ) + ) + ) + ) + ) + ) + ) + +(defmethod fill-and-try-snap-to-surface ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) + (vector-normalize-copy! (-> arg4 start-pos) arg0 arg1) + (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> this trans)) + (vector-normalize-copy! (-> arg4 move-dist) arg0 (- arg2 arg1)) + (fill-using-line-sphere *collide-cache* arg4) + (try-snap-to-surface this arg0 arg1 arg2 arg3) + ) + +(defmethod move-to-ground-point ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) + (move-to-point! this arg0) + (set! (-> arg1 y) 0.0) + (set! (-> this ground-touch-point quad) (-> arg0 quad)) + (set! (-> this poly-normal quad) (-> arg2 quad)) + (set! (-> this surface-normal quad) (-> arg2 quad)) + (set! (-> this local-normal quad) (-> arg2 quad)) + (set! (-> this ground-poly-normal quad) (-> arg2 quad)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + (set! (-> this ground-impact-vel) (- (vector-dot arg1 (-> this dynam gravity-normal)))) + 0 + (none) + ) + +(defmethod integrate-no-collide! ((this collide-shape-moving) (arg0 vector)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (let ((t9-1 (method-of-object this move-by-vector!)) + (a1-5 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-2 (seconds-per-frame))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a1-5 quad) vf1) + (t9-1 this a1-5) + ) + 0 + (none) + ) + ) + +(defmethod integrate-for-enemy-no-mtg ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) + (integrate-no-collide! this arg0) + (let ((s5-1 (find-overlapping-shapes this arg1))) + (if s5-1 + (move-to-point! this (-> this trans-old)) + ) + s5-1 + ) + ) + +(defmethod find-ground ((this collide-shape-moving) + (arg0 collide-query) + (arg1 collide-spec) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 process) + ) + (set! (-> this gspot-pos quad) (-> this trans quad)) + (set! (-> arg0 start-pos quad) (-> this trans quad)) + (vector-reset! (-> arg0 move-dist)) + (let ((f0-0 (-> this transv y))) + (if (< f0-0 0.0) + (set! arg2 (- arg2 (fmax -40960.0 (* f0-0 (seconds-per-frame))))) + ) + ) + (+! (-> arg0 start-pos y) arg2) + (set! (-> arg0 move-dist y) (- (+ arg2 arg3))) + (let ((v1-7 arg0)) + (set! (-> v1-7 radius) arg4) + (set! (-> v1-7 collide-with) arg1) + (set! (-> v1-7 ignore-process0) (-> this process)) + (set! (-> v1-7 ignore-process1) arg5) + (set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> this pat-ignore-mask))) + (set! (-> v1-7 action-mask) (collide-action solid)) + ) + (let ((f0-10 (fill-and-probe-using-line-sphere *collide-cache* arg0))) + (cond + ((>= f0-10 0.0) + (let ((v1-11 (vector+float*! (new 'stack-no-clear 'vector) (-> arg0 start-pos) (-> arg0 move-dist) f0-10))) + (set! (-> this gspot-pos y) (- (-> v1-11 y) arg4)) + (vector-! (-> this gspot-normal) v1-11 (-> arg0 best-other-tri intersect)) + ) + (vector-normalize! (-> this gspot-normal) 1.0) + #t + ) + (else + (set! (-> this gspot-pos y) -40959590.0) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + #f + ) + ) + ) + ) + +(defmethod above-ground? ((this collide-shape) + (arg0 collide-query) + (arg1 vector) + (arg2 collide-spec) + (arg3 float) + (arg4 float) + (arg5 float) + ) + (set! (-> arg0 start-pos quad) (-> arg1 quad)) + (+! (-> arg0 start-pos y) arg3) + (vector-reset! (-> arg0 move-dist)) + (set! (-> arg0 move-dist y) (- (+ arg3 arg4))) + (let ((v1-2 arg0)) + (set! (-> v1-2 radius) arg5) + (set! (-> v1-2 collide-with) arg2) + (set! (-> v1-2 ignore-process0) (-> this process)) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) (-> this pat-ignore-mask)) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) + ) + +(defmethod move-above-ground ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) + (when *debug-segment* + (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-7 'collide) + (s2-0 *profile-collide-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s1-0 (-> s3-0 data (-> s3-0 count)))) + (let ((s0-0 (-> s3-0 base-time))) + (set! (-> s1-0 name) v1-7) + (set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0)))) + ) + (set! (-> s1-0 depth) (the-as uint (-> s3-0 depth))) + (set! (-> s1-0 color) s2-0) + (set! (-> s3-0 segment (-> s3-0 depth)) s1-0) + ) + (set! (-> s3-0 count) (min 1023 (+ (-> s3-0 count) 1))) + (+! (-> s3-0 depth) 1) + (set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth))) + ) + ) + 0 + ) + (set! (-> arg1 on-ground?) #f) + (set! (-> arg1 do-move?) #t) + (set! (-> arg1 old-gspot-pos quad) (-> this gspot-pos quad)) + (set! (-> arg1 old-gspot-normal quad) (-> this gspot-normal quad)) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (vector-v+! (-> this trans) (-> this trans) arg0) + (set! (-> arg1 new-pos quad) (-> this trans quad)) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (cond + ((find-ground this s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) + (when (>= (-> this gspot-pos y) (-> arg1 new-pos y)) + (set! (-> arg1 on-ground?) #t) + (set! (-> arg1 pat) (-> s3-1 best-other-tri pat)) + (set! (-> arg1 new-pos y) (-> s3-1 best-other-tri intersect y)) + (set! (-> this ground-impact-vel) (- (vector-dot arg0 (-> this dynam gravity-normal)))) + (set! (-> arg0 y) 0.0) + ) + ) + (else + (if (-> arg1 hover-if-no-ground?) + (set! (-> arg1 new-pos y) (-> this trans-old y)) + ) + ) + ) + ) + (set! (-> this trans quad) (-> this trans-old quad)) + (move-to-point! this (-> arg1 new-pos)) + (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) + (collide-spec hit-by-player-list hit-by-others-list player-list) + ) + (-> this root-prim prim-core collide-with) + ) + (when (find-overlapping-shapes this (-> arg1 overlaps-params)) + (when (-> arg1 dont-move-if-overlaps?) + (set! (-> arg1 do-move?) #f) + (move-to-point! this (-> this trans-old)) + (set! (-> this gspot-pos quad) (-> arg1 old-gspot-pos quad)) + (set! (-> this gspot-normal quad) (-> arg1 old-gspot-normal quad)) + ) + ) + ) + (when (-> arg1 do-move?) + (cond + ((-> arg1 on-ground?) + (let ((a1-8 (-> this gspot-pos)) + (a0-31 (-> this gspot-normal)) + (v1-59 (-> arg1 pat)) + ) + (set! (-> this ground-touch-point quad) (-> a1-8 quad)) + (set! (-> this poly-normal quad) (-> a0-31 quad)) + (set! (-> this surface-normal quad) (-> a0-31 quad)) + (set! (-> this local-normal quad) (-> a0-31 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-31 quad)) + (set! (-> this poly-pat) v1-59) + (set! (-> this cur-pat) v1-59) + (set! (-> this ground-pat) v1-59) + ) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + ) + (else + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-69 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-69 quad)) + (set! (-> this surface-normal quad) (-> v1-69 quad)) + (set! (-> this poly-normal quad) (-> v1-69 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + ) + ) + ) + (when *debug-segment* + (let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-83 (+ (-> gp-1 depth) -1)) + (s5-1 (-> gp-1 segment v1-83)) + (s4-1 (-> gp-1 base-time)) + ) + (when (>= v1-83 0) + (set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-1)))) + (+! (-> gp-1 depth) -1) + ) + ) + ) + ) + 0 + ) + 0 + (none) + ) + +(defmethod move-to-ground ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) + (local-vars (sv-576 profile-segment) (sv-592 int)) + (when *debug-segment* + (let ((s1-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-7 'collide) + (s0-0 *profile-collide-color*) + ) + (when (and *dproc* *debug-segment*) + (set! sv-576 (-> s1-0 data (-> s1-0 count))) + (set! sv-592 (-> s1-0 base-time)) + (set! (-> sv-576 name) v1-7) + (set! (-> sv-576 start-time) + (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint sv-592))) + ) + (set! (-> sv-576 depth) (the-as uint (-> s1-0 depth))) + (set! (-> sv-576 color) s0-0) + (set! (-> s1-0 segment (-> s1-0 depth)) sv-576) + (set! (-> s1-0 count) (min 1023 (+ (-> s1-0 count) 1))) + (+! (-> s1-0 depth) 1) + (set! (-> s1-0 max-depth) (max (-> s1-0 max-depth) (-> s1-0 depth))) + ) + ) + 0 + ) + (let ((s1-1 (new 'stack-no-clear 'collide-query))) + (cond + ((find-ground this s1-1 arg3 arg0 arg1 1024.0 (the-as process #f)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> this trans quad)) + (set! (-> a1-4 y) (-> s1-1 best-other-tri intersect y)) + (move-to-point! this a1-4) + ) + (let ((a1-5 (-> s1-1 best-other-tri intersect)) + (a0-21 (-> s1-1 best-other-tri normal)) + (v1-25 (-> s1-1 best-other-tri pat)) + ) + (set! (-> this ground-touch-point quad) (-> a1-5 quad)) + (set! (-> this poly-normal quad) (-> a0-21 quad)) + (set! (-> this surface-normal quad) (-> a0-21 quad)) + (set! (-> this local-normal quad) (-> a0-21 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-21 quad)) + (set! (-> this poly-pat) v1-25) + (set! (-> this cur-pat) v1-25) + (set! (-> this ground-pat) v1-25) + ) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + #t + ) + (else + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-36 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-36 quad)) + (set! (-> this surface-normal quad) (-> v1-36 quad)) + (set! (-> this poly-normal quad) (-> v1-36 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (if arg2 + (format 0 "WARNING: move-to-ground: failed to locate ground for ~S!~%" (-> this process name)) + ) + ) + ) + ) + (when *debug-segment* + (let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-52 (+ (-> gp-1 depth) -1)) + (s5-1 (-> gp-1 segment v1-52)) + (s4-1 (-> gp-1 base-time)) + ) + (when (>= v1-52 0) + (set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-1)))) + (+! (-> gp-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (none) + ) + +(defmethod compute-acc-due-to-gravity ((this collide-shape-moving) (arg0 vector) (arg1 float)) + (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this dynam gravity))) + (a2-1 (-> this local-normal)) + (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) + ) + (vector--float*! arg0 s4-0 a2-2 (cond + ((logtest? (-> this status) (collide-status on-surface)) + (empty) + arg1 + ) + (else + 0.0 + ) + ) + ) + ) + arg0 + ) + +(defmethod fill-cache-integrate-and-collide ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((a0-1 v1-0)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-1 quad) vf1) + ) + (fill-cache-for-shape this (+ (vector-length v1-0) arg2) arg1) + ) + (integrate-and-collide! this arg0) + (none) + ) + ) + +(defmethod fill-cache-for-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) + (cond + ((build-bounding-box-for-shape this (-> arg1 bbox) arg0 (-> arg1 collide-with)) + (fill-using-bounding-box *collide-cache* arg1) + (if (and *display-collide-cache* (or (= (-> this process type) target) (= (-> this process) *debug-actor*))) + (debug-draw *collide-cache*) + ) + ) + (else + (reset *collide-cache*) + ) + ) + 0 + (none) + ) + +(defmethod build-bounding-box-for-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) + (rlet ((vf0 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + (let ((t0-0 (new 'static 'vector :x 4.096)) + (v1-0 (-> this root-prim)) + ) + (.mov vf31 arg1) + (let ((a0-2 (logand (-> v1-0 prim-core collide-with) arg2)) + (a2-1 (-> v1-0 prim-core prim-type)) + ) + (b! (zero? a0-2) cfg-9 :delay (.lvf vf28 (&-> t0-0 quad))) + (.add.x.vf vf31 vf31 vf28 :mask #b1) + (let ((a0-3 (-> v1-0 specific 0))) + (b! (zero? a2-1) cfg-3 :delay (.lvf vf24 (&-> v1-0 prim-core world-sphere quad))) + (.add.w.vf vf25 vf31 vf24 :mask #b1) + (.add.x.vf vf30 vf24 vf25 :mask #b111) + (b! #t cfg-10 :delay (.sub.x.vf vf29 vf24 vf25 :mask #b111)) + (label cfg-3) + ;; og:preserve-this + (b! (zero? a0-3) cfg-9 :delay (set! v1-0 (&+ v1-0 80))) + (+! a0-3 -1) + (let ((a2-3 (logand (-> v1-0 prim-core collide-with) arg2))) + (.lvf vf24 (&-> v1-0 prim-core world-sphere quad)) + (b! (zero? a2-3) cfg-3 :delay (.add.w.vf vf25 vf31 vf24 :mask #b1)) + ) + (.add.x.vf vf30 vf24 vf25 :mask #b111) + (.sub.x.vf vf29 vf24 vf25 :mask #b111) + (label cfg-6) + ;; og:preserve-this + (b! (zero? a0-3) cfg-10 :delay (set! v1-0 (&+ v1-0 80))) + (+! a0-3 -1) + ) + ) + (let ((a2-5 (logand (-> v1-0 prim-core collide-with) arg2))) + (.lvf vf24 (&-> v1-0 prim-core world-sphere quad)) + (b! (zero? a2-5) cfg-6 :delay (.add.w.vf vf25 vf31 vf24 :mask #b1)) + ) + ) + (.add.x.vf vf27 vf24 vf25 :mask #b111) + (.sub.x.vf vf26 vf24 vf25 :mask #b111) + (.min.vf vf29 vf29 vf26) + (.max.vf vf30 vf30 vf27) + (b! #t cfg-6 :delay (nop!)) + (label cfg-9) + (let ((v0-0 #f)) + (b! #t cfg-11 :delay (nop!)) + (label cfg-10) + (.mov.vf vf29 vf0 :mask #b1000) + (.mov.vf vf30 vf0 :mask #b1000) + (.svf (&-> arg0 min quad) vf29) + (.svf (&-> arg0 max quad) vf30) + (set! v0-0 #t) + (label cfg-11) + v0-0 + ) + ) + ) + +(defmethod find-prim-by-id ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (if (= (-> v1-0 prim-id) arg0) + (return v1-0) + ) + (&+! v1-0 80) + ) + ) + (the-as collide-shape-prim #f) + ) + +(defmethod find-prim-by-id-logtest ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (if (logtest? (-> v1-0 prim-id) arg0) + (return v1-0) + ) + (&+! v1-0 80) + ) + ) + (the-as collide-shape-prim #f) + ) + +(defun-debug collide-shape-draw-debug-marks () + (add-debug-sphere + (or *display-collision-marks* *display-target-marks*) + (bucket-id debug) + (target-pos 0) + (meters 0.2) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + (when *display-collision-marks* + (let ((v1-4 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((gp-1 (-> v1-4 next0))) + (while (!= v1-4 (-> *collide-player-list* alive-list-end)) + (let ((a0-4 (the-as collide-shape (-> (the-as connection v1-4) param1)))) + (if (or (not *debug-actor*) (= (-> a0-4 process) *target*) (= (-> a0-4 process) *debug-actor*)) + (debug-draw a0-4) + ) + ) + (set! v1-4 gp-1) + *collide-player-list* + (set! gp-1 (-> gp-1 next0)) + ) + ) + ) + (let ((v1-15 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((gp-2 (-> v1-15 next0))) + (while (!= v1-15 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((a0-11 (the-as collide-shape (-> (the-as connection v1-15) param1)))) + (if (or (not *debug-actor*) (= (-> a0-11 process) *target*) (= (-> a0-11 process) *debug-actor*)) + (debug-draw a0-11) + ) + ) + (set! v1-15 gp-2) + *collide-hit-by-player-list* + (set! gp-2 (-> gp-2 next0)) + ) + ) + ) + (let ((v1-26 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((gp-3 (-> v1-26 next0))) + (while (!= v1-26 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((a0-18 (the-as collide-shape (-> (the-as connection v1-26) param1)))) + (if (or (not *debug-actor*) (= (-> a0-18 process) *target*) (= (-> a0-18 process) *debug-actor*)) + (debug-draw a0-18) + ) + ) + (set! v1-26 gp-3) + *collide-hit-by-others-list* + (set! gp-3 (-> gp-3 next0)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this collide-shape)) + (if (sphere-in-view-frustum? (the-as sphere (-> this root-prim prim-core))) + (debug-draw (-> this root-prim)) + ) + 0 + (none) + ) + +(define *col-timer* (new 'global 'stopwatch)) + +(define *frame-timer* (new 'global 'stopwatch)) + +(define *col-timer-enable* #t) + +(defun debug-report-col-stats () + (when *col-timer-enable* + (stopwatch-end *frame-timer*) + (format *stdcon* "col stats:~%") + (format *stdcon* " col ~F ms~%" (* 1000.0 (stopwatch-elapsed-seconds *col-timer*))) + (format *stdcon* " frame ~F ms~%" (* 1000.0 (stopwatch-elapsed-seconds *frame-timer*))) + (stopwatch-init *col-timer*) + (stopwatch-init *frame-timer*) + (stopwatch-begin *frame-timer*) + ) + ) + +(defmethod update-transforms ((this collide-shape)) + (local-vars (v1-8 float) (a1-5 float) (a1-7 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> this root-prim)) + (v1-1 (-> this process node-list)) + ) + (cond + ((nonzero? v1-1) + (countdown (a0-1 (-> this total-prims)) + (let ((a1-0 (-> s5-0 transform-index))) + (cond + ((>= a1-0 0) + (let ((a1-4 (-> v1-1 data a1-0 bone transform))) + (.lvf vf5 (&-> a1-4 trans quad)) + (.lvf vf1 (&-> s5-0 local-sphere quad)) + (.lvf vf2 (&-> a1-4 rvec quad)) + (.mul.w.vf acc vf5 vf0) + (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b11) + (.lvf vf3 (&-> a1-4 uvec quad)) + (.add.mul.x.vf acc vf2 vf1 acc) + (.lvf vf4 (&-> a1-4 fvec quad)) + ) + (.add.mul.y.vf acc vf3 vf1 acc) + (.add.mul.z.vf vf1 vf4 vf1 acc :mask #b111) + (.mul.vf vf1 vf1 Q :mask #b111) + (.svf (&-> s5-0 prim-core world-sphere quad) vf1) + (.mov a1-5 vf1) + ) + (else + (when (= a1-0 -2) + (.lvf vf1 (&-> s5-0 local-sphere quad)) + (.lvf vf2 (&-> this trans quad)) + (.add.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> s5-0 prim-core world-sphere quad) vf1) + (.mov a1-7 vf1) + ) + ) + ) + ) + (&+! s5-0 80) + ) + ) + (else + (countdown (s4-0 (-> this total-prims)) + (case (-> s5-0 transform-index) + ((-3) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s5-0 local-sphere) (-> this quat)) + (vector+! (the-as vector (-> s5-0 prim-core)) s3-0 (-> this trans)) + ) + (set! (-> s5-0 prim-core world-sphere w) (-> s5-0 local-sphere w)) + ) + ((-2) + (.lvf vf1 (&-> s5-0 local-sphere quad)) + (.lvf vf2 (&-> this trans quad)) + (.add.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> s5-0 prim-core world-sphere quad) vf1) + (.mov v1-8 vf1) + ) + ) + (&+! s5-0 80) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod move-by-vector! ((this collide-shape) (arg0 vector)) + (vector+! (-> this trans) (-> this trans) arg0) + (let ((v1-1 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (vector+! (the-as vector (-> v1-1 prim-core)) (the-as vector (-> v1-1 prim-core)) arg0) + (set! (-> v1-1 prim-core world-sphere w) (-> v1-1 local-sphere w)) + (&+! v1-1 80) + ) + ) + 0 + (none) + ) + +(defmethod move-to-point! ((this collide-shape) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (-> this trans)) + (set! (-> this trans quad) (-> arg0 quad)) + (let ((a1-2 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (vector+! (the-as vector (-> a1-2 prim-core)) (the-as vector (-> a1-2 prim-core)) v1-0) + (set! (-> a1-2 prim-core world-sphere w) (-> a1-2 local-sphere w)) + (&+! a1-2 80) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-collide-with! ((this collide-shape) (arg0 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (set! (-> v1-0 prim-core collide-with) arg0) + (nop!) + (nop!) + (&+! v1-0 80) + ) + ) + 0 + (none) + ) + +(defmethod set-collide-as! ((this collide-shape) (arg0 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (set! (-> v1-0 prim-core collide-as) arg0) + (nop!) + (nop!) + (&+! v1-0 80) + ) + ) + 0 + (none) + ) + +(defmethod iterate-prims ((this collide-shape) (arg0 (function collide-shape-prim none))) + (let ((s5-0 (-> this root-prim))) + (countdown (s4-0 (-> this total-prims)) + (arg0 s5-0) + (&+! s5-0 80) + ) + ) + 0 + (none) + ) + +(defmethod find-collision-meshes ((this collide-shape)) + (let ((s5-0 (-> this root-prim)) + (s4-0 0) + ) + (let ((v1-0 (-> s5-0 prim-core prim-type))) + (cond + ((= v1-0 1) + (set! s4-0 1) + ) + ((zero? v1-0) + (set! s4-0 (the-as int (-> s5-0 specific 1))) + (&+! s5-0 80) + ) + ) + ) + (when (nonzero? s4-0) + (let ((s3-0 0)) + (let ((v1-7 (-> this process draw)) + (s2-0 (the-as (array collide-mesh) #f)) + ) + (when (and (nonzero? v1-7) (-> v1-7 jgeo)) + (set! s2-0 (res-lump-struct (-> v1-7 jgeo extra) 'collide-mesh-group (array collide-mesh))) + (when s2-0 + (countdown (s1-0 s4-0) + (when (= (-> s5-0 prim-core prim-type) 1) + (let ((s0-0 (-> (the-as collide-shape-prim-mesh s5-0) mesh-id))) + (cond + ((and (>= s0-0 0) (< s0-0 (length s2-0))) + (set! (-> (the-as collide-shape-prim-mesh s5-0) mesh) (-> s2-0 s0-0)) + ) + (else + (set! (-> (the-as collide-shape-prim-mesh s5-0) mesh) #f) + (+! s3-0 1) + ) + ) + ) + ) + (set! s5-0 (&+ (the-as collide-shape-prim-mesh s5-0) 80)) + ) + ) + ) + (when (not s2-0) + (while (nonzero? s4-0) + (+! s4-0 -1) + (when (= (-> (the-as collide-shape-prim-mesh s5-0) prim-core prim-type) 1) + (set! (-> (the-as collide-shape-prim-mesh s5-0) mesh) #f) + (+! s3-0 1) + ) + (set! s5-0 (&+ (the-as collide-shape-prim-mesh s5-0) 80)) + ) + ) + ) + (if (nonzero? s3-0) + (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s3-0 (-> this process name)) + ) + ) + ) + ) + (update-transforms this) + 0 + (none) + ) + +(defmethod debug-draw ((this collide-shape-prim)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this collide-shape-prim-sphere)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (cond + ((and (zero? (-> this prim-core collide-as)) (zero? (-> this prim-core collide-with))) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) + ) + ((logtest? (-> this prim-core action) (collide-action solid)) + (new 'static 'rgba :r #xff :g #xff :a #x40) + ) + (else + (new 'static 'rgba :r #xff :g #x80 :a #x40) + ) + ) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this collide-shape-prim-mesh)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (new 'static 'rgba :b #xff :a #x40) + ) + 0 + (none) + ) + +(defmethod debug-draw ((this collide-shape-prim-group)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (new 'static 'rgba :g #xff :a #x10) + ) + (countdown (s5-0 (-> this num-children)) + (debug-draw (-> this child s5-0)) + ) + 0 + (none) + ) + +(defmethod do-push-aways ((this collide-shape)) + (local-vars (at-0 int) (v1-55 float) (a2-5 float) (a2-12 float)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) + (set! (-> gp-0 cspec) (collide-spec)) + (let ((s4-0 (-> this root-prim prim-core collide-with))) + (set! *actor-list-length* 0) + (if (logtest? s4-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> this root-prim prim-core)) *actor-list* 256) + ) + ) + (when (logtest? s4-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s4-0 (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-2 (-> this root-prim prim-core)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-2 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this root-prim prim-core world-sphere w))) + ) + (when (< f0-0 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-14 (-> (the-as collide-shape-moving a0-6) root-prim)) + ) + (when (logtest? s4-0 (-> a1-14 prim-core collide-as)) + (let ((a1-15 (-> a1-14 prim-core))) + (let ((a2-11 a1-15) + (a3-4 (-> this root-prim prim-core)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-4 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-15 world-sphere w) (-> this root-prim prim-core world-sphere w))) + ) + (when (< f0-1 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let* ((s1-0 (-> *actor-list* s3-0)) + (s2-0 (-> s1-0 root-prim)) + ) + (when (logtest? s4-0 (-> s2-0 prim-core collide-as)) + (when (!= (-> this process) (-> s1-0 process)) + (when (and (should-push-away this s1-0 (-> gp-0 cquery)) (>= -81.92 (-> gp-0 cquery best-dist))) + (set! (-> gp-0 cquery collide-with) (-> s1-0 root-prim prim-core collide-with)) + (set! (-> gp-0 cquery ignore-process0) (-> s1-0 process)) + (set! (-> gp-0 cquery ignore-process1) #f) + (set! (-> gp-0 cquery ignore-pat) (-> s1-0 pat-ignore-mask)) + (set! (-> gp-0 cquery action-mask) (collide-action solid)) + (-> gp-0 cquery) + (fill-cache-for-shape s1-0 8192.0 (-> gp-0 cquery)) + (let ((s4-1 3)) + (until (or (<= s4-1 0) (not (should-push-away this s1-0 (-> gp-0 cquery)))) + (set! (-> gp-0 vec33 quad) (-> s1-0 trans quad)) + (let* ((f0-4 (+ 2867.2 (-> gp-0 vec33 y))) + (f2-2 (+ 5734.4 f0-4)) + (f1-11 (-> gp-0 cquery best-other-tri intersect y)) + ) + (cond + ((< f1-11 f0-4) + (set! f1-11 f0-4) + ) + ((< f2-2 f1-11) + (set! f1-11 f2-2) + ) + ) + (set! (-> gp-0 vec33 y) f1-11) + ) + (.lvf vf4 (&-> (-> gp-0 vec33) quad)) + (.lvf vf3 (&-> (-> gp-0 cquery) best-other-tri intersect quad)) + (.lvf vf5 (&-> (-> gp-0 cquery) best-other-tri normal quad)) + (.sub.vf vf2 vf4 vf3) + (.mul.vf vf1 vf5 vf2) + (.add.x.vf vf1 vf1 vf1 :mask #b10) + (.add.z.vf vf1 vf1 vf1 :mask #b10) + (.mov v1-55 vf1) + (b! (< (the-as int v1-55) 0) cfg-35 :likely-delay (.sub.vf vf2 vf0 vf2)) + (label cfg-35) + (.svf (&-> (-> gp-0 push-vel) quad) vf2) + (vector-normalize! (-> gp-0 push-vel) 1.0) + (vector-float*! (-> gp-0 push-vel) (-> gp-0 push-vel) (- (-> gp-0 cquery best-dist))) + (let ((v1-59 (-> gp-0 push-vel))) + (.lvf vf1 (&-> (-> gp-0 push-vel) quad)) + (let ((f0-7 (-> pp clock frames-per-second))) + (.mov at-0 f0-7) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-59 quad) vf1) + ) + (let ((s0-0 (-> (the-as collide-shape-moving s1-0) status))) + (integrate-and-collide! (the-as collide-shape-moving s1-0) (-> gp-0 push-vel)) + (set! (-> (the-as collide-shape-moving s1-0) status) s0-0) + ) + (+! s4-1 -1) + ) + (if (zero? s4-1) + (logior! (-> gp-0 cspec) (-> s2-0 prim-core collide-as)) + ) + ) + (set! s4-0 (-> this root-prim prim-core collide-with)) + ) + ) + ) + ) + ) + ) + (-> gp-0 cspec) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod find-overlapping-shapes ((this collide-shape) (arg0 overlaps-others-params)) + (local-vars (a0-10 float) (a0-14 uint) (a2-5 float) (a2-12 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as object #f))) + (let* ((s3-0 (-> this root-prim)) + (s2-0 (the-as uint (logand (-> s3-0 prim-core collide-with) (-> arg0 collide-with-filter)))) + ) + (set! (-> arg0 filtered-root-collide-with) (the-as collide-spec s2-0)) + (set! *actor-list-length* 0) + (b! (not (logtest? (the-as collide-spec s2-0) 512)) cfg-2 :delay (empty-form)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> s3-0 prim-core)) *actor-list* 256) + ) + (label cfg-2) + (b! (not (logtest? (the-as collide-spec s2-0) 1024)) cfg-11 :delay (empty-form)) + (let ((a0-3 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-12 (-> a0-3 next0))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-4) + (let ((a0-4 (-> (the-as connection a0-3) param1))) + (let ((a1-2 (-> (the-as collide-shape a0-4) root-prim))) + (b! (not (logtest? (the-as collide-spec s2-0) (-> a1-2 prim-core collide-as))) cfg-8 :delay (empty-form)) + (let ((a1-3 (-> a1-2 prim-core))) + (let ((a2-4 a1-3) + (a3-1 (-> s3-0 prim-core)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-3 world-sphere w) (-> s3-0 prim-core world-sphere w))) + ) + (b! (>= f0-0 (* f1-1 f1-1)) cfg-8 :delay #f) + ) + ) + ) + (b! (>= *actor-list-length* 256) cfg-8 :delay #f) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-4)) + ) + (set! *actor-list-length* (+ *actor-list-length* 1)) + (label cfg-8) + (set! a0-3 v1-12) + *collide-player-list* + (set! v1-12 (-> v1-12 next0)) + ) + (label cfg-9) + (b! (!= a0-3 (-> *collide-player-list* alive-list-end)) cfg-4 :delay (nop!)) + ) + (label cfg-11) + (b! (not (logtest? (the-as collide-spec s2-0) 256)) cfg-20 :delay (empty-form)) + (let ((a0-6 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-20 (-> a0-6 next0))) + (b! #t cfg-18 :delay (nop!)) + (label cfg-13) + (let ((a0-7 (-> (the-as connection a0-6) param1))) + (let ((a1-14 (-> (the-as collide-shape-moving a0-7) root-prim))) + (b! (not (logtest? (the-as collide-spec s2-0) (-> a1-14 prim-core collide-as))) cfg-17 :delay (empty-form)) + (let ((a1-15 (-> a1-14 prim-core))) + (let ((a2-11 a1-15) + (a3-2 (-> s3-0 prim-core)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-15 world-sphere w) (-> s3-0 prim-core world-sphere w))) + ) + (b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f) + ) + ) + ) + (b! (>= *actor-list-length* 256) cfg-17 :delay #f) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-7)) + ) + (set! *actor-list-length* (+ *actor-list-length* 1)) + (label cfg-17) + (set! a0-6 v1-20) + *collide-hit-by-player-list* + (set! v1-20 (-> v1-20 next0)) + ) + (label cfg-18) + (b! (!= a0-6 (-> *collide-hit-by-player-list* alive-list-end)) cfg-13 :delay (nop!)) + ) + (label cfg-20) + (let ((s1-0 0)) + (b! #t cfg-30 :delay (nop!)) + (label cfg-21) + (let ((s0-0 (-> *actor-list* s1-0))) + (let ((a2-15 (-> s0-0 root-prim))) + (b! (not (logtest? (the-as collide-spec s2-0) (-> a2-15 prim-core collide-as))) cfg-29 :delay (empty-form)) + (.lvf vf1 (&-> s3-0 prim-core world-sphere quad)) + (.lvf vf2 (&-> a2-15 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-2 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (let ((v1-28 (-> this process))) + (.mov a0-10 vf3) + (let ((a1-26 (-> s0-0 process))) + (b! (< f0-2 a0-10) cfg-28) + (b! (= v1-28 a1-26) cfg-28 :delay (nop!)) + ) + ) + ) + (let ((v1-30 (overlaps-others-test s3-0 arg0 a2-15))) + (.lvf vf1 (&-> s3-0 prim-core world-sphere quad)) + (b! (= v1-30 #f) cfg-28 :delay (set! s2-0 (the-as uint (-> arg0 filtered-root-collide-with)))) + ) + ) + (let ((a0-12 (-> (the-as (pointer uint64) arg0) 0)) + (v1-31 (-> this penetrate-using)) + ) + (b! (not (logtest? a0-12 4)) cfg-27 :delay (set! a0-14 (the-as uint (-> arg0 tlist)))) + (b! (logtest? (-> s0-0 penetrated-by) v1-31) cfg-28 :delay (nop!)) + ) + ) + (label cfg-27) + (b! (= a0-14 #f) cfg-32 :delay (set! gp-0 0)) + (label cfg-28) + 0 + (label cfg-29) + (+! s1-0 1) + (label cfg-30) + (b! (< s1-0 *actor-list-length*) cfg-21) + ) + ) + (label cfg-32) + (b! (= (the-as uint gp-0) #f) cfg-34 :delay (nop!)) + (set! gp-0 #t) + (label cfg-34) + (the-as symbol gp-0) + ) + ) + ) + +(defmethod overlaps-others-test ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") + #f + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod overlaps-others-test ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (a0-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as collide-shape-prim this)) + (v1-0 (-> arg1 prim-core collide-as)) + (s2-0 (the-as object #f)) + ) + (let ((a1-1 (-> arg0 collide-with-filter))) + (nop!) + (let ((s3-0 (-> this num-children)) + (v1-1 (logand v1-0 a1-1)) + ) + (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) + (nop!) + (set! (-> arg0 filtered-other-collide-as) v1-1) + (label cfg-1) + ;; og:preserve-this + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (&+ s4-0 80))) + (+! s3-0 -1) + (let ((a0-2 (logand (-> s4-0 prim-core collide-with) v1-1))) + (.lvf vf2 (&-> s4-0 prim-core world-sphere quad)) + (b! (zero? a0-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) + ) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + (b! (< f0-0 a0-3) cfg-1) + ) + (let ((a0-5 (overlaps-others-test s4-0 arg0 arg1))) + (set! v1-1 (-> arg0 filtered-other-collide-as)) + (b! (= a0-5 #f) cfg-1 :delay (.lvf vf1 (&-> arg1 prim-core world-sphere quad))) + ) + ) + ) + (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) + (label cfg-6) + (b! (= (the-as uint s2-0) #f) cfg-8 :delay (nop!)) + (set! s2-0 #t) + (label cfg-8) + (the-as symbol s2-0) + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod overlaps-others-group ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) + (local-vars (a0-4 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as collide-shape-prim arg1)) + (v1-0 (-> this prim-core collide-with)) + ) + (nop!) + (let ((a0-1 (-> arg0 collide-with-filter))) + (nop!) + (let ((s3-0 (-> arg1 num-children)) + (v1-1 (logand v1-0 a0-1)) + ) + (.lvf vf2 (&-> this prim-core world-sphere quad)) + (let ((s2-0 (the-as object #f))) + (set! (-> arg0 filtered-child-collide-with) v1-1) + (label cfg-1) + ;; og:preserve-this + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (&+ s4-0 80))) + (+! s3-0 -1) + (let ((a0-3 (logand v1-1 (-> s4-0 prim-core collide-as)))) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (b! (zero? a0-3) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) + ) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-4 vf3) + (b! (< f0-0 a0-4) cfg-1) + ) + (let ((a0-6 (overlaps-others-test this arg0 s4-0))) + (set! v1-1 (-> arg0 filtered-child-collide-with)) + (b! (= a0-6 #f) cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) + ) + (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) + (label cfg-6) + (b! (= (the-as uint s2-0) #f) cfg-8 :delay (nop!)) + (set! s2-0 #t) + (label cfg-8) + (the-as symbol s2-0) + ) + ) + ) + ) + ) + ) + +(defmethod overlaps-others-test ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (v1-11 uint) (s4-0 uint)) + (let ((v1-0 (-> arg1 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) + (b! #t cfg-17 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-4 :delay (nop!)) + (b! #t cfg-11 :delay (logand s4-0 2)) + (label cfg-4) + (b! (nonzero? 0) cfg-11 :delay (nop!)) + (let ((s2-0 (-> (the-as collide-shape-prim-mesh arg1) mesh))) + (b! (not s2-0) cfg-10 :delay (empty-form)) + (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* (the-as collide-shape-prim-mesh arg1)))) + (when v1-5 + (when (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> this prim-core))) + (b! #t cfg-11 :delay (nop!)) + (the-as none 0) + ) + ) + ) + ) + (label cfg-10) + (set! v0-1 #f) + (b! #t cfg-17 :delay (nop!)) + (label cfg-11) + (let ((a0-8 (-> arg0 tlist))) + (b! (= a0-8 #f) cfg-13 :delay (nop!)) + (add-touching-prims a0-8 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + ) + (label cfg-13) + (b! (not (logtest? s4-0 1)) cfg-16 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) + (let ((a0-9 (-> arg1 prim-core action))) + (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-9) cfg-16 :delay (nop!)) + ) + (set! v0-1 #f) + (b! #t cfg-17 :delay (nop!)) + (label cfg-16) + (set! v0-1 #t) + (label cfg-17) + v0-1 + ) + ) + ) + +(defmethod overlaps-others-test ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (v1-3 uint) (v1-11 uint) (s4-0 uint)) + (let ((v1-0 (-> arg1 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) + (b! #t cfg-18 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-10 :delay (set! v1-3 (logand s4-0 2))) + (b! (nonzero? v1-3) cfg-12 :delay (nop!)) + (let ((s2-0 (-> this mesh))) + (b! (not s2-0) cfg-9 :delay (empty-form)) + (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* this))) + (b! (not v1-5) cfg-9 :delay (empty-form)) + (b! + (not (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> arg1 prim-core)))) + cfg-9 + :delay (empty-form) + ) + ) + ) + (b! #t cfg-12 :delay (nop!)) + (the-as none 0) + (label cfg-9) + (set! v0-1 #f) + (b! #t cfg-18 :delay (nop!)) + (label cfg-10) + (b! (nonzero? v1-3) cfg-12 :delay (nop!)) + (format + 0 + "ERROR: Unsupported mesh -> mesh test attempted in collide-shape-prim-mesh::overlaps-others-test!~%" + ) + (set! v0-1 #f) + (b! #t cfg-18 :delay (nop!)) + (label cfg-12) + (let ((a0-9 (-> arg0 tlist))) + (b! (= a0-9 #f) cfg-14 :delay (nop!)) + (add-touching-prims a0-9 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + ) + (label cfg-14) + (b! (not (logtest? s4-0 1)) cfg-17 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) + (let ((a0-10 (-> arg1 prim-core action))) + (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-10) cfg-17 :delay (nop!)) + ) + (set! v0-1 #f) + (b! #t cfg-18 :delay (nop!)) + (label cfg-17) + (set! v0-1 #t) + (label cfg-18) + v0-1 + ) + ) + ) + +(defmethod modify-collide-as! ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (if (logtest? (-> v1-0 prim-id) arg0) + (set! (-> v1-0 prim-core collide-as) (logior (logclear (-> v1-0 prim-core collide-as) arg1) arg2)) + ) + (&+! v1-0 80) + ) + ) + 0 + (none) + ) + +(defmethod send-shoves ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (when arg1 + (let ((s0-0 (-> arg1 head))) + (set! sv-144 arg0) + (let ((gp-0 (if (type? sv-144 process-focusable) + sv-144 + ) + ) + ) + (when (and s0-0 gp-0) + (while s0-0 + (set! sv-160 (get-touched-prim s0-0 this arg1)) + (get-touched-prim s0-0 (the-as collide-shape (-> (the-as process-drawable gp-0) root)) arg1) + (when (logtest? (-> sv-160 prim-core action) (collide-action no-standon)) + (let ((v1-12 (touching-prims-entry-method-9 s0-0 (new 'stack-no-clear 'vector)))) + (set! sv-176 (new 'stack-no-clear 'vector)) + (let ((a0-7 (-> sv-160 prim-core))) + (.lvf vf4 (&-> v1-12 quad)) + (.lvf vf5 (&-> a0-7 world-sphere quad)) + ) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-176 quad) vf6) + (vector-normalize! sv-176 1.0) + (when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech)) + (< (-> (the-as process-focusable gp-0) root transv y) 4.096) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad)) + (let* ((v1-26 (-> (the-as process-focusable gp-0) root transv)) + (f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + ) + (if (= f30-0 0.0) + (set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad)) + ) + (vector-xz-normalize! s2-1 (fmax f30-0 arg4)) + ) + (set! (-> s2-1 y) arg3) + (send-event + gp-0 + 'shove + arg1 + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (vector s2-1) + (angle 'jump) + ) + ) + ) + ) + (return #t) + ) + ) + (set! s0-0 (-> s0-0 next)) + ) + ) + ) + ) + ) + #f + ) + ) + +;; WARN: Return type mismatch int vs vector. +(defmethod shove-to-closest-point-on-path ((this collide-shape) (arg0 attack-info) (arg1 float)) + (set! (-> arg0 shove-up) arg1) + (let* ((s3-0 (-> this process path)) + (s2-0 (-> s3-0 curve num-cverts)) + (s4-0 (target-pos 0)) + (s1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 -1.0)) + (dotimes (s0-0 s2-0) + (get-point-in-path! s3-0 s1-0 (the float s0-0) 'interp) + (let ((f0-3 (vector-vector-distance-squared s4-0 s1-0))) + (when (or (< f30-0 0.0) (< f0-3 f30-0)) + (set! f30-0 f0-3) + (set! (-> s5-0 quad) (-> s1-0 quad)) + ) + ) + ) + ) + (vector-! (-> arg0 vector) s5-0 s4-0) + ) + (the-as vector 0) + ) diff --git a/goal_src/jak3/engine/collide/collide-touch-h.gc b/goal_src/jak3/engine/collide/collide-touch-h.gc index 03bdacaf8c..b2a8d9b39f 100644 --- a/goal_src/jak3/engine/collide/collide-touch-h.gc +++ b/goal_src/jak3/engine/collide/collide-touch-h.gc @@ -27,8 +27,8 @@ Potentially also stores the triangle that is involved." (prim2 touching-prim :inline) ) (:methods - (touching-prims-entry-method-9 () none) - (touching-prims-entry-method-10 () none) + (touching-prims-entry-method-9 (_type_ vector) vector) + (get-middle-of-bsphere-overlap (_type_ vector) vector) (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim) (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) @@ -42,10 +42,10 @@ Potentially also stores the triangle that is involved." ) (:methods (new (symbol type) _type_) - (touching-prims-entry-pool-method-9 () none) - (touching-prims-entry-pool-method-10 () none) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) (init-list! (_type_) none) - (touching-prims-entry-pool-method-12 () none) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) @@ -100,7 +100,7 @@ storing a record of the primitives involved." (get-touched-shape (_type_ collide-shape) collide-shape) (prims-touching? (_type_ collide-shape uint) touching-prims-entry) (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) - (touching-shapes-entry-method-14 () none) + (free-touching-prims-list (_type_) none) ) ) @@ -113,11 +113,11 @@ storing a record of the primitives involved." ) (:methods (new (symbol type) _type_) - (touching-list-method-9 () none) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) (free-nodes (_type_) none) - (touching-list-method-11 () none) + (update-from-step-size (_type_ float) none) (send-events-for-touching-shapes (_type_) none) - (touching-list-method-13 () none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ) ) diff --git a/goal_src/jak3/engine/collide/collide-touch.gc b/goal_src/jak3/engine/collide/collide-touch.gc index bdc99a6558..2355329d66 100644 --- a/goal_src/jak3/engine/collide/collide-touch.gc +++ b/goal_src/jak3/engine/collide/collide-touch.gc @@ -7,3 +7,512 @@ ;; DECOMP BEGINS +(defmethod get-free-node-count ((this touching-prims-entry-pool)) + (let ((v0-0 0)) + (let ((v1-0 (-> this head))) + (while v1-0 + (+! v0-0 1) + (set! v1-0 (-> v1-0 next)) + (nop!) + (nop!) + (nop!) + ) + ) + v0-0 + ) + ) + +(defmethod alloc-node ((this touching-prims-entry-pool)) + (let ((gp-0 (-> this head))) + (cond + (gp-0 + (let ((v1-0 (-> gp-0 next))) + (set! (-> this head) v1-0) + (if v1-0 + (set! (-> v1-0 prev) #f) + ) + ) + (set! (-> gp-0 allocated?) #t) + (set! (-> gp-0 next) #f) + (set! (-> gp-0 prev) #f) + ) + (else + (format 0 "ERROR: touching-prims-entry-pool::alloc-node() failed!~%") + ) + ) + gp-0 + ) + ) + +(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) + (when (-> arg0 allocated?) + (set! (-> arg0 allocated?) #f) + (let ((v1-1 (-> this head))) + (set! (-> arg0 next) v1-1) + (set! (-> arg0 prev) #f) + (set! (-> this head) arg0) + (when v1-1 + (set! (-> v1-1 prev) arg0) + arg0 + ) + ) + ) + ) + +(defmethod free-touching-prims-list ((this touching-shapes-entry)) + (when (-> this cshape1) + (set! (-> this cshape1) #f) + (let ((gp-0 (-> this head))) + (when gp-0 + (set! (-> this head) #f) + (let ((s5-0 *touching-prims-entry-pool*)) + (while gp-0 + (let ((a1-0 gp-0)) + (set! gp-0 (-> a1-0 next)) + (free-node s5-0 a1-0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod free-nodes ((this touching-list)) + (let ((s5-0 (the-as object (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) + (free-touching-prims-list (the-as touching-shapes-entry s5-0)) + (set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 32)) + ) + ) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs touching-shapes-entry. +(defmethod get-shapes-entry ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) + (let ((v0-0 (the-as object (-> this touching-shapes)))) + (let ((v1-0 (the-as touching-shapes-entry #f))) + (countdown (a3-0 (-> this num-touching-shapes)) + (let ((t0-0 (-> (the-as touching-shapes-entry v0-0) cshape1))) + (set! v1-0 (cond + (t0-0 + (if (or (and (= t0-0 arg0) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg1)) + (and (= t0-0 arg1) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg0)) + ) + (return (the-as touching-shapes-entry v0-0)) + ) + v1-0 + ) + (else + (the-as touching-shapes-entry v0-0) + ) + ) + ) + ) + (set! v0-0 (&+ (the-as touching-shapes-entry v0-0) 32)) + ) + (cond + (v1-0 + (set! v0-0 v1-0) + ) + (else + (when (>= (-> this num-touching-shapes) 32) + (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") + (return (the-as touching-shapes-entry #f)) + ) + (+! (-> this num-touching-shapes) 1) + ) + ) + ) + (set! (-> (the-as touching-shapes-entry v0-0) cshape1) arg0) + (set! (-> (the-as touching-shapes-entry v0-0) cshape2) arg1) + (set! (-> (the-as touching-shapes-entry v0-0) head) #f) + (set! (-> (the-as touching-shapes-entry v0-0) resolve-u) 1) + (set! (-> this resolve-u) 1) + (set! (-> (the-as touching-shapes-entry v0-0) handle1) (process->handle (-> arg0 process))) + (set! (-> (the-as touching-shapes-entry v0-0) handle2) (process->handle (-> arg1 process))) + (the-as touching-shapes-entry v0-0) + ) + ) + +(deftype add-prims-touching-work (structure) + ((tri1 collide-tri-result) + (tri2 collide-tri-result) + ) + ) + + +;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. +(defmethod add-touching-prims ((this touching-list) + (arg0 collide-shape-prim) + (arg1 collide-shape-prim) + (arg2 float) + (arg3 collide-tri-result) + (arg4 collide-tri-result) + ) + (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) + (set! (-> gp-0 tri1) arg3) + (set! (-> gp-0 tri2) arg4) + (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) + (when s2-0 + (when (= (-> s2-0 cshape1) (-> arg1 cshape)) + (let ((v1-4 arg0)) + (set! arg0 arg1) + (set! arg1 v1-4) + ) + ) + (let ((s0-0 (-> s2-0 head))) + (while s0-0 + (when (and (= (-> s0-0 prim1 cprim) arg0) (= (-> s0-0 prim2 cprim) arg1)) + (when (< arg2 (-> s0-0 u)) + (-> s0-0 u) + (let ((v1-12 (-> s0-0 prim1)) + (a1-2 (-> gp-0 tri1)) + ) + (cond + (a1-2 + (set! (-> v1-12 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-12 tri)) (the-as pointer a1-2) 88) + ) + (else + (set! (-> v1-12 has-tri?) #f) + ) + ) + ) + (let ((v1-15 (-> s0-0 prim2)) + (a1-3 (-> gp-0 tri2)) + ) + (cond + (a1-3 + (set! (-> v1-15 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-15 tri)) (the-as pointer a1-3) 88) + ) + (else + (set! (-> v1-15 has-tri?) #f) + ) + ) + ) + ) + (return 0) + ) + (set! s0-0 (-> s0-0 next)) + ) + ) + (let ((s0-1 (alloc-node *touching-prims-entry-pool*))) + (when s0-1 + (let ((v1-22 (-> s2-0 head))) + (set! (-> s0-1 next) v1-22) + (set! (-> s0-1 prev) #f) + (set! (-> s2-0 head) s0-1) + (if v1-22 + (set! (-> v1-22 prev) s0-1) + ) + ) + (set! (-> s0-1 u) arg2) + (when (>= arg2 0.0) + (set! (-> s2-0 resolve-u) 1) + (set! (-> this resolve-u) 1) + ) + (let ((v1-26 (-> s0-1 prim1)) + (a1-4 (-> gp-0 tri1)) + ) + (set! (-> v1-26 cprim) arg0) + (cond + (a1-4 + (set! (-> v1-26 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-26 tri)) (the-as pointer a1-4) 88) + ) + (else + (set! (-> v1-26 has-tri?) #f) + ) + ) + ) + (let ((v1-29 (-> s0-1 prim2)) + (a1-5 (-> gp-0 tri2)) + ) + (set! (-> v1-29 cprim) arg1) + (cond + (a1-5 + (set! (-> v1-29 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-29 tri)) (the-as pointer a1-5) 88) + ) + (else + (set! (-> v1-29 has-tri?) #f) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod update-from-step-size ((this touching-list) (arg0 float)) + (when (nonzero? (-> this resolve-u)) + (set! (-> this resolve-u) 0) + (let ((s5-0 (the-as object (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) + (when (nonzero? (-> (the-as touching-shapes-entry s5-0) resolve-u)) + (set! (-> (the-as touching-shapes-entry s5-0) resolve-u) 0) + (when (-> (the-as touching-shapes-entry s5-0) cshape1) + (let ((s3-0 (-> (the-as touching-shapes-entry s5-0) head))) + (while s3-0 + (let ((f0-0 (-> s3-0 u))) + (set! s3-0 (cond + ((>= f0-0 0.0) + (cond + ((>= arg0 f0-0) + (set! (-> s3-0 u) -1.0) + (set! s3-0 (-> s3-0 next)) + ) + (else + (let ((a1-1 s3-0)) + (let ((v1-8 (-> s3-0 next))) + (let ((a0-1 (-> s3-0 prev))) + (if a0-1 + (set! (-> a0-1 next) v1-8) + (set! (-> (the-as touching-shapes-entry s5-0) head) v1-8) + ) + (if v1-8 + (set! (-> v1-8 prev) a0-1) + ) + ) + (set! s3-0 v1-8) + ) + (free-node *touching-prims-entry-pool* a1-1) + ) + ) + ) + s3-0 + ) + (else + (-> s3-0 next) + ) + ) + ) + ) + ) + ) + (if (not (-> (the-as touching-shapes-entry s5-0) head)) + (set! (-> (the-as touching-shapes-entry s5-0) cshape1) #f) + ) + ) + ) + (set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 32)) + ) + ) + ) + 0 + (none) + ) + +(defmethod send-events-for-touching-shapes ((this touching-list)) + (let ((gp-0 (the-as object (-> this touching-shapes)))) + (countdown (s5-0 (-> this num-touching-shapes)) + (let ((s3-0 (-> (the-as touching-shapes-entry gp-0) cshape1))) + (when s3-0 + (let ((s4-0 (handle->process (-> (the-as touching-shapes-entry gp-0) handle1))) + (s2-0 (handle->process (-> (the-as touching-shapes-entry gp-0) handle2))) + ) + (when (and s4-0 s2-0) + (let ((s1-0 (-> (the-as touching-shapes-entry gp-0) cshape2))) + (when (< (-> s3-0 event-priority) (-> s1-0 event-priority)) + (let ((v1-9 s3-0)) + (set! s3-0 s1-0) + (set! s1-0 v1-9) + ) + (let ((v1-11 s4-0)) + (set! s4-0 s2-0) + (set! s2-0 v1-11) + ) + ) + (let ((v1-13 (-> s3-0 event-self))) + (if v1-13 + (send-event s4-0 v1-13 :from s2-0 gp-0) + ) + ) + (let ((v1-14 (-> s3-0 event-other))) + (if v1-14 + (send-event s2-0 v1-14 :from s4-0 gp-0) + ) + ) + (let ((v1-15 (-> s1-0 event-self))) + (if v1-15 + (send-event s2-0 v1-15 :from s4-0 gp-0) + ) + ) + (let ((v1-16 (-> s1-0 event-other))) + (if v1-16 + (send-event s4-0 v1-16 :from s2-0 gp-0) + ) + ) + ) + ) + ) + ) + ) + (set! gp-0 (&+ (the-as touching-shapes-entry gp-0) 32)) + ) + ) + 0 + (none) + ) + +(defmethod prims-touching? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) + (cond + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) + (while v1-1 + (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) + (return v1-1) + ) + (set! v1-1 (-> v1-1 next)) + ) + ) + ) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) + (while v1-4 + (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) + (return v1-4) + ) + (set! v1-4 (-> v1-4 next)) + ) + ) + ) + (else + (format 0 "ERROR: touching-shapes-entry::prims-touching? : Bogus cshape value!~%") + ) + ) + (the-as touching-prims-entry #f) + ) + +;; WARN: Return type mismatch touching-prims-entry vs basic. +(defmethod prims-touching-action? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) + (cond + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) + (while v1-1 + (let ((a0-1 (-> v1-1 prim1 cprim))) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) + (return (the-as basic v1-1)) + ) + ) + (set! v1-1 (-> v1-1 next)) + ) + ) + ) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) + (while v1-4 + (let ((a0-5 (-> v1-4 prim2 cprim))) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) + (return (the-as basic v1-4)) + ) + ) + (set! v1-4 (-> v1-4 next)) + ) + ) + ) + (else + (format 0 "ERROR: touching-shapes-entry::prims-touching-action? : Bogus cshape value!~%") + ) + ) + (the-as basic #f) + ) + +(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) + (cond + ((= (-> this cshape1) arg0) + (return (-> this cshape2)) + ) + ((= (-> this cshape2) arg0) + (return (-> this cshape1)) + ) + ) + (the-as collide-shape #f) + ) + +(defmethod get-touched-prim ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) + (cond + ((= (-> arg1 cshape1) arg0) + (return (-> this prim1 cprim)) + ) + ((= (-> arg1 cshape2) arg0) + (return (-> this prim2 cprim)) + ) + ) + (the-as collide-shape-prim #f) + ) + +(defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) + (let ((v0-0 (the-as collide-tri-result #f))) + (cond + ((not this) + ) + ((= (-> arg1 cshape1) arg0) + (let ((v1-4 (-> this prim1))) + (if (-> v1-4 has-tri?) + (set! v0-0 (-> v1-4 tri)) + ) + ) + ) + ((= (-> arg1 cshape2) arg0) + (let ((v1-7 (-> this prim2))) + (if (-> v1-7 has-tri?) + (set! v0-0 (-> v1-7 tri)) + ) + ) + ) + ) + v0-0 + ) + ) + +(defmethod touching-prims-entry-method-9 ((this touching-prims-entry) (arg0 vector)) + (let* ((s4-0 (-> this prim1 cprim)) + (v1-0 (-> this prim2 cprim)) + (gp-1 (vector-! + (new 'stack-no-clear 'vector) + (the-as vector (-> v1-0 prim-core)) + (the-as vector (-> s4-0 prim-core)) + ) + ) + ) + (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + ) + (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) + ) + arg0 + ) + +(defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) + (let ((v1-0 (-> this prim1 cprim)) + (a2-0 (-> this prim2 cprim)) + ) + (vector+! arg0 (the-as vector (-> a2-0 prim-core)) (the-as vector (-> v1-0 prim-core))) + ) + (vector-float*! arg0 arg0 0.5) + arg0 + ) + +(defun get-intersect-point ((arg0 vector) (arg1 touching-prims-entry) (arg2 collide-shape) (arg3 touching-shapes-entry)) + (when arg1 + (let ((a0-2 (get-touched-tri arg1 arg2 arg3))) + (if a0-2 + (set! (-> arg0 quad) (-> a0-2 intersect quad)) + (touching-prims-entry-method-9 arg1 arg0) + ) + ) + ) + arg0 + ) diff --git a/goal_src/jak3/engine/collide/collide.gc b/goal_src/jak3/engine/collide/collide.gc index 94f6615e3e..3d734c2e6f 100644 --- a/goal_src/jak3/engine/collide/collide.gc +++ b/goal_src/jak3/engine/collide/collide.gc @@ -5,7 +5,20 @@ ;; name in dgo: collide ;; dgos: GAME -(define-extern *collide-vif0-init* (array uint32)) - ;; DECOMP BEGINS +(define *collide-vif0-init* (new 'static 'boxed-array :type uint32 + #x30000000 + #x4d000000 + #x4d000000 + #x4d000000 + #x3f800000 + #x5000001 + #x20000000 + #x40404040 + #x1000404 + #x0 + #x0 + #x0 + ) + ) diff --git a/goal_src/jak3/engine/collide/main-collide.gc b/goal_src/jak3/engine/collide/main-collide.gc index 9986bb57f5..ba4c1ba931 100644 --- a/goal_src/jak3/engine/collide/main-collide.gc +++ b/goal_src/jak3/engine/collide/main-collide.gc @@ -191,7 +191,7 @@ (nop!) (let ((a2-0 (new-stack-vector0))) (.svf (&-> a2-0 quad) vf9) - (add-debug-sphere #t (bucket-id bucket583) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (add-debug-sphere #t (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) ) ) ) diff --git a/goal_src/jak3/engine/common-obs/collectables-part.gc b/goal_src/jak3/engine/common-obs/collectables-part.gc index 35415ed7ee..fc4a76d71a 100644 --- a/goal_src/jak3/engine/common-obs/collectables-part.gc +++ b/goal_src/jak3/engine/common-obs/collectables-part.gc @@ -7,3 +7,2820 @@ ;; DECOMP BEGINS +(defpartgroup group-rod-of-god + :id 123 + :flags (sp0) + :bounds (static-bspherem 0 300 0 640) + :parts ((sp-item 409 :fade-after (meters 80) :falloff-to (meters 160)) + (sp-item 410 :flags (sp6)) + (sp-item 411 :flags (sp6)) + ) + ) + +(defpart 409 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0) + (:x (meters 0) (meters 2.7)) + (:y (meters 0) (meters 32)) + (:scale-x (meters 0.25)) + (:scale-y (meters 0.25) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.0016666667) (meters 0.0016666667)) + (:fade-a 0.4) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.267)) + (:next-launcher 412) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 412 + :init-specs ((:fade-a -0.4)) + ) + +(defpart 410 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters -0.25)) + (:scale-x (meters 18)) + (:rot-x (degrees 135)) + (:scale-y (meters 18)) + (:r 128.0) + (:g 128.0) + (:b 0.0 64.0) + (:a 32.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 20480.0) + ) + ) + +(defpart 411 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters -0.25)) + (:scale-x (meters 9)) + (:rot-x (degrees 135)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 20480.0) + ) + ) + +(defpartgroup group-eco-green-collect + :id 124 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 415 :flags (sp3) :binding 413) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 417 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 415 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +(defpart 418 + :init-specs ((:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:a 0.0) (:fade-a 0.0)) + ) + +(defpart 413 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 416 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 419) + ) + ) + +(defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (if (not (logtest? (-> arg1 key proc state-flags) (state-flags sf0))) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + 0 + (none) + ) + +(defun eco-track-root-prim-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-1 (-> arg1 key proc))) + (let ((a0-3 (-> (the-as collide-shape (-> v1-1 root)) root-prim prim-core))) + (set! (-> arg2 x) (-> a0-3 world-sphere x)) + (set! (-> arg2 y) (-> a0-3 world-sphere y)) + (set! (-> arg2 z) (-> a0-3 world-sphere z)) + ) + (if (not (logtest? (-> v1-1 state-flags) (state-flags sf0))) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + ) + 0 + (none) + ) + +(defpartgroup group-eco-green-pill + :id 125 + :bounds (static-bspherem 0 0 0 0.4) + :parts ((sp-item 424 :flags (sp3) :binding 420) + (sp-item 420 :flags (sp2 sp3) :binding 421) + (sp-item 421 :flags (sp2 sp3) :binding 422) + (sp-item 422 :flags (sp2 sp3) :binding 423) + (sp-item 422 :flags (sp2 sp3)) + (sp-item 422 :flags (sp2 sp3)) + (sp-item 422 :flags (sp2 sp3)) + (sp-item 423 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 424 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 425) + ) + ) + +(defpart 420 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.1)) + (:scale-x (meters 0.6) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.026666667) (meters 0.026666667)) + (:vel-y (meters 0.0014814815)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 425) + ) + ) + +(defpart 425 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +(defpart 421 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.2)) + (:scale-x (meters 0.6) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.4) 1 (degrees 0.8)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 425) + ) + ) + +(defpart 422 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.2) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 426) + ) + ) + +(defpart 426 + :init-specs ((:fade-r 0.0) (:fade-a -0.8466667) (:timer (seconds 0.5))) + ) + +(defpart 423 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.25) + (:y (meters -0.05)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.00039393938)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 427) + ) + ) + +(defpartgroup group-eco-green-pill-collect + :id 126 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 415 :flags (sp3) :binding 428) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 428 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.25) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0.04)) + (:accel-z (meters -0.0026666666)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 414 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.0004545455)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 419) + ) + ) + +(defpartgroup group-eco-light-pill + :id 127 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 4) + :scale (1.0 10.0 1.0) + :parts ((sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017)) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 30) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 60) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 90) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 120) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 150) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 180) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 210) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 240) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 270) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017)) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 30) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 60) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 90) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 120) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 150) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 180) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 210) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 240) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 270) + (sp-item 432 :flags (sp3) :binding 430) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 433) + ) + ) + +(defpart 431 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 429 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y (meters 0.4) (meters 0.2)) + (:r 128.0 128.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters -0.0014814815) (meters 0.002962963)) + (:vel-z (meters 0.0016666667) (meters 0.00066666666)) + (:rotvel-z (degrees -0.4) 1 (degrees 0.8)) + (:fade-a 0.21333334) + (:accel-z (meters -0.00006666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.5)) + (:next-launcher 434) + ) + ) + +(defpart 434 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpart 432 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 430 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 0.8) (meters 0.2)) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 0.0) + (:g 0.0 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 1 (meters 0.035555556)) + (:vel-y (meters -0.00014814814) (meters 0.0002962963)) + (:vel-z (meters 0.0016666667)) + (:rotvel-z (degrees -0.6) 1 (degrees 1.2)) + (:accel-z (meters -0.00005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch)) + ) + ) + +(defpart 433 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 0.4) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 1 20.0) + (:g 0.0 64.0) + (:b 100.0) + (:a 0.0) + (:scalevel-x (meters -0.006666667) (meters 0.015)) + (:scalevel-y :copy scalevel-x) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4.096) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.167)) + (:next-launcher 435) + ) + ) + +(defpart 435 + :init-specs ((:fade-a -2.56)) + ) + +(defpart 1 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0) + (:x (meters 0) (meters 0.1)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters -0.0013333333) (meters -0.0013333333)) + (:scalevel-y (meters 0.0013333333) (meters 0.0013333333)) + (:fade-a -0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.95 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-eco-dark-pill + :id 128 + :flags (sp7) + :bounds (static-bspherem 0 0 0 4) + :scale (1.0 10.0 1.0) + :parts ((sp-item 438 :period (seconds 0.085) :length (seconds 0.017) :binding 436) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 439 :period (seconds 0.085) :length (seconds 0.017) :binding 437) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 440 :flags (sp6)) + ) + ) + +(defpart 440 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 438 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 436 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 1.4) (meters 0.2)) + (:scale-y (meters 1.4) (meters 0.2)) + (:r 0.0 255.0) + (:g 0.0) + (:b 255.0) + (:a 6.0 6.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters -0.00037037037) (meters 0.00074074074)) + (:vel-z (meters 0.0016666667)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:accel-z (meters -0.000041666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +(defpart 439 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 437 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y (meters 0.4) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters -0.00037037037) (meters 0.00074074074)) + (:vel-z (meters 0.0016666667)) + (:rotvel-z (degrees -0.6) 1 (degrees 1.2)) + (:accel-z (meters -0.000041666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 ready-to-launch)) + ) + ) + +(defpartgroup group-eco-green + :id 129 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 444 :flags (sp3) :binding 441) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + ) + ) + +(defpart 444 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:a 1.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 441 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.25)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 445) + ) + ) + +(defpart 445 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +(defpart 442 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 255.0) + (:a 64.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.053333335) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 446) + ) + ) + +(defpart 446 + :init-specs ((:fade-a -0.42666668) (:timer (seconds 0.5))) + ) + +(defpart 443 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.25) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 48.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 427) + ) + ) + +(defpart 427 + :init-specs ((:fade-r 0.0)) + ) + +(defpartgroup group-eco-dark-pill-move-collect + :id 130 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 449 :flags (sp3) :binding 447) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 449 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:b 128.0 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 450) + ) + ) + +(defpart 450 + :init-specs ((:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:a 0.0) (:fade-a 0.0)) + ) + +(defpart 451 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:b 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 447 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.25) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:b 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0.04)) + (:accel-z (meters -0.0026666666)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 452 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 453) + ) + ) + +(defpart 448 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters -0.0004545455)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 453) + ) + ) + +(defpartgroup group-generic-collect + :id 131 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 454)) + ) + +(defpart 455 + :init-specs ((:fade-a -0.15238096)) + ) + +(defpart 454 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 456 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 457 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + +(defpartgroup group-skill-glow-red + :id 132 + :flags (sp1) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 459 :fade-after (meters 150) :flags (sp6 sp7))) + ) + +(defpart 459 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 90.0) + (:b 64.0) + (:a 16.0) + (:omega (degrees 13511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2867.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-skill-glow-yellow + :id 133 + :flags (sp1) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 460 :fade-after (meters 150) :flags (sp6 sp7))) + ) + +(defpart 460 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:omega (degrees 13511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2867.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-gem-glow + :id 134 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 461 :flags (sp6 sp7)) (sp-item 462 :flags (sp6 sp7)) (sp-item 463 :flags (sp6 sp7))) + ) + +(defpart 461 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2867.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 462 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters 0.3)) + (:scale-x (meters 1.75)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 12.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 463 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -0.3)) + (:scale-x (meters 1.75)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 12.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 464 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpartgroup group-gem-collect + :id 135 + :duration (seconds 0.1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 465 :period (seconds 0.5) :length (seconds 0.017)) + (sp-item 466 :period (seconds 0.5) :length (seconds 0.067)) + ) + ) + +(defpart 466 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 3.0 1.0) + (:scale-x (meters 16) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 16.0) + (:scalevel-x (meters -0.4)) + (:scalevel-y (meters 0.00125)) + (:fade-a 0.2 0.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +(defpart 465 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.23333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.33333334) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 467) + ) + ) + +(defpart 467 + :init-specs ((:a 16.0) (:fade-a -0.8)) + ) + +(defpart 468 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpartgroup group-ammo-yellow-collect + :id 136 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ammo-red-collect + :id 137 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ammo-blue-collect + :id 138 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +(defpartgroup group-ammo-dark-collect + :id 139 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +(defpartgroup group-eco-dark-pill-collect + :id 140 + :duration (seconds 0.1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 469 :period (seconds 0.5) :length (seconds 0.017)) + (sp-item 470 :period (seconds 0.5) :length (seconds 0.067)) + ) + ) + +(defpart 470 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 3.0 1.0) + (:scale-x (meters 24) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 128.0 128.0) + (:g 0.0) + (:b 255.0) + (:a 16.0) + (:scalevel-x (meters -0.6)) + (:scalevel-y (meters 0.00125)) + (:fade-a 0.2 0.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +(defpart 469 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.33333334) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 471) + ) + ) + +(defpart 471 + :init-specs ((:a 16.0) (:fade-a -0.8)) + ) + +(defpartgroup group-green-collect + :id 141 + :duration (seconds 1) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 474 :period (seconds 1.5) :length (seconds 0.017) :offset 100) + (sp-item 475 :period (seconds 1.5) :length (seconds 0.067) :offset 125) + (sp-item 476 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 1.5) :length (seconds 0.067) :binding 472) + (sp-item 472 :fade-after (meters 80) :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + ) + ) + +(defpart 476 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 472 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 8)) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 28.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.008888889) (meters 0.017777778)) + (:vel-z (meters -0.053333335)) + (:fade-r -0.8) + (:fade-a 0.8) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:next-time (seconds 1.5) (seconds 0.497)) + (:next-launcher 477) + ) + ) + +(defpart 477 + :init-specs ((:fade-r 0.0) (:fade-a -0.8466667 -0.8466667) (:timer (seconds 0.5))) + ) + +(defpart 473 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.0006060606)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 427) + ) + ) + +(defpart 475 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 3.0 1.0) + (:scale-x (meters 24) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 0.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 16.0) + (:scalevel-x (meters -0.6)) + (:scalevel-y (meters 0.00125)) + (:fade-a 0.2 0.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +(defpart 474 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.21176471)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.5058824) + (:fade-a 0.28235295) + (:timer (seconds 0.35)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + (:next-time (seconds 0.285)) + (:next-launcher 478) + ) + ) + +(defpart 478 + :init-specs ((:a 16.0) (:fade-r -12.8) (:fade-a -1.0)) + ) + +(defpartgroup group-skate-point + :id 142 + :linger-duration (seconds 1) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 479 :fade-after (meters 90) :falloff-to (meters 90) :flags (is-3d)) + (sp-item 480 :flags (is-3d)) + (sp-item 481 :flags (sp6)) + (sp-item 482 :flags (is-3d sp6)) + (sp-item 483 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +(defpart 483 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.1) (meters 0.15)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 32.0) + (:b 0.0 16.0) + (:a 96.0 32.0) + (:omega (degrees 0.19125001)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.7066667) + (:friction 0.97) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 479 + :init-specs ((:texture (new 'static 'texture-id :page #x17e)) + (:num 0.05) + (:scale-x (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 64.0) + (:b 16.0) + (:a 64.0) + (:scalevel-x (meters 0.0055555557)) + (:rotvel-x (degrees 0.8)) + (:rotvel-y (degrees 0.8)) + (:rotvel-z (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 482 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-camera-orient) + (:num 1.0) + (:scale-x (meters 1.5) (meters 2.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 480 + :init-specs ((:texture (new 'static 'texture-id :page #x17e)) + (:birth-func 'birth-func-camera-orient) + (:num 1.0) + (:scale-x (meters 2.9) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 16.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 481 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.2)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 16.0) + (:a 32.0 8.0) + (:omega (degrees 22509)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-skate-point-explode + :id 143 + :duration (seconds 0.017) + :linger-duration (seconds 1) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 484 :flags (sp6))) + ) + +(defpart 484 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 16.0) + (:a 128.0) + (:omega (degrees 22509)) + (:scalevel-x (meters -0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.6) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-part-vent-light-active + :id 144 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 485 :flags (is-3d)) + (sp-item 486 :flags (is-3d)) + (sp-item 487 :flags (is-3d)) + (sp-item 488 :flags (is-3d)) + (sp-item 489) + (sp-item 490) + ) + ) + +(defpart 485 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -11)) + (:scale-x (meters 40)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.5)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:fade-a 0.64 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 491 + :init-specs ((:fade-a -0.64 -0.64)) + ) + +(defpart 486 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -11)) + (:scale-x (meters 40)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.2)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 487 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -11)) + (:scale-x (meters 40)) + (:rot-z (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 488 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters -2)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 10)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.25) (meters 0.5)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b000 #x40b100)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 1)) + (:next-launcher 492) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 492 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +(defpart 489 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 0.0 1 128.0) + (:g 0.0 1 128.0) + (:b 0.0 1 128.0) + (:a 0.0) + (:vel-y (meters 0.00083333335) (meters 0.0016666667)) + (:fade-a 0.85333335) + (:timer (seconds 1) (seconds 1.665)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.5)) + (:next-launcher 493) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 493 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 490 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 0.5) + (:y (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y (meters 0.006666667) (meters 0.016666668)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:next-time (seconds 1)) + (:next-launcher 494) + ) + ) + +(defpart 494 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpartgroup group-part-vent-light-touched + :id 145 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 495 :flags (is-3d)) + (sp-item 496 :flags (is-3d)) + (sp-item 497 :flags (is-3d)) + (sp-item 498 :flags (is-3d)) + (sp-item 499 :flags (is-3d)) + (sp-item 500) + (sp-item 501) + ) + ) + +(defpart 495 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.64 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 502) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 502 + :init-specs ((:fade-a -0.64 -0.64)) + ) + +(defpart 496 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 497 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 502) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 498 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:scalevel-y (meters 0.016666668)) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 502) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 499 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.15 0.15) + (:x (meters -0.5) (meters 1)) + (:y (meters -1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.1) (meters 0.3)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.06666667)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b000 #x40b100)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 1)) + (:next-launcher 503) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 503 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +(defpart 500 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 2.0 2.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 10)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0 1 128.0) + (:g 0.0 1 128.0) + (:b 0.0 1 128.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:fade-a 2.56) + (:friction 1.1) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 504) + (:conerot-x (degrees -170) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 504 + :init-specs ((:fade-a -2.56)) + ) + +(defpart 501 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.016666668) (meters 0.013333334)) + (:scalevel-y (meters 0.06666667) (meters 0.033333335)) + (:fade-a 0.16 0.16) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x408600 #x400700)) + (:next-time (seconds 0.335)) + (:next-launcher 505) + ) + ) + +(defpart 505 + :init-specs ((:fade-a -0.32)) + ) + +(defpartgroup group-part-vent-dark-active + :id 146 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 10) + :parts ((sp-item 506 :flags (is-3d sp3)) + (sp-item 507 :flags (is-3d sp3)) + (sp-item 508 :flags (is-3d sp3)) + (sp-item 509) + (sp-item 510) + ) + ) + +(defun sparticle-3d-rotate-xz-to-camera-eco-shaft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-4 float) (v1-5 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (-> arg1 key proc) + (let ((a0-1 (math-camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) *up-vector* s5-0)) + (s5-1 (new 'stack-no-clear 'quaternion)) + ) + (matrix->quaternion s5-1 a1-3) + (quaternion-rotate-local-z! s5-1 s5-1 -16384.0) + (quaternion-rotate-y! s5-1 s5-1 -16384.0) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-4 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defun spt-func-part-vent-eco-dark-shaft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-3d-rotate-xz-to-camera-eco-shaft arg0 arg1 (the-as sprite-vec-data-3d arg2)) + (sparticle-texture-animate arg0 arg1 arg2) + (none) + ) + +(defpart 506 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 2.2)) + (:scale-y (meters 10)) + (:r 20.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 507 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 2)) + (:scale-y (meters 12)) + (:r 60.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 25 + 1 + 0 + #x403800 + #x403700 + #x403600 + #x403500 + #x403400 + #x403300 + #x403200 + #x403100 + #x403000 + #x402f00 + #x402e00 + #x402d00 + #x402c00 + #x402b00 + #x402a00 + #x402900 + #x402800 + #x402700 + #x402600 + #x402500 + #x402400 + #x402300 + #x402200 + #x402100 + #x402000 + #x401f00 + #x401e00 + #x401d00 + #x401c00 + #x401b00 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 508 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 1.8)) + (:scale-y (meters 14)) + (:r 100.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 30 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 511 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters -2)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 20)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.25) (meters 0.5)) + (:r 40.0 40.0) + (:g 0.0) + (:b 128.0 128.0) + (:a 0.0) + (:scalevel-x (meters -0.01) (meters -0.006666667)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b000 #x40b100)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 1)) + (:next-launcher 512) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 512 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +(defpart 509 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0) (meters 15)) + (:z (meters -0.2) (meters 0.4)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y (meters 1) (meters 1)) + (:r 255.0) + (:g 0.0 128.0) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y (meters 0.0033333334)) + (:fade-g 0.053333335 0.053333335 :store) + (:fade-b '*sp-temp*) + (:fade-a 0.053333335 0.053333335) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 510 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:y (meters 3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0 64.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.026666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.10666667 0.21333334) + (:fade-g -0.053333335 -0.053333335) + (:fade-b 0.10666667 0.10666667) + (:fade-a 0.21333334 0.21333334) + (:accel-x (meters -0.00033333333) (meters 0.00066666666)) + (:accel-z (meters -0.00033333333) (meters 0.00066666666)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 513) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 513 + :init-specs ((:fade-a -0.42666668 -0.42666668)) + ) + +(defpartgroup group-part-vent-dark-touched + :id 147 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 514 :flags (is-3d) :period (seconds 2) :length (seconds 0.017)) + (sp-item 515 :flags (is-3d) :period (seconds 2) :length (seconds 0.017)) + (sp-item 516 :flags (is-3d) :period (seconds 2) :length (seconds 0.017)) + (sp-item 517 :flags (is-3d)) + (sp-item 518) + (sp-item 519) + (sp-item 520) + ) + ) + +(defpart 514 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 2)) + (:scale-y (meters 10)) + (:r 20.0) + (:g 0.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 515 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 1.5)) + (:scale-y (meters 12)) + (:r 60.0) + (:g 0.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 15 + 1 + 0 + #x403800 + #x403700 + #x403600 + #x403500 + #x403400 + #x403300 + #x403200 + #x403100 + #x403000 + #x402f00 + #x402e00 + #x402d00 + #x402c00 + #x402b00 + #x402a00 + #x402900 + #x402800 + #x402700 + #x402600 + #x402500 + #x402400 + #x402300 + #x402200 + #x402100 + #x402000 + #x401f00 + #x401e00 + #x401d00 + #x401c00 + #x401b00 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 516 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 1)) + (:scale-y (meters 14)) + (:r 100.0) + (:g 0.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 517 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-y (meters -0.053333335)) + (:fade-a 0.64 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 521) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 522 + :init-specs ((:fade-a 0.0)) + ) + +(defpart 518 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 2.0 2.0) + (:x (meters 8)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1125)) + (:fade-a 0.42666668) + (:accel-x (meters -0.0016666667)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'spt-func-part-vent-eco-dark-touched-specs) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defun spt-func-part-vent-eco-dark-touched-specs ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (check-drop-group-center arg0 arg1 (the-as sparticle-launchinfo arg2)) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +(defpart 519 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 3.0 3.0) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0) (meters 15)) + (:z (meters -0.2) (meters 0.4)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y (meters 1) (meters 1)) + (:r 255.0) + (:g 0.0 128.0) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y (meters 0.0033333334)) + (:fade-g 0.053333335 0.053333335 :store) + (:fade-b '*sp-temp*) + (:fade-a 0.10666667 0.10666667) + (:accel-y (meters -0.00066666666) (meters -0.00033333333)) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 520 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:y (meters 3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.026666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.42666668 -0.42666668) + (:fade-g -0.85 -0.85) + (:fade-a 0.21333334 0.21333334) + (:accel-x (meters -0.001) (meters 0.00066666666)) + (:accel-y (meters -0.00016666666)) + (:accel-z (meters -0.001) (meters 0.00066666666)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 523) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 523 + :init-specs ((:fade-a -0.42666668 -0.42666668)) + ) + +(defpartgroup group-part-vent-green-active + :id 148 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 10) + :parts ((sp-item 526 :fade-after (meters 100) :period (seconds 0.167) :length (seconds 0.017) :binding 524) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 527 :fade-after (meters 100) :flags (is-3d sp7)) + ) + ) + +(defpart 527 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0) + (:y (meters 1) (meters 0.2)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 92.0 32.0) + (:b 0.0) + (:a 255.0) + (:vel-y (meters 0.008333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-y (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.56666666 -0.56666666) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 528 + :init-specs ((:vel-y (meters -0.0033333334)) + (:scalevel-x (meters 0.016666668) (meters 0.006666667)) + (:rotvel-y (degrees 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.085)) + (:next-launcher 529) + ) + ) + +(defpart 529 + :init-specs ((:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:rotvel-y (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256 -0.256) + (:accel-y (meters 0.0019333332)) + (:next-time (seconds 0.085)) + (:next-launcher 530) + ) + ) + +(defpart 530 + :init-specs ((:vel-y (meters 0)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-y (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0.0016666667)) + (:friction 0.9) + ) + ) + +(defpart 531 + :init-specs ((:texture (wave-foam foresta-sprite)) + (:num 0.3) + (:y (meters 1)) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y (meters 0.2) (meters 0.2)) + (:r 8.0) + (:g 64.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.016666668)) + (:fade-a 0.85333335) + (:accel-y (meters 0.00033333333)) + (:friction 0.98) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'spt-func-turn-to-vel-radial) + (:next-time (seconds 0.5)) + (:next-launcher 532) + (:conerot-x (degrees -90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 532 + :init-specs ((:scalevel-y (meters 0.006666667)) + (:fade-a -0.17066666 -0.17066666) + (:accel-y (meters 0.00026666667) (meters 0.00006666667)) + (:friction 0.95) + ) + ) + +(defpart 526 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 1.5) (meters 0.5)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 524 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 255.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0) (degrees 3600)) + (:vel-x (meters 0.059259262) (meters 0.0074074077)) + (:vel-y (meters 0)) + (:vel-z (meters 0.0016666667)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 533 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpart 525 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-placeholder-small + :id 149 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 249)) + ) + +(defpart 534 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +(defpartgroup group-placeholder-single + :id 150 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 535 :flags (sp7))) + ) + +(defpart 535 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +(defpartgroup group-placeholder-multiple + :id 151 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 536 :flags (sp7))) + ) + +(defpart 536 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.01)) + (:timer (seconds 2)) + (:flags ()) + (:conerot-x (degrees -45) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/collectables.gc b/goal_src/jak3/engine/common-obs/collectables.gc index da55b0fffc..265febbd53 100644 --- a/goal_src/jak3/engine/common-obs/collectables.gc +++ b/goal_src/jak3/engine/common-obs/collectables.gc @@ -911,10 +911,7 @@ ) :trans (behavior () (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) - (let ((t9-2 (method-of-object (-> self root) collide-shape-moving-method-57))) - (-> self root transv) - (t9-2) - ) + (integrate-no-collide! (-> self root) (-> self root transv)) (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) (set! (-> self root trans y) (-> self base y)) (cond @@ -1060,7 +1057,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part fade) (* 0.0033333334 f0-1)) + (set! (-> self part local-space-binding) (the-as particle-local-space-info (* 0.0033333334 f0-1))) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -1664,7 +1661,7 @@ (a1-3 (-> this draw skeleton bones 3)) ) (if (nonzero? a0-7) - (sparticle-launch-control-method-17 a0-7 (the-as matrix a1-3)) + (spawn-from-mat a0-7 (the-as matrix a1-3)) ) ) 0 @@ -1798,10 +1795,7 @@ ) ) (else - (let ((t9-7 (method-of-object (-> self root) collide-shape-moving-method-57))) - (-> self root transv) - (t9-7) - ) + (integrate-no-collide! (-> self root) (-> self root transv)) ) ) ) @@ -2673,7 +2667,7 @@ (you-suck-stage *game-info* #f 0) (cond ((or (< 20 (-> *game-info* live-eco-pill-count)) - (not (logtest? (game-feature feature58) (-> *game-info* features))) + (not (logtest? (game-feature darkeco) (-> *game-info* features))) ) (return (the-as pickup-type #f)) ) @@ -2696,7 +2690,7 @@ ;; WARN: Return type mismatch number vs pickup-type. (defun pickup-light-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) (the-as pickup-type (cond - ((logtest? (game-feature feature57) (-> *game-info* features)) + ((logtest? (game-feature lighteco) (-> *game-info* features)) (set! (-> arg1 0) (pickup-type eco-pill-light)) (set! (-> arg2 0) 20.0) ) diff --git a/goal_src/jak3/engine/common-obs/enemy-states.gc b/goal_src/jak3/engine/common-obs/enemy-states.gc index 047bd628db..661615130a 100644 --- a/goal_src/jak3/engine/common-obs/enemy-states.gc +++ b/goal_src/jak3/engine/common-obs/enemy-states.gc @@ -894,17 +894,9 @@ (set! (-> s5-1 quad) (-> gp-1 gspot-pos quad)) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> gp-1 gspot-normal quad)) - (let* ((a0-10 gp-1) - (t9-5 (method-of-object a0-10 find-ground)) - (a2-2 (-> self enemy-info gnd-collide-with)) - (a3-1 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (not (t9-5 a0-10 a1-5 a2-2 a3-1 t0-0 t1-0)) - (set! (-> gp-1 gspot-pos quad) (-> s5-1 quad)) - (set! (-> gp-1 gspot-normal quad) (-> s4-1 quad)) - ) + (when (not (find-ground gp-1 a1-5 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))) + (set! (-> gp-1 gspot-pos quad) (-> s5-1 quad)) + (set! (-> gp-1 gspot-normal quad) (-> s4-1 quad)) ) ) ) @@ -1035,18 +1027,18 @@ (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) ) - (let* ((v1-0 s5-0) - (t9-0 (method-of-object v1-0 find-ground)) - (a2-1 (-> this enemy-info recover-gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (t9-0 v1-0 a1-0 a2-1 a3-0 t0-0 t1-0) - (if (< (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)) 8192.0) - (set! gp-0 #f) + (when (find-ground + s5-0 + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) ) - ) + (if (< (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)) 8192.0) + (set! gp-0 #f) + ) ) gp-0 ) diff --git a/goal_src/jak3/engine/common-obs/generic-obs-h.gc b/goal_src/jak3/engine/common-obs/generic-obs-h.gc index 82015b44d6..4e03f48b2b 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs-h.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs-h.gc @@ -38,9 +38,17 @@ (declare-type joint-mod basic) (declare-type sparticle-launch-group basic) (declare-type sparticle-subsampler basic) +(declare-type part-tracker process) +(declare-type part-tracker-subsampler part-tracker) +(declare-type part-tracker-init-params structure) +(declare-type part-tracker-subsampler-init-params structure) +(declare-type lightning-tracker process) (define-extern process-grab? (function process symbol symbol :behavior process)) (define-extern process-release? (function process symbol :behavior process)) +(define-extern part-tracker-init (function part-tracker-init-params object :behavior part-tracker)) +(define-extern part-tracker-subsampler-init (function part-tracker-subsampler-init-params object :behavior part-tracker-subsampler)) +(define-extern lightning-tracker-init (function lightning-spec time-frame symbol process-drawable vector vector none :behavior lightning-tracker)) ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/common-obs/generic-obs.gc b/goal_src/jak3/engine/common-obs/generic-obs.gc index cbfdd7187e..f736b5e8cf 100644 --- a/goal_src/jak3/engine/common-obs/generic-obs.gc +++ b/goal_src/jak3/engine/common-obs/generic-obs.gc @@ -1225,17 +1225,14 @@ (nonzero? (-> (the-as process-drawable v1-15) root)) (nonzero? (-> (the-as process-drawable v1-15) node-list)) ) - (sparticle-launch-control-method-18 - (-> self part) - (-> (the-as process-drawable v1-15) node-list data (-> self target-joint)) - ) + (spawn-from-cspace (-> self part) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint))) (set! (-> self root trans quad) (-> self part origin trans quad)) ) (else (let ((a0-11 (-> self root trans))) (set! (-> self mat trans quad) (-> a0-11 quad)) ) - (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + (spawn-from-mat (-> self part) (-> self mat)) ) ) ) @@ -1306,7 +1303,7 @@ (nonzero? (-> (the-as process-drawable v1-15) root)) (nonzero? (-> (the-as process-drawable v1-15) node-list)) ) - (sparticle-subsampler-method-10 + (init-with-mat! (-> self subsampler) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint) bone transform) ) @@ -1316,7 +1313,7 @@ (let ((a0-11 (-> self root trans))) (set! (-> self mat trans quad) (-> a0-11 quad)) ) - (sparticle-subsampler-method-10 (-> self subsampler) (-> self mat)) + (init-with-mat! (-> self subsampler) (-> self mat)) ) ) ) @@ -1453,7 +1450,7 @@ (set! (-> self part) (create-launch-control (-> arg0 group) self)) (when (and (-> arg0 target) (logtest? (-> self part group flags) (sp-group-flag sp12 sp14))) (let* ((gp-0 (-> self part)) - (s5-0 (method-of-object gp-0 sparticle-launch-control-method-20)) + (s5-0 (method-of-object gp-0 set-local-space-info)) (s4-0 (add-connection *part-local-space-engine* self local-space-proc-joint (-> self target-joint) 0 0)) ) (let ((v1-10 (process->handle (-> arg0 target)))) @@ -1470,7 +1467,7 @@ (part-local-space-flags) ) ) - (s5-0 gp-0 (the-as float s4-0)) + (s5-0 gp-0 (the-as particle-local-space-info s4-0)) ) ) (set! (-> self event-hook) (-> (method-of-object self active) event)) @@ -2081,7 +2078,7 @@ (defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) (local-vars (sv-16 string)) - (stack-size-set! (-> this main-thread) 16) + (stack-size-set! (-> this main-thread) 64) (logior! (-> this mask) (process-mask ambient)) (+! (-> this clock ref-count) -1) (+! (-> *display* part-clock ref-count) 1) @@ -3251,7 +3248,7 @@ ) 0 (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) - (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + (spawn-from-mat (-> self part) (-> self mat)) (suspend) ) (set-time! (-> self start-time)) @@ -4050,7 +4047,7 @@ :virtual #t :trans (behavior () (set! (-> self task-counter) (-> *game-info* task-counter)) - (if *bigmap* + (if (and *bigmap* (nonzero? *bigmap*)) (bigmap-method-16 *bigmap*) ) (let ((gp-0 (res-lump-struct (-> self entity) 'on-running structure))) diff --git a/goal_src/jak3/engine/common-obs/plat.gc b/goal_src/jak3/engine/common-obs/plat.gc index 4e97b60ccf..080a65f68e 100644 --- a/goal_src/jak3/engine/common-obs/plat.gc +++ b/goal_src/jak3/engine/common-obs/plat.gc @@ -42,7 +42,7 @@ (set! (-> s5-0 total-prims) (the-as uint 1)) (set! (-> s5-0 root-prim) s4-0) ) - ((method-of-object s5-0 collide-shape-method-54)) + (pusher-init s5-0) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (let ((v1-11 (-> s5-0 root-prim))) (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) diff --git a/goal_src/jak3/engine/common-obs/prim-beam-h.gc b/goal_src/jak3/engine/common-obs/prim-beam-h.gc index 26bccaa3c4..dd1bdd6d8d 100644 --- a/goal_src/jak3/engine/common-obs/prim-beam-h.gc +++ b/goal_src/jak3/engine/common-obs/prim-beam-h.gc @@ -5,11 +5,20 @@ ;; name in dgo: prim-beam-h ;; dgos: GAME +(declare-type prim-beam process) +(declare-type prim-beam-tracker prim-beam) +(declare-type prim-beam-params structure) +(declare-type prim-beam-tracker-params prim-beam-params) + +(define-extern prim-beam-tracker-init-by-other (function prim-beam-tracker-params object :behavior prim-beam-tracker)) +(define-extern spawn-prim-beam-tracker (function prim-beam-tracker-params symbol process handle)) + + ;; DECOMP BEGINS (deftype prim-beam-settings (structure) ((width float) - (color uint32) + (color rgba) (alpha float) (tex-id uint32) (num-tiles float) diff --git a/goal_src/jak3/engine/common-obs/projectile.gc b/goal_src/jak3/engine/common-obs/projectile.gc index 7fdab32bf6..79ca2692f3 100644 --- a/goal_src/jak3/engine/common-obs/projectile.gc +++ b/goal_src/jak3/engine/common-obs/projectile.gc @@ -532,20 +532,20 @@ (projectile-bounce-update-velocity self) (set! (-> s5-0 quad) (-> gp-0 trans quad)) (vector-v++! s5-0 (-> gp-0 transv)) - (let* ((a0-4 gp-0) - (t9-2 (method-of-object a0-4 find-ground)) - (a2-0 #x100249) - (a3-0 4096.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (t9-2 a0-4 s4-0 (the-as collide-spec a2-0) a3-0 t0-0 t1-0) - (let ((f30-0 (+ (-> gp-0 gspot-pos y) (-> self root root-prim local-sphere w)))) - (when (>= f30-0 (-> s5-0 y)) - (projectile-bounce-method-43 self) - (set! (-> s5-0 y) f30-0) - (vector-reset! (-> gp-0 transv)) + (when (find-ground + gp-0 + s4-0 + (collide-spec backgnd crate obstacle hit-by-others-list pusher) + 4096.0 + 81920.0 + 1024.0 + (the-as process #f) ) + (let ((f30-0 (+ (-> gp-0 gspot-pos y) (-> self root root-prim local-sphere w)))) + (when (>= f30-0 (-> s5-0 y)) + (projectile-bounce-method-43 self) + (set! (-> s5-0 y) f30-0) + (vector-reset! (-> gp-0 transv)) ) ) ) diff --git a/goal_src/jak3/engine/common-obs/vent.gc b/goal_src/jak3/engine/common-obs/vent.gc index e0415c0fd4..58c4887567 100644 --- a/goal_src/jak3/engine/common-obs/vent.gc +++ b/goal_src/jak3/engine/common-obs/vent.gc @@ -340,7 +340,7 @@ ) ) :trans (behavior () - (if (not (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (if (not (logtest? (the-as game-feature (logand (game-feature lighteco) (-> *setting-control* user-current features))) (-> *game-info* features) ) ) @@ -389,7 +389,7 @@ (defstate close (light-eco-vent) :virtual #t :trans (behavior () - (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (if (logtest? (the-as game-feature (logand (game-feature lighteco) (-> *setting-control* user-current features))) (-> *game-info* features) ) (go-virtual open #f) @@ -462,7 +462,7 @@ (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-light" (-> this root trans) 0.0)) (set-falloff-far! (-> this sound) 81920.0) (set-falloff-mode! (-> this sound) 9) - (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (if (logtest? (the-as game-feature (logand (game-feature lighteco) (-> *setting-control* user-current features))) (-> *game-info* features) ) (go (method-of-object this open) #t) @@ -542,7 +542,7 @@ ) ) :trans (behavior () - (if (not (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (if (not (logtest? (the-as game-feature (logand (game-feature darkeco) (-> *setting-control* user-current features))) (-> *game-info* features) ) ) @@ -591,7 +591,7 @@ (defstate close (dark-eco-vent) :virtual #t :trans (behavior () - (if (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (if (logtest? (the-as game-feature (logand (game-feature darkeco) (-> *setting-control* user-current features))) (-> *game-info* features) ) (go-virtual open #f) diff --git a/goal_src/jak3/engine/common-obs/voicebox.gc b/goal_src/jak3/engine/common-obs/voicebox.gc index de7d26c7fb..6183d58960 100644 --- a/goal_src/jak3/engine/common-obs/voicebox.gc +++ b/goal_src/jak3/engine/common-obs/voicebox.gc @@ -140,7 +140,7 @@ ) (vector-float*! v1-16 a0-9 (/ 1.0 f0-2)) ) - (sparticle-launch-control-method-18 (-> this part) (-> this node-list data 3)) + (spawn-from-cspace (-> this part) (-> this node-list data 3)) ) 0 (none) diff --git a/goal_src/jak3/engine/common-obs/warp-gate.gc b/goal_src/jak3/engine/common-obs/warp-gate.gc index 4b86acb175..a78fa3d8e2 100644 --- a/goal_src/jak3/engine/common-obs/warp-gate.gc +++ b/goal_src/jak3/engine/common-obs/warp-gate.gc @@ -1195,8 +1195,8 @@ (* 450.56 (cos (* 42.25403 (the float (mod (current-time) 1551))))) ) ) - (sparticle-launch-control-method-18 (-> self part-exhaust-left) (joint-node air-train-lod0-jg thruster_l)) - (sparticle-launch-control-method-18 (-> self part-exhaust-right) (joint-node air-train-lod0-jg thruster_r)) + (spawn-from-cspace (-> self part-exhaust-left) (joint-node air-train-lod0-jg thruster_l)) + (spawn-from-cspace (-> self part-exhaust-right) (joint-node air-train-lod0-jg thruster_r)) (let ((f0-9 (-> self dust-y))) (when (!= f0-9 (the-as float #x7f800000)) (let ((a1-2 (new 'stack-no-clear 'vector))) diff --git a/goal_src/jak3/engine/common-obs/water-part.gc b/goal_src/jak3/engine/common-obs/water-part.gc index 6cc41bd32a..cfbcff6733 100644 --- a/goal_src/jak3/engine/common-obs/water-part.gc +++ b/goal_src/jak3/engine/common-obs/water-part.gc @@ -5,5 +5,734 @@ ;; name in dgo: water-part ;; dgos: GAME +(define-extern *range-wsplash-color* curve-color-fast) +(define-extern *range-wsplash-alpha* curve2d-fast) +(define-extern *range-wsplash-scale-x* curve2d-fast) +(define-extern *range-wsplash-scale-y* curve2d-fast) +(define-extern *curve-wsplash-alpha* curve2d-fast) +(define-extern *curve-wsplash-scale-x* curve2d-fast) +(define-extern *curve-wsplash-scale-y* curve2d-fast) +(define-extern *part-water-splash-curve-settings* particle-curve-settings) +(define-extern *range-splash-color* curve-color-fast) +(define-extern *range-splash-alpha* curve2d-fast) +(define-extern *range-splash-scale-x* curve2d-fast) +(define-extern *range-splash-scale-y* curve2d-fast) +(define-extern *curve-splash-alpha* curve2d-fast) +(define-extern *curve-splash-scale-x* curve2d-fast) +(define-extern *curve-splash-scale-y* curve2d-fast) +(define-extern *part-water-splash-center-curve-settings* particle-curve-settings) +(define-extern *curve-wsplash-small-scale-x* curve2d-fast) +(define-extern *curve-wsplash-small-scale-y* curve2d-fast) +(define-extern *part-water-splash-small-curve-settings* particle-curve-settings) + ;; DECOMP BEGINS +(defpart 756 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.1) + (:x (meters -0.25) (meters 0.5)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters 0) (meters 0.006666667)) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'check-water-level-above-and-die) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 757 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.1) + (:x (meters -0.25) (meters 0.5)) + (:y (meters 0.15)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters 0) (meters 0.006666667)) + (:accel-y (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'check-water-level-above-and-die) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 758 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.05) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.005) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.04 -0.04) + (:timer (seconds 2.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 759 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.06) + (:x (meters 10)) + (:scale-x (meters 0.75) (meters 1.5)) + (:rot-y (degrees 0)) + (:scale-y (meters 0.75) (meters 1.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-x (meters 0.01) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004333333)) + (:scalevel-y (meters 0.0033333334) (meters 0.004333333)) + (:fade-a 0.000111111105) + (:friction 0.94) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.3)) + (:next-launcher 760) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 760 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.3) (seconds 0.397)) (:next-launcher 761)) + ) + +(defpart 761 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpart 762 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.05 0.4) + (:x (meters -0.75) (meters 1.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 0.2) (meters 0.7)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.0016666667) (meters 0.003)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 763) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 763 + :init-specs ((:fade-a 0.0) (:next-time (seconds 1.2)) (:next-launcher 764)) + ) + +(defpart 764 + :init-specs ((:fade-a -0.7111111)) + ) + +(defpartgroup group-part-water-splash + :id 192 + :duration (seconds 5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 765 :flags (sp7) :period (seconds 10) :length (seconds 0.2)) + (sp-item 766 :flags (sp7) :period (seconds 10) :length (seconds 0.067) :offset 125) + (sp-item 767 :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 768 :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.167) :offset 125) + (sp-item 769 :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.5) :offset 150) + (sp-item 770 :flags (sp7) :period (seconds 10) :length (seconds 0.167) :offset 20) + (sp-item 771 :flags (sp7) :period (seconds 10) :length (seconds 0.167) :offset 125) + ) + ) + +(defpart 765 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.016666668)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-wsplash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 158.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 0.5 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 2.0 :z 0.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y -5.0000005 :z -1.6666666 :w 1.0) + ) + ) + ) + +(define *part-water-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.95) :lifetime-offset (seconds 0.1)) + ) + +(set! (-> *part-id-table* 765 init-specs 13 initial-valuef) (the-as float *part-water-splash-curve-settings*)) + +(set! (-> *part-water-splash-curve-settings* color-start) *range-wsplash-color*) + +(set! (-> *part-water-splash-curve-settings* alpha-start) *range-wsplash-alpha*) + +(set! (-> *part-water-splash-curve-settings* scale-x-start) *range-wsplash-scale-x*) + +(set! (-> *part-water-splash-curve-settings* scale-y-start) *range-wsplash-scale-y*) + +(set! (-> *part-water-splash-curve-settings* r-scalar) #f) + +(set! (-> *part-water-splash-curve-settings* g-scalar) #f) + +(set! (-> *part-water-splash-curve-settings* b-scalar) #f) + +(set! (-> *part-water-splash-curve-settings* a-scalar) *curve-wsplash-alpha*) + +(set! (-> *part-water-splash-curve-settings* scale-x-scalar) *curve-wsplash-scale-x*) + +(set! (-> *part-water-splash-curve-settings* scale-y-scalar) *curve-wsplash-scale-y*) + +(defpart 766 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 2.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +(if #t + (set! *range-splash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 110.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -3.3333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 0.15 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -2.8333333 :y -0.21428573 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 3.0 :z 2.0) + :one-over-x-deltas (new 'static 'vector :x 6.0 :y -5.0000005 :z -6.6666665 :w 1.0) + ) + ) + ) + +(define *part-water-splash-center-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.8) :lifetime-offset (seconds 0.4)) + ) + +(set! (-> *part-id-table* 766 init-specs 11 initial-valuef) + (the-as float *part-water-splash-center-curve-settings*) + ) + +(set! (-> *part-water-splash-center-curve-settings* color-start) *range-splash-color*) + +(set! (-> *part-water-splash-center-curve-settings* alpha-start) *range-splash-alpha*) + +(set! (-> *part-water-splash-center-curve-settings* scale-x-start) *range-splash-scale-x*) + +(set! (-> *part-water-splash-center-curve-settings* scale-y-start) *range-splash-scale-y*) + +(set! (-> *part-water-splash-center-curve-settings* r-scalar) #f) + +(set! (-> *part-water-splash-center-curve-settings* g-scalar) #f) + +(set! (-> *part-water-splash-center-curve-settings* b-scalar) #f) + +(set! (-> *part-water-splash-center-curve-settings* a-scalar) *curve-splash-alpha*) + +(set! (-> *part-water-splash-center-curve-settings* scale-x-scalar) *curve-splash-scale-x*) + +(set! (-> *part-water-splash-center-curve-settings* scale-y-scalar) *curve-splash-scale-y*) + +(defpart 767 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.4) + (:scale-x (meters 2) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:scalevel-y (meters 0.01) (meters 0.0033333334)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + ) + ) + +(defpart 768 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0) (meters 0.1)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 0) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.00033333333) (meters 0.006666667)) + (:scalevel-y (meters 0.00033333333) (meters 0.006666667)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + ) + ) + +(defpart 770 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 10.0) + (:x (meters 0) (meters 1)) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 769 + :init-specs ((:texture (ripples level-default-sprite)) + (:num 0.5 1.0) + (:x (meters 1) (meters 5)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 771 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 2.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.026666667) (meters 0.026666667)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-part-water-splash-small + :id 193 + :duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 772 :period (seconds 10) :length (seconds 0.2)) + (sp-item 773 :flags (is-3d) :period (seconds 10) :length (seconds 0.067)) + (sp-item 774 :period (seconds 10) :length (seconds 0.167) :offset 20) + ) + ) + +(defpart 773 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.8) + (:scale-x (meters 0.5) (meters 0.2)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:scalevel-y (meters 0.01) (meters 0.0033333334)) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + ) + ) + +(defpart 774 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 5.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.006666667) (meters 0.016666668)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 772 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 4.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.01)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *curve-wsplash-small-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.3 :y 0.7 :z 1.7 :w 2.7) + :one-over-x-deltas (new 'static 'vector :x 0.39999998 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-wsplash-small-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 0.7 :z 0.2) + :one-over-x-deltas (new 'static 'vector :x 1.75 :y -1.6666667 :z -0.6666666 :w 1.0) + ) + ) + ) + +(define *part-water-splash-small-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.25) :lifetime-offset (seconds 0.1)) + ) + +(set! (-> *part-id-table* 772 init-specs 13 initial-valuef) + (the-as float *part-water-splash-small-curve-settings*) + ) + +(set! (-> *part-water-splash-small-curve-settings* color-start) *range-wsplash-color*) + +(set! (-> *part-water-splash-small-curve-settings* alpha-start) *range-wsplash-alpha*) + +(set! (-> *part-water-splash-small-curve-settings* scale-x-start) *range-wsplash-scale-x*) + +(set! (-> *part-water-splash-small-curve-settings* scale-y-start) *range-wsplash-scale-y*) + +(set! (-> *part-water-splash-small-curve-settings* r-scalar) #f) + +(set! (-> *part-water-splash-small-curve-settings* g-scalar) #f) + +(set! (-> *part-water-splash-small-curve-settings* b-scalar) #f) + +(set! (-> *part-water-splash-small-curve-settings* a-scalar) *curve-wsplash-alpha*) + +(set! (-> *part-water-splash-small-curve-settings* scale-x-scalar) *curve-wsplash-small-scale-x*) + +(set! (-> *part-water-splash-small-curve-settings* scale-y-scalar) *curve-wsplash-small-scale-y*) + +(defpart 775 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.16)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 10240.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 776 + :init-specs ((:fade-a -0.64)) + ) + +(defpart 777 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 12.0) + (:y (meters 0)) + (:scale-x (meters 0.08) (meters 0.03)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.05)) + (:accel-y (meters -0.005) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata -208896.0) + (:func 'check-water-level-drop-motion) + (:next-time (seconds 0) (seconds 0.58)) + (:next-launcher 41) + (:conerot-x (degrees 15) (degrees 65)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defpart 41 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 778)) + ) + +(defpart 778 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 779)) + ) + +(defpart 780 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32 -0.32) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 781 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 0.08) (meters 0.03)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 0.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.026666667) (meters 0.05)) + (:accel-y (meters -0.005) (meters -0.00066666666)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata -208896.0) + (:func 'check-water-level-drop-and-die-motion) + (:next-time (seconds 0) (seconds 0.33)) + (:next-launcher 41) + (:conerot-x (degrees 30) (degrees 40)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 782 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.15) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 0.0) + (:omega (degrees 0.0225) (degrees 0.0225)) + (:vel-x (meters -0.016666668) (meters 0.0016666667)) + (:vel-y (meters 0.016666668)) + (:vel-z (meters -0.016666668) (meters 0.0016666667)) + (:scalevel-x (meters -0.00016666666)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.001) (meters -0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'check-water-level-drop-motion) + (:next-time (seconds 2)) + (:next-launcher 783) + ) + ) diff --git a/goal_src/jak3/engine/common-obs/water.gc b/goal_src/jak3/engine/common-obs/water.gc index 18a8ef47eb..afe1d74b21 100644 --- a/goal_src/jak3/engine/common-obs/water.gc +++ b/goal_src/jak3/engine/common-obs/water.gc @@ -963,8 +963,9 @@ ) ) (dotimes (s1-2 (the-as int (+ arg3 -1))) - (set! (-> (the-as region-prim-area #x70000000) pos quad) (-> arg2 s1-2 sphere quad)) - (when (and (within-area? arg1 (the-as region-prim-area (+ #x70000000 0))) + ;; og:preserve-this + (set! (-> (scratchpad-object region-prim-area) pos quad) (-> arg2 s1-2 sphere quad)) + (when (and (within-area? arg1 (scratchpad-object region-prim-area)) (begin (logior! (-> arg0 flags) (water-flag over-water)) (>= (-> arg0 trans y) (- (-> arg2 s1-2 sphere y) (-> arg2 s1-2 sphere r))) @@ -992,9 +993,10 @@ (set! (-> arg1 flags) (water-flag)) (set! (-> arg1 handle) (the-as handle #f)) (set! (-> arg2 extra-flags) (the-as uint 0)) - (set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0) - (set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0) - (set! (-> (the-as region-prim-area #x70000000) pos quad) (-> arg0 sphere quad)) + ;; og:preserve-this + (set! (-> (scratchpad-object region-prim-area) region-prim-list num-items) 0) + (set! (-> (scratchpad-object region-prim-area) region-inside-count) 0) + (set! (-> (scratchpad-object region-prim-area) pos quad) (-> arg0 sphere quad)) (dotimes (gp-0 (-> *level* length)) (let ((v1-7 (-> *level* level gp-0))) (when (= (-> v1-7 status) 'active) @@ -1008,9 +1010,10 @@ (if (= (-> a0-6 name) 'water) (collect-regions a0-6 - (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) + ;; og:preserve-this + (the-as sphere (-> (scratchpad-object region-prim-area) pos)) 0 - (the-as region-prim-list (+ #x70000000 0)) + (the-as region-prim-list (scratchpad-object region-prim-area)) ) ) (+! s3-0 1) @@ -1022,17 +1025,19 @@ ) ) ) - (return (nonzero? (-> (the-as region-prim-area #x70000000) region-prim-list num-items))) + ;; og:preserve-this + (return (nonzero? (-> (scratchpad-object region-prim-area) region-prim-list num-items))) v0-1 ) (defun find-water-2 ((arg0 (inline-array water-sphere)) (arg1 int) (arg2 water-info) (arg3 water-info) (arg4 process-drawable)) (set! (-> arg2 prim) #f) (set! (-> arg3 prim) #f) - (countdown (s1-0 (-> (the-as region-prim-area #x70000000) region-prim-list num-items)) + ;; og:preserve-this + (countdown (s1-0 (-> (scratchpad-object region-prim-area) region-prim-list num-items)) (water-info<-region arg3 - (-> (the-as region-prim-area #x70000000) region-prim-list items s1-0) + (-> (scratchpad-object region-prim-area) region-prim-list items s1-0) arg0 (the-as collide-action arg1) arg4 diff --git a/goal_src/jak3/engine/data/art-h.gc b/goal_src/jak3/engine/data/art-h.gc index 3846c5770d..01c933fa79 100644 --- a/goal_src/jak3/engine/data/art-h.gc +++ b/goal_src/jak3/engine/data/art-h.gc @@ -486,4 +486,4 @@ Each process-drawable has a draw-control." ) (import "goal_src/jak3/engine/data/art-elts.gc") -;; (import "goal_src/jak3/engine/data/joint-nodes.gc") +(import "goal_src/jak3/engine/data/joint-nodes.gc") diff --git a/goal_src/jak3/engine/debug/anim-tester.gc b/goal_src/jak3/engine/debug/anim-tester.gc index 77b7329d1a..32f710d826 100644 --- a/goal_src/jak3/engine/debug/anim-tester.gc +++ b/goal_src/jak3/engine/debug/anim-tester.gc @@ -5,5 +5,168 @@ ;; name in dgo: anim-tester ;; dgos: GAME +(define-extern anim-tester-start (function symbol)) + ;; DECOMP BEGINS +(deftype list-control (structure) + ((listfunc (function int list-control symbol) :offset-assert 0) ;; guessed by decompiler + (list-owner uint32 :offset-assert 4) + (top int32 :offset-assert 8) + (left int32 :offset-assert 12) + (list glst-list :offset-assert 16) + (the-node glst-node :offset-assert 20) + (top-index int32 :offset-assert 24) + (the-index int32 :offset-assert 28) + (the-disp-line int32 :offset-assert 32) + (highlight-index int32 :offset-assert 36) + (current-index int32 :offset-assert 40) + (numlines int32 :offset-assert 44) + (lines-to-disp int32 :offset-assert 48) + (charswide int32 :offset-assert 52) + (highlight-disp-line int32 :offset-assert 56) + (field-id int32 :offset-assert 60) + (xpos int32 :offset-assert 64) + (ypos int32 :offset-assert 68) + (user-info int32 :offset-assert 72) + (return-int int32 :offset-assert 76) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype list-field (structure) + ((left int32 :offset-assert 0) + (width int32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype DISP_LIST-bank (basic) + ((V_SPACING int32 :offset-assert 4) + (BORDER_WIDTH int32 :offset-assert 8) + (BORDER_HEIGHT int32 :offset-assert 12) + (MAX_LINES int32 :offset-assert 16) + (CHAR_WIDTH int32 :offset-assert 20) + (INC_DELAY int32 :offset-assert 24) + (BORDER_LINES int32 :offset-assert 28) + (CXOFF int32 :offset-assert 32) + (CYOFF int32 :offset-assert 36) + (BXOFF int32 :offset-assert 40) + (BYOFF int32 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype anim-tester-bank (basic) + ((ANIM_SPEED float :offset-assert 4) + (BLEND float :offset-assert 8) + (OBJECT_LIST_X int32 :offset-assert 12) + (OBJECT_LIST_Y int32 :offset-assert 16) + (OBJECT_LIST_MIN_WIDTH int32 :offset-assert 20) + (ANIM_LIST_X int32 :offset-assert 24) + (ANIM_LIST_Y int32 :offset-assert 28) + (ANIM_LIST_MIN_WIDTH int32 :offset-assert 32) + (PICK_LIST_X int32 :offset-assert 36) + (PICK_LIST_Y int32 :offset-assert 40) + (PICK_LIST_MIN_WIDTH int32 :offset-assert 44) + (EDIT_LIST_X int32 :offset-assert 48) + (EDIT_LIST_Y int32 :offset-assert 52) + (EDIT_STATS_X int32 :offset-assert 56) + (EDIT_LIST_MIN_WIDTH int32 :offset-assert 60) + (EDIT_PICK_X int32 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +(defenum anim-tester-flags + :bitfield #t + :type int32 + (fanimt0) + (fanimt1) + (fanimt2) + (fanimt3) + (fanimt4) + (fanimt5) + ) + +(deftype anim-tester (process-focusable) + ((flags anim-tester-flags :offset-assert 208) + (obj-list glst-list :inline :offset-assert 212) + (current-obj string :offset-assert 228) + (speed int32 :offset-assert 232) + (list-con list-control :inline :offset-assert 236) + (pick-con list-control :inline :offset-assert 316) + (item-field int64 :offset-assert 400) + (inc-delay int32 :offset-assert 408) + (inc-timer int32 :offset-assert 412) + (edit-mode int32 :offset-assert 416) + (old-mode int32 :offset-assert 420) + (anim-speed float :offset-assert 424) + (anim-gspeed float :offset-assert 428) + (anim-first float :offset-assert 432) + (anim-last float :offset-assert 436) + ) + :method-count-assert 28 + :size-assert #x1b8 + :heap-base #x140 + :flag-assert #x1c014001b8 + (:states + anim-tester-process + ) + ) + +(deftype anim-test-obj (glst-named-node) + ((obj-art-group basic :offset-assert 12) + (seq-list glst-list :inline :offset-assert 16) + (flags int32 :offset-assert 32) + (mesh-geo basic :offset-assert 36) + (joint-geo basic :offset-assert 40) + (list-con list-control :inline :offset-assert 44) + (parent uint32 :offset-assert 124) + (anim-index int32 :offset-assert 128) + (anim-hindex int32 :offset-assert 132) + (seq-index int32 :offset-assert 136) + (seq-hindex int32 :offset-assert 140) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) + +(deftype anim-test-sequence (glst-named-node) + ((item-list glst-list :inline :offset-assert 12) + (playing-item int32 :offset-assert 28) + (flags int32 :offset-assert 32) + (list-con list-control :inline :offset-assert 36) + (parent anim-test-obj :offset-assert 116) + ) + :method-count-assert 9 + :size-assert #x78 + :flag-assert #x900000078 + ) + +(deftype anim-test-seq-item (glst-named-node) + ((speed int32 :offset-assert 12) + (blend int32 :offset-assert 16) + (first-frame float :offset-assert 20) + (last-frame float :offset-assert 24) + (num-frames float :offset-assert 28) + (artist-base float :offset-assert 32) + (flags int32 :offset-assert 36) + (parent anim-test-sequence :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(define-extern *anim-tester* (pointer anim-tester)) \ No newline at end of file diff --git a/goal_src/jak3/engine/debug/bug-report.gc b/goal_src/jak3/engine/debug/bug-report.gc index 9a9dc9d0dd..b56f7912e6 100644 --- a/goal_src/jak3/engine/debug/bug-report.gc +++ b/goal_src/jak3/engine/debug/bug-report.gc @@ -5,5 +5,383 @@ ;; name in dgo: bug-report ;; dgos: GAME +(declare-type bug-report process) + +(define-extern *bug-report* (pointer bug-report)) + ;; DECOMP BEGINS +;; og:preserve-this this file was manually rewritten +(declare-file (debug)) + +(define *continue-bug-report* + (new 'static 'continue-point + :name "wasall-start" + :level #f + :flags (continue-flags continue-flag-16) + :trans (new 'static 'vector :x 9283373.0 :y 126422.22 :z 1057314.9 :w 1.0) + :camera-trans (new 'static 'vector :x 9272728.0 :y 147014.05 :z 1009150.4 :w 1.0) + :quat (new 'static 'vector4h :data (new 'static 'array int16 4 -36 #x5dfc 22 #x56de)) + :camera-rot (new 'static 'array int16 9 #x796a 0 -10364 #x4b5 #x7f20 #xe21 #x2834 -3810 #x7899) + :on-goto #f + :vis-nick 'wasall + :vehicle-type #x1b + :want-count 4 + :want (new 'static 'inline-array level-buffer-state-small 4 + (new 'static 'level-buffer-state-small :name 'wasall :display? 'special) + (new 'static 'level-buffer-state-small :name 'desert-game :display? 'display) + (new 'static 'level-buffer-state-small :name 'wasdoors :display? 'display) + (new 'static 'level-buffer-state-small :name 'desertb :display? 'display) + ) + :want-sound (new 'static 'array symbol 3 'wasall1 'desert1 'desert2) + ) + ) + +(deftype bug-report (process) + ((bug-number uint32 5) + (digit uint32) + (state-time time-frame) + (next-down time-frame) + ) + (:state-methods + idle + ) + (:methods + (bug-report-method-15 (_type_) none) + (bug-report-method-16 (_type_) none) + ) + ) + +(define *bug-report* (the (pointer bug-report) #f)) + +(defmethod inspect ((this bug-report)) + (call-parent-method this) + (format #t "~2Tbug-number[5] @ #x~X~%" (-> this bug-number)) + (dotimes (i 5) + (format #t "~T [~D]~2Tbug-number: ~D~%" i (-> this bug-number i)) + ) + (format #t "~2Tdigit: ~D~%" (-> this digit)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tnext-down: ~D~%" (-> this next-down)) + this + ) + +(defmethod deactivate ((this bug-report)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (set! *bug-report* (the (pointer bug-report) #f)) + (call-parent-method this) + ) + +(defbehavior bug-report-init bug-report () + (set! *bug-report* (the (pointer bug-report) (process->ppointer self))) + (set! (-> self bug-number 0) (the-as uint 0)) + (set! (-> self bug-number 1) (the-as uint 0)) + (set! (-> self bug-number 2) (the-as uint 0)) + (set! (-> self bug-number 3) (the-as uint 0)) + (set! (-> self bug-number 4) (the-as uint 0)) + (set! (-> self digit) (the-as uint 0)) + (set! (-> self next-down) 0) + (go-virtual idle) + ) + +(defun bug-report-stop () + (kill-by-type bug-report *active-pool*) + (none) + ) + +(defun bug-report-start () + (bug-report-stop) + (process-spawn bug-report :init bug-report-init :name "bug-report") + (none) + ) + +(defstate idle (bug-report) + :virtual #t + :enter (behavior () (set-time! (-> self state-time))) + :code sleep-code + :trans (behavior () + (when (cpad-hold? 0 l2) + (when (>= (- (current-time) (-> self next-down)) 0) + (when (cpad-hold? 0 left) + (set! (-> self next-down) (+ (current-time) (seconds 0.2))) + (if (zero? (-> self digit)) + (set! (-> self digit) (the-as uint 4)) + (+! (-> self digit) -1) + ) + ) + (when (cpad-hold? 0 right) + (set! (-> self next-down) (+ (current-time) (seconds 0.2))) + (cond + ((= (-> self digit) 4) + (set! (-> self digit) (the-as uint 0)) + 0 + ) + (else + (+! (-> self digit) 1) + ) + ) + ) + (when (cpad-hold? 0 up) + (set! (-> self next-down) (+ (current-time) (seconds 0.2))) + (cond + ((= (-> self bug-number (-> self digit)) 9) + (set! (-> self bug-number (-> self digit)) (the-as uint 0)) + 0 + ) + (else + (+! (-> self bug-number (-> self digit)) 1) + ) + ) + ) + (when (cpad-hold? 0 down) + (set! (-> self next-down) (+ (current-time) (seconds 0.2))) + (if (zero? (-> self bug-number (-> self digit))) + (set! (-> self bug-number (-> self digit)) (the-as uint 9)) + (+! (-> self bug-number (-> self digit)) -1) + ) + ) + ) + (if (cpad-pressed? 0 x) + (bug-report-method-16 self) + ) + 0 + ) + (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (bucket-id hud-draw-hud-alpha) + ) + (draw-string-xy "Use L2 + X to Load" s5-0 32 80 (font-color white) (font-flags kerning)) + (draw-string-xy "Use L2 + D-Pad to change bug number" s5-0 32 112 (font-color white) (font-flags kerning)) + (dotimes (s4-0 5) + (let ((s3-0 (clear *temp-string*))) + (format s3-0 "~1,'0D" (-> self bug-number s4-0)) + (draw-string-xy + s3-0 + s5-0 + (+ (* 24 s4-0) 32) + 132 + (if (= (-> self digit) s4-0) + (font-color red) + (font-color yellow) + ) + (font-flags kerning large) + ) + ) + ) + ) + ) + ) + +(defmethod bug-report-method-15 ((this bug-report)) + (if (not *target*) + (return #f) + ) + (let ((a0-1 (-> *target* control)) + (s5-0 *continue-bug-report*) + ) + (set! (-> s5-0 trans quad) (-> a0-1 trans quad)) + (set-vector! + (-> s5-0 quat) + (the int (* 32767.0 (-> a0-1 quat x))) + (the int (* 32767.0 (-> a0-1 quat y))) + (the int (* 32767.0 (-> a0-1 quat z))) + (the int (* 32767.0 (-> a0-1 quat w))) + ) + (let ((v1-6 *math-camera*)) + (set! (-> s5-0 camera-trans quad) (-> v1-6 trans quad)) + (set! (-> s5-0 camera-rot 0) (the int (* 32767.0 (-> v1-6 inv-camera-rot rvec x)))) + (set! (-> s5-0 camera-rot 1) (the int (* 32767.0 (-> v1-6 inv-camera-rot rvec y)))) + (set! (-> s5-0 camera-rot 2) (the int (* 32767.0 (-> v1-6 inv-camera-rot rvec z)))) + (set! (-> s5-0 camera-rot 3) (the int (* 32767.0 (-> v1-6 inv-camera-rot uvec x)))) + (set! (-> s5-0 camera-rot 4) (the int (* 32767.0 (-> v1-6 inv-camera-rot uvec y)))) + (set! (-> s5-0 camera-rot 5) (the int (* 32767.0 (-> v1-6 inv-camera-rot uvec z)))) + (set! (-> s5-0 camera-rot 6) (the int (* 32767.0 (-> v1-6 inv-camera-rot fvec x)))) + (set! (-> s5-0 camera-rot 7) (the int (* 32767.0 (-> v1-6 inv-camera-rot fvec y)))) + (set! (-> s5-0 camera-rot 8) (the int (* 32767.0 (-> v1-6 inv-camera-rot fvec z)))) + ) + (dotimes (s4-0 4) + (let ((v1-10 (lookup-level-info (-> *load-state* want s4-0 name)))) + (cond + ((and v1-10 (!= (-> v1-10 memory-mode) 10)) + (set! (-> s5-0 want s4-0 name) (-> *load-state* want s4-0 name)) + (set! (-> s5-0 want s4-0 display?) (-> *load-state* want s4-0 display?)) + ) + (else + (set! (-> s5-0 want s4-0 name) #f) + (set! (-> s5-0 want s4-0 display?) #f) + ) + ) + ) + ) + ) + (format + (clear *temp-string*) + "db/bug-report/bug-report-~D~D~D~D~D.txt" + (-> this bug-number 0) + (-> this bug-number 1) + (-> this bug-number 2) + (-> this bug-number 3) + (-> this bug-number 4) + ) + *temp-string* + (let ((gp-1 (new 'stack 'file-stream *temp-string* 'write))) + (let ((s5-2 format) + (s4-1 gp-1) + (s3-0 "nick ~S~%") + (v1-29 (lookup-level-info (-> *load-state* vis-nick))) + ) + (s5-2 s4-1 s3-0 (if v1-29 + (-> v1-29 name) + ) + ) + ) + (let ((t9-6 format) + (a0-37 gp-1) + (a1-16 "continue ~S~%") + (v1-31 (-> *game-info* current-continue)) + ) + (t9-6 a0-37 a1-16 (if v1-31 + (-> v1-31 name) + ) + ) + ) + (dotimes (s5-3 10) + (format gp-1 "level ~D ~A ~A~%" s5-3 (-> *load-state* want s5-3 name) (-> *load-state* want s5-3 display?)) + ) + (format gp-1 "music ~-8S~%" (-> *setting-control* user-current music)) + (dotimes (s5-4 6) + (format gp-1 "sound ~D ~-8S~%" s5-4 (-> *level* sound-bank s5-4 name)) + ) + (let ((v1-43 (target-pos 0))) + (format gp-1 "target ~f ~f ~f~%" (-> v1-43 x) (-> v1-43 y) (-> v1-43 z)) + ) + (let ((s5-5 *math-camera*)) + (format gp-1 "camera-trans ~f ~f ~f~%" (-> s5-5 trans x) (-> s5-5 trans y) (-> s5-5 trans z)) + (format + gp-1 + "camera-rot ~f ~f ~f " + (-> s5-5 inv-camera-rot rvec x) + (-> s5-5 inv-camera-rot rvec y) + (-> s5-5 inv-camera-rot rvec z) + ) + (format + gp-1 + "~f ~f ~f " + (-> s5-5 inv-camera-rot uvec x) + (-> s5-5 inv-camera-rot uvec y) + (-> s5-5 inv-camera-rot uvec z) + ) + (format + gp-1 + "~f ~f ~f~%" + (-> s5-5 inv-camera-rot fvec x) + (-> s5-5 inv-camera-rot fvec y) + (-> s5-5 inv-camera-rot fvec z) + ) + ) + (let ((s5-6 (-> *game-info* sub-task-list))) + (dotimes (s4-2 (-> s5-6 length)) + (when (nonzero? s4-2) + (let ((s3-1 (-> s5-6 s4-2))) + (if (game-task-node-info-method-12 s3-1) + (format gp-1 "open-node ~s~%" (-> s3-1 name)) + ) + ) + ) + ) + ) + (file-stream-close gp-1) + (file-stream-close gp-1) + ) + (none) + ) + +(defmethod bug-report-method-16 ((this bug-report)) + (local-vars + (sv-128 string) + (sv-132 string) + (sv-136 continue-point) + (sv-140 int) + (sv-144 vector) + (sv-148 vector) + ) + (format + (clear *temp-string*) + "db/bug-report/bug-report-~D~D~D~D~D.txt" + (-> this bug-number 0) + (-> this bug-number 1) + (-> this bug-number 2) + (-> this bug-number 3) + (-> this bug-number 4) + ) + *temp-string* + (let ((gp-1 (new 'stack 'file-stream *temp-string* 'read))) + (when (zero? (-> gp-1 file)) + (set! sv-128 (new 'debug 'string 1024 (the-as string #f))) + (set! sv-132 (new 'debug 'string 64 (the-as string #f))) + (set! sv-136 *continue-bug-report*) + (set! sv-140 0) + (set! sv-144 (new 'stack-no-clear 'vector)) + (set! sv-148 (new 'stack-no-clear 'vector)) + (file-stream-read-string gp-1 sv-128) + (while (string-get-arg!! sv-132 sv-128) + (cond + ((string= "nick" sv-132) + (string-get-arg!! sv-132 sv-128) + ) + ((string= "continue" sv-132) + (string-get-arg!! sv-132 sv-128) + ) + ((string= "level" sv-132) + (string-get-int32!! (the-as (pointer int32) (& sv-140)) sv-128) + (string-get-arg!! sv-132 sv-128) + (set! (-> sv-136 want sv-140 name) (string->symbol sv-132)) + (string-get-arg!! sv-132 sv-128) + (set! (-> sv-136 want sv-140 display?) (string->symbol sv-132)) + ) + ((string= "music" sv-132) + (string-get-arg!! sv-132 sv-128) + ) + ((string= "target" sv-132) + (string-get-float!! (the-as (pointer float) (-> sv-136 trans)) sv-128) + (string-get-float!! (&-> sv-136 trans y) sv-128) + (string-get-float!! (&-> sv-136 trans z) sv-128) + ) + ((string= "camera-trans" sv-132) + (string-get-float!! (the-as (pointer float) (-> sv-136 camera-trans)) sv-128) + (string-get-float!! (&-> sv-136 camera-trans y) sv-128) + (string-get-float!! (&-> sv-136 camera-trans z) sv-128) + ) + ((string= "camera-rot" sv-132) + (let ((s5-1 (new 'stack-no-clear 'array 'float 9))) + (string-get-float!! (&-> s5-1 0) sv-128) + (string-get-float!! (&-> s5-1 1) sv-128) + (string-get-float!! (&-> s5-1 2) sv-128) + (string-get-float!! (&-> s5-1 3) sv-128) + (string-get-float!! (&-> s5-1 4) sv-128) + (string-get-float!! (&-> s5-1 5) sv-128) + (string-get-float!! (&-> s5-1 6) sv-128) + (string-get-float!! (&-> s5-1 7) sv-128) + (string-get-float!! (&-> s5-1 8) sv-128) + (dotimes (v1-34 9) + (set! (-> sv-136 camera-rot v1-34) (the int (* 32767.0 (-> s5-1 v1-34)))) + ) + ) + ) + ((string= "open-node" sv-132) + (string-get-arg!! sv-132 sv-128) + (let ((a0-48 (task-node-index-by-name sv-132))) + (if a0-48 + (task-node-open! (the-as game-task-node a0-48) 'menu) + ) + ) + ) + ) + ) + (file-stream-close gp-1) + (stop 'debug) + (start 'debug *continue-bug-report*) + ) + (file-stream-close gp-1) + ) + (none) + ) diff --git a/goal_src/jak3/engine/debug/debug-part.gc b/goal_src/jak3/engine/debug/debug-part.gc index dc04dbd0ad..3ee03d8121 100644 --- a/goal_src/jak3/engine/debug/debug-part.gc +++ b/goal_src/jak3/engine/debug/debug-part.gc @@ -5,5 +5,1844 @@ ;; name in dgo: debug-part ;; dgos: GAME +(define-extern hud-money type) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(defpart 537 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 64.0) + (:rotvel-z (degrees 0.3)) + (:fade-a -1.6) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-red-eco-strike-ground + :id 152 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 538) (sp-item 539)) + ) + +(defpart 538 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 24.0) + (:y (meters 1)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 32.0) + (:a 8.0 56.0) + (:vel-y (meters 0.13333334) (meters 0.16666667)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.4222223) + (:fade-a -0.35555556) + (:accel-y (meters 0.00008333333)) + (:friction 0.7) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.3)) + (:next-launcher 540) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 539 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 32.0) + (:y (meters 1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:a 64.0 8.0) + (:vel-y (meters 0.3)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.8444445) + (:fade-a -0.82222223) + (:friction 0.7) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 540) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-red-eco-spinkick + :id 153 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 541) (sp-item 542) (sp-item 543 :flags (sp6))) + ) + +(defpart 541 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 32.0) + (:a 8.0 56.0) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.4222223) + (:fade-a -0.35555556) + (:accel-y (meters 0.00008333333)) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.3)) + (:next-launcher 540) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 540 + :init-specs ((:fade-r -0.7111111) (:fade-g 0.7111111) (:fade-b 0.35555556)) + ) + +(defpart 542 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.66) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:a 64.0 8.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.8444445) + (:fade-a -0.82222223) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 540) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +(defpart 543 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0) + (:a 64.0) + (:fade-a -4.0) + (:accel-y (meters 0.00008333333)) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-eco-blue + :id 154 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 550 :flags (sp3) :binding 544) + (sp-item 544 :fade-after (meters 40) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 60) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 80) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 100) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 130) :flags (sp2 sp3) :binding 545) + (sp-item 544 :flags (sp2 sp3) :binding 545) + (sp-item 545 :flags (sp2 sp3) :binding 546) + (sp-item 545 :flags (sp2 sp3) :binding 547) + (sp-item 545 :flags (sp2 sp3) :binding 548) + (sp-item 545 :flags (sp2 sp3) :binding 546) + (sp-item 545 :flags (sp2 sp3) :binding 547) + (sp-item 545 :flags (sp2 sp3) :binding 548) + (sp-item 546 :fade-after (meters 60) :flags (sp2) :binding 549) + (sp-item 547 :fade-after (meters 70) :flags (sp2) :binding 549) + (sp-item 548 :fade-after (meters 80) :flags (sp2) :binding 549) + (sp-item 546 :fade-after (meters 90) :flags (sp2) :binding 549) + (sp-item 547 :fade-after (meters 100) :flags (sp2) :binding 549) + (sp-item 548 :fade-after (meters 100) :flags (sp2) :binding 549) + (sp-item 549 :flags (sp2)) + ) + ) + +(defpart 550 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 544 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.15)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 32.0 96.0) + (:b 128.0 128.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 551) + ) + ) + +(defpart 551 + :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5))) + ) + +(defpart 545 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.1)) + (:scale-x (meters 0.8) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0) + (:b 192.0) + (:a 32.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 269.52002) (degrees 208.99998)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 552) + ) + ) + +(defpart 552 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +(defpart 546 + :init-specs ((:texture (common-white common)) + (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 547 + :init-specs ((:texture (common-white common)) + (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 548 + :init-specs ((:texture (common-white common)) + (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 549 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.2 0.2) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 192.0) + (:a 96.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-eco-blue-collect + :id 155 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 558 :flags (sp3) :binding 554) + (sp-item 554 :flags (sp2 sp3) :binding 555) + (sp-item 554 :flags (sp2 sp3) :binding 556) + (sp-item 554 :flags (sp2 sp3) :binding 555) + (sp-item 554 :flags (sp2 sp3) :binding 556) + (sp-item 554 :flags (sp2 sp3) :binding 557) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 558 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0) + (:b 192.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +(defpart 554 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.75) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 555 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 556 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 557 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpartgroup group-part-vent-blue-active + :id 156 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 562 :fade-after (meters 140) :falloff-to (meters 140) :binding 559) + (sp-item 562 :fade-after (meters 140) :falloff-to (meters 140) :binding 560) + (sp-item 562 :fade-after (meters 140) :falloff-to (meters 140) :binding 561) + (sp-item 563) + (sp-item 564 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 565 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 566 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 561 :fade-after (meters 30) :falloff-to (meters 30) :flags (sp2)) + (sp-item 560 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp2)) + (sp-item 559 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp2)) + (sp-item 561 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp2)) + (sp-item 560 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp2)) + (sp-item 559 :fade-after (meters 110) :falloff-to (meters 110) :flags (sp2)) + (sp-item 561 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp2)) + (sp-item 560 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp2)) + ) + ) + +(defpartgroup group-part-vent-blue-inactive + :id 157 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 562 :fade-after (meters 100)) (sp-item 563)) + ) + +(defpart 563 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.1 1.0) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.5) (meters 1.4)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 192.0) + (:a 64.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:fade-a -0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 562 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.05 0.1) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.5) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 192.0) + (:a 96.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 559 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 560 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 561 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 564 + :init-specs ((:texture (common-white common)) + (:num 0.1 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 565 + :init-specs ((:texture (common-white common)) + (:num 0.2 0.4) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 566 + :init-specs ((:texture (common-white common)) + (:num 0.3 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +(defpart 553 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.0) (:fade-g -1.0) (:fade-a -2.0)) + ) + +(defpartgroup group-eco-red + :id 158 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 571 :flags (sp3) :binding 567) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 568 :flags (sp2 sp3) :binding 569) + (sp-item 568 :flags (sp2 sp3) :binding 569) + (sp-item 568 :flags (sp2 sp3) :binding 569) + (sp-item 569 :fade-after (meters 100) :flags (sp2 sp3) :binding 570) + (sp-item 569 :fade-after (meters 100) :flags (sp2 sp3) :binding 570) + (sp-item 569 :fade-after (meters 100) :flags (sp2 sp3) :binding 570) + (sp-item 570 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 570 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 570 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + ) + ) + +(defpart 571 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 567 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.15) (meters 0.2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 572) + ) + ) + +(defpart 572 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +(defpart 568 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.25) (meters 0.1)) + (:scale-x (meters 0.6) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 573) + ) + ) + +(defpart 573 + :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5))) + ) + +(defpart 569 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.07) (meters 0.03)) + (:scale-x (meters 0.6) (meters 0.6)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:vel-x (meters 0.11259259)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 573) + ) + ) + +(defpart 570 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1 1.0) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.00038095238)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.1) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 574) + ) + ) + +(defpart 574 + :init-specs ((:fade-g 0.0)) + ) + +(defpartgroup group-eco-red-collect + :id 159 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 577 :flags (sp3) :binding 575) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 577 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +(defpart 575 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 576 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters -0.005555555)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.0) + (:fade-a -0.22857143) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.18)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 578) + ) + ) + +(defpartgroup group-part-vent-red-active + :id 160 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 582 :fade-after (meters 30) :period (seconds 1.1) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 90) :period (seconds 3.12) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 130) :period (seconds 1.76) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 170) :period (seconds 2.67) :length (seconds 0.017) :binding 579) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 50) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 60) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 70) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 80) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 583 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 584) + ) + ) + +(defpartgroup group-part-vent-red-inactive + :id 161 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 583 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 584)) + ) + +(defpart 584 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 583 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 582 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 1.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 579 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 580 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.25) (meters 0.1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 581 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters -0.0023809525)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.07619048) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.1) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 578) + ) + ) + +(defpart 578 + :init-specs ((:fade-g 0.0)) + ) + +(defpartgroup group-part-vent-yellow-active + :id 162 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 588 :fade-after (meters 40) :period (seconds 1.1) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 80) :period (seconds 3.12) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 100) :period (seconds 1.76) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 130) :period (seconds 2.67) :length (seconds 0.017) :binding 585) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 60) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 70) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 80) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 589 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 590) + ) + ) + +(defpartgroup group-part-vent-yellow-inactive + :id 163 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 589 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 590)) + ) + +(defpart 590 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 92.0 32.0) + (:g 32.0 92.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 589 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 588 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 1.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:timer (seconds 1.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 585 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 128.0) + (:vel-x (meters 0.10666667)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:fade-a -0.34133333) + (:timer (seconds 1.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 586 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.2)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 128.0) + (:vel-x (meters 0.11259259)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:fade-a -0.34133333) + (:timer (seconds 1.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 587 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5 2.0) + (:y (meters -0.05)) + (:scale-x (meters 0.4) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 64.0) + (:vel-y (meters 0.0023333333) (meters 0.0016666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.024242423) + (:accel-y (meters -0.000100000005) (meters -0.0003)) + (:friction 0.93) + (:timer (seconds 0.1) (seconds 0.697)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 591) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.05)) + ) + ) + +(defpart 591 + :init-specs ((:fade-r 0.0)) + ) + +(defpartgroup group-eco-yellow + :id 164 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 596 :flags (sp3) :binding 592) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + ) + ) + +(defpart 596 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 592 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.15) (meters 0.2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 597) + ) + ) + +(defpart 597 + :init-specs ((:fade-a -0.10666667) (:timer (seconds 0.5))) + ) + +(defpart 593 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.75) (meters 0.1)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 598) + ) + ) + +(defpart 598 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +(defpart 594 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.12) (meters 0.03)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:vel-x (meters 0.11259259)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 598) + ) + ) + +(defpart 595 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 599) + ) + ) + +(defpart 599 + :init-specs ((:fade-g 0.0)) + ) + +(defpartgroup group-eco-yellow-collect + :id 165 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 602 :flags (sp3) :binding 600) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + ) + ) + +(defpart 602 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +(defpart 600 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 601 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 599) + ) + ) + +(defpartgroup group-fuel-cell-starburst + :id 166 + :bounds (static-bspherem 0 0.5 0 1.5) + :parts ((sp-item 603 :fade-after (meters 35)) + (sp-item 604 :fade-after (meters 20)) + (sp-item 605 :flags (sp1 sp3)) + (sp-item 606 :flags (sp1 sp3)) + ) + ) + +(defpart 603 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.8)) + (:r 0.0 1 255.0) + (:g 0.0 1 255.0) + (:b 0.0 1 255.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 0.35555556) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.3)) + (:next-launcher 607) + ) + ) + +(defpart 607 + :init-specs ((:fade-a -0.53333336)) + ) + +(defpart 604 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.06) + (:scale-x (meters 2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2)) + (:r 0.0 1 255.0) + (:g 0.0 1 255.0) + (:b 0.0 1 255.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:fade-a 0.32) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.25)) + (:next-launcher 607) + ) + ) + +(defpart 605 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-z (degrees 0)) + (:scale-y (meters 3)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 64.0) + (:rotvel-z (degrees -0.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defpart 606 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +(defun sparticle-track-root-money ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-1 (-> arg1 key proc))) + (when (!= (-> v1-1 type) hud-money) + (let ((v1-3 (-> v1-1 root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (+ 2048.0 (-> v1-3 y))) + (set! (-> arg2 z) (-> v1-3 z)) + ) + ) + ) + 0 + (none) + ) + +(defpart 608 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.8)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 0.35555556) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.3)) + (:next-launcher 609) + ) + ) + +(defpart 609 + :init-specs ((:fade-a -0.53333336)) + ) + +(defpart 610 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.06) + (:scale-x (meters 2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:fade-a 0.32) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.25)) + (:next-launcher 609) + ) + ) + +(defpart 611 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-z (degrees 0)) + (:scale-y (meters 2)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 32.0) + (:rotvel-z (degrees -0.4)) + (:timer (seconds 12)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root-money) + ) + ) + +(defpart 612 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0)) + (:scale-y (meters 2.5)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 12)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root-money) + ) + ) + +(defpartgroup group-money-starburst :id 167 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 613))) + +(defpartgroup group-buzzer-effect :id 168 :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 249))) + +(defpartgroup group-blue-collect + :id 169 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 614) (sp-item 615) (sp-item 616)) + ) + +(defpart 614 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 615 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 616 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + +(defpartgroup group-yellow-collect + :id 170 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 617) (sp-item 618) (sp-item 619)) + ) + +(defpart 617 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 618 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 619 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + +(defpart 458 + :init-specs ((:scalevel-x (meters -0.025)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-red-collect + :id 171 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 620) (sp-item 621) (sp-item 622)) + ) + +(defpart 620 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 621 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +(defpart 622 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) diff --git a/goal_src/jak3/engine/debug/debug.gc b/goal_src/jak3/engine/debug/debug.gc index 250a7a505e..23346f1d79 100644 --- a/goal_src/jak3/engine/debug/debug.gc +++ b/goal_src/jak3/engine/debug/debug.gc @@ -1333,7 +1333,7 @@ (set! (-> gp-0 0 y) (* (cos (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (dotimes (s5-1 32) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket583) + (bucket-id debug) ) (draw-sprite2d-xy s3-0 @@ -1580,7 +1580,7 @@ ) (let ((s5-0 (the-as adgif-shader (-> arg1 base)))) (adgif-shader<-texture-simple! s5-0 a1-1) - (set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> s5-0 alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> s5-0 tex0 tfx) 0) (set! (-> s5-0 tex1 mmag) 0) (set! (-> s5-0 clamp) (new 'static 'gs-clamp)) diff --git a/goal_src/jak3/engine/debug/default-menu.gc b/goal_src/jak3/engine/debug/default-menu.gc index cd10f7e461..2b1b38164a 100644 --- a/goal_src/jak3/engine/debug/default-menu.gc +++ b/goal_src/jak3/engine/debug/default-menu.gc @@ -5,5 +5,7146 @@ ;; name in dgo: default-menu ;; dgos: GAME +(define-extern *ocean-map-sewer* ocean-map) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(define *debug-menu-context* (new 'debug 'debug-menu-context)) + +(define *dm-cam-mode-interpolation* 0) + +(defun dm-cam-mode-func ((arg0 (state camera-slave)) (arg1 debug-menu-msg)) + (if (and (= arg1 (debug-menu-msg press)) arg0) + (set-setting-by-param *setting-control* 'mode-name (-> arg0 name) 0 0) + ) + (if *camera* + (send-event *camera* 'query-state arg0) + (not arg0) + ) + ) + +(defun dm-cam-mode-default ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (remove-setting-by-arg0 *setting-control* 'mode-name) + ) + (not (get-setting *setting-control* 'mode-name)) + ) + +(defun dm-cam-settings-default ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (remove-setting-by-arg0 *setting-control* 'fov) + (remove-setting-by-arg0 *setting-control* 'slave-options) + ) + (and (not (get-setting *setting-control* 'fov)) (not (get-setting *setting-control* 'slave-options))) + ) + +(defun dm-cam-settings-func ((arg0 int) (arg1 debug-menu-msg)) + (when (and (= arg1 (debug-menu-msg press)) *camera*) + (cond + ((zero? arg0) + (send-event *camera* 'toggle-slave-option (cam-slave-options BUTT_CAM)) + ) + ((= arg0 1) + (send-event *camera* 'toggle-slave-option (cam-slave-options SAME_SIDE)) + ) + ((= arg0 2) + (send-event *camera* 'toggle-slave-option (cam-slave-options MOVE_SPHERICAL)) + ) + ((= arg0 3) + (send-event *camera* 'toggle-slave-option (cam-slave-options DRAG)) + ) + ((= arg0 4) + (send-event *camera* 'toggle-slave-option (cam-slave-options ALLOW_Z_ROT)) + ) + ((= arg0 6) + (set-setting-by-param *setting-control* 'slave-options 'clear 0 16) + ) + ((= arg0 7) + (send-event *camera* 'toggle-slave-option (cam-slave-options FIND_HIDDEN_TARGET)) + ) + ((= arg0 8) + (send-event *camera* 'toggle-slave-option (cam-slave-options COLLIDE)) + ) + ((= arg0 9) + (send-event *camera* 'toggle-slave-option (cam-slave-options LINE_OF_SIGHT)) + ) + ((= arg0 10) + (send-event *camera* 'toggle-slave-option (cam-slave-options NO_ROTATE)) + ) + ((= arg0 11) + (send-event *camera* 'toggle-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + (cond + (*camera* + (cond + ((zero? arg0) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 BUTT_CAM)) + ) + ((= arg0 1) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 SAME_SIDE)) + ) + ((= arg0 2) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 MOVE_SPHERICAL)) + ) + ((= arg0 3) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 DRAG)) + ) + ((= arg0 4) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 ALLOW_Z_ROT)) + ) + ((= arg0 6) + (not (get-setting *setting-control* 'slave-options)) + ) + ((= arg0 7) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 FIND_HIDDEN_TARGET)) + ) + ((= arg0 8) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 COLLIDE)) + ) + ((= arg0 9) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 LINE_OF_SIGHT)) + ) + ((= arg0 10) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 NO_ROTATE)) + ) + ((= arg0 11) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 STICKY_ANGLE)) + ) + (else + #f + ) + ) + ) + (else + #f + ) + ) + ) + +(defun dm-cam-settings-func-int ((arg0 int) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) + (when (and (= arg1 (debug-menu-msg press)) *camera*) + (if (= (/ arg0 8) 5) + (set! *dm-cam-mode-interpolation* arg2) + ) + ) + (cond + (*camera* + (if (= (/ arg0 8) 5) + *dm-cam-mode-interpolation* + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-cam-externalize ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((= arg0 'reset) + (if (!= *external-cam-mode* 'locked) + (external-cam-reset!) + ) + ) + ((= arg0 'allow-z) + (set! *external-cam-options* (logxor *external-cam-options* (external-cam-option allow-z))) + ) + ((= *external-cam-mode* arg0) + (set! *external-cam-mode* #f) + ) + (else + (if (not *external-cam-mode*) + (external-cam-reset!) + ) + (set! *external-cam-mode* arg0) + ) + ) + ) + (if (= arg0 'allow-z) + (logtest? *external-cam-options* (external-cam-option allow-z)) + (= *external-cam-mode* arg0) + ) + ) + +(defun dm-cam-setting-float ((arg0 float) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (let ((v1-2 arg0)) + (when (= (the-as int v1-2) 'fov) + (if (not (get-setting *setting-control* 'fov)) + (set! arg2 64.0) + ) + (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) + (if *camera-combiner* + (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) + ) + (if (and *camera* (-> *camera* slave)) + (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) + ) + ) + ) + ) + (cond + ((= (the-as int arg0) 'fov) + (cond + ((get-setting *setting-control* 'fov) + (empty) + arg2 + ) + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-cam-render-float ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (when (zero? (/ arg0 8)) + (when *math-camera* + (set! (-> *math-camera* fov) (* 182.04445 arg2)) + (update-math-camera + *math-camera* + (-> *setting-control* user-current video-mode) + (-> *setting-control* user-current aspect-ratio) + (-> *math-camera* fov) + ) + ) + ) + ) + (cond + ((zero? (/ arg0 8)) + (cond + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + +(defun dm-subdiv-float ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('close) + (when (and *math-camera* *subdivide-settings*) + (dotimes (v1-6 12) + (set! (-> *subdivide-settings* close v1-6) (* 4096.0 arg2)) + ) + ) + ) + (('far) + (when (and *math-camera* *subdivide-settings*) + (dotimes (v1-13 12) + (set! (-> *subdivide-settings* far v1-13) (* 4096.0 arg2)) + ) + ) + ) + ) + ) + (case arg0 + (('close) + (if (and *math-camera* *subdivide-settings*) + (* 0.00024414062 (-> *subdivide-settings* close 0)) + arg3 + ) + ) + (('far) + (if (and *math-camera* *subdivide-settings*) + (* 0.00024414062 (-> *subdivide-settings* far 0)) + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-subdiv-int ((arg0 symbol) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('anim-speed) + (if *anim-tester* + (set! (-> *anim-tester* 0 speed) arg2) + ) + ) + ) + ) + (case arg0 + (('anim-speed) + (if *anim-tester* + (-> *anim-tester* 0 speed) + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-select-race-path ((arg0 object) (arg1 debug-menu-msg) (arg2 int)) + (if (= arg1 (debug-menu-msg press)) + (set! *select-race-path* arg2) + ) + *select-race-path* + ) + +(defun dm-setting-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default language) (/ arg0 8)) + ) + +(defun dm-setting-subtitle-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default subtitle-language) (/ arg0 8)) + ) + +(defun dm-setting-audio-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default audio-language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default audio-language) (/ arg0 8)) + ) + +(defun dm-setting-stereo-mode ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default stereo-mode) (the-as int (/ (the-as int arg0) 8))) + ) + (= (-> *setting-control* user-default stereo-mode) (/ (the-as int arg0) 8)) + ) + +(defun dm-current-continue ((arg0 string) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (start 'play (get-continue-by-name *game-info* arg0)) + ) + (string= (-> (get-current-continue-forced *game-info*) name) arg0) + ) + +(defun dm-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-draw-mode* (the-as subdivide-setting (/ arg0 8))) + ) + (= (/ arg0 8) *subdivide-draw-mode*) + ) + +(defun dm-scissor-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-scissor-draw-mode* (the-as subdivide-setting (/ arg0 8))) + ) + (= (/ arg0 8) *subdivide-scissor-draw-mode*) + ) + +(defun dm-foreground-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! *subdivide-foreground-draw-mode* (the-as subdivide-setting (/ arg0 8))) + (let ((v1-3 *generic-consts*) + (a1-1 (/ arg0 8)) + ) + (cond + ((zero? a1-1) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= a1-1 1) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= a1-1 2) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= a1-1 3) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + ) + (= (/ arg0 8) *subdivide-foreground-draw-mode*) + ) + +(defun dm-col-rend-on-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 draw?) (not (-> v1-0 draw?))) + ) + (-> v1-0 draw?) + ) + ) + +(defun dm-col-rend-outline-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 outline?) (not (-> v1-0 outline?))) + ) + (-> v1-0 outline?) + ) + ) + +(defun dm-col-rend-back-face-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-back-faces?) (not (-> v1-0 show-back-faces?))) + ) + (-> v1-0 show-back-faces?) + ) + ) + +(defun dm-col-rend-normals-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-normals?) (not (-> v1-0 show-normals?))) + ) + (-> v1-0 show-normals?) + ) + ) + +(defun dm-col-rend-ghost-hidden-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 ghost-hidden?) (not (-> v1-0 ghost-hidden?))) + ) + (-> v1-0 ghost-hidden?) + ) + ) + +(defun dm-col-rend-track-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 track) (the-as uint (/ arg0 8))) + ) + (= (/ arg0 8) (-> v1-0 track)) + ) + ) + +(defun dm-col-rend-show-only-toggle-func ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 show-only) arg0) + (logand! (-> v1-0 show-only) -57) + ) + (logtest? (-> v1-0 show-only) arg0) + ) + ) + +(defun dm-col-rend-show-only-set-func ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-only) arg0) + ) + (= (-> v1-0 show-only) arg0) + ) + ) + +(defun dm-col-rend-cspec-toggle ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 cspec) (the-as uint arg0)) + ) + (logtest? (-> v1-0 cspec) arg0) + ) + ) + +(defun dm-col-rend-size ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 bbox-radius) (* 2048.0 arg2)) + ) + (* 0.00024414062 (* 2.0 (-> v1-0 bbox-radius))) + ) + ) + +(defun dm-col-rend-cam-dist ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) + ) + (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + ) + ) + +(defun dm-ocean-height-func ((arg0 ocean-height-hack) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! *ocean-height-hack* (the-as ocean-height-hack (/ (the-as int arg0) 8))) + (let* ((v1-3 (/ (the-as int arg0) 8)) + (f0-0 (cond + ((= v1-3 2) + -16384000.0 + ) + ((= v1-3 3) + -216498.17 + ) + ((= v1-3 4) + -265650.2 + ) + ((= v1-3 5) + -314802.2 + ) + ((= v1-3 6) + -368050.2 + ) + (else + 0.0 + ) + ) + ) + ) + (set-height! *ocean-map-sewer* f0-0) + ) + ) + (= (/ (the-as int arg0) 8) *ocean-height-hack*) + ) + +(defun dm-ocean-subdiv-draw-func ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-ocean-draw-mode* (the-as subdivide-setting (/ (the-as int arg0) 8))) + ) + (= (/ (the-as int arg0) 8) *subdivide-ocean-draw-mode*) + ) + +(defun dm-time-of-day-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((zero? (/ arg0 8)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 7) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 1) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 10) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 2) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 12) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 3) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 14) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 4) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 18) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 5) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 19) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 6) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 7) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 4) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 8) + (send-event + (ppointer->process *time-of-day*) + 'dest-clock-ratio-set + (if *time-of-day-fast* + #x42700000 + #x3f800000 + ) + (seconds 2) + ) + ) + (else + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (set! (-> *time-of-day-context* mode) + (logand (logxor (-> *time-of-day-context* mode) (the-as uint (/ arg0 8))) + (time-of-day-palette-id palette-0 palette-1 palette-2 palette-3 palette-4 palette-5 palette-6 palette-7) + ) + ) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'minutes 0) + (send-event (ppointer->process *time-of-day*) 'change 'seconds 0) + (send-event (ppointer->process *time-of-day*) 'change 'frames 0) + (set! *teleport-count* 1) + ) + (cond + ((< (/ arg0 8) 9) + (= (/ arg0 8) (-> *time-of-day-context* mode)) + ) + ((< (/ arg0 8) 8) + #f + ) + (else + (logtest? (-> *time-of-day-context* mode) (/ arg0 8)) + ) + ) + ) + +(defun dm-time-of-day-func2 ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> arg0 value) (not (-> arg0 value))) + (if (nonzero? (send-event (ppointer->process *time-of-day*) 'ratio)) + (send-event + (ppointer->process *time-of-day*) + 'dest-clock-ratio-set + (if *time-of-day-fast* + #x42700000 + #x3f800000 + ) + (seconds 2) + ) + ) + ) + (-> arg0 value) + ) + +(defun dm-time-of-day-palette-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-palette) (the-as time-of-day-palette-id (/ arg0 8))) + (cond + ((zero? (/ arg0 8)) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-0)) + ) + ((= (/ arg0 8) 1) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-1)) + ) + ((= (/ arg0 8) 2) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-2)) + ) + ((= (/ arg0 8) 3) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-3)) + ) + ((= (/ arg0 8) 4) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-4)) + ) + ((= (/ arg0 8) 5) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-5)) + ) + ((= (/ arg0 8) 6) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-6)) + ) + ((= (/ arg0 8) 7) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-7)) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + ) + (cond + ((zero? (/ arg0 8)) + (= (-> *time-of-day-context* mode) 16) + ) + ((= (/ arg0 8) 1) + (= (-> *time-of-day-context* mode) 32) + ) + ((= (/ arg0 8) 2) + (= (-> *time-of-day-context* mode) 64) + ) + ((= (/ arg0 8) 3) + (= (-> *time-of-day-context* mode) 128) + ) + ((= (/ arg0 8) 4) + (= (-> *time-of-day-context* mode) 256) + ) + ((= (/ arg0 8) 5) + (= (-> *time-of-day-context* mode) 512) + ) + ((= (/ arg0 8) 6) + (= (-> *time-of-day-context* mode) 1024) + ) + ((= (/ arg0 8) 7) + (= (-> *time-of-day-context* mode) 2048) + ) + ) + ) + +(defun dm-boolean-toggle-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> arg0 value) (not (-> arg0 value))) + ) + (-> arg0 value) + ) + +(defun dm-time-of-day-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (time-of-day-setup (= arg1 (debug-menu-msg press))) + ) + +(defun dm-stats-memory-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 (/ arg0 8))) + (if (= arg1 (debug-menu-msg press)) + (set! *stats-memory-level-index* v1-0) + ) + (= *stats-memory-level-index* v1-0) + ) + ) + +(defun dm-actor-marks-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-actor-marks* arg0) + ) + (= *display-actor-marks* arg0) + ) + +;; WARN: Return type mismatch number vs object. +(defun dm-debug-actor-lod-dist ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (local-vars (sv-16 res-tag)) + (when (= arg1 (debug-menu-msg press)) + (when (and *debug-actor* (>= (-> (the-as process-drawable *debug-actor*) draw lod-set max-lod) (/ arg0 8))) + (let ((a0-4 (&+ (-> (the-as process-drawable *debug-actor*) draw jgeo extra data-base) (* (/ arg0 8) 4)))) + (mem-set32! a0-4 1 (the-as int (* 4096.0 arg2))) + ) + (reset-actors 'debug) + ) + ) + (cond + (*debug-actor* + (let ((f30-0 0.00024414062)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-21 (res-lump-data + (-> (the-as process-drawable *debug-actor*) draw jgeo extra) + 'lod-dist + (pointer float) + :tag-ptr (& sv-16) + ) + ) + ) + (* f30-0 (if (and v1-21 (< (/ arg0 8) (the-as int (-> sv-16 elt-count)))) + (-> v1-21 (/ arg0 8)) + 0.0 + ) + ) + ) + ) + ) + (else + 0 + ) + ) + ) + +(defun dm-select-race-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *select-race* (the-as race-selection (/ arg0 8))) + ) + (= (/ arg0 8) *select-race*) + ) + +(defun dm-compact-actor-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *compact-actors* arg0) + ) + (= *compact-actors* arg0) + ) + +(defun dm-actor-vis-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-actor-vis* arg0) + ) + (= *display-actor-vis* arg0) + ) + +(defun dm-game-mode-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *game-info* mode) arg0) + ) + (= (-> *game-info* mode) arg0) + ) + +(defun dm-game-feature-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ arg0 8)))) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* features) (the-as uint v1-1)) + (set! (-> *game-info* debug-features) + (logior (logclear (-> *game-info* debug-features) v1-1) (logand (-> *game-info* features) v1-1)) + ) + (if (logtest? (game-feature + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + ) + (-> *game-info* features) + ) + (logior! (-> *game-info* features) (game-feature gun)) + (logclear! (-> *game-info* features) (game-feature gun)) + ) + (if (logtest? (game-feature + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + ) + (-> *game-info* debug-features) + ) + (logior! (-> *game-info* debug-features) (game-feature gun)) + (logclear! (-> *game-info* debug-features) (game-feature gun)) + ) + ) + (logtest? (-> *game-info* features) v1-1) + ) + ) + +(defun dm-game-vehicle-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ arg0 8)))) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* vehicles) (the-as uint v1-1)) + (set! (-> *game-info* debug-vehicles) + (logior (logclear (-> *game-info* debug-vehicles) v1-1) (logand (-> *game-info* vehicles) v1-1)) + ) + ) + (logtest? (-> *game-info* vehicles) v1-1) + ) + ) + +(defun dm-game-secret-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* secrets) (the-as uint (ash 1 (/ arg0 8)))) + (update-task-masks 'event) + ) + (logtest? (-> *game-info* secrets) (ash 1 (/ arg0 8))) + ) + +(defun display-scene-control-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-scene-control* (logxor *display-scene-control* (the-as uint arg0))) + ) + (logtest? *display-scene-control* arg0) + ) + +(defun display-scene-control-set-pick-func ((arg0 scene-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-scene-control* arg0) + ) + (= *display-scene-control* arg0) + ) + +(defun display-bot-marks-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-bot-marks* (logxor *display-bot-marks* (the-as uint arg0))) + ) + (logtest? *display-bot-marks* arg0) + ) + +(defun display-bot-marks-set-pick-func ((arg0 bot-marks-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-bot-marks* arg0) + ) + (= *display-bot-marks* arg0) + ) + +(defun display-race-marks-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-race-marks* (logxor *display-race-marks* (the-as uint arg0))) + ) + (logtest? *display-race-marks* arg0) + ) + +(defun display-race-marks-set-pick-func ((arg0 race-marks-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-race-marks* arg0) + ) + (= *display-race-marks* arg0) + ) + +(defun dm-vu1-user-toggle-pick-func ((arg0 vu1-renderer-mask) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ (the-as int arg0) 8)))) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *display* vu1-enable-user-menu) (the-as uint v1-1)) + ) + (logtest? (-> *display* vu1-enable-user-menu) v1-1) + ) + ) + +(defun dm-vu1-user-all-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (let ((v1-1 (the-as uint #x17fffffff8))) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-1)) + ) + (= (-> *display* vu1-enable-user-menu) v1-1) + ) + ) + +(defun dm-vu1-user-none-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (let ((v1-0 0)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-0)) + ) + (= (-> *display* vu1-enable-user-menu) v1-0) + ) + ) + +(defun dm-texture-user-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *texture-pool* texture-enable-user-menu) (the-as uint arg0)) + ) + (logtest? (-> *texture-pool* texture-enable-user-menu) arg0) + ) + +(defun dm-texture-user-set-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *texture-pool* texture-enable-user-menu) (the-as texture-enable-mask arg0)) + ) + (= (-> *texture-pool* texture-enable-user-menu) arg0) + ) + +(defun dm-strip-lines-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-strip-lines* (logxor *display-strip-lines* (the-as uint (/ arg0 8)))) + ) + (logtest? *display-strip-lines* (/ arg0 8)) + ) + +(defun dm-strip-lines-set-pick-func ((arg0 strip-lines-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-strip-lines* (the-as strip-lines-controls (/ (the-as int arg0) 8))) + ) + (= *display-strip-lines* (/ (the-as int arg0) 8)) + ) + +(defun dm-edit-instance-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (dotimes (s4-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s4-0))) + (when (= (-> a1-1 status) 'active) + (let ((v1-4 (find-instance-by-name-level *edit-instance* a1-1))) + (when v1-4 + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-4 flags) (the-as uint arg0)) + ) + (logtest? (-> v1-4 flags) arg0) + ) + ) + ) + ) + ) + #f + ) + +;; og:preserve-this +(defun all-texture-tweak-adjust ((arg0 texture-page-dir) (arg1 float)) + (none) + ) + +(defun dm-float-field-tie-rvanish-func ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (case (prototype-bucket-type s2-0) + ((instance-tie) + (let* ((f0-0 (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far)) + (f1-2 (- f0-0 (/ 128.0 (-> (the-as prototype-bucket-tie s2-0) tie-rvanish)))) + ) + (let ((f2-1 (-> (the-as prototype-bucket-tie s2-0) dists w))) + (when (= arg1 (debug-menu-msg press)) + (logior! (-> (the-as prototype-bucket-tie s2-0) flags) (prototype-flags vanish)) + (set! f1-2 (fmax (fmin (* 4096.0 arg2) f0-0) (+ 4096.0 f2-1))) + (let ((f0-1 (fmax f0-0 (+ 4096.0 f1-2)))) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-rvanish) (/ 128.0 (- f0-1 f1-2))) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far) f0-1) + ) + ) + ) + (set! f30-0 (* 0.00024414062 f1-2)) + ) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +(defun dm-float-field-tie-vanish-far-func ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (case (prototype-bucket-type s2-0) + ((instance-tie) + (let ((f0-0 (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far))) + (let ((f2-1 (- f0-0 (/ 128.0 (-> (the-as prototype-bucket-tie s2-0) tie-rvanish)))) + (f1-2 (-> (the-as prototype-bucket-tie s2-0) dists w)) + ) + (when (= arg1 (debug-menu-msg press)) + (logior! (-> s2-0 flags) (prototype-flags vanish)) + (set! f0-0 (fmax (* 4096.0 arg2) (+ 4096.0 f2-1))) + (let ((f1-4 (fmax (fmin f2-1 f0-0) (+ 4096.0 f1-2)))) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-rvanish) (/ 128.0 (- f0-0 f1-4))) + ) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far) f0-0) + ) + ) + (set! f30-0 (* 0.00024414062 f0-0)) + ) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +(defun dm-bug-report-output-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *bug-report-output-mode* arg0) + ) + (= *bug-report-output-mode* arg0) + ) + +(defun dm-bug-report-report-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (bug-report-display arg0) + ) + 0 + (none) + ) + +(defun debug-menu-node arg0 name) (-> arg1 name)) + ) + +(defun dm-shader-pick-func ((arg0 texture-id) (arg1 debug-menu-msg)) + (if (and (= arg1 (debug-menu-msg press)) + *texture-page-dir* + (-> *texture-page-dir* entries (-> arg0 page) page) + (-> *texture-page-dir* entries (-> arg0 page) link) + (nonzero? (-> *texture-page-dir* entries (-> arg0 page) link next (-> arg0 index))) + ) + (set! *edit-shader* arg0) + ) + (and (nonzero? *edit-shader*) (= arg0 *edit-shader*)) + ) + +(define *shader-pick-menu* (the-as debug-menu #f)) + +;; WARN: Return type mismatch pair vs none. +(defun build-shader-list () + (debug-menu-remove-all-items *shader-pick-menu*) + (when *texture-page-dir* + (dotimes (gp-0 (-> *texture-page-dir* length)) + (let ((s5-0 (-> *texture-page-dir* entries gp-0 page)) + (s4-0 (-> *texture-page-dir* entries gp-0 link)) + ) + (when (and s5-0 s4-0) + (dotimes (s3-0 (-> s5-0 length)) + (when (and (-> s5-0 data s3-0) (nonzero? (-> s4-0 next s3-0))) + (let ((a1-1 (new + 'debug + 'debug-menu-item-flag + (-> s5-0 data s3-0 name) + (logior (shr (shl s3-0 52) 44) (shr (shl gp-0 52) 32)) + dm-shader-pick-func + ) + ) + ) + (debug-menu-append-item *shader-pick-menu* a1-1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> *shader-pick-menu* items) (sort (-> *shader-pick-menu* items) debug-menu-node *level* length)) + (let ((a1-1 (-> *level* level s5-0))) + (when (= (-> a1-1 status) 'active) + (if (find-instance-by-name-level arg0 a1-1) + (set! *edit-instance* arg0) + ) + ) + ) + ) + ) + (the-as basic (and *edit-instance* (string= arg0 *edit-instance*))) + ) + +(defun dm-enable-instance-func ((arg0 string) (arg1 debug-menu-msg)) + (let ((s3-0 #f)) + (dotimes (s4-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s4-0))) + (when (= (-> a1-1 status) 'active) + (let ((v1-4 (find-instance-by-name-level arg0 a1-1))) + (when v1-4 + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-4 flags) (prototype-flags disable)) + ) + (set! s3-0 (not (logtest? (-> v1-4 flags) (prototype-flags disable)))) + ) + ) + ) + ) + ) + s3-0 + ) + ) + +(define *instance-shrub-menu* (the-as debug-menu #f)) + +(define *instance-tie-menu* (the-as debug-menu #f)) + +(define *enable-instance-shrub-menu* (the-as debug-menu #f)) + +(define *enable-instance-tie-menu* (the-as debug-menu #f)) + +(defun build-instance-list ((arg0 object)) + (debug-menu-remove-all-items *instance-shrub-menu*) + (debug-menu-remove-all-items *instance-tie-menu*) + (debug-menu-remove-all-items *enable-instance-shrub-menu*) + (debug-menu-remove-all-items *enable-instance-tie-menu*) + (set! *display-instance-info* #f) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-3 (-> *level* level gp-0))) + (when (= (-> v1-3 status) 'active) + (let ((s5-0 (-> v1-3 bsp drawable-trees))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((v1-7 (-> s5-0 trees s4-0))) + (case (-> v1-7 type) + ((drawable-tree-instance-shrub) + (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-4 + (new + 'global + 'debug-menu-item-flag + (-> s3-0 data s2-0 name) + (the-as int (-> s3-0 data s2-0 name)) + dm-instance-pick-func + ) + ) + ) + (debug-menu-append-item *instance-shrub-menu* a1-4) + ) + (let ((a1-6 + (new + 'debug + 'debug-menu-item-flag + (-> s3-0 data s2-0 name) + (the-as int (-> s3-0 data s2-0 name)) + dm-enable-instance-func + ) + ) + ) + (set! (-> a1-6 is-on) #t) + (debug-menu-append-item *enable-instance-shrub-menu* a1-6) + ) + ) + ) + ) + ((drawable-tree-instance-tie) + (let ((s3-1 (-> (the-as drawable-tree-instance-tie v1-7) prototypes prototype-array-tie))) + (dotimes (s2-1 (-> s3-1 length)) + (let ((a1-9 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (the-as int (-> s3-1 array-data s2-1 name)) + dm-instance-pick-func + ) + ) + ) + (debug-menu-append-item *instance-tie-menu* a1-9) + ) + (let ((a1-11 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (the-as int (-> s3-1 array-data s2-1 name)) + dm-enable-instance-func + ) + ) + ) + (set! (-> a1-11 is-on) #t) + (debug-menu-append-item *enable-instance-tie-menu* a1-11) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> *instance-shrub-menu* items) + (sort + (-> *instance-shrub-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *instance-tie-menu* items) + (sort + (-> *instance-tie-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *enable-instance-shrub-menu* items) + (sort + (-> *enable-instance-shrub-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *enable-instance-tie-menu* items) + (sort + (-> *enable-instance-tie-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + 0 + (none) + ) + +(defun dm-scene-load-pick-func ((arg0 pair) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((s5-0 *display-profile*)) + (play-clean #f) + (set! *display-profile* s5-0) + ) + (set! *debug-menu-scene-play* #t) + (let ((s5-1 (car (cdr arg0)))) + (process-spawn scene-player :init scene-player-init s5-1 #t (car arg0) :name "scene-player") + ) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (set-master-mode 'game) + ) + #f + ) + +;; WARN: Return type mismatch object vs none. +(defun debug-create-cam-restore () + (cond + (*math-camera* + (format #t "(defun-debug cam-restore ()~%") + (format #t " ;;this function is a hack, don't use it as an example~%") + (format #t " (let ((pos (new 'stack 'vector))~%") + (format #t " (rot (new 'stack 'matrix)))~%") + (format #t " (set! (-> pos x) ~12F)~%" (-> *math-camera* trans x)) + (format #t " (set! (-> pos y) ~12F)~%" (-> *math-camera* trans y)) + (format #t " (set! (-> pos z) ~12F)~%" (-> *math-camera* trans z)) + (format #t " (set! (-> pos w) 1.0)~%") + (format #t " (set! (-> rot data 0) ~12F)~%" (-> *math-camera* inv-camera-rot rvec x)) + (format #t " (set! (-> rot data 1) ~12F)~%" (-> *math-camera* inv-camera-rot rvec y)) + (format #t " (set! (-> rot data 2) ~12F)~%" (-> *math-camera* inv-camera-rot rvec z)) + (format #t " (set! (-> rot data 3) ~12F)~%" (-> *math-camera* inv-camera-rot rvec w)) + (format #t " (set! (-> rot data 4) ~12F)~%" (-> *math-camera* inv-camera-rot uvec x)) + (format #t " (set! (-> rot data 5) ~12F)~%" (-> *math-camera* inv-camera-rot uvec y)) + (format #t " (set! (-> rot data 6) ~12F)~%" (-> *math-camera* inv-camera-rot uvec z)) + (format #t " (set! (-> rot data 7) ~12F)~%" (-> *math-camera* inv-camera-rot uvec w)) + (format #t " (set! (-> rot data 8) ~12F)~%" (-> *math-camera* inv-camera-rot fvec x)) + (format #t " (set! (-> rot data 9) ~12F)~%" (-> *math-camera* inv-camera-rot fvec y)) + (format #t " (set! (-> rot data 10) ~12F)~%" (-> *math-camera* inv-camera-rot fvec z)) + (format #t " (set! (-> rot data 11) ~12F)~%" (-> *math-camera* inv-camera-rot fvec w)) + (format #t " (set! (-> rot data 12) ~12F)~%" 0) + (format #t " (set! (-> rot data 13) ~12F)~%" 0) + (format #t " (set! (-> rot data 14) ~12F)~%" 0) + (format #t " (set! (-> rot data 15) ~12F)~%" #x3f800000) + (let ((gp-0 (new 'stack-no-clear 'euler-angles))) + (matrix->eul gp-0 (-> *math-camera* inv-camera-rot) 21) + (format #t " ;; euler angles (xyz order degrees) x ~R y ~R z ~R~%" (-> gp-0 x) (-> gp-0 y) (-> gp-0 z)) + (format + #t + " ;; MAYA euler angles (xyz order degrees) x ~R y ~R z ~R~%" + (-> gp-0 x) + (- 32768.0 (-> gp-0 y)) + (-> gp-0 z) + ) + ) + (format #t " (debug-set-camera-pos-rot! pos rot)~%") + (format #t " (send-event *camera* 'set-fov (deg ~f))~%" (* 0.005493164 (-> *math-camera* fov))) + (format #t " (clear *camera-old-level*)~%") + (format #t " (format *camera-old-level* \"~A\")~%" (-> *level* level0 name)) + (let ((t9-31 format) + (a0-31 #t) + (a1-31 " (set! *camera-old-cpu* ~D)~%") + (a2-25 (-> *display* frames (-> *display* last-screen) profile-array data 0)) + ) + (t9-31 a0-31 a1-31 (- (-> a2-25 data 0 end-time) (-> a2-25 data 0 start-time))) + ) + (let ((t9-32 format) + (a0-32 #t) + (a1-32 " (set! *camera-old-vu* ~D)~%") + (a2-29 (-> *display* frames (-> *display* on-screen) profile-array data 1)) + ) + (t9-32 a0-32 a1-32 (- (-> a2-29 data 0 end-time) (-> a2-29 data 0 start-time))) + ) + (compute-memory-usage! (the-as level (-> *level* level)) #f) + (format #t " (set! *camera-old-tfrag-bytes* ~D)~%" (+ (-> *level* level0 mem-usage-block data 1 total) + (-> *level* level0 mem-usage-block data 2 total) + (-> *level* level0 mem-usage-block data 3 total) + (-> *level* level0 mem-usage-block data 4 total) + (-> *level* level0 mem-usage-block data 5 total) + (-> *level* level0 mem-usage-block data 6 total) + (-> *level* level0 mem-usage-block data 7 total) + (-> *level* level0 mem-usage-block data 8 total) + ) + ) + (format #t " (clear *camera-old-stat-string-tfrag*)~%") + (format #t " (clear *camera-old-stat-string-tfrag-near*)~%") + (format #t " (clear *camera-old-stat-string-total*)~%") + (when *stats-poly* + (format #t " (format *camera-old-stat-string-tfrag* \"~S\")~%" *stat-string-tfrag*) + (format #t " (format *camera-old-stat-string-tfrag-near* \"~S\")~%" *stat-string-tfrag-scissor*) + (format #t " (format *camera-old-stat-string-total* \"~S\")~%" *stat-string-total*) + ) + (format #t " (set! *display-camera-old-stats* #t)~%") + (format #t " )~%") + (format #t " )~%") + ) + (else + (format #t "camera save failed~%") + ) + ) + (none) + ) + +(defun debug-menu-make-camera-mode-menu ((arg0 debug-menu) (arg1 debug-menu)) + (new 'debug 'debug-menu-item-submenu "Camera" arg0) + (let ((a1-3 (new 'debug 'debug-menu-item-submenu "Mode" arg1))) + (debug-menu-append-item arg0 a1-3) + ) + (let ((a1-5 (new 'debug 'debug-menu-item-flag "Default" (the-as int #f) dm-cam-mode-default))) + (debug-menu-append-item arg1 a1-5) + ) + (let ((a1-7 (new 'debug 'debug-menu-item-flag "Free-floating" (the-as int cam-free-floating) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-7) + ) + (let ((a1-9 (new 'debug 'debug-menu-item-flag "Fixed" (the-as int cam-fixed) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-9) + ) + (let ((a1-11 (new 'debug 'debug-menu-item-flag "No Trans" (the-as int cam-no-trans) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-11) + ) + (let ((a1-13 (new 'debug 'debug-menu-item-flag "Pov" (the-as int cam-pov) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-13) + ) + (let ((a1-15 (new 'debug 'debug-menu-item-flag "Pov180" (the-as int cam-pov180) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-15) + ) + (let ((a1-17 (new 'debug 'debug-menu-item-flag "Pov-track" (the-as int cam-pov-track) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-17) + ) + (let ((a1-19 (new 'debug 'debug-menu-item-flag "Decel" (the-as int cam-decel) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-19) + ) + (let ((a1-21 (new 'debug 'debug-menu-item-flag "Endless fall" (the-as int cam-endlessfall) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-21) + ) + (let ((a1-23 (new 'debug 'debug-menu-item-flag "Eye" (the-as int cam-eye) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-23) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "Stick" (the-as int cam-stick) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-25) + ) + (let ((a1-27 (new 'debug 'debug-menu-item-flag "String" (the-as int cam-string) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-27) + ) + (let ((a1-29 (new 'debug 'debug-menu-item-flag "Standoff" (the-as int cam-standoff) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-29) + ) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Circular" (the-as int cam-circular) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-31) + ) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Look At" (the-as int cam-lookat) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-33) + ) + (let ((a1-35 (new 'debug 'debug-menu-item-flag "Center of world" (the-as int cam-point-watch) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-35) + ) + (let ((a1-37 (new 'debug 'debug-menu-item-flag "Spline" (the-as int cam-spline) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-37) + ) + (let ((a1-39 (new 'debug 'debug-menu-item-flag "Tube Sled" (the-as int cam-tube-sled) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-39) + ) + (let ((a1-41 (new 'debug 'debug-menu-item-flag "Bike" (the-as int cam-bike) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-41) + ) + ) + +(defun debug-menu-make-camera-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Camera menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Camera" gp-0)) + ) + (let ((a1-3 (new 'debug 'debug-menu arg0 "Camera mode menu"))) + (debug-menu-make-camera-mode-menu gp-0 a1-3) + ) + (let ((s3-0 (new 'debug 'debug-menu arg0 "Camera externalize menu"))) + (let ((a1-6 (new 'debug 'debug-menu-item-submenu "External" s3-0))) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((a1-8 (new 'debug 'debug-menu-item-flag "CPad 0" (the-as int 'pad-0) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-8) + ) + (let ((a1-10 (new 'debug 'debug-menu-item-flag "CPad 1" (the-as int 'pad-1) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-10) + ) + (let ((a1-12 (new 'debug 'debug-menu-item-flag "Lock" (the-as int 'locked) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-12) + ) + (let ((a1-14 (new 'debug 'debug-menu-item-flag "Reset" (the-as int 'reset) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-14) + ) + (let ((a1-16 (new 'debug 'debug-menu-item-flag "Allow z rot" (the-as int 'allow-z) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-16) + ) + (let ((s2-0 (new 'debug 'debug-menu-item-var "Fov" 0 80))) + (debug-menu-item-var-make-float s2-0 dm-cam-render-float 1.0 #t 15.0 180.0 1) + (debug-menu-append-item s3-0 s2-0) + ) + (let ((a1-21 + (new 'debug 'debug-menu-item-flag "turbo free" (the-as int '*camera-turbo-free*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s3-0 a1-21) + ) + ) + (let ((s3-1 (new 'debug 'debug-menu arg0 "Camera collision menu"))) + (let ((a1-24 (new 'debug 'debug-menu-item-submenu "Collision" s3-1))) + (debug-menu-append-item gp-0 a1-24) + ) + (let ((a1-26 (new + 'debug + 'debug-menu-item-flag + "Record" + (the-as int '*record-cam-collide-history*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s3-1 a1-26) + ) + (let ((a1-28 (new + 'debug + 'debug-menu-item-flag + "Display" + (the-as int '*display-cam-collide-history*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s3-1 a1-28) + ) + ) + (let ((s4-1 (new 'debug 'debug-menu arg0 "Camera settings menu"))) + (let ((a1-31 (new 'debug 'debug-menu-item-submenu "Settings" s4-1))) + (debug-menu-append-item gp-0 a1-31) + ) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Default" (the-as int #f) dm-cam-settings-default))) + (debug-menu-append-item s4-1 a1-33) + ) + (let ((a1-35 + (new 'debug 'debug-menu-item-flag "turbo free" (the-as int '*camera-turbo-free*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-35) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "Fov" (the-as int 'fov) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-cam-setting-float) + 1.0 + #t + 15.0 + 180.0 + 1 + ) + (debug-menu-append-item s4-1 s3-2) + ) + (let ((a1-40 (new 'debug 'debug-menu-item-flag "Butt cam" 0 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-40) + ) + (let ((a1-42 (new 'debug 'debug-menu-item-flag "Same side" 1 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-42) + ) + (let ((a1-44 (new 'debug 'debug-menu-item-flag "Move spherical" 2 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-44) + ) + (let ((a1-46 (new 'debug 'debug-menu-item-flag "Drag" 3 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-46) + ) + (let ((a1-48 (new 'debug 'debug-menu-item-flag "Allow Z rot" 4 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-48) + ) + (let ((a1-50 (new 'debug 'debug-menu-item-flag "Pitch for jump" 6 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-50) + ) + (let ((a1-52 (new 'debug 'debug-menu-item-flag "Find hidden target" 7 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-52) + ) + (let ((a1-54 (new 'debug 'debug-menu-item-flag "Collide" 8 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-54) + ) + (let ((a1-56 (new 'debug 'debug-menu-item-flag "Line of Sight" 9 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-56) + ) + (let ((a1-58 (new 'debug 'debug-menu-item-flag "No Rotate" 10 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-58) + ) + (let ((a1-60 (new 'debug 'debug-menu-item-flag "Sticky Angle" 11 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-60) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "Interp Frms" 40 80))) + (debug-menu-item-var-make-int s3-3 dm-cam-settings-func-int 1 #f 0 0 #f) + (debug-menu-append-item s4-1 s3-3) + ) + (let ((a1-65 (new + 'debug + 'debug-menu-item-flag + "no mip/lod correction" + (the-as int '*camera-no-mip-correction*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-65) + ) + (let ((a1-67 (new + 'debug + 'debug-menu-item-flag + "last attacker" + (the-as int '*display-camera-last-attacker*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-67) + ) + (let ((a1-69 (new + 'debug + 'debug-menu-item-flag + "old stats" + (the-as int '*display-camera-old-stats*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-69) + ) + (let ((a1-71 (new 'debug 'debug-menu-item-flag "Amy cam" (the-as int '*amy-cam*) dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-71) + ) + (let ((a1-73 + (new 'debug 'debug-menu-item-flag "xyz axes" (the-as int '*display-xyz-axes*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-73) + ) + (let ((a1-75 (new + 'debug + 'debug-menu-item-flag + "Master Marks" + (the-as int '*display-cam-master-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-75) + ) + (let ((a1-77 + (new 'debug 'debug-menu-item-flag "Other Marks" (the-as int '*display-cam-other*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-77) + ) + (let ((a1-79 (new + 'debug + 'debug-menu-item-flag + "los debug" + (the-as int '*display-cam-los-debug*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-79) + ) + (let ((a1-81 + (new 'debug 'debug-menu-item-flag "los info" (the-as int '*display-cam-los-info*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-81) + ) + (let ((a1-83 (new + 'debug + 'debug-menu-item-flag + "los Marks" + (the-as int '*display-cam-los-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-83) + ) + (let ((a1-85 (new + 'debug + 'debug-menu-item-flag + "coll Marks" + (the-as int '*display-cam-coll-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-85) + ) + (let ((a1-87 (new + 'debug + 'debug-menu-item-flag + "Camera Marks" + (the-as int '*display-camera-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-87) + ) + ) + (let ((a1-89 (new + 'debug + 'debug-menu-item-flag + "Edit" + (the-as int '*cam-layout*) + (lambda ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if (-> arg0 value) + (cam-layout-stop) + (cam-layout-start) + ) + ) + (-> arg0 value) + ) + ) + ) + ) + (debug-menu-append-item gp-0 a1-89) + ) + (let ((a1-91 (new + 'debug + 'debug-menu-item-function + "Save Pos" + (the-as int #f) + (the-as (function object object) debug-create-cam-restore) + ) + ) + ) + (debug-menu-append-item gp-0 a1-91) + ) + s5-0 + ) + ) + +(defun debug-menu-make-shader-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Shader menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Shader" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Shader pick menu"))) + (set! *shader-pick-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shader" a3-3))) + (debug-menu-append-item gp-0 a1-4) + ) + ) + (let ((a1-6 (new + 'debug + 'debug-menu-item-function + "Refresh" + (the-as int #f) + (the-as (function object object) build-shader-list) + ) + ) + ) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((s4-1 (new 'debug 'debug-menu-item-var "tweak" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-float + s4-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((s4-0 (the-as texture-id (-> arg0 value))) + (gp-0 (lookup-texture-by-id s4-0)) + (v1-3 (-> *texture-page-dir* entries (-> s4-0 page) link)) + ) + (cond + ((and gp-0 v1-3) + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 uv-dist) arg2) + (let ((s5-1 (the-as object (* (-> v1-3 next (-> s4-0 index) shader) 16)))) + (while (nonzero? (the-as uint s5-1)) + (adgif-shader-update! (the-as adgif-shader s5-1) gp-0) + (set! s5-1 (* (-> (the-as adgif-shader s5-1) next shader) 16)) + ) + ) + ) + (-> gp-0 uv-dist) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + 0.1 + #t + 0.1 + 30.0 + 1 + ) + (debug-menu-append-item gp-0 s4-1) + ) + (let ((a1-11 (new + 'debug + 'debug-menu-item-function + "all tweak+" + (the-as int #f) + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* 0.1))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((a1-13 (new + 'debug + 'debug-menu-item-function + "all tweak-" + (the-as int #f) + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* -0.1))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-13) + ) + (let ((s4-2 (new 'debug 'debug-menu-item-var "l" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-2 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 l) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 l) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #f + ) + (debug-menu-append-item gp-0 s4-2) + ) + (let ((s4-3 (new 'debug 'debug-menu-item-var "k" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-3 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; og:preserve-this + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 k) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (sar (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex1))) 20) 52) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + -2048 + 2047 + #f + ) + (debug-menu-append-item gp-0 s4-3) + ) + (let ((s4-4 (new 'debug 'debug-menu-item-var "mmin" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-4 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmin) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmin) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 5 + #t + ) + (debug-menu-append-item gp-0 s4-4) + ) + (let ((s4-5 (new 'debug 'debug-menu-item-var "mmag" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-5 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmag) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmag) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-5) + ) + (let ((s4-6 (new 'debug 'debug-menu-item-var "lcm" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-6 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 lcm) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 lcm) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-6) + ) + (let ((s4-7 (new 'debug 'debug-menu-item-var "tfx" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-7 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; og:preserve-this + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tfx) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 27) 62) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-7) + ) + (let ((s4-8 (new 'debug 'debug-menu-item-var "tbp" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-8 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbp0) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbp0) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + #x4000 + #t + ) + (debug-menu-append-item gp-0 s4-8) + ) + (let ((s4-9 (new 'debug 'debug-menu-item-var "tbw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-9 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 15 + #t + ) + (debug-menu-append-item gp-0 s4-9) + ) + (let ((s4-10 (new 'debug 'debug-menu-item-var "tw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-10 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-10) + ) + (let ((s4-11 (new 'debug 'debug-menu-item-var "th" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-11 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; og:preserve-this + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 th) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 30) 60) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-11) + ) + (let ((s4-12 (new 'debug 'debug-menu-item-var "mxl" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-12 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mxl) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mxl) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 6 + #t + ) + (debug-menu-append-item gp-0 s4-12) + ) + (let ((s4-13 (new 'debug 'debug-menu-item-var "wms" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-13 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wms) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wms) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-13) + ) + (let ((s4-14 (new 'debug 'debug-menu-item-var "wmt" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-14 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wmt) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wmt) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-14) + ) + (let ((s4-15 (new 'debug 'debug-menu-item-var "minu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-15 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp minu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-15) + ) + (let ((s4-16 (new 'debug 'debug-menu-item-var "maxu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-16 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp maxu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-16) + ) + (let ((s4-17 (new 'debug 'debug-menu-item-var "minv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-17 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; og:preserve-this + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minv) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 30) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-17) + ) + (let ((s4-18 (new 'debug 'debug-menu-item-var "maxv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-18 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; og:preserve-this + (let ((a1-8 (the-as object (* (the-as int (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxv) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 20) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-18) + ) + s5-0 + ) + ) + +(defun debug-menu-make-instance-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Instance menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Instance" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Instance shrub menu"))) + (set! *instance-shrub-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shrub" a3-3))) + (debug-menu-append-item gp-0 a1-4) + ) + ) + (let ((a3-5 (new 'debug 'debug-menu arg0 "Instance tie menu"))) + (set! *instance-tie-menu* a3-5) + (let ((a1-7 (new 'debug 'debug-menu-item-submenu "Pick Tie" a3-5))) + (debug-menu-append-item gp-0 a1-7) + ) + ) + (let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" (the-as int #f) build-instance-list))) + (debug-menu-append-item gp-0 a1-9) + ) + (let ((a1-11 (new + 'debug + 'debug-menu-item-function + "Print Info" + (the-as int #f) + (the-as (function object object) print-prototype-list) + ) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-0 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> s2-0 dists x) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields s2-0) + ) + (set! f30-0 (* 0.00024414062 (-> s2-0 dists x))) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-0) + ) + (let ((s3-1 (new 'debug 'debug-menu-item-var "far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> s2-0 dists w) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields s2-0) + ) + (set! f30-0 (* 0.00024414062 (-> s2-0 dists w))) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-1) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "tie vanish near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-rvanish-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-2) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "tie vanish far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-3 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-vanish-far-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-3) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "invisible" 1 dm-edit-instance-toggle-pick-func))) + (debug-menu-append-item gp-0 a1-25) + ) + (let ((a3-18 (new 'debug 'debug-menu arg0 "Enable Instance Shrub Menu"))) + (set! *enable-instance-shrub-menu* a3-18) + (let ((a1-28 (new 'debug 'debug-menu-item-submenu "Enable Shrub" a3-18))) + (debug-menu-append-item gp-0 a1-28) + ) + ) + (let ((a3-20 (new 'debug 'debug-menu arg0 "Enable Instance Tie Menu"))) + (set! *enable-instance-tie-menu* a3-20) + (let ((a1-31 (new 'debug 'debug-menu-item-submenu "Enable Tie" a3-20))) + (debug-menu-append-item gp-0 a1-31) + ) + ) + (let ((a1-33 (new + 'debug + 'debug-menu-item-flag + "Instance Info" + (the-as int '*display-instance-info*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item gp-0 a1-33) + ) + s5-0 + ) + ) + +(defun dm-task-menu-pick-func ((arg0 game-task) (arg1 debug-menu-msg)) + (let ((gp-0 (/ (the-as int arg0) 8))) + (when (= arg1 (debug-menu-msg press)) + (cond + ((cpad-hold? 0 l1) + (task-node-open! (the-as game-task-node gp-0) 'menu) + ) + (else + (let ((t9-1 task-node-close!) + (a0-2 gp-0) + ) + 'menu + (t9-1 (the-as game-task-node a0-2)) + ) + ) + ) + ) + (if (and (not (task-node-closed? (the-as game-task-node gp-0))) + (not (task-node-open? (the-as game-task-node gp-0))) + ) + (return 'invalid) + ) + (task-node-closed? (the-as game-task-node gp-0)) + ) + ) + +(defun debug-menu-make-continue-sub-menu ((arg0 game-info) (arg1 symbol)) + (local-vars + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 string) + (sv-208 symbol) + (sv-224 type) + ) + (let ((s4-0 *level-load-list*) + (s5-0 '()) + ) + (while (not (null? s4-0)) + (let ((v1-1 (-> (the-as symbol (car s4-0)) value))) + (when (or (= arg1 'test) (= (-> (the-as level-load-info v1-1) taskname) arg1)) + (let ((s3-0 (-> (the-as level-load-info v1-1) continues))) + (while (not (null? s3-0)) + (let ((v1-2 (car s3-0)) + (a0-5 arg1) + ) + (when (if (= a0-5 'test) + (logtest? (continue-flags continue-flag-16) (-> (the-as continue-point v1-2) flags)) + #t + ) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> (the-as continue-point v1-2) name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (-> (the-as continue-point v1-2) name)) + (let* ((a3-1 (cons 'dm-current-continue '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! s5-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) s5-0)) + ) + ) + ) + ) + (set! s3-0 (cdr s3-0)) + ) + ) + ) + ) + (set! s4-0 (cdr s4-0)) + ) + (let ((s4-1 s5-0) + (s5-1 '()) + ) + (let ((a2-6 (car s4-1))) + (while (not (null? s4-1)) + (set! s5-1 (cons a2-6 s5-1)) + (set! s4-1 (cdr s4-1)) + (set! a2-6 (car s4-1)) + ) + ) + (let ((s4-2 (method-of-type pair new)) + (s3-1 'global) + (s2-1 pair) + (s1-1 'menu) + (s0-1 (method-of-type pair new)) + ) + (set! sv-208 'global) + (set! sv-224 pair) + (let ((a2-7 (symbol->string-debug arg1)) + (a3-6 s5-1) + ) + (s4-2 s3-1 s2-1 s1-1 (s0-1 sv-208 sv-224 a2-7 a3-6)) + ) + ) + ) + ) + ) + +(defun debug-menu-make-task-sub-menu ((arg0 symbol)) + (local-vars + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 int) + (sv-208 symbol) + (sv-224 type) + ) + (let ((gp-0 '())) + (let ((s4-0 (-> *game-info* sub-task-list))) + (countdown (s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((v1-4 (-> s4-0 s3-0))) + (when (= (-> v1-4 level) arg0) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> v1-4 name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (* s3-0 8)) + (let* ((a3-1 (cons 'dm-task-menu-pick-func '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! gp-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) gp-0)) + ) + ) + ) + ) + ) + ) + ) + (let ((s4-1 (method-of-type pair new)) + (s3-1 'global) + (s2-1 pair) + (s1-1 'menu) + (s0-1 (method-of-type pair new)) + ) + (set! sv-208 'global) + (set! sv-224 pair) + (let ((a2-5 (symbol->string-debug arg0)) + (a3-5 gp-0) + ) + (s4-1 s3-1 s2-1 s1-1 (s0-1 sv-208 sv-224 a2-5 a3-5)) + ) + ) + ) + ) + +(defun debug-menu-make-task-menu ((arg0 debug-menu-context)) + (local-vars (sv-16 debug-menu-context)) + (let* ((s5-0 (new 'debug 'debug-menu arg0 "Task menu")) + (s4-0 (new 'debug 'debug-menu-item-submenu "Task" s5-0)) + ) + (let* ((s3-0 '(city + comb + desert + factory + forest + mine + nest + palace + sewer + wascity + arena + temple + tower + volcano + precursor + default + test + ) + ) + (a0-3 (car s3-0)) + ) + (while (not (null? s3-0)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s5-0) + (s0-0 debug-menu-make-from-template) + ) + (set! sv-16 arg0) + (let ((a1-2 (debug-menu-make-task-sub-menu (the-as symbol a0-3)))) + (s2-0 s1-0 (s0-0 sv-16 a1-2)) + ) + ) + (set! s3-0 (cdr s3-0)) + (set! a0-3 (car s3-0)) + ) + ) + s4-0 + ) + ) + +;; WARN: Return type mismatch int vs object. +(defun dm-play-task-with-continue ((arg0 game-task) (arg1 string)) + (let* ((t9-0 play-task) + (a1-1 'debug) + (a2-0 (cond + ((cpad-hold? 0 l1) + 'pre-play + ) + ((cpad-hold? 0 r1) + 'kiosk + ) + ) + ) + (a1-2 (t9-0 arg0 a1-1 a2-0)) + ) + (if arg1 + (set! a1-2 arg1) + ) + (start 'play (get-continue-by-name *game-info* a1-2)) + ) + (set-master-mode 'game) + 0 + ) + +(defun dm-play-task ((arg0 game-task)) + (dm-play-task-with-continue (the-as game-task (/ (the-as int arg0) 8)) (the-as string #f)) + ) + +(defun dm-play-race ((arg0 race-selection) (arg1 symbol)) + (let ((s5-0 (the-as string #f)) + (gp-0 0) + ) + (case arg0 + (((race-selection desertb-race-record)) + (set! gp-0 15) + (set! s5-0 "desertb-race-record") + ) + (((race-selection rs1)) + (set! gp-0 131) + (set! s5-0 "desertb-race-record") + ) + (((race-selection desrally-record)) + (set! gp-0 132) + (set! s5-0 "desrally-record") + ) + ) + (if (not arg1) + (set! s5-0 (the-as string #f)) + ) + (format #t "dm-play-race starting task ~d continue ~s~%" gp-0 s5-0) + (if (nonzero? gp-0) + (dm-play-task-with-continue (the-as game-task gp-0) s5-0) + ) + ) + ) + +(defun debug-menu-make-play-menu ((arg0 debug-menu-context)) + (local-vars + (sv-16 type) + (sv-32 (function symbol type object object pair)) + (sv-48 symbol) + (sv-64 type) + (sv-80 symbol) + (sv-96 (function symbol type object object pair)) + (sv-112 symbol) + (sv-128 type) + (sv-144 string) + (sv-160 (function symbol type object object pair)) + (sv-176 symbol) + (sv-192 type) + (sv-208 symbol) + (sv-224 type) + (sv-240 (function symbol type object object pair)) + (sv-256 symbol) + (sv-272 type) + (sv-288 symbol) + (sv-304 (function symbol type object object pair)) + (sv-320 symbol) + (sv-336 type) + (sv-352 (function symbol type object object pair)) + (sv-368 symbol) + (sv-384 type) + (sv-400 int) + (sv-416 type) + (sv-432 symbol) + (sv-448 (function symbol type object object pair)) + (sv-464 symbol) + (sv-480 type) + (sv-496 string) + (sv-512 (function symbol type object object pair)) + (sv-528 symbol) + (sv-544 type) + (sv-560 symbol) + ) + (let ((s5-0 '())) + (let ((s2-0 #x200000)) + (countdown (s4-0 (-> *game-info* play-list length)) + (let ((s3-0 (-> *game-info* play-list s4-0))) + (when (-> s3-0 play-continue) + (let ((s1-0 + (logand (game-task-node-flag act1 act2 act3 bbush) (-> *game-info* sub-task-list (-> s3-0 play-node) flags)) + ) + ) + (when (!= s1-0 s2-0) + (let ((s2-1 (method-of-type pair new)) + (s0-0 'global) + ) + (set! sv-16 pair) + (set! sv-32 (method-of-type pair new)) + (set! sv-48 'global) + (set! sv-64 pair) + (set! sv-80 'function) + (set! sv-96 (method-of-type pair new)) + (set! sv-112 'global) + (set! sv-128 pair) + (cond + ((logtest? (game-task-node-flag act3) s1-0) + (set! sv-144 "=== Burning Bush ===") + ) + ((logtest? (game-task-node-flag act2) s1-0) + (set! sv-144 "====== ACT 3 ======") + ) + ((logtest? (game-task-node-flag act1) s1-0) + (set! sv-144 "====== ACT 2 ======") + ) + (else + (set! sv-144 "======= END =======") + ) + ) + (set! sv-160 (method-of-type pair new)) + (set! sv-176 'global) + (set! sv-192 pair) + (set! sv-208 (the-as symbol #f)) + (let* ((a3-1 (cons 'nothing '())) + (a3-2 (sv-160 sv-176 sv-192 sv-208 a3-1)) + (a3-3 (sv-96 sv-112 sv-128 sv-144 a3-2)) + (a2-4 (sv-32 sv-48 sv-64 sv-80 a3-3)) + ) + (set! s5-0 (s2-1 s0-0 sv-16 a2-4 s5-0)) + ) + ) + (set! s2-0 (the-as int s1-0)) + ) + ) + (let ((s1-1 (method-of-type pair new)) + (s0-1 'global) + ) + (set! sv-224 pair) + (set! sv-240 (method-of-type pair new)) + (set! sv-256 'global) + (set! sv-272 pair) + (set! sv-288 'function) + (set! sv-304 (method-of-type pair new)) + (set! sv-320 'global) + (set! sv-336 pair) + (let ((s3-1 (-> s3-0 name))) + (set! sv-352 (method-of-type pair new)) + (set! sv-368 'global) + (set! sv-384 pair) + (set! sv-400 (* s4-0 8)) + (let* ((a3-6 (cons 'dm-play-task '())) + (a3-7 (sv-352 sv-368 sv-384 sv-400 a3-6)) + (a3-8 (sv-304 sv-320 sv-336 s3-1 a3-7)) + (a2-9 (sv-240 sv-256 sv-272 sv-288 a3-8)) + (a3-9 s5-0) + ) + (set! s5-0 (s1-1 s0-1 sv-224 a2-9 a3-9)) + ) + ) + ) + ) + ) + ) + ) + (let ((s4-1 (method-of-type pair new)) + (s3-2 'global) + (s2-2 pair) + (s1-2 (method-of-type pair new)) + (s0-2 'global) + ) + (set! sv-416 pair) + (set! sv-432 'function) + (set! sv-448 (method-of-type pair new)) + (set! sv-464 'global) + (set! sv-480 pair) + (set! sv-496 "====== ACT 1 ======") + (set! sv-512 (method-of-type pair new)) + (set! sv-528 'global) + (set! sv-544 pair) + (set! sv-560 (the-as symbol #f)) + (let* ((a3-11 (cons 'nothing '())) + (a3-12 (sv-512 sv-528 sv-544 sv-560 a3-11)) + (a3-13 (sv-448 sv-464 sv-480 sv-496 a3-12)) + (a3-15 (s4-1 s3-2 s2-2 (s1-2 s0-2 sv-416 sv-432 a3-13) s5-0)) + ) + (debug-menu-make-from-template arg0 (cons 'menu (cons "Play" a3-15))) + ) + ) + ) + ) + +(defun dm-anim-tester-flag-func ((arg0 int) (arg1 debug-menu-msg)) + (when *anim-tester* + (case arg0 + (('at-apply-align) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5)) + ) + (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5))) + ) + (('at-show-joint-info) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4)) + ) + (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4))) + ) + ) + ) + #f + ) + +(defun dm-anim-tester-func ((arg0 int) (arg1 debug-menu-msg)) + (local-vars (v0-1 symbol)) + (if (not *anim-tester*) + (anim-tester-start) + ) + (when *anim-tester* + (cond + ((= arg0 'at-pick-object) + (send-event (ppointer->process *anim-tester*) 'pick-object) + (set! v0-1 #t) + (set! (-> *debug-menu-context* is-hidden) v0-1) + v0-1 + ) + ((= arg0 'at-pick-joint-anim) + (send-event (ppointer->process *anim-tester*) 'pick-joint-anim) + (set! v0-1 #t) + (set! (-> *debug-menu-context* is-hidden) v0-1) + v0-1 + ) + ) + ) + ) + +(defun dm-pilot-mode ((arg0 object)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'pilot #f arg0 #t) + ) + +(defun stop-watch-display ((arg0 object) (arg1 object)) + (let ((v1-3 (- (-> *display* base-clock frame-counter) (-> *game-info* stop-watch-start)))) + (format arg1 "Stop watch ~D:~D:~D~%" (/ v1-3 #x4650) (/ (mod v1-3 #x4650) 300) (/ (* 100 (mod v1-3 300)) 300)) + ) + #f + ) + +(defun debug-menu-context-make-default-menus ((arg0 debug-menu-context)) + (local-vars (sv-16 debug-menu-context)) + (let ((s5-0 (new 'debug 'debug-menu arg0 "Main menu"))) + (debug-menu-context-set-root-menu arg0 s5-0) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Artist" + (flag "Poly Stats" *stats-poly* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + (flag "Level 6" 6 dm-stats-memory-func) + (flag "Level 7" 7 dm-stats-memory-func) + (flag "Level 8" 8 dm-stats-memory-func) + (flag "Level 9" 9 dm-stats-memory-func) + ) + (flag "All Visible" *artist-all-visible* dm-boolean-toggle-pick-func) + (flag "Flip Visible" *artist-flip-visible* dm-boolean-toggle-pick-func) + (flag "Fix Visible" *artist-fix-visible* dm-boolean-toggle-pick-func) + (flag "Fix Frustum" *artist-fix-frustum* dm-boolean-toggle-pick-func) + (flag "Manual Sample Point" *manual-sample-point* dm-boolean-toggle-pick-func) + (flag "Error Spheres" *artist-error-spheres* dm-boolean-toggle-pick-func) + (flag "Use menu subdiv" *artist-use-menu-subdiv* dm-boolean-toggle-pick-func) + (float-var "Subdiv Close" close dm-subdiv-float 10 1 #t 1 1000 1) + (float-var "Subdiv Far" far dm-subdiv-float 10 1 #t 1 1000 1) + (function + "Target Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + (function "Target Stop" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (stop 'debug))) + ;; (menu + ;; "Anim Tester" + ;; (int-var "Speed" anim-speed dm-subdiv-int 10 10 #t -300 1000) + ;; (flag "Apply Align" at-apply-align dm-anim-tester-flag-func) + ;; (flag "Show Joint Inf" at-show-joint-info dm-anim-tester-flag-func) + ;; (function "Pick Object" at-pick-object dm-anim-tester-func) + ;; (function "Pick Joint Anim" at-pick-joint-anim dm-anim-tester-func) + ;; (function "Pick Sequence" at-pick-sequence dm-anim-tester-func) + ;; (function "Save Sequences" at-save-sequences dm-anim-tester-func) + ;; ) + (flag "Show Entity Errors" *display-entity-errors* dm-boolean-toggle-pick-func) + (flag "Capture Mode" *display-capture-mode* dm-boolean-toggle-pick-func) + (flag "Sprite Info" *display-sprite-info* dm-boolean-toggle-pick-func) + (flag "Sprite Marks" *display-sprite-marks* dm-boolean-toggle-pick-func) + (flag "Sprite Spheres" *display-sprite-spheres* dm-boolean-toggle-pick-func) + (flag "Time of Day" #f dm-time-of-day-pick-func) + (flag "Preload Anims" *preload-spool-anims* dm-boolean-toggle-pick-func) + (function + "Mike F" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (debug-actor "drill-crane-14") + (send-event *debug-actor* 'die) + ) + ) + (function + "Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :name "editable-player" :to *entity-pool*) + (set-master-mode 'game) + ) + ) + (flag + "Screen shot highres enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* highres-enable) (not (-> *screen-shot-work* highres-enable))) + ) + (-> *screen-shot-work* highres-enable) + ) + ) + (flag + "Screen shot hud enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* hud-enable) (not (-> *screen-shot-work* hud-enable))) + ) + (-> *screen-shot-work* hud-enable) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Game" + (function + "New Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + (function + "New Life" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (initialize! *game-info* 'dead (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + (function + "Kill Target" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* mode) 'play) + (send-event + *target* + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'death)) + ) + ) + ) + ) + (function + "Hit Target" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* mode) 'play) + (send-event + *target* + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0)) + ) + ) + ) + ) + (function + "Reset Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + (function "Reset Actors" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (reset-actors 'debug))) + (function + "Save Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (auto-save-command 'save 0 0 *default-pool* #f)) + ) + (function + "Load Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (auto-save-command 'restore 0 0 *default-pool* #f)) + ) + (function + "Manager Complete" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (script-eval '(send-event *task-manager* 'complete))) + ) + (flag "Target" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + *target* + ) + ) + (flag "Game Mode" play dm-game-mode-pick-func) + (flag "Debug Mode" debug dm-game-mode-pick-func) + (function + "Stop Watch Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (remove-by-param0 *debug-engine* stop-watch-display) + (add-connection *debug-engine* *dproc* stop-watch-display *dproc* *stdcon0* #f) + (set! (-> *game-info* stop-watch-start) (-> *display* base-clock frame-counter)) + (set! (-> *game-info* stop-watch-stop) 0) + (format #t "Stop watch started!~%") + ) + ) + (function + "Stop Watch Stop" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (remove-by-param0 *debug-engine* stop-watch-display) + (set! (-> *game-info* stop-watch-stop) (-> *display* base-clock frame-counter)) + (let ((v1-7 (- (-> *game-info* stop-watch-stop) (-> *game-info* stop-watch-start)))) + (format + #t + "Stop watch elasped time was ~D:~D:~D~%" + (/ v1-7 #x4650) + (/ (mod v1-7 #x4650) 300) + (/ (* 100 (mod v1-7 300)) 300) + ) + ) + ) + ) + (function + "Continue Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (start 'play (-> *game-info* current-continue))) + ) + (function + "Kiosk Reset" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (auto-save-command 'restore 0 0 *default-pool* #f)) + ) + (menu + "Secrets" + (flag "hero-mode" 0 dm-game-secret-toggle-pick-func) + (flag "toggle-beard" 14 dm-game-secret-toggle-pick-func) + (flag "hflip-screen" 15 dm-game-secret-toggle-pick-func) + (flag "endless-ammo" 16 dm-game-secret-toggle-pick-func) + (flag "invulnerable" 17 dm-game-secret-toggle-pick-func) + (flag "endless-dark" 18 dm-game-secret-toggle-pick-func) + (flag "endless-light" 19 dm-game-secret-toggle-pick-func) + (flag "scene-player-1" 1 dm-game-secret-toggle-pick-func) + (flag "scene-player-2" 2 dm-game-secret-toggle-pick-func) + (flag "scene-player-3" 3 dm-game-secret-toggle-pick-func) + (flag "level-select-1" 5 dm-game-secret-toggle-pick-func) + (flag "level-select-2" 6 dm-game-secret-toggle-pick-func) + (flag "level-select-3" 7 dm-game-secret-toggle-pick-func) + (flag "scrap-book-1" 8 dm-game-secret-toggle-pick-func) + (flag "scrap-book-2" 9 dm-game-secret-toggle-pick-func) + (flag "scrap-book-3" 10 dm-game-secret-toggle-pick-func) + (flag "gungame-blue" 20 dm-game-secret-toggle-pick-func) + (flag "gungame-dark" 21 dm-game-secret-toggle-pick-func) + (flag "gungame-ratchet" 22 dm-game-secret-toggle-pick-func) + (flag "big-head" 23 dm-game-secret-toggle-pick-func) + (flag "little-head" 24 dm-game-secret-toggle-pick-func) + (flag "fast-movie" 25 dm-game-secret-toggle-pick-func) + (flag "slow-movie" 26 dm-game-secret-toggle-pick-func) + (flag "unlimited-turbos" 27 dm-game-secret-toggle-pick-func) + (flag "vehicle-hit-points" 28 dm-game-secret-toggle-pick-func) + (flag "board-fast" 29 dm-game-secret-toggle-pick-func) + (flag "vehicle-fox" 30 dm-game-secret-toggle-pick-func) + (flag "vehicle-mirage" 31 dm-game-secret-toggle-pick-func) + (flag "vehicle-x-ride" 32 dm-game-secret-toggle-pick-func) + (flag "model-viewer-1" 11 dm-game-secret-toggle-pick-func) + (flag "model-viewer-2" 12 dm-game-secret-toggle-pick-func) + (flag "model-viewer-3" 13 dm-game-secret-toggle-pick-func) + (flag "kleever-diaper" 33 dm-game-secret-toggle-pick-func) + (flag "bad-weather" 34 dm-game-secret-toggle-pick-func) + (flag "fast-weather" 35 dm-game-secret-toggle-pick-func) + (flag "daxter-pants" 36 dm-game-secret-toggle-pick-func) + (flag "darkjak-tracking" 37 dm-game-secret-toggle-pick-func) + (flag "commentary" 4 dm-game-secret-toggle-pick-func) + (flag "jak-is-jak2" 38 dm-game-secret-toggle-pick-func) + (flag "button-invis" 40 dm-game-secret-toggle-pick-func) + (flag "statistics" 39 dm-game-secret-toggle-pick-func) + (flag "gun-dark-4" 41 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-red-1" 42 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-red-2" 43 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-red-3" 44 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-yellow-1" 45 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-yellow-2" 46 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-yellow-3" 47 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-blue-1" 48 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-blue-2" 49 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-blue-3" 50 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-dark-1" 51 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-dark-2" 52 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-dark-3" 53 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-red" 54 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-yellow" 55 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-blue" 56 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-dark" 57 dm-game-secret-toggle-pick-func) + ) + (function "Print Load State" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (dotimes (gp-0 11) + (let ((s5-0 (-> *level* level gp-0))) + (if (!= (-> s5-0 status) 'inactive) + (format + #t + "~Tlevel ~2D ~16S ~16S bits #b~18,'0B ~A~%" + gp-0 + (-> s5-0 name) + (if (nonzero? (-> s5-0 info)) + (level-memory-mode->string (-> s5-0 info memory-mode)) + ) + (-> s5-0 memory-mask) + (-> s5-0 status) + ) + ) + ) + ) + #t + ) + ) + (menu "Continue") + (menu + "Settings" + (float-var + "sfx-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default sfx-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default sfx-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "ambient-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default ambient-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default ambient-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "music-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default music-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default music-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "dialog-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default dialog-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default dialog-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "contrast" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default contrast) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default contrast) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + (new 'static 'bfloat :data 0.25) + (new 'static 'bfloat :data 1.0) + 0 + ) + (float-var + "brightness" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default brightness) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default brightness) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + (new 'static 'bfloat :data 0.25) + (new 'static 'bfloat :data 1.0) + 0 + ) + (function + "reset contrast and brightness" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *setting-control* user-default contrast) 0.5) + (set! (-> *setting-control* user-default brightness) 0.5) + ) + ) + (menu + "Language" + (flag "english" 0 dm-setting-language) + (flag "french" 1 dm-setting-language) + (flag "german" 2 dm-setting-language) + (flag "spanish" 3 dm-setting-language) + (flag "italian" 4 dm-setting-language) + (flag "korean" 7 dm-setting-language) + (flag "russian" 8 dm-setting-language) + (flag "portuguese" 9 dm-setting-language) + (flag "uk-english" 11 dm-setting-language) + ) + (menu + "Audio Language" + (flag "english" 0 dm-setting-audio-language) + (flag "french" 1 dm-setting-audio-language) + (flag "german" 2 dm-setting-audio-language) + (flag "spanish" 3 dm-setting-audio-language) + (flag "italian" 4 dm-setting-audio-language) + (flag "commentary" 5 dm-setting-audio-language) + ) + (menu + "Subtitle Language" + (flag "english" 0 dm-setting-subtitle-language) + (flag "french" 1 dm-setting-subtitle-language) + (flag "german" 2 dm-setting-subtitle-language) + (flag "spanish" 3 dm-setting-subtitle-language) + (flag "italian" 4 dm-setting-subtitle-language) + (flag "korean" 7 dm-setting-subtitle-language) + (flag "russian" 8 dm-setting-subtitle-language) + (flag "portuguese" 9 dm-setting-subtitle-language) + (flag "uk-english" 11 dm-setting-subtitle-language) + ) + (flag + "play-hints " + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default play-hints) (not (-> *setting-control* user-default play-hints))) + ) + (-> *setting-control* user-default play-hints) + ) + ) + (flag + "subtitle " + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) + ) + (-> *setting-control* user-default subtitle) + ) + ) + (flag + "vibration" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default vibration) (not (-> *setting-control* user-default vibration))) + ) + (-> *setting-control* user-default vibration) + ) + ) + (menu + "Stereo Mode" + (flag "mono" 0 dm-setting-stereo-mode) + (flag "stereo" 1 dm-setting-stereo-mode) + (flag "surround" 2 dm-setting-stereo-mode) + ) + (flag + "camera-stick-dir" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default camera-stick-dir) + (not (-> *setting-control* user-default camera-stick-dir)) + ) + ) + (-> *setting-control* user-default camera-stick-dir) + ) + ) + (flag + "progressive-scan" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default set-video-mode) + (not (-> *setting-control* user-default set-video-mode)) + ) + ) + (-> *setting-control* user-default set-video-mode) + ) + ) + (flag + "border-mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default border-mode) (not (-> *setting-control* user-default border-mode))) + (set! (-> *level* play?) (-> *setting-control* user-default border-mode)) + ) + (-> *setting-control* user-default border-mode) + ) + ) + ) + (menu + "Features" + (flag "armor0" 52 dm-game-feature-toggle-pick-func) + (flag "armor1" 53 dm-game-feature-toggle-pick-func) + (flag "armor2" 54 dm-game-feature-toggle-pick-func) + (flag "armor3" 55 dm-game-feature-toggle-pick-func) + (flag "artifact-invis" 51 dm-game-feature-toggle-pick-func) + (flag "board" 18 dm-game-feature-toggle-pick-func) + (flag "board-training" 36 dm-game-feature-toggle-pick-func) + (flag "board-launch" 37 dm-game-feature-toggle-pick-func) + (flag "board-zap" 39 dm-game-feature-toggle-pick-func) + (flag "board-trail" 38 dm-game-feature-toggle-pick-func) + (flag "carry" 19 dm-game-feature-toggle-pick-func) + (flag "sidekick" 20 dm-game-feature-toggle-pick-func) + (flag "darkeco" 58 dm-game-feature-toggle-pick-func) + (flag "darkjak" 40 dm-game-feature-toggle-pick-func) + (flag "darkjak-smack" 41 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb0" 42 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb1" 43 dm-game-feature-toggle-pick-func) + (flag "darkjak-tracking" 44 dm-game-feature-toggle-pick-func) + (flag "darkjak-invinc" 45 dm-game-feature-toggle-pick-func) + (flag "lighteco" 57 dm-game-feature-toggle-pick-func) + (flag "lightjak" 46 dm-game-feature-toggle-pick-func) + (flag "lightjak-regen" 47 dm-game-feature-toggle-pick-func) + (flag "lightjak-swoop" 48 dm-game-feature-toggle-pick-func) + (flag "lightjak-freeze" 49 dm-game-feature-toggle-pick-func) + (flag "lightjak-shield" 50 dm-game-feature-toggle-pick-func) + (flag "gun-yellow-1" 9 dm-game-feature-toggle-pick-func) + (flag "gun-yellow-2" 10 dm-game-feature-toggle-pick-func) + (flag "gun-yellow-3" 11 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-yellow-ammo-1" 23 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-yellow-ammo-2" 24 dm-game-feature-toggle-pick-func) + (flag "gun-red-1" 6 dm-game-feature-toggle-pick-func) + (flag "gun-red-2" 7 dm-game-feature-toggle-pick-func) + (flag "gun-red-3" 8 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-red-ammo-1" 25 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-red-ammo-2" 26 dm-game-feature-toggle-pick-func) + (flag "gun-blue-1" 12 dm-game-feature-toggle-pick-func) + (flag "gun-blue-2" 13 dm-game-feature-toggle-pick-func) + (flag "gun-blue-3" 14 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-blue-ammo-1" 27 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-blue-ammo-2" 28 dm-game-feature-toggle-pick-func) + (flag "gun-dark-1" 15 dm-game-feature-toggle-pick-func) + (flag "gun-dark-2" 16 dm-game-feature-toggle-pick-func) + (flag "gun-dark-3" 17 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-dark-ammo-1" 29 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-dark-ammo-2" 30 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-speed" 21 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-damage" 22 dm-game-feature-toggle-pick-func) + (flag "pass-port-mh" 31 dm-game-feature-toggle-pick-func) + (flag "pass-port-inda" 32 dm-game-feature-toggle-pick-func) + (flag "pass-inda-indb" 33 dm-game-feature-toggle-pick-func) + (flag "pass-indb-sluma" 34 dm-game-feature-toggle-pick-func) + (flag "pass-slumb-genb" 35 dm-game-feature-toggle-pick-func) + (flag "turtle" 0 dm-game-vehicle-toggle-pick-func) + (flag "snake" 1 dm-game-vehicle-toggle-pick-func) + (flag "scorpion" 2 dm-game-vehicle-toggle-pick-func) + (flag "toad" 3 dm-game-vehicle-toggle-pick-func) + (flag "fox" 4 dm-game-vehicle-toggle-pick-func) + (flag "rhino" 5 dm-game-vehicle-toggle-pick-func) + (flag "mirage" 6 dm-game-vehicle-toggle-pick-func) + (flag "x-ride" 7 dm-game-vehicle-toggle-pick-func) + ) + ) + ) + ) + (let* ((s4-2 (debug-menu-find-from-template arg0 '("Game" "Continue"))) + (s3-2 + '(city + comb + desert + factory + forest + mine + nest + palace + sewer + wascity + arena + temple + tower + volcano + precursor + default + test + ) + ) + (a1-7 (car s3-2)) + ) + (while (not (null? s3-2)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s4-2) + (s0-0 debug-menu-make-from-template) + ) + (set! sv-16 arg0) + (let ((a1-8 (debug-menu-make-continue-sub-menu *game-info* (the-as symbol a1-7)))) + (s2-0 s1-0 (s0-0 sv-16 a1-8)) + ) + ) + (set! s3-2 (cdr s3-2)) + (set! a1-7 (car s3-2)) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Stats" + (flag "Poly" *stats-poly* dm-boolean-toggle-pick-func) + (flag "Collide" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Bsp" *stats-bsp* dm-boolean-toggle-pick-func) + (flag "Buffer" *stats-buffer* dm-boolean-toggle-pick-func) + (flag "Target" *stats-target* dm-boolean-toggle-pick-func) + (flag "Blerc" *stats-blerc* dm-boolean-toggle-pick-func) + (flag "Profile bars" *stats-profile-bars* dm-boolean-toggle-pick-func) + (flag "Perf" *stats-perf* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + (flag "Level 6" 6 dm-stats-memory-func) + (flag "Level 7" 7 dm-stats-memory-func) + (flag "Level 8" 8 dm-stats-memory-func) + (flag "Level 9" 9 dm-stats-memory-func) + ) + (function + "Print Entity Memory" + #f + ,(lambda () + (format #t "~%~%========================= Entity Memory =========================~%~%") + (let ((gp-0 (-> *level* level))) + (inspect (-> gp-0 0 art-group)) + (dotimes (s5-0 (-> gp-0 0 art-group art-group-array length)) + (inspect (-> gp-0 0 art-group art-group-array s5-0)) + ) + ) + #f + ) + ) + (function + "Print Texture Info" + #f + ,(lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (inspect *texture-page-dir*) + ) + ) + (function + "Print Texture Verbose" + #f + ,(lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (texture-page-dir-inspect *texture-page-dir* #t) + ) + ) + (function + "Print Merc Stats" + #f + ,(lambda () + (format #t "~%~%========================== Merc Stats ==========================~%~%") + (merc-stats) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Render" + (menu + "Background" + (flag "Textured" 0 dm-subdiv-draw-func) + (flag "Outline" 1 dm-subdiv-draw-func) + (flag "Gouraud" 2 dm-subdiv-draw-func) + (flag "Hack" 3 dm-subdiv-draw-func) + ) + (menu + "Background Scissor" + (flag "Textured" 0 dm-scissor-subdiv-draw-func) + (flag "Outline" 1 dm-scissor-subdiv-draw-func) + (flag "Gouraud" 2 dm-scissor-subdiv-draw-func) + (flag "Hack" 3 dm-scissor-subdiv-draw-func) + ) + (menu + "Foreground" + (flag "Textured" 0 dm-foreground-subdiv-draw-func) + (flag "Outline" 1 dm-foreground-subdiv-draw-func) + (flag "Gouraud" 2 dm-foreground-subdiv-draw-func) + (flag "Hack" 3 dm-foreground-subdiv-draw-func) + ) + (menu + "Ocean" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + (flag "Hack" 3 dm-ocean-subdiv-draw-func) + ) + (flag "SKY TEXTURES" 32 dm-texture-user-toggle-pick-func) + (flag "sky" 3 dm-vu1-user-toggle-pick-func) + (flag "ocean" 4 dm-vu1-user-toggle-pick-func) + (flag "ocean-wave" 5 dm-vu1-user-toggle-pick-func) + (flag "HFRAG TIE TEXTURES" 64 dm-texture-user-toggle-pick-func) + (flag "hfrag" 6 dm-vu1-user-toggle-pick-func) + (flag "hfrag-scissor" 7 dm-vu1-user-toggle-pick-func) + (flag "TFRAG TIE TEXTURES" #x1 dm-texture-user-toggle-pick-func) + (flag "tfrag" 8 dm-vu1-user-toggle-pick-func) + (flag "tie" 10 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap" 11 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor" 9 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor" 12 dm-vu1-user-toggle-pick-func) + (flag "tie-vanish" 13 dm-vu1-user-toggle-pick-func) + (flag "SHRUB TEXTURES" #x4 dm-texture-user-toggle-pick-func) + (flag "shrub-near" 18 dm-vu1-user-toggle-pick-func) + (flag "shrubbery" 17 dm-vu1-user-toggle-pick-func) + (flag "shrubbery-vanish" 20 dm-vu1-user-toggle-pick-func) + (flag "billboard" 19 dm-vu1-user-toggle-pick-func) + (flag "ALPHA TEXTURES" 1 dm-texture-user-toggle-pick-func) + (flag "tfrag-trans" 21 dm-vu1-user-toggle-pick-func) + (flag "tie-trans" 23 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-trans" 24 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-trans" 22 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-trans" 25 dm-vu1-user-toggle-pick-func) + (flag "PRIS TEXTURES" #x2 dm-texture-user-toggle-pick-func) + (flag "merc" 15 dm-vu1-user-toggle-pick-func) + (flag "emerc" 16 dm-vu1-user-toggle-pick-func) + (flag "generic" 14 dm-vu1-user-toggle-pick-func) + (flag "WATER TEXTURES" 2 dm-texture-user-toggle-pick-func) + (flag "tfrag-water" 26 dm-vu1-user-toggle-pick-func) + (flag "tie-water" 28 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-water" 29 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-water" 27 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-water" 30 dm-vu1-user-toggle-pick-func) + (flag "SPRITE TEXTURES" 8 dm-texture-user-toggle-pick-func) + (flag "sprite" 31 dm-vu1-user-toggle-pick-func) + (flag "shadow" 32 dm-vu1-user-toggle-pick-func) + (flag "shadow-debug" *shadow-debug* dm-boolean-toggle-pick-func) + (flag "depth-cue" 36 dm-vu1-user-toggle-pick-func) + (flag "WARP TEXTURES" 4 dm-texture-user-toggle-pick-func) + (flag "HUD TEXTURES" 16 dm-texture-user-toggle-pick-func) + (flag "all on" #f dm-vu1-user-all-pick-func) + (flag "all off" #f dm-vu1-user-none-pick-func) + (flag "all textures on" #x3ff dm-texture-user-set-pick-func) + (flag "all textures off" 0 dm-texture-user-set-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Collision" + (menu + "Collision Renderer" + (flag "On" 0 dm-col-rend-on-func) + (flag "Track Player" 0 dm-col-rend-track-func) + (flag "Track Camera" 1 dm-col-rend-track-func) + (float-var " Dist" #f dm-col-rend-cam-dist 10 1 #t 0 80 1) + (flag "Fixed Pos" 2 dm-col-rend-track-func) + (float-var "Size" #f dm-col-rend-size 10 1 #t 1 20 1) + (flag "Outline" 0 dm-col-rend-outline-func) + (flag "Show Back-faces" 0 dm-col-rend-back-face-func) + (flag "Show Normals" 0 dm-col-rend-normals-func) + (flag "Ghost Hidden" 0 dm-col-rend-ghost-hidden-func) + (menu + "Show Only" + (flag "(board)" 1 dm-col-rend-show-only-set-func) + (flag "(grind)" 2 dm-col-rend-show-only-set-func) + (flag "(grindonly)" 4 dm-col-rend-show-only-set-func) + (flag "melt" 16384 dm-col-rend-show-only-toggle-func) + (flag "noboard" 8 dm-col-rend-show-only-toggle-func) + (flag "nocamera" 16 dm-col-rend-show-only-toggle-func) + (flag "noedge" 32 dm-col-rend-show-only-toggle-func) + (flag "noendlessfall" 64 dm-col-rend-show-only-toggle-func) + (flag "noentity" 128 dm-col-rend-show-only-toggle-func) + (flag "nogrind" 256 dm-col-rend-show-only-toggle-func) + (flag "nojak" 512 dm-col-rend-show-only-toggle-func) + (flag "nolineofsight" 1024 dm-col-rend-show-only-toggle-func) + (flag "nomech" 2048 dm-col-rend-show-only-toggle-func) + (flag "nopilot" 4096 dm-col-rend-show-only-toggle-func) + (flag "noproj" 8192 dm-col-rend-show-only-toggle-func) + (flag "probe" 32768 dm-col-rend-show-only-toggle-func) + (flag "Select All" 49144 dm-col-rend-show-only-set-func) + (flag "Unselect All" 0 dm-col-rend-show-only-set-func) + ) + (menu + "Find" + (flag "background" 1 dm-col-rend-cspec-toggle) + (flag "obstacles" 2 dm-col-rend-cspec-toggle) + (flag "pushers" 4 dm-col-rend-cspec-toggle) + (flag "Jak" 8 dm-col-rend-cspec-toggle) + (flag "other" 16 dm-col-rend-cspec-toggle) + ) + ) + (flag "Collision Cache" *display-collide-cache* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (flag "Ground Stats" *display-ground-stats* dm-boolean-toggle-pick-func) + (flag "Hipri Collision Marks" *display-hipri-collision-marks* dm-boolean-toggle-pick-func) + (flag "Edge Collision Marks" *display-edge-collision-marks* dm-boolean-toggle-pick-func) + (flag "Collide Stats" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Render Collision" *display-render-collision* dm-boolean-toggle-pick-func) + (flag "Collide List Boxes" *collide-list-boxes* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Display" + (flag "Profile" *display-profile* dm-boolean-toggle-pick-func) + (flag "Ticks" *profile-ticks* dm-boolean-toggle-pick-func) + (flag "File Info" *display-file-info* dm-boolean-toggle-pick-func) + (flag "Level Spheres" *display-level-spheres* dm-boolean-toggle-pick-func) + (flag "Camera Marks" *display-camera-marks* dm-boolean-toggle-pick-func) + (flag "Camera Info" *display-camera-info* dm-boolean-toggle-pick-func) + (flag "Geometry Marks" *display-geo-marks* dm-boolean-toggle-pick-func) + (flag "Art Control" *display-art-control* dm-boolean-toggle-pick-func) + (flag "Gui Control" *display-gui-control* dm-boolean-toggle-pick-func) + (flag "Instance Info" *display-instance-info* dm-boolean-toggle-pick-func) + (menu + "strip lines" + (flag "strippable" 1 dm-strip-lines-toggle-pick-func) + (flag "convertible" 2 dm-strip-lines-toggle-pick-func) + (flag "edgeable" 4 dm-strip-lines-toggle-pick-func) + (flag "ordinary" 8 dm-strip-lines-toggle-pick-func) + (flag "color mismatch" 16 dm-strip-lines-toggle-pick-func) + (flag "shader mismatch" 32 dm-strip-lines-toggle-pick-func) + (flag "uv mismatch" 64 dm-strip-lines-toggle-pick-func) + (flag "too big" 128 dm-strip-lines-toggle-pick-func) + (flag "good" 3 dm-strip-lines-set-pick-func) + (flag "bad" 240 dm-strip-lines-set-pick-func) + (flag "all edges" 255 dm-strip-lines-set-pick-func) + (flag "strips" 256 dm-strip-lines-set-pick-func) + (flag "frags" 512 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (menu + "collision mesh" + (flag "wall" 1024 dm-strip-lines-toggle-pick-func) + (flag "ground" 2048 dm-strip-lines-toggle-pick-func) + (flag "all" 3072 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (flag "Texture Distances" *display-texture-distances* dm-boolean-toggle-pick-func) + (flag "Texture Download" *display-texture-download* dm-boolean-toggle-pick-func) + (flag "Level Border" *display-level-border* dm-boolean-toggle-pick-func) + (flag "Split Boxes" *display-split-boxes* dm-boolean-toggle-pick-func) + (flag "Split Box Info" *display-split-box-info* dm-boolean-toggle-pick-func) + (flag "Memcard Info" *display-memcard-info* dm-boolean-toggle-pick-func) + (flag "Trail Graph" *display-trail-graph* dm-boolean-toggle-pick-func) + (flag "Color Bars" *display-color-bars* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Actor" + (flag "Spawn Actors" *spawn-actors* dm-boolean-toggle-pick-func) + (function "Reset Actors" #f ,(lambda () (reset-actors 'debug))) + (function "Traffic Start" #f ,(lambda () (let ((gp-0 traffic-start)) + (if (valid? gp-0 function "" #t 0) + (gp-0) + ) + ) + ) + ) + (function "Traffic Kill" #f ,(lambda () (let ((gp-0 traffic-kill)) + (if (valid? gp-0 function "" #t 0) + (gp-0) + ) + ) + ) + ) + (menu + "Bot" + (function + "Bot Next" + #f + ,(lambda () + (send-event (process-by-name "sig-atoll-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-sewer-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-escort-1" *active-pool*) 'skip) + (send-event (process-by-name "squid-2" *active-pool*) 'skip) + (send-event (process-by-name "metalkor-1" *active-pool*) 'skip) + (send-event (process-by-name "sig-under-1" *active-pool*) 'skip) + (send-event (process-by-name "scorpion-gun-manager-1" *active-pool*) 'skip) + (send-event (process-by-name "terraformer-1" *active-pool*) 'skip) + ) + ) + (menu + "Bot Marks" + (flag "course spots" 1 display-bot-marks-toggle-pick-func) + (flag "task spots" 2 display-bot-marks-toggle-pick-func) + (flag "all on" 3 display-bot-marks-set-pick-func) + (flag "all off" 0 display-bot-marks-set-pick-func) + ) + ) + (menu + "Actor Compaction" + (flag "off" #f dm-compact-actor-pick-func) + (flag "on" #t dm-compact-actor-pick-func) + (flag "debug" debug dm-compact-actor-pick-func) + ) + (flag "Traffic height map" *display-traffic-height-map* dm-boolean-toggle-pick-func) + (flag "View Anims" *debug-view-anims* dm-boolean-toggle-pick-func) + (flag "Unkillable" *debug-unkillable* dm-boolean-toggle-pick-func) + (flag "Jak Vehicle Unkillable" *debug-player-vehicle-unkillable* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Actor Vis" *vis-actors* dm-boolean-toggle-pick-func) + (float-var + "Entity clock" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *display* (nonzero? *display*)) + (update-rates! (-> *display* entity-clock) arg2) + ) + ) + ((or (not *display*) (zero? *display*)) + 0 + ) + (else + (-> *display* entity-clock clock-ratio) + ) + ) + ) + 4 + (new 'static 'bfloat :data 0.01) + #t + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 0.0001) + ) + (flag "Battle Marks" *display-battle-marks* dm-boolean-toggle-pick-func) + (menu + "Hover Marks" + (flag "Nav Network" *display-nav-network* dm-boolean-toggle-pick-func) + (flag "Debug Hover" *debug-hover* dm-boolean-toggle-pick-func) + ) + (flag "Path Marks" *display-path-marks* dm-boolean-toggle-pick-func) + (flag "Nav Marks" *display-nav-marks* dm-boolean-toggle-pick-func) + (flag "Vol Marks" *display-vol-marks* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (menu + "Debug Actor" + (float-var "lod0-dist" 0 dm-debug-actor-lod-dist 10 (new 'static 'bfloat :data 1.0) #f 0 0 1) + (float-var "lod1-dist" 1 dm-debug-actor-lod-dist 10 (new 'static 'bfloat :data 1.0) #f 0 0 1) + (float-var "lod2-dist" 2 dm-debug-actor-lod-dist 10 (new 'static 'bfloat :data 1.0) #f 0 0 1) + (flag "Joint Axes" *display-joint-axes* dm-boolean-toggle-pick-func) + ) + (menu + "Actor Vis" + (flag "off" #f dm-actor-vis-pick-func) + (flag "box" box dm-actor-vis-pick-func) + (flag "sphere" sphere dm-actor-vis-pick-func) + (flag "all" #t dm-actor-vis-pick-func) + ) + (menu + "Actor Marks" + (flag "off" #f dm-actor-marks-pick-func) + (flag "alive entities" #t dm-actor-marks-pick-func) + (flag "all entities" full dm-actor-marks-pick-func) + (flag "processes" process dm-actor-marks-pick-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Target" + (menu + "Mode" + (function + "normal" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (send-event *target* 'change-mode 'normal)) + ) + (function "racer" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'racer #f) + ) + ) + (function "flut" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'flut #f) + ) + ) + (function "board" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature gun)) + (logior! (-> *game-info* debug-features) (game-feature gun)) + (send-event *target* 'change-mode 'gun #f (pickup-type none)) + ) + ) + (function + "darkjak" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + ) + (function + "lightjak" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 5) + ) + ) + (function "indax" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f #f) + ) + ) + (function + "invisible" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'invisible #f) + ) + ) + ) + (menu + "Pilot Mode" + (function "h-bike-a" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 0))) + (function "h-bike-b" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 1))) + (function "h-bike-c" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 2))) + (function "h-bike-d" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 6))) + (function "h-car-a" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 3))) + (function "h-car-b" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 4))) + (function "h-car-c" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 5))) + (function "h-hellcat" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 7))) + (function "h-warf" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 8))) + (function "h-glider" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 9))) + (function "h-sled" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 10))) + (function "v-turtle" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 12))) + (function "v-snake" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 13))) + (function "v-scorpion" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 14))) + (function "v-toad" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 15))) + (function "v-fox" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 16))) + (function "v-rhino" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 17))) + (function "v-mirage" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 18))) + (function "v-x-ride" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 19))) + (function "v-marauder" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 20))) + (function "v-faccar" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 21))) + (function "v-catapult" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 22))) + (function "v-marauder-b" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 23))) + (function "evantestbike" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 29))) + (function "test-car" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 25))) + (function "wbike-test" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 26))) + ) + (flag "Target" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Darkjak" + (function + "get all" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* debug-features) + ) + ) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + ) + ) + (function + "debug" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* debug-features) + ) + ) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage active bomb0 no-anim disable-force-on)) + ) + ) + (function + "manual" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + ) + (function + "rapid" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage bomb0)) + ) + ) + (function "smack" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1)) + ) + ) + (function + "bomb0" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1 invinc)) + ) + ) + (function + "bomb1" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1 invinc giant)) + ) + ) + (function + "tracking" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1 invinc giant no-anim)) + ) + ) + (function + "invinc" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event + *target* + 'change-mode + 'darkjak + #f + (darkjak-stage force-on bomb0 invinc giant no-anim disable-force-on) + ) + ) + ) + ) + (menu + "Lightjak" + (function + "get all" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature lightjak lightjak-regen lightjak-swoop lightjak-freeze lightjak-shield) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + ) + ) + (function + "debug" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature lightjak lightjak-regen lightjak-swoop lightjak-freeze lightjak-shield) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + (send-event *target* 'change-mode 'lightjak #f 6) + ) + ) + (function + "manual" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 5) + ) + ) + (function + "normal" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 4) + ) + ) + ) + (flag "Target Marks" *display-target-marks* dm-boolean-toggle-pick-func) + (flag "Gun Marks" *gun-marks* dm-boolean-toggle-pick-func) + (flag "Target Stats" *stats-target* dm-boolean-toggle-pick-func) + (flag "Sidekick Stats" *display-sidekick-stats* dm-boolean-toggle-pick-func) + (flag "Invulnerable" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (logxor! (-> *target* target-flags) (target-flags tf2)) + ) + ) + (and *target* (logtest? (-> *target* target-flags) (target-flags tf2))) + ) + ) + (flag + "Endless Ammo" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (set! (-> *target* target-flags) (logxor (target-flags tf16) (the-as int (-> *target* target-flags)))) + ) + ) + (and *target* (logtest? (target-flags tf16) (-> *target* target-flags))) + ) + ) + (function + "Full Stuff" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (send-event *target* 'get-pickup (pickup-type health) 1000.0) + (send-event *target* 'get-pickup (pickup-type shield) 1000.0) + (send-event *target* 'get-pickup (pickup-type skill) 100.0) + (send-event *target* 'get-pickup (pickup-type gem) 100.0) + (send-event *target* 'get-pickup (pickup-type ammo-yellow) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-red) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-blue) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-dark) 1000.0) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature + gun + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + board + darkjak + ) + (-> *game-info* features) + ) + ) + ) + (let ((v0-10 + (logior (game-feature gun gun-red-1 gun-yellow-1 gun-blue-1 gun-dark-1 board darkjak) + (-> *game-info* debug-features) + ) + ) + ) + (set! (-> *game-info* debug-features) (the-as game-feature v0-10)) + v0-10 + ) + ) + ) + (function + "Dump Stuff" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (send-event *target* 'get-pickup (pickup-type shield) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-yellow) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-red) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-blue) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-dark) -1000.0) + ) + ) + (function + "Trick Mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (send-event *target* 'get-pickup (pickup-type trick-judge) 18000.0) + ) + ) + (function + "Reset Trans" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when *target* + (position-in-front-of-camera! (target-pos 0) 40960.0 4096.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control quat-for-control)) + (quaternion-identity! (-> *target* control dir-targ)) + ) + ) + ) + (function + "Zero Trans" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when *target* + (set-vector! (-> *target* control trans) 0.0 163840.0 0.0 1.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control quat-for-control)) + (quaternion-identity! (-> *target* control dir-targ)) + ) + ) + ) + (flag "Slow Frame Rate" *slow-frame-rate* dm-boolean-toggle-pick-func) + (function "Print Pos" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 (target-pos 0))) + (format #t "~6,,2m ~6,,2m ~6,,2m~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) + ) + 0 + ) + ) + (flag "Goggles" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((not *target*) + ) + ((= (-> *target* goggles-interp-targ) 0.0) + (set! (-> *target* goggles-interp-targ) 1.0) + ) + (else + (set! (-> *target* goggles-interp-targ) 0.0) + ) + ) + ) + (if *target* + (!= (-> *target* goggles-interp-targ) 0.0) + #f + ) + ) + ) + (flag "Scarf" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((not *target*) + ) + ((= (-> *target* scarf-interp-targ) 0.0) + (set! (-> *target* scarf-interp-targ) 1.0) + ) + (else + (set! (-> *target* scarf-interp-targ) 0.0) + ) + ) + ) + (if *target* + (!= (-> *target* scarf-interp-targ) 0.0) + #f + ) + ) + ) + (function + "Save Continue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (if *target* + (trsq->continue-point (-> *target* control)) + ) + ) + ) + (flag "RC Board Controls" *target-rc-board-controls* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-camera-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Racing" + (flag "Desertb" 0 dm-select-race-pick-func) + (flag "Desert Rally" 2 dm-select-race-pick-func) + (int-var "Select Path" 0 dm-select-race-path 10 1 #t 0 7) + (menu + "Race Marks" + (flag "Path 0 (Red)" 1 display-race-marks-toggle-pick-func) + (flag "Path 1 (Green)" 2 display-race-marks-toggle-pick-func) + (flag "Path 2 (Blue)" 4 display-race-marks-toggle-pick-func) + (flag "Path 3 (Yellow)" 8 display-race-marks-toggle-pick-func) + (flag "Path 4 (Cyan)" 16 display-race-marks-toggle-pick-func) + (flag "Path 5 (Violet)" 32 display-race-marks-toggle-pick-func) + (flag "Path 6 (Orange)" 64 display-race-marks-toggle-pick-func) + (flag "Path 7 (Black)" 128 display-race-marks-toggle-pick-func) + (flag "All Paths On" 255 display-race-marks-set-pick-func) + (flag "All Off" 0 display-race-marks-set-pick-func) + ) + (flag "Race Mesh" *display-race-mesh* dm-boolean-toggle-pick-func) + (function + "Record Selected Path" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! *race-record-path* #t) + (dm-play-race *select-race* #t) + ) + ) + (function + "Play Race" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! *race-record-path* #f) + (dm-play-race *select-race* #f) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Nav Graph" + (function + "Start Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (when (not (get-nav-graph-editor)) + (let ((t9-1 run-nav-graph-editor) + (a0-1 'test) + ) + (t9-1 a0-1) + ) + ) + ) + ) + (function + "Exit Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (if (get-nav-graph-editor) + (exit-nav-graph-editor) + ) + ) + ) + (function + "Toggle Plane Mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (if a0-1 + ((method-of-object a0-1 nav-graph-editor-method-64)) + ) + ) + ) + ) + (function + "Toggle Hover Mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (if a0-1 + ((method-of-object a0-1 nav-graph-editor-method-65)) + ) + ) + ) + ) + (menu + "Load" + (function + "Hover Foresta" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'foresta + (t9-1) + ) + ) + ) + ) + ) + (function + "Hover Sewc" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'sewc + (t9-1) + ) + ) + ) + ) + ) + (function + "Hover Sewg" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'sewg + (t9-1) + ) + ) + ) + ) + ) + (function + "Hover Sewl" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'sewl + (t9-1) + ) + ) + ) + ) + ) + (function + "Traffic" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'traffic + (t9-1) + ) + ) + ) + ) + ) + (function + "Minimap" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'minimap + (t9-1) + ) + ) + ) + ) + ) + (function + "flyingsaw_2" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'flyingsaw_2 + (t9-1) + ) + ) + ) + ) + ) + (function + "flyingsaw_3" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'flyingsaw_3 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-1" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-1 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-2" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-2 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-3" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-3 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-4" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-4 + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Beast" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'beast + (t9-1) + ) + ) + ) + ) + ) + (function + "Was Minimap" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'wasminimap + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Rescue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'desrescue + (t9-1) + ) + ) + ) + ) + ) + (function + "Assault" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'assault + (t9-1) + ) + ) + ) + ) + ) + (function + "Timer Chase 1" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'timer-chase-1 + (t9-1) + ) + ) + ) + ) + ) + (function + "ProtectHQ" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'protect-hq + (t9-1) + ) + ) + ) + ) + ) + (function + "Blow Tower" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'blow-tower + (t9-1) + ) + ) + ) + ) + ) + (function + "desert-lizard" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'desert-lizard + (t9-1) + ) + ) + ) + ) + ) + (function + "terraformer-walk" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'terraformer-walk + (t9-1) + ) + ) + ) + ) + ) + (function + "terraformer-fly" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'terraformer-fly + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Beast Battle" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'beast-battle + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Chase Marauder" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'desert-chase-marauder + (t9-1) + ) + ) + ) + ) + ) + ) + (function + "Save" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (if a0-1 + ((method-of-object a0-1 nav-graph-editor-method-67)) + ) + ) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Nav Mesh" + (function + "Start Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (not *nav-mesh-editor*) + (kill-by-type nav-mesh-editor *active-pool*) + (let ((gp-0 (get-process *default-dead-pool* nav-mesh-editor #x4000 1))) + (when gp-0 + (let ((t9-2 (method-of-type nav-mesh-editor activate))) + (t9-2 (the-as nav-mesh-editor gp-0) *entity-pool* "nav-mesh-editor" (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-4 gp-0) + (a1-4 nav-mesh-editor-init) + ) + ((the-as (function object object none) t9-3) a0-4 a1-4) + ) + (-> gp-0 ppointer) + ) + ) + ) + ) + ) + (function + "Exit Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (kill-by-type nav-mesh-editor *active-pool*)) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Ocean" + (menu + "Ocean Height" + (flag "zero" 1 dm-ocean-height-func) + (flag "far-below" 2 dm-ocean-height-func) + (flag "sewer-start" 3 dm-ocean-height-func) + (flag "sewer-hi" 4 dm-ocean-height-func) + (flag "sewer-med" 5 dm-ocean-height-func) + (flag "sewer-lo" 6 dm-ocean-height-func) + ) + (menu + "Ocean Subdiv" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Time of day" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "palette 0" 16 dm-time-of-day-func) + (flag "palette 1" 32 dm-time-of-day-func) + (flag "palette 2" 64 dm-time-of-day-func) + (flag "palette 3" 128 dm-time-of-day-func) + (flag "palette 4" 256 dm-time-of-day-func) + (flag "palette 5" 512 dm-time-of-day-func) + (flag "palette 6" 1024 dm-time-of-day-func) + (flag "palette 7" 2048 dm-time-of-day-func) + (flag "on" #f dm-time-of-day-pick-func) + (flag "Fast" *time-of-day-fast* dm-time-of-day-func2) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Mood" + (flag + "Overide Enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-enable) (not (-> *time-of-day-context* overide-enable))) + ) + (-> *time-of-day-context* overide-enable) + ) + ) + (menu + "Weather" + (flag + "Overide Weather Enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* overide-weather-flag) (not (-> *mood-control* overide-weather-flag))) + ) + (-> *mood-control* overide-weather-flag) + ) + ) + (flag + "Display Values" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* display-flag) (not (-> *mood-control* display-flag))) + ) + (-> *mood-control* display-flag) + ) + ) + (float-var + "Clouds" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide cloud) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0 + ) + (else + (-> *mood-control* overide cloud) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + (float-var + "Fog" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide fog) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0 + ) + (else + (-> *mood-control* overide fog) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + ) + (menu + "Colors" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Ambient Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + 2 + 0 + ) + (float-var + "Light Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + 2 + 0 + ) + (function + "reset selected time" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as + pointer + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + (the-as + pointer + (-> *debug-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + 32 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + 1.0 + ) + ) + ) + (function + "reset all times" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! (the-as pointer *overide-mood-color-table*) (the-as pointer *debug-mood-color-table*) 256) + (dotimes (v1-0 8) + (set! (-> *overide-mood-color-table* data v1-0 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-0 amb-color w) 1.0) + ) + #f + ) + ) + ) + (menu + "Fog" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + -1000 + 10000 + 0 + ) + (float-var + "End" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 10000 + 0 + ) + (float-var + "Max" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (float-var + "Min" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (function + "reset selected time" + #f + ,(lambda () + (mem-copy! + (the-as + pointer + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + (the-as + pointer + (-> *debug-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + 48 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + ) + (function + "reset all times" + #f + ,(lambda () + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer *debug-mood-fog-table*) 384) + (dotimes (v1-0 8) + (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + ) + ) + #f + ) + ) + ) + (menu + "Palette" + (flag "palette 0" 0 dm-time-of-day-palette-func) + (flag "palette 1" 1 dm-time-of-day-palette-func) + (flag "palette 2" 2 dm-time-of-day-palette-func) + (flag "palette 3" 3 dm-time-of-day-palette-func) + (flag "palette 4" 4 dm-time-of-day-palette-func) + (flag "palette 5" 5 dm-time-of-day-palette-func) + (flag "palette 6" 6 dm-time-of-day-palette-func) + (flag "palette 7" 7 dm-time-of-day-palette-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (function + "reset selected time" + #f + ,(lambda () (let ((v0-0 (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette)))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + (function "reset all times" #f ,(lambda () + (dotimes (v1-0 8) + (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) + ) + #f + ) + ) + ) + (menu + "Filter" + (float-var + "Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + 2 + 0 + ) + (function "reset filter" #f ,(lambda () (let ((v0-0 (-> *time-of-day-context* filter-color))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + ) + (menu + "Sky" + (float-var + "Cloud Min" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-min) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-min) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Cloud Max" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-max) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-max) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (function + "reset sky" + #f + ,(lambda () + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) + ) + ) + ) + (function "Print mood tables" #f ,(lambda () (print-mood-tables))) + (function + "reset everything" + #f + ,(lambda () + (mem-copy! (the-as pointer *overide-mood-color-table*) (the-as pointer *debug-mood-color-table*) 256) + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer *debug-mood-fog-table*) 384) + (dotimes (v1-0 8) + (set! (-> *overide-mood-color-table* data v1-0 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-0 amb-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + ) + (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) + ) + (set-vector! (-> *time-of-day-context* filter-color) 1.0 1.0 1.0 1.0) + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Sound" + (flag "Effect Debug" *debug-effect-control* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) + (function "Reload Banks" #f sound-bank-reload) + (function "List Sounds" #f ,(lambda () (list-sounds))) + (function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)))) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-shader-menu arg0)) + (debug-menu-append-item s5-0 (debug-menu-make-instance-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Bug Report" + (flag "display" *display-bug-report* dm-boolean-toggle-pick-func) + (function "Start" #f ,(lambda () (bug-report-start))) + (function "Stop" #f ,(lambda () (bug-report-stop))) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Scene" + (menu + "Scene Info" + (flag "channel" 1 display-scene-control-toggle-pick-func) + (flag "anim name" 2 display-scene-control-toggle-pick-func) + (flag "dma size" 4 display-scene-control-toggle-pick-func) + (flag "bounds spheres" 8 display-scene-control-toggle-pick-func) + (flag "actors" 16 display-scene-control-toggle-pick-func) + (flag "actor-marks" 32 display-scene-control-toggle-pick-func) + (flag "special fma spheres" 64 display-scene-control-toggle-pick-func) + (flag "all on" 95 display-scene-control-set-pick-func) + (flag "all off" 0 display-scene-control-set-pick-func) + ) + (menu + "arena" + (function + "arena-training-1-intro" + ("waspala-intro-training" "arena-training-1-intro") + dm-scene-load-pick-func + ) + (function "arena-fight-1-intro" ("wasstada-pre-fight-1" "arena-fight-1-intro") dm-scene-load-pick-func) + (function "arena-fight-1-res" ("wasstada-fight" "arena-fight-1-res") dm-scene-load-pick-func) + (function "wascity-chase-intro" ("wasstada-wascity-chase" "wascity-chase-intro") dm-scene-load-pick-func) + (function "arena-fight-2-res" ("wasstada-fight" "arena-fight-2-res") dm-scene-load-pick-func) + (function "arena-fight-3-intro" ("wasstada-fight" "arena-fight-3-intro") dm-scene-load-pick-func) + (function "arena-fight-3-res" ("wasstada-fight" "arena-fight-3-res") dm-scene-load-pick-func) + ) + (menu + "city" + (function "sewer-hum-kg-entrance" ("ctyslumb-sewer" "sewer-hum-kg-entrance") dm-scene-load-pick-func) + (function "sewer-kg-entrance" ("ctyinda-sewer" "sewer-kg-entrance") dm-scene-load-pick-func) + (function "sewer-genb-entrance" ("ctygenb-sewer" "sewer-genb-entrance") dm-scene-load-pick-func) + (function "city-gun-course-intro" ("gungame-start" "city-gun-course-intro") dm-scene-load-pick-func) + (function "city-gun-course-1-res" ("gungame-start" "city-gun-course-1-res") dm-scene-load-pick-func) + (function "city-gun-course-2-intro" ("gungame-start" "city-gun-course-2-intro") dm-scene-load-pick-func) + (function "city-gun-course-2-res" ("gungame-start" "city-gun-course-2-res") dm-scene-load-pick-func) + (function "city-port-attack-intro-b" ("ctyport-hiphog" "ctyport-attack-get-on-nuke") dm-scene-load-pick-func) + (function "city-port-attack-res" ("ctyport-attack-res" "city-port-attack-res") dm-scene-load-pick-func) + (function "city-hijack-vehicle-res" ("ctyhijack-res" "city-hijack-vehicle-res") dm-scene-load-pick-func) + (function "city-get-dark-punch" ("mhcitya-fma" "city-get-dark-punch") dm-scene-load-pick-func) + (function "sewer-met-hum-intro" ("ctygenb-samos" "sewer-met-hum-intro") dm-scene-load-pick-func) + (function "city-destroy-grid-res" ("ctyinda-grid-res-a" "city-destroy-grid-res") dm-scene-load-pick-func) + (function "tower-destroy-intro" ("mhcityb-tower-fma" "tower-destroy-intro") dm-scene-load-pick-func) + ) + (menu + "desert" + (function "nest-destroy-barrier" ("desertg-egg-wall-scene" "nest-destroy-barrier") dm-scene-load-pick-func) + (function "nest-hunt-intro" ("desertg-egg-wall-scene" "nest-hunt-intro") dm-scene-load-pick-func) + (function "nest-hunt-res" ("desertg-hunt-res-start" "nest-hunt-res") dm-scene-load-pick-func) + (function + "desert-oasis-defense-res" + ("desert-ashelin-movie" "desert-oasis-defense-res") + dm-scene-load-pick-func + ) + (function "desert-rescue-res-a" ("desert-rescue-movie" "desert-rescue-res-a") dm-scene-load-pick-func) + (function "desert-hover-res" ("desert-hover-movie" "desert-hover-res") dm-scene-load-pick-func) + (function "desert-lizard-catch" ("desert-lizard-corral" "desert-lizard-catch") dm-scene-load-pick-func) + (function "desert-lizard-catch-2" ("desert-lizard-corral" "desert-lizard-catch-2") dm-scene-load-pick-func) + (function "desert-lizard-catch-3" ("desert-lizard-corral" "desert-lizard-resolution") dm-scene-load-pick-func) + (function + "desert-oasis-defense-res-b" + ("desert-ashelin-movie" "desert-oasis-defense-res-b") + dm-scene-load-pick-func + ) + (function "desert-glide-res" ("volcanox-vola-start" "desert-glide-res") dm-scene-load-pick-func) + (function "desert-courserace-win" ("desertg-hunt-res-start" "desert-courserace-win") dm-scene-load-pick-func) + (function + "desert-final-boss-res" + ("desert-final-boss-res-movie-a" "desert-final-boss-res") + dm-scene-load-pick-func + ) + (function + "desert-final-boss-res-b" + ("desert-final-boss-res-movie" "desert-final-boss-res-b") + dm-scene-load-pick-func + ) + (function + "desert-final-boss-intro" + ("wasall-final-boss-intro-movie" "desert-final-boss-intro") + dm-scene-load-pick-func + ) + (function + "full desert-jak-gets-on-terraformer" + ("desert-boss-res-a" ("desert-jak-gets-on-t-a" "desert-jak-gets-on-t-b" "desert-jak-gets-on-t-c")) + dm-scene-load-pick-func + ) + (function "desert-jak-gets-on-t-a" ("desert-boss-res-a" "desert-jak-gets-on-t-a") dm-scene-load-pick-func) + (function "desert-jak-gets-on-t-b" ("desert-boss-res-b" "desert-jak-gets-on-t-b") dm-scene-load-pick-func) + (function "desert-jak-gets-on-t-c" ("desert-boss-res-b" "desert-jak-gets-on-t-c") dm-scene-load-pick-func) + (function + "full outro" + ("desert-final-boss-res-movie-a" ("desert-final-boss-res" "desert-final-boss-res-b" "arena-outro")) + dm-scene-load-pick-func + ) + ) + (menu + "comb" + (function "comb-exit" ("combn-start" "comb-exit") dm-scene-load-pick-func) + (function "comb-entrance-temple" ("temple-comb-entrance" "comb-entrance-temple") dm-scene-load-pick-func) + (function "catacombs-wild-ride-res" ("railx-start" "catacombs-wild-ride-res") dm-scene-load-pick-func) + (function "catacomb-get-shield" ("combn-start" "catacomb-get-shield") dm-scene-load-pick-func) + ) + (menu + "factory" + (function "factory-sky-battle-res" ("factorya-movie" "factory-sky-battle-res") dm-scene-load-pick-func) + (function + "factory-sky-battle-intro-b" + ("factorya-intro-b" "factory-sky-battle-intro-b") + dm-scene-load-pick-func + ) + (function "factory-indax-1-intro" ("factoryc-start" "factory-indax-1-intro") dm-scene-load-pick-func) + (function "factory-indax-2-intro" ("factoryc-start" "factory-indax-2-intro") dm-scene-load-pick-func) + (function "factory-indax-3-intro" ("factoryc-start" "factory-indax-3-intro") dm-scene-load-pick-func) + (function "factory-indax-4-intro" ("factoryc-start" "factory-indax-4-intro") dm-scene-load-pick-func) + (function "factory-boss-intro" ("factoryd-start" "factory-boss-intro") dm-scene-load-pick-func) + (function "factory-boss-res" ("factoryd-res-fma" "factory-boss-res") dm-scene-load-pick-func) + ) + (menu + "forest" + (function "forest-tower" ("foresta-start" "forest-tower") dm-scene-load-pick-func) + (function + "forest-turn-on-machine-res" + ("forest-pillar-start" "forest-turn-on-machine-res") + dm-scene-load-pick-func + ) + (function "precursor-tour-res" ("precura-foresta" "precursor-tour-res") dm-scene-load-pick-func) + (function "forest-ring-chase-res" ("foresta-start" "forest-ring-chase-res") dm-scene-load-pick-func) + (function "forest-res-b" ("foresta-start" "forest-res-b") dm-scene-load-pick-func) + ) + (menu + "freehq" + (function "factory-sky-battle-intro" ("freehq-movie" "factory-sky-battle-intro") dm-scene-load-pick-func) + (function "city-protect-hq-intro" ("freehq-movie" "city-protect-hq-intro") dm-scene-load-pick-func) + (function "city-protect-hq-res" ("freehq-movie" "city-protect-hq-res") dm-scene-load-pick-func) + (function "city-blow-tower-intro" ("freehq-movie" "city-blow-tower-intro") dm-scene-load-pick-func) + (function "temple-defend-intro" ("freehq-movie" "temple-defend-intro") dm-scene-load-pick-func) + ) + (menu + "hiphog" + (function "sewer-kg-met-intro" ("hiphog-movie" "sewer-kg-met-intro") dm-scene-load-pick-func) + (function "port-assault-intro" ("hiphog-movie" "port-assault-intro") dm-scene-load-pick-func) + (function "city-blow-barricade-intro" ("hiphog-movie" "city-blow-barricade-intro") dm-scene-load-pick-func) + (function "city-blow-barricade-res" ("hiphog-movie" "city-blow-barricade-res") dm-scene-load-pick-func) + (function "city-port-fight-intro" ("hiphog-movie" "city-port-fight-intro") dm-scene-load-pick-func) + (function "city-sniper-fight-intro" ("hiphog-movie" "city-sniper-fight-intro") dm-scene-load-pick-func) + (function "city-port-attack-intro" ("hiphog-movie" "city-port-attack-intro") dm-scene-load-pick-func) + ) + (menu + "intro" + (function + "full intro" + ("wasintro-start" ("intro-drop" "intro-lost" "intro-ffhq" "intro-tired" "intro-palace" "intro-rescue")) + dm-scene-load-pick-func + ) + (function "intro-drop" ("wasintro-start" "intro-drop") dm-scene-load-pick-func) + (function "intro-lost" ("wasintro-start" "intro-lost") dm-scene-load-pick-func) + (function "intro-ffhq" ("freehq-intro" "intro-ffhq") dm-scene-load-pick-func) + (function "intro-tired" ("wasintro-tired" "intro-tired") dm-scene-load-pick-func) + (function "intro-palace" ("wasintro-palace" "intro-palace") dm-scene-load-pick-func) + (function "intro-rescue" ("wasintro-rescue" "intro-rescue") dm-scene-load-pick-func) + ) + (menu + "mine" + (function "catacombs-travel-res" ("minec-start" "catacombs-travel-res") dm-scene-load-pick-func) + (function "mine-train-intro" ("mineb-elevator-room" "mine-train-intro") dm-scene-load-pick-func) + (function "mine-train-res" ("minec-train" "mine-train-res") dm-scene-load-pick-func) + (function "mine-boss-intro" ("prebot-intro" "mine-boss-intro") dm-scene-load-pick-func) + (function "prebot-hit-a" ("prebot-fight" "prebot-hit-a") dm-scene-load-pick-func) + (function "prebot-hit-b" ("prebot-fight" "prebot-hit-b") dm-scene-load-pick-func) + (function "mine-boss-res" ("prebot-fight" "mine-boss-res") dm-scene-load-pick-func) + (function "minee-genb-exit" ("minee-exit" "minee-genb-exit") dm-scene-load-pick-func) + (function "mine-explore-res" ("mineb-elevator-room" "mine-explore-res") dm-scene-load-pick-func) + ) + (menu + "onintent" + (function + "city-find-catacomb-ent-intro" + ("onintent-start" "city-find-catacomb-ent-intro") + dm-scene-load-pick-func + ) + ) + (menu "outro" (function "arena-outro" ("wasstada-outro" "arena-outro") dm-scene-load-pick-func)) + (menu + "precursor" + (function "precursor-destroy-ship-res" ("precurd-start" "precursor-destroy-ship-res") dm-scene-load-pick-func) + (function "desert-final-boss-intro-a" ("precurd-escape" "desert-final-boss-intro-a") dm-scene-load-pick-func) + (function + "precursor-destroy-ship-exp-res" + ("precurd-escape" "precursor-destroy-ship-exp-res") + dm-scene-load-pick-func + ) + (function + "precursor-destroy-ship-lose" + ("precura-start" "precursor-destroy-ship-lose") + dm-scene-load-pick-func + ) + (function + "full final-boss-intro" + ("precurd-escape" ("desert-final-boss-intro-a" "precursor-destroy-ship-exp-res" "desert-final-boss-intro")) + dm-scene-load-pick-func + ) + ) + (menu + "rubble" + (function "palace-ruins-attack-intro" ("rubblea-start" "palace-ruins-attack-intro") dm-scene-load-pick-func) + (function + "full palace-ruins-attack-res" + ("rubblec-fma" ("palace-ruins-attack-res-a" "palace-ruins-attack-res")) + dm-scene-load-pick-func + ) + (function "palace-ruins-attack-res" ("rubblec-fma" "palace-ruins-attack-res") dm-scene-load-pick-func) + (function "palace-ruins-attack-res-a" ("rubblec-fma" "palace-ruins-attack-res-a") dm-scene-load-pick-func) + (function "palace-ruins-patrol-intro" ("stadium-tunnel" "palace-ruins-patrol-intro") dm-scene-load-pick-func) + ) + (menu + "sewer" + (function "sewer-kg-exit" ("sewf-start" "sewer-kg-exit") dm-scene-load-pick-func) + (function "sewer-mh-exit" ("sewj-exit" "sewer-mh-exit") dm-scene-load-pick-func) + (function "sewer-port-exit" ("sewo-exit" "sewer-port-exit") dm-scene-load-pick-func) + (function "sewer-waterslide" ("sewd-start" "sewer-waterslide") dm-scene-load-pick-func) + (function "sewer-hum-kg-res" ("sewe-switch" "sewer-hum-kg-res") dm-scene-load-pick-func) + (function "sewer-met-hum-intro" ("ctygenb-samos" "sewer-met-hum-intro") dm-scene-load-pick-func) + ) + (menu + "temple" + (function "temple-climb-intro" ("templex-start" "temple-climb-intro") dm-scene-load-pick-func) + (function "temple-climb-res" ("templex-pre-hang" "temple-climb-res") dm-scene-load-pick-func) + (function "temple-oracle-intro" ("templeb-oracle-movie" "temple-oracle-intro") dm-scene-load-pick-func) + (function "temple-oracle-res" ("templeb-start" "temple-oracle-res") dm-scene-load-pick-func) + (function + "temple-jak-gets-light-glide" + ("templeb-glide" "temple-jak-gets-light-glide") + dm-scene-load-pick-func + ) + (function "temple-tests-res-a" ("templeb-flash-freeze" "temple-tests-res-a") dm-scene-load-pick-func) + (function "temple-tests-res-b" ("comba-elevator" "temple-tests-res-b") dm-scene-load-pick-func) + (function "temple-tests-intro" ("templea-mardoor" "temple-tests-intro") dm-scene-load-pick-func) + (function "temple-defend-res" ("templed-start" "temple-defend-res") dm-scene-load-pick-func) + ) + (menu + "throne" + (function + "full training intro" + ("waspala-intro-training" ("intro-training" "arena-training-1-intro")) + dm-scene-load-pick-func + ) + (function "intro-training" ("waspala-intro-training" "intro-training") dm-scene-load-pick-func) + (function "arena-fight-2-intro" ("waspala-start" "arena-fight-2-intro") dm-scene-load-pick-func) + (function "nest-eggs-intro" ("waspala-start" "nest-eggs-intro") dm-scene-load-pick-func) + (function "desert-rescue-intro" ("waspala-start" "desert-rescue-intro") dm-scene-load-pick-func) + (function "desert-jump-mission-intro" ("waspala-start" "desert-jump-mission-intro") dm-scene-load-pick-func) + ) + (menu + "tower" + (function "tower-destroy-res" ("towerb-top" "tower-destroy-res") dm-scene-load-pick-func) + (function "tower-destroy-res-b" ("ltowerb-fma" "tower-destroy-res-b") dm-scene-load-pick-func) + ) + (menu + "vinroom" + (function "city-power-game-intro" ("vinroom-movie" "city-power-game-intro") dm-scene-load-pick-func) + (function "city-power-game-res" ("vinroom-movie" "city-power-game-res") dm-scene-load-pick-func) + ) + (menu + "volcano" + (function "volcano-darkeco-res" ("volcano-movie" "volcano-darkeco-res") dm-scene-load-pick-func) + (function "volcano-indax-1-intro" ("volcano-movie" "volcano-indax-1-intro") dm-scene-load-pick-func) + (function "volcano-indax-1-res" ("volcano-movie" "volcano-indax-1-res") dm-scene-load-pick-func) + (function "volcano-indax-2-intro" ("volcano-movie" "volcano-indax-2-intro") dm-scene-load-pick-func) + (function "volcano-indax-2-res" ("volcano-movie" "volcano-indax-2-res") dm-scene-load-pick-func) + ) + (menu + "warp" + (function "desert-air-train-in" ("desert-warp" "desert-air-train-in") dm-scene-load-pick-func) + (function "desert-air-train-out" ("desert-warp" "desert-air-train-out") dm-scene-load-pick-func) + (function "city-air-train-out" ("ctyport-air-train" "city-air-train-out") dm-scene-load-pick-func) + (function "city-air-train-in-desert" ("ctyport-air-train" "city-air-train-in-desert") dm-scene-load-pick-func) + ) + (menu + "wasdoors" + (function "desert-course-race-intro" ("wasdoors-desert" "desert-course-race-intro") dm-scene-load-pick-func) + (function + "desert-artifact-race-1-intro" + ("wasdoors-desert" "desert-artifact-race-1-intro") + dm-scene-load-pick-func + ) + (function + "desert-artifact-race-1-res" + ("wasdoors-desert" "desert-artifact-race-1-res") + dm-scene-load-pick-func + ) + (function + "desert-artifact-race-2-intro" + ("wasdoors-desert" "desert-artifact-race-2-intro") + dm-scene-load-pick-func + ) + (function "desert-hover-intro" ("wasdoors-desert" "desert-hover-intro") dm-scene-load-pick-func) + (function "desert-beast-battle-intro" ("wasdoors-desert" "desert-beast-battle-intro") dm-scene-load-pick-func) + (function + "desert-catch-lizards-intro" + ("wasdoors-desert" "desert-catch-lizards-intro") + dm-scene-load-pick-func + ) + ) + (menu + "wasteland" + (function "wascity-pre-game-intro" ("wascityb-seem" "wascity-pre-game-intro") dm-scene-load-pick-func) + (function "wascity-pre-game-res" ("wascityb-seem" "wascity-pre-game-res") dm-scene-load-pick-func) + (function "wascity-leaper-race-intro" ("wascitya-seem" "wascity-leaper-race-intro") dm-scene-load-pick-func) + (function "wascity-leaper-race-res" ("wascityb-flut" "wascity-leaper-race-res") dm-scene-load-pick-func) + (function "wascity-gun-intro" ("wascityb-gungame" "wascity-gun-intro") dm-scene-load-pick-func) + (function "wascity-gun-res" ("wascityb-gungame" "wascity-gun-res") dm-scene-load-pick-func) + (function "nest-eggs-intro" ("waspala-nest" "nest-eggs-intro") dm-scene-load-pick-func) + (function "wascity-defend-res" ("wascityb-gungame" "wascity-defend-res") dm-scene-load-pick-func) + ) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-task-menu arg0)) + (debug-menu-append-item s5-0 (debug-menu-make-play-menu arg0)) + ) + arg0 + ) + +(define *popup-menu-context* (new 'debug 'debug-menu-context)) + +(defun popup-menu-context-make-default-menus ((arg0 debug-menu-context)) + (debug-menu-make-from-template + arg0 + '(main-menu + "Popup" + (flag "Cam 1" pad-1 dm-cam-externalize) + (flag "Turbo Cam" *camera-turbo-free* dm-boolean-toggle-pick-func) + (flag "Target" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Mode" + (function "normal" #f ,(lambda () (send-event *target* 'change-mode 'normal))) + (function "racer" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'racer #f) + ) + ) + (function "flut" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'flut #f) + ) + ) + (function "board" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature gun)) + (logior! (-> *game-info* debug-features) (game-feature gun)) + (send-event *target* 'change-mode 'gun #f (pickup-type none)) + ) + ) + (function + "darkjak" + #f + ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + ) + (function + "lightjak" + #f + ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 5) + ) + ) + (function "indax" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f) + ) + ) + (function + "invisible" + #f + ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'invisible #f) + ) + ) + ) + (flag "Game" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((v1-3 (-> *game-info* mode))) + (set! (-> *game-info* mode) (cond + ((= v1-3 'play) + 'debug + ) + ((= v1-3 'debug) + 'play + ) + (else + (-> *game-info* mode) + ) + ) + ) + ) + ) + (= (-> *game-info* mode) 'play) + ) + ) + (function "Clean" #f ,(lambda () + (if (time-of-day-setup #f) + (time-of-day-setup #t) + ) + (play-clean #f) + ) + ) + (flag "Stats" *stats-target* dm-boolean-toggle-pick-func) + (function "Reset" #f ,(lambda () (reset-actors 'debug))) + (function "Start" #f ,(lambda () (start 'play (-> *game-info* current-continue)))) + (function + "Editor" + #f + ,(lambda () + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :name "editable-player" :to *entity-pool*) + (set-master-mode 'game) + ) + ) + ) + ) + arg0 + ) + +(debug-menu-context-make-default-menus *debug-menu-context*) + +(popup-menu-context-make-default-menus *popup-menu-context*) + +(defun menu-respond-to-pause () + (case *master-mode* + (('menu) + (cond + ((and (cpad-hold? 0 l3) (cpad-hold? 0 select)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ;; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ((and (cpad-hold? 1 start) *editable*) + ;; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ((and (cpad-hold? 0 l3) (cpad-hold? 0 start)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ;; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ) + ) + (else + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ;; (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ) + #f + ) + +(defun *menu-hook* () + (debug-menus-handler *debug-menu-context*) + (debug-menus-handler *popup-menu-context*) + ) diff --git a/goal_src/jak3/engine/debug/editable-h.gc b/goal_src/jak3/engine/debug/editable-h.gc index c4990f7400..f7fc0e4fa0 100644 --- a/goal_src/jak3/engine/debug/editable-h.gc +++ b/goal_src/jak3/engine/debug/editable-h.gc @@ -5,5 +5,876 @@ ;; name in dgo: editable-h ;; dgos: GAME +;; +++editable-command +(defenum editable-command + :type uint32 + (none 0) + (exit 1) + (kill 2) + (select-one 3) + (select-add 4) + (select-remove 5) + (select-toggle 6) + (select-all 7) + (select-none 8) + (select-region 9) + (select-face 10) + (select-prim 11) + (select-current-owner 12) + (select-current-region 13) + (select-current-face 14) + (select-current-prim 15) + (pick-target 16) + (pick-loc 17) + (pick-yes-no 18) + (cancel 19) + (drag-none 20) + (drag-move 21) + (drag-scale 22) + (drag-rotate 23) + (drag-resize 24) + (camera-tumble 25) + (camera-xz 26) + (camera-xy 27) + (camera-rotate 28) + (camera-move 29) + (camera-zoom 30) + (insert-sphere 31) + (insert-point 32) + (insert-sample 33) + (insert-simple-camera 34) + (insert-light 35) + (insert-entity 36) + (insert-face 37) + (insert-plane 38) + (insert-box 39) + (insert-wall 40) + (delete 41) + (copy 42) + (resize 43) + (snap-to-ground 44) + (snap-xz 45) + (snap-y 46) + (snap-rotate 47) + (flip-side 48) + (region-set 49) + (region-new 50) + (edit-plane-set 51) + (edit-plane-clear 52) + (delete-region 53) + (copy-region 54) + (region-add 55) + (save 56) + (load 57) + (update-game 58) + (print-region-info 59) + (refresh-filter 60) + (rotate-level 61) + (translate-y-level 62) + (select-user0 63) + (select-user1 64) + (select-user2 65) + (select-user3 66) + (select-user4 67) + (select-user5 68) + (select-user6 69) + (select-user7 70) + (select-user8 71) + (select-user9 72) + (select-user10 73) + (select-user11 74) + (select-user12 75) + ) +;; ---editable-command + + +;; +++editable-filter +(defenum editable-filter + :type uint32 + :bitfield #t + (none 0) + (unknown 1) + (sound 2) + (part 3) + (user-setting 4) + (cam-setting 5) + (load 6) + (water-command 7) + (camera 8) + (target 9) + (water 10) + (data 11) + (city_vis 12) + (sample 13) + (light 14) + (entity 15) + (selected 16) + ) +;; ---editable-filter + + +;; +++editable-flag +(defenum editable-flag + :type uint32 + :bitfield #t + (selected) + (no-save) + (orient) + (x) + (y) + (z) + (no-plane-snap) + (no-update) + (mark) + (top-set) + (bot-set) + (changed) + ) +;; ---editable-flag + +(declare-type editable-array basic) +(declare-type editable-plane editable) +(declare-type editable-region basic) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(define *editable-temp-id* 0) + +(define *editable-default-name* (new 'debug 'string 32 "undefined")) + +(defun editable-command->string ((arg0 editable-command)) + (case arg0 + (((editable-command select-current-face)) + "select-current-face" + ) + (((editable-command camera-move)) + "camera-move" + ) + (((editable-command select-current-region)) + "select-current-region" + ) + (((editable-command insert-sample)) + "insert-sample" + ) + (((editable-command print-region-info)) + "print-region-info" + ) + (((editable-command camera-rotate)) + "camera-rotate" + ) + (((editable-command select-user1)) + "select-user1" + ) + (((editable-command select-add)) + "select-add" + ) + (((editable-command camera-xz)) + "camera-xz" + ) + (((editable-command pick-loc)) + "pick-loc" + ) + (((editable-command insert-box)) + "insert-box" + ) + (((editable-command insert-entity)) + "insert-entity" + ) + (((editable-command translate-y-level)) + "translate-y-level" + ) + (((editable-command select-user11)) + "select-user11" + ) + (((editable-command select-user10)) + "select-user10" + ) + (((editable-command select-all)) + "select-all" + ) + (((editable-command copy-region)) + "copy-region" + ) + (((editable-command select-none)) + "select-none" + ) + (((editable-command camera-zoom)) + "camera-zoom" + ) + (((editable-command delete-region)) + "delete-region" + ) + (((editable-command select-toggle)) + "select-toggle" + ) + (((editable-command copy)) + "copy" + ) + (((editable-command pick-yes-no)) + "pick-yes-no" + ) + (((editable-command insert-light)) + "insert-light" + ) + (((editable-command none)) + "none" + ) + (((editable-command select-user4)) + "select-user4" + ) + (((editable-command resize)) + "resize" + ) + (((editable-command flip-side)) + "flip-side" + ) + (((editable-command refresh-filter)) + "refresh-filter" + ) + (((editable-command cancel)) + "cancel" + ) + (((editable-command save)) + "save" + ) + (((editable-command select-user6)) + "select-user6" + ) + (((editable-command region-new)) + "region-new" + ) + (((editable-command snap-to-ground)) + "snap-to-ground" + ) + (((editable-command pick-target)) + "pick-target" + ) + (((editable-command snap-y)) + "snap-y" + ) + (((editable-command select-user8)) + "select-user8" + ) + (((editable-command select-face)) + "select-face" + ) + (((editable-command exit)) + "exit" + ) + (((editable-command drag-move)) + "drag-move" + ) + (((editable-command edit-plane-set)) + "edit-plane-set" + ) + (((editable-command select-region)) + "select-region" + ) + (((editable-command delete)) + "delete" + ) + (((editable-command select-user0)) + "select-user0" + ) + (((editable-command camera-xy)) + "camera-xy" + ) + (((editable-command select-current-owner)) + "select-current-owner" + ) + (((editable-command region-add)) + "region-add" + ) + (((editable-command insert-sphere)) + "insert-sphere" + ) + (((editable-command insert-plane)) + "insert-plane" + ) + (((editable-command drag-rotate)) + "drag-rotate" + ) + (((editable-command select-one)) + "select-one" + ) + (((editable-command update-game)) + "update-game" + ) + (((editable-command select-user2)) + "select-user2" + ) + (((editable-command select-user3)) + "select-user3" + ) + (((editable-command snap-rotate)) + "snap-rotate" + ) + (((editable-command rotate-level)) + "rotate-level" + ) + (((editable-command select-prim)) + "select-prim" + ) + (((editable-command drag-none)) + "drag-none" + ) + (((editable-command select-current-prim)) + "select-current-prim" + ) + (((editable-command select-user5)) + "select-user5" + ) + (((editable-command insert-wall)) + "insert-wall" + ) + (((editable-command insert-simple-camera)) + "insert-sample-camera" + ) + (((editable-command insert-face)) + "insert-face" + ) + (((editable-command region-set)) + "region-set" + ) + (((editable-command select-user7)) + "select-user7" + ) + (((editable-command insert-point)) + "insert-point" + ) + (((editable-command drag-resize)) + "drag-resize" + ) + (((editable-command kill)) + "kill" + ) + (((editable-command snap-xz)) + "snap-xz" + ) + (((editable-command select-user12)) + "select-user12" + ) + (((editable-command camera-tumble)) + "camera-tumble" + ) + (((editable-command select-user9)) + "select-user9" + ) + (((editable-command edit-plane-clear)) + "edit-plane-clear" + ) + (((editable-command drag-scale)) + "drag-scale" + ) + (((editable-command load)) + "load" + ) + (((editable-command select-remove)) + "select-remove" + ) + (else + "*unknown*" + ) + ) + ) + +;; WARN: Return type mismatch basic vs string. +(defun editable-filter->string ((arg0 editable-filter) (arg1 basic)) + (if (= (logand arg0 (editable-filter target)) (editable-filter target)) + (format arg1 "target ") + ) + (if (= (logand arg0 (editable-filter city_vis)) (editable-filter city_vis)) + (format arg1 "city_vis ") + ) + (if (= (logand arg0 (editable-filter water-command)) (editable-filter water-command)) + (format arg1 "water-command ") + ) + (if (= (logand arg0 (editable-filter user-setting)) (editable-filter user-setting)) + (format arg1 "user-setting ") + ) + (if (= (logand arg0 (editable-filter sample)) (editable-filter sample)) + (format arg1 "sample ") + ) + (if (= (logand arg0 (editable-filter light)) (editable-filter light)) + (format arg1 "light ") + ) + (if (= (logand arg0 (editable-filter part)) (editable-filter part)) + (format arg1 "part ") + ) + (if (= (logand arg0 (editable-filter unknown)) (editable-filter unknown)) + (format arg1 "unknown ") + ) + (if (= (logand arg0 (editable-filter entity)) (editable-filter entity)) + (format arg1 "entity ") + ) + (if (= (logand arg0 (editable-filter data)) (editable-filter data)) + (format arg1 "data ") + ) + (if (= (logand arg0 (editable-filter water)) (editable-filter water)) + (format arg1 "water ") + ) + (if (= (logand arg0 (editable-filter cam-setting)) (editable-filter cam-setting)) + (format arg1 "cam-setting ") + ) + (if (= (logand (editable-filter selected) arg0) (editable-filter selected)) + (format arg1 "selected ") + ) + (if (= (logand arg0 (editable-filter none)) (editable-filter none)) + (format arg1 "none ") + ) + (if (= (logand arg0 (editable-filter camera)) (editable-filter camera)) + (format arg1 "camera ") + ) + (if (= (logand arg0 (editable-filter load)) (editable-filter load)) + (format arg1 "load ") + ) + (if (= (logand arg0 (editable-filter sound)) (editable-filter sound)) + (format arg1 "sound ") + ) + (the-as string arg1) + ) + +(deftype editable-region (basic) + ((changed symbol) + (locked symbol) + (id uint64) + (filter editable-filter) + (tree symbol) + (level string) + (on-enter string) + (on-inside string) + (on-exit string) + ) + (:methods + (new (symbol type) _type_) + (editable-region-method-9 () none) + (editable-region-method-10 () none) + (editable-region-method-11 () none) + (editable-region-method-12 () none) + ) + ) + + +(deftype editable (basic) + ((flags editable-flag) + (name string) + (id uint32) + (region editable-region) + (owner pair) + (prefix basic) + ) + (:methods + (editable-method-9 () none) + (editable-method-10 () none) + (editable-method-11 () none) + (editable-method-12 () none) + (editable-method-13 () none) + (editable-method-14 () none) + (editable-method-15 () none) + (editable-method-16 () none) + (editable-method-17 () none) + (editable-method-18 () none) + (editable-method-19 () none) + (editable-method-20 () none) + (editable-method-21 () none) + (editable-method-22 () none) + (editable-method-23 () none) + (editable-method-24 () none) + (editable-method-25 () none) + (editable-method-26 () none) + (editable-method-27 () none) + (editable-method-28 () none) + (editable-method-29 () none) + (editable-method-30 () none) + (editable-method-31 () none) + (editable-method-32 () none) + (editable-method-33 () none) + (editable-method-34 () none) + (editable-method-35 () none) + ) + ) + + +(deftype editable-array (basic) + ((allocated-length int32) + (length int32) + (region editable-region) + (backup-region editable-region) + (region-lock? symbol) + (move-lock? symbol) + (move-speed float) + (selection (array editable)) + (filter editable-filter 2) + (target editable) + (target-mode editable-command) + (target-command editable-command) + (target-message string) + (edit-plane editable-plane) + (edit-plane-center vector :inline) + (edit-plane-normal vector :inline) + (level-offset vector :inline) + (level-info-id uint32) + (level uint32) + (edit-param0 float) + (data editable :dynamic) + ) + (:methods + (new (symbol type int) _type_) + (editable-array-method-9 () none) + (editable-array-method-10 () none) + (editable-array-method-11 () none) + (editable-array-method-12 () none) + (editable-array-method-13 () none) + (editable-array-method-14 () none) + (editable-array-method-15 () none) + (editable-array-method-16 () none) + (editable-array-method-17 () none) + (editable-array-method-18 () none) + (editable-array-method-19 () none) + ) + ) + + +(defmethod new editable-array ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* arg0 4)))))) + (set! (-> s5-0 allocated-length) arg0) + (set! (-> s5-0 length) 0) + (set! (-> s5-0 region) #f) + (set! (-> s5-0 backup-region) #f) + (set! (-> s5-0 region-lock?) #f) + (set! (-> s5-0 move-lock?) #f) + (set! (-> s5-0 target) #f) + (set! (-> s5-0 target-command) (editable-command none)) + (set! (-> s5-0 target-message) #f) + (set! (-> s5-0 selection) + (the-as (array editable) ((method-of-type array new) allocation array editable arg0)) + ) + (set! (-> s5-0 edit-plane) #f) + (set! (-> s5-0 filter 0) (editable-filter + none + unknown + sound + part + user-setting + cam-setting + load + water-command + city_vis + sample + light + entity + ) + ) + (set! (-> s5-0 filter 1) (editable-filter camera target water data city_vis sample light entity selected)) + (dotimes (v1-5 arg0) + (set! (-> s5-0 data v1-5) #f) + (set! (-> s5-0 selection v1-5) #f) + ) + s5-0 + ) + ) + +(deftype editable-point (editable) + ((radius meters) + (trans vector :inline) + ) + (:methods + (new (symbol type vector editable-region) _type_) + ) + ) + + +(defmethod new editable-point ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (set! (-> gp-0 name) "undefined") + (set! (-> gp-0 prefix) "undefined") + (let* ((s3-0 gp-0) + (s2-0 (method-of-object s3-0 editable-method-23)) + ) + (set! arg1 (cond + (arg1 + (empty) + arg1 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s2-0) + ) + (set! (-> gp-0 trans quad) (-> arg0 quad)) + (set! (-> gp-0 radius) 2048.0) + (set! (-> gp-0 owner) '()) + gp-0 + ) + ) + +(deftype editable-sphere (editable-point) + () + (:methods + (new (symbol type vector float editable-region) _type_) + ) + ) + + +(defmethod new editable-sphere ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 float) (arg2 editable-region)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 region) #f) + (set! (-> s5-0 name) "undefined") + (set! (-> s5-0 prefix) "undefined") + (let* ((s2-0 s5-0) + (s1-0 (method-of-object s2-0 editable-method-23)) + ) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s1-0) + ) + (set! (-> s5-0 trans quad) (-> arg0 quad)) + (set! (-> s5-0 radius) arg1) + (set! (-> s5-0 owner) '()) + s5-0 + ) + ) + +(deftype editable-sample (editable-point) + () + ) + + +(deftype editable-light (editable-sphere) + ((direction vector :inline) + (color vector :inline) + (decay-start float) + (ambient-point-ratio float) + (brightness float) + (shadow uint32 :overlay-at (-> direction data 0)) + (shadows float 5) + (shadow-ambi float :overlay-at (-> shadows 0)) + (shadow-dir0 float :overlay-at (-> shadows 1)) + (shadow-dir1 float :overlay-at (-> shadows 2)) + (shadow-dir2 float :overlay-at (-> shadows 3)) + (shadow-dir3 float :overlay-at (-> shadows 4)) + ) + (:methods + (new (symbol type vector float editable-region) _type_) + ) + ) + + +(defmethod new editable-light ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 float) (arg2 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (let* ((s2-0 gp-0) + (s1-0 (method-of-object s2-0 editable-method-23)) + ) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s1-0) + ) + (set! (-> gp-0 trans quad) (-> arg0 quad)) + (set! (-> gp-0 radius) arg1) + (set! (-> gp-0 owner) '()) + (set! (-> gp-0 prefix) (new 'debug 'string 32 *editable-default-name*)) + (let ((s5-1 (new 'debug 'string 32 (the-as string #f)))) + (format s5-1 "~s-~d" (-> gp-0 prefix) *editable-temp-id*) + (set! (-> gp-0 name) s5-1) + ) + (set! *editable-temp-id* (+ *editable-temp-id* 1)) + (set! (-> gp-0 decay-start) 0.5) + (set! (-> gp-0 ambient-point-ratio) 1.0) + (set! (-> gp-0 brightness) 1.0) + (set-vector! (-> gp-0 color) 1.0 1.0 1.0 -1.0) + (set-vector! (-> gp-0 direction) 0.0 0.0 0.0 0.0) + (set! (-> gp-0 shadow-ambi) 1.0) + (set! (-> gp-0 shadow-dir0) 1.0) + (set! (-> gp-0 shadow-dir1) 1.0) + (set! (-> gp-0 shadow-dir2) 1.0) + (set! (-> gp-0 shadow-dir3) 1.0) + gp-0 + ) + ) + +(deftype editable-entity (editable-point) + ((angles euler-angles :inline) + (idx int32) + ) + (:methods + (new (symbol type vector float editable-region) _type_) + (editable-entity-method-36 () none) + ) + ) + + +(defmethod new editable-entity ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 float) (arg2 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (let* ((s2-0 gp-0) + (s1-0 (method-of-object s2-0 editable-method-23)) + ) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s1-0) + ) + (set! (-> gp-0 trans quad) (-> arg0 quad)) + (set! (-> gp-0 radius) arg1) + (set! (-> gp-0 owner) '()) + (set! (-> gp-0 prefix) (new 'debug 'string 32 "entity")) + (set! (-> gp-0 name) (new 'debug 'string 32 "entity")) + gp-0 + ) + ) + +(deftype editable-face (editable) + ((length int32) + (normal vector :inline) + (center vector :inline) + (vertex editable-point 6) + ) + (:methods + (new (symbol type editable-region) _type_) + (editable-face-method-36 () none) + (editable-face-method-37 () none) + ) + ) + + +(defmethod new editable-face ((allocation symbol) (type-to-make type) (arg0 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (set! (-> gp-0 name) "undefined") + (set! (-> gp-0 prefix) "undefined") + (let* ((s4-0 gp-0) + (s3-0 (method-of-object s4-0 editable-method-23)) + ) + (set! arg0 (cond + (arg0 + (empty) + arg0 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s3-0) + ) + (set! (-> gp-0 owner) '()) + gp-0 + ) + ) + +(deftype editable-plane (editable) + ((length int32) + (radius meters) + (vertex editable-point 2) + ) + (:methods + (new (symbol type editable-region) _type_) + (editable-plane-method-36 () none) + (editable-plane-method-37 () none) + ) + ) + + +(defmethod new editable-plane ((allocation symbol) (type-to-make type) (arg0 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (set! (-> gp-0 name) "undefined") + (set! (-> gp-0 prefix) "undefined") + (let* ((s4-0 gp-0) + (s3-0 (method-of-object s4-0 editable-method-23)) + ) + (set! arg0 (cond + (arg0 + (empty) + arg0 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s3-0) + ) + (set! (-> gp-0 owner) '()) + (set! (-> gp-0 radius) 20480.0) + gp-0 + ) + ) + +(deftype editable-player (process-drawable) + ((current editable-array) + (current-command uint32) + (select-command function) + (drag-command uint32) + (extra-command function) + (left-handed basic) + (light-names basic) + (external-cam-mode symbol) + (command editable-command 6) + (close-menu-time time-frame) + (mouse-pos vector :inline) + (mouse-end vector :inline) + (manipulator manipulator :inline) + (mouse-box vector 2 :inline) + (mouse-hit vector :inline) + (mouse-normal vector :inline) + (float-variable float) + (float-step float) + (float-max float) + (float-min float) + (float-id uint32) + ) + (:methods + (editable-player-method-20 () none) + (editable-player-method-21 () none) + (editable-player-method-22 () none) + (editable-player-method-23 () none) + ) + ) + + +(deftype editable-work (basic) + ((num-found int16) + (last-found int16) + (last-x float) + (last-y float) + (hide symbol) + (found editable 256) + (dists uint32 256) + ) + ) + + +(define *editable-work* (new 'global 'editable-work)) + +(define *editable* (the-as (pointer editable-player) #f)) diff --git a/goal_src/jak3/engine/debug/editable-player.gc b/goal_src/jak3/engine/debug/editable-player.gc index dabf3ab4ef..6f1a65831b 100644 --- a/goal_src/jak3/engine/debug/editable-player.gc +++ b/goal_src/jak3/engine/debug/editable-player.gc @@ -5,5 +5,8 @@ ;; name in dgo: editable-player ;; dgos: GAME +(define-extern editable-player-init (function symbol none :behavior editable-player)) +(define-extern *editable-menu-context* debug-menu-context) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/debug/manipulator.gc b/goal_src/jak3/engine/debug/manipulator.gc index 0479fa63b9..ebd3f5ea62 100644 --- a/goal_src/jak3/engine/debug/manipulator.gc +++ b/goal_src/jak3/engine/debug/manipulator.gc @@ -5,5 +5,673 @@ ;; name in dgo: manipulator ;; dgos: GAME +;; +++manipulator-action +(defenum manipulator-action + :type uint32 + (ma0 0) + (ma1 1) + (ma2 2) + (ma3 3) + (ma4 4) + (ma5 5) + (ma6 6) + (ma7 7) + ) +;; ---manipulator-action + + +;; +++manipulator-mode +(defenum manipulator-mode + :type uint32 + (mm0 0) + (mm1 1) + ) +;; ---manipulator-mode + + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(deftype manipulator (structure) + ((action manipulator-action) + (mode manipulator-mode) + (dragging? symbol) + (position vector :inline) + (speed vector :inline) + (drag-ref-position vector :inline) + (mouse-ref-position vector :inline) + (mat matrix :inline) + (rotate-ref int32) + (angles euler-angles :inline) + ) + (:methods + (set-mode (_type_ manipulator-mode) none) + (manipulator-method-10 (_type_) none) + (manipulator-method-11 (_type_) none) + (manipulator-method-12 (_type_ vector) none) + (manipulator-method-13 (_type_ vector vector) none) + (manipulator-method-14 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch symbol vs none. +(defun draw-axis ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 rgba)) + (local-vars + (sv-160 int) + (sv-176 (function symbol bucket-id vector vector vector rgba symbol)) + (sv-192 symbol) + (sv-208 int) + (sv-224 vector) + (sv-240 vector) + (sv-256 vector) + (sv-272 vector) + (sv-288 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (cond + ((< (fabs (vector-dot arg1 *x-vector*)) 0.5) + (vector-cross! s1-0 *x-vector* arg1) + ) + ((< (fabs (vector-dot arg1 *y-vector*)) 0.5) + (vector-cross! s1-0 *y-vector* arg1) + ) + (else + (vector-cross! s1-0 *z-vector* arg1) + ) + ) + (vector-cross! s1-0 s1-0 arg1) + (vector-normalize! s1-0 1.0) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (let ((v1-10 arg0)) + (let ((a0-8 arg1)) + (let ((a1-10 arg2)) + (.mov vf7 a1-10) + ) + (.lvf vf5 (&-> a0-8 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s0-0 quad) vf6) + (set! sv-160 0) + (while (< sv-160 8) + (set! sv-176 add-debug-flat-triangle) + (set! sv-192 #t) + (set! sv-208 584) + (set! sv-224 (new 'stack-no-clear 'vector)) + (let ((v1-16 s0-0)) + (let ((a0-9 arg1)) + (let ((a1-11 arg3)) + (.mov vf7 a1-11) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-16 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-224 quad) vf6) + (set! sv-256 (new 'stack-no-clear 'vector)) + (set! sv-240 s0-0) + (let* ((a2-3 + (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) arg1 (* 182.04445 (the float (* 45 sv-160)))) + ) + (v1-22 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-3)) + ) + (let ((a0-13 (* 0.25 arg3))) + (.mov vf7 a0-13) + ) + (.lvf vf5 (&-> v1-22 quad)) + ) + (.lvf vf4 (&-> sv-240 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-256 quad) vf6) + (set! sv-288 (new 'stack-no-clear 'vector)) + (set! sv-272 s0-0) + (let* ((a2-7 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + arg1 + (* 182.04445 (the float (* 45 (+ sv-160 1)))) + ) + ) + (v1-29 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-7)) + ) + (let ((a0-17 (* 0.25 arg3))) + (.mov vf7 a0-17) + ) + (.lvf vf5 (&-> v1-29 quad)) + ) + (.lvf vf4 (&-> sv-272 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-288 quad) vf6) + (let ((t1-0 arg4)) + (sv-176 sv-192 (the-as bucket-id sv-208) sv-224 sv-256 sv-288 t1-0) + ) + (set! sv-160 (+ sv-160 1)) + ) + ) + ) + (add-debug-vector #t (bucket-id debug-no-zbuf2) arg0 arg1 arg2 arg4) + (none) + ) + ) + +(defmethod set-mode ((this manipulator) (arg0 manipulator-mode)) + (set! (-> this mode) arg0) + 0 + (none) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +(defmethod manipulator-method-11 ((this manipulator)) + (local-vars (sv-240 rgba) (sv-256 vector) (sv-272 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (format *stdcon* "~M ~M ~M~%" (-> this position x) (-> this position y) (-> this position z)) + (let ((s5-0 (-> this position))) + 0.0 + (let* ((v0-1 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> *math-camera* trans) (-> this position)) 1.0) + ) + (s4-0 (< (fabs (vector-dot v0-1 (the-as vector (-> this mat)))) 0.9)) + (s3-0 (< (fabs (vector-dot v0-1 (-> this mat uvec))) 0.9)) + (s2-0 (< (fabs (vector-dot v0-1 (-> this mat fvec))) 0.9)) + (f30-1 (* 0.15 (vector-vector-distance (-> *math-camera* trans) s5-0))) + ) + (if s4-0 + (draw-axis + s5-0 + (the-as vector (-> this mat)) + f30-1 + (* 0.25 f30-1) + (if (= (-> this action) (manipulator-action ma1)) + *color-yellow* + *color-red* + ) + ) + ) + (if s3-0 + (draw-axis s5-0 (-> this mat uvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma2)) + *color-yellow* + *color-green* + ) + ) + ) + (if s2-0 + (draw-axis s5-0 (-> this mat fvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma3)) + *color-yellow* + *color-blue* + ) + ) + ) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (let ((f28-0 0.1)) + (if (= (-> this action) (manipulator-action ma7)) + (set! sv-240 *color-yellow*) + (set! sv-240 *color-light-blue*) + ) + (let ((a1-7 s1-0)) + (let ((v1-26 s5-0)) + (let ((a0-13 (vector+! + (new 'stack-no-clear 'vector) + (the-as vector (-> *math-camera* inv-camera-rot)) + (-> *math-camera* inv-camera-rot uvec) + ) + ) + ) + (let ((a2-6 (* f30-1 f28-0))) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-13 quad)) + ) + (.lvf vf4 (&-> v1-26 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-7 quad) vf6) + ) + (let ((a0-14 s0-0)) + (let ((v1-27 s1-0)) + (let ((a1-9 (-> *math-camera* inv-camera-rot uvec))) + (let ((a2-8 (* -2.0 f30-1 f28-0))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-9 quad)) + ) + (.lvf vf4 (&-> v1-27 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-14 quad) vf6) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (let ((a0-18 s0-0)) + (let ((v1-29 s0-0)) + (let ((a1-12 (-> *math-camera* inv-camera-rot))) + (let ((a2-11 (* -2.0 f30-1 f28-0))) + (.mov vf7 a2-11) + ) + (.lvf vf5 (&-> a1-12 rvec quad)) + ) + (.lvf vf4 (&-> v1-29 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-18 quad) vf6) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (let ((a0-22 s0-0)) + (let ((v1-31 s0-0)) + (let ((a1-15 (-> *math-camera* inv-camera-rot uvec))) + (let ((a2-14 (* 2.0 f30-1 f28-0))) + (.mov vf7 a2-14) + ) + (.lvf vf5 (&-> a1-15 quad)) + ) + (.lvf vf4 (&-> v1-31 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-22 quad) vf6) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (let ((a0-26 s0-0)) + (let ((v1-33 s0-0)) + (let ((a1-18 (-> *math-camera* inv-camera-rot))) + (let ((a2-17 (* 2.0 f30-1 f28-0))) + (.mov vf7 a2-17) + ) + (.lvf vf5 (&-> a1-18 rvec quad)) + ) + (.lvf vf4 (&-> v1-33 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-26 quad) vf6) + ) + ) + (let ((t9-9 add-debug-line) + (a0-27 #t) + (a1-19 577) + (t1-3 #f) + (t2-3 -1) + ) + (t9-9 a0-27 (the-as bucket-id a1-19) s1-0 s0-0 sv-240 t1-3 (the-as rgba t2-3)) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (when (and s3-0 s2-0) + (let ((a1-20 s1-1)) + (let ((v1-36 s5-0)) + (let ((a0-29 (vector+! (new 'stack-no-clear 'vector) (-> this mat fvec) (-> this mat uvec)))) + (let ((a2-20 f30-1)) + (.mov vf7 a2-20) + ) + (.lvf vf5 (&-> a0-29 quad)) + ) + (.lvf vf4 (&-> v1-36 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-20 quad) vf6) + ) + (let ((s0-1 draw-axis)) + (set! sv-256 s1-1) + (let ((a1-22 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec))) + (a2-21 (* 0.15 f30-1)) + (a3-11 (* 0.15 f30-1)) + (t0-11 (if (= (-> this action) (manipulator-action ma6)) + *color-yellow* + *color-green* + ) + ) + ) + (s0-1 sv-256 a1-22 a2-21 a3-11 t0-11) + ) + ) + (let ((s0-2 draw-axis)) + (set! sv-272 s1-1) + (let ((a1-24 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec))) + (a2-22 (* 0.15 f30-1)) + (a3-12 (* 0.15 f30-1)) + (t0-12 (if (= (-> this action) (manipulator-action ma6)) + *color-yellow* + *color-blue* + ) + ) + ) + (s0-2 sv-272 a1-24 a2-22 a3-12 t0-12) + ) + ) + ) + (set! s2-0 (and s4-0 s2-0)) + (when s2-0 + (let ((a1-25 s1-1)) + (let ((v1-44 s5-0)) + (let ((a0-37 (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> this mat)) (-> this mat fvec)))) + (let ((a2-24 f30-1)) + (.mov vf7 a2-24) + ) + (.lvf vf5 (&-> a0-37 quad)) + ) + (.lvf vf4 (&-> v1-44 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-25 quad) vf6) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (the-as vector (-> this mat))) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma5)) + *color-yellow* + *color-red* + ) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec)) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma5)) + *color-yellow* + *color-blue* + ) + ) + ) + (set! s3-0 (and s4-0 s3-0)) + (when s3-0 + (let ((a0-44 s1-1)) + (let ((v1-52 (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> this mat)) (-> this mat uvec)))) + (let ((a1-31 f30-1)) + (.mov vf7 a1-31) + ) + (.lvf vf5 (&-> v1-52 quad)) + ) + (.lvf vf4 (&-> s5-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-44 quad) vf6) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (the-as vector (-> this mat))) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma4)) + *color-yellow* + *color-red* + ) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec)) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma4)) + *color-yellow* + *color-green* + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod manipulator-method-12 ((this manipulator) (arg0 vector)) + (set! (-> this rotate-ref) (the int (-> *mouse* posx))) + (set! (-> this mouse-ref-position quad) (-> arg0 quad)) + (set! (-> this drag-ref-position quad) (-> this position quad)) + (set! (-> this dragging?) #t) + (set! (-> this speed quad) (the-as uint128 0)) + 0 + (none) + ) + +(defmethod manipulator-method-13 ((this manipulator) (arg0 vector) (arg1 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (cond + ((= (-> this mode) (manipulator-mode mm0)) + (set! (-> this speed quad) (-> this position quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0)) + ) + 0.0 + 0.0 + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((or (= (-> this action) (manipulator-action ma1)) + (= (-> this action) (manipulator-action ma2)) + (= (-> this action) (manipulator-action ma3)) + ) + (cond + ((= (-> this action) (manipulator-action ma1)) + (cond + ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec)))) + (set! (-> s2-0 quad) (-> this mat fvec quad)) + (set! (-> s1-0 quad) (-> this mat uvec quad)) + ) + (else + (set! (-> s2-0 quad) (-> this mat uvec quad)) + (set! (-> s1-0 quad) (-> this mat fvec quad)) + ) + ) + ) + ((= (-> this action) (manipulator-action ma2)) + (cond + ((< (fabs (vector-dot s5-1 (the-as vector (-> this mat)))) (fabs (vector-dot s5-1 (-> this mat fvec)))) + (set! (-> s2-0 quad) (-> this mat fvec quad)) + (set! (-> s1-0 quad) (-> this mat rvec quad)) + ) + (else + (set! (-> s2-0 quad) (-> this mat rvec quad)) + (set! (-> s1-0 quad) (-> this mat fvec quad)) + ) + ) + ) + ((= (-> this action) (manipulator-action ma3)) + (cond + ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (the-as vector (-> this mat))))) + (set! (-> s2-0 quad) (-> this mat rvec quad)) + (set! (-> s1-0 quad) (-> this mat uvec quad)) + ) + (else + (set! (-> s2-0 quad) (-> this mat uvec quad)) + (set! (-> s1-0 quad) (-> this mat rvec quad)) + ) + ) + ) + ) + (let ((f30-0 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0)) + (f0-11 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0)) + ) + (let ((a1-3 s5-1)) + (let ((v1-41 arg0)) + (let ((a0-43 s5-1)) + (let ((a2-3 f30-0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-43 quad)) + ) + (.lvf vf4 (&-> v1-41 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-3 quad) vf6) + ) + (let ((a0-44 s4-1)) + (let ((v1-42 s4-1)) + (let ((a1-4 f0-11)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> v1-42 quad)) + ) + (.lvf vf4 (&-> arg0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-44 quad) vf6) + ) + ) + (vector-flatten! s5-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this position)) s1-0) + (vector-flatten! s4-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this position)) s1-0) + (let ((v1-46 (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1))) + (vector+! (-> this position) (-> this drag-ref-position) v1-46) + (format *stdcon* "delta ~M ~M ~M~%" (-> v1-46 x) (-> v1-46 y) (-> v1-46 z)) + ) + ) + ((or (= (-> this action) (manipulator-action ma4)) + (= (-> this action) (manipulator-action ma5)) + (= (-> this action) (manipulator-action ma6)) + (= (-> this action) (manipulator-action ma7)) + ) + (cond + ((= (-> this action) (manipulator-action ma4)) + (set! (-> s2-0 quad) (-> *z-vector* quad)) + ) + ((= (-> this action) (manipulator-action ma5)) + (set! (-> s2-0 quad) (-> *y-vector* quad)) + ) + ((= (-> this action) (manipulator-action ma6)) + (set! (-> s2-0 quad) (-> *x-vector* quad)) + ) + ((= (-> this action) (manipulator-action ma7)) + (set! (-> s2-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + ) + ) + (vector-normalize! s2-0 1.0) + (let ((f30-1 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0)) + (f0-15 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0)) + ) + (let ((a1-14 s5-1)) + (let ((v1-69 arg0)) + (let ((a0-69 s5-1)) + (let ((a2-13 f30-1)) + (.mov vf7 a2-13) + ) + (.lvf vf5 (&-> a0-69 quad)) + ) + (.lvf vf4 (&-> v1-69 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-14 quad) vf6) + ) + (let ((v1-70 s4-1)) + (let ((a0-70 arg0)) + (let ((a1-15 s4-1)) + (let ((a2-14 f0-15)) + (.mov vf7 a2-14) + ) + (.lvf vf5 (&-> a1-15 quad)) + ) + (.lvf vf4 (&-> a0-70 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-70 quad) vf6) + ) + ) + (vector+! (-> this position) (-> this drag-ref-position) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)) + ) + ) + ) + ) + (vector-! (-> this speed) (-> this position) (-> this speed)) + ) + ((= (-> this mode) (manipulator-mode mm1)) + (let ((s4-2 (- (-> this rotate-ref) (the int (-> *mouse* posx)))) + (s5-2 (new 'stack-no-clear 'matrix)) + ) + (new 'stack 'euler-angles) + (matrix-identity! s5-2) + (cond + ((= (-> this action) (manipulator-action ma1)) + (matrix-axis-angle! s5-2 (the-as vector (-> this mat)) (* 182.04445 (the float s4-2))) + ) + ((= (-> this action) (manipulator-action ma2)) + (matrix-axis-angle! s5-2 (-> this mat uvec) (* 182.04445 (the float s4-2))) + ) + ((= (-> this action) (manipulator-action ma3)) + (matrix-axis-angle! s5-2 (-> this mat fvec) (* 182.04445 (the float s4-2))) + ) + ) + (matrix*! (-> this mat) (-> this mat) s5-2) + ) + (vector-normalize! (the-as vector (-> this mat)) 1.0) + (vector-normalize! (-> this mat uvec) 1.0) + (vector-normalize! (-> this mat fvec) 1.0) + (matrix->eul (-> this angles) (-> this mat) 21) + (format *stdcon* "X = ~R~%Y = ~R~%Z = ~R~%" (-> this angles x) (-> this angles y) (-> this angles z)) + (set! (-> this rotate-ref) (the int (-> *mouse* posx))) + ) + (else + ) + ) + 0 + (none) + ) + ) + +(defmethod manipulator-method-14 ((this manipulator)) + (set! (-> this speed quad) (the-as uint128 0)) + (set! (-> this dragging?) #f) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/debug/memory-usage.gc b/goal_src/jak3/engine/debug/memory-usage.gc index 6f485c785d..57b603b9f7 100644 --- a/goal_src/jak3/engine/debug/memory-usage.gc +++ b/goal_src/jak3/engine/debug/memory-usage.gc @@ -7,3 +7,568 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + + +(defmethod mem-usage ((this object) (usage memory-usage-block) (flags int)) + this + ) + +(defmethod calculate-total ((this memory-usage-block)) + (let ((v0-0 0)) + (dotimes (v1-0 (-> this length)) + (+! v0-0 (-> this data v1-0 total)) + ) + v0-0 + ) + ) + +(defmethod reset! ((this memory-usage-block)) + (set! (-> this length) 0) + (dotimes (v1-0 113) + (set! (-> this data v1-0 used) 0) + (set! (-> this data v1-0 total) 0) + (set! (-> this data v1-0 count) 0) + ) + this + ) + +(defun mem-size ((arg0 basic) (arg1 symbol) (arg2 int)) + (let ((gp-0 (new 'stack 'memory-usage-block))) + (mem-usage arg0 gp-0 arg2) + (if arg1 + (inspect gp-0) + ) + (calculate-total gp-0) + ) + ) + +(defmethod compute-memory-usage! ((this level) (arg0 symbol)) + (if (zero? (-> this mem-usage-block)) + (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) + ) + (set! arg0 (or (zero? (-> this mem-usage-block length)) arg0)) + (when arg0 + (mem-usage this (reset! (-> this mem-usage-block)) 0) + (set! (-> this mem-usage) (calculate-total (-> this mem-usage-block))) + 0 + ) + (-> this mem-usage-block) + ) + +(defmethod mem-usage ((this process-tree) (usage memory-usage-block) (flags int)) + (let ((s3-0 91)) + (let* ((s2-0 *dead-pool-list*) + (a0-1 (car s2-0)) + ) + (while (not (null? s2-0)) + (set! (-> usage data s3-0 name) (symbol->string-debug (the-as symbol a0-1))) + (+! s3-0 1) + (set! s2-0 (cdr s2-0)) + (set! a0-1 (car s2-0)) + ) + ) + (set! (-> usage length) (max (-> usage length) s3-0)) + ) + (set! (-> usage data 97 name) "*debug-dead-pool*") + (set! *temp-mem-usage* usage) + (when (logtest? flags 32) + (let* ((s5-1 91) + (s4-1 *dead-pool-list*) + (v1-10 (car s4-1)) + ) + (while (not (null? s4-1)) + (let ((a0-4 (-> (the-as symbol v1-10) value))) + (set! *global-search-count* s5-1) + (iterate-process-tree + (the-as process-tree a0-4) + (lambda ((arg0 basic)) + (let ((gp-0 *temp-mem-usage*) + (s5-0 *global-search-count*) + ) + (+! (-> gp-0 data s5-0 used) 1) + (+! (-> gp-0 data s5-0 total) (logand -16 (+ (asize-of arg0) 15))) + ) + #t + ) + *null-kernel-context* + ) + ) + (+! s5-1 1) + (set! s4-1 (cdr s4-1)) + (set! v1-10 (car s4-1)) + ) + ) + ) + (iterate-process-tree + this + (lambda ((arg0 process-drawable)) + (let ((gp-0 *temp-mem-usage*)) + (let ((s4-0 (cond + ((= (-> arg0 pool) *8k-dead-pool*) + 92 + ) + ((= (-> arg0 pool) *16k-dead-pool*) + 93 + ) + ((= (-> arg0 pool) *nk-dead-pool*) + 94 + ) + ((= (-> arg0 pool) *target-dead-pool*) + 95 + ) + ((= (-> arg0 pool) *camera-dead-pool*) + 96 + ) + ((= (-> arg0 pool) *debug-dead-pool*) + 97 + ) + (else + 91 + ) + ) + ) + ) + (+! (-> gp-0 data s4-0 count) 1) + (+! (-> gp-0 data s4-0 total) (logand -16 (+ (asize-of arg0) 15))) + ) + (set! (-> gp-0 length) (max 99 (-> gp-0 length))) + (set! (-> gp-0 data 98 name) "process-active") + (+! (-> gp-0 data 98 count) 1) + (let ((v1-23 (asize-of arg0))) + (+! (-> gp-0 data 98 used) v1-23) + (+! (-> gp-0 data 98 total) (logand -16 (+ v1-23 15))) + ) + (set! (-> gp-0 length) (max 100 (-> gp-0 length))) + (set! (-> gp-0 data 99 name) "heap-total") + (+! (-> gp-0 data 99 count) 1) + (let ((v1-34 (+ (- -4 (the-as int arg0)) (the-as int (-> arg0 heap-cur))))) + (+! (-> gp-0 data 99 used) v1-34) + (+! (-> gp-0 data 99 total) (logand -16 (+ v1-34 15))) + ) + (set! (-> gp-0 length) (max 101 (-> gp-0 length))) + (set! (-> gp-0 data 100 name) "heap-process") + (+! (-> gp-0 data 100 count) 1) + (let ((v1-45 (- (-> arg0 type size) (-> arg0 type heap-base)))) + (+! (-> gp-0 data 100 used) v1-45) + (+! (-> gp-0 data 100 total) (logand -16 (+ v1-45 15))) + ) + (set! (-> gp-0 length) (max 102 (-> gp-0 length))) + (set! (-> gp-0 data 101 name) "heap-header") + (+! (-> gp-0 data 101 count) 1) + (let ((v1-55 (-> arg0 type heap-base))) + (+! (-> gp-0 data 101 used) v1-55) + (+! (-> gp-0 data 101 total) (logand -16 (+ v1-55 15))) + ) + (set! (-> gp-0 length) (max 103 (-> gp-0 length))) + (set! (-> gp-0 data 102 name) "heap-thread") + (+! (-> gp-0 data 102 count) 1) + (let ((v1-65 (asize-of (-> arg0 main-thread)))) + (+! (-> gp-0 data 102 used) v1-65) + (+! (-> gp-0 data 102 total) (logand -16 (+ v1-65 15))) + ) + (when (type? arg0 process-drawable) + (when (nonzero? (-> arg0 root)) + (set! (-> gp-0 length) (max 104 (-> gp-0 length))) + (set! (-> gp-0 data 103 name) "heap-root") + (+! (-> gp-0 data 103 count) 1) + (let ((v1-78 (asize-of (-> arg0 root)))) + (+! (-> gp-0 data 103 used) v1-78) + (+! (-> gp-0 data 103 total) (logand -16 (+ v1-78 15))) + ) + (when (type? (-> arg0 root) collide-shape) + (set! (-> gp-0 length) (max 110 (-> gp-0 length))) + (set! (-> gp-0 data 109 name) "heap-collide-prim") + (+! (-> gp-0 data 109 count) 1) + (let ((v1-90 (asize-of (-> (the-as collide-shape-moving (-> arg0 root)) root-prim)))) + (+! (-> gp-0 data 109 used) v1-90) + (+! (-> gp-0 data 109 total) (logand -16 (+ v1-90 15))) + ) + ) + ) + (when (nonzero? (-> arg0 node-list)) + (set! (-> gp-0 length) (max 107 (-> gp-0 length))) + (set! (-> gp-0 data 106 name) "heap-cspace") + (+! (-> gp-0 data 106 count) 1) + (let ((v1-102 (asize-of (-> arg0 node-list)))) + (+! (-> gp-0 data 106 used) v1-102) + (+! (-> gp-0 data 106 total) (logand -16 (+ v1-102 15))) + ) + ) + (when (nonzero? (-> arg0 draw)) + (set! (-> gp-0 length) (max 105 (-> gp-0 length))) + (set! (-> gp-0 data 104 name) "heap-draw-control") + (+! (-> gp-0 data 104 count) 1) + (let ((v1-114 (asize-of (-> arg0 draw)))) + (+! (-> gp-0 data 104 used) v1-114) + (+! (-> gp-0 data 104 total) (logand -16 (+ v1-114 15))) + ) + (when (nonzero? (-> arg0 draw skeleton)) + (set! (-> gp-0 length) (max 108 (-> gp-0 length))) + (set! (-> gp-0 data 107 name) "heap-bone") + (+! (-> gp-0 data 107 count) 1) + (let ((v1-128 (asize-of (-> arg0 draw skeleton)))) + (+! (-> gp-0 data 107 used) v1-128) + (+! (-> gp-0 data 107 total) (logand -16 (+ v1-128 15))) + ) + ) + ) + (when (nonzero? (-> arg0 skel)) + (set! (-> gp-0 length) (max 106 (-> gp-0 length))) + (set! (-> gp-0 data 105 name) "heap-joint-control") + (+! (-> gp-0 data 105 count) 1) + (let ((v1-140 (asize-of (-> arg0 skel)))) + (+! (-> gp-0 data 105 used) v1-140) + (+! (-> gp-0 data 105 total) (logand -16 (+ v1-140 15))) + ) + ) + (when (nonzero? (-> arg0 part)) + (set! (-> gp-0 length) (max 109 (-> gp-0 length))) + (set! (-> gp-0 data 108 name) "heap-part") + (+! (-> gp-0 data 108 count) 1) + (let ((v1-152 (asize-of (-> arg0 part)))) + (+! (-> gp-0 data 108 used) v1-152) + (+! (-> gp-0 data 108 total) (logand -16 (+ v1-152 15))) + ) + ) + (when (nonzero? (-> arg0 nav)) + (set! (-> gp-0 length) (max 111 (-> gp-0 length))) + (set! (-> gp-0 data 110 name) "heap-misc") + (+! (-> gp-0 data 110 count) 1) + (let ((v1-164 (asize-of (-> arg0 nav)))) + (+! (-> gp-0 data 110 used) v1-164) + (+! (-> gp-0 data 110 total) (logand -16 (+ v1-164 15))) + ) + ) + (when (nonzero? (-> arg0 path)) + (set! (-> gp-0 length) (max 111 (-> gp-0 length))) + (set! (-> gp-0 data 110 name) "heap-misc") + (+! (-> gp-0 data 110 count) 1) + (let ((v1-176 (asize-of (-> arg0 path)))) + (+! (-> gp-0 data 110 used) v1-176) + (+! (-> gp-0 data 110 total) (logand -16 (+ v1-176 15))) + ) + ) + (when (nonzero? (-> arg0 vol)) + (set! (-> gp-0 length) (max 111 (-> gp-0 length))) + (set! (-> gp-0 data 110 name) "heap-misc") + (+! (-> gp-0 data 110 count) 1) + (let ((v1-188 (asize-of (-> arg0 vol)))) + (+! (-> gp-0 data 110 used) v1-188) + (+! (-> gp-0 data 110 total) (logand -16 (+ v1-188 15))) + ) + ) + ) + ) + #t + ) + *null-kernel-context* + ) + this + ) + +(define *max-dma* 0) + +(defmethod print-mem-usage ((this memory-usage-block) (arg0 level) (arg1 object)) + (local-vars (sv-16 object) (sv-32 string) (sv-48 symbol)) + (let ((s3-0 (&- (-> arg0 heap current) (the-as uint (-> arg0 heap base))))) + (let ((v1-2 (+ (-> this data 62 total) (-> this data 63 total)))) + (< #x10000 v1-2) + ) + (let* ((v1-4 (-> arg0 info memory-mode)) + (v1-5 + (cond + ((= v1-4 (level-memory-mode large)) + #xbd0000 + ) + ((= v1-4 (level-memory-mode medium)) + #x8fb800 + ) + ((or (= v1-4 (level-memory-mode small-center)) (= v1-4 (level-memory-mode city-center))) + #x627000 + ) + ((or (= v1-4 (level-memory-mode borrow)) + (= v1-4 (level-memory-mode borrow0)) + (= v1-4 (level-memory-mode borrow1)) + (= v1-4 (level-memory-mode borrow2)) + (= v1-4 (level-memory-mode borrow3)) + (= v1-4 (level-memory-mode borrow4)) + (= v1-4 (level-memory-mode borrow-city-small)) + ) + (+ (- #xc000 (the-as int (-> arg0 heap base))) (the-as int (-> arg0 heap top-base))) + ) + ((or (= v1-4 (level-memory-mode tiny-center)) + (= v1-4 (level-memory-mode tiny-edge)) + (= v1-4 (level-memory-mode city-tiny-edge)) + (= v1-4 (level-memory-mode tiny)) + ) + #x3f0000 + ) + ((= v1-4 (level-memory-mode micro)) + #x1f8000 + ) + ((= v1-4 (level-memory-mode tiny-center-micro)) + #x2f4000 + ) + ((= v1-4 (level-memory-mode tiny-center-small)) + #x4ec000 + ) + (else + #x5e8000 + ) + ) + ) + (a0-25 (-> arg0 info memory-mode)) + (v1-8 + (- (the-as int v1-5) + (the-as + uint + (if (or (= a0-25 (level-memory-mode tiny-center)) (or (= a0-25 (level-memory-mode tiny-edge)) + (= a0-25 (level-memory-mode city-tiny-edge)) + (= a0-25 (level-memory-mode tiny)) + ) + ) + #x24000 + #xc000 + ) + ) + ) + ) + (a0-28 0) + ) + (when (-> arg0 info borrow) + (dotimes (a1-21 5) + (+! a0-28 (-> arg0 info borrow borrow-size a1-21)) + ) + ) + (let ((s1-0 (- v1-8 (shl a0-28 10))) + (s2-0 (* (dma-buffer-length (-> *display* frames (-> *display* last-screen) global-buf)) 16)) + ) + (set! *max-dma* (max s2-0 *max-dma*)) + (if (< (- s1-0 (the-as int (shl (-> arg0 info buffer-size) 10))) s3-0) + (format arg1 "~3L") + ) + (let ((s0-0 format)) + (set! sv-16 arg1) + (set! sv-32 "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--") + (set! sv-48 (-> arg0 name)) + (let* ((s3-1 (sar s3-0 10)) + (s4-1 (- (sar s1-0 10) (the-as int (-> arg0 info buffer-size)))) + (s1-1 (sar (memory-used *nk-dead-pool*) 10)) + (t2-0 (sar (memory-total *nk-dead-pool*) 10)) + (t0-0 s4-1) + (t1-0 s1-1) + ) + (s0-0 sv-16 sv-32 sv-48 s3-1 t0-0 t1-0 t2-0) + (format arg1 "~5,'-DK/~5,'-DK--~%" (shr s2-0 10) (sar *max-dma* 10)) + (when *stats-memory-short* + (let ((s3-2 (if (cpad-hold? 1 l3) + #t + arg1 + ) + ) + (s4-2 format) + (s2-1 "heap-~5,'-DK/~5,'-DK----~D---~D/~D~%") + (s1-2 (sar (memory-used *nk-dead-pool*) 10)) + (s0-1 (sar (memory-total *nk-dead-pool*) 10)) + ) + (set! t0-0 (the-as int (compact-time *nk-dead-pool*))) + (set! t1-0 (the-as int (-> *nk-dead-pool* compact-count))) + (set! t2-0 (the-as int (-> *nk-dead-pool* compact-count-targ))) + (s4-2 s3-2 s2-1 s1-2 s0-1 (the-as uint t0-0) (the-as uint t1-0) (the-as uint t2-0)) + ) + ) + (when (not *stats-memory-short*) + (set! (-> *dma-mem-usage* data 88 total) + (* (dma-buffer-length (-> *display* frames (-> *display* last-screen) debug-buf)) 16) + ) + (let ((t9-11 format) + (a0-47 arg1) + (a1-28 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%") + (a2-12 (sar (+ (-> this data 59 total) (-> this data 60 total) (-> this data 61 total)) 10)) + (a3-5 (sar (-> *dma-mem-usage* data 88 total) 10)) + ) + (t9-11 a0-47 a1-28 a2-12 a3-5 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0)) + (format + arg1 + " bsp-leaf-vis ~192H~5DK~%" + (sar (+ (-> this data 62 total) (-> this data 63 total)) 10) + (the-as none a3-5) + ) + (format arg1 " level-code ~192H~5DK~%" (sar (-> this data 66 total) 10) (the-as none a3-5)) + ) + (format + arg1 + " tfrag ~192H~5DK ~280Htfragment~456H~5DK~%" + (sar + (+ (-> this data 1 total) + (-> this data 2 total) + (-> this data 3 total) + (-> this data 4 total) + (-> this data 5 total) + (-> this data 6 total) + (-> this data 7 total) + (-> this data 8 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 1 total) 10) + ) + (format + arg1 + " tie-proto ~192H~5DK ~280Hsky~456H~5DK~%" + (sar + (+ (-> this data 9 total) + (-> this data 10 total) + (-> this data 11 total) + (-> this data 12 total) + (-> this data 13 total) + (-> this data 14 total) + (-> this data 16 total) + (-> this data 17 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 89 total) 10) + ) + (format + arg1 + " tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%" + (sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10) + (sar (-> *dma-mem-usage* data 9 total) 10) + ) + (format + arg1 + " shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%" + (sar + (+ (-> this data 25 total) + (-> this data 26 total) + (-> this data 27 total) + (-> this data 28 total) + (-> this data 29 total) + (-> this data 30 total) + (-> this data 31 total) + (-> this data 32 total) + (-> this data 33 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 15 total) 10) + ) + (format + arg1 + " shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%" + (sar (-> this data 34 total) 10) + (sar (-> *dma-mem-usage* data 27 total) 10) + ) + (format + arg1 + " hfragment ~192H~5DK ~280Hhfragment~456H~5DK~%" + (sar (-> this data 43 total) 10) + (sar (-> *dma-mem-usage* data 43 total) 10) + (the-as none t0-0) + (the-as none t1-0) + (the-as none t2-0) + ) + (format + arg1 + " collision ~192H~5DK ~280Htie-generic~456H~5DK~%" + (sar + (+ (-> this data 51 total) + (-> this data 52 total) + (-> this data 53 total) + (-> this data 54 total) + (-> this data 55 total) + (-> this data 56 total) + (-> this data 57 total) + (-> this data 58 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 17 total) 10) + ) + (format + arg1 + " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%" + (sar + (+ (-> this data 35 total) + (-> this data 36 total) + (-> this data 37 total) + (-> this data 38 total) + (-> this data 39 total) + (-> this data 40 total) + (-> this data 41 total) + (-> this data 42 total) + (-> this data 74 total) + (-> this data 75 total) + (-> this data 76 total) + (-> this data 77 total) + (-> this data 79 total) + (-> this data 82 total) + (-> this data 81 total) + (-> this data 112 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 35 total) 10) + ) + (format + arg1 + " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%" + (sar + (+ (-> this data 68 total) + (-> this data 69 total) + (-> this data 70 total) + (-> this data 71 total) + (-> this data 72 total) + (-> this data 78 total) + (-> this data 80 total) + (-> this data 73 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 90 total) 10) + ) + (format + arg1 + " textures ~192H~5DK ~280Htextures~456H~5DK~%" + (sar (-> this data 83 total) 10) + (sar (-> *dma-mem-usage* data 83 total) 10) + ) + (format arg1 " entity ~192H~5DK~%" (sar + (+ (-> this data 67 total) + (-> this data 44 total) + (-> this data 45 total) + (-> this data 46 total) + (-> this data 50 total) + (-> this data 49 total) + (-> this data 47 total) + (-> this data 48 total) + ) + 10 + ) + ) + (format + arg1 + " misc ~192H~5DK ~280Hsprite~456H~5DK~%" + (sar + (+ (-> this data 0 total) + (-> this data 64 total) + (-> this data 65 total) + (-> this data 84 total) + (-> this data 85 total) + ) + 10 + ) + (sar (-> *dma-mem-usage* data 86 total) 10) + ) + ) + ) + ) + ) + ) + ) + (format arg1 "~1K~0L") + this + ) diff --git a/goal_src/jak3/engine/debug/menu.gc b/goal_src/jak3/engine/debug/menu.gc index bafdee1ba1..92397f77c3 100644 --- a/goal_src/jak3/engine/debug/menu.gc +++ b/goal_src/jak3/engine/debug/menu.gc @@ -747,7 +747,7 @@ ) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (draw-string-adv (-> arg0 name) s3-0 s5-0) (draw-string-adv "..." s3-0 s5-0) @@ -783,7 +783,7 @@ ) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (set-context! *font-work* s5-0) (draw-string (-> arg0 name) s3-0 s5-0) @@ -819,7 +819,7 @@ ) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (set-context! *font-work* s5-0) (draw-string (-> arg0 name) s3-0 s5-0) @@ -852,7 +852,7 @@ ) ) (with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (draw-string-adv (-> arg0 name) s1-0 s5-0) (draw-string-adv ":" s1-0 s5-0) @@ -933,7 +933,7 @@ ) ) (with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (draw-sprite2d-xy s0-0 @@ -978,7 +978,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id bucket585) + (bucket-id debug-menu) sv-32 (the-as (pointer dma-tag) a3-3) ) diff --git a/goal_src/jak3/engine/debug/nav-mesh-editor-h.gc b/goal_src/jak3/engine/debug/nav-mesh-editor-h.gc index 13b5c92ce5..8e8361a1c2 100644 --- a/goal_src/jak3/engine/debug/nav-mesh-editor-h.gc +++ b/goal_src/jak3/engine/debug/nav-mesh-editor-h.gc @@ -5,5 +5,204 @@ ;; name in dgo: nav-mesh-editor-h ;; dgos: GAME +(define-extern nav-mesh-editor-init (function none)) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(deftype vector-array (inline-array-class) + ((data vector :inline :dynamic) + ) + ) + + +(set! (-> vector-array heap-base) (the-as uint 16)) + +(deftype int16-array (inline-array-class) + ((data int16 :dynamic) + ) + ) + + +(set! (-> int16-array heap-base) (the-as uint 2)) + +(deftype nav-mesh-poly (structure) + ((poly-id uint32) + (flags uint32) + (index basic) + (insert-pos uint32) + ) + (:methods + (new (symbol type) _type_) + (nav-mesh-poly-method-9 () none) + (nav-mesh-poly-method-10 () none) + (nav-mesh-poly-method-11 () none) + (nav-mesh-poly-method-12 () none) + (nav-mesh-poly-method-13 () none) + (nav-mesh-poly-method-14 () none) + ) + ) + + +(deftype nav-mesh-poly-array (inline-array-class) + ((data nav-mesh-poly :inline :dynamic) + ) + ) + +(set! (-> nav-mesh-poly-array heap-base) (the-as uint 16)) + +;; WARN: Return type mismatch object vs nav-mesh-poly. +(defmethod new nav-mesh-poly ((allocation symbol) (type-to-make type)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((gp-0 (the-as object (t9-0 allocation v1-1)))) + (when (zero? (the-as structure gp-0)) + (set! gp-0 0) + (goto cfg-4) + ) + ((method-of-type nav-mesh-poly nav-mesh-poly-method-9)) + (label cfg-4) + (the-as nav-mesh-poly gp-0) + ) + ) + ) + +(deftype nav-mesh-tri-quad (structure) + ((indices int32 4) + (poly uint32) + ) + ) + + +(deftype nav-mesh-tri-quad-array (inline-array-class) + ((data nav-mesh-tri-quad :inline :dynamic) + ) + ) + + +(set! (-> nav-mesh-tri-quad-array heap-base) (the-as uint 32)) + +(deftype nav-mesh-editable (structure) + ((flags uint32) + (verts basic) + (tris basic) + (quads nav-mesh-tri-quad-array) + (navmesh-id uint32) + (idx uint32) + (level-name symbol) + (level-id uint32) + (polys nav-mesh-poly-array) + (selected-poly uint32) + ) + (:methods + (nav-mesh-editable-method-9 () none) + (nav-mesh-editable-method-10 () none) + (nav-mesh-editable-method-11 () none) + (nav-mesh-editable-method-12 () none) + (nav-mesh-editable-method-13 () none) + (nav-mesh-editable-method-14 () none) + (nav-mesh-editable-method-15 () none) + (nav-mesh-editable-method-16 () none) + (nav-mesh-editable-method-17 () none) + (nav-mesh-editable-method-18 () none) + ) + ) + + +(deftype nav-mesh-editable-array (inline-array-class) + ((data nav-mesh-editable :inline :dynamic) + ) + ) + + +(set! (-> nav-mesh-editable-array heap-base) (the-as uint 48)) + +(deftype nav-mesh-editor-undo (structure) + ((current-nav-mesh nav-mesh-editable) + (selected-poly uint32) + (index basic) + (insert-pos uint32) + (verts basic) + ) + (:methods + (new (symbol type) _type_) + (nav-mesh-editor-undo-method-9 () none) + ) + ) + + +(deftype nav-mesh-editor-undo-array (inline-array-class) + ((data nav-mesh-editor-undo :inline :dynamic) + ) + ) + + +(set! (-> nav-mesh-editor-undo-array heap-base) (the-as uint 32)) + +;; WARN: Return type mismatch object vs nav-mesh-editor-undo. +(defmethod new nav-mesh-editor-undo ((allocation symbol) (type-to-make type)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((gp-0 (the-as object (t9-0 allocation v1-1)))) + (when (zero? (the-as structure gp-0)) + (set! gp-0 0) + (goto cfg-4) + ) + ((method-of-type nav-mesh-editor-undo nav-mesh-editor-undo-method-9)) + (label cfg-4) + (the-as nav-mesh-editor-undo gp-0) + ) + ) + ) + +(deftype nav-mesh-editor (process-drawable) + ((close-menu-time uint64) + (external-cam-mode basic) + (mouse-pressed uint64) + (mouse-screen-pos vector :inline) + (mouse-pos vector :inline) + (mouse-end vector :inline) + (mouse-hit vector :inline) + (mouse-hit-pick vector :inline) + (mouse-snap vector :inline) + (mouse-normal vector :inline) + (mouse-collide basic) + (mouse-tumble-dist float) + (mouse-tumble vector :inline) + (manipulator-pos vector :inline) + (manipulator-back-pos vector :inline) + (lock-action basic) + (mouse-action uint32) + (mouse-action-pos-ref vector :inline) + (nav-meshes basic) + (current-nav-mesh nav-mesh-editable) + (manipulator manipulator :inline) + (level-name basic) + (level-id uint32) + (undo-min uint32) + (undo-id uint32) + (undo-max uint32) + (undos basic) + (hide-unselected basic) + (allow-snap basic) + ) + (:methods + (nav-mesh-editor-method-20 () none) + (nav-mesh-editor-method-21 () none) + (nav-mesh-editor-method-22 () none) + (nav-mesh-editor-method-23 () none) + (nav-mesh-editor-method-24 () none) + (nav-mesh-editor-method-25 () none) + (nav-mesh-editor-method-26 () none) + (nav-mesh-editor-method-27 () none) + ) + ) + + +(define *nav-mesh-editor* (the-as nav-mesh-editor #f)) diff --git a/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc b/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc index 68b6622717..476d4b990d 100644 --- a/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc +++ b/goal_src/jak3/engine/debug/nav/mysql-nav-graph.gc @@ -5,5 +5,217 @@ ;; name in dgo: mysql-nav-graph ;; dgos: GAME +;; +++nav-clock-type +(defenum nav-clock-type + "This string value is stored in their SQL database" + :type uint32 + :bitfield #f + (no-clock 0) + (clock2 1) + (clock3 2) + (clock4 3) + ) +;; ---nav-clock-type + + +;; +++nav-clock-mask +(defenum nav-clock-mask + "This string value is stored in their SQL database" + :type uint32 + :bitfield #t + (phase-1 0) + (phase-1a 1) + (phase-2 2) + (phase-2a 3) + (phase-3 4) + (phase-3a 5) + (phase-4 6) + (phase-4a 7) + ) +;; ---nav-clock-mask + + +;; +++nav-directionality +(defenum nav-directionality + :type uint32 + :bitfield #f + (default 0) + (directed 1) + (bi_directional 2) + ) +;; ---nav-directionality + + +;; +++nav-node-flag +(defenum nav-node-flag + "This string value is stored in their SQL database" + :type uint32 + :bitfield #t + (visited 0) + (blocked 1) + (pedestrian 2) + (selected 3) + (hidden 4) + ) +;; ---nav-node-flag + + +;; +++mysql-save-flag +(defenum mysql-save-flag + :type uint32 + :bitfield #t + (delete 1) + (update 2) + (insert 3) + ) +;; ---mysql-save-flag + + +(declare-type mysql-nav-edge structure) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(deftype mysql-nav-node (structure) + ((mysql-save-flag mysql-save-flag) + (runtime-id uint32) + (temp-edge-list (inline-array mysql-nav-edge)) + (level-node-index int32) + (cam-dist float) + (visible symbol) + (nav_node_id uint32) + (nav_graph_id uint32) + (position vector :inline) + (level_name symbol) + (angle float) + (radius float) + (nav_node_flag nav-node-flag) + (nav_mesh_id uint32) + (data_int_0 uint32) + (data_int_1 uint32) + ) + (:methods + (mysql-nav-node-method-9 () none) + (mysql-nav-node-method-10 () none) + ) + ) + + +(deftype mysql-nav-node-array (inline-array-class) + ((data mysql-nav-node :dynamic) + ) + ) + + +(set! (-> mysql-nav-node-array heap-base) (the-as uint 80)) + +(deftype mysql-nav-edge (structure) + ((mysql-save-flag mysql-save-flag) + (runtime-id uint32) + (runtime-node-id-1 int32) + (runtime-node-id-2 int32) + (temp-next-edge mysql-nav-edge) + (nav_edge_id uint32) + (nav_graph_id uint32) + (nav_node_id_1 uint32) + (nav_node_id_2 uint32) + (directionality nav-directionality) + (speed_limit float) + (density float) + (traffic_edge_flag int32) + (nav_clock_mask nav-clock-mask) + (nav_clock_type nav-clock-type) + (nav_territory_type uint32) + (exclusive_data uint32) + (width float) + (minimap_edge_flag int32) + ) + :allow-misaligned + (:methods + (mysql-nav-edge-method-9 () none) + ) + ) + + +(deftype mysql-nav-edge-array (inline-array-class) + ((data mysql-nav-edge :inline :dynamic) + ) + ) + + +(set! (-> mysql-nav-edge-array heap-base) (the-as uint 80)) + +(deftype mysql-nav-visnode (structure) + ((mysql-save-flag mysql-save-flag) + (runtime-node-id int32) + (runtime-edge-id int32) + (nav_visnode_id uint32) + (nav_graph_id uint32) + (nav_node_id uint32) + (nav_edge_id uint32) + ) + (:methods + (mysql-nav-visnode-method-9 () none) + ) + ) + + +(deftype mysql-nav-visnode-array (inline-array-class) + ((data mysql-nav-visnode :inline :dynamic) + ) + ) + + +(set! (-> mysql-nav-visnode-array heap-base) (the-as uint 32)) + +(deftype mysql-nav-pov-conn (structure) + ((runtime-node-id-1 int32) + (runtime-node-id-2 int32) + ) + ) + + +(deftype mysql-nav-graph-level-info (structure) + ((level symbol) + (level-id uint32) + (node-count int32) + (branch-count int32) + (to-link-count int32) + ) + :allow-misaligned + ) + + +(deftype mysql-nav-graph (basic) + ((nav_graph_id uint32) + (graph-type basic) + (node-array mysql-nav-node-array) + (edge-array mysql-nav-edge-array) + (visnode-array mysql-nav-visnode-array) + (pov-conn-array uint32) + (pov-conn-array-length int32) + (level-info-array-length int32) + (level-info-last-lookup int32) + (level-info-array mysql-nav-graph-level-info 32 :inline) + ) + (:methods + (new (symbol type) _type_) + (mysql-nav-graph-method-9 () none) + (mysql-nav-graph-method-10 () none) + (mysql-nav-graph-method-11 () none) + (mysql-nav-graph-method-12 () none) + (mysql-nav-graph-method-13 () none) + (mysql-nav-graph-method-14 () none) + (mysql-nav-graph-method-15 () none) + (mysql-nav-graph-method-16 () none) + (mysql-nav-graph-method-17 () none) + (mysql-nav-graph-method-18 () none) + (mysql-nav-graph-method-19 () none) + (mysql-nav-graph-method-20 () none) + (mysql-nav-graph-method-21 () none) + (mysql-nav-graph-method-22 () none) + (mysql-nav-graph-method-23 () none) + ) + ) diff --git a/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc index aa5ca9ad21..2bbcb6f3f0 100644 --- a/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak3/engine/debug/nav/nav-graph-editor.gc @@ -5,5 +5,123 @@ ;; name in dgo: nav-graph-editor ;; dgos: GAME +(declare-type nav-graph-editor process) +(define-extern run-nav-graph-editor (function symbol (pointer process))) +(define-extern get-nav-graph-editor (function nav-graph-editor)) +(define-extern exit-nav-graph-editor (function none)) +(define-extern *nav-graph-editor* (pointer nav-graph-editor)) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(deftype nav-graph-command (structure) + ((com-type uint32) + (id int32) + (index int32) + (move-vec vector :inline) + ) + ) + + +(deftype nav-graph-command-array (inline-array-class) + ((data nav-graph-command :inline :dynamic) + ) + ) + + +(set! (-> nav-graph-command-array heap-base) (the-as uint 32)) + +(deftype nav-graph-editor (process) + ((nav-graph mysql-nav-graph) + (mode symbol) + (command-id int32) + (max-command int32) + (selected-index int32) + (selected-dist float) + (selected-node-edge? symbol) + (closest-node int32) + (dist-closest-node float) + (closest-edge int32) + (dist-closest-edge float) + (mouse-pos vector :inline) + (mouse-hit vector :inline) + (mouse-hit-pick vector :inline) + (mouse-normal vector :inline) + (mouse-spos-hold vector :inline) + (edge-src int32) + (edge-dst int32) + (edge-visibility int32) + (vehicle-edit-mode symbol) + (hover-edit-mode symbol) + (plane-height float) + (plane-height-hold float) + (minimap-make-mode uint8) + (clipping-dist float) + (default-node mysql-nav-node :inline) + (default-edge mysql-nav-edge :inline) + (command-array nav-graph-command-array) + ) + (:state-methods + move-node + move-plane + create + edit-edge + create-edge + adjust-plane + adjust-it + adjust-minimap + adjust-node-angle + adjust-node-radius + adjust-edge-visibility + adjust-edge-width + adjust-edge-density + draw-closest-minimap + create-pov + ) + (:methods + (nav-graph-editor-method-29 () none) + (nav-graph-editor-method-30 () none) + (nav-graph-editor-method-31 () none) + (nav-graph-editor-method-32 () none) + (nav-graph-editor-method-33 () none) + (nav-graph-editor-method-34 () none) + (nav-graph-editor-method-35 () none) + (nav-graph-editor-method-36 () none) + (nav-graph-editor-method-37 () none) + (nav-graph-editor-method-38 () none) + (nav-graph-editor-method-39 () none) + (nav-graph-editor-method-40 () none) + (nav-graph-editor-method-41 () none) + (nav-graph-editor-method-42 () none) + (nav-graph-editor-method-43 () none) + (nav-graph-editor-method-44 () none) + (nav-graph-editor-method-45 () none) + (nav-graph-editor-method-46 () none) + (nav-graph-editor-method-47 () none) + (nav-graph-editor-method-48 () none) + (nav-graph-editor-method-49 () none) + (nav-graph-editor-method-50 () none) + (nav-graph-editor-method-51 () none) + (nav-graph-editor-method-52 () none) + (nav-graph-editor-method-53 () none) + (nav-graph-editor-method-54 () none) + (nav-graph-editor-method-55 () none) + (nav-graph-editor-method-56 () none) + (nav-graph-editor-method-57 () none) + (nav-graph-editor-method-58 () none) + (nav-graph-editor-method-59 () none) + (nav-graph-editor-method-60 () none) + (nav-graph-editor-method-61 () none) + (nav-graph-editor-method-62 () none) + (nav-graph-editor-method-63 () none) + (nav-graph-editor-method-64 () none) + (nav-graph-editor-method-65 () none) + (nav-graph-editor-method-66 () none) + (nav-graph-editor-method-67 () none) + ) + ) + + +(define *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) diff --git a/goal_src/jak3/engine/dma/dma-buffer.gc b/goal_src/jak3/engine/dma/dma-buffer.gc index c8afef49f7..8786f2a2f6 100644 --- a/goal_src/jak3/engine/dma/dma-buffer.gc +++ b/goal_src/jak3/engine/dma/dma-buffer.gc @@ -297,7 +297,7 @@ (let ((,bucket-edge (the (pointer dma-tag) (-> ,buf base)))) ;; if nothing was added, skip the tag entirely. - (when (!= ,bucket-edge ,buf-start) + ;;(when (!= ,bucket-edge ,buf-start) (let ((,pkt (the-as dma-packet (-> ,buf base)))) (set! (-> ,pkt dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -311,7 +311,7 @@ ,buf-start ;; the first thing in this chain, bucket will patch previous to this ,bucket-edge ;; end of this chain (ptr to next tag) ) - ) + ;; ) ) ) ) diff --git a/goal_src/jak3/engine/draw/drawable-h.gc b/goal_src/jak3/engine/draw/drawable-h.gc index ae2e51af97..b8ebc2c281 100644 --- a/goal_src/jak3/engine/draw/drawable-h.gc +++ b/goal_src/jak3/engine/draw/drawable-h.gc @@ -7,6 +7,7 @@ (declare-type region-prim-list structure) +(define-extern sphere-cull "Is this sphere visible? Uses cached camera matrix registers, so use with care." (function vector symbol)) (define-extern sphere-in-view-frustum? (function sphere symbol)) (define-extern line-in-view-frustum? (function vector vector symbol)) (define-extern vis-cull (function int symbol)) diff --git a/goal_src/jak3/engine/draw/drawable-tree-h.gc b/goal_src/jak3/engine/draw/drawable-tree-h.gc index e109b3378b..3a7a77a41c 100644 --- a/goal_src/jak3/engine/draw/drawable-tree-h.gc +++ b/goal_src/jak3/engine/draw/drawable-tree-h.gc @@ -17,5 +17,6 @@ Generally, the object passed to a large renderer is a drawable-tree." (deftype drawable-tree-array (drawable-group) "Collection of drawable trees. This might have a tfrag tree, tie tree, etc." - () + ((trees drawable-tree :dynamic :offset 32) + ) ) diff --git a/goal_src/jak3/engine/draw/drawable-tree.gc b/goal_src/jak3/engine/draw/drawable-tree.gc index 65fe2e378c..bf2fdc3b1b 100644 --- a/goal_src/jak3/engine/draw/drawable-tree.gc +++ b/goal_src/jak3/engine/draw/drawable-tree.gc @@ -15,7 +15,7 @@ ) (else (dotimes (s5-0 (-> this length)) - (draw (-> this data s5-0)) + (draw (-> this trees s5-0)) ) ) ) @@ -28,7 +28,7 @@ This is only called when viewing stats. The vis-bits and culling registers are loaded during this time." (dotimes (s5-0 (-> this length)) - (collect-stats (-> this data s5-0)) + (collect-stats (-> this trees s5-0)) ) 0 (none) @@ -37,7 +37,7 @@ (defmethod debug-draw ((this drawable-tree-array)) "Debug-draw a drawable and its children. Typically uses the debug-draw functions." (dotimes (s5-0 (-> this length)) - (debug-draw (-> this data s5-0)) + (debug-draw (-> this trees s5-0)) ) 0 (none) diff --git a/goal_src/jak3/engine/draw/drawable.gc b/goal_src/jak3/engine/draw/drawable.gc index aa0e16a9b2..09e38b57aa 100644 --- a/goal_src/jak3/engine/draw/drawable.gc +++ b/goal_src/jak3/engine/draw/drawable.gc @@ -192,7 +192,7 @@ (when (sphere-cull (-> arg0 bsphere)) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> arg0 bsphere) (-> arg0 bsphere w) (new 'static 'rgba :r #x80 :a #x80) @@ -1141,8 +1141,9 @@ ) (logclear! (-> arg1 status) (draw-control-status on-screen)) (when (not (logtest? (-> arg1 status) (draw-control-status no-draw no-draw-temp uninited))) - (let ((s3-0 (-> (the-as foreground-work #x70000000) bounds)) - (s4-0 (-> (the-as foreground-work #x70000000) lights)) + ;; og:preserve-this + (let ((s3-0 (-> (scratchpad-object foreground-work) bounds)) + (s4-0 (-> (scratchpad-object foreground-work) lights)) ) (.lvf vf16 (&-> arg1 origin quad)) (.svf (&-> s3-0 quad) vf16) @@ -1162,7 +1163,8 @@ (.lvf vf26 (&-> at-0 camera-rot fvec quad)) (.lvf vf27 (&-> at-0 camera-rot trans quad)) ) - (let ((v1-20 (-> (the-as foreground-work #x70000000) distance))) + ;; og:preserve-this + (let ((v1-20 (-> (scratchpad-object foreground-work) distance))) (.lvf vf15 (&-> s3-0 quad)) (.mul.w.vf acc vf27 vf0) (.add.mul.x.vf acc vf24 vf15 acc) @@ -1298,7 +1300,8 @@ (local-vars (a3-4 uint128)) (logclear! (-> arg1 status) (draw-control-status on-screen)) (when (not (logtest? (-> arg1 status) (draw-control-status no-draw no-draw-temp uninited))) - (let ((v1-6 (-> (the-as foreground-work #x70000000) lights)) + ;; og:preserve-this + (let ((v1-6 (-> (scratchpad-object foreground-work) lights)) (a0-3 *hud-lights*) ) (set! (-> v1-6 direction 0 quad) (-> a0-3 direction 0 quad)) @@ -1428,10 +1431,10 @@ (let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf))) (bones-init gp-0) (bones-mtx-calc-execute) - (generic-merc-execute-all gp-0) - (shadow-execute-all gp-0) + ;; (generic-merc-execute-all gp-0) + ;; (shadow-execute-all gp-0) ) - (lightning-draw-all) + ;; (lightning-draw-all) (prim-engine-execute) (none) ) @@ -1497,43 +1500,43 @@ (foreground-initialize-engines) (reset! *prim-work*) - ;; update wind/time of day prior to drawing. - (let ((gp-2 (-> pp clock))) - (if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3)) - (set! (-> pp clock) (-> *display* bg-clock)) - (set! (-> pp clock) (-> *display* real-clock)) - ) - (if (not (paused?)) - (update-wind *wind-work* *wind-scales*) - ) - (update-time-of-day *time-of-day-context*) - (set! (-> pp clock) gp-2) - ) - - ;; draw sky - (with-profiler 'sky *profile-sky-color* - (if (-> *sky-work* draw-vortex) - (draw-vortex) - (draw *sky-work*) - ) - (flush-cache 0) - ) - - - ;; draw ocean - (let ((gp-5 (-> pp clock))) - (if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3)) - (set! (-> pp clock) (-> *display* bg-clock)) - (set! (-> pp clock) (-> *display* real-clock)) - ) - (with-profiler 'ocean *profile-ocean-color* - (draw! *ocean*) - (if *ocean-map* - (update-map *ocean*) - ) - ) - (set! (-> pp clock) gp-5) - ) + ; ;; update wind/time of day prior to drawing. + ; (let ((gp-2 (-> pp clock))) + ; (if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3)) + ; (set! (-> pp clock) (-> *display* bg-clock)) + ; (set! (-> pp clock) (-> *display* real-clock)) + ; ) + ; (if (not (paused?)) + ; (update-wind *wind-work* *wind-scales*) + ; ) + ; (update-time-of-day *time-of-day-context*) + ; (set! (-> pp clock) gp-2) + ; ) + + ; ;; draw sky + ; (with-profiler 'sky *profile-sky-color* + ; (if (-> *sky-work* draw-vortex) + ; (draw-vortex) + ; (draw *sky-work*) + ; ) + ; (flush-cache 0) + ; ) + + + ; ;; draw ocean + ; (let ((gp-5 (-> pp clock))) + ; (if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3)) + ; (set! (-> pp clock) (-> *display* bg-clock)) + ; (set! (-> pp clock) (-> *display* real-clock)) + ; ) + ; (with-profiler 'ocean *profile-ocean-color* + ; (draw! *ocean*) + ; (if *ocean-map* + ; (update-map *ocean*) + ; ) + ; ) + ; (set! (-> pp clock) gp-5) + ; ) ;; draw foreground (foreground-engine-execute *foreground-draw-engine*) @@ -1549,8 +1552,8 @@ ) - (when *add-sphere* - ) + ; (when *add-sphere* + ; ) ;; sprites/particles (if (not (paused?)) @@ -1567,13 +1570,13 @@ (debug-draw-actors *level* *display-actor-marks*) (collide-shape-draw-debug-marks) ) - (when *display-trail-graph* - (let ((a0-67 *trail-graph*)) - (if a0-67 - (debug-draw a0-67) - ) - ) - ) + ; (when *display-trail-graph* + ; (let ((a0-67 *trail-graph*)) + ; (if a0-67 + ; (debug-draw a0-67) + ; ) + ; ) + ; ) ;; dispatch collision events (send-events-for-touching-shapes *touching-list*) @@ -1586,12 +1589,12 @@ (actors-update *level*) ) - ;; do navigation math - (with-profiler 'nav *profile-nav-color* - (update-nav-meshes-method *level*) - ) + ; ;; do navigation math + ; (with-profiler 'nav *profile-nav-color* + ; (update-nav-meshes-method *level*) + ; ) - ;; draw the backgroun + ;; draw the background (with-profiler 'background *profile-background-color* (init-background) (execute-connections *background-draw-engine* #f) @@ -1785,7 +1788,11 @@ ;; WARN: Return type mismatch display vs none. (defun display-frame-start ((arg0 display) (arg1 int) (arg2 float)) "Advance clocks, poll pads/mouse, set up buckets." - (set! (-> (the-as vif-bank #x10003c00) err me0) 1) + + ;; workaround for PS2 hardware bug + ;; (set! (-> (the-as vif-bank #x10003c00) err me0) 1) + + ;; update clocks (set-time-ratios *display* 1.0) (tick! (-> arg0 frame-clock)) (tick! (-> arg0 real-frame-clock)) @@ -1811,6 +1818,7 @@ (tick! (-> arg0 user9-clock)) (set! (-> arg0 bg-clock frame-counter) (the-as time-frame (mod (-> arg0 bg-clock frame-counter) #x69780))) (tick! (-> arg0 part-clock)) + (when (and (nonzero? *screen-shot-work*) (!= (-> *screen-shot-work* count) -1)) (let ((v1-61 (-> *screen-shot-work* size))) (if (!= (-> *screen-shot-work* count) (* v1-61 v1-61)) @@ -1871,6 +1879,7 @@ (with-profiler 'texture *profile-texture-color* (when (-> *texture-pool* update-sprites-flag) (update-sprites *texture-pool*) + ;; TODO (particle-adgif-cache-flush) (remap-all-particles) ) @@ -1886,7 +1895,7 @@ (update-warp-and-hud *texture-pool*) ) (-> arg0 frames (-> arg0 on-screen) global-buf) - (update-eyes) + ;; (update-eyes) TODO ) (when *debug-segment* (with-profiler 'debug *profile-debug-color* @@ -2098,15 +2107,34 @@ ) ) +;; og:preserve-this pc port function +(defun pc-maybe-vsync () + "PC Port implementation of the block of code in display-sync that computes frame-time-ratio and maybe vsyncs." + ;; for now, it's very simple. + + ;; I think the right logic in the future is to always vsync here, but return a more accurate dog ratio. + + (syncv 0) ;; sync always! + 1.0 ;; and report that we run at full speed. + ) + (defun display-sync ((arg0 display)) + ;; wait for VU1 rendering to complete. (sync-path 0 0) + + ;; measure the time it took for this frame (let* ((s4-0 (-> arg0 last-screen)) (s2-0 (shl (timer-count (the-as timer-bank #x10000800)) 48)) (s5-0 (shl (-> arg0 frames s4-0 start-time) 48)) (a1-1 (shl (-> arg0 vblank-start-time 0) 48)) (s1-0 (shl (-> arg0 vblank-start-time 1) 48)) ) - (set! *ticks-per-frame* (max 9000 (min #x2ee0 (sar (- s1-0 a1-1) 48)))) + + ;; the *ticks-per-frame* is set based on vblank interrupt timing. Just lock it, like we did for Jak 2. + ;; this value should be related the PS2's NTSC/PAL output system. + ;; (set! *ticks-per-frame* (max 9000 (min #x2ee0 (sar (- s1-0 a1-1) 48)))) + (set! *ticks-per-frame* 9765) + (let ((f28-0 (the float *ticks-per-frame*)) (s3-0 (sar (- s2-0 s5-0) 48)) (f30-1 (fmax 1.0 (calc-ratio (the-as int s2-0) (the-as int s5-0)))) @@ -2118,47 +2146,58 @@ (if (< (the-as int s3-0) 0) (set! s3-0 (the uint (+ #x10000 s3-0))) ) - (set! (-> arg0 frames s4-0 run-time) s3-0) - (set! f30-1 (cond - ((-> arg0 run-half-speed) - (syncv 0) - (let ((a0-8 (shl (timer-count (the-as timer-bank #x10000800)) 48))) - (if (and (< (calc-ratio (the-as int a0-8) (the-as int s5-0)) 2.0) (< f28-1 0.9)) - (syncv 0) - ) - ) - 2.0 - ) - ((< 1.0 f30-1) - (when (> (-> arg0 force-sync) 0) - (syncv 0) - (+! (-> arg0 force-sync) -1) - (let ((a0-12 (shl (timer-count (the-as timer-bank #x10000800)) 48))) - (set! f30-1 (calc-ratio (the-as int a0-12) (the-as int s5-0))) - ) - ) - f30-1 - ) - ((and (= f30-1 1.0) (< f30-1 f26-0)) - (while (< f30-1 f26-0) - (let ((a0-14 (shl (timer-count (the-as timer-bank #x10000800)) 48))) - (set! f30-1 (calc-ratio (the-as int a0-14) (the-as int s5-0))) - ) - (if (< f30-1 0.0) - (set! f30-1 f26-0) - ) - ) - 1.0 - ) - (else - (if (< f28-1 0.9) - (syncv 0) - ) - f30-1 - ) - ) - ) + + ;; track previous frame's run time. This is used to disable some extra effects if the game + ;; is close to lagging. We disable this. + ; (set! (-> arg0 frames s4-0 run-time) s3-0) + (set! (-> arg0 frames s4-0 run-time) 0) + + ;; disable their vsync logic: + ; (set! f30-1 (cond + ; ((-> arg0 run-half-speed) + ; (syncv 0) + ; (let ((a0-8 (shl (timer-count (the-as timer-bank #x10000800)) 48))) + ; (if (and (< (calc-ratio (the-as int a0-8) (the-as int s5-0)) 2.0) (< f28-1 0.9)) + ; (syncv 0) + ; ) + ; ) + ; 2.0 + ; ) + ; ((< 1.0 f30-1) + ; (when (> (-> arg0 force-sync) 0) + ; (syncv 0) + ; (+! (-> arg0 force-sync) -1) + ; (let ((a0-12 (shl (timer-count (the-as timer-bank #x10000800)) 48))) + ; (set! f30-1 (calc-ratio (the-as int a0-12) (the-as int s5-0))) + ; ) + ; ) + ; f30-1 + ; ) + ; ((and (= f30-1 1.0) (< f30-1 f26-0)) + ; (while (< f30-1 f26-0) + ; (let ((a0-14 (shl (timer-count (the-as timer-bank #x10000800)) 48))) + ; (set! f30-1 (calc-ratio (the-as int a0-14) (the-as int s5-0))) + ; ) + ; (if (< f30-1 0.0) + ; (set! f30-1 f26-0) + ; ) + ; ) + ; 1.0 + ; ) + ; (else + ; (if (< f28-1 0.9) + ; (syncv 0) + ; ) + ; f30-1 + ; ) + ; ) + ; ) ) + + ;; always vsync: + (set! f30-1 (pc-maybe-vsync)) + + ;; remember start time: (let ((s4-1 (-> arg0 on-screen))) (let ((v1-50 (timer-count (the-as timer-bank #x10000800)))) (let ((a0-19 (sar (- (shl v1-50 48) s5-0) 48))) @@ -2169,22 +2208,30 @@ ) (set! (-> arg0 frames s4-1 start-time) v1-50) ) - (set-graphics-mode) + + ;; (set-graphics-mode) + + ;; start dma (let ((s5-1 (-> arg0 frames s4-1 calc-buf))) (when (nonzero? (dma-buffer-length s5-1)) + ;; swap buffers (+! s4-1 1) (if (< 1 s4-1) (set! s4-1 0) ) (set! (-> arg0 last-screen) (-> arg0 on-screen)) (set! (-> arg0 on-screen) s4-1) + ;; reset VU profiler (when *debug-segment* (set! *profile-interrupt-segment* (-> *display* frames (-> *display* last-screen) profile-array data 1)) (set! (-> *profile-interrupt-segment* depth) 0) (set! (-> *profile-interrupt-segment* max-depth) 1) ) + ;; DMA! (if (not (-> *display* dma-buffer-overflow)) - (dma-buffer-send-chain (the-as dma-bank-source #x10009000) s5-1) + ;; (dma-buffer-send-chain (the-as dma-bank-source #x10009000) s5-1) + (__send-gfx-dma-chain (the-as dma-bank-source #x10009000) (-> s5-1 data)) + ) ) ) diff --git a/goal_src/jak3/engine/engine/engines.gc b/goal_src/jak3/engine/engine/engines.gc index b66c427156..299770373c 100644 --- a/goal_src/jak3/engine/engine/engines.gc +++ b/goal_src/jak3/engine/engine/engines.gc @@ -11,6 +11,7 @@ :bitfield #t (pls0 0) (pls1 1) + (pls2 2) ) ;; ---part-local-space-flags diff --git a/goal_src/jak3/engine/entity/entity-h.gc b/goal_src/jak3/engine/entity/entity-h.gc index 3a70056ca8..caacb12587 100644 --- a/goal_src/jak3/engine/entity/entity-h.gc +++ b/goal_src/jak3/engine/entity/entity-h.gc @@ -32,6 +32,7 @@ (declare-type race-mesh basic) (declare-type nav-poly structure) +(define-extern process-by-ename (function string process)) (define-extern entity-by-name (function string entity)) (define-extern entity-by-aid (function uint entity)) (define-extern reset-actors (function symbol none)) diff --git a/goal_src/jak3/engine/entity/entity-table.gc b/goal_src/jak3/engine/entity/entity-table.gc index b20bf31d02..dae5720082 100644 --- a/goal_src/jak3/engine/entity/entity-table.gc +++ b/goal_src/jak3/engine/entity/entity-table.gc @@ -95,7 +95,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref ladder :method-count 0) + :ptype (type-ref ladder :method-count 27) :pool '*16k-dead-pool* :heap-size #x4000 ) diff --git a/goal_src/jak3/engine/entity/entity.gc b/goal_src/jak3/engine/entity/entity.gc index a8f963c3b7..4ba0e9fc77 100644 --- a/goal_src/jak3/engine/entity/entity.gc +++ b/goal_src/jak3/engine/entity/entity.gc @@ -1115,7 +1115,7 @@ (if (and (nonzero? (-> (the-as process-drawable arg0) draw)) *display-actor-vis*) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> (the-as process-drawable arg0) draw origin) (-> (the-as process-drawable arg0) draw bounds w) (new 'static 'rgba :r #x80 :a #x80) @@ -1348,7 +1348,7 @@ ) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> (the-as process-drawable s0-2) draw origin) (-> (the-as process-drawable s0-2) draw bounds w) (new 'static 'rgba :r #x80 :a #x80) diff --git a/goal_src/jak3/engine/entity/relocate.gc b/goal_src/jak3/engine/entity/relocate.gc index 566ef4854e..5d27c57ba7 100644 --- a/goal_src/jak3/engine/entity/relocate.gc +++ b/goal_src/jak3/engine/entity/relocate.gc @@ -7,3 +7,417 @@ ;; DECOMP BEGINS +(defmethod relocate ((this process) (offset int)) + (let ((v1-0 *kernel-context*)) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) + (set! (-> v1-0 relocating-max) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) + ) + (set! (-> v1-0 relocating-offset) offset) + ) + (&+! (-> this ppointer 0) offset) + (let ((v1-5 (-> this entity))) + (if (and v1-5 (= (-> v1-5 extra process) this)) + (&+! (-> v1-5 extra process) offset) + ) + ) + (let ((v1-7 (-> this connection-list next1))) + (while (the-as connection v1-7) + (let ((a0-14 (-> v1-7 prev1))) + (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) + (< (the-as int a0-14) (-> *kernel-context* relocating-max)) + ) + (&+! (-> v1-7 prev1) offset) + ) + ) + (let ((a0-19 (-> (the-as connection v1-7) param1))) + (if (and (>= (the-as int a0-19) (-> *kernel-context* relocating-min)) + (< (the-as int a0-19) (-> *kernel-context* relocating-max)) + ) + (&+! (-> (the-as connection v1-7) param1) offset) + ) + ) + (let ((a0-24 (-> (the-as connection v1-7) param2))) + (if (and (>= a0-24 (-> *kernel-context* relocating-min)) (< a0-24 (-> *kernel-context* relocating-max))) + (+! (-> (the-as connection v1-7) param2) offset) + ) + ) + (let ((a0-29 (-> (the-as connection v1-7) param3))) + (if (and (>= a0-29 (-> *kernel-context* relocating-min)) (< a0-29 (-> *kernel-context* relocating-max))) + (+! (-> (the-as connection v1-7) param3) offset) + ) + ) + (set! v1-7 (-> (the-as connection v1-7) next1)) + ) + ) + (let ((v1-10 (-> this self))) + (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) + (< (the-as int v1-10) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this self) offset) + ) + ) + (let ((v1-15 (-> this ppointer))) + (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) + (< (the-as int v1-15) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this ppointer) offset) + ) + ) + ;; og:preserve-this basic cast + (let ((s4-0 (the-as basic (&+ (-> this heap-base) 4)))) + (while (< (the-as int s4-0) (the-as int (-> this heap-cur))) + (relocate s4-0 offset) + (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) + ) + ) + (&+! (-> this main-thread) offset) + (&+! (-> this top-thread) offset) + (if (-> this state-stack) + (&+! (-> this state-stack) offset) + ) + (&+! (-> this heap-base) offset) + (&+! (-> this heap-cur) offset) + (&+! (-> this heap-top) offset) + (let ((a2-4 (asize-of this)) + (a1-22 (&-> this type)) + ) + (cond + ((>= offset 0) + (qmem-copy->! (&+ a1-22 offset) a1-22 a2-4) + ) + ((< a2-4 2560) + (qmem-copy<-! (&+ a1-22 offset) a1-22 a2-4) + ) + (else + (ultimate-memcpy (&+ a1-22 offset) a1-22 (the-as uint a2-4)) + ) + ) + ) + (set! (-> *kernel-context* relocating-process) #f) + (&+ this offset) + ) + +(defmethod relocate ((this cpu-thread) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; WARN: Return type mismatch process vs process-drawable. +(defmethod relocate ((this process-drawable) (offset int)) + (let ((v1-0 *kernel-context*)) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) + (set! (-> v1-0 relocating-max) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) + ) + (set! (-> v1-0 relocating-offset) offset) + ) + (let ((a0-6 (-> this nav))) + (if (and (nonzero? a0-6) a0-6) + (relocate a0-6 offset) + ) + ) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this node-list)) + (&+! (-> this node-list) offset) + ) + (if (nonzero? (-> this draw)) + (&+! (-> this draw) offset) + ) + (if (nonzero? (-> this skel)) + (&+! (-> this skel) offset) + ) + (if (nonzero? (-> this align)) + (&+! (-> this align) offset) + ) + (if (nonzero? (-> this path)) + (&+! (-> this path) offset) + ) + (if (nonzero? (-> this vol)) + (&+! (-> this vol) offset) + ) + (if (nonzero? (-> this fact)) + (&+! (-> this fact) offset) + ) + (if (nonzero? (-> this link)) + (&+! (-> this link) offset) + ) + (if (nonzero? (-> this part)) + (&+! (-> this part) offset) + ) + (if (nonzero? (-> this water)) + (&+! (-> this water) offset) + ) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) offset) + ) + (if (nonzero? (-> this carry)) + (&+! (-> this carry) offset) + ) + (if (nonzero? (-> this rbody)) + (&+! (-> this rbody) offset) + ) + (the-as process-drawable ((method-of-type process relocate) this offset)) + ) + +(defmethod relocate ((this collide-shape) (offset int)) + (&+! (-> this process) offset) + (&+! (-> this root-prim) offset) + this + ) + +;; WARN: Return type mismatch collide-shape vs collide-shape-moving. +(defmethod relocate ((this collide-shape-moving) (offset int)) + (if (-> this dynam) + (&+! (-> this dynam) offset) + ) + (the-as collide-shape-moving ((method-of-type collide-shape relocate) this offset)) + ) + +(defmethod relocate ((this collide-shape-prim) (offset int)) + (&+! (-> this cshape) offset) + this + ) + +(defmethod relocate ((this collide-shape-prim-group) (offset int)) + (&+! (-> this cshape) offset) + (&+! (-> this child) offset) + this + ) + +(defmethod relocate ((this fact-info) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this draw-control) (offset int)) + (&+! (-> this skeleton) offset) + (&+! (-> this process) offset) + (when (-> this ripple) + (if (-> this ripple query) + (&+! (-> this ripple query) offset) + ) + (&+! (-> this ripple) offset) + ) + (let ((v1-14 (-> this shadow-ctrl))) + (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) + (< (the-as int v1-14) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this shadow-ctrl) offset) + ) + ) + (when (-> this cloth-instances) + (dotimes (v1-21 (-> this cloth-instances length)) + (&+! (-> this cloth-instances v1-21) offset) + ) + (&+! (-> this cloth-instances) offset) + ) + this + ) + +(defmethod relocate ((this joint-control) (offset int)) + (if (-> this effect) + (&+! (-> this effect) offset) + ) + (if (-> this top-anim) + (&+! (-> this top-anim) offset) + ) + (&+! (-> this root-channel) offset) + (countdown (v1-10 (-> this allocated-length)) + (&+! (-> this channel v1-10 parent) offset) + ) + this + ) + +(defmethod relocate ((this cspace-array) (offset int)) + (countdown (v1-0 (-> this length)) + (let ((a2-2 (-> this data v1-0))) + (if (-> a2-2 parent) + (&+! (-> a2-2 parent) offset) + ) + (&+! (-> a2-2 bone) offset) + (let ((a3-6 (-> a2-2 param1))) + (if (and (>= (the-as int a3-6) (-> *kernel-context* relocating-min)) + (< (the-as int a3-6) (-> *kernel-context* relocating-max)) + ) + (&+! (-> a2-2 param1) offset) + ) + ) + (let ((a3-11 (-> a2-2 param2))) + (if (and (>= (the-as int a3-11) (-> *kernel-context* relocating-min)) + (< (the-as int a3-11) (-> *kernel-context* relocating-max)) + ) + (&+! (-> a2-2 param2) offset) + ) + ) + ) + ) + this + ) + +(defmethod relocate ((this path-control) (offset int)) + (&+! (-> this process) offset) + (let ((v1-2 (-> this curve cverts))) + (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) + (< (the-as int v1-2) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this curve cverts) offset) + ) + ) + this + ) + +(defmethod relocate ((this vol-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this water-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this actor-link-info) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this align-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this joint-mod) (offset int)) + (&+! (-> this process) offset) + (&+! (-> this joint) offset) + this + ) + +(defmethod relocate ((this joint-mod-ik) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this effect-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +(defmethod relocate ((this sparticle-launch-control) (offset int)) + (&+! (-> this proc) offset) + (countdown (v1-2 (-> this length)) + (let* ((a0-4 (-> this data v1-2)) + (a2-0 (-> a0-4 center)) + ) + (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) + (< (the-as int a2-0) (-> *kernel-context* relocating-max)) + ) + (&+! (-> a0-4 center) offset) + ) + ) + ) + (forall-particles-with-key + this + (lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (let ((v1-1 (-> *kernel-context* relocating-offset))) + (set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))) + (if (-> arg1 binding) + (set! (-> arg1 binding) (the-as sparticle-launch-state (+ (the-as int (-> arg1 binding)) v1-1))) + ) + ) + 0 + (none) + ) + #t + #t + ) + this + ) + +;; WARN: Return type mismatch process vs camera-master. +(defmethod relocate ((this camera-master) (offset int)) + (if (nonzero? (-> this water-drip)) + (&+! (-> this water-drip) offset) + ) + (the-as camera-master ((method-of-type process relocate) this offset)) + ) + +;; WARN: Return type mismatch process vs time-of-day-proc. +(defmethod relocate ((this time-of-day-proc) (offset int)) + (if (nonzero? (-> this sun)) + (&+! (-> this sun) offset) + ) + (if (nonzero? (-> this green-sun)) + (&+! (-> this green-sun) offset) + ) + (if (nonzero? (-> this moon)) + (&+! (-> this moon) offset) + ) + (if (nonzero? (-> this day-star)) + (&+! (-> this day-star) offset) + ) + (the-as time-of-day-proc ((method-of-type process relocate) this offset)) + ) + +;; WARN: Return type mismatch process vs part-tracker. +(defmethod relocate ((this part-tracker) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this part)) + (&+! (-> this part) offset) + ) + (the-as part-tracker ((method-of-type process relocate) this offset)) + ) + +;; WARN: Return type mismatch process vs part-spawner. +(defmethod relocate ((this part-spawner) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this part)) + (&+! (-> this part) offset) + ) + (if (nonzero? (-> this path)) + (&+! (-> this path) offset) + ) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) offset) + ) + (if (nonzero? (-> this sound-extra)) + (&+! (-> this sound-extra) offset) + ) + (the-as part-spawner ((method-of-type process relocate) this offset)) + ) + +;; WARN: Return type mismatch process vs lightning-tracker. +(defmethod relocate ((this lightning-tracker) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) offset) + ) + (the-as lightning-tracker ((method-of-type process relocate) this offset)) + ) + +;; WARN: Return type mismatch process-drawable vs manipy. +(defmethod relocate ((this manipy) (offset int)) + (if (nonzero? (-> this joint 0)) + (&+! (-> this joint 0) offset) + ) + (if (nonzero? (-> this joint 1)) + (&+! (-> this joint 1) offset) + ) + (if (nonzero? (-> this joint 2)) + (&+! (-> this joint 2) offset) + ) + (if (nonzero? (-> this joint 3)) + (&+! (-> this joint 3) offset) + ) + (the-as manipy ((method-of-type process-drawable relocate) this offset)) + ) diff --git a/goal_src/jak3/engine/game/effect-control.gc b/goal_src/jak3/engine/game/effect-control.gc index 9ad57dd85d..b1c22be43f 100644 --- a/goal_src/jak3/engine/game/effect-control.gc +++ b/goal_src/jak3/engine/game/effect-control.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(define *footstep-surface* (the-as object 7168)) +(define *footstep-surface* (new 'static 'pat-surface :material (pat-material grass))) (define *debug-effect-control* #f) @@ -103,7 +103,7 @@ ) ((25) (logior! (-> arg0 mask) (sound-mask reg0)) - (set! (-> arg0 reg 0) (the-as uint (shr (shl (the-as int *footstep-surface*) 48) 58))) + (set! (-> arg0 reg 0) (the-as uint (-> *footstep-surface* material))) (let* ((s2-3 arg3) (v1-33 (if (type? s2-3 process-focusable) s2-3 @@ -369,7 +369,7 @@ ) ) ) - (do-effect-for-surface this (the-as symbol s3-0) arg1 arg2 (-> this res) (the-as pat-surface t1-2)) + (do-effect-for-surface this (the-as symbol s3-0) arg1 arg2 (-> this res) t1-2) ) ) ((and (= (-> s3-0 data 0) 103) diff --git a/goal_src/jak3/engine/game/game-info-h.gc b/goal_src/jak3/engine/game/game-info-h.gc index d0d1b14d3d..78cfeeab33 100644 --- a/goal_src/jak3/engine/game/game-info-h.gc +++ b/goal_src/jak3/engine/game/game-info-h.gc @@ -413,7 +413,7 @@ (dust-storm handle) (flut-count int32) (death-resetter resetter-spec :inline) - (current-vehicle uint8) + (current-vehicle game-vehicle-u8) (vehicle-turbo-ready float) (percent-complete float) ) diff --git a/goal_src/jak3/engine/game/game-info.gc b/goal_src/jak3/engine/game/game-info.gc index 1d5e1fc88e..4084f20c23 100644 --- a/goal_src/jak3/engine/game/game-info.gc +++ b/goal_src/jak3/engine/game/game-info.gc @@ -476,7 +476,7 @@ (set! (-> this old-vehicles) (game-vehicles)) (set! (-> this secrets) (game-secrets)) (set! (-> this purchase-secrets) (game-secrets)) - (set! (-> this current-vehicle) (the-as uint 27)) + (set! (-> this current-vehicle) (game-vehicle-u8 v-turtle v-snake v-toad v-fox)) (set-continue! this (cond @@ -487,7 +487,8 @@ "title-start" ) ((and *debug-segment* (= mode 'boot)) - "wascity-start" + "halfpipe" + ;; "wascity-start" ) (else "title-start" @@ -587,7 +588,10 @@ (dotimes (v1-96 (-> this game-score length)) (set! (-> this game-score v1-96) 0.0) ) - ((method-of-object *bigmap* bigmap-method-9)) + (when (nonzero? *bigmap*) ;; og:preserve-this not-yet-implemented check + (format 0 "skipping bigmap init in game-info~%") + ((method-of-object *bigmap* bigmap-method-9)) + ) ) ) (case mode @@ -684,13 +688,17 @@ (get-current-continue-forced this) ) ) + (t1-3 arg2) + (t2-0 reset-spec) ) - ((the-as (function symbol symbol continue-point game-save resetter-spec none :behavior process) s0-2) - (the-as symbol sv-128) - (the-as symbol sv-144) - (the-as continue-point sv-160) - (the-as game-save mode) - (the-as resetter-spec t0-4) + ((the-as (function cpu-thread function symbol symbol continue-point game-save resetter-spec none) s0-2) + sv-128 + sv-144 + sv-160 + mode + (the-as continue-point t0-4) + t1-3 + t2-0 ) ) ) @@ -1394,6 +1402,10 @@ (defmethod copy-perms-to-level! ((this game-info) (arg0 level)) (let ((s5-0 (-> arg0 bsp level entity))) + (when (not s5-0) ;; og:preserve-this not-yet-implemented check + (format #t "skipping copy-perms-to-level! since we have no entity links (needs entity.gc)~%") + (return 0) + ) (dotimes (s4-0 (-> s5-0 length)) (let* ((s3-0 (-> s5-0 data s4-0 entity extra perm)) (v1-7 (actor-perm this (-> s3-0 aid))) @@ -1893,7 +1905,10 @@ (defmethod adjust-to-screen-flip ((this cpad-info)) (if (and (not (paused?)) (zero? (-> this number)) (-> *setting-control* user-current player-control-override)) - (override-player-controls) + (when (nonzero? override-player-controls) ;; og:preserve-this not-yet-implemented check + ;; added nonzero check, but I suspect there's a bug we're even getting here... + (override-player-controls) + ) ) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) @@ -2149,8 +2164,8 @@ lightjak-shield artifact-invis feature56 - feature57 - feature58 + lighteco + darkeco ) ) (set! (-> gp-0 vehicles) (game-vehicles v-turtle v-snake v-scorpion v-toad v-fox v-rhino v-mirage v-x-ride)) @@ -2175,7 +2190,7 @@ (set! (-> gp-0 distance) 0.0) (set! (-> gp-0 health-bar-vehicle) 0.0) (set! (-> gp-0 dust-storm) (the-as handle #f)) - (set! (-> gp-0 current-vehicle) (the-as uint 27)) + (set! (-> gp-0 current-vehicle) (game-vehicle-u8 v-turtle v-snake v-toad v-fox)) ) 0 diff --git a/goal_src/jak3/engine/game/game-save.gc b/goal_src/jak3/engine/game/game-save.gc index 5e4ccac5b5..7d910b7a7b 100644 --- a/goal_src/jak3/engine/game/game-save.gc +++ b/goal_src/jak3/engine/game/game-save.gc @@ -1898,7 +1898,7 @@ (set! (-> this vehicles) (the-as game-vehicles (-> (the-as game-save-tag s4-0) user-uint64))) ) (((game-save-elt vehicle)) - (set! (-> this current-vehicle) (-> (the-as game-save-tag s4-0) user-uint8 0)) + (set! (-> this current-vehicle) (the-as game-vehicle-u8 (-> (the-as game-save-tag s4-0) user-uint8 0))) ) (((game-save-elt items)) (set! (-> this items) (the-as game-items (-> (the-as game-save-tag s4-0) user-uint64))) diff --git a/goal_src/jak3/engine/game/main-h.gc b/goal_src/jak3/engine/game/main-h.gc index c5f28b97a3..e72cda4468 100644 --- a/goal_src/jak3/engine/game/main-h.gc +++ b/goal_src/jak3/engine/game/main-h.gc @@ -10,6 +10,7 @@ (define-extern paused? (function symbol)) (define-extern demo? (function symbol)) (define-extern kiosk? (function symbol)) +(define-extern scene-select? (function symbol)) (define-extern set-blackout-frames (function time-frame none)) (define-extern set-master-mode (function symbol none)) (define-extern on (function symbol process)) @@ -134,18 +135,9 @@ ;; +++main-h:race-selection (defenum race-selection :type int64 - ; (kiera-class3 0) - ; (kiera-class2 1) - ; (kiera-class1 2) - ; (errol 3) - ; (bush-class3 4) - ; (bush-class2 5) - ; (bush-class1 6) - ; (bush-errol 7) - ; (bush-port 8) - ; (bush-class3-reverse 9) - ; (bush-class2-reverse 10) - ; (bush-class1-reverse 11) + (desertb-race-record 0) + (rs1 1) + (desrally-record 2) ) ;; ---main-h:race-selection @@ -359,7 +351,7 @@ (define *debug-player-vehicle-unkillable* #f) -(define *debug-actor* (the-as object #f)) +(define *debug-actor* (the-as process #f)) (define *gun-marks* #f) diff --git a/goal_src/jak3/engine/game/main.gc b/goal_src/jak3/engine/game/main.gc index 891a0565a8..76e805b888 100644 --- a/goal_src/jak3/engine/game/main.gc +++ b/goal_src/jak3/engine/game/main.gc @@ -1284,7 +1284,7 @@ (-> *display* frames (-> *display* on-screen) global-buf) ) ) - (bucket-id bucket583) + (bucket-id debug) ) (show-iop-memory s5-1) ) @@ -1410,19 +1410,19 @@ (load-continue (-> *level* loading-level)) ) - ;; modify vertices for merc face animation. I believe this is somewhat racing DMA of merc data to VU1. - (with-profiler 'merc *profile-merc-color* - (blerc-execute) - (blerc-init) - ) + ; ;; modify vertices for merc face animation. I believe this is somewhat racing DMA of merc data to VU1. + ; (with-profiler 'merc *profile-merc-color* + ; (blerc-execute) + ; (blerc-init) + ; ) - ;; modify merc vertices for texture scrolling effect. Again, racing DMA. - (texscroll-execute) + ; ;; modify merc vertices for texture scrolling effect. Again, racing DMA. + ; (texscroll-execute) - ;; modify merc vertices for water ripple effect. Again, racing DMA. - (ripple-execute) + ; ;; modify merc vertices for water ripple effect. Again, racing DMA. + ; (ripple-execute) - ;; detect player/camera entering/exiting regions, and run callbacks for those. + ; ;; detect player/camera entering/exiting regions, and run callbacks for those. (region-execute) ;; decompress joint animations, compute joint and bone transformation for each actor. @@ -1433,8 +1433,8 @@ (execute-math-engine) ) - ;; cloth simulation update - (execute-cloth-engine) + ; ;; cloth simulation update + ; (execute-cloth-engine) (with-profiler 'debug *profile-debug-color* ;; run debug callbacks @@ -1459,8 +1459,8 @@ (execute-cam-post-hook-engine) ) - ;; Update start-menu map and masking - (update *bigmap*) + ; ;; Update start-menu map and masking + ; (update *bigmap*) ;; do some more level loading. (if (-> *level* loading-level) @@ -1479,13 +1479,14 @@ (load-continue (-> *level* loading-level)) ) - (if *display-color-bars* - (draw-color-bars *blit-displays-work*) - ) + ; (if *display-color-bars* + ; (draw-color-bars *blit-displays-work*) + ; ) ;; run debug menu (*menu-hook*) - ;; load the right language file. + ; load the right language file. + ;; disabled for now: seems to load 255COMMON.TXT. (load-level-text-files -1) ;; draw screen filter @@ -1524,10 +1525,10 @@ ) ) - ;; generate DMA to copy from render buffer to frame buffer. - (with-profiler 'blit-displays *profile-blit-color* - (blit-displays-work-method-19 *blit-displays-work*) - ) + ; ;; generate DMA to copy from render buffer to frame buffer. + ; (with-profiler 'blit-displays *profile-blit-color* + ; (blit-displays-work-method-19 *blit-displays-work*) + ; ) ;; wrap up this frame (drawing of stdcon, debugging, etc.) (end-display arg0) @@ -1546,6 +1547,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; start stat collection for this frame + (start-frame! (-> arg0 frames (-> arg0 on-screen) profile-array data 0)) (start-profiling! (-> *perf-stats* data 0)) ;; update *teleport* flag, which is set when the game intentionally teleports the camera, @@ -1567,11 +1569,11 @@ (execute-particle-local-space-engine 1) ;; init unused? VU0 collision stuff. - (dma-send - (the-as dma-bank #x10008000) - (the-as uint (-> *collide-vif0-init* data)) - (the-as uint (/ (-> *collide-vif0-init* length) 4)) - ) + ; (dma-send + ; (the-as dma-bank #x10008000) + ; (the-as uint (-> *collide-vif0-init* data)) + ; (the-as uint (/ (-> *collide-vif0-init* length) 4)) + ; ) ;; update sound system. (swap-sound-buffers @@ -1593,10 +1595,10 @@ (level-update *level*) ;; update memory card - (mc-run) + ; (mc-run) ;; check for memory card errors. - (auto-save-check) + ; (auto-save-check) 0 (none) ) @@ -1630,8 +1632,8 @@ (let ((gp-1 *display*)) ;; initial setup (set! *teleport* #t) - (update *setting-control*) - (init-time-of-day-context *time-of-day-context*) + (update *setting-control*) ;; dies on camera stuff, which looks for entities. + ;; (init-time-of-day-context *time-of-day-context*) (display-sync gp-1) (display-frame-finish gp-1) (display-sync gp-1) @@ -1639,12 +1641,12 @@ (free-nodes *touching-list*) (prepare *collide-rider-pool*) (update-actor-hash) - (blerc-init) - (dma-send - (the-as dma-bank #x10008000) - (the-as uint (-> *collide-vif0-init* data)) - (the-as uint (/ (-> *collide-vif0-init* length) 4)) - ) + ;; (blerc-init) + ; (dma-send + ; (the-as dma-bank #x10008000) + ; (the-as uint (-> *collide-vif0-init* data)) + ; (the-as uint (/ (-> *collide-vif0-init* length) 4)) + ; ) (suspend) (set! (-> *setting-control* user-default bg-a) 0.0) (set! (-> gp-1 frames 0 start-time) (timer-count (the-as timer-bank #x10000800))) diff --git a/goal_src/jak3/engine/game/settings-h.gc b/goal_src/jak3/engine/game/settings-h.gc index 45eae8dcb1..54dc162d69 100644 --- a/goal_src/jak3/engine/game/settings-h.gc +++ b/goal_src/jak3/engine/game/settings-h.gc @@ -121,8 +121,8 @@ (armor2 54) (armor3 55) (feature56 56) - (feature57 57) - (feature58 58) + (lighteco 57) + (darkeco 58) (feature59 59) (feature60 60) (feature61 61) @@ -276,6 +276,15 @@ (declare-type resetter-spec structure) +;; +++game-vehicle-u8 +(defenum game-vehicle-u8 + :type uint8 + :bitfield #t + :copy-entries game-vehicles + ) +;; ---game-vehicle-u8 + + ;; DECOMP BEGINS (deftype user-setting-data (structure) @@ -569,7 +578,7 @@ (remove-setting (_type_ process symbol) none) (kill-persister (_type_ engine-pers object) none) (setting-control-method-14 (_type_ object) connectable) - (setting-control-method-15 (_type_ object) connectable) + (get-setting (_type_ object) connectable) (remove-setting-by-arg0 (_type_ object) none) (set-setting-by-param (_type_ symbol object object object) connection) (apply-settings (_type_) user-setting-data) diff --git a/goal_src/jak3/engine/game/settings.gc b/goal_src/jak3/engine/game/settings.gc index b02c2a31d1..5e4f1a00f0 100644 --- a/goal_src/jak3/engine/game/settings.gc +++ b/goal_src/jak3/engine/game/settings.gc @@ -1265,7 +1265,7 @@ (none) ) -(defmethod setting-control-method-15 ((this setting-control) (arg0 object)) +(defmethod get-setting ((this setting-control) (arg0 object)) (let ((v1-1 (-> this engine-hi alive-list next0))) (-> this engine-hi) (let ((a2-2 (-> (the-as connection v1-1) next0))) diff --git a/goal_src/jak3/engine/game/task/task-control-h.gc b/goal_src/jak3/engine/game/task/task-control-h.gc index a3c605b1d8..a55b646db3 100644 --- a/goal_src/jak3/engine/game/task/task-control-h.gc +++ b/goal_src/jak3/engine/game/task/task-control-h.gc @@ -51,11 +51,17 @@ (define-extern game-task-node->string (function game-task-node string)) (define-extern task-close! (function string symbol)) (define-extern task-node-index-by-name (function string int)) +(define-extern task-node-close! (function game-task-node int)) +(define-extern task-node-open? (function game-task-node symbol)) (define-extern restart-mission (function int)) (define-extern play-task (function game-task symbol symbol string)) (define-extern play-clean (function symbol int)) +(declare-type task-manager process) +(declare-type game-task-node-info basic) +(define-extern task-manager-init-by-other (function game-task-node-info symbol object :behavior task-manager)) + ;; DECOMP BEGINS (defun-debug game-task->string ((task game-task)) @@ -1426,7 +1432,7 @@ (:methods (game-task-node-info-method-9 () none) (open! (_type_ symbol) int) - (game-task-node-info-method-11 () none) + (game-task-node-info-method-11 (_type_ symbol) none) (game-task-node-info-method-12 (_type_) symbol) (game-task-node-info-method-13 () none) ) diff --git a/goal_src/jak3/engine/game/task/task-control.gc b/goal_src/jak3/engine/game/task/task-control.gc index 3e43caa92a..593d3743fb 100644 --- a/goal_src/jak3/engine/game/task/task-control.gc +++ b/goal_src/jak3/engine/game/task/task-control.gc @@ -5,5 +5,66 @@ ;; name in dgo: task-control ;; dgos: GAME + +(defmethod game-task-node-info-method-12 ((this game-task-node-info)) + (local-vars (a0-3 symbol) (a1-1 symbol)) + (let ((a1-0 (-> *game-info* sub-task-list)) + (v1-1 this) + ) + (and (not (logtest? (-> v1-1 flags) (game-task-node-flag closed))) + (begin + (dotimes (a2-2 4) + (let ((t0-0 (-> v1-1 parent-node a2-2))) + (when (and (nonzero? t0-0) (not (logtest? (-> a1-0 t0-0 flags) (game-task-node-flag closed)))) + (set! a1-1 #f) + (goto cfg-12) + ) + ) + ) + (set! a1-1 #t) + (label cfg-12) + a1-1 + ) + (and (or (zero? (+ (-> *setting-control* user-current exclusive-task-count) (-> *game-info* task-node-exclusive length)) + ) + (begin + (dotimes (a1-6 (the-as int (-> *setting-control* user-current exclusive-task-count))) + (when (= (-> *setting-control* user-current exclusive-task a1-6) (-> this task)) + (set! a0-3 #t) + (goto cfg-29) + ) + ) + (dotimes (a1-9 (-> *game-info* task-node-exclusive length)) + (when (= (-> *game-info* task-node-exclusive a1-9) (-> this task)) + (set! a0-3 #t) + (goto cfg-29) + ) + ) + (set! a0-3 #f) + (label cfg-29) + (or a0-3 (logtest? (-> v1-1 flags) (game-task-node-flag auto-close disk-close))) + ) + ) + (or (not (-> v1-1 open?)) ((-> v1-1 open?) v1-1)) + ) + ) + ) + ) + +(defmethod open! ((this game-task-node-info) (arg symbol)) + (format #t "skipping (open! ~A ~A)~%" this arg) + 0 + ) + +(defun update-task-masks ((arg0 symbol)) + (format #t "skipping (update-task-masks ~A)~%" arg0) + 0 + ) + +(defun task-node-reset ((arg0 symbol)) + (format #t "skipping (task-node-reset ~A)~%" arg0) + 0 + ) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/geometry/path.gc b/goal_src/jak3/engine/geometry/path.gc index b61956a364..c2694f056e 100644 --- a/goal_src/jak3/engine/geometry/path.gc +++ b/goal_src/jak3/engine/geometry/path.gc @@ -7,3 +7,10 @@ ;; DECOMP BEGINS +(defmethod path-control-method-25 ((this path-control) (arg0 vector)) + 0.0 + ) + +(defmethod get-point-at-percent-along-path! ((this path-control) (ret vector) (percent float) (search-type symbol)) + (static-vectorm 0 0 0) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/background/background.gc b/goal_src/jak3/engine/gfx/background/background.gc index b5a826e95c..ba5fa103bc 100644 --- a/goal_src/jak3/engine/gfx/background/background.gc +++ b/goal_src/jak3/engine/gfx/background/background.gc @@ -5,6 +5,97 @@ ;; name in dgo: background ;; dgos: GAME +(defun add-pc-tfrag3-data ((dma-buf dma-buffer) (lev level)) + "Add PC-port specific tfrag data" + (let ((packet (the-as dma-packet (-> dma-buf base)))) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 24)) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (set! (-> dma-buf base) (the pointer (&+ packet 16))) + ) + + ;; first 4 quadwords are planes, then itimes + (let ((data-ptr (the-as (pointer uint128) (-> dma-buf base)))) + ;; the "use-camera-other" flag is set to "move" entire levels, + ;; like the rotating city below in the throne room. + (cond + ((logtest? (-> lev info level-flags) (level-flags use-camera-other)) + (set! (-> data-ptr 0) (-> *math-camera* plane-other 0 quad)) + (set! (-> data-ptr 1) (-> *math-camera* plane-other 1 quad)) + (set! (-> data-ptr 2) (-> *math-camera* plane-other 2 quad)) + (set! (-> data-ptr 3) (-> *math-camera* plane-other 3 quad)) + (set! (-> data-ptr 4) (-> lev mood-context itimes 0 quad)) + (set! (-> data-ptr 5) (-> lev mood-context itimes 1 quad)) + (set! (-> data-ptr 6) (-> lev mood-context itimes 2 quad)) + (set! (-> data-ptr 7) (-> lev mood-context itimes 3 quad)) + (set! (-> data-ptr 8) (-> *math-camera* camera-temp-other vector 0 quad)) + (set! (-> data-ptr 9) (-> *math-camera* camera-temp-other vector 1 quad)) + (set! (-> data-ptr 10) (-> *math-camera* camera-temp-other vector 2 quad)) + (set! (-> data-ptr 11) (-> *math-camera* camera-temp-other vector 3 quad)) + (set! (-> data-ptr 12) (-> *math-camera* hvdf-off quad)) + (let ((vec (-> (the (inline-array vector) data-ptr) 13))) + (set! (-> vec x) (-> *math-camera* pfog0)) + (set! (-> vec y) (-> *math-camera* fog-min)) + (set! (-> vec z) (-> *math-camera* fog-max)) + ) + (set! (-> data-ptr 14) (-> *math-camera* trans-other quad)) + + (set! (-> data-ptr 15) (-> *math-camera* camera-rot-other vector 0 quad)) + (set! (-> data-ptr 16) (-> *math-camera* camera-rot-other vector 1 quad)) + (set! (-> data-ptr 17) (-> *math-camera* camera-rot-other vector 2 quad)) + (set! (-> data-ptr 18) (-> *math-camera* camera-rot-other vector 3 quad)) + + (set! (-> data-ptr 19) (-> *math-camera* perspective vector 0 quad)) + (set! (-> data-ptr 20) (-> *math-camera* perspective vector 1 quad)) + (set! (-> data-ptr 21) (-> *math-camera* perspective vector 2 quad)) + (set! (-> data-ptr 22) (-> *math-camera* perspective vector 3 quad)) + + ) + (else + (set! (-> data-ptr 0) (-> *math-camera* plane 0 quad)) + (set! (-> data-ptr 1) (-> *math-camera* plane 1 quad)) + (set! (-> data-ptr 2) (-> *math-camera* plane 2 quad)) + (set! (-> data-ptr 3) (-> *math-camera* plane 3 quad)) + (set! (-> data-ptr 4) (-> lev mood-context itimes 0 quad)) + (set! (-> data-ptr 5) (-> lev mood-context itimes 1 quad)) + (set! (-> data-ptr 6) (-> lev mood-context itimes 2 quad)) + (set! (-> data-ptr 7) (-> lev mood-context itimes 3 quad)) + ;; HACK: + (let ((vec (new 'static 'vector4w :x #x70707070 :y #x70707070 :z #x70707070 :w #x70707070))) + (set! (-> data-ptr 4) (-> vec quad)) + (set! (-> data-ptr 5) (-> vec quad)) + (set! (-> data-ptr 6) (-> vec quad)) + (set! (-> data-ptr 7) (-> vec quad)) + ) + (set! (-> data-ptr 8) (-> *math-camera* camera-temp vector 0 quad)) + (set! (-> data-ptr 9) (-> *math-camera* camera-temp vector 1 quad)) + (set! (-> data-ptr 10) (-> *math-camera* camera-temp vector 2 quad)) + (set! (-> data-ptr 11) (-> *math-camera* camera-temp vector 3 quad)) + (set! (-> data-ptr 12) (-> *math-camera* hvdf-off quad)) + (let ((vec (-> (the (inline-array vector) data-ptr) 13))) + (set! (-> vec x) (-> *math-camera* pfog0)) + (set! (-> vec y) (-> *math-camera* fog-min)) + (set! (-> vec z) (-> *math-camera* fog-max)) + ) + (set! (-> data-ptr 14) (-> *math-camera* trans quad)) + + (set! (-> data-ptr 15) (-> *math-camera* camera-rot vector 0 quad)) + (set! (-> data-ptr 16) (-> *math-camera* camera-rot vector 1 quad)) + (set! (-> data-ptr 17) (-> *math-camera* camera-rot vector 2 quad)) + (set! (-> data-ptr 18) (-> *math-camera* camera-rot vector 3 quad)) + + (set! (-> data-ptr 19) (-> *math-camera* perspective vector 0 quad)) + (set! (-> data-ptr 20) (-> *math-camera* perspective vector 1 quad)) + (set! (-> data-ptr 21) (-> *math-camera* perspective vector 2 quad)) + (set! (-> data-ptr 22) (-> *math-camera* perspective vector 3 quad)) + ) + ) + + (charp<-string (the (pointer uint8) (&-> data-ptr 23)) (symbol->string (-> lev nickname))) + ) + (&+! (-> dma-buf base) (* 16 24)) + ) + ;; DECOMP BEGINS (define *background-work* (new 'global 'background-work)) @@ -150,9 +241,9 @@ (let ((v1-8 (-> *level* level gp-0))) (when (= (-> v1-8 status) 'active) (-> v1-8 bsp wind-array) - (if (nonzero? (-> v1-8 bsp wind-array-length)) - (level-update-wind *wind-work*) - ) + ;; (if (nonzero? (-> v1-8 bsp wind-array-length)) + ;; (level-update-wind *wind-work*) + ;; ) ) ) ) @@ -194,13 +285,13 @@ (let ((s5-1 (-> *background-work* shrub-trees gp-2)) (s4-1 (-> *background-work* shrub-levels gp-2)) ) - (if (nonzero? (-> s5-1 colors-added)) - (time-of-day-interp-colors - (-> *instance-shrub-work* colors) - (the-as uint (-> s5-1 colors-added)) - (-> s4-1 mood-context) - ) - ) + ; (if (nonzero? (-> s5-1 colors-added)) + ; (time-of-day-interp-colors + ; (-> *instance-shrub-work* colors) + ; (the-as uint (-> s5-1 colors-added)) + ; (-> s4-1 mood-context) + ; ) + ; ) (set-background-regs! s4-1) (set-shrub-quard-planes! s4-1) (draw-drawable-tree-instance-shrub s5-1 s4-1) @@ -232,7 +323,7 @@ (set-subdivide-settings! s1-1) (when (not (or (zero? s0-1) (= s4-3 s0-1))) (flush-cache 0) - (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-1 (-> s1-1 mood-context)) + ;; (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-1 (-> s1-1 mood-context)) (set! s4-3 s0-1) ) ) @@ -254,7 +345,7 @@ (set-subdivide-settings! s1-2) (when (not (or (zero? s0-2) (= s4-3 s0-2))) (flush-cache 0) - (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-2 (-> s1-2 mood-context)) + ;; (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-2 (-> s1-2 mood-context)) (set! s4-3 s0-2) ) ) @@ -276,7 +367,7 @@ (set-subdivide-settings! s1-3) (when (not (or (zero? s0-3) (= s4-3 s0-3))) (flush-cache 0) - (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-3 (-> s1-3 mood-context)) + ;; (time-of-day-interp-colors-scratch (the-as (pointer rgba) (+ 6144 #x70000000)) s0-3 (-> s1-3 mood-context)) (set! s4-3 s0-3) ) ) diff --git a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc index 0ebc2c4959..0c8008fb58 100644 --- a/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc +++ b/goal_src/jak3/engine/gfx/background/hfrag/hfrag-h.gc @@ -252,8 +252,8 @@ (size uint32 :overlay-at (-> start-corner data 3)) ) (:methods - (hfragment-method-17 () none) - (hfragment-method-18 () none) + (hfragment-method-17 (_type_ collide-cache collide-query) none) + (hfragment-method-18 (_type_ collide-cache collide-query) none) (hfragment-method-19 () none) (hfragment-method-20 () none) (hfragment-method-21 () none) @@ -420,6 +420,7 @@ ) ) + (deftype hfrag-mip-packet (structure) ((mip-tmpl dma-gif-packet :inline) (tex0-1 vector :inline) diff --git a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc index c4d5b2ec41..d95b6819bd 100644 --- a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc +++ b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-h.gc @@ -11,6 +11,7 @@ (define-extern draw-drawable-tree-tfrag (function drawable-tree-tfrag none)) (define-extern draw-drawable-tree-tfrag-trans (function drawable-tree-tfrag none)) (define-extern draw-drawable-tree-tfrag-water (function drawable-tree-tfrag none)) +(define-extern *pc-tfrag-draw-level* level) ;; added ;; DECOMP BEGINS @@ -59,6 +60,7 @@ (color-count uint8 :offset 57) (texture-masks-index uint16 :offset 58) (generic generic-tfragment :offset 60) + (generic-u32 uint32 :overlay-at generic) ) ) diff --git a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-methods.gc b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-methods.gc index 4579d60b17..1b4de11e38 100644 --- a/goal_src/jak3/engine/gfx/background/tfrag/tfrag-methods.gc +++ b/goal_src/jak3/engine/gfx/background/tfrag/tfrag-methods.gc @@ -39,22 +39,22 @@ (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (let ((s5-0 (+ (-> arg0 length) -1))) (when (nonzero? s5-0) - (dotimes (s4-0 s5-0) - (let* ((v1-8 (-> arg0 arrays s4-0)) - (a0-4 (-> arg0 arrays (+ s4-0 1))) - (a1-1 (/ (-> (the-as drawable-inline-array-node v1-8) data 0 id) 8)) - (a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8)) - (a1-3 (+ a1-1 #x3800 #x70000000)) - (a0-8 (+ a0-6 #x3800 #x70000000)) - ) - (draw-node-cull - (the-as pointer a0-8) - (the-as pointer a1-3) - (the-as (inline-array draw-node) (&+ v1-8 32)) - (-> v1-8 length) - ) - ) - ) + ; (dotimes (s4-0 s5-0) + ; (let* ((v1-8 (-> arg0 arrays s4-0)) + ; (a0-4 (-> arg0 arrays (+ s4-0 1))) + ; (a1-1 (/ (-> (the-as drawable-inline-array-node v1-8) data 0 id) 8)) + ; (a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8)) + ; (a1-3 (+ a1-1 #x3800 #x70000000)) + ; (a0-8 (+ a0-6 #x3800 #x70000000)) + ; ) + ; (draw-node-cull + ; (the-as pointer a0-8) + ; (the-as pointer a1-3) + ; (the-as (inline-array draw-node) (&+ v1-8 32)) + ; (-> v1-8 length) + ; ) + ; ) + ; ) ) (let* ((v1-14 (-> arg0 arrays s5-0)) (s4-1 (&+ v1-14 32)) @@ -82,7 +82,7 @@ (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0)) (set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp tfrag-closest))) (set! (-> *tfrag-work* last-call) (the-as uint 0)) - (draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0) + ;; (draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0) (set! (-> *level* draw-level *draw-index* tfrag-last-calls 0) (-> *tfrag-work* last-call)) (update-wait-stats (-> *perf-stats* data 42) @@ -91,34 +91,34 @@ (-> *tfrag-work* wait-from-spr) ) ) - (with-dma-buffer-add-bucket ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf)) - (-> (new 'static 'array bucket-id 10 - (bucket-id tfrag-scissor-l0-tfrag) - (bucket-id tfrag-scissor-l1-tfrag) - (bucket-id tfrag-scissor-l2-tfrag) - (bucket-id tfrag-scissor-l3-tfrag) - (bucket-id tfrag-scissor-l4-tfrag) - (bucket-id tfrag-scissor-l5-tfrag) - (bucket-id tfrag-scissor-l6-tfrag) - (bucket-id tfrag-scissor-l7-tfrag) - (bucket-id tfrag-scissor-l8-tfrag) - (bucket-id tfrag-scissor-l9-tfrag) - ) - *draw-index* - ) - ) - (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0)) - (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0)) - (set! (-> *tfrag-work* last-call) (the-as uint 0)) - (draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1) - (set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (-> *tfrag-work* last-call)) - (update-wait-stats - (-> *perf-stats* data 43) - (the-as uint 0) - (-> *tfrag-work* near-wait-to-spr) - (-> *tfrag-work* near-wait-from-spr) - ) - ) + ; (with-dma-buffer-add-bucket ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf)) + ; (-> (new 'static 'array bucket-id 10 + ; (bucket-id tfrag-scissor-l0-tfrag) + ; (bucket-id tfrag-scissor-l1-tfrag) + ; (bucket-id tfrag-scissor-l2-tfrag) + ; (bucket-id tfrag-scissor-l3-tfrag) + ; (bucket-id tfrag-scissor-l4-tfrag) + ; (bucket-id tfrag-scissor-l5-tfrag) + ; (bucket-id tfrag-scissor-l6-tfrag) + ; (bucket-id tfrag-scissor-l7-tfrag) + ; (bucket-id tfrag-scissor-l8-tfrag) + ; (bucket-id tfrag-scissor-l9-tfrag) + ; ) + ; *draw-index* + ; ) + ; ) + ; (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0)) + ; (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0)) + ; (set! (-> *tfrag-work* last-call) (the-as uint 0)) + ; ;; (draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1) + ; (set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (-> *tfrag-work* last-call)) + ; (update-wait-stats + ; (-> *perf-stats* data 43) + ; (the-as uint 0) + ; (-> *tfrag-work* near-wait-to-spr) + ; (-> *tfrag-work* near-wait-from-spr) + ; ) + ; ) (let ((a0-33 *dma-mem-usage*)) (when (nonzero? a0-33) (set! (-> a0-33 length) (max 2 (-> a0-33 length))) @@ -144,22 +144,22 @@ (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (let ((s5-0 (+ (-> arg0 length) -1))) (when (nonzero? s5-0) - (dotimes (s4-0 s5-0) - (let* ((v1-7 (-> arg0 arrays s4-0)) - (a0-6 (-> arg0 arrays (+ s4-0 1))) - (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8)) - (a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8)) - (a1-3 (+ a1-1 #x3800 #x70000000)) - (a0-10 (+ a0-8 #x3800 #x70000000)) - ) - (draw-node-cull - (the-as pointer a0-10) - (the-as pointer a1-3) - (the-as (inline-array draw-node) (&+ v1-7 32)) - (-> v1-7 length) - ) - ) - ) + ; (dotimes (s4-0 s5-0) + ; (let* ((v1-7 (-> arg0 arrays s4-0)) + ; (a0-6 (-> arg0 arrays (+ s4-0 1))) + ; (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8)) + ; (a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8)) + ; (a1-3 (+ a1-1 #x3800 #x70000000)) + ; (a0-10 (+ a0-8 #x3800 #x70000000)) + ; ) + ; (draw-node-cull + ; (the-as pointer a0-10) + ; (the-as pointer a1-3) + ; (the-as (inline-array draw-node) (&+ v1-7 32)) + ; (-> v1-7 length) + ; ) + ; ) + ; ) ) (let* ((v1-13 (-> arg0 arrays s5-0)) (s5-1 (&+ v1-13 32)) @@ -188,7 +188,7 @@ (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0)) (set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp alpha-closest))) (set! (-> *tfrag-work* last-call) (the-as uint 0)) - (draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0) + ;; (draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0) (set! (-> *level* draw-level *draw-index* tfrag-last-calls 2) (-> *tfrag-work* last-call)) (update-wait-stats (-> *perf-stats* data 42) @@ -197,36 +197,36 @@ (-> *tfrag-work* wait-from-spr) ) ) - (with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) - (-> (new 'static 'array bucket-id 12 - (bucket-id tfrag-scissor-l0-alpha) - (bucket-id tfrag-scissor-l1-alpha) - (bucket-id tfrag-scissor-l2-alpha) - (bucket-id tfrag-scissor-l3-alpha) - (bucket-id tfrag-scissor-l4-alpha) - (bucket-id tfrag-scissor-l5-alpha) - (bucket-id tfrag-scissor-l6-alpha) - (bucket-id tfrag-scissor-l7-alpha) - (bucket-id tfrag-scissor-l8-alpha) - (bucket-id tfrag-scissor-l9-alpha) - (bucket-id bucket0) - (bucket-id bucket0) - ) - *draw-index* - ) - ) - (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0)) - (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0)) - (set! (-> *tfrag-work* last-call) (the-as uint 0)) - (draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1) - (set! (-> *level* draw-level *draw-index* tfrag-last-calls 3) (-> *tfrag-work* last-call)) - (update-wait-stats - (-> *perf-stats* data 43) - (the-as uint 0) - (-> *tfrag-work* near-wait-to-spr) - (-> *tfrag-work* near-wait-from-spr) - ) - ) + ; (with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) + ; (-> (new 'static 'array bucket-id 12 + ; (bucket-id tfrag-scissor-l0-alpha) + ; (bucket-id tfrag-scissor-l1-alpha) + ; (bucket-id tfrag-scissor-l2-alpha) + ; (bucket-id tfrag-scissor-l3-alpha) + ; (bucket-id tfrag-scissor-l4-alpha) + ; (bucket-id tfrag-scissor-l5-alpha) + ; (bucket-id tfrag-scissor-l6-alpha) + ; (bucket-id tfrag-scissor-l7-alpha) + ; (bucket-id tfrag-scissor-l8-alpha) + ; (bucket-id tfrag-scissor-l9-alpha) + ; (bucket-id bucket0) + ; (bucket-id bucket0) + ; ) + ; *draw-index* + ; ) + ; ) + ; (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0)) + ; (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0)) + ; (set! (-> *tfrag-work* last-call) (the-as uint 0)) + ; ;; (draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1) + ; (set! (-> *level* draw-level *draw-index* tfrag-last-calls 3) (-> *tfrag-work* last-call)) + ; (update-wait-stats + ; (-> *perf-stats* data 43) + ; (the-as uint 0) + ; (-> *tfrag-work* near-wait-to-spr) + ; (-> *tfrag-work* near-wait-from-spr) + ; ) + ; ) ) ) ) @@ -240,22 +240,22 @@ (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (let ((s5-0 (+ (-> arg0 length) -1))) (when (nonzero? s5-0) - (dotimes (s4-0 s5-0) - (let* ((v1-7 (-> arg0 arrays s4-0)) - (a0-6 (-> arg0 arrays (+ s4-0 1))) - (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8)) - (a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8)) - (a1-3 (+ a1-1 #x3800 #x70000000)) - (a0-10 (+ a0-8 #x3800 #x70000000)) - ) - (draw-node-cull - (the-as pointer a0-10) - (the-as pointer a1-3) - (the-as (inline-array draw-node) (&+ v1-7 32)) - (-> v1-7 length) - ) - ) - ) + ; (dotimes (s4-0 s5-0) + ; (let* ((v1-7 (-> arg0 arrays s4-0)) + ; (a0-6 (-> arg0 arrays (+ s4-0 1))) + ; (a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8)) + ; (a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8)) + ; (a1-3 (+ a1-1 #x3800 #x70000000)) + ; (a0-10 (+ a0-8 #x3800 #x70000000)) + ; ) + ; (draw-node-cull + ; (the-as pointer a0-10) + ; (the-as pointer a1-3) + ; (the-as (inline-array draw-node) (&+ v1-7 32)) + ; (-> v1-7 length) + ; ) + ; ) + ; ) ) (let* ((v1-13 (-> arg0 arrays s5-0)) (s5-1 (&+ v1-13 32)) @@ -284,7 +284,7 @@ (set! (-> *tfrag-work* wait-from-spr) (the-as uint 0)) (set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp water-closest))) (set! (-> *tfrag-work* last-call) (the-as uint 0)) - (draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0) + ;; (draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0) (set! (-> *level* draw-level *draw-index* tfrag-last-calls 4) (-> *tfrag-work* last-call)) (update-wait-stats (-> *perf-stats* data 42) @@ -293,36 +293,36 @@ (-> *tfrag-work* wait-from-spr) ) ) - (with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) - (-> (new 'static 'array bucket-id 12 - (bucket-id tfrag-scissor-l0-water) - (bucket-id tfrag-scissor-l1-water) - (bucket-id tfrag-scissor-l2-water) - (bucket-id tfrag-scissor-l3-water) - (bucket-id tfrag-scissor-l4-water) - (bucket-id tfrag-scissor-l5-water) - (bucket-id tfrag-scissor-l6-water) - (bucket-id tfrag-scissor-l7-water) - (bucket-id tfrag-scissor-l8-water) - (bucket-id tfrag-scissor-l9-water) - (bucket-id bucket0) - (bucket-id bucket0) - ) - *draw-index* - ) - ) - (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0)) - (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0)) - (set! (-> *tfrag-work* last-call) (the-as uint 0)) - (draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1) - (set! (-> *level* draw-level *draw-index* tfrag-last-calls 5) (-> *tfrag-work* last-call)) - (update-wait-stats - (-> *perf-stats* data 43) - (the-as uint 0) - (-> *tfrag-work* near-wait-to-spr) - (-> *tfrag-work* near-wait-from-spr) - ) - ) + ; (with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf)) + ; (-> (new 'static 'array bucket-id 12 + ; (bucket-id tfrag-scissor-l0-water) + ; (bucket-id tfrag-scissor-l1-water) + ; (bucket-id tfrag-scissor-l2-water) + ; (bucket-id tfrag-scissor-l3-water) + ; (bucket-id tfrag-scissor-l4-water) + ; (bucket-id tfrag-scissor-l5-water) + ; (bucket-id tfrag-scissor-l6-water) + ; (bucket-id tfrag-scissor-l7-water) + ; (bucket-id tfrag-scissor-l8-water) + ; (bucket-id tfrag-scissor-l9-water) + ; (bucket-id bucket0) + ; (bucket-id bucket0) + ; ) + ; *draw-index* + ; ) + ; ) + ; (set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0)) + ; (set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0)) + ; (set! (-> *tfrag-work* last-call) (the-as uint 0)) + ; (draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1) + ; (set! (-> *level* draw-level *draw-index* tfrag-last-calls 5) (-> *tfrag-work* last-call)) + ; (update-wait-stats + ; (-> *perf-stats* data 43) + ; (the-as uint 0) + ; (-> *tfrag-work* near-wait-to-spr) + ; (-> *tfrag-work* near-wait-from-spr) + ; ) + ; ) ) ) ) @@ -343,8 +343,11 @@ ) ) (when (not (-> v1-0 dma-buffer-overflow)) + (let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0))) (when (!= s4-0 (-> s4-0 last)) + (format 0 "hello init buf (~D)~%" arg0) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-1 (-> s3-0 base)) ) @@ -489,13 +492,15 @@ ) ) -;; WARN: Return type mismatch symbol vs none. +(define *pc-tfrag-draw-level* (the level #f)) + (defun tfrag-vu1-init-buffers () "Initialize all tfrag buckets." (dotimes (gp-0 10) (let ((s5-0 (-> *level* draw-level gp-0)) (s4-0 (-> *tfrag-init-table* gp-0)) ) + (set! *pc-tfrag-draw-level* s5-0) (when s5-0 (set-subdivide-settings! s5-0) (let ((s3-0 (-> s5-0 tfrag-gs-test))) diff --git a/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc b/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc index 41a26d9f50..aa5756576c 100644 --- a/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc +++ b/goal_src/jak3/engine/gfx/background/tfrag/tfrag.gc @@ -181,7 +181,7 @@ (define *tfrag-display-stats* #f) -(define tfrag-vu1-block (new 'static 'vu-function :length #x74b :qlength #x3a6)) +(define tfrag-vu1-block (new 'static 'vu-function)) ;; og:preserve-this ;; WARN: Return type mismatch tfrag-data vs none. (defun tfrag-data-setup ((arg0 tfrag-data) (arg1 int) (arg2 int)) @@ -415,6 +415,9 @@ (add-tfrag-mtx-0 arg0 arg3) (add-tfrag-mtx-1 arg0 arg3) (add-tfrag-data arg0 arg2 (the-as int *subdivide-draw-mode*)) + (#when PC_PORT + (add-pc-tfrag3-data arg0 *pc-tfrag-draw-level*) + ) (let ((v1-5 (the-as dma-packet (-> arg0 base)))) (set! (-> v1-5 dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) (set! (-> v1-5 vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) diff --git a/goal_src/jak3/engine/gfx/background/tie/tie-methods.gc b/goal_src/jak3/engine/gfx/background/tie/tie-methods.gc index 27e6e3b403..436de8e016 100644 --- a/goal_src/jak3/engine/gfx/background/tie/tie-methods.gc +++ b/goal_src/jak3/engine/gfx/background/tie/tie-methods.gc @@ -51,6 +51,75 @@ (define *pke-hack* (new 'global 'vector)) +(defun pc-add-tie-vis-mask ((lev level) (dma-buf dma-buffer)) + "Add data so Tie3.cpp can hide protos." + (let ((packet (the-as dma-packet (-> dma-buf base)))) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (set! (-> dma-buf base) (the pointer (&+ packet 16))) + + (let ((lev-trees (-> lev bsp drawable-trees)) + (data-ptr (the (pointer uint8) (-> dma-buf base))) + ) + (dotimes (tree-idx (-> lev-trees length)) + (let ((tree (-> lev-trees data tree-idx))) + (when (= (-> tree type) drawable-tree-instance-tie) + (let* ((tie-tree (the drawable-tree-instance-tie tree)) + (protos (-> tie-tree prototypes prototype-array-tie)) + ) + (dotimes (i (-> protos length)) + (let ((proto (-> protos array-data i))) + (when (logtest? (-> proto flags) (prototype-flags visible)) + ;; invisible! + ;(format 0 "invis: ~A~%" (-> proto name)) + (let ((src (-> proto name data))) + (while (nonzero? (-> src)) + (set! (-> data-ptr) (-> src)) + (&+! src 1) + (&+! data-ptr 1) + ) + (set! (-> data-ptr) 0) + (&+! data-ptr 1) + ) + ) + ) + ) + ) + ) + ) + ) + ;; align + (while (nonzero? (logand data-ptr #xf)) + (set! (-> data-ptr) 0) + (&+! data-ptr 1) + ) + (set! (-> packet dma) (new 'static 'dma-tag + :id (dma-tag-id cnt) + :qwc (/ (&- data-ptr (-> dma-buf base)) 16)) + ) + (set! (-> dma-buf base) data-ptr) + #f + ) + ) + ) + +(defun pc-add-tie-envmap-info ((dma-buf dma-buffer)) + (let ((packet (the-as dma-packet (-> dma-buf base)))) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 1)) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (set! (-> dma-buf base) (the pointer (&+ packet 16))) + (set! (-> (the (pointer uint128) (-> dma-buf base))) + (if (and *time-of-day-context* + (nonzero? *time-of-day-context*)) + (-> *time-of-day-context* current-env-color quad) + (the uint128 0) + ) + ) + (set! (-> dma-buf base) (the pointer (&+ packet 32))) + ) + ) + ;; ERROR: function was not converted to expressions. Cannot decompile. ;; ERROR: function was not converted to expressions. Cannot decompile. @@ -176,58 +245,61 @@ ; ) ; ) ; ) - ; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask etie)) - ; (when (nonzero? (-> *prototype-tie-work* envmap-count)) - ; (let ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf base))) - ; (with-dma-buffer-add-bucket ((v1-69 (-> *display* frames (-> *display* on-screen) global-buf)) - ; (-> (new 'static 'array bucket-id 10 - ; (bucket-id etie-l0-tfrag) - ; (bucket-id etie-l1-tfrag) - ; (bucket-id etie-l2-tfrag) - ; (bucket-id etie-l3-tfrag) - ; (bucket-id etie-l4-tfrag) - ; (bucket-id etie-l5-tfrag) - ; (bucket-id etie-l6-tfrag) - ; (bucket-id etie-l7-tfrag) - ; (bucket-id etie-l8-tfrag) - ; (bucket-id etie-l9-tfrag) - ; ) - ; (-> arg1 draw-index) - ; ) - ; ) - ; (let ((a1-37 (-> v1-69 base)) - ; (a0-31 (the-as object (-> *prototype-tie-work* envmap-last))) - ; ) - ; (let ((a3-19 (-> *prototype-tie-work* envmap-next))) - ; (set! (-> (the-as (pointer uint128) a1-37)) (-> *prototype-tie-work* model-next quad)) - ; (set! (-> (the-as (pointer uint64) a1-37)) - ; (logior (logand (-> (the-as (pointer uint64) a1-37)) (the-as uint #x80000000ffffffff)) (shr (shl a3-19 33) 1)) - ; ) - ; ) - ; (let ((a1-41 (logior (logand (-> (the-as (pointer uint64) a0-31) 0) (the-as uint #x80000000ffffffff)) - ; (shr (shl (the-as int (&+ a1-37 16)) 33) 1) - ; ) - ; ) - ; ) - ; (s.d! (the-as uint a0-31) a1-41) - ; ) - ; ) - ; (&+! (-> v1-69 base) 16) - ; ) - ; (let ((v1-77 *dma-mem-usage*)) - ; (when (nonzero? v1-77) - ; (set! (-> v1-77 length) (max 10 (-> v1-77 length))) - ; (set! (-> v1-77 data 9 name) "tie-fragment") - ; (+! (-> v1-77 data 9 count) 1) - ; (+! (-> v1-77 data 9 used) - ; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-2)) - ; ) - ; (set! (-> v1-77 data 9 total) (-> v1-77 data 9 used)) - ; ) - ; ) - ; ) - ; ) - ; ) + (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask etie)) + ; (when (nonzero? (-> *prototype-tie-work* envmap-count)) + (let ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf base))) + (with-dma-buffer-add-bucket ((v1-69 (-> *display* frames (-> *display* on-screen) global-buf)) + (-> (new 'static 'array bucket-id 10 + (bucket-id tie-l0-tfrag) ; (bucket-id etie-l0-tfrag) + (bucket-id tie-l1-tfrag) ; (bucket-id etie-l1-tfrag) + (bucket-id tie-l2-tfrag) ; (bucket-id etie-l2-tfrag) + (bucket-id tie-l3-tfrag) ; (bucket-id etie-l3-tfrag) + (bucket-id tie-l4-tfrag) ; (bucket-id etie-l4-tfrag) + (bucket-id tie-l5-tfrag) ; (bucket-id etie-l5-tfrag) + (bucket-id tie-l6-tfrag) ; (bucket-id etie-l6-tfrag) + (bucket-id tie-l7-tfrag) ; (bucket-id etie-l7-tfrag) + (bucket-id tie-l8-tfrag) ; (bucket-id etie-l8-tfrag) + (bucket-id tie-l9-tfrag) ; (bucket-id etie-l9-tfrag) + ) + (-> arg1 draw-index) + ) + ) + (add-pc-tfrag3-data v1-69 arg1) + (pc-add-tie-vis-mask arg1 v1-69) + (pc-add-tie-envmap-info v1-69) + ; (let ((a1-37 (-> v1-69 base)) + ; (a0-31 (the-as object (-> *prototype-tie-work* envmap-last))) + ; ) + ; (let ((a3-19 (-> *prototype-tie-work* envmap-next))) + ; (set! (-> (the-as (pointer uint128) a1-37)) (-> *prototype-tie-work* model-next quad)) + ; (set! (-> (the-as (pointer uint64) a1-37)) + ; (logior (logand (-> (the-as (pointer uint64) a1-37)) (the-as uint #x80000000ffffffff)) (shr (shl a3-19 33) 1)) + ; ) + ; ) + ; (let ((a1-41 (logior (logand (-> (the-as (pointer uint64) a0-31) 0) (the-as uint #x80000000ffffffff)) + ; (shr (shl (the-as int (&+ a1-37 16)) 33) 1) + ; ) + ; ) + ; ) + ; (s.d! (the-as uint a0-31) a1-41) + ; ) + ; ) + ; (&+! (-> v1-69 base) 16) + ) + (let ((v1-77 *dma-mem-usage*)) + (when (nonzero? v1-77) + (set! (-> v1-77 length) (max 10 (-> v1-77 length))) + (set! (-> v1-77 data 9 name) "tie-fragment") + (+! (-> v1-77 data 9 count) 1) + (+! (-> v1-77 data 9 used) + (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-2)) + ) + (set! (-> v1-77 data 9 total) (-> v1-77 data 9 used)) + ) + ) + ) + ; ) + ) ; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask etie-scissor)) ; (when (nonzero? (-> *prototype-tie-work* envmap-scissor-count)) ; (let ((s5-3 (-> *display* frames (-> *display* on-screen) global-buf base))) @@ -445,7 +517,7 @@ ; (-> (new 'static 'array bucket-id 10 ; (bucket-id etie-l0-alpha) ; (bucket-id etie-l1-alpha) - ; (bucket-id etie-l02alpha) + ; (bucket-id etie-l2-alpha) ; (bucket-id etie-l3-alpha) ; (bucket-id etie-l4-alpha) ; (bucket-id etie-l5-alpha) @@ -784,214 +856,214 @@ ) (defun draw-drawable-tree-instance-tie ((arg0 drawable-tree-instance-tie) (arg1 level)) - ; (local-vars (v0-9 object) (a0-42 int) (a0-44 int) (a0-55 int) (a0-57 int) (sv-16 int)) - ; (when (logtest? (vu1-renderer-mask - ; tie-scissor - ; tie - ; etie - ; etie-scissor - ; tie-vanish - ; generic - ; tie-scissor-trans - ; tie-trans - ; etie-trans - ; etie-scissor-trans - ; ) - ; (-> *display* vu1-enable-user) - ; ) - ; (set! (-> *instance-tie-work* wind-vectors) (-> arg0 prototypes wind-vectors)) - ; (let ((s5-0 (+ (-> arg0 length) -1))) - ; (when (nonzero? s5-0) - ; (dotimes (s4-0 s5-0) - ; (let* ((v1-9 (-> arg0 data s4-0)) - ; (a0-7 (-> arg0 data (+ s4-0 1))) - ; (a1-2 (/ (-> (the-as drawable-inline-array-node v1-9) data 0 id) 8)) - ; (a0-9 (/ (-> (the-as drawable-inline-array-node a0-7) data 0 id) 8)) - ; (a1-4 (+ a1-2 #x3800 #x70000000)) - ; (a0-11 (+ a0-9 #x3800 #x70000000)) - ; ) - ; (draw-node-cull - ; (the-as pointer a0-11) - ; (the-as pointer a1-4) - ; (-> (the-as drawable-inline-array-node v1-9) data) - ; (-> (the-as drawable-inline-array-node v1-9) length) - ; ) - ; ) - ; ) - ; ) - ; (let* ((s2-0 (-> arg0 data s5-0)) - ; (s3-0 (-> arg0 prototypes prototype-array-tie)) - ; (s4-1 (-> s3-0 length)) - ; (s5-1 (-> *display* frames (-> *display* on-screen) global-buf)) - ; (s0-0 (-> s5-1 base)) - ; (s1-1 (&- (-> s5-1 end) (the-as uint (* (-> arg0 prototypes prototype-max-qwc) 16)))) - ; ) - ; (when *debug-segment* - ; (if (>= (the-as uint s0-0) (the-as uint s1-1)) - ; (format *stdcon* "out of tie memory~%") - ; ) - ; ) - ; (when (< (the-as uint s0-0) (the-as uint s1-1)) - ; (set! (-> *instance-tie-work* buffer-start) (the-as uint (-> s5-1 base))) - ; (set! (-> *instance-tie-work* buffer-end) (the-as uint s1-1)) - ; (dotimes (v1-28 16) - ; (set! (-> *prototype-tie-work* last v1-28) (the-as uint 0)) - ; (set! (-> *prototype-tie-work* next v1-28) (the-as uint 0)) - ; (set! (-> *prototype-tie-work* count v1-28) (the-as uint 0)) - ; ) - ; (dotimes (v1-31 s4-1) - ; (let ((a0-26 (-> s3-0 array-data v1-31))) - ; (dotimes (a1-9 3) - ; (set! (-> a0-26 next-clear a1-9) (the-as uint128 0)) - ; (set! (-> a0-26 count-clear a1-9) (the-as uint 0)) - ; ) - ; ) - ; ) - ; (let* ((s1-2 (&+ s2-0 32)) - ; (s0-1 (+ (/ (-> s1-2 id) 8) #x3800 #x70000000)) - ; ) - ; (set! sv-16 (-> (the-as drawable-inline-array-instance-tie s2-0) length)) - ; (when (nonzero? sv-16) - ; (let* ((v1-41 (logand (the-as int *gsf-buffer*) 8191)) - ; (v1-43 - ; (the-as - ; object - ; (logand (the-as int (&- (logand (the-as int (&-> (-> s3-0 data) -640)) 8191) (the-as uint v1-41))) 8191) - ; ) - ; ) - ; ) - ; (set! *instance-tie-work-copy* (the-as instance-tie-work (+ (the-as int *gsf-buffer*) (the-as int v1-43)))) - ; ) - ; (quad-copy! (the-as pointer *instance-tie-work-copy*) (the-as pointer *instance-tie-work*) 35) - ; (let ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf base))) - ; (set! (-> *instance-tie-work-copy* wait-to-spr) (the-as uint 0)) - ; (set! (-> *instance-tie-work-copy* wait-from-spr) (the-as uint 0)) - ; (set! (-> *instance-tie-work-copy* tfrag-dists) (the-as uint (-> arg1 bsp tfrag-closest))) - ; (set! (-> *instance-tie-work-copy* alpha-dists) (the-as uint (-> arg1 bsp alpha-closest))) - ; (set! (-> *instance-tie-work-copy* water-dists) (the-as uint (-> arg1 bsp water-closest))) - ; (let* ((v1-61 (-> *perf-stats* data 46)) - ; (a0-39 (-> v1-61 ctrl)) - ; ) - ; (+! (-> v1-61 count) 1) - ; (b! (zero? a0-39) cfg-23 :delay (nop!)) - ; (.mtc0 Perf 0) - ; (.sync.l) - ; (.sync.p) - ; (.mtpc pcr0 0) - ; (.mtpc pcr1 0) - ; (.sync.l) - ; (.sync.p) - ; (.mtc0 Perf a0-39) - ; ) - ; (.sync.l) - ; (.sync.p) - ; (label cfg-23) - ; 0 - ; (let ((t9-3 draw-inline-array-instance-tie) - ; (a3-1 s5-1) - ; ) - ; (t9-3 (the-as pointer s0-1) (the-as (inline-array instance-tie) s1-2) sv-16 a3-1) - ; ) - ; (let ((v1-64 (-> *perf-stats* data 46))) - ; (b! (zero? (-> v1-64 ctrl)) cfg-25 :delay (nop!)) - ; (.mtc0 Perf 0) - ; (.sync.l) - ; (.sync.p) - ; (.mfpc a0-42 pcr0) - ; (+! (-> v1-64 accum0) a0-42) - ; (.mfpc a0-44 pcr1) - ; (+! (-> v1-64 accum1) a0-44) - ; ) - ; (label cfg-25) - ; 0 - ; (update-wait-stats - ; (-> *perf-stats* data 46) - ; (the-as uint 0) - ; (-> *instance-tie-work-copy* wait-to-spr) - ; (-> *instance-tie-work-copy* wait-from-spr) - ; ) - ; (let ((v1-71 (-> *instance-tie-work-copy* min-dist quad))) - ; (set! (-> *instance-tie-work* min-dist quad) v1-71) - ; ) - ; (set! (-> *instance-tie-work* flags) (-> *instance-tie-work-copy* flags)) - ; (if (and *debug-segment* (< (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base)))) - ; (format *stdcon* "out of tie memory~%") - ; ) - ; (when (>= (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base))) - ; (set! (-> *prototype-tie-work* wait-to-spr) (the-as uint 0)) - ; (set! (-> *prototype-tie-work* wait-from-spr) (the-as uint 0)) - ; (let* ((v1-85 (-> *perf-stats* data 47)) - ; (a0-52 (-> v1-85 ctrl)) - ; ) - ; (+! (-> v1-85 count) 1) - ; (b! (zero? a0-52) cfg-33 :delay (nop!)) - ; (.mtc0 Perf 0) - ; (.sync.l) - ; (.sync.p) - ; (.mtpc pcr0 0) - ; (.mtpc pcr1 0) - ; (.sync.l) - ; (.sync.p) - ; (.mtc0 Perf a0-52) - ; ) - ; (.sync.l) - ; (.sync.p) - ; (label cfg-33) - ; 0 - ; (draw-inline-array-prototype-tie-asm s5-1 s4-1 s3-0) - ; (let ((v1-88 (-> *perf-stats* data 47))) - ; (b! (zero? (-> v1-88 ctrl)) cfg-35 :delay (nop!)) - ; (.mtc0 Perf 0) - ; (.sync.l) - ; (.sync.p) - ; (.mfpc a0-55 pcr0) - ; (+! (-> v1-88 accum0) a0-55) - ; (.mfpc a0-57 pcr1) - ; (+! (-> v1-88 accum1) a0-57) - ; ) - ; (label cfg-35) - ; 0 - ; (update-wait-stats - ; (-> *perf-stats* data 47) - ; (the-as uint 0) - ; (-> *prototype-tie-work* wait-to-spr) - ; (-> *prototype-tie-work* wait-from-spr) - ; ) - ; ) - ; (let ((a0-60 *dma-mem-usage*)) - ; (when (nonzero? a0-60) - ; (set! (-> a0-60 length) (max 10 (-> a0-60 length))) - ; (set! (-> a0-60 data 9 name) "tie-fragment") - ; (+! (-> a0-60 data 9 count) 1) - ; (+! (-> a0-60 data 9 used) - ; (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s2-1)) - ; ) - ; (set! (-> a0-60 data 9 total) (-> a0-60 data 9 used)) - ; ) - ; ) - ; ) - ; ) - ; ) - ; (set! v0-9 (cond - ; ((< (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base))) - ; (if *debug-segment* - ; (format *stdcon* "out of tie memory~%") - ; ) - ; (set! v0-9 (-> *instance-tie-work* buffer-start)) - ; (set! (-> s5-1 base) (the-as pointer v0-9)) - ; v0-9 - ; ) - ; (else - ; (instance-tie-patch-buckets s5-1 arg1) - ; ) - ; ) - ; ) - ; ) - ; ) - ; ) - ; ) - ; (set! (-> arg1 tie-min-dist) (-> *instance-tie-work* min-dist x)) - ; 0 + (local-vars (v0-9 object) (a0-42 int) (a0-44 int) (a0-55 int) (a0-57 int) (sv-16 int)) + (when (logtest? (vu1-renderer-mask + tie-scissor + tie + etie + etie-scissor + tie-vanish + generic + tie-scissor-trans + tie-trans + etie-trans + etie-scissor-trans + ) + (-> *display* vu1-enable-user) + ) + (set! (-> *instance-tie-work* wind-vectors) (-> arg0 prototypes wind-vectors)) + (let ((s5-0 (+ (-> arg0 length) -1))) + (when (nonzero? s5-0) + ; (dotimes (s4-0 s5-0) + ; (let* ((v1-9 (-> arg0 data s4-0)) + ; (a0-7 (-> arg0 data (+ s4-0 1))) + ; (a1-2 (/ (-> (the-as drawable-inline-array-node v1-9) data 0 id) 8)) + ; (a0-9 (/ (-> (the-as drawable-inline-array-node a0-7) data 0 id) 8)) + ; (a1-4 (+ a1-2 #x3800 #x70000000)) + ; (a0-11 (+ a0-9 #x3800 #x70000000)) + ; ) + ; (draw-node-cull + ; (the-as pointer a0-11) + ; (the-as pointer a1-4) + ; (-> (the-as drawable-inline-array-node v1-9) data) + ; (-> (the-as drawable-inline-array-node v1-9) length) + ; ) + ; ) + ; ) + ) + (let* ((s2-0 (-> arg0 data s5-0)) + (s3-0 (-> arg0 prototypes prototype-array-tie)) + (s4-1 (-> s3-0 length)) + (s5-1 (-> *display* frames (-> *display* on-screen) global-buf)) + (s0-0 (-> s5-1 base)) + (s1-1 (&- (-> s5-1 end) (the-as uint (* (-> arg0 prototypes prototype-max-qwc) 16)))) + ) + (when *debug-segment* + (if (>= (the-as uint s0-0) (the-as uint s1-1)) + (format *stdcon* "out of tie memory~%") + ) + ) + (when (< (the-as uint s0-0) (the-as uint s1-1)) + (set! (-> *instance-tie-work* buffer-start) (the-as uint (-> s5-1 base))) + (set! (-> *instance-tie-work* buffer-end) (the-as uint s1-1)) + (dotimes (v1-28 16) + (set! (-> *prototype-tie-work* last v1-28) (the-as uint 0)) + (set! (-> *prototype-tie-work* next v1-28) (the-as uint 0)) + (set! (-> *prototype-tie-work* count v1-28) (the-as uint 0)) + ) + (dotimes (v1-31 s4-1) + (let ((a0-26 (-> s3-0 array-data v1-31))) + (dotimes (a1-9 3) + (set! (-> a0-26 next-clear a1-9) (the-as uint128 0)) + (set! (-> a0-26 count-clear a1-9) (the-as uint 0)) + ) + ) + ) + (let* ((s1-2 (&+ s2-0 32)) + (s0-1 (+ (/ (-> s1-2 id) 8) #x3800 #x70000000)) + ) + (set! sv-16 (-> (the-as drawable-inline-array-instance-tie s2-0) length)) + (when (nonzero? sv-16) + (let* ((v1-41 (logand (the-as int *gsf-buffer*) 8191)) + (v1-43 + (the-as + object + (logand (the-as int (&- (logand (the-as int (&-> (-> s3-0 data) -640)) 8191) (the-as uint v1-41))) 8191) + ) + ) + ) + (set! *instance-tie-work-copy* (the-as instance-tie-work (+ (the-as int *gsf-buffer*) (the-as int v1-43)))) + ) + (quad-copy! (the-as pointer *instance-tie-work-copy*) (the-as pointer *instance-tie-work*) 35) + (let ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf base))) + (set! (-> *instance-tie-work-copy* wait-to-spr) (the-as uint 0)) + (set! (-> *instance-tie-work-copy* wait-from-spr) (the-as uint 0)) + (set! (-> *instance-tie-work-copy* tfrag-dists) (the-as uint (-> arg1 bsp tfrag-closest))) + (set! (-> *instance-tie-work-copy* alpha-dists) (the-as uint (-> arg1 bsp alpha-closest))) + (set! (-> *instance-tie-work-copy* water-dists) (the-as uint (-> arg1 bsp water-closest))) + ; (let* ((v1-61 (-> *perf-stats* data 46)) + ; (a0-39 (-> v1-61 ctrl)) + ; ) + ; (+! (-> v1-61 count) 1) + ; (b! (zero? a0-39) cfg-23 :delay (nop!)) + ; (.mtc0 Perf 0) + ; (.sync.l) + ; (.sync.p) + ; (.mtpc pcr0 0) + ; (.mtpc pcr1 0) + ; (.sync.l) + ; (.sync.p) + ; (.mtc0 Perf a0-39) + ; ) + ; (.sync.l) + ; (.sync.p) + ; (label cfg-23) + ; 0 + ; (let ((t9-3 draw-inline-array-instance-tie) + ; (a3-1 s5-1) + ; ) + ; (t9-3 (the-as pointer s0-1) (the-as (inline-array instance-tie) s1-2) sv-16 a3-1) + ; ) + ; (let ((v1-64 (-> *perf-stats* data 46))) + ; (b! (zero? (-> v1-64 ctrl)) cfg-25 :delay (nop!)) + ; (.mtc0 Perf 0) + ; (.sync.l) + ; (.sync.p) + ; (.mfpc a0-42 pcr0) + ; (+! (-> v1-64 accum0) a0-42) + ; (.mfpc a0-44 pcr1) + ; (+! (-> v1-64 accum1) a0-44) + ; ) + ; (label cfg-25) + ; 0 + (update-wait-stats + (-> *perf-stats* data 46) + (the-as uint 0) + (-> *instance-tie-work-copy* wait-to-spr) + (-> *instance-tie-work-copy* wait-from-spr) + ) + (let ((v1-71 (-> *instance-tie-work-copy* min-dist quad))) + (set! (-> *instance-tie-work* min-dist quad) v1-71) + ) + (set! (-> *instance-tie-work* flags) (-> *instance-tie-work-copy* flags)) + (if (and *debug-segment* (< (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base)))) + (format *stdcon* "out of tie memory~%") + ) + (when (>= (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base))) + (set! (-> *prototype-tie-work* wait-to-spr) (the-as uint 0)) + (set! (-> *prototype-tie-work* wait-from-spr) (the-as uint 0)) + ; (let* ((v1-85 (-> *perf-stats* data 47)) + ; (a0-52 (-> v1-85 ctrl)) + ; ) + ; (+! (-> v1-85 count) 1) + ; (b! (zero? a0-52) cfg-33 :delay (nop!)) + ; (.mtc0 Perf 0) + ; (.sync.l) + ; (.sync.p) + ; (.mtpc pcr0 0) + ; (.mtpc pcr1 0) + ; (.sync.l) + ; (.sync.p) + ; (.mtc0 Perf a0-52) + ; ) + ; (.sync.l) + ; (.sync.p) + ; (label cfg-33) + ; 0 + ; (draw-inline-array-prototype-tie-asm s5-1 s4-1 s3-0) + ; (let ((v1-88 (-> *perf-stats* data 47))) + ; (b! (zero? (-> v1-88 ctrl)) cfg-35 :delay (nop!)) + ; (.mtc0 Perf 0) + ; (.sync.l) + ; (.sync.p) + ; (.mfpc a0-55 pcr0) + ; (+! (-> v1-88 accum0) a0-55) + ; (.mfpc a0-57 pcr1) + ; (+! (-> v1-88 accum1) a0-57) + ; ) + ; (label cfg-35) + ; 0 + (update-wait-stats + (-> *perf-stats* data 47) + (the-as uint 0) + (-> *prototype-tie-work* wait-to-spr) + (-> *prototype-tie-work* wait-from-spr) + ) + ) + (let ((a0-60 *dma-mem-usage*)) + (when (nonzero? a0-60) + (set! (-> a0-60 length) (max 10 (-> a0-60 length))) + (set! (-> a0-60 data 9 name) "tie-fragment") + (+! (-> a0-60 data 9 count) 1) + (+! (-> a0-60 data 9 used) + (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s2-1)) + ) + (set! (-> a0-60 data 9 total) (-> a0-60 data 9 used)) + ) + ) + ) + ) + ) + (set! v0-9 (cond + ((< (the-as int (-> *instance-tie-work* buffer-end)) (the-as int (-> s5-1 base))) + (if *debug-segment* + (format *stdcon* "out of tie memory~%") + ) + (set! v0-9 (-> *instance-tie-work* buffer-start)) + (set! (-> s5-1 base) (the-as pointer v0-9)) + v0-9 + ) + (else + (instance-tie-patch-buckets s5-1 arg1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> arg1 tie-min-dist) (-> *instance-tie-work* min-dist x)) + 0 (none) ) @@ -1150,7 +1222,7 @@ :tie-vanish-bucket (bucket-id tie-vanish-l2-tfrag) :tie-trans-bucket (bucket-id tie-l2-alpha) :tie-scissor-trans-bucket (bucket-id tie-scissor-l2-alpha) - :tie-envmap-trans-bucket (bucket-id etie-l02alpha) + :tie-envmap-trans-bucket (bucket-id etie-l2-alpha) :tie-envmap-scissor-trans-bucket (bucket-id etie-scissor-l2-alpha) :tie-water-bucket (bucket-id tie-l2-water) :tie-scissor-water-bucket (bucket-id tie-scissor-l2-water) diff --git a/goal_src/jak3/engine/gfx/background/tie/tie.gc b/goal_src/jak3/engine/gfx/background/tie/tie.gc index 73e7890bf3..86358bb424 100644 --- a/goal_src/jak3/engine/gfx/background/tie/tie.gc +++ b/goal_src/jak3/engine/gfx/background/tie/tie.gc @@ -31,7 +31,7 @@ ) (when (= (-> s5-0 reg-4) 66) (set! (-> s5-0 reg-4) (the-as uint 127)) - (set! (-> s5-0 alpha) (new 'static 'gs-alpha)) + (set! (-> s5-0 alpha) (new 'static 'gs-miptbp)) 0 ) (&+! s5-0 80) @@ -260,7 +260,7 @@ ) -(define tie-vu1-block (new 'static 'vu-function :length #x3e7 :qlength #x1f4)) +(define tie-vu1-block (new 'static 'vu-function #|:length #x3e7 :qlength #x1f4|#)) (defun tie-init-consts ((arg0 tie-consts) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test)) "Set up tie-consts for VU1" diff --git a/goal_src/jak3/engine/gfx/blit-displays.gc b/goal_src/jak3/engine/gfx/blit-displays.gc index 681dda058b..200536e4de 100644 --- a/goal_src/jak3/engine/gfx/blit-displays.gc +++ b/goal_src/jak3/engine/gfx/blit-displays.gc @@ -5,7 +5,83 @@ ;; name in dgo: blit-displays ;; dgos: GAME +;; just a stub for now. (define-extern draw-color-bars (function blit-displays-work none)) +(define *blit-displays-work* (new 'static 'blit-displays-work + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) + ) + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x408b400000008010 #x5353) + ) + :contrast-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x40ab400000008010 #x5353) + ) + :sprite-slow-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531) + ) + :draw-slow-time-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x13 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x13 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x30aec00000008006 #x531) + ) + :line-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x2020c00000008020 #x55) + ) + :scan-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4c :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4c :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x5020c0000000800f #x55551) + ) + :color (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :line-color #x3f80000000000000 + :scan-colors (new 'static 'inline-array vector4w 15 + (new 'static 'vector4w :y 1 :z 1) + (new 'static 'vector4w :y 1 :z 1) + (new 'static 'vector4w :y 1 :z 1) + (new 'static 'vector4w :y 1 :z 1) + (new 'static 'vector4w :x 1 :y 3 :z 2) + (new 'static 'vector4w :x 1 :y 4 :z 3) + (new 'static 'vector4w :x 2 :y 6 :z 5) + (new 'static 'vector4w :x 3 :y 8 :z 7) + (new 'static 'vector4w :x 5 :y 11 :z 10) + (new 'static 'vector4w :x 6 :y 14 :z 13) + (new 'static 'vector4w :x 9 :y 20 :z 17) + (new 'static 'vector4w :x 13 :y 27 :z 21) + (new 'static 'vector4w :x 17 :y 36 :z 24) + (new 'static 'vector4w :x 22 :y 45 :z 28) + (new 'static 'vector4w :x 32 :y 63 :z 32) + ) + :menu-mode #f + :screen-copied #f + :horizontal-flip-flag #f + ) + ) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/gfx/foreground/foreground-h.gc b/goal_src/jak3/engine/gfx/foreground/foreground-h.gc index 80d6ddc14c..acc6225bda 100644 --- a/goal_src/jak3/engine/gfx/foreground/foreground-h.gc +++ b/goal_src/jak3/engine/gfx/foreground/foreground-h.gc @@ -124,6 +124,7 @@ that assigns stuff to buckets and prepares DMA for merc (or requests for generic "Scratch info computed per-merc-effect by the foreground code, then later read by merc DMA generation. This is only for the currently-processing merc model's effects." ((color-fade rgba) + (alpha uint8 :offset 3) (merc-path uint8) (ignore-alpha uint8) (disable-draw uint8) diff --git a/goal_src/jak3/engine/gfx/foreground/foreground.gc b/goal_src/jak3/engine/gfx/foreground/foreground.gc index 3176e413cf..eaad9d82c8 100644 --- a/goal_src/jak3/engine/gfx/foreground/foreground.gc +++ b/goal_src/jak3/engine/gfx/foreground/foreground.gc @@ -513,24 +513,24 @@ (defun foreground-init () "Initialize scratchpad and VU0 for foreground. Start foreground DMA chains." - (let ((gp-0 (the-as foreground-work (+ #x70000000 0)))) + (let ((gp-0 (scratchpad-object foreground-work))) (vu-lights-default! *default-lights*) - (let ((s5-0 *vu0-dma-list*)) - (let ((v1-1 s5-0)) - (set! (-> v1-1 base) (-> v1-1 data)) - (set! (-> v1-1 end) (the-as pointer (+ (+ (-> v1-1 allocated-length) 28) (the-as int v1-1)))) - ) - (dma-buffer-add-vu-function s5-0 foreground-vu0-block 0) - (let* ((v1-2 s5-0) - (a0-6 (-> v1-2 base)) - ) - (set! (-> (the-as (pointer uint64) a0-6) 0) (the-as uint #x70000000)) - (set! (-> (the-as (pointer uint64) a0-6) 1) (the-as uint 0)) - (set! (-> v1-2 base) (&+ a0-6 16)) - ) - (.sync.l) - (dma-buffer-send-chain (the-as dma-bank-source #x10008000) s5-0) - ) + ;; (let ((s5-0 *vu0-dma-list*)) + ;; (let ((v1-1 s5-0)) + ;; (set! (-> v1-1 base) (-> v1-1 data)) + ;; (set! (-> v1-1 end) (the-as pointer (+ (+ (-> v1-1 allocated-length) 28) (the-as int v1-1)))) + ;; ) + ;; (dma-buffer-add-vu-function s5-0 foreground-vu0-block 0) + ;; (let* ((v1-2 s5-0) + ;; (a0-6 (-> v1-2 base)) + ;; ) + ;; (set! (-> (the-as (pointer uint64) a0-6) 0) (the-as uint #x70000000)) + ;; (set! (-> (the-as (pointer uint64) a0-6) 1) (the-as uint 0)) + ;; (set! (-> v1-2 base) (&+ a0-6 16)) + ;; ) + ;; (.sync.l) + ;; (dma-buffer-send-chain (the-as dma-bank-source #x10008000) s5-0) + ;; ) (set! (-> gp-0 next-tmpl dma) (new 'static 'dma-tag :id (dma-tag-id next))) (set! (-> gp-0 next-tmpl vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) (set! (-> gp-0 next-tmpl vif1) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) @@ -756,7 +756,7 @@ (defun foreground-wrapup () "Finish foreground DMA chains." - (let ((gp-0 (the-as foreground-work (+ #x70000000 0)))) + (let ((gp-0 (scratchpad-object foreground-work))) (dotimes (s5-0 11) (let ((s4-0 (-> gp-0 grid level-buckets s5-0))) (dotimes (s3-0 7) @@ -1065,8 +1065,821 @@ ;; ERROR: Bad vector register dependency: vf9 ;; ERROR: Unsupported inline assembly instruction kind - [lui at, 28672] ;; ERROR: Unsupported inline assembly instruction kind - [vcallms 0] -(defun foreground-draw ((dc draw-control) (dma-buf dma-buffer) (dist float)) - (local-vars (work foreground-work) (a0-100 uint)) +;; (defun foreground-draw ((dc draw-control) (dma-buf dma-buffer) (dist float)) +;; (local-vars (work foreground-work) (a0-100 uint)) +;; (rlet ((vf1 :class vf) +;; (vf2 :class vf) +;; (vf3 :class vf) +;; (vf4 :class vf) +;; (vf5 :class vf) +;; (vf6 :class vf) +;; (vf7 :class vf) +;; (vf8 :class vf) +;; (vf9 :class vf) +;; (acc :class vf) +;; ) +;; ;; (.lui work 28672) +;; (set! work (scratchpad-object foreground-work)) +;; (let* ((bone-calc (-> dma-buf base)) +;; (matrix-mem (the-as object (&+ bone-calc 64))) +;; ) +;; (let ((a3-0 (logand (the-as int matrix-mem) 48))) +;; (b! (zero? a3-0) cfg-2 :delay (nop!)) +;; (set! matrix-mem (&- (&+ (the-as pointer matrix-mem) 64) (the-as uint a3-0))) +;; ) +;; (label cfg-2) +;; (let* ((num-bones (+ (-> dc mgeo length) 3)) +;; (matrix-mem-size (* num-bones 128)) +;; ) +;; (let ((regs (-> (scratchpad-object foreground-work) regs))) +;; (set! (-> regs joint-ptr) (the-as (inline-array joint) (-> dc jgeo data 0))) +;; (set! (-> regs bone-ptr) (-> dc skeleton bones)) +;; (set! (-> regs num-bones) (the-as uint num-bones)) +;; (set! (-> regs dist) dist) +;; (set! (-> regs dma-buf) dma-buf) +;; (set! (-> regs level-buckets) (-> (scratchpad-object foreground-work) +;; grid +;; level-buckets +;; (-> (scratchpad-object foreground-work) draw-index-map (-> dc level-index)) +;; ) +;; ) +;; ) +;; (let ((bone-output matrix-mem) +;; (bone-flags 0) +;; ) +;; (let ((fg-regs (-> (scratchpad-object foreground-work) regs)) +;; (calc-list *bone-calculation-list*) +;; (calc (the-as bone-calculation bone-calc)) +;; ) +;; (let ((t2-4 (-> fg-regs joint-ptr)) +;; (t3-0 (-> fg-regs bone-ptr)) +;; (t4-1 (-> fg-regs num-bones)) +;; (t5-0 calc) +;; ) +;; (set! (-> t5-0 flags) (the-as bone-calc-flags bone-flags)) +;; (set! (-> t5-0 num-bones) t4-1) +;; (set! (-> t5-0 matrix-area) (the-as (inline-array pris-mtx) bone-output)) +;; (set! (-> t5-0 joints) t2-4) +;; (set! (-> t5-0 bones) t3-0) +;; (set! (-> t5-0 next) (the-as bone-calculation 0)) +;; ) +;; (if (nonzero? (-> calc-list next)) +;; (set! (-> calc-list next next) calc) +;; ) +;; (if (zero? (-> calc-list first)) +;; (set! (-> calc-list first) calc) +;; ) +;; (set! (-> calc-list next) calc) +;; ) +;; (&+ bone-calc 48) +;; (let ((dma-ptr (the-as object (+ (the-as uint matrix-mem) matrix-mem-size)))) +;; (set! (-> work regs mtxs) (the-as (inline-array pris-mtx) matrix-mem)) +;; (let ((bucket-info (-> *foreground* merc-bucket-info))) +;; (when (= (-> dc data-format) (draw-control-data-format merc)) +;; (let ((lights-in (-> (scratchpad-object foreground-work) lights)) +;; (lights-out (-> bucket-info light)) +;; ) +;; (let ((inv-camera (-> *math-camera* inv-camera-rot))) +;; (nop!) +;; (nop!) +;; (.lvf vf4 (&-> inv-camera rvec quad)) +;; (nop!) +;; (.lvf vf5 (&-> inv-camera uvec quad)) +;; (nop!) +;; (.lvf vf6 (&-> inv-camera fvec quad)) +;; ) +;; (nop!) +;; (.lvf vf1 (&-> lights-in direction 0 quad)) +;; (nop!) +;; (.lvf vf2 (&-> lights-in direction 1 quad)) +;; (nop!) +;; (.lvf vf3 (&-> lights-in direction 2 quad)) +;; ;; (.vcallms 0) +;; ; mulax.xyzw ACC, vf01, vf04 +;; (.mul.x.vf acc vf1 vf4) +;; ; madday.xyzw ACC, vf02, vf04 +;; (.add.mul.y.vf acc vf2 vf4 acc) +;; ; maddz.xyzw vf07, vf03, vf04 +;; (.add.mul.z.vf vf7 vf3 vf4 acc) +;; ; mulax.xyzw ACC, vf01, vf05 +;; (.mul.x.vf acc vf1 vf5) +;; ; madday.xyzw ACC, vf02, vf05 +;; (.add.mul.y.vf acc vf2 vf5 acc) +;; ; maddz.xyzw vf08, vf03, vf05 +;; (.add.mul.z.vf vf8 vf3 vf5 acc) +;; ; mulax.xyzw ACC, vf01, vf06 +;; (.mul.x.vf acc vf1 vf6) +;; ; madday.xyzw ACC, vf02, vf06 :e +;; (.add.mul.y.vf acc vf2 vf6 acc) +;; ; maddz.xyzw vf09, vf03, vf06 +;; (.add.mul.z.vf vf9 vf3 vf6 acc) +;; (let ((a1-9 (-> lights-in color 0 quad))) +;; (nop!) +;; (let ((a2-6 (-> lights-in color 1 quad))) +;; (nop!) +;; (let ((a3-4 (-> lights-in color 2 quad))) +;; (nop!) +;; (let ((a0-6 (-> lights-in ambient quad))) +;; (nop!) +;; (set! (-> lights-out color 0 quad) a1-9) +;; (nop!) +;; (set! (-> lights-out color 1 quad) a2-6) +;; (nop!) +;; (set! (-> lights-out color 2 quad) a3-4) +;; (nop!) +;; (set! (-> lights-out ambient quad) a0-6) +;; ) +;; ) +;; ) +;; ) +;; (nop!) +;; (.nop.vf) +;; (nop!) +;; (.svf (&-> lights-out direction 0 quad) vf7) +;; (nop!) +;; (.svf (&-> lights-out direction 1 quad) vf8) +;; (nop!) +;; (.svf (&-> lights-out direction 2 quad) vf9) +;; (nop!) +;; (set! (-> lights-out direction 1 w) 0.0) +;; ) +;; (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 0)) +;; (set! (-> (scratchpad-object foreground-work) regs emerc-used) (the-as uint 0)) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 0)) +;; (set! (-> bucket-info needs-clip) (if (logtest? (-> dc status) (draw-control-status close-to-screen)) +;; 1 +;; 0 +;; ) +;; ) +;; (set! (-> bucket-info need-mercprime-if-merc) 0) +;; (set! (-> bucket-info must-use-mercneric-for-clip) 0) +;; (when (logtest? (-> dc status) (draw-control-status close-to-screen)) +;; (cond +;; ((logtest? (-> dc status) (draw-control-status force-vu1)) +;; (set! (-> bucket-info need-mercprime-if-merc) 1) +;; ) +;; ((nonzero? (-> dc longest-edge)) +;; (if (foreground-check-longest-edge-asm dc (-> (scratchpad-object foreground-work) regs dist)) +;; (set! (-> bucket-info need-mercprime-if-merc) 1) +;; (set! (-> bucket-info must-use-mercneric-for-clip) 1) +;; ) +;; ) +;; (else +;; (set! (-> bucket-info must-use-mercneric-for-clip) 1) +;; ) +;; ) +;; ) +;; (let ((geo (-> dc lod-set lod (-> dc cur-lod) geo))) +;; (let ((effect-mask (-> dc effect-mask))) +;; (dotimes (effect-idx (the-as int (-> geo header effect-count))) +;; (cond +;; ((= (logand effect-mask 1) 1) +;; (set! (-> bucket-info effect effect-idx disable-draw) (the-as uint 1)) +;; ) +;; ((begin +;; (set! (-> bucket-info effect effect-idx disable-draw) (the-as uint 0)) +;; (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 0)) +;; (when (logtest? (-> geo effect effect-idx effect-bits) (effect-bits texscroll)) +;; (let* ((v1-40 (the-as structure (-> geo effect effect-idx extra-info))) +;; (texscroll-info +;; (the-as +;; mei-texture-scroll +;; (+ (the-as uint v1-40) (* (-> (the-as merc-extra-info v1-40) texture-scroll-offset) 16)) +;; ) +;; ) +;; ) +;; (if (< (-> (scratchpad-object foreground-work) regs dist) (-> texscroll-info max-dist)) +;; (texscroll-make-request (-> geo effect effect-idx)) +;; ) +;; ) +;; ) +;; (if (and (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ripple)) (-> dc ripple)) +;; (set! dma-ptr (foreground-ripple dc geo (the-as pointer dma-ptr) effect-idx)) +;; ) +;; (or (nonzero? (-> dc death-timer)) +;; (and (logtest? (-> dc global-effect) (draw-control-global-effect no-textures)) +;; (not (logtest? (-> geo effect effect-idx effect-usage) 8)) +;; ) +;; ) +;; ) +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) +;; (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 1)) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) +;; ) +;; ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits force-mercneric)) +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) +;; ) +;; ((and (logtest? (-> geo effect effect-idx effect-usage) 1) +;; (not (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap))) +;; ) +;; 0.0 +;; (let* ((v1-75 (the-as structure (-> geo effect effect-idx extra-info))) +;; (envmap-info +;; (the-as mei-envmap-tint (+ (the-as uint v1-75) (* (-> (the-as merc-extra-info v1-75) envmap-tint-offset) 16))) +;; ) +;; (envmap-fade0 (-> envmap-info fade0)) +;; (envmap-fade1 (-> envmap-info fade1)) +;; (envmap-interp (+ (* envmap-fade0 (-> (scratchpad-object foreground-work) regs dist)) envmap-fade1)) +;; (envmap-strength (fmax 0.0 (fmin 1.0 envmap-interp))) +;; ) +;; (cond +;; ((or (nonzero? (-> bucket-info must-use-mercneric-for-clip)) +;; (or (< 0.0 envmap-strength) (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade))) +;; ) +;; (let ((envmap-tint (&-> envmap-info tint)) +;; (envmap-rgba-out (the-as (pointer uint8) (-> bucket-info effect effect-idx))) +;; ) +;; (let ((tod-rgba (-> *time-of-day-context* current-env-color))) +;; (if (and (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) +;; (logtest? (-> dc status) (draw-control-status warp-cross-fade)) +;; ) +;; (set! envmap-strength (* 0.0078125 (the float (- 128 (the-as int (-> dc force-fade)))) envmap-strength)) +;; ) +;; (cond +;; ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-tod-for-envmap-tint)) +;; (dotimes (a1-18 3) +;; (set! (-> envmap-rgba-out a1-18) +;; (the-as +;; uint +;; (min 255 (the int (* envmap-strength (the float (-> (the-as (pointer uint8) (&+ envmap-tint a1-18)) 0))))) +;; ) +;; ) +;; ) +;; ) +;; (else +;; (let ((envmap-rgba-multiplier (* 0.0078125 envmap-strength))) +;; (dotimes (a2-26 3) +;; (set! (-> envmap-rgba-out a2-26) +;; (the-as +;; uint +;; (min +;; 255 +;; (the int +;; (* envmap-rgba-multiplier +;; (-> tod-rgba data a2-26) +;; (the float (-> (the-as (pointer uint8) (&+ envmap-tint a2-26)) 0)) +;; ) +;; ) +;; ) +;; ) +;; ) +;; ) +;; ) +;; ) +;; ) +;; ) +;; (set! (-> envmap-rgba-out 3) (the-as uint 128)) +;; ) +;; (cond +;; ((and (logtest? (-> dc status) (draw-control-status force-vu1)) +;; (logtest? (-> geo effect effect-idx effect-bits) (effect-bits emerc)) +;; ) +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 1)) +;; (set! (-> (scratchpad-object foreground-work) regs emerc-used) (the-as uint 1)) +;; ) +;; (else +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) +;; (if (logtest? (-> dc status) (draw-control-status force-fade)) +;; (set! (-> bucket-info light fade-int) (-> dc force-fade)) +;; ) +;; ) +;; ) +;; (set! (-> bucket-info effect effect-idx ignore-alpha) +;; (the-as uint (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) +;; 1 +;; 0 +;; ) +;; ) +;; ) +;; ) +;; ((logtest? (-> dc status) (draw-control-status force-fade)) +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) +;; (set! (-> bucket-info effect effect-idx ignore-alpha) +;; (the-as uint (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) +;; 1 +;; 0 +;; ) +;; ) +;; ) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) +;; (set! (-> bucket-info light fade-int) (-> dc force-fade)) +;; ) +;; (else +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 0)) +;; (set! (-> bucket-info effect effect-idx ignore-alpha) (the-as uint 1)) +;; (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 1)) +;; ) +;; ) +;; ) +;; ) +;; (else +;; (cond +;; ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) +;; ) +;; ((or (logtest? (-> dc status) (draw-control-status force-fade)) +;; (nonzero? (-> bucket-info must-use-mercneric-for-clip)) +;; ) +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) +;; (if (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) +;; (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 1)) +;; ) +;; (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) +;; ) +;; (else +;; (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 0)) +;; (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 1)) +;; ) +;; ) +;; (set! (-> bucket-info effect effect-idx ignore-alpha) +;; (the-as +;; uint +;; (if (or (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) +;; (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) +;; ) +;; 1 +;; 0 +;; ) +;; ) +;; ) +;; ) +;; ) +;; (set! effect-mask (shr effect-mask 1)) +;; ) +;; ) +;; +;; +;; ;; TODO reassign for PC! +;; +;; (when (nonzero? (-> (scratchpad-object foreground-work) regs mercneric-used)) +;; (if (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic)) +;; (set! dma-ptr (foreground-generic-merc dc (the-as pointer dma-ptr) 0)) +;; ) +;; ) +;; (if (-> dc shadow) +;; (set! dma-ptr +;; (foreground-shadow dc (-> (scratchpad-object foreground-work) regs mtxs) (the-as pointer dma-ptr)) +;; ) +;; ) +;; (when (nonzero? (-> (scratchpad-object foreground-work) regs merc-used)) +;; (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask merc)) +;; (let ((fade-amount 0) +;; (fade-enable #f) +;; ) +;; (cond +;; ((logtest? (-> geo effect 0 effect-bits) (effect-bits no-fade-out)) +;; (set! fade-enable #f) +;; ) +;; ((logtest? (-> dc status) (draw-control-status force-fade)) +;; (set! fade-amount (the-as int (-> dc force-fade))) +;; (set! fade-enable #t) +;; ) +;; ((= (-> dc cur-lod) (-> dc lod-set max-lod)) +;; (let ((dist-until-gone +;; (- (-> dc lod-set lod (-> dc cur-lod) dist) (-> (scratchpad-object foreground-work) regs dist)) +;; ) +;; ) +;; (if (< dist-until-gone 81920.0) +;; (set! fade-enable #t) +;; ) +;; (set! fade-amount (the int (* 0.0015625 dist-until-gone))) +;; ) +;; ) +;; ) +;; (when fade-enable +;; (let ((v1-164 (min 128 (max 0 fade-amount))) +;; (a0-90 (-> bucket-info light)) +;; ) +;; (set! (-> a0-90 fade-flags) (the-as uint 0.00000000000000000000000000000000000000000014)) +;; (set! (-> a0-90 fade-int) (the-as uint v1-164)) +;; ) +;; ) +;; ) +;; (if (nonzero? (-> bucket-info need-mercprime-if-merc)) +;; (set! dma-ptr +;; (foreground-merc +;; dc +;; (-> (scratchpad-object foreground-work) regs mtxs) +;; (the-as pointer dma-ptr) +;; 32 +;; 17 +;; bone-flags +;; ) +;; ) +;; (set! dma-ptr +;; (foreground-merc +;; dc +;; (-> (scratchpad-object foreground-work) regs mtxs) +;; (the-as pointer dma-ptr) +;; 35 +;; 20 +;; bone-flags +;; ) +;; ) +;; ) +;; ) +;; ) +;; ) +;; (when (nonzero? (-> (scratchpad-object foreground-work) regs emerc-used)) +;; (if (logtest? (vu1-renderer-mask emerc) (-> *display* vu1-enable-user)) +;; (set! dma-ptr +;; (foreground-emerc +;; dc +;; (-> (scratchpad-object foreground-work) regs mtxs) +;; (the-as pointer dma-ptr) +;; 29 +;; 19 +;; bone-flags +;; ) +;; ) +;; ) +;; ) +;; (when (nonzero? (-> dc death-timer)) +;; (b! (paused?) cfg-131 :delay (empty-form)) +;; (+! (-> dc death-timer) -1) +;; (if (>= (the-as uint 1) (-> dc death-timer)) +;; (send-event (-> dc process) 'death-end dc) +;; ) +;; ) +;; ) +;; ) +;; (label cfg-131) +;; (let ((v1-190 (logand (the-as int dma-ptr) 48))) +;; 0 +;; (b! (zero? v1-190) cfg-133 :delay (set! a0-100 (the-as uint #x20000000))) +;; ;; (s.q! dma-ptr a0-100) +;; (set! (-> (the (pointer uint128) dma-ptr) 0) (the uint128 a0-100)) +;; +;; (let ((a0-101 dma-ptr)) +;; (set! dma-ptr (+ (- (the-as int dma-ptr) (the-as uint v1-190)) 64)) +;; ;; (s.w! (+ a0-101 4) (the-as int dma-ptr)) +;; (set! (-> (the (pointer int32) (+ (the-as uint a0-101) 4))) (the-as int dma-ptr)) +;; ) +;; ) +;; (label cfg-133) +;; (set! (-> (scratchpad-object foreground-work) regs dma-buf base) +;; (the-as pointer (logand (the-as int dma-ptr) #xfffffff)) +;; ) +;; ) +;; ) +;; ) +;; ) +;; 0 +;; (none) +;; ) +;; ) + +(defun pc-merc-blend-shape ((pd process-drawable) (blerc-weights-out (pointer float))) + "PC implementation to get blerc weights as floats and avoid the u16 rounding. + Returns #f if there is no blerc running, which means that we should use base positions. + If things work correctly, the original implementation would try to restore weights of 0 + after the animation finishes - it leaves `blend-shape-valid` set after `blend-shape` is cleared + causing one more round of merc-blend-shape to run with hardcoded weights of 0. + " + (when (or (not (-> pd skel)) + (zero? (-> pd skel)) + ) + (return #f) + ) + + ;; grab the currently playing animatoin + (let* ((jc-channel (-> pd skel root-channel 0)) + (anim (-> jc-channel frame-group)) + (got-weights #f) + ) + (when (and anim ;; we have an anim + (> (-> pd skel active-channels) 0) ;; there are channels running + (zero? (-> pd draw cur-lod)) ;; using high lod + (logtest? (-> pd skel status) (joint-control-status blend-shape)) ;; blend shape is on + ) + (cond + ;; first, see if we have an override: + ((and (-> pd skel override) (!= (-> pd skel override 0) 0.0)) + ;; we do! copy from there. + (let* ((mctrl (-> pd draw mgeo)) + (num-targets (-> mctrl header blend-target-count)) + (override-array (-> pd skel override)) + ) + (set! got-weights #t) + (dotimes (i num-targets) + (set! (-> blerc-weights-out i) (* 8192.0 (-> override-array (+ i 1)))) + ) + ) + ) + (else + ;; otherwise, do the animation + (let ((shape-anim (-> anim blend-shape-anim))) + (when shape-anim + (let ((mctrl (-> pd draw mgeo))) + (let* ((num-targets (-> mctrl header blend-target-count)) + (frame-f (-> jc-channel frame-num)) + ;; round down to the integer frame + (frame-i (the int frame-f)) + (frame-1-data (the (pointer uint8) (&+ shape-anim (* frame-i num-targets)))) + ) + (cond + ;; check if there's a frame after this + ((< frame-i (the-as int (+ (-> anim frames num-frames) -1))) + ;; there is, interpolate between them. + ;; this is rewritten to use floats, but still use the same scaling as the s16 weights. + (let* ((frame-2-data (&+ frame-1-data num-targets)) + (frame-2-mult (* 64.0 (- frame-f (the float frame-i)))) + (frame-1-mult (- 64.0 frame-2-mult)) + ) + (set! got-weights #t) + (dotimes (i num-targets) + ;; key difference: this is floats + (set! (-> blerc-weights-out i) + (+ (* (the float (- (-> frame-1-data i) 64)) frame-1-mult) + (* (the float (- (-> frame-2-data i) 64)) frame-2-mult) + ) + ) + ) + ) + ) + (else + ;; at the last frame, nothing to interpolate. + (set! got-weights #t) + (dotimes (a3-7 num-targets) + (set! (-> blerc-weights-out a3-7) (the float (* (+ (-> (the-as (pointer uint8) (&+ frame-1-data a3-7))) -64) 64))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + got-weights + + ) + ) + +(defenum pc-merc-bits + :type uint8 + :bitfield #t + (update-verts 0) + (disable-fog 1) + (pc-blerc 2) + (disable-envmap 3) + ) + +(deftype pc-merc-flags (structure) + ((enable-mask uint64) + (ignore-alpha-mask uint64) + (effect-count uint8) + (bit-flags pc-merc-bits) + ) + ) + +(define *use-fp-blerc* #f) + +(defun pc-merc-draw-request ((dc draw-control) (dma-buf pointer) (matrix-buf pointer) (tex-idx int) (update-verts symbol) (blercs (pointer float))) + "Send a request to PC Merc2 to draw the given object. + Only draws the effects which match this texture index. + Just places a single big dma packet, you have to patch the end yourself. + If update-verts is set to #t, tell the PC renderer to use EE version of vertices. + If update-verts is set to 'blerc, tell the PC renderer to use the included blerc weights + to modify the vertices." + (let ((start-packet (the-as dma-packet dma-buf)) + (qwc-total 0)) + (set! (-> start-packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> start-packet vif0) (new 'static 'vif-tag)) + (set! (-> start-packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (set! dma-buf (the pointer (&+ start-packet 16))) + + ;; NAME: 128 char, 8 qw + (let ((data-ptr (the-as (pointer uint128) dma-buf))) + (charp<-string (the (pointer uint8) (&-> data-ptr 0)) (-> dc mgeo name)) + ) + (&+! dma-buf (* 16 8)) + (+! qwc-total 8) + + ;; LIGHTS: + (quad-copy! dma-buf (the pointer (-> (-> *foreground* merc-bucket-info) light)) 7) + (&+! dma-buf (* 16 7)) + (+! qwc-total 7) + + + (let ((matrix-slot-string (the (pointer uint8) dma-buf)) ;; matrix slot list (so PC knows what order they come in) + (enable-mask 0) + (ignore-alpha-mask 0) + (matrix-out-idx 0) + ) + (&+! dma-buf (* 16 8)) + (+! qwc-total 8) + ;; flag of matrices we've already transferred and can de-dup + (let ((transferred-matrices (new 'stack-no-clear 'array 'uint8 128))) + (dotimes (i 128) (set! (-> transferred-matrices i) 0)) + + (let ((merc-ctrl (-> dc lod-set lod (-> dc cur-lod) geo))) + ;; loop to: grab matrices and populate flags + (dotimes (effect-idx (-> merc-ctrl header effect-count)) + + ;; check to skip fragment. only draw if: + ;; We want to use "merc" + ;; We aren't disabled (new feature in jak 2) + ;; We match the texture index for the bucket. + (when (and (zero? (-> (-> *foreground* merc-bucket-info) effect effect-idx merc-path)) + (zero? (-> (-> *foreground* merc-bucket-info) effect effect-idx disable-draw)) + (= tex-idx (-> merc-ctrl effect effect-idx texture-index)) + ) + ;; set enable bit for pc render + (logior! enable-mask (ash 1 effect-idx)) + ;; set alpha bit for pc render + (when (nonzero? (-> (-> *foreground* merc-bucket-info) effect effect-idx ignore-alpha)) + (logior! ignore-alpha-mask (ash 1 effect-idx)) + ) + (let* ((effect (-> merc-ctrl effect effect-idx)) + (frag (-> effect frag-ctrl)) + ) + ;; iterate over fragments + (dotimes (frag-idx (-> effect frag-count)) + ;; matrices + (dotimes (mat-xfer-idx (-> frag mat-xfer-count)) + (let ((mat-idx (-> frag mat-dest-data mat-xfer-idx matrix-number))) + (if (>= mat-idx 128) ;; pc merc2 limit + (break!) + ) + (when (zero? (-> transferred-matrices mat-idx)) + ;; transfer it. + (set! (-> transferred-matrices mat-idx) 1) + (set! (-> matrix-slot-string matrix-out-idx) mat-idx) + (+! matrix-out-idx 1) + (set! (-> (the (pointer pointer) dma-buf)) (&+ matrix-buf (* 128 mat-idx))) + (&+! dma-buf 16) + (+! qwc-total 1) + ) + ) + ) + (&+! frag (* 2 (-> frag mat-xfer-count))) + (&+! frag (size-of merc-fragment-control)) + ) + ) + ) + ) ;; end effect loop + + ;; end matrix string + (while (< matrix-out-idx 128) + (set! (-> matrix-slot-string matrix-out-idx) #xff) + (+! matrix-out-idx 1) + ) + + ;; flags + (let ((flags (the (pc-merc-flags) dma-buf))) + (set! (-> flags effect-count) (-> merc-ctrl header effect-count)) + (set! (-> flags bit-flags) (the pc-merc-bits 0)) + (when update-verts + (if (= update-verts 'blerc) + (logior! (-> flags bit-flags) (pc-merc-bits pc-blerc)) + (logior! (-> flags bit-flags) (pc-merc-bits update-verts)) + ) + ) + (when (logtest? (-> dc status) (draw-control-status disable-fog)) + (logior! (-> flags bit-flags) (pc-merc-bits disable-fog)) + ) + (when (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> flags bit-flags) (pc-merc-bits disable-envmap)) + ) + (set! (-> flags enable-mask) enable-mask) + (set! (-> flags ignore-alpha-mask) ignore-alpha-mask) + ) + (&+! dma-buf (* 16 2)) + (+! qwc-total 2) + + ;; include blerc weights. + (when (= update-verts 'blerc) + (mem-copy! dma-buf blercs (* 40 4)) + (&+! dma-buf (* 40 4)) + (+! qwc-total 10) + ) + + ;; fades + (let ((fades (the (pointer uint32) dma-buf))) + (dotimes (i (-> merc-ctrl header effect-count)) + (set! (-> fades i) (the-as uint (-> (-> *foreground* merc-bucket-info) effect i color-fade))) + ) + ) + + (let ((num-fades (/ (+ (-> merc-ctrl header effect-count) 3) 4))) + (&+! dma-buf (* 16 num-fades)) + (+! qwc-total num-fades) + ) + + ;; merc ptrs + (let ((merc-ptrs (the (pointer object) dma-buf))) + (dotimes (i (-> merc-ctrl header effect-count)) + (set! (-> merc-ptrs i) (-> merc-ctrl effect i)) + ) + ) + (let ((num-fades (/ (+ (-> merc-ctrl header effect-count) 3) 4))) + (&+! dma-buf (* 16 num-fades)) + (+! qwc-total num-fades) + ) + ) + ) + ) + + (set! (-> start-packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc qwc-total)) + dma-buf + ) + ) + +(defun pc-draw-bones ((dc draw-control) (dma-buf pointer) (matrix-buf pointer)) + "Add a dma packet to tell the PC renderer which model we are renderering." + (let* ((use-flags (new 'stack-no-clear 'array 'uint8 7)) + (blerc-weights (new 'stack-no-clear 'array 'float 40)) + (mctrl (-> dc mgeo)) + (buckets (-> (scratchpad-object foreground-work) grid level-buckets (-> (scratchpad-object foreground-work) draw-index-map (-> dc level-index)))) + (has-ripple-or-texscroll #f) + (uses-fp-blerc (and *use-fp-blerc* (pc-merc-blend-shape (the process-drawable (-> dc process)) blerc-weights))) + ) + ;; mark all as unused, until we see a use + (dotimes (i 7) (set! (-> use-flags i) 0)) + + ;; look for uses. + (dotimes (i (-> mctrl header effect-count)) + ;;(format 0 "effect ~d, texture ~d~%" i (-> mctrl effect i texture-index)) + (when (= 0 (-> *foreground* merc-bucket-info effect i merc-path)) + (set! (-> use-flags (-> mctrl effect i texture-index)) 1) + (when (logtest? (-> (-> dc lod-set lod (-> dc cur-lod) geo) effect i effect-bits) (effect-bits ripple texscroll)) + (set! has-ripple-or-texscroll #t) + ) + ) + ) + + ;; loop over texture groupe + (dotimes (i 7) + (when (nonzero? (-> use-flags i)) + ;; this one is used, update the model for pc. + ;; create dma-packet to send the name: + (let ((packet (the-as dma-packet dma-buf)) + (vertex-update #f) + ) + (when has-ripple-or-texscroll + (set! vertex-update #t) + ) + (when uses-fp-blerc + (set! vertex-update 'blerc) + ) + + ;; if the fp blerc is disabled, handle blerc with normal modified vertices. + (unless *use-fp-blerc* + (let* ((pd (the process-drawable (-> dc process))) + (jc (-> pd skel))) + (when (nonzero? jc) + (when (logtest? (-> jc status) (joint-control-status blend-shape-valid)) + (set! vertex-update #t) + ) + ) + ) + ) + + ; (format 0 "~D weights: ~X~%" i blerc-weights) + + (set! dma-buf (pc-merc-draw-request dc dma-buf matrix-buf i vertex-update blerc-weights)) + + ;; create a patch packet + (let ((patch-packet (the-as dma-packet dma-buf))) + (set! (-> patch-packet dma) (the-as dma-tag #x20000000)) + (set! (-> patch-packet vif0) (new 'static 'vif-tag)) + (set! (-> patch-packet vif1) (new 'static 'vif-tag)) + (set! dma-buf (the pointer (&+ patch-packet 16))) + + ;; now, the confusing splice stuff + (let ((merc-chain (-> buckets data i merc))) + ;; first step: set first, if we are the first thing to draw. + (when (zero? (-> merc-chain first)) + (set! (-> merc-chain first) packet) + ) + + ;; second step: patch the last thing that was drawn + (when (nonzero? (-> merc-chain patch)) + (let ((patch-addr (+ 4 (the-as int (-> merc-chain patch))))) + (set! (-> (the (pointer dma-packet) patch-addr)) packet) + ) + ) + + ;; third step: update patch to point to our packet. + (set! (-> merc-chain patch) patch-packet) + + ) + ) + ) + + ) + ) + ) + dma-buf + ) + +(defun foreground-draw ((dc draw-control) (dma-buf dma-buffer) (dist-in float)) + (local-vars (fg-work foreground-work) (a0-92 uint)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -1078,82 +1891,86 @@ (vf9 :class vf) (acc :class vf) ) - ;; (.lui work 28672) - (set! work (scratchpad-object foreground-work)) - (let* ((bone-calc (-> dma-buf base)) - (matrix-mem (the-as object (&+ bone-calc 64))) - ) - (let ((a3-0 (logand (the-as int matrix-mem) 48))) - (b! (zero? a3-0) cfg-2 :delay (nop!)) - (set! matrix-mem (&- (&+ (the-as pointer matrix-mem) 64) (the-as uint a3-0))) - ) - (label cfg-2) - (let* ((num-bones (+ (-> dc mgeo length) 3)) - (matrix-mem-size (* num-bones 128)) - ) - (let ((regs (-> (scratchpad-object foreground-work) regs))) - (set! (-> regs joint-ptr) (the-as (inline-array joint) (-> dc jgeo data 0))) - (set! (-> regs bone-ptr) (-> dc skeleton bones)) - (set! (-> regs num-bones) (the-as uint num-bones)) - (set! (-> regs dist) dist) - (set! (-> regs dma-buf) dma-buf) - (set! (-> regs level-buckets) (-> (scratchpad-object foreground-work) - grid - level-buckets - (-> (scratchpad-object foreground-work) draw-index-map (-> dc level-index)) - ) - ) - ) - (let ((bone-output matrix-mem) - (bone-flags 0) + ;;(.lui fg-work 28672) + (set! fg-work (scratchpad-object foreground-work)) + ;; (with-pc + ;; (when (-> *pc-settings* force-envmap?) + ;; (set! dist-in 0.0))) + (let* ((bone-calc (the-as bone-calculation (-> dma-buf base))) + (matrix-mem (the-as object (&+ (the-as pointer bone-calc) 64))) + ) + (let ((a3-0 (logand (the-as int matrix-mem) 48))) + (b! (zero? a3-0) cfg-2 :delay (nop!)) + (set! matrix-mem (&- (&+ (the-as pointer matrix-mem) 64) (the-as uint a3-0))) + ) + (label cfg-2) + (let* ((num-bones (+ (-> dc mgeo num-joints) 3)) + (bone-mem-size (* num-bones 128)) + ) + (let ((fg-regs (-> (scratchpad-object foreground-work) regs))) + (set! (-> fg-regs joint-ptr) (the-as (inline-array joint) (-> dc jgeo data 0))) + (set! (-> fg-regs bone-ptr) (-> dc skeleton bones)) + (set! (-> fg-regs num-bones) (the-as uint num-bones)) + (set! (-> fg-regs dist) dist-in) + (set! (-> fg-regs dma-buf) dma-buf) + (set! (-> fg-regs level-buckets) + (-> (scratchpad-object foreground-work) + grid + level-buckets + (-> (scratchpad-object foreground-work) draw-index-map (-> dc level-index)) + ) + ) ) - (let ((fg-regs (-> (scratchpad-object foreground-work) regs)) - (calc-list *bone-calculation-list*) - (calc (the-as bone-calculation bone-calc)) - ) - (let ((t2-4 (-> fg-regs joint-ptr)) - (t3-0 (-> fg-regs bone-ptr)) - (t4-1 (-> fg-regs num-bones)) - (t5-0 calc) + (let ((matrix-mem2 matrix-mem) + (bflags 0) ) - (set! (-> t5-0 flags) (the-as bone-calc-flags bone-flags)) - (set! (-> t5-0 num-bones) t4-1) - (set! (-> t5-0 matrix-area) (the-as (inline-array pris-mtx) bone-output)) - (set! (-> t5-0 joints) t2-4) - (set! (-> t5-0 bones) t3-0) - (set! (-> t5-0 next) (the-as bone-calculation 0)) - ) - (if (nonzero? (-> calc-list next)) - (set! (-> calc-list next next) calc) - ) - (if (zero? (-> calc-list first)) - (set! (-> calc-list first) calc) - ) - (set! (-> calc-list next) calc) - ) - (&+ bone-calc 48) - (let ((dma-ptr (the-as object (+ (the-as uint matrix-mem) matrix-mem-size)))) - (set! (-> work regs mtxs) (the-as (inline-array pris-mtx) matrix-mem)) - (let ((bucket-info (-> *foreground* merc-bucket-info))) - (when (= (-> dc data-format) (draw-control-data-format merc)) - (let ((lights-in (-> (scratchpad-object foreground-work) lights)) - (lights-out (-> bucket-info light)) + (let ((f-regs (-> (scratchpad-object foreground-work) regs)) + (bone-list *bone-calculation-list*) + (calc-to-add bone-calc) + ) + (let ((jnt (-> f-regs joint-ptr)) + (bn (-> f-regs bone-ptr)) + (count (-> f-regs num-bones)) + (calc calc-to-add) ) - (let ((inv-camera (-> *math-camera* inv-camera-rot))) - (nop!) - (nop!) - (.lvf vf4 (&-> inv-camera rvec quad)) - (nop!) - (.lvf vf5 (&-> inv-camera uvec quad)) - (nop!) - (.lvf vf6 (&-> inv-camera fvec quad)) + (set! (-> calc flags) (the-as bone-calc-flags bflags)) + (set! (-> calc num-bones) count) + (set! (-> calc matrix-area) (the-as (inline-array pris-mtx) matrix-mem2)) + (set! (-> calc joints) jnt) + (set! (-> calc bones) bn) + (set! (-> calc next) (the-as bone-calculation 0)) + ) + (if (nonzero? (-> bone-list next)) + (set! (-> bone-list next next) calc-to-add) + ) + (if (zero? (-> bone-list first)) + (set! (-> bone-list first) calc-to-add) ) - (nop!) - (.lvf vf1 (&-> lights-in direction 0 quad)) - (nop!) - (.lvf vf2 (&-> lights-in direction 1 quad)) - (nop!) - (.lvf vf3 (&-> lights-in direction 2 quad)) + (set! (-> bone-list next) calc-to-add) + ) + (&+ bone-calc 48) + (let ((dma-ptr (the-as pointer (+ (the-as uint matrix-mem) bone-mem-size)))) + (set! (-> fg-work regs mtxs) (the-as (inline-array pris-mtx) matrix-mem)) + (let ((bucket-info (-> *foreground* merc-bucket-info))) + (when (= (-> dc data-format) (draw-control-data-format merc)) + (let ((fg-lights (-> (scratchpad-object foreground-work) lights)) + (rotated-light-out (-> bucket-info light)) + ) + (let ((inv-cam-rot (-> *math-camera* inv-camera-rot))) + (nop!) + (nop!) + (.lvf vf4 (&-> inv-cam-rot quad 0)) + (nop!) + (.lvf vf5 (&-> inv-cam-rot quad 1)) + (nop!) + (.lvf vf6 (&-> inv-cam-rot quad 2)) + ) + (nop!) + (.lvf vf1 (&-> fg-lights direction 0 quad)) + (nop!) + (.lvf vf2 (&-> fg-lights direction 1 quad)) + (nop!) + (.lvf vf3 (&-> fg-lights direction 2 quad)) ;; (.vcallms 0) ; mulax.xyzw ACC, vf01, vf04 (.mul.x.vf acc vf1 vf4) @@ -1173,367 +1990,373 @@ (.add.mul.y.vf acc vf2 vf6 acc) ; maddz.xyzw vf09, vf03, vf06 (.add.mul.z.vf vf9 vf3 vf6 acc) - (let ((a1-9 (-> lights-in color 0 quad))) - (nop!) - (let ((a2-6 (-> lights-in color 1 quad))) - (nop!) - (let ((a3-4 (-> lights-in color 2 quad))) + + (let ((a1-9 (-> fg-lights color 0 quad))) (nop!) - (let ((a0-6 (-> lights-in ambient quad))) + (let ((a2-6 (-> fg-lights color 1 quad))) (nop!) - (set! (-> lights-out color 0 quad) a1-9) - (nop!) - (set! (-> lights-out color 1 quad) a2-6) - (nop!) - (set! (-> lights-out color 2 quad) a3-4) - (nop!) - (set! (-> lights-out ambient quad) a0-6) + (let ((a3-4 (-> fg-lights color 2 quad))) + (nop!) + (let ((a0-6 (-> fg-lights ambient quad))) + (nop!) + (set! (-> rotated-light-out color 0 quad) a1-9) + (nop!) + (set! (-> rotated-light-out color 1 quad) a2-6) + (nop!) + (set! (-> rotated-light-out color 2 quad) a3-4) + (nop!) + (set! (-> rotated-light-out ambient quad) a0-6) + ) + ) ) ) + (nop!) + (.nop.vf) + (nop!) + (.svf (&-> rotated-light-out direction 0 quad) vf7) + (nop!) + (.svf (&-> rotated-light-out direction 1 quad) vf8) + (nop!) + (.svf (&-> rotated-light-out direction 2 quad) vf9) + (nop!) + (set! (-> rotated-light-out fade-flags) (the-as uint 0)) ) - ) - (nop!) - (.nop.vf) - (nop!) - (.svf (&-> lights-out direction 0 quad) vf7) - (nop!) - (.svf (&-> lights-out direction 1 quad) vf8) - (nop!) - (.svf (&-> lights-out direction 2 quad) vf9) - (nop!) - (set! (-> lights-out direction 1 w) 0.0) - ) - (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 0)) - (set! (-> (scratchpad-object foreground-work) regs emerc-used) (the-as uint 0)) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 0)) - (set! (-> bucket-info needs-clip) (if (logtest? (-> dc status) (draw-control-status close-to-screen)) - 1 - 0 - ) - ) - (set! (-> bucket-info need-mercprime-if-merc) 0) - (set! (-> bucket-info must-use-mercneric-for-clip) 0) - (when (logtest? (-> dc status) (draw-control-status close-to-screen)) - (cond - ((logtest? (-> dc status) (draw-control-status force-vu1)) - (set! (-> bucket-info need-mercprime-if-merc) 1) - ) - ((nonzero? (-> dc longest-edge)) - (if (foreground-check-longest-edge-asm dc (-> (scratchpad-object foreground-work) regs dist)) + (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 0)) + (set! (-> (scratchpad-object foreground-work) regs emerc-used) (the-as uint 0)) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 0)) + (set! (-> bucket-info needs-clip) (if (logtest? (-> dc status) (draw-control-status close-to-screen)) + 1 + 0 + ) + ) + (set! (-> bucket-info need-mercprime-if-merc) 0) + (set! (-> bucket-info must-use-mercneric-for-clip) 0) + (when (logtest? (-> dc status) (draw-control-status close-to-screen)) + (cond + ((logtest? (-> dc status) (draw-control-status force-vu1)) (set! (-> bucket-info need-mercprime-if-merc) 1) - (set! (-> bucket-info must-use-mercneric-for-clip) 1) ) - ) - (else - (set! (-> bucket-info must-use-mercneric-for-clip) 1) - ) - ) - ) - (let ((geo (-> dc lod-set lod (-> dc cur-lod) geo))) - (let ((effect-mask (-> dc effect-mask))) - (dotimes (effect-idx (the-as int (-> geo header effect-count))) - (cond - ((= (logand effect-mask 1) 1) - (set! (-> bucket-info effect effect-idx disable-draw) (the-as uint 1)) + ((nonzero? (-> dc longest-edge)) + (if (foreground-check-longest-edge-asm dc (-> (scratchpad-object foreground-work) regs dist)) + (set! (-> bucket-info need-mercprime-if-merc) 1) + (set! (-> bucket-info must-use-mercneric-for-clip) 1) + ) ) - ((begin - (set! (-> bucket-info effect effect-idx disable-draw) (the-as uint 0)) - (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 0)) - (when (logtest? (-> geo effect effect-idx effect-bits) (effect-bits texscroll)) - (let* ((v1-40 (the-as structure (-> geo effect effect-idx extra-info))) - (texscroll-info - (the-as - mei-texture-scroll - (+ (the-as uint v1-40) (* (-> (the-as merc-extra-info v1-40) texture-scroll-offset) 16)) + (else + (set! (-> bucket-info must-use-mercneric-for-clip) 1) + ) + ) + ) + (let ((geo (-> dc lod-set lod (-> dc cur-lod) geo))) + (let ((effect-mask (-> dc effect-mask))) + (dotimes (effect-idx (the-as int (-> geo header effect-count))) + (cond + ((= (logand effect-mask 1) 1) + (set! (-> bucket-info effect effect-idx disable-draw) (the-as uint 1)) + ) + ((begin + (set! (-> bucket-info effect effect-idx disable-draw) (the-as uint 0)) + (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 0)) + (when (logtest? (-> geo effect effect-idx effect-bits) (effect-bits texscroll)) + (let* ((extra (the-as structure (-> geo effect effect-idx extra-info))) + (tex-scroll-info + (the-as + mei-texture-scroll + (+ (the-as uint extra) (* (-> (the-as merc-extra-info extra) texture-scroll-offset) 16)) + ) + ) ) - ) - ) - (if (< (-> (scratchpad-object foreground-work) regs dist) (-> texscroll-info max-dist)) - (texscroll-make-request (-> geo effect effect-idx)) + (if (< (-> (scratchpad-object foreground-work) regs dist) (-> tex-scroll-info max-dist)) + (texscroll-make-request (-> geo effect effect-idx)) + ) + ) + ) + (when (and (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ripple)) (-> dc ripple)) + (set! dma-ptr (foreground-ripple dc geo dma-ptr effect-idx)) ) + (nonzero? (-> dc death-timer)) ) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) ) - (if (and (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ripple)) (-> dc ripple)) - (set! dma-ptr (foreground-ripple dc geo (the-as pointer dma-ptr) effect-idx)) - ) - (or (nonzero? (-> dc death-timer)) - (and (logtest? (-> dc global-effect) (draw-control-global-effect no-textures)) - (not (logtest? (-> geo effect effect-idx effect-usage) 8)) - ) - ) - ) - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) - (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 1)) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) - ) - ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits force-mercneric)) - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) - ) - ((and (logtest? (-> geo effect effect-idx effect-usage) 1) - (not (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap))) - ) - 0.0 - (let* ((v1-75 (the-as structure (-> geo effect effect-idx extra-info))) - (envmap-info - (the-as mei-envmap-tint (+ (the-as uint v1-75) (* (-> (the-as merc-extra-info v1-75) envmap-tint-offset) 16))) - ) - (envmap-fade0 (-> envmap-info fade0)) - (envmap-fade1 (-> envmap-info fade1)) - (envmap-interp (+ (* envmap-fade0 (-> (scratchpad-object foreground-work) regs dist)) envmap-fade1)) - (envmap-strength (fmax 0.0 (fmin 1.0 envmap-interp))) - ) - (cond - ((or (nonzero? (-> bucket-info must-use-mercneric-for-clip)) - (or (< 0.0 envmap-strength) (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade))) + ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits force-mercneric)) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) + ) + ((and (logtest? (-> geo effect effect-idx effect-usage) 1) + (zero? (logand (-> dc global-effect) (draw-control-global-effect disable-envmap))) ) - (let ((envmap-tint (&-> envmap-info tint)) - (envmap-rgba-out (the-as (pointer uint8) (-> bucket-info effect effect-idx))) + 0.0 + (let* ((ei (the-as structure (-> geo effect effect-idx extra-info))) + (tint-info + (the-as mei-envmap-tint (+ (the-as uint ei) (* (-> (the-as merc-extra-info ei) envmap-tint-offset) 16))) + ) + (t-fade-0 (-> tint-info fade0)) + (t-fade-1 (-> tint-info fade1)) + (t-interp (+ (* t-fade-0 (-> (scratchpad-object foreground-work) regs dist)) t-fade-1)) + (t-amount (fmax 0.0 (fmin 1.0 t-interp))) ) - (let ((tod-rgba (-> *time-of-day-context* current-env-color))) - (if (and (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) - (logtest? (-> dc status) (draw-control-status warp-cross-fade)) + (cond + ((or (nonzero? (-> bucket-info must-use-mercneric-for-clip)) + (or (< 0.0 t-amount) (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade))) + ) + (let ((a0-33 (&-> tint-info tint)) + (v1-74 (the-as object (-> bucket-info effect effect-idx))) + ) + (let ((a1-17 (-> *time-of-day-context* current-env-color))) + (if (and (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) + (logtest? (-> dc status) (draw-control-status warp-cross-fade)) + ) + (set! t-amount (* 0.0078125 (the float (- 128 (the-as int (-> dc force-fade)))) t-amount)) + ) + (cond + ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-tod-for-envmap-tint)) + (dotimes (a1-18 3) + (set! (-> (the-as (pointer int8) (&+ (the-as pointer v1-74) a1-18))) + (the int (* t-amount (the float (-> (the-as (pointer uint8) (&+ a0-33 a1-18)) 0)))) + ) ) - (set! envmap-strength (* 0.0078125 (the float (- 128 (the-as int (-> dc force-fade)))) envmap-strength)) + ) + (else + (let ((f0-7 (* 0.0078125 t-amount))) + (dotimes (a2-27 3) + (set! (-> (the-as (pointer int8) (&+ (the-as pointer v1-74) a2-27))) + (the int (* f0-7 (-> a1-17 data a2-27) (the float (-> (the-as (pointer uint8) (&+ a0-33 a2-27)) 0)))) + ) + ) + ) + ) + ) ) + (set! (-> (the-as merc-effect-bucket-info v1-74) alpha) (the-as uint 128)) + ) + ;(format 0 "envmap stat: ~A ~A~%" (-> dc process name) (logtest? (-> geo effect effect-idx effect-bits) (effect-bits emerc))) (cond - ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-tod-for-envmap-tint)) - (dotimes (a1-18 3) - (set! (-> envmap-rgba-out a1-18) - (the-as - uint - (min 255 (the int (* envmap-strength (the float (-> (the-as (pointer uint8) (&+ envmap-tint a1-18)) 0))))) - ) - ) - ) + ((and (logtest? (-> dc status) (draw-control-status force-vu1)) + (logtest? (-> geo effect effect-idx effect-bits) (effect-bits emerc)) + ) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 1)) + (set! (-> (scratchpad-object foreground-work) regs emerc-used) (the-as uint 1)) ) (else - (let ((envmap-rgba-multiplier (* 0.0078125 envmap-strength))) - (dotimes (a2-26 3) - (set! (-> envmap-rgba-out a2-26) - (the-as - uint - (min - 255 - (the int - (* envmap-rgba-multiplier - (-> tod-rgba data a2-26) - (the float (-> (the-as (pointer uint8) (&+ envmap-tint a2-26)) 0)) - ) - ) - ) - ) - ) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) + (if (logtest? (-> dc status) (draw-control-status force-fade)) + (set! (-> bucket-info light fade-int) (-> dc force-fade)) ) - ) ) ) + + (set! (-> bucket-info effect effect-idx ignore-alpha) + (the-as uint (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) + 1 + 0 + ) + ) + ) ) - (set! (-> envmap-rgba-out 3) (the-as uint 128)) - ) + ((logtest? (-> dc status) (draw-control-status force-fade)) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) + (set! (-> bucket-info effect effect-idx ignore-alpha) + (the-as uint (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) + 1 + 0 + ) + ) + ) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) + (set! (-> bucket-info light fade-int) (-> dc force-fade)) + ) + (else + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 0)) + (set! (-> bucket-info effect effect-idx ignore-alpha) (the-as uint 1)) + (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 1)) + ) + ) + ) + ) ;; end if envmap + + (else (cond - ((and (logtest? (-> dc status) (draw-control-status force-vu1)) - (logtest? (-> geo effect effect-idx effect-bits) (effect-bits emerc)) - ) - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 1)) - (set! (-> (scratchpad-object foreground-work) regs emerc-used) (the-as uint 1)) + ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) + ) + ((or (logtest? (-> dc status) (draw-control-status force-fade)) + (nonzero? (-> bucket-info must-use-mercneric-for-clip)) + ) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) + (if (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 1)) + ) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) ) (else - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) - (if (logtest? (-> dc status) (draw-control-status force-fade)) - (set! (-> bucket-info light fade-int) (-> dc force-fade)) - ) + (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 0)) + (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 1)) ) ) (set! (-> bucket-info effect effect-idx ignore-alpha) - (the-as uint (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) - 1 - 0 - ) - ) - ) - ) - ((logtest? (-> dc status) (draw-control-status force-fade)) - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) - (set! (-> bucket-info effect effect-idx ignore-alpha) - (the-as uint (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) - 1 - 0 - ) - ) + (the-as + uint + (if (or (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) + (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) + ) + 1 + 0 + ) + ) ) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) - (set! (-> bucket-info light fade-int) (-> dc force-fade)) ) - (else - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 0)) - (set! (-> bucket-info effect effect-idx ignore-alpha) (the-as uint 1)) - (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 1)) + ) + (set! effect-mask (shr effect-mask 1)) + ) + ) + + ;; reassign for PC. For the most part, we reassign everything to merc. The exceptions are: + ;; - "warp" effect is on: this special effect isn't supported by PC merc + ;; - "death" effect is on: this requires the renderer to return transformed vertices. + ;; - using the warp bucket. - there's no merc warp bucket, so we have to use generic here. + ;; NOTE: we don't listen to force-mercneric because I believe we handle this case correctly + ;; in extract_merc.cpp by checking the trans bit. This can be enabled, but texture uploads + ;; for at least water aren't hooked up to the PC texture system. + (when (or (nonzero? (-> (scratchpad-object foreground-work) regs mercneric-used)) + (nonzero? (-> (scratchpad-object foreground-work) regs emerc-used)) + ) + + ;; technically we should use generic for ripple query, but the only user is dark eco, + ;; which doesn't actually do anything with the result of the query. + (when #t ;;(not (and (-> dc ripple) (-> dc ripple query))) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) 0) + (set! (-> (scratchpad-object foreground-work) regs emerc-used) 0) + (set! (-> (scratchpad-object foreground-work) regs merc-used) 1) + (dotimes (effect-idx (the-as int (-> geo header effect-count))) + (cond + ((or (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) + (logtest? (-> geo effect effect-idx effect-bits) (effect-bits force-mercneric)) + (= (-> geo effect effect-idx texture-index) (tpage-category warp)) + (nonzero? (-> dc death-timer)) + ) + + ; (if (logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) + ; (format *stdcon* "[fg] ~S to generic 1~%" (-> dc process name)) + ; ) + ; (if (= (-> geo effect effect-idx texture-index) (tpage-category warp)) + ; (format *stdcon* "[fg] ~S to generic 2~%" (-> dc process name)) + ; ) + ; (if (nonzero? (-> dc death-timer)) + ; (format *stdcon* "[fg] ~S to generic 3~%" (-> dc process name)) + ; ) + (set! (-> bucket-info effect effect-idx merc-path) 2) + (set! (-> (scratchpad-object foreground-work) regs mercneric-used) 1) ) - ) - ) - ) - (else - (cond - ((logtest? (-> geo effect effect-idx effect-bits) (effect-bits cross-fade)) - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) - ) - ((or (logtest? (-> dc status) (draw-control-status force-fade)) - (nonzero? (-> bucket-info must-use-mercneric-for-clip)) - ) - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 2)) - (if (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) - (set! (-> bucket-info effect effect-idx disable-envmap) (the-as uint 1)) - ) - (set! (-> (scratchpad-object foreground-work) regs mercneric-used) (the-as uint 1)) - ) - (else - (set! (-> bucket-info effect effect-idx merc-path) (the-as uint 0)) - (set! (-> (scratchpad-object foreground-work) regs merc-used) (the-as uint 1)) + (else + (set! (-> bucket-info effect effect-idx merc-path) 0) + ) + ) + + (when (logtest? (-> geo effect effect-idx effect-usage) 1) + (set! (-> bucket-info effect effect-idx ignore-alpha) 1) ) ) - (set! (-> bucket-info effect effect-idx ignore-alpha) - (the-as - uint - (if (or (logtest? (-> geo effect effect-idx effect-bits) (effect-bits ignore-alpha)) - (logtest? (-> dc global-effect) (draw-control-global-effect disable-envmap)) - ) - 1 - 0 - ) - ) - ) ) ) - (set! effect-mask (shr effect-mask 1)) - ) - ) - ;; TODO reassign for PC! - (when (nonzero? (-> (scratchpad-object foreground-work) regs mercneric-used)) - (if (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic)) - (set! dma-ptr (foreground-generic-merc dc (the-as pointer dma-ptr) 0)) - ) - ) - (if (-> dc shadow) - (set! dma-ptr - (foreground-shadow dc (-> (scratchpad-object foreground-work) regs mtxs) (the-as pointer dma-ptr)) - ) - ) - (when (nonzero? (-> (scratchpad-object foreground-work) regs merc-used)) - (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask merc)) - (let ((fade-amount 0) - (fade-enable #f) + (when (nonzero? (-> (scratchpad-object foreground-work) regs mercneric-used)) + (if (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic)) + (set! dma-ptr (foreground-generic-merc dc dma-ptr 0)) ) - (cond - ((logtest? (-> geo effect 0 effect-bits) (effect-bits no-fade-out)) - (set! fade-enable #f) - ) - ((logtest? (-> dc status) (draw-control-status force-fade)) - (set! fade-amount (the-as int (-> dc force-fade))) - (set! fade-enable #t) - ) - ((= (-> dc cur-lod) (-> dc lod-set max-lod)) - (let ((dist-until-gone - (- (-> dc lod-set lod (-> dc cur-lod) dist) (-> (scratchpad-object foreground-work) regs dist)) - ) - ) - (if (< dist-until-gone 81920.0) - (set! fade-enable #t) - ) - (set! fade-amount (the int (* 0.0015625 dist-until-gone))) - ) - ) + ) + (if (-> dc shadow) + (set! dma-ptr (foreground-shadow dc (-> (scratchpad-object foreground-work) regs mtxs) dma-ptr)) ) - (when fade-enable - (let ((v1-164 (min 128 (max 0 fade-amount))) - (a0-90 (-> bucket-info light)) + (when (nonzero? (-> (scratchpad-object foreground-work) regs merc-used)) + (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask merc)) + (let ((merc-fade-int 0) + (fade-enable #f) + ) + (cond + ((logtest? (-> geo effect 0 effect-bits) (effect-bits no-fade-out)) + (set! fade-enable #f) + ) + ((logtest? (-> dc status) (draw-control-status force-fade)) + (set! merc-fade-int (the-as int (-> dc force-fade))) + (set! fade-enable #t) + ) + ((= (-> dc cur-lod) (-> dc lod-set max-lod)) + (let ((dist-until-gone + (- (-> dc lod-set lod (-> dc cur-lod) dist) (-> (scratchpad-object foreground-work) regs dist)) + ) + ) + (if (< dist-until-gone 81920.0) + (set! fade-enable #t) + ) + (set! merc-fade-int (the int (* 0.0015625 dist-until-gone))) + ) + ) + ) + (when fade-enable + (let ((v1-159 (min 128 (max 0 merc-fade-int))) + (a0-84 (-> bucket-info light)) + ) + (set! (-> a0-84 fade-flags) (the-as uint 0.00000000000000000000000000000000000000000014)) + (set! (-> a0-84 fade-int) (the-as uint v1-159)) ) - (set! (-> a0-90 fade-flags) (the-as uint 0.00000000000000000000000000000000000000000014)) - (set! (-> a0-90 fade-int) (the-as uint v1-164)) + ) ) + + ;; added + (set! dma-ptr (pc-draw-bones dc dma-ptr (the pointer (-> (scratchpad-object foreground-work) regs mtxs)))) + + ; (if (nonzero? (-> bucket-info need-mercprime-if-merc)) + ; (set! dma-ptr (foreground-merc dc (-> (scratchpad-object foreground-work) regs mtxs) dma-ptr 32 17 bucket-info)) + ; (set! dma-ptr (foreground-merc dc (-> (scratchpad-object foreground-work) regs mtxs) dma-ptr 35 20 bucket-info)) + ; ) ) ) - (if (nonzero? (-> bucket-info need-mercprime-if-merc)) - (set! dma-ptr - (foreground-merc - dc - (-> (scratchpad-object foreground-work) regs mtxs) - (the-as pointer dma-ptr) - 32 - 17 - bone-flags - ) - ) - (set! dma-ptr - (foreground-merc - dc - (-> (scratchpad-object foreground-work) regs mtxs) - (the-as pointer dma-ptr) - 35 - 20 - bone-flags - ) - ) + ) + (when (nonzero? (-> (scratchpad-object foreground-work) regs emerc-used)) + (if (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask emerc)) + (set! dma-ptr (foreground-emerc dc (-> (scratchpad-object foreground-work) regs mtxs) dma-ptr 29 19 bflags)) ) ) - ) - ) - (when (nonzero? (-> (scratchpad-object foreground-work) regs emerc-used)) - (if (logtest? (vu1-renderer-mask emerc) (-> *display* vu1-enable-user)) - (set! dma-ptr - (foreground-emerc - dc - (-> (scratchpad-object foreground-work) regs mtxs) - (the-as pointer dma-ptr) - 29 - 19 - bone-flags - ) + (when (nonzero? (-> dc death-timer)) + (when (not (paused?)) + (+! (-> dc death-timer) -1) + (if (>= (the-as uint 1) (-> dc death-timer)) + (send-event (-> dc process) 'death-end dc) ) + ) ) + ) ) - (when (nonzero? (-> dc death-timer)) - (b! (paused?) cfg-131 :delay (empty-form)) - (+! (-> dc death-timer) -1) - (if (>= (the-as uint 1) (-> dc death-timer)) - (send-event (-> dc process) 'death-end dc) - ) + (let ((v1-186 (logand (the-as int dma-ptr) 48))) + 0 + (b! (zero? v1-186) cfg-128 :delay (set! a0-92 (the-as uint #x20000000))) + ;; (s.q! (the-as object dma-ptr) a0-92) + (set! (-> (the (pointer uint128) dma-ptr) 0) (the uint128 a0-92)) + + (let ((a0-93 (the-as object dma-ptr))) + (set! dma-ptr (the-as pointer (+ (- (the-as int dma-ptr) (the-as uint v1-186)) 64))) + ;; (s.w! (+ a0-93 4) (the-as int dma-ptr)) + (set! (-> (the (pointer int32) (+ (the-as uint a0-93) 4))) (the-as int dma-ptr)) + ) ) + (label cfg-128) + (set! (-> (scratchpad-object foreground-work) regs dma-buf base) + (the-as pointer (logand (the-as int dma-ptr) #xfffffff)) + ) ) ) - (label cfg-131) - (let ((v1-190 (logand (the-as int dma-ptr) 48))) - 0 - (b! (zero? v1-190) cfg-133 :delay (set! a0-100 (the-as uint #x20000000))) - ;; (s.q! dma-ptr a0-100) - (set! (-> (the (pointer uint128) dma-ptr) 0) (the uint128 a0-100)) - - (let ((a0-101 dma-ptr)) - (set! dma-ptr (+ (- (the-as int dma-ptr) (the-as uint v1-190)) 64)) - ;; (s.w! (+ a0-101 4) (the-as int dma-ptr)) - (set! (-> (the (pointer int32) (+ (the-as uint a0-101) 4))) (the-as int dma-ptr)) - ) - ) - (label cfg-133) - (set! (-> (scratchpad-object foreground-work) regs dma-buf base) - (the-as pointer (logand (the-as int dma-ptr) #xfffffff)) - ) ) ) + 0 + (none) ) - ) - 0 - (none) - ) ) -;; ERROR: function was not converted to expressions. Cannot decompile. - (kmemopen global "foreground-engine") (define *foreground* (new 'global 'foreground-globals)) diff --git a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc index 20c6274386..ea38e67e7c 100644 --- a/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc +++ b/goal_src/jak3/engine/gfx/generic/lightning/lightning-new-h.gc @@ -7,3 +7,136 @@ ;; DECOMP BEGINS +(deftype lightning-appearance (structure) + ((base-alpha float) + (width-range-start float) + (width-range-end float) + (tex-id uint32) + (blend-mode uint64) + (fade-time time-frame) + (regenerate-time-start time-frame) + (regenerate-time-end time-frame) + (alpha-1-curve curve2d-fast) + (alpha-1-mode uint64) + (alpha-1-repeat-dist float) + (alpha-2-curve curve2d-fast) + (alpha-2-mode uint64) + (alpha-2-repeat-dist float) + (width-curve curve2d-fast) + (width-mode uint64) + (width-repeat-dist float) + (uv-repeat-dist float) + (uv-shift? symbol) + (uv-shift-speed time-frame) + (use-sprite-bucket? symbol :offset 128) + (use-accurate-interp? symbol) + ) + ) + + +(deftype lightning-span-internal (structure) + ((index int16) + (span-flags uint8) + (num-inner-points int8) + ) + :pack-me + ) + + +(deftype lightning-span (structure) + ((random-offset-size-start float) + (inner-random-offset-size float) + ) + :pack-me + ) + + +(deftype lightning-spans-array (inline-array-class) + ((data lightning-span :inline :dynamic) + ) + ) + + +(set! (-> lightning-spans-array heap-base) (the-as uint 8)) + +(deftype lightning-spans-internal-array (inline-array-class) + ((data lightning-span-internal :inline :dynamic) + ) + ) + + +(set! (-> lightning-spans-internal-array heap-base) (the-as uint 4)) + +(deftype tex-u-holder (structure) + ((uu float) + (last-dist float) + ) + ) + + +(deftype lightning-bolt (basic) + ((current-points vector-array) + (desired-points vector-array) + (span-pts-start vector-array) + (spans lightning-spans-array) + (spans-internal lightning-spans-internal-array) + (strip1 prim-strip) + (strip2 prim-strip) + (inner-point-travel-time time-frame) + (start-fade-time time-frame) + (new-inner-point-generate-time time-frame) + (last-generate-time time-frame) + (base-width float) + (current-uv-shift float) + (current-fade-scalar float) + (fractal-reduction float) + (appearance lightning-appearance) + (fade-mode uint64) + (generate-mode uint64) + (snap-inner-points? symbol) + (span-data int8 2) + (num-active-spans int8 :overlay-at (-> span-data 0)) + (num-spans int8 :overlay-at (-> span-data 1)) + (base-color rgba) + ) + (:methods + (lightning-bolt-method-9 (_type_ int int lightning-appearance) none) + (lightning-bolt-method-10 () none) + (lightning-bolt-method-11 (_type_) none) + (lightning-bolt-method-12 (_type_) none) + (lightning-bolt-method-13 (_type_ int) none) + (lightning-bolt-method-14 (_type_) int) + (lightning-bolt-method-15 () none) + (lightning-bolt-method-16 () none) + (lightning-bolt-method-17 () none) + (lightning-bolt-method-18 () none) + (lightning-bolt-method-19 () none) + (lightning-bolt-method-20 () none) + (lightning-bolt-method-21 () none) + (lightning-bolt-method-22 () none) + ) + ) + + +(deftype lightning-new-tracker (process) + ((bolt lightning-bolt) + (lifetime time-frame) + (state-time time-frame) + ) + (:methods + (lightning-new-tracker-method-14 () none) + (lightning-new-tracker-method-15 () none) + ) + ) + + +(deftype lightning-tracker-init-params (structure) + ((appearance lightning-appearance) + (start-pt vector :inline) + (end-pt vector :inline) + (lifetime time-frame) + (num-inner-points int8) + (inner-random-offset-size float) + (random-offset-size-start float) + ) + ) diff --git a/goal_src/jak3/engine/gfx/mood/mood-tables.gc b/goal_src/jak3/engine/gfx/mood/mood-tables.gc index 5dd7cc39e4..bdd6911002 100644 --- a/goal_src/jak3/engine/gfx/mood/mood-tables.gc +++ b/goal_src/jak3/engine/gfx/mood/mood-tables.gc @@ -5,6 +5,10 @@ ;; name in dgo: mood-tables ;; dgos: GAME +(define-extern *debug-mood-color-table* mood-color-table) +(define-extern *debug-mood-fog-table* mood-fog-table) +(define-extern print-mood-tables (function none)) + ;; DECOMP BEGINS (define *no-cloud-haze-mood-fog-table* diff --git a/goal_src/jak3/engine/gfx/mood/time-of-day-h.gc b/goal_src/jak3/engine/gfx/mood/time-of-day-h.gc index 78c80e0886..e6a90c3f5c 100644 --- a/goal_src/jak3/engine/gfx/mood/time-of-day-h.gc +++ b/goal_src/jak3/engine/gfx/mood/time-of-day-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: time-of-day-h ;; dgos: GAME +(define-extern time-of-day-setup (function symbol symbol)) + ;; +++time-of-day-palette-id (defenum time-of-day-palette-id :type uint32 diff --git a/goal_src/jak3/engine/gfx/mood/time-of-day.gc b/goal_src/jak3/engine/gfx/mood/time-of-day.gc index 5895d8951e..39b886fe7b 100644 --- a/goal_src/jak3/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak3/engine/gfx/mood/time-of-day.gc @@ -5,5 +5,12 @@ ;; name in dgo: time-of-day ;; dgos: GAME +(define-extern time-of-day-effect (function none)) +(define-extern *overide-mood-color-table* mood-color-table) ;; +(define-extern *overide-mood-fog-table* mood-fog-table) ;; + ;; DECOMP BEGINS +(defun time-of-day-setup ((arg0 symbol)) + #f + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/mood/weather-part.gc b/goal_src/jak3/engine/gfx/mood/weather-part.gc index 6256c79bd0..3ea80fb100 100644 --- a/goal_src/jak3/engine/gfx/mood/weather-part.gc +++ b/goal_src/jak3/engine/gfx/mood/weather-part.gc @@ -5,5 +5,15 @@ ;; name in dgo: weather-part ;; dgos: GAME +;; stubs +(defun update-rain ((a0 float) (a1 vector) (a2 vector)) + (none) + ) + +(defun update-snow ((a0 float) (a1 vector) (a2 vector)) + (none) + ) + + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/gfx/shrub/shrubbery.gc b/goal_src/jak3/engine/gfx/shrub/shrubbery.gc index 4d42112777..6826a846a0 100644 --- a/goal_src/jak3/engine/gfx/shrub/shrubbery.gc +++ b/goal_src/jak3/engine/gfx/shrub/shrubbery.gc @@ -11,6 +11,58 @@ ;; DECOMP BEGINS +(defun pc-add-shrub-vis-mask ((dma-buf dma-buffer) (lev level)) + "Add data so Proto.cpp can disable drawing for disabled protos." + (let ((packet (the-as dma-packet (-> dma-buf base)))) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (set! (-> dma-buf base) (the pointer (&+ packet 16))) + + (let ((lev-trees (-> lev bsp drawable-trees)) + (data-ptr (the (pointer uint8) (-> dma-buf base))) + ) + (dotimes (tree-idx (-> lev-trees length)) + (let ((tree (-> lev-trees data tree-idx))) + (when (= (-> tree type) drawable-tree-instance-shrub) + (let* ((shrub-tree (the drawable-tree-instance-shrub tree)) + (protos (-> shrub-tree info prototype-inline-array-shrub)) + ) + (dotimes (i (-> protos length)) + (let ((proto (-> protos data i))) + (when (logtest? (-> proto flags) (prototype-flags visible)) + ;; invisible! + ;; (format 0 "invis: ~A~%" (-> proto name)) + (let ((src (-> proto name data))) + (while (nonzero? (-> src)) + (set! (-> data-ptr) (-> src)) + (&+! src 1) + (&+! data-ptr 1) + ) + (set! (-> data-ptr) 0) + (&+! data-ptr 1) + ) + ) + ) + ) + ) + ) + ) + ) + ;; align + (while (nonzero? (logand data-ptr #xf)) + (set! (-> data-ptr) 0) + (&+! data-ptr 1) + ) + (set! (-> packet dma) (new 'static 'dma-tag + :id (dma-tag-id cnt) + :qwc (/ (&- data-ptr (-> dma-buf base)) 16)) + ) + (set! (-> dma-buf base) data-ptr) + #f + ) + ) + ) + (defmethod login ((this billboard)) "Initialize the object after it is loaded." (adgif-shader-login (-> this flat)) @@ -245,7 +297,8 @@ this ) -(define shrub-vu1-block (new 'static 'vu-function :length #x26a :qlength #x135)) +;; og:preserve-this +(define shrub-vu1-block (new 'static 'vu-function #|:length #x26a :qlength #x135|#)) (defun shrub-num-tris ((arg0 shrubbery)) "Get the number of triangles in this shrubbery." @@ -888,18 +941,38 @@ (let ((v1-24 (-> *display* frames (-> *display* on-screen) global-buf))) (when (nonzero? (-> arg0 length)) (let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf base))) - (start-profiling! (-> *perf-stats* data (perf-stat-bucket inst-shrub))) - (draw-inline-array-instance-shrub - v1-24 - (&+ (-> arg0 data 0) 32) - (-> (the-as drawable-group (-> arg0 data 0)) length) - s4-0 - ) - (stop-profiling! (-> *perf-stats* data (perf-stat-bucket inst-shrub))) + ;; (start-profiling! (-> *perf-stats* data (perf-stat-bucket inst-shrub))) + ;; (draw-inline-array-instance-shrub + ;; v1-24 + ;; (&+ (-> arg0 data 0) 32) + ;; (-> (the-as drawable-group (-> arg0 data 0)) length) + ;; s4-0 + ;; ) + ;; (stop-profiling! (-> *perf-stats* data (perf-stat-bucket inst-shrub))) - (start-profiling! (-> *perf-stats* data (perf-stat-bucket proto-shrub))) - (draw-prototype-inline-array-shrub s5-0 s4-0) - (stop-profiling! (-> *perf-stats* data (perf-stat-bucket proto-shrub))) + ;; (start-profiling! (-> *perf-stats* data (perf-stat-bucket proto-shrub))) + ;; (draw-prototype-inline-array-shrub s5-0 s4-0) + ;; (stop-profiling! (-> *perf-stats* data (perf-stat-bucket proto-shrub))) + + ;; og:preserve-this PC port shrub drawing + (with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf)) + (-> (new 'static 'array bucket-id 10 + (bucket-id shrub-l0-shrub) + (bucket-id shrub-l1-shrub) + (bucket-id shrub-l2-shrub) + (bucket-id shrub-l3-shrub) + (bucket-id shrub-l4-shrub) + (bucket-id shrub-l5-shrub) + (bucket-id shrub-l6-shrub) + (bucket-id shrub-l7-shrub) + (bucket-id shrub-l8-shrub) + (bucket-id shrub-l9-shrub) + ) + *draw-index* + )) + (add-pc-tfrag3-data buf (-> *level* draw-level *draw-index*)) + (pc-add-shrub-vis-mask buf (-> *level* draw-level *draw-index*)) + ) (let ((v1-33 *dma-mem-usage*)) (when (nonzero? v1-33) (set! (-> v1-33 length) (max 28 (-> v1-33 length))) diff --git a/goal_src/jak3/engine/gfx/sky/sky-h.gc b/goal_src/jak3/engine/gfx/sky/sky-h.gc index a0414130b3..cdb846fc7a 100644 --- a/goal_src/jak3/engine/gfx/sky/sky-h.gc +++ b/goal_src/jak3/engine/gfx/sky/sky-h.gc @@ -197,7 +197,7 @@ (sky-work-method-9 () none) (sky-work-method-10 () none) (sky-work-method-11 () none) - (sky-work-method-12 () none) + (update-time-and-speed (_type_ float float) none) (sky-work-method-13 () none) (draw (_type_) none) (sky-work-method-15 () none) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc index 344221d1c6..02b8e6cda3 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-h.gc @@ -7,6 +7,9 @@ (declare-type sprite-vec-data-2d structure) +(define-extern sp-get-particle (function sparticle-system int sparticle-launch-state sparticle-cpuinfo)) +(define-extern kill-all-particles-with-key (function sparticle-launch-control none)) + ;; +++sp-cpuinfo-flag (defenum sp-cpuinfo-flag :bitfield #t @@ -71,6 +74,7 @@ (friction float) (timer int32) (flags sp-cpuinfo-flag) + (flags-s32 int32 :overlay-at flags) (user-int32 int32) (user-uint32 uint32 :overlay-at user-int32) (user-float float :overlay-at user-int32) @@ -126,6 +130,9 @@ There are separate systems for different modes of sprite rendering: 2D/billboard (vecdata-table pointer) (adgifdata-table (inline-array adgif-shader)) ) + (:methods + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) + ) ) (define-extern sp-kill-particle (function sparticle-system sparticle-cpuinfo symbol)) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc index 8db83bcd46..1cdc86651c 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -533,13 +533,13 @@ particle system itself. This type just holds the launching-related state." (data sparticle-launch-state :inline :dynamic) ) (:methods - (sparticle-launch-control-method-14 () none) - (sparticle-launch-control-method-15 () none) + (initialize (_type_ sparticle-launch-group process-drawable) none) + (is-visible? (_type_ vector) symbol) (spawn (_type_ vector) object) - (sparticle-launch-control-method-17 (_type_ matrix) none) - (sparticle-launch-control-method-18 (_type_ cspace) none) + (spawn-from-mat (_type_ matrix) none) + (spawn-from-cspace (_type_ cspace) none) (kill-particles (_type_) none) - (sparticle-launch-control-method-20 (_type_ float) none) + (set-local-space-info (_type_ particle-local-space-info) none) ) ) @@ -555,8 +555,8 @@ particle system itself. This type just holds the launching-related state." ) (:methods (new (symbol type sparticle-system sparticle-launcher float) _type_) - (sparticle-subsampler-method-9 () none) - (sparticle-subsampler-method-10 (_type_ matrix) none) + (init-with-vec! (_type_ vector) vector) + (init-with-mat! (_type_ matrix) matrix) ) ) @@ -598,3 +598,4 @@ particle system itself. This type just holds the launching-related state." (define-extern sp-launch-particles-var (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)) (define-extern *part-id-table* (array sparticle-launcher)) (define-extern *part-group-id-table* (array sparticle-launch-group)) +(define-extern sparticle-set-conerot (function sparticle-launcher vector none)) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc index 1b9e04e11f..0c77e5063a 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -33,14 +33,2744 @@ ) ) -(define-extern sparticle-2d-spline-align-instant (function object sparticle-cpuinfo sprite-vec-data-2d object none)) -(define-extern rot-to-particle (function degrees sprite-vec-data-2d matrix none)) - ;; DECOMP BEGINS -;; TODO: stub - (kmemopen global "part-tables") - (define *part-id-table* (new 'global 'boxed-array sparticle-launcher 5500)) - (define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1700)) - (define *sp-temp* 0.0) - (kmemclose) \ No newline at end of file +;; WARN: Return type mismatch int vs sparticle-launcher. + +(kmemopen global "part-tables") + +(define *part-id-table* (new 'global 'boxed-array sparticle-launcher 5500)) + +(define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1700)) + +(define *sp-temp* 0.0) + +(kmemclose) + +(defun lookup-part-group-by-name ((arg0 string)) + (let* ((s5-0 *part-group-id-table*) + (s4-0 (-> s5-0 length)) + ) + (dotimes (s3-0 s4-0) + (let ((s2-0 (-> s5-0 s3-0))) + (if (and (nonzero? s2-0) (string= arg0 (-> s2-0 name))) + (return s2-0) + ) + ) + ) + ) + (the-as sparticle-launch-group #f) + ) + +;; WARN: Return type mismatch (pointer sparticle-launch-group) vs (pointer object). +(defun lookup-part-group-pointer-by-name ((arg0 string)) + (let* ((s4-0 *part-group-id-table*) + (s3-0 (-> s4-0 length)) + ) + (dotimes (gp-0 s3-0) + (let ((v1-2 (-> s4-0 gp-0))) + (if (and (nonzero? v1-2) (string= arg0 (-> v1-2 name))) + (return (the-as (pointer object) (&+ (-> s4-0 data) (* gp-0 4)))) + ) + ) + ) + ) + (the-as (pointer sparticle-launch-group) #f) + ) + +(defun part-group-pointer? ((arg0 pointer)) + (let ((v1-0 *part-group-id-table*)) + (and (>= (the-as int arg0) (the-as int (-> v1-0 data))) (< (the-as int arg0) (the-as int (&-> v1-0 1700)))) + ) + ) + +(defun unlink-part-group-by-heap ((arg0 kheap)) + (let* ((v1-0 *part-group-id-table*) + (a2-0 (-> v1-0 length)) + (a1-0 (-> arg0 base)) + (a0-1 (-> arg0 top-base)) + ) + (while (nonzero? a2-0) + (+! a2-0 -1) + (let ((a3-2 (-> v1-0 a2-0))) + (when (and (>= (the-as int a3-2) (the-as int a1-0)) (< (the-as int a3-2) (the-as int a0-1))) + (set! (-> v1-0 a2-0) (the-as sparticle-launch-group 0)) + 0 + ) + ) + ) + ) + 0 + ) + +(def-mips2c sp-init-fields! (function (pointer float) (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol (inline-array sp-field-init-spec))) + +(deftype sp-queued-launch-particles (structure) + ((sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (pos vector :inline) + ) + ) + + +(deftype sp-launch-queue (basic) + ((in-use int32) + (queue sp-queued-launch-particles 256 :inline) + ) + ) + + +(kmemopen global "launcher-queue") + +(define *sp-launcher-lock* #f) + +(define *sp-launch-queue* (new 'global 'sp-launch-queue)) + +(define *sp-launcher-enable* #t) + +(kmemclose) + +(defun particle-setup-adgif ((arg0 adgif-shader) (arg1 int)) + (let ((a1-1 (lookup-texture-by-id-fast (the-as texture-id arg1))) + (s5-0 #f) + ) + (when (not a1-1) + (set! a1-1 (get-texture common-white common)) + (set! s5-0 #t) + ) + (set! (-> arg0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> arg0 tex0 tfx) 0) + (adgif-shader<-texture! arg0 a1-1) + (set! (-> arg0 prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 prims 3) (the-as gs-reg64 (logior arg1 20))) + (set! (-> arg0 prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 clamp-reg) (gs-reg64 zbuf-1)) + (set! (-> arg0 prims 9) (gs-reg64 alpha-1)) + (if s5-0 + (logior! (-> arg0 link-test) (link-test-flags backup-sprite-tex)) + ) + ) + (set! (-> arg0 alpha) (new 'static 'gs-miptbp :tbp1 #x44)) + (set! (-> arg0 clamp) (new 'static 'gs-clamp :minu #x13 :minv #x101)) + 0 + (none) + ) + +(deftype particle-adgif-cache (basic) + ((used int32) + (last uint16) + (lastgif adgif-shader) + (tidhash uint16 80) + (spadgif adgif-shader 80 :inline) + ) + ) + + +(kmemopen global "part-adgif-cache") + +(define *particle-adgif-cache* (new 'global 'particle-adgif-cache)) + +(set! (-> *particle-adgif-cache* used) 0) + +(kmemclose) + +(defun particle-adgif-cache-flush () + (set! (-> *particle-adgif-cache* used) 0) + (set! (-> *particle-adgif-cache* last) (the-as uint 0)) + 0 + (none) + ) + +(def-mips2c particle-adgif (function adgif-shader texture-id none)) + +;; ERROR: Bad vector register dependency: vf16 +;; ERROR: Bad vector register dependency: vf17 +;; ERROR: Bad vector register dependency: vf18 +;; ERROR: Bad vector register dependency: vf19 +;; ERROR: Bad vector register dependency: vf20 +(defun particle-adgif-callback ((arg0 adgif-shader) (arg1 texture-id)) + (local-vars (v1-0 float)) + (rlet ((vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf20 :class vf) + ) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (let ((s4-0 (-> arg0 alpha)) + (s3-0 (-> arg0 clamp)) + ) + ;; og:preserve-this + ; (.svf (&-> s5-0 0 quad) vf16) + ; (.svf (&-> s5-0 1 quad) vf17) + ; (.svf (&-> s5-0 2 quad) vf18) + ; (.svf (&-> s5-0 3 quad) vf19) + ; (.svf (&-> s5-0 4 quad) vf20) + (particle-adgif arg0 arg1) + (set! (-> arg0 alpha) s4-0) + (set! (-> arg0 clamp) s3-0) + ) + ;; og:preserve-this + ; (.lvf vf16 (&-> s5-0 0 quad)) + ; (.lvf vf17 (&-> s5-0 1 quad)) + ; (.lvf vf18 (&-> s5-0 2 quad)) + ; (.lvf vf19 (&-> s5-0 3 quad)) + ; (.lvf vf20 (&-> s5-0 4 quad)) + ) + (.mov v1-0 vf20) + 0 + (none) + ) + ) + +(defun sp-queue-launch ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 matrix)) + (let ((v1-0 *sp-launch-queue*)) + (when (= (-> v1-0 in-use) 256) + (format 0 "ERROR: sp-launch-particles called during processing, and queue is full~%") + (return 0) + ) + (let ((a3-5 (-> v1-0 queue (-> v1-0 in-use)))) + (set! (-> a3-5 sp-system) arg0) + (set! (-> a3-5 sp-launcher) arg1) + (set! (-> a3-5 pos quad) (-> arg2 trans quad)) + ) + (let ((v0-1 (+ (-> v1-0 in-use) 1))) + (set! (-> v1-0 in-use) v0-1) + v0-1 + ) + ) + ) + +(defun sp-adjust-launch ((arg0 sparticle-launchinfo) + (arg1 sparticle-cpuinfo) + (arg2 (inline-array sp-field-init-spec)) + (arg3 matrix) + (arg4 symbol) + ) + (let ((s2-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (sp-init-fields! + (the-as (pointer float) (-> s2-0 rvec)) + arg2 + (sp-field-id launch-fields-start) + (sp-field-id launch-fields-end) + #t + ) + (matrix-rotate-xyz! s5-0 (-> s2-0 rvec)) + (vector3s-matrix*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (matrix-rotate-xyz! s5-0 (-> s2-0 uvec)) + (vector3s-matrix*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (matrix*! s5-0 s5-0 arg3) + (set-vector! s0-0 0.0 (-> s2-0 fvec w) 0.0 1.0) + (vector-matrix*! s0-0 s0-0 s5-0) + (+! (-> arg0 launchrot x) (-> s0-0 x)) + (+! (-> arg0 launchrot y) (-> s0-0 y)) + (+! (-> arg0 launchrot z) (-> s0-0 z)) + ) + (when (logtest? (sp-cpuinfo-flag set-conerot) (-> arg1 flags)) + (let ((f0-10 (vector-length (-> arg3 rvec))) + (f1-3 (vector-length (-> arg3 uvec))) + (f2-0 (vector-length (-> arg3 fvec))) + ) + (set! (-> arg0 launchrot w) (* (-> arg0 launchrot w) f0-10)) + (set! (-> arg0 conerot w) (* (-> arg0 conerot w) f1-3)) + (set! (-> arg1 vel-sxvel w) (* (-> arg1 vel-sxvel w) f0-10)) + (set! (-> arg1 rot-syvel w) (* (-> arg1 rot-syvel w) f1-3)) + (set! (-> arg1 vel-sxvel x) (* (-> arg1 vel-sxvel x) f0-10)) + (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) f1-3)) + (set! (-> arg1 vel-sxvel z) (* (-> arg1 vel-sxvel z) f2-0)) + ) + ) + (matrix-rotate-xyz! s5-0 (-> s2-0 fvec)) + (matrix*! s5-0 s5-0 arg3) + (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) + (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (if (not (logtest? (sp-cpuinfo-flag launch-along-z) (-> arg1 flags))) + (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) + ) + (if (logtest? (sp-cpuinfo-flag right-multiply-quat) (-> arg1 flags)) + (set! (-> arg0 conerot y) (+ 16384.0 (vector-y-angle (-> s5-0 fvec)))) + ) + (when arg4 + (let ((s4-1 (new 'stack-no-clear 'euler-angles))) + (matrix->eul s4-1 s5-0 13) + (set! (-> arg0 conerot x) (- (-> arg0 conerot x) (-> s4-1 y))) + (set! (-> arg0 conerot y) (- (-> arg0 conerot y) (-> s4-1 z))) + (set! (-> arg0 conerot z) (- (-> arg0 conerot z) (-> s4-1 x))) + ) + ) + ) + 0 + (none) + ) + +(defun sp-euler-convert ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo)) + (local-vars (v1-1 float) (v1-2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'quaternion)) + ) + (set-vector! a1-1 (-> arg0 conerot x) (-> arg0 conerot y) (-> arg0 conerot z) 1.0) + (quaternion-zxy! s5-0 a1-1) + (cond + ((< (-> s5-0 w) 0.0) + (.lvf vf1 (&-> arg0 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg0 conerot quad) vf1) + (.mov v1-1 vf1) + ) + (else + (.lvf vf1 (&-> arg0 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg0 conerot quad) vf1) + (.mov v1-2 vf1) + ) + ) + ) + (cond + (*sp-60-hz* + (set! (-> arg1 rot-syvel x) (* 5.0 (-> arg1 rot-syvel x))) + (set! (-> arg1 rot-syvel y) (* 5.0 (-> arg1 rot-syvel y))) + (set! (-> arg1 rot-syvel z) (* 5.0 (-> arg1 rot-syvel z))) + ) + (else + (set! (-> arg1 rot-syvel x) (* 6.0 (-> arg1 rot-syvel x))) + (set! (-> arg1 rot-syvel y) (* 6.0 (-> arg1 rot-syvel y))) + (set! (-> arg1 rot-syvel z) (* 6.0 (-> arg1 rot-syvel z))) + ) + ) + (quaternion-zxy! (-> arg1 rotvel3d) (-> arg1 rot-syvel)) + 0 + (none) + ) + ) + +(defun sp-rotate-system ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo) (arg2 transformq)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((a1-1 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 a1-1) + (a0-1 arg2) + (f0-0 (-> a0-1 quat x)) + (f1-0 (-> a0-1 quat y)) + (f2-0 (-> a0-1 quat z)) + ) + (set! (-> v1-0 x) f0-0) + (set! (-> v1-0 y) f1-0) + (set! (-> v1-0 z) f2-0) + (set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion->matrix s5-0 a1-1) + ) + (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) + (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (if (not (logtest? (sp-cpuinfo-flag launch-along-z) (-> arg1 flags))) + (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) + ) + ) + 0 + (none) + ) + +(deftype sp-launch-stack (structure) + ((ra basic) + (dummy0 basic) + (dummy1 basic) + (b-spfic basic) + (r16 uint128) + (r17 uint128) + (r18 uint128) + (pos uint128) + (matrix matrix :inline) + (l-spfic basic) + (birth-info sparticle-birthinfo :inline) + (sprite sprite-vec-data-2d :inline) + (r19 uint128) + (r20 uint128) + (r21 uint128) + (r22 uint128) + ) + ) + + +(def-mips2c sp-launch-particles-var (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)) + +(define *death-adgif* (the-as adgif-shader #f)) + +;; WARN: Function sp-launch-particles-death has a return type of none, but the expression builder found a return statement. +(defun sp-launch-particles-death ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 vector)) + (local-vars (v1-26 float) (v1-28 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf30 :class vf) + (vf31 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf30 (&-> arg2 quad)) + (let ((v1-0 #x437f0000)) + (.mov vf31 v1-0) + ) + (let ((s5-0 (new 'stack-no-clear 'matrix)) + (gp-0 (sp-get-particle arg0 0 (the-as sparticle-launch-state #f))) + ) + (if (not gp-0) + (return 0) + ) + (let* ((a1-2 (-> arg1 init-specs 0)) + (a1-3 (sp-init-fields! + (the-as (pointer float) (-> s5-0 rvec)) + (the-as (inline-array sp-field-init-spec) a1-2) + (sp-field-id sprite-fields-start) + (sp-field-id sprite-fields-end) + #t + ) + ) + ) + (sp-init-fields! (&-> gp-0 omega) a1-3 (sp-field-id cpu-fields-start) (sp-field-id cpu-fields-end) #t) + ) + (set! (-> s5-0 uvec y) 0.0) + (set! (-> s5-0 uvec z) (the float (sar (shl (the int (-> s5-0 uvec z)) 48) 48))) + (.lvf vf4 (&-> s5-0 fvec quad)) + (.lvf vf5 (&-> s5-0 rvec quad)) + (.min.x.vf vf4 vf4 vf31 :mask #b111) + (.add.vf vf5 vf5 vf30 :mask #b111) + (.svf (&-> s5-0 fvec quad) vf4) + (.svf (&-> s5-0 rvec quad) vf5) + (when (not *death-adgif*) + (set! *death-adgif* (new 'static 'adgif-shader)) + (particle-adgif *death-adgif* (new 'static 'texture-id :index #x18 :page #x4)) + (set! (-> *death-adgif* alpha) (new 'static 'gs-miptbp :tbp1 #x48)) + ) + (let ((v1-14 (-> *death-adgif* quad 0 quad))) + (set! (-> gp-0 adgif quad 0 quad) v1-14) + ) + (let ((v1-16 (-> *death-adgif* quad 1 quad))) + (set! (-> gp-0 adgif quad 1 quad) v1-16) + ) + (let ((v1-18 (-> *death-adgif* quad 2 quad))) + (set! (-> gp-0 adgif quad 2 quad) v1-18) + ) + (let ((v1-20 (-> *death-adgif* quad 3 quad))) + (set! (-> gp-0 adgif quad 3 quad) v1-20) + ) + (let ((v1-22 (-> *death-adgif* quad 4 quad))) + (set! (-> gp-0 adgif quad 4 quad) v1-22) + ) + (set! (-> gp-0 clock-index) (the-as uint 8)) + (.lvf vf4 (&-> (-> *time-of-day-context* current-prt-color) quad)) + (.lvf vf5 (&-> s5-0 fvec quad)) + (.lvf vf6 (&-> gp-0 fade quad)) + (.mul.vf vf5 vf5 vf4 :mask #b111) + (.mul.vf vf6 vf6 vf4 :mask #b111) + (.svf (&-> s5-0 fvec quad) vf5) + (.svf (&-> gp-0 fade quad) vf6) + (.mov v1-26 vf6) + (set! (-> gp-0 key) (the-as sparticle-launch-control 0)) + (set! (-> gp-0 binding) #f) + (let ((v1-27 (-> gp-0 sprite))) + (.lvf vf1 (&-> s5-0 rvec quad)) + (.lvf vf2 (&-> s5-0 uvec quad)) + (.lvf vf3 (&-> s5-0 fvec quad)) + (.svf (&-> v1-27 x-y-z-sx quad) vf1) + (.svf (&-> v1-27 flag-rot-sy quad) vf2) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.svf (&-> v1-27 r-g-b-a quad) vf3) + ) + (.mov v1-28 vf3) + (logior! (-> gp-0 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-5)) + (set! (-> gp-0 cache-alpha) (-> s5-0 fvec w)) + ) + 0 + (none) + ) + ) + +(defun sp-clear-queue () + (let ((gp-0 *sp-launch-queue*) + (s5-0 *launch-matrix*) + ) + (when (> (-> gp-0 in-use) 0) + (dotimes (s4-0 (-> gp-0 in-use)) + (let ((v1-4 (-> gp-0 queue s4-0))) + (set! (-> s5-0 trans quad) (-> v1-4 pos quad)) + (launch-particles :system (-> v1-4 sp-system) (-> v1-4 sp-launcher) s5-0 :origin-is-matrix #t) + ) + ) + (set! (-> gp-0 in-use) 0) + 0 + ) + ) + 0 + (none) + ) + +(defun sp-relaunch-setup-fields ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-3d)) + (local-vars + (sv-80 (inline-array sp-field-init-spec)) + (sv-88 sp-cpuinfo-flag) + (sv-96 matrix) + (sv-100 symbol) + (sv-104 symbol) + ) + (set! sv-80 (the-as (inline-array sp-field-init-spec) (-> arg1 init-specs 0))) + (set! sv-88 (logand (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1 sp-cpuinfo-flag-12))) + (set! sv-96 (new 'stack-no-clear 'matrix)) + (set! sv-100 (the-as symbol #f)) + (set! sv-104 (the-as symbol #f)) + (set! (-> arg2 next-launcher) (the-as basic 0)) + (when (nonzero? (-> arg2 key)) + (let ((s3-0 #t)) + (cond + ((logtest? (sp-cpuinfo-flag left-multiply-quat) (-> arg2 flags)) + (quaternion->matrix sv-96 (-> arg2 key proc root quat)) + ) + ((logtest? (-> arg2 key group flags) (sp-group-flag sp12)) + (let* ((v1-17 sv-96) + (a3-1 (-> arg2 key local-space-binding mat-new)) + (a0-5 (-> a3-1 rvec quad)) + (a1-2 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-17 rvec quad) a0-5) + (set! (-> v1-17 uvec quad) a1-2) + (set! (-> v1-17 fvec quad) a2-1) + (set! (-> v1-17 trans quad) a3-2) + ) + ) + (else + (set! s3-0 #f) + ) + ) + (when s3-0 + (matrix-transpose! sv-96 sv-96) + (when (or (get-field-spec-by-id arg1 (sp-field-id spt-accel-x)) + (get-field-spec-by-id arg1 (sp-field-id spt-accel-y)) + (get-field-spec-by-id arg1 (sp-field-id spt-accel-z)) + ) + (set! sv-100 #t) + (vector3s-rotate*! (the-as vector3s (-> arg2 acc)) (the-as vector3s (-> arg2 acc)) sv-96) + ) + (when (or (get-field-spec-by-id arg1 (sp-field-id spt-vel-x)) + (get-field-spec-by-id arg1 (sp-field-id spt-vel-y)) + (get-field-spec-by-id arg1 (sp-field-id spt-vel-z)) + ) + (set! sv-104 #t) + (vector3s-rotate*! (the-as vector3s (-> arg2 vel-sxvel)) (the-as vector3s (-> arg2 vel-sxvel)) sv-96) + ) + (matrix-transpose! sv-96 sv-96) + ) + ) + ) + (cond + ((and (logtest? (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-13)) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag glow))) + ) + (let ((f20-0 (-> arg3 r-g-b-a x)) + (f22-0 (-> arg3 r-g-b-a y)) + (f24-0 (-> arg3 r-g-b-a z)) + (f26-0 (-> arg2 fade x)) + (f28-0 (-> arg2 fade y)) + (f30-0 (-> arg2 fade z)) + ) + (set! (-> arg3 r-g-b-a x) 99999.0) + (set! (-> arg3 r-g-b-a y) 99999.0) + (set! (-> arg3 r-g-b-a z) 99999.0) + (set! (-> arg2 fade x) 99999.0) + (set! (-> arg2 fade y) 99999.0) + (set! (-> arg2 fade z) 99999.0) + (set! sv-80 + (sp-init-fields! + (the-as (pointer float) (-> arg3 x-y-z-sx)) + sv-80 + (sp-field-id sprite-fields-start) + (sp-field-id sprite-fields-end) + #f + ) + ) + (set! sv-80 + (sp-init-fields! (&-> arg2 omega) sv-80 (sp-field-id cpu-fields-start) (sp-field-id cpu-fields-end) #f) + ) + (logior! (-> arg2 flags) sv-88) + (let ((v1-54 (-> *time-of-day-context* current-prt-color))) + (if (= (-> arg3 r-g-b-a x) 99999.0) + (set! (-> arg3 r-g-b-a x) f20-0) + (set! (-> arg3 r-g-b-a x) (* (-> arg3 r-g-b-a x) (-> v1-54 x))) + ) + (if (= (-> arg3 r-g-b-a y) 99999.0) + (set! (-> arg3 r-g-b-a y) f22-0) + (set! (-> arg3 r-g-b-a y) (* (-> arg3 r-g-b-a y) (-> v1-54 y))) + ) + (if (= (-> arg3 r-g-b-a z) 99999.0) + (set! (-> arg3 r-g-b-a z) f24-0) + (set! (-> arg3 r-g-b-a z) (* (-> arg3 r-g-b-a z) (-> v1-54 z))) + ) + (if (= (-> arg2 fade x) 99999.0) + (set! (-> arg2 fade x) f26-0) + (set! (-> arg2 fade x) (* (-> arg2 fade x) (-> v1-54 x))) + ) + (if (= (-> arg2 fade y) 99999.0) + (set! (-> arg2 fade y) f28-0) + (set! (-> arg2 fade y) (* (-> arg2 fade y) (-> v1-54 y))) + ) + (if (= (-> arg2 fade z) 99999.0) + (set! (-> arg2 fade z) f30-0) + (set! (-> arg2 fade z) (* (-> arg2 fade z) (-> v1-54 z))) + ) + ) + ) + ) + (else + (set! sv-80 + (sp-init-fields! + (the-as (pointer float) (-> arg3 x-y-z-sx)) + sv-80 + (sp-field-id sprite-fields-start) + (sp-field-id sprite-fields-end) + #f + ) + ) + (set! sv-80 + (sp-init-fields! (&-> arg2 omega) sv-80 (sp-field-id cpu-fields-start) (sp-field-id cpu-fields-end) #f) + ) + ) + ) + (if sv-100 + (vector3s-rotate*! (the-as vector3s (-> arg2 acc)) (the-as vector3s (-> arg2 acc)) sv-96) + ) + (if sv-104 + (vector3s-rotate*! (the-as vector3s (-> arg2 vel-sxvel)) (the-as vector3s (-> arg2 vel-sxvel)) sv-96) + ) + 0 + 0 + (none) + ) + +(defun sp-relaunch-particle-2d ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d)) + (sp-relaunch-setup-fields arg0 arg1 arg2 (the-as sprite-vec-data-3d arg3)) + (when (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort)) + (set! (-> arg3 r-g-b-a w) 0.0) + (set! (-> arg2 fade w) 0.0) + (logclear! (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-2)) + ) + (when (logtest? (-> arg2 flags) (sp-cpuinfo-flag glow)) + ) + 0 + (none) + ) + +(defun sp-relaunch-particle-3d ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-3d)) + (local-vars (v1-9 float) (v1-10 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 s4-0) + (a2-1 arg3) + (f0-0 (-> a2-1 qx-qy-qz-sy x)) + (f1-0 (-> a2-1 qx-qy-qz-sy y)) + (f2-0 (-> a2-1 qx-qy-qz-sy z)) + ) + (set! (-> v1-0 x) f0-0) + (set! (-> v1-0 y) f1-0) + (set! (-> v1-0 z) f2-0) + (set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (set! (-> arg3 qx-qy-qz-sy x) 0.0) + (set! (-> arg3 qx-qy-qz-sy y) 0.0) + (set! (-> arg3 qx-qy-qz-sy z) 0.0) + (sp-relaunch-setup-fields arg0 arg1 arg2 arg3) + (let* ((a1-1 (-> arg2 flags-s32)) + (v1-1 -2) + ;; og:preserve-this + (a0-1 (the-as uint (-> arg3 r-g-b-a x))) + (a1-2 (logand a1-1 #x4000)) + ) + 1 + (let ((a1-3 (sar a1-2 14))) + (set! (-> arg3 r-g-b-a x) (the-as float (logior (logand a0-1 (the-as uint v1-1)) a1-3))) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (set-vector! a1-4 (-> arg3 qx-qy-qz-sy x) (-> arg3 qx-qy-qz-sy y) (-> arg3 qx-qy-qz-sy z) 1.0) + (quaternion-zxy! s3-0 a1-4) + (if (logtest? (sp-cpuinfo-flag left-multiply-quat) (-> arg2 flags)) + (quaternion*! s3-0 s4-0 s3-0) + ) + (cond + ((< (-> s3-0 w) 0.0) + (.lvf vf1 (&-> arg3 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s3-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg3 qx-qy-qz-sy quad) vf1) + (.mov v1-9 vf1) + ) + (else + (.lvf vf1 (&-> arg3 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s3-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg3 qx-qy-qz-sy quad) vf1) + (.mov v1-10 vf1) + ) + ) + ) + ) + (cond + (*sp-60-hz* + (set! (-> arg2 rot-syvel x) (* 5.0 (-> arg2 rot-syvel x))) + (set! (-> arg2 rot-syvel y) (* 5.0 (-> arg2 rot-syvel y))) + (set! (-> arg2 rot-syvel z) (* 5.0 (-> arg2 rot-syvel z))) + ) + (else + (set! (-> arg2 rot-syvel x) (* 6.0 (-> arg2 rot-syvel x))) + (set! (-> arg2 rot-syvel y) (* 6.0 (-> arg2 rot-syvel y))) + (set! (-> arg2 rot-syvel z) (* 6.0 (-> arg2 rot-syvel z))) + ) + ) + (quaternion-zxy! (-> arg2 rotvel3d) (-> arg2 rot-syvel)) + 0 + (none) + ) + ) + +(defmethod initialize ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process-drawable)) + (let ((s5-0 0)) + (set! (-> this group) arg0) + (set! (-> this proc) arg1) + (set! (-> this local-clock) 0) + (set! (-> this local-space-binding) (the-as particle-local-space-info 1.0)) + (set! (-> this matrix) 0) + (set! (-> this last-spawn-frame) + (the-as int (+ (-> *display* real-frame-clock integral-frame-counter) (seconds -0.007))) + ) + (set! (-> this last-spawn-time) 0) + (if (logtest? (-> this group flags) (sp-group-flag sp4)) + (quaternion->matrix (-> this origin) (-> arg1 root quat)) + (matrix-identity! (-> this origin)) + ) + (when (logtest? (-> arg0 flags) (sp-group-flag sp6)) + (let ((f0-1 (-> arg0 rotate-x)) + (f1-0 (-> arg0 rotate-y)) + (f2-0 (-> arg0 rotate-z)) + (t9-2 matrix-rotate-xyz!) + (a0-3 (new 'stack-no-clear 'matrix)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) f0-1) + (set! (-> a1-2 y) f1-0) + (set! (-> a1-2 z) f2-0) + (set! (-> a1-2 w) 1.0) + (let ((a1-3 (t9-2 a0-3 a1-2))) + (matrix*! (-> this origin) a1-3 (-> this origin)) + ) + ) + ) + (when (logtest? (-> arg0 flags) (sp-group-flag sp7)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 x) (-> arg0 scale-x)) + (set! (-> a1-4 y) (-> arg0 scale-y)) + (set! (-> a1-4 z) (-> arg0 scale-z)) + (set! (-> a1-4 w) 1.0) + (set! (-> a1-4 w) 1.0) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) + ) + ) + (dotimes (s3-0 (-> arg0 length)) + (let* ((a0-7 (-> arg0 launcher s3-0)) + (a1-6 (-> *part-id-table* (-> a0-7 launcher))) + (v1-29 (-> this data s5-0)) + ) + (when (nonzero? a1-6) + (set! (-> v1-29 group-item) a0-7) + (cond + ((= (-> a1-6 type) sparticle-launcher) + (set! (-> v1-29 accum) 0.0) + (set! (-> v1-29 spawn-time) (the-as uint (+ (current-time) (seconds -100)))) + (set! (-> v1-29 offset) (the-as uint (-> a0-7 offset))) + (set! (-> v1-29 randomize) (the-as uint 0)) + (cond + ((logtest? (-> a0-7 flags) (sp-group-item-flag sp2)) + (logclear! (-> v1-29 flags) (sp-launch-state-flags sp0)) + (set! (-> v1-29 center) #f) + (set! (-> v1-29 sprite3d) #f) + (set! (-> v1-29 sprite) #f) + ) + (else + (logior! (-> v1-29 flags) (sp-launch-state-flags sp0)) + (set! (-> v1-29 center) (-> this origin trans)) + (set! (-> v1-29 sprite3d) #f) + (set! (-> v1-29 sprite) #f) + ) + ) + (+! s5-0 1) + ) + (else + (format 0 "initialize called with non-particle-launcher~%") + ) + ) + ) + ) + ) + (set! (-> this length) s5-0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs sparticle-launch-control. +(defmethod create-launch-control ((this sparticle-launch-group) (arg0 process)) + (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) + (when (zero? (the-as sparticle-launch-control gp-0)) + (go process-drawable-art-error "memory") + (set! gp-0 0) + (goto cfg-4) + ) + (initialize (the-as sparticle-launch-control gp-0) this (the-as process-drawable arg0)) + (label cfg-4) + (the-as sparticle-launch-control gp-0) + ) + ) + +(defmethod kill-particles ((this sparticle-launch-control)) + (countdown (v1-0 (-> this length)) + (let ((a0-4 (-> this data v1-0))) + (logclear! (-> a0-4 flags) (sp-launch-state-flags sp1)) + ) + ) + (set! (-> this local-clock) 0) + (set! (-> this local-space-binding) (the-as particle-local-space-info 1.0)) + (kill-all-particles-with-key this) + (if (> (-> this matrix) 0) + (sprite-release-user-hvdf (-> this matrix)) + ) + 0 + (none) + ) + +(defmethod clear-2 ((this sparticle-launch-control)) + "Set length to 0" + (kill-all-particles-with-key this) + 0 + (none) + ) + +(defmethod is-visible? ((this sparticle-launch-control) (arg0 vector)) + (let* ((v1-0 (-> this group)) + (f0-0 (-> v1-0 bounds r)) + ) + (cond + ((= f0-0 0.0) + #t + ) + ((nonzero? (-> this matrix)) + #t + ) + (else + (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) + (set! (-> s5-1 w) f0-0) + (when (or *display-sprite-marks* + *display-sprite-spheres* + (and *display-actor-vis* (= (-> this proc) *debug-actor*)) + ) + (add-debug-sphere + *display-sprite-spheres* + (bucket-id debug) + s5-1 + (-> s5-1 w) + (new 'static 'rgba :g #xff :a #x80) + ) + (add-debug-matrix *display-sprite-marks* (bucket-id debug) (-> this origin) (meters 2)) + ) + (sphere-in-view-frustum? (the-as sphere s5-1)) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch particle-local-space-info vs none. +(defmethod set-local-space-info ((this sparticle-launch-control) (arg0 particle-local-space-info)) + (set! (-> this local-space-binding) arg0) + (none) + ) + +(defun execute-particle-local-space-engine ((arg0 int)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (let* ((gp-0 *part-local-space-engine*) + (v1-2 (-> gp-0 alive-list next0)) + (s5-0 (-> (the-as connection v1-2) next0)) + ) + (while (!= v1-2 (-> gp-0 alive-list-end)) + ((the-as (function object) (-> (the-as connection v1-2) param0))) + (set! v1-2 s5-0) + (set! s5-0 (-> (the-as connection s5-0) next0)) + ) + ) + ) + ((= v1-0 1) + (let* ((v1-7 *part-local-space-engine*) + (a1-0 (-> v1-7 alive-list next0)) + (a0-13 (-> (the-as particle-local-space-info a1-0) next0)) + ) + (while (!= a1-0 (-> v1-7 alive-list-end)) + (let* ((a2-0 (-> (the-as particle-local-space-info a1-0) mat-prev)) + (t1-0 (-> (the-as particle-local-space-info a1-0) mat-new)) + (a1-1 (-> t1-0 rvec quad)) + (a3-0 (-> t1-0 uvec quad)) + (t0-0 (-> t1-0 fvec quad)) + (t1-1 (-> t1-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) a1-1) + (set! (-> a2-0 uvec quad) a3-0) + (set! (-> a2-0 fvec quad) t0-0) + (set! (-> a2-0 trans quad) t1-1) + ) + (set! a1-0 a0-13) + (set! a0-13 (-> a0-13 next0)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun local-space-camera ((arg0 particle-local-space-info)) + (let ((s5-0 (math-camera-matrix)) + (gp-0 (-> arg0 mat-new)) + ) + (logior! (-> arg0 flags) (part-local-space-flags pls2)) + (cond + ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) + (matrix-identity! gp-0) + (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + ) + ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) + (let ((a2-0 gp-0) + (v1-7 (-> s5-0 rvec quad)) + (a0-4 (-> s5-0 uvec quad)) + (a1-0 (-> s5-0 fvec quad)) + (a3-0 (-> s5-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-7) + (set! (-> a2-0 uvec quad) a0-4) + (set! (-> a2-0 fvec quad) a1-0) + (set! (-> a2-0 trans quad) a3-0) + ) + (set! (-> gp-0 rvec y) 0.0) + (set! (-> gp-0 fvec y) 0.0) + (vector-normalize! (-> gp-0 rvec) 1.0) + (vector-normalize! (-> gp-0 fvec) 1.0) + (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) + ) + (else + (let* ((a2-1 s5-0) + (v1-10 (-> a2-1 rvec quad)) + (a0-8 (-> a2-1 uvec quad)) + (a1-4 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-10) + (set! (-> gp-0 uvec quad) a0-8) + (set! (-> gp-0 fvec quad) a1-4) + (set! (-> gp-0 trans quad) a2-2) + ) + ) + ) + ) + 0 + (none) + ) + +(defun local-space-proc-joint ((arg0 particle-local-space-info)) + (let ((a2-0 (handle->process (-> arg0 hand)))) + (when a2-0 + (let ((s5-0 (-> (the-as process-drawable a2-0) node-list data (the-as int (-> arg0 param1)) bone transform)) + (gp-0 (-> arg0 mat-new)) + ) + (logior! (-> arg0 flags) (part-local-space-flags pls2)) + (cond + ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) + (matrix-identity! gp-0) + (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + ) + ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) + (let ((a2-2 gp-0) + (v1-14 (-> s5-0 rvec quad)) + (a0-4 (-> s5-0 uvec quad)) + (a1-5 (-> s5-0 fvec quad)) + (a3-0 (-> s5-0 trans quad)) + ) + (set! (-> a2-2 rvec quad) v1-14) + (set! (-> a2-2 uvec quad) a0-4) + (set! (-> a2-2 fvec quad) a1-5) + (set! (-> a2-2 trans quad) a3-0) + ) + (set! (-> gp-0 rvec y) 0.0) + (set! (-> gp-0 fvec y) 0.0) + (vector-normalize! (-> gp-0 rvec) 1.0) + (vector-normalize! (-> gp-0 fvec) 1.0) + (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) + ) + (else + (let* ((a2-3 s5-0) + (v1-17 (-> a2-3 rvec quad)) + (a0-8 (-> a2-3 uvec quad)) + (a1-9 (-> a2-3 fvec quad)) + (a2-4 (-> a2-3 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-17) + (set! (-> gp-0 uvec quad) a0-8) + (set! (-> gp-0 fvec quad) a1-9) + (set! (-> gp-0 trans quad) a2-4) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod spawn-from-mat ((this sparticle-launch-control) (arg0 matrix)) + (let* ((a2-0 (-> this origin)) + (a3-0 arg0) + (v1-0 (-> a3-0 rvec quad)) + (a0-1 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-0) + (set! (-> a2-0 uvec quad) a0-1) + (set! (-> a2-0 fvec quad) a1-1) + (set! (-> a2-0 trans quad) a3-1) + ) + (let ((s4-0 (-> this group))) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp6)) + (let ((f0-0 (-> s4-0 rotate-x)) + (f1-0 (-> s4-0 rotate-y)) + (f2-0 (-> s4-0 rotate-z)) + (t9-0 matrix-rotate-xyz!) + (a0-2 (new 'stack-no-clear 'matrix)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) f0-0) + (set! (-> a1-2 y) f1-0) + (set! (-> a1-2 z) f2-0) + (set! (-> a1-2 w) 1.0) + (let ((a1-3 (t9-0 a0-2 a1-2))) + (matrix*! (-> this origin) a1-3 (-> this origin)) + ) + ) + ) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp7)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 x) (-> s4-0 scale-x)) + (set! (-> a1-4 y) (-> s4-0 scale-y)) + (set! (-> a1-4 z) (-> s4-0 scale-z)) + (set! (-> a1-4 w) 1.0) + (set! (-> a1-4 w) 1.0) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) + ) + ) + ) + (spawn this (-> arg0 trans)) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod spawn-from-cspace ((this sparticle-launch-control) (arg0 cspace)) + (let* ((v1-0 (-> this origin)) + (a3-0 (-> arg0 bone transform)) + (a0-2 (-> a3-0 rvec quad)) + (a1-1 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-0 rvec quad) a0-2) + (set! (-> v1-0 uvec quad) a1-1) + (set! (-> v1-0 fvec quad) a2-0) + (set! (-> v1-0 trans quad) a3-1) + ) + (let ((s4-0 (-> this group))) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp6)) + (let ((f0-0 (-> s4-0 rotate-x)) + (f1-0 (-> s4-0 rotate-y)) + (f2-0 (-> s4-0 rotate-z)) + (t9-0 matrix-rotate-xyz!) + (a0-3 (new 'stack-no-clear 'matrix)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) f0-0) + (set! (-> a1-2 y) f1-0) + (set! (-> a1-2 z) f2-0) + (set! (-> a1-2 w) 1.0) + (let ((a1-3 (t9-0 a0-3 a1-2))) + (matrix*! (-> this origin) a1-3 (-> this origin)) + ) + ) + ) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp7)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 x) (-> s4-0 scale-x)) + (set! (-> a1-4 y) (-> s4-0 scale-y)) + (set! (-> a1-4 z) (-> s4-0 scale-z)) + (set! (-> a1-4 w) 1.0) + (set! (-> a1-4 w) 1.0) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) + ) + ) + ) + (spawn this (vector<-cspace! (-> this origin trans) arg0)) + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod spawn ((this sparticle-launch-control) (arg0 vector)) + (with-pp + (set! (-> this origin trans quad) (-> arg0 quad)) + (if (not (or (is-visible? this arg0) + (logtest? (-> this group flags) (sp-group-flag sp1 sp2)) + (and (logtest? (-> this group flags) (sp-group-flag sp2 sp11)) + (not (-> *setting-control* user-current part-bounds-check)) + ) + ) + ) + (return (the-as object 0)) + ) + (when (logtest? (-> this group flags) (sp-group-flag sp12)) + (let* ((v1-18 (-> this origin)) + (a3-0 (-> this local-space-binding mat-prev)) + (a0-5 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-18 rvec quad) a0-5) + (set! (-> v1-18 uvec quad) a1-2) + (set! (-> v1-18 fvec quad) a2-0) + (set! (-> v1-18 trans quad) a3-1) + ) + ) + (let ((s4-0 (the-as int (current-time))) + (s5-0 (-> this last-spawn-time)) + ) + (let ((v1-22 (-> *display* real-frame-clock integral-frame-counter))) + (if (!= v1-22 (+ (-> this last-spawn-frame) 1)) + (set! s5-0 (the-as int (- (the-as time-frame s4-0) (logand (the-as int (-> pp clock sparticle-data x)) 255)))) + ) + ) + (set! (-> this last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) + (set! (-> this last-spawn-time) s4-0) + (when (logtest? (-> this group flags) (sp-group-flag sp0)) + (set! s5-0 (-> this local-clock)) + (+! (-> this local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) + (set! s4-0 (-> this local-clock)) + ) + (let* ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) + (v1-38 1) + (a0-12 *time-of-day*) + ;; og:preserve-this added check + (s3-1 (if (nonzero? *time-of-day*) + (ash v1-38 + (if a0-12 + (-> a0-12 0 hours) + 0 + ) + ) + 0 + ) + ) + ) + (if (nonzero? (-> this matrix)) + (set! f30-0 0.0) + ) + (let ((s2-1 (-> this length))) + (b! #t cfg-102 :delay (nop!)) + (label cfg-26) + (+! s2-1 -1) + (let* ((a3-2 (-> this data s2-1)) + (v1-45 (-> a3-2 group-item)) + (a1-5 (-> *part-id-table* (-> v1-45 launcher))) + ) + (when (and a1-5 (nonzero? a1-5) (logtest? (-> a3-2 flags) (sp-launch-state-flags sp0))) + (let* ((f1-3 (if (!= (-> v1-45 falloff-to) 0.0) + (- 1.0 (/ f30-0 (-> v1-45 falloff-to))) + 1.0 + ) + ) + (f0-5 f1-3) + ) + (let ((a0-24 sparticle-launcher)) + (b! (!= (-> a1-5 type) a0-24) cfg-101 :delay (nop!)) + ) + (b! (not (logtest? (-> v1-45 flags) (sp-group-item-flag sp3))) cfg-49 :delay (nop!)) + (when (not (logtest? (-> a3-2 flags) (sp-launch-state-flags sp1))) + (set! (-> a3-2 spawn-time) (the-as uint s4-0)) + (logior! (-> a3-2 flags) (sp-launch-state-flags sp1)) + (when (< 0.0 f0-5) + (cond + ((logtest? (-> v1-45 flags) (sp-group-item-flag sp7)) + (launch-particles + :system (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + a1-5 + (-> this origin) + :launch-state a3-2 + :launch-control this + :rate f0-5 + :origin-is-matrix #t + ) + ) + (else + (let ((t9-4 sp-launch-particles-var) + (a0-37 (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> a3-2 center quad)) + (t9-4 a0-37 a1-5 a2-5 a3-2 this f0-5) + ) + ) + ) + ) + ) + (b! #t cfg-100 :delay (nop!)) + (label cfg-49) + (when (or (logtest? s3-1 (-> v1-45 hour-mask)) + (not (or (= (-> v1-45 fade-after) 0.0) (< f30-0 (-> v1-45 fade-after)))) + ) + 0 + (goto cfg-100) + ) + (b! (nonzero? (-> v1-45 period)) cfg-66 :delay (empty-form)) + (if (not (logtest? (-> v1-45 flags) (sp-group-item-flag sp6))) + (set! f0-5 (* 0.2 (the float (- s4-0 s5-0)) f0-5)) + ) + (b! #t cfg-88 :delay (nop!)) + (label cfg-66) + 0 + 0 + (let* ((a2-6 (-> v1-45 length)) + (a0-56 (-> v1-45 period)) + (t0-10 (mod (+ (- s5-0 (the-as int (-> this data s2-1 offset))) a0-56) (the-as int a0-56))) + (a0-57 (mod (the-as uint (+ (- s4-0 (the-as int (-> this data s2-1 offset))) a0-56)) a0-56)) + ) + (set! f0-5 (cond + ((and (< t0-10 (the-as int a2-6)) (< (the-as int a0-57) (the-as int a2-6))) + (* 0.2 (the float (- s4-0 s5-0)) f0-5) + ) + ((and (< t0-10 (the-as int a2-6)) (>= (the-as int a0-57) (the-as int a2-6))) + (* 0.2 (the float (- a2-6 (the-as uint t0-10))) f0-5) + ) + ((and (>= t0-10 (the-as int a2-6)) (< (the-as int a0-57) (the-as int a2-6))) + (* 0.2 (the float a0-57) f0-5) + ) + (else + (when (not (logtest? (-> v1-45 flags) (sp-group-item-flag sp1))) + 0 + (goto cfg-100) + ) + (when (< (the-as uint (- s4-0 (the-as int (-> this data s2-1 spawn-time)))) (-> v1-45 period)) + 0 + (goto cfg-100) + ) + (set! (-> this data s2-1 offset) (- (-> v1-45 period) a0-57)) + (* 0.2 (the float (- s4-0 s5-0)) f0-5) + ) + ) + ) + ) + (label cfg-88) + (set! (-> a3-2 spawn-time) (the-as uint s4-0)) + (logior! (-> a3-2 flags) (sp-launch-state-flags sp1)) + (when (< 0.0 f0-5) + (if (logtest? (-> v1-45 flags) (sp-group-item-flag sp6)) + (set! f0-5 f1-3) + ) + (cond + ((logtest? (-> v1-45 flags) (sp-group-item-flag sp7)) + (launch-particles + :system (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + a1-5 + (-> this origin) + :launch-state a3-2 + :launch-control this + :rate f0-5 + :origin-is-matrix #t + ) + ) + (else + (let ((t9-6 sp-launch-particles-var) + (a0-82 (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + (a2-23 *launch-matrix*) + ) + (set! (-> a2-23 trans quad) (-> a3-2 center quad)) + (t9-6 a0-82 a1-5 a2-23 a3-2 this f0-5) + ) + ) + ) + ) + ) + (label cfg-100) + (b! #t cfg-102 :delay (nop!)) + (label cfg-101) + (format 0 "spawn called for non-sparticle-launcher~%") + ) + ) + (label cfg-102) + (b! (nonzero? s2-1) cfg-26 :delay (nop!)) + ) + ) + ) + 0 + ) + ) + +(defun execute-part-engine () + (local-vars (sv-96 sparticle-launcher) (sv-104 int)) + (let ((gp-0 *sp-particle-system-2d*)) + (let* ((s5-0 *part-engine*) + (s4-0 *part-id-table*) + (s3-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'vector)) + (v1-1 (-> s5-0 alive-list next0)) + (s1-0 (-> v1-1 next0)) + ) + (while (!= v1-1 (-> s5-0 alive-list-end)) + (let* ((a0-2 (the-as process-drawable (-> (the-as connection v1-1) param1))) + (a1-0 (-> a0-2 draw)) + (s0-0 (the-as object (-> (the-as connection v1-1) param3))) + ) + (when (and (logtest? (-> a1-0 status) (draw-control-status on-screen)) + (< (-> a1-0 distance) (-> (the-as vector s0-0) w)) + ) + (set! sv-96 (-> s4-0 (-> (the-as connection v1-1) param2))) + (set! sv-104 (the-as int (-> (the-as connection v1-1) param0))) + (when (nonzero? sv-96) + (let ((a1-8 (-> a0-2 node-list data sv-104))) + (let* ((v1-7 s3-0) + (t0-0 (-> a1-8 bone transform)) + (a0-5 (-> t0-0 rvec quad)) + (a2-2 (-> t0-0 uvec quad)) + (a3-0 (-> t0-0 fvec quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-7 rvec quad) a0-5) + (set! (-> v1-7 uvec quad) a2-2) + (set! (-> v1-7 fvec quad) a3-0) + (set! (-> v1-7 trans quad) t0-1) + ) + (vector<-cspace! (-> s3-0 trans) a1-8) + ) + (set! (-> s2-0 quad) (-> (the-as vector s0-0) quad)) + (set! (-> s2-0 w) 1.0) + (vector-matrix*! (-> s3-0 trans) s2-0 s3-0) + (launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t) + ) + ) + ) + (set! v1-1 s1-0) + (set! s1-0 (-> s1-0 next0)) + ) + ) + (let* ((s5-1 (camera-pos)) + (v1-12 1) + (a0-14 *time-of-day*) + ;; og:preserve-this added check + (s4-1 (if (nonzero? *time-of-day*) + (ash v1-12 + (if a0-14 + (-> a0-14 0 hours) + 0 + ) + ) + 0 + ) + ) + ) + (dotimes (s3-1 (-> *level* length)) + (let ((v1-16 (-> *level* level s3-1))) + (when (= (-> v1-16 status) 'active) + (let ((s2-1 (-> v1-16 part-engine))) + (when s2-1 + (countdown (s1-1 (-> s2-1 length)) + (let ((s0-1 (-> s2-1 data s1-1))) + (when (and (or (zero? (-> s0-1 param3)) + ;; og:preserve-this + (< (vector-vector-distance s5-1 (the-as vector (&-> s0-1 param0))) (the-as float (-> s0-1 param3))) + ) + (not (logtest? s4-1 (the-as int (-> s0-1 prev1)))) + ) + (let ((a1-14 (-> s0-1 next1)) + (t9-5 sp-launch-particles-var) + (a0-25 gp-0) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> (the-as vector (&-> s0-1 param0)) quad)) + (t9-5 + a0-25 + (the-as sparticle-launcher a1-14) + a2-5 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun sparticle-track-root ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-3 (-> arg1 key proc root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + 0 + (none) + ) + +(defun sparticle-track-root-prim ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-4 (-> (the-as collide-shape (-> arg1 key proc root)) root-prim prim-core))) + (set! (-> arg2 x) (-> v1-4 world-sphere x)) + (set! (-> arg2 y) (-> v1-4 world-sphere y)) + (set! (-> arg2 z) (-> v1-4 world-sphere z)) + ) + 0 + (none) + ) + +(defun sparticle-track-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-1 (-> arg1 key proc)) + (a1-1 (the int (-> arg1 user-float))) + (v1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1))) + ) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + 0 + (none) + ) + +(defun sparticle-turn-to-vel ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-1 float) (v1-2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (+ 32768.0 (vector-y-angle (-> arg1 vel-sxvel)))) + (cond + ((< (-> gp-0 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-1 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-2 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +(defun sparticle-rotate-to-vel-3d ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) (arg3 vector)) + (local-vars (v1-9 float) (v1-10 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (let ((s4-0 (-> arg1 key proc))) + (vector-normalize! s5-0 1.0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (v1-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-4 x) (-> arg2 x-y-z-sx x)) + (set! (-> v1-4 y) (-> arg2 x-y-z-sx y)) + (set! (-> v1-4 z) (-> arg2 x-y-z-sx z)) + (set! (-> v1-4 w) 1.0) + (let ((s3-1 (vector-! s3-0 v1-4 (-> s4-0 root trans))) + (s2-0 (new 'stack-no-clear 'matrix)) + ) + (cond + (#t + (set! (-> s3-1 y) 0.0) + (vector-rotate-around-y! s3-1 s3-1 16384.0) + (vector-normalize! s3-1 1.0) + (matrix-r-f-compose s2-0 s5-0 s3-1 arg3) + ) + (else + (matrix-r-f-compose s2-0 s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat)) arg3) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (matrix->quaternion s5-1 s2-0) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-9 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-10 vf1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defun birth-func-clean ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when *display-capture-mode* + (set! (-> arg1 timer) 0) + 0 + ) + 0 + (none) + ) + +(defun birth-func-process-clock ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg1 clock-index) (the-as uint (-> *kernel-context* current-process clock index))) + 0 + (none) + ) + +(defun birth-func-copy-rot-color ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-5 float) (v1-6 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion-rotate-y! s4-0 s4-0 (-> s5-0 sprite flag-rot-sy z)) + (let ((v1-4 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-4 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-4 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + (else + (.lvf vf1 (&-> v1-4 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-4 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a x) (-> s5-0 sprite r-g-b-a x)) + (set! (-> arg2 r-g-b-a y) (-> s5-0 sprite r-g-b-a y)) + (set! (-> arg2 r-g-b-a z) (-> s5-0 sprite r-g-b-a z)) + ) + 0 + (none) + ) + ) + +(define *global-toggle* 0) + +(defun birth-func-copy2-rot-color ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-18 float) (v1-19 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (let ((a1-1 (new-stack-vector0))) + (set! (-> a1-1 y) (-> s5-0 sprite flag-rot-sy z)) + (set! (-> a1-1 z) (if (logtest? *global-toggle* 1) + (the float (sar (shl (the int (- 16384.0 (-> s5-0 sprite x-y-z-sx w))) 48) 48)) + (the float (sar (shl (the int (+ 16384.0 (-> s5-0 sprite x-y-z-sx w))) 48) 48)) + ) + ) + (quaternion-zxy! s4-0 a1-1) + ) + (let ((v1-17 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-17 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-17 qx-qy-qz-sy quad) vf1) + (.mov v1-18 vf1) + ) + (else + (.lvf vf1 (&-> v1-17 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-17 qx-qy-qz-sy quad) vf1) + (.mov v1-19 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a x) (-> s5-0 sprite r-g-b-a x)) + (set! (-> arg2 r-g-b-a y) (-> s5-0 sprite r-g-b-a y)) + (set! (-> arg2 r-g-b-a z) (-> s5-0 sprite r-g-b-a z)) + ) + (set! *global-toggle* (+ *global-toggle* 1)) + 0 + (none) + ) + ) + +(defun birth-func-copy-omega-to-z ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg2 qx-qy-qz-sy z) (+ -16384.0 (-> arg1 omega))) + (set! (-> arg1 next-time) (-> arg4 sprite next-time)) + (set! (-> arg2 x-y-z-sx w) (* 163.85638 (the float (-> arg4 sprite next-time)))) + 0 + (none) + ) + +(defun birth-func-random-next-time ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg1 next-time) (the-as uint (the int (rand-vu-float-range 0.0 (-> arg1 user-float))))) + 0 + (none) + ) + +(defun sparticle-respawn-heights ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((gp-0 (the-as (array int32) (-> arg1 user-float)))) + (when (and (nonzero? gp-0) + ;; og:preserve-this + (or (and (< (-> arg1 vel-sxvel y) 0.0) (< (-> arg2 y) (the-as float (-> gp-0 1)))) + (and (< 0.0 (-> arg1 vel-sxvel y)) (< (the-as float (-> gp-0 2)) (-> arg2 y))) + ) + ) + (sp-kill-particle arg0 arg1) + (let ((s3-0 (+ (-> gp-0 length) -1))) + (when (< 2 s3-0) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (if (zero? (-> gp-0 0)) + *sp-particle-system-2d* + *sp-particle-system-3d* + ) + ) + ) + (set-vector! s2-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (let ((s5-1 3)) + (while (>= s3-0 s5-1) + (let ((t9-1 sp-launch-particles-var) + (a0-2 s1-0) + (a1-3 (-> *part-id-table* (-> gp-0 s5-1))) + (a2-1 *launch-matrix*) + ) + (set! (-> a2-1 trans quad) (-> s2-0 quad)) + (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (+! s5-1 1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun sparticle-respawn-timer ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (<= (-> arg1 timer) 0) + (let ((gp-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? gp-0) + (sp-kill-particle arg0 arg1) + (let ((s5-0 (+ (-> gp-0 length) -1))) + (when (< 2 s5-0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (if (zero? (-> gp-0 0)) + *sp-particle-system-2d* + *sp-particle-system-3d* + ) + ) + ) + (set-vector! s4-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (let ((s2-1 3)) + (while (>= s5-0 s2-1) + (let ((t9-1 sp-launch-particles-var) + (a0-2 s3-0) + (a1-3 (-> *part-id-table* (-> gp-0 s2-1))) + (a2-1 *launch-matrix*) + ) + (set! (-> a2-1 trans quad) (-> s4-0 quad)) + (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (+! s2-1 1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun sparticle-texture-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? v1-0) + (if (zero? (-> v1-0 2)) + (set! (-> v1-0 2) (-> arg1 timer)) + ) + (let* ((a0-6 (+ (-> v1-0 length) -3)) + (a2-1 (-> v1-0 0)) + (a3-0 (-> v1-0 2)) + (t0-1 (if (< (-> arg1 timer) 0) + (the-as int (-> *display* base-clock frame-counter)) + (- a3-0 (-> arg1 timer)) + ) + ) + ) + (cond + ((zero? (-> v1-0 1)) + (let ((v1-2 + (the-as + (array int32) + (-> (the-as + (array int32) + (+ (* (+ (max 0 (min (+ (/ t0-1 a2-1) (-> arg1 user1-int16)) (+ a0-6 -1))) 3) 4) (the-as int v1-0)) + ) + 0 + ) + ) + ) + ) + (if (nonzero? v1-2) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id v1-2)) + ) + ) + ) + (else + (let ((v1-4 (-> v1-0 (+ (mod (max 0 (+ (/ t0-1 a2-1) (-> arg1 user1-int16))) a0-6) 3)))) + (if (nonzero? v1-4) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id v1-4)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +;; ERROR: Bad vector register dependency: vf1 +;; ERROR: Bad vector register dependency: vf2 +(defun sparticle-texture-day-night ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (local-vars + (v1-9 uint128) + (v1-10 uint128) + (v1-13 uint128) + (v1-14 uint128) + (v1-23 uint128) + (v1-24 uint128) + (v1-27 uint128) + (v1-28 uint128) + (v1-33 float) + (a0-5 float) + (a0-11 float) + (t7-0 int) ;; og:preserve-this float -> int + (t7-3 int) ;; og:preserve-this float -> int + (s3-0 float) + (s4-0 float) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((s2-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? s2-0) + (let* ((v1-1 *time-of-day*) + (s1-0 (if v1-1 + (-> v1-1 0 hours) + 0 + ) + ) + (f0-0 (rand-vu)) + ) + (.mov s4-0 vf1) + (.mov s3-0 vf2) + (cond + ((or (< s1-0 6) (< 18 s1-0)) + (let ((a1-1 (-> s2-0 7))) + (when (nonzero? a1-1) + (let ((v1-6 f0-0)) + (.mov vf2 v1-6) + ) + (let ((v1-8 (the-as uint128 (make-u128 0 (-> s2-0 9))))) + (.pextlb v1-9 0 v1-8) + ) + (.pextlb v1-10 0 v1-9) + (.mov vf1 v1-10) + (.itof.vf vf1 vf1) + (.mul.x.vf vf1 vf1 vf2) + (let ((v1-12 (the-as uint128 (make-u128 0 (-> s2-0 8))))) + (.pextlb v1-13 0 v1-12) + ) + (.pextlb v1-14 0 v1-13) + (.mov vf2 v1-14) + (.itof.vf vf2 vf2) + (.add.vf vf1 vf1 vf2) + (let ((v1-15 (-> arg1 flags-s32))) + (when (nonzero? (-> s2-0 10)) + (.lvf vf2 (&-> *time-of-day-context* current-prt-color quad)) + (.mul.vf vf1 vf1 vf2) + (.mov a0-5 vf1) + ) + (let ((v1-16 (logand v1-15 #x4000))) + (.mov t7-0 vf1) + (let ((v1-17 (sar v1-16 14))) + ;; og:preserve-this + (set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand (the-as uint t7-0) (the-as uint -2)) v1-17))) + ) + ) + ) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1)) + ) + ) + ) + (else + (let ((a1-2 (-> s2-0 3))) + (when (nonzero? a1-2) + (let ((v1-20 f0-0)) + (.mov vf2 v1-20) + ) + (let ((v1-22 (the-as uint128 (make-u128 0 (-> s2-0 5))))) + (.pextlb v1-23 0 v1-22) + ) + (.pextlb v1-24 0 v1-23) + (.mov vf1 v1-24) + (.itof.vf vf1 vf1) + (.mul.x.vf vf1 vf1 vf2) + (let ((v1-26 (the-as uint128 (make-u128 0 (-> s2-0 4))))) + (.pextlb v1-27 0 v1-26) + ) + (.pextlb v1-28 0 v1-27) + (.mov vf2 v1-28) + (.itof.vf vf2 vf2) + (.add.vf vf1 vf1 vf2) + (let ((v1-29 (-> arg1 flags-s32))) + (when (nonzero? (-> s2-0 6)) + (.lvf vf2 (&-> *time-of-day-context* current-prt-color quad)) + (.mul.vf vf1 vf1 vf2) + (.mov a0-11 vf1) + ) + (let ((v1-30 (logand v1-29 #x4000))) + (.mov t7-3 vf1) + (let ((v1-31 (sar v1-30 14))) + ;; og:preserve-this + (set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand (the-as uint t7-3) (the-as uint -2)) v1-31))) + ) + ) + ) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-2)) + ) + ) + ) + ) + ) + (.mov vf1 s4-0) + (.mov vf2 s3-0) + (.mov v1-33 vf2) + ) + ) + (none) + ) + ) + +(defun sparticle-mode-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((a0-1 (-> arg1 key)) + (v1-0 (the-as object (-> arg1 user-float))) + ) + (when (nonzero? (the-as float v1-0)) + (let ((a1-2 (the-as (array uint32) (-> (the-as (array symbol) v1-0) 0 value)))) + (when (nonzero? a1-2) + (let* ((a1-4 (the-as object (-> a1-2 (min (the-as int (+ (-> a0-1 state-mode 0) 1)) (+ (-> a1-2 length) -1))))) + (a0-8 (the-as + object + (-> (the-as (array int32) a1-4) + (+ (mod + (the-as int (/ (-> a0-1 state-counter) (the-as uint (/ (-> (the-as vector4w a1-4) w) 8)))) + (+ (-> (the-as (pointer int32) a1-4) 0) -1) + ) + 1 + ) + ) + ) + ) + (a1-6 (/ (-> (the-as (array int32) v1-0) 1) 8)) + (a2-14 (-> (the-as (pointer int64) a0-8) (/ a1-6 64))) + (a0-11 (logtest? a2-14 (ash 1 (logand a1-6 63)))) + (s4-0 (if a0-11 + (-> (the-as (pointer int32) v1-0) 6) + (-> (the-as (pointer int32) v1-0) 5) + ) + ) + ) + (if a0-11 + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 64.0 192.0)) + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 32.0 48.0)) + ) + (set! (-> arg2 r-g-b-a y) (-> arg2 r-g-b-a x)) + (set! (-> arg2 r-g-b-a z) (-> arg2 r-g-b-a x)) + (if (nonzero? s4-0) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id s4-0)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(def-mips2c sparticle-motion-blur (function sparticle-system sparticle-cpuinfo vector none)) + +;; WARN: Return type mismatch int vs object. +(defun-debug sparticle-motion-blur-old ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector4w)) + (s3-0 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> s2-0 x) (-> arg2 x-y-z-sx x)) + (set! (-> s2-0 y) (-> arg2 x-y-z-sx y)) + (set! (-> s2-0 z) (-> arg2 x-y-z-sx z)) + (set! (-> s2-0 w) 1.0) + (when (and (or (!= (-> arg1 vel-sxvel x) 0.0) (!= (-> arg1 vel-sxvel y) 0.0) (!= (-> arg1 vel-sxvel z) 0.0)) + (transform-point-qword! s5-0 s2-0) + ) + (+! (-> s2-0 x) (* 32.0 (-> arg1 vel-sxvel x))) + (+! (-> s2-0 y) (* 32.0 (-> arg1 vel-sxvel y))) + (+! (-> s2-0 z) (* 32.0 (-> arg1 vel-sxvel z))) + (when (transform-point-qword! s3-0 s2-0) + (let* ((f0-14 (the float (+ (-> s5-0 x) -28672))) + (f1-10 (the float (+ (-> s5-0 y) -29440))) + (f2-4 (the float (+ (-> s3-0 x) -28672))) + (f3-1 (the float (+ (-> s3-0 y) -29440))) + (f30-0 (- f2-4 f0-14)) + (f28-0 (- f3-1 f1-10)) + ) + (set! (-> arg2 qx-qy-qz-sy z) (+ -16384.0 (atan f30-0 f28-0))) + (let ((f0-17 (-> arg1 omega))) + (if (!= f0-17 0.0) + (set! (-> arg2 x-y-z-sx w) (* (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0))) + f0-17 + (lerp-scale 3.0 0.25 (/ 1.0 (the float (-> s5-0 z))) 0.000001 0.00000014285715) + ) + ) + ) + ) + ) + (return (the-as object #f)) + ) + ) + ) + (if (!= (-> arg1 omega) 0.0) + (set! (-> arg2 x-y-z-sx w) 0.0) + ) + 0 + ) + +(defun sparticle-set-conerot ((arg0 sparticle-launcher) (arg1 vector)) + (let ((s5-0 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-x))) + (s4-0 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-y))) + (v1-3 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-z))) + ) + (set! (-> s5-0 initial-valuef) (-> arg1 x)) + (set! (-> s4-0 initial-valuef) (-> arg1 y)) + (set! (-> v1-3 initial-valuef) (-> arg1 z)) + ) + 0 + (none) + ) + +(defun sparticle-next-on-mode-1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (zero? (-> arg1 key state-mode 0)) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + 0.0 + ) + +(defun check-ground-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((f0-1 (+ (-> arg1 key origin trans y) (-> arg1 user-float)))) + (when (and (< (-> arg2 launchrot y) f0-1) (< (-> arg1 vel-sxvel y) 0.0)) + (set! (-> arg2 launchrot y) f0-1) + (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) (- (rand-vu-float-range 0.6 0.8)))) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun check-drop-group-center ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((f0-0 (-> arg1 key origin trans y))) + (if (< (-> arg2 launchrot y) f0-0) + (sp-kill-particle arg0 arg1) + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun check-bubble-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (< (-> arg1 key origin trans y) (-> arg2 launchrot y)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun check-raise-group-center ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (< (-> arg1 key origin trans y) (-> arg2 launchrot y)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +(defun birth-func-y->userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (+! (-> arg1 user-float) (-> arg2 rvec y)) + 0 + (none) + ) + +(defun birth-func-ocean-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (set! (-> arg2 rvec y) (+ (get-height *ocean* (-> arg2 rvec) #t) (-> arg1 user-float))) + 0 + (none) + ) + +(defun birth-func-camera-orient ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-0 float) (v1-1 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-1 + (forward-up-nopitch->quaternion (new 'stack-no-clear 'quaternion) (-> (math-camera-matrix) fvec) *up-vector*) + ) + ) + (quaternion-rotate-x! s5-1 s5-1 16384.0) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-0 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-1 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +(defun birth-func-set-parent-pntr ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg1 user-float) (the-as float (-> arg4 sprite sprite))) + 0 + (none) + ) + +(defun birth-func-get-parent-quat ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((a0-1 (-> arg4 sprite sprite)) + (a1-1 (new 'stack-no-clear 'quaternion)) + ) + (when a0-1 + (let ((v1-2 a1-1) + (f0-0 (-> a0-1 flag-rot-sy x)) + (f1-0 (-> a0-1 flag-rot-sy y)) + (f2-0 (-> a0-1 flag-rot-sy z)) + ) + (set! (-> v1-2 x) f0-0) + (set! (-> v1-2 y) f1-0) + (set! (-> v1-2 z) f2-0) + (set! (-> v1-2 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion->matrix (-> arg4 control origin) a1-1) + ) + ) + 0 + (none) + ) + +(defun spt-func-camera-facing-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + 0.0 + (quaternion<-rotate-y-vector s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> arg1 rotvel3d))) + (let ((f0-2 (- (camera-angle) (quaternion-xz-angle s5-0)))) + (quaternion-rotate-y! (-> arg1 rotvel3d) (-> arg1 rotvel3d) f0-2) + ) + ) + ) + +(define *particle-quat* (new 'static 'quaternion :w 1.0)) + +(defun birth-func-set-quat ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (a0-2 float) (a0-3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 arg2) + (v1-0 *particle-quat*) + ) + (cond + ((< (-> v1-0 w) 0.0) + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-2 vf1) + ) + (else + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-3 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +(define *particle-vel* (new 'static 'vector :w 1.0)) + +(defun birth-func-set-vel ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 *particle-vel*)) + (set! (-> arg1 vel-sxvel x) (-> v1-0 x)) + (set! (-> arg1 vel-sxvel y) (-> v1-0 y)) + (set! (-> arg1 vel-sxvel z) (-> v1-0 z)) + ) + 0 + (none) + ) + +(defun birth-func-texture-group ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? s5-0) + (let* ((s4-0 (+ (-> s5-0 length) -3)) + (v1-3 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) s4-0) 3)) + (a1-1 (-> s5-0 v1-3)) + ) + (set! (-> arg1 user1-int16) (the-as uint (+ v1-3 -3))) + (if (nonzero? a1-1) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1)) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod get-field-spec-by-id ((this sparticle-launcher) (arg0 sp-field-id)) + "Look up a field's init spec by ID number." + (let ((v1-0 0)) + (until #f + (let ((a2-2 (-> this init-specs v1-0 field))) + (cond + ((= a2-2 arg0) + (return (-> this init-specs v1-0)) + ) + ((or (< (the-as uint arg0) (the-as uint a2-2)) (= a2-2 (sp-field-id spt-end))) + (return (the-as sp-field-init-spec #f)) + ) + (else + (+! v1-0 1) + ) + ) + ) + ) + ) + (the-as sp-field-init-spec #f) + ) + +(defmethod setup-special-textures ((this sparticle-launcher) (arg0 string)) + "Set the particle's texture to the texture with the given name, and convert userdata strings to textures." + (let ((s5-0 (get-field-spec-by-id this (sp-field-id spt-texture))) + (v1-1 (lookup-texture-id-by-name arg0 (the-as string #f))) + ) + (if s5-0 + (set! (-> s5-0 initial-valuef) (the-as float v1-1)) + ) + ) + (let ((v1-3 (get-field-spec-by-id this (sp-field-id spt-userdata)))) + (when (and v1-3 (= (-> v1-3 flags) (sp-flag object))) + (let ((gp-1 (the-as (array int32) (-> v1-3 initial-valuef)))) + (when (and (= (logand (the-as int gp-1) 7) 4) (type? gp-1 array) (logtest? (-> gp-1 1) 128)) + (set! (-> gp-1 0) (/ (-> gp-1 0) 8)) + (set! (-> gp-1 1) (/ (logand (-> gp-1 1) 8) 8)) + (set! (-> gp-1 2) (/ (-> gp-1 2) 8)) + (set! (-> gp-1 content-type) int32) + (dotimes (s5-1 (+ (-> gp-1 length) -3)) + (set! (-> gp-1 (+ s5-1 3)) + (the-as int (lookup-texture-id-by-name (the-as string (-> gp-1 (+ s5-1 3))) (the-as string #f))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch degrees vs none. +(defun rot-to-particle ((arg0 degrees) (arg1 sprite-vec-data-2d) (arg2 matrix)) + (logand! (-> arg1 flag) -49) + (let ((v1-4 (the int (* 0.000061035156 (+ 32768.0 arg0))))) + (if (or (zero? v1-4) (= v1-4 3)) + (logior! (-> arg1 flag) 32) + ) + ) + (set! (-> arg1 flag-rot-sy z) arg0) + (none) + ) + +(defun birth-func-flip-based-on-scale ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (< (-> arg2 x-y-z-sx w) 0.0) + (set! (-> arg2 qx-qy-qz-sy x) (the-as float (logior (the-as int (-> arg2 qx-qy-qz-sy x)) 16))) + (set! (-> arg2 x-y-z-sx w) (* -1.0 (-> arg2 x-y-z-sx w))) + ) + (when (< (-> arg2 qx-qy-qz-sy w) 0.0) + (set! (-> arg2 qx-qy-qz-sy x) (the-as float (logior (the-as int (-> arg2 qx-qy-qz-sy x)) 32))) + (set! (-> arg2 qx-qy-qz-sy w) (* -1.0 (-> arg2 qx-qy-qz-sy w))) + ) + 0 + (none) + ) + +(defun sparticle-2d-spline-align ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s3-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s3-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s3-0 w) 1.0) + (let ((f30-0 (-> arg2 flag-rot-sy z))) + (vector-normalize! s3-0 1.0) + (let ((s5-0 deg-seek) + (s4-0 f30-0) + ) + 0.0 + (let ((a0-2 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-7 (vector-dot a0-2 s3-0))) + (vector-float*! v1-1 a0-2 f0-7) + ) + (vector-! s3-0 s3-0 v1-1) + ) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s3-0 s3-0 a2-2) + ) + (let* ((a1-11 (the float (sar (shl (the int (atan (-> s3-0 y) (* -1.0 (-> s3-0 x)))) 48) 48))) + (a2-3 (* 65536.0 (seconds-per-frame))) + (f0-17 (s5-0 s4-0 a1-11 a2-3)) + ) + (rot-to-particle f0-17 arg2 (the-as matrix a2-3)) + ) + ) + ) + ) + 0 + (none) + ) + +(defun sparticle-2d-spline-align-instant ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s5-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s5-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s5-0 w) 1.0) + (-> arg2 flag-rot-sy z) + (vector-normalize! s5-0 1.0) + 0.0 + (let ((a0-2 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-8 (vector-dot a0-2 s5-0))) + (vector-float*! v1-1 a0-2 f0-8) + ) + (vector-! s5-0 s5-0 v1-1) + ) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-0 s5-0 a2-2) + (let ((f0-16 (the float (sar (shl (the int (atan (-> s5-0 y) (* -1.0 (-> s5-0 x)))) 48) 48)))) + (rot-to-particle f0-16 arg2 a2-2) + ) + ) + ) + 0 + (none) + ) + +(defun birth-func-inherit-size ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-1 (-> arg4 sprite sprite))) + (set! (-> arg2 x-y-z-sx w) (* (-> v1-1 x-y-z-sx w) (-> arg2 x-y-z-sx w))) + (set! (-> arg2 qx-qy-qz-sy w) (* (-> v1-1 flag-rot-sy w) (-> arg2 qx-qy-qz-sy w))) + ) + 0 + (none) + ) + +(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (birth-func-texture-group (the-as int arg0) arg1 arg2) + 0 + (none) + ) + +(defun birth-func-set-vel-2d ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 *particle-vel*)) + (set! (-> arg1 vel-sxvel x) (-> v1-0 x)) + (set! (-> arg1 vel-sxvel y) (-> v1-0 y)) + (set! (-> arg1 vel-sxvel z) (-> v1-0 z)) + ) + 0 + (none) + ) + +(defun sparticle-3d-rotate-xz-to-camera ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-4 float) (v1-5 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (-> arg1 key proc) + (let ((a0-1 (math-camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) s5-0 *up-vector*)) + (s5-1 (new 'stack-no-clear 'quaternion)) + ) + (matrix->quaternion s5-1 a1-3) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-4 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod init-with-vec! ((this sparticle-subsampler) (arg0 vector)) + (let ((f30-0 (-> this spt-num))) + (when (not (-> this inited?)) + (set! (-> this spawn-mat trans quad) (-> arg0 quad)) + (set! (-> this inited?) #t) + (set! f30-0 0.000000000000000000000000000000000000000000001) + ) + (set! (-> this sp-launcher birthaccum) 0.0) + (let ((f28-0 (/ 1.0 f30-0))) + 0.0 + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 s4-0) + (a3-0 (-> this spawn-mat)) + (v1-8 (-> a3-0 rvec quad)) + (a0-3 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-8) + (set! (-> a2-0 uvec quad) a0-3) + (set! (-> a2-0 fvec quad) a1-1) + (set! (-> a2-0 trans quad) a3-1) + ) + (dotimes (s3-0 (the int f30-0)) + (let ((f0-5 (* f28-0 (the float s3-0)))) + (vector-lerp! (-> s4-0 trans) arg0 (-> this spawn-mat trans) f0-5) + ) + (launch-particles :system (-> this sp-system) (-> this sp-launcher) s4-0 :origin-is-matrix #t) + ) + ) + ) + ) + (let ((v0-2 (-> this spawn-mat trans))) + (set! (-> v0-2 quad) (-> arg0 quad)) + v0-2 + ) + ) + +(defmethod init-with-mat! ((this sparticle-subsampler) (arg0 matrix)) + (when (not (-> this inited?)) + (let* ((a2-0 (-> this spawn-mat)) + (a3-0 arg0) + (v1-2 (-> a3-0 rvec quad)) + (a0-1 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-2) + (set! (-> a2-0 uvec quad) a0-1) + (set! (-> a2-0 fvec quad) a1-1) + (set! (-> a2-0 trans quad) a3-1) + ) + (set! (-> this inited?) #t) + ) + (set! (-> this sp-launcher birthaccum) 0.0) + (let ((f30-0 (/ 1.0 (-> this spt-num)))) + 0.0 + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-1 s4-0) + (a3-2 arg0) + (v1-6 (-> a3-2 rvec quad)) + (a0-2 (-> a3-2 uvec quad)) + (a1-2 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> a2-1 rvec quad) v1-6) + (set! (-> a2-1 uvec quad) a0-2) + (set! (-> a2-1 fvec quad) a1-2) + (set! (-> a2-1 trans quad) a3-3) + ) + (dotimes (s3-0 (the int (-> this spt-num))) + (let ((f0-5 (* f30-0 (the float s3-0)))) + (vector-lerp! (-> s4-0 trans) (-> arg0 trans) (-> this spawn-mat trans) f0-5) + ) + (launch-particles :system (-> this sp-system) (-> this sp-launcher) s4-0 :origin-is-matrix #t) + ) + ) + ) + (let ((v0-2 (-> this spawn-mat))) + (let ((v1-10 (-> arg0 rvec quad)) + (a0-5 (-> arg0 uvec quad)) + (a1-5 (-> arg0 fvec quad)) + (a2-4 (-> arg0 trans quad)) + ) + (set! (-> v0-2 rvec quad) v1-10) + (set! (-> v0-2 uvec quad) a0-5) + (set! (-> v0-2 fvec quad) a1-5) + (set! (-> v0-2 trans quad) a2-4) + ) + v0-2 + ) + ) + +(defun spt-func-relative-pos ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars + (sv-256 vector) + (sv-260 vector) + (sv-264 vector) + (sv-268 matrix) + (sv-272 matrix) + (sv-276 matrix) + (sv-280 matrix) + (sv-284 matrix) + ) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) (-> arg2 x-y-z-sx x)) + (set! (-> v1-0 y) (-> arg2 x-y-z-sx y)) + (set! (-> v1-0 z) (-> arg2 x-y-z-sx z)) + (set! (-> v1-0 w) 1.0) + (set! sv-256 v1-0) + ) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (set! (-> v1-1 x) (-> arg1 vel-sxvel x)) + (set! (-> v1-1 y) (-> arg1 vel-sxvel y)) + (set! (-> v1-1 z) (-> arg1 vel-sxvel z)) + (set! (-> v1-1 w) 1.0) + (set! sv-260 v1-1) + ) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (set! (-> v1-2 x) (-> arg1 acc x)) + (set! (-> v1-2 y) (-> arg1 acc y)) + (set! (-> v1-2 z) (-> arg1 acc z)) + (set! (-> v1-2 w) 1.0) + (set! sv-264 v1-2) + ) + (set! sv-268 (-> arg1 key local-space-binding mat-prev)) + (set! sv-272 (-> arg1 key local-space-binding mat-new)) + (set! sv-276 (new 'stack-no-clear 'matrix)) + (set! sv-280 (new 'stack-no-clear 'matrix)) + (set! sv-284 (new 'stack-no-clear 'matrix)) + (let* ((a2-1 sv-280) + (a3-0 sv-268) + (v1-12 (-> a3-0 rvec quad)) + (a0-4 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-1 rvec quad) v1-12) + (set! (-> a2-1 uvec quad) a0-4) + (set! (-> a2-1 fvec quad) a1-1) + (set! (-> a2-1 trans quad) a3-1) + ) + (let* ((a2-2 sv-284) + (a3-2 sv-272) + (v1-13 (-> a3-2 rvec quad)) + (a0-5 (-> a3-2 uvec quad)) + (a1-2 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> a2-2 rvec quad) v1-13) + (set! (-> a2-2 uvec quad) a0-5) + (set! (-> a2-2 fvec quad) a1-2) + (set! (-> a2-2 trans quad) a3-3) + ) + (dotimes (s4-0 3) + (vector-normalize! (the-as vector (&-> sv-280 quad s4-0)) 1.0) + (vector-normalize! (the-as vector (&-> sv-284 quad s4-0)) 1.0) + ) + (set! (-> sv-256 w) 1.0) + (set! (-> sv-260 w) 0.0) + (set! (-> sv-264 w) 0.0) + (let ((a1-6 (matrix-inverse-of-rot-trans! (new 'stack-no-clear 'matrix) sv-280))) + (matrix*! sv-276 a1-6 sv-284) + ) + (vector-matrix*! sv-256 sv-256 sv-276) + (set! (-> arg2 x-y-z-sx x) (-> sv-256 x)) + (set! (-> arg2 x-y-z-sx y) (-> sv-256 y)) + (set! (-> arg2 x-y-z-sx z) (-> sv-256 z)) + (-> arg2 x-y-z-sx) + (vector-matrix*! sv-260 sv-260 sv-276) + (set! (-> arg1 vel-sxvel x) (-> sv-260 x)) + (set! (-> arg1 vel-sxvel y) (-> sv-260 y)) + (set! (-> arg1 vel-sxvel z) (-> sv-260 z)) + (-> arg1 vel-sxvel) + (vector-matrix*! sv-264 sv-264 sv-276) + (set! (-> arg1 acc x) (-> sv-264 x)) + (set! (-> arg1 acc y) (-> sv-264 y)) + (set! (-> arg1 acc z) (-> sv-264 z)) + (-> arg1 acc) + 0 + (none) + ) + +(defun spt-func-turn-to-vel-radial ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-5 float) (v1-6 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (let ((s3-0 (-> arg1 key proc))) + (vector-normalize! s5-0 1.0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (v1-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-4 x) (-> arg2 x-y-z-sx x)) + (set! (-> v1-4 y) (-> arg2 x-y-z-sx y)) + (set! (-> v1-4 z) (-> arg2 x-y-z-sx z)) + (set! (-> v1-4 w) 1.0) + (let ((s4-1 (vector-! s4-0 v1-4 (-> s3-0 root trans))) + (s3-1 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-1 y) 0.0) + (vector-rotate-around-y! s4-1 s4-1 16384.0) + (vector-normalize! s4-1 1.0) + (matrix-f-r-compose s3-1 s5-0 s4-1) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (matrix->quaternion s5-1 s3-1) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) diff --git a/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc index 0197a0dce9..7dcd32e7ed 100644 --- a/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak3/engine/gfx/sprite/particles/sparticle.gc @@ -7,3 +7,683 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch object vs sparticle-cpuinfo. +(defmethod print ((this sparticle-cpuinfo)) + (format #t "~%") + (dotimes (s5-0 16) + (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) + ) + (format #t "TIMER:~D~%" (-> this timer)) + (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) + ) + +;; WARN: Return type mismatch (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) vs none. +(defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) + (let ((v1-1 (-> arg1 sprite x-y-z-sx quad))) + (set! (-> arg0 sprite x-y-z-sx quad) v1-1) + ) + (let ((v1-3 (-> arg1 sprite flag-rot-sy quad))) + (set! (-> arg0 sprite flag-rot-sy quad) v1-3) + ) + (let ((v1-5 (-> arg1 sprite r-g-b-a quad))) + (set! (-> arg0 sprite r-g-b-a quad) v1-5) + ) + (dotimes (v1-6 10) + (set! (-> arg0 adgif prims v1-6) (-> arg1 adgif prims v1-6)) + ) + (set! (-> arg0 vel-sxvel quad) (-> arg1 vel-sxvel quad)) + (set! (-> arg0 rot-syvel quad) (-> arg1 rot-syvel quad)) + (set! (-> arg0 fade quad) (-> arg1 fade quad)) + (set! (-> arg0 acc quad) (-> arg1 acc quad)) + (set! (-> arg0 friction) (-> arg1 friction)) + (set! (-> arg0 timer) (-> arg1 timer)) + (set! (-> arg0 flags) (-> arg1 flags)) + (set! (-> arg0 user-float) (-> arg1 user-float)) + (set! (-> arg0 sp-func) (-> arg1 sp-func)) + (none) + ) + +(defmethod new sparticle-system ((allocation symbol) + (type-to-make type) + (arg0 int) + (arg1 int) + (arg2 symbol) + (arg3 pointer) + (arg4 (inline-array adgif-shader)) + ) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let* ((v1-3 (/ (+ arg0 63) 64)) + (a0-2 (/ (+ arg1 63) 64)) + (a1-2 (* v1-3 64)) + (a2-2 (* a0-2 64)) + (s2-1 (+ v1-3 a0-2)) + (s5-1 (+ a1-2 a2-2)) + ) + (set! (-> gp-0 blocks 0) v1-3) + (set! (-> gp-0 length 0) a1-2) + (set! (-> gp-0 num-alloc 0) 0) + (set! (-> gp-0 blocks 1) a0-2) + (set! (-> gp-0 length 1) a2-2) + (set! (-> gp-0 num-alloc 1) 0) + (set! (-> gp-0 is-3d) (the-as basic arg2)) + (set! (-> gp-0 alloc-table) (the-as (pointer uint64) (malloc 'global (* s2-1 8)))) + (set! (-> gp-0 cpuinfo-table) (the-as (inline-array sparticle-cpuinfo) (malloc 'global (* 144 s5-1)))) + (set! (-> gp-0 vecdata-table) arg3) + (set! (-> gp-0 adgifdata-table) arg4) + (dotimes (v1-5 s2-1) + (set! (-> gp-0 alloc-table v1-5) (the-as uint -1)) + ) + (dotimes (s4-1 s5-1) + (set! (-> gp-0 cpuinfo-table s4-1 valid) (the-as uint 0)) + (set! (-> gp-0 cpuinfo-table s4-1 sprite) + (the-as sprite-vec-data-2d (&+ (-> gp-0 vecdata-table) (* 48 s4-1))) + ) + (set! (-> gp-0 cpuinfo-table s4-1 adgif) (-> gp-0 adgifdata-table s4-1)) + (adgif-shader<-texture-simple! (-> gp-0 adgifdata-table s4-1) (the-as texture #f)) + (set! (-> gp-0 adgifdata-table s4-1 alpha) (new 'static 'gs-miptbp :tbp1 #x48)) + ) + ) + gp-0 + ) + ) + +(kmemopen global "part-systems") + +(define *sp-particle-system-2d* + (new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data)) + ) + +(define *sp-particle-system-3d* + (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) + ) + +(kmemclose) + +(defun sp-get-block-size ((arg0 sparticle-system) (arg1 int)) + (let ((v0-0 0)) + (let ((v1-0 0) + (a2-0 (-> arg0 blocks 0)) + ) + (when (= arg1 1) + (set! v1-0 a2-0) + (set! a2-0 (-> arg0 blocks 1)) + ) + (dotimes (a1-3 a2-0) + (if (!= (-> arg0 alloc-table (+ v1-0 a1-3)) -1) + (set! v0-0 (+ a1-3 1)) + ) + ) + ) + v0-0 + ) + ) + +(defun sp-get-approx-alloc-size ((arg0 sparticle-system) (arg1 int)) + (let ((a3-0 arg1) + (v1-0 0) + ) + (let ((a1-1 0) + (a2-0 (-> arg0 blocks 0)) + ) + (when (= a3-0 1) + (set! a1-1 a2-0) + (set! a2-0 (-> arg0 blocks 1)) + ) + (dotimes (a3-3 a2-0) + (if (!= (-> arg0 alloc-table (+ a1-1 a3-3)) -1) + (set! v1-0 (+ a3-3 1)) + ) + ) + ) + (* v1-0 64) + ) + ) + +(defun sp-free-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d)) + (if (and (-> arg2 binding) (nonzero? (-> arg2 binding))) + (logclear! (-> arg2 binding flags) (sp-launch-state-flags sp0 sp1)) + ) + (let ((v1-6 (/ arg1 64)) + (t0-4 (logand arg1 63)) + ) + (logior! (-> arg0 alloc-table v1-6) (ash 1 t0-4)) + ) + (if (< arg1 (-> arg0 length 0)) + (+! (-> arg0 num-alloc 0) -1) + (+! (-> arg0 num-alloc 1) -1) + ) + (set! (-> arg2 valid) (the-as uint 0)) + (set! (-> arg3 r-g-b-a w) 0.0) + 0 + (none) + ) + +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t2, t1] +(defun sp-get-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-launch-state)) + (local-vars + (a2-3 int) + (a2-4 int) + (a2-5 int) + (a2-6 int) + (a2-7 int) + (a2-8 int) + (t1-16 int) + (t1-17 int) + (t1-18 int) + (t1-19 int) + (t1-20 int) + (t3-5 int) + ) + (let ((v1-0 0) + (t0-0 (-> arg0 blocks 0)) + (a3-0 0) + ) + (when (= arg1 1) + (set! v1-0 t0-0) + (set! t0-0 (-> arg0 blocks 1)) + ) + (when arg2 + (set! a3-0 (the-as int (-> arg2 randomize))) + (+! (-> arg2 randomize) 1) + (when (= (-> arg2 randomize) t0-0) + (set! (-> arg2 randomize) (the-as uint 0)) + 0 + ) + ) + (dotimes (a2-1 t0-0) + (when (nonzero? (-> arg0 alloc-table (+ v1-0 a3-0))) + (let ((a2-2 0) + (t1-15 (-> arg0 alloc-table (+ v1-0 a3-0))) + (t0-4 (* (+ v1-0 a3-0) 64)) + ) + 0 + 0 + (let ((t2-4 (shl t1-15 32)) + (t3-0 (+ a2-2 32)) + ) + (move-if-not-zero t1-16 t2-4 t2-4 t1-15) + (.movz a2-3 t3-0 t2-4 a2-2) + ) + (let ((t2-5 (shl t1-16 16)) + (t3-1 (+ a2-3 16)) + ) + (move-if-not-zero t1-17 t2-5 t2-5 t1-16) + (.movz a2-4 t3-1 t2-5 a2-3) + ) + (let ((t2-6 (* t1-17 256)) + (t3-2 (+ a2-4 8)) + ) + (move-if-not-zero t1-18 t2-6 t2-6 t1-17) + (.movz a2-5 t3-2 t2-6 a2-4) + ) + (let ((t2-7 (* t1-18 16)) + (t3-3 (+ a2-5 4)) + ) + (move-if-not-zero t1-19 t2-7 t2-7 t1-18) + (.movz a2-6 t3-3 t2-7 a2-5) + ) + (let ((t2-8 (* t1-19 4)) + (t3-4 (+ a2-6 2)) + ) + (move-if-not-zero t1-20 t2-8 t2-8 t1-19) + (.movz a2-7 t3-4 t2-8 a2-6) + (let ((t1-21 (* t1-20 2)) + (t2-9 (+ a2-7 1)) + ) + (move-if-not-zero t3-5 t1-21 t1-21 t3-4) + (.movz a2-8 t2-9 t1-21 a2-7) + ) + ) + (let ((t0-5 (+ t0-4 a2-8))) + (logxor! (-> arg0 alloc-table (+ v1-0 a3-0)) (the-as uint (ash 1 a2-8))) + (+! (-> arg0 num-alloc arg1) 1) + (let ((v1-9 (-> arg0 cpuinfo-table t0-5))) + (set! (-> v1-9 valid) (the-as uint 1)) + (return v1-9) + ) + ) + ) + ) + (+! a3-0 1) + (if (= a3-0 t0-0) + (set! a3-0 0) + ) + ) + ) + (the-as sparticle-cpuinfo #f) + ) + +(defun sp-kill-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (cond + ;; og:preserve-this + ((in-scratchpad? arg1) + (set! (-> arg1 timer) 0) + 0 + ) + (else + (let ((a2-1 (/ (the-as int (- (the-as uint arg1) (the-as uint (the-as uint (-> arg0 cpuinfo-table 0))))) 144))) + (when (or (< a2-1 0) (>= a2-1 (+ (-> arg0 length 0) (-> arg0 length 1)))) + (format 0 "Tried to release particle ~D~%" a2-1) + (return #f) + ) + (sp-free-particle arg0 a2-1 arg1 (-> arg1 sprite)) + ) + ) + ) + #t + ) + +(defun sp-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((f2-0 (-> arg1 omega)) + (f0-0 (-> arg1 radius)) + (f3-0 (-> arg1 vel-sxvel x)) + (f30-0 (-> arg1 vel-sxvel y)) + (f1-0 (-> arg1 vel-sxvel z)) + (f4-0 (-> *display* clock (-> arg1 clock-index) sparticle-data y)) + (f26-0 (+ f2-0 (* f3-0 f4-0))) + ) + (set! (-> arg1 omega) f26-0) + (let ((f28-0 (+ f0-0 (* f1-0 f4-0)))) + (set! (-> arg1 radius) f28-0) + (let ((f24-0 (sin f26-0)) + (f26-1 (cos f26-0)) + (f22-0 (sin (* 0.5 f30-0))) + (f0-5 (cos (* 0.5 f30-0))) + (a2-1 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'matrix))) + (set-vector! a2-1 (* f22-0 f26-1) 0.0 (* f22-0 f24-0) f0-5) + (quaternion*! (-> arg1 rotvel3d) (-> arg1 rotvel3d) a2-1) + (quaternion-normalize! (-> arg1 rotvel3d)) + (set-vector! s4-0 (* f24-0 f28-0) 0.0 (* f26-1 f28-0) 1.0) + (quaternion->matrix s3-0 (-> arg1 rotvel3d)) + (vector-matrix*! s4-0 s4-0 s3-0) + ) + (let ((v1-8 (the-as sprite-vec-data-2d (-> arg1 user-float)))) + (set! (-> arg2 x) (+ (-> s4-0 x) (-> v1-8 x-y-z-sx x))) + (set! (-> arg2 y) (+ (-> s4-0 y) (-> v1-8 x-y-z-sx y))) + (set! (-> arg2 z) (+ (-> s4-0 z) (-> v1-8 x-y-z-sx z))) + ) + ) + ) + ) + 0 + (none) + ) + +(def-mips2c sp-process-block-2d (function sparticle-system int int int int symbol none)) + +(def-mips2c sp-process-block-3d (function sparticle-system int int int int symbol none)) + +(defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int)) + (let ((a2-1 (/ (+ arg2 15) 16))) + ;; og:preserve-this + ; (dma-send-to-spr-no-flush (the-as uint arg0) (the-as uint arg1) (the-as uint a2-1) #t) + (__mem-move (&+ (scratchpad-start) arg0) arg1 (the uint (* a2-1 16))) + ) + 0 + (none) + ) + +(defun sp-copy-from-spr ((arg0 int) (arg1 pointer) (arg2 int)) + (let ((a2-1 (/ (+ arg2 15) 16))) + ;; og:preserve-this + ; (dma-send-from-spr-no-flush (the-as uint arg1) (the-as uint arg0) (the-as uint a2-1) #t) + (__mem-move arg1 (&+ (scratchpad-start) arg0) (the uint (* a2-1 16))) + ) + 0 + (none) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +(defun sp-process-block ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d) (arg3 int)) + (local-vars (sv-16 int) (sv-32 int) (sv-48 int) (sv-64 int)) + (let ((s3-0 352) + (s2-0 (* 144 arg3)) + (s5-0 (* 48 arg3)) + ) + (set! sv-32 (* 80 arg3)) + (let ((s1-0 (+ s3-0 s2-0))) + (set! sv-16 (+ s1-0 s5-0)) + (sp-copy-to-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0) + (sp-copy-to-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0) + (let ((t9-2 sp-copy-to-spr) + (a1-7 (-> arg0 adgifdata-table arg1)) + ) + (t9-2 sv-16 (the-as pointer a1-7) sv-32) + ) + ;; og:preserve-this + (set! sv-48 (+ (the int (scratchpad-start)) s3-0)) + (set! sv-64 (+ (the int (scratchpad-start)) s1-0)) + (let ((t1-0 (paused?))) + (cond + ((-> arg0 is-3d) + (let ((t9-4 sp-process-block-3d) + (a0-6 arg0) + (a3-1 arg1) + ) + (t9-4 a0-6 sv-48 sv-64 a3-1 arg3 t1-0) + ) + ) + (else + (sp-process-block-2d arg0 sv-48 sv-64 arg1 arg3 t1-0) + ) + ) + ) + (sp-copy-from-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0) + (sp-copy-from-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0) + ) + ) + 0 + (none) + ) + +(defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d)) + (countdown (v1-0 22) + (let ((a0-4 (-> *display* clock v1-0 sparticle-data quad))) + ;; og:preserve-this + (set! (-> (the-as vector (+ (the int (scratchpad-start)) (* v1-0 16))) quad) a0-4) + ) + ) + (let* ((v1-3 352) + (s1-0 (/ (- #x4000 v1-3) 272)) + (s2-0 0) + (s3-0 (sp-get-approx-alloc-size arg0 arg1)) + ) + (if (= arg1 1) + (set! s2-0 (* (-> arg0 blocks 0) 64)) + ) + (set! (-> arg2 num-valid arg1) s3-0) + (flush-cache 0) + (while (>= s3-0 s1-0) + (sp-process-block arg0 s2-0 arg2 s1-0) + (set! s3-0 (- s3-0 s1-0)) + (+! s2-0 s1-0) + ) + (if (> s3-0 0) + (sp-process-block arg0 s2-0 arg2 s3-0) + ) + ) + 0 + (none) + ) + +(define-perm *particles-flag* symbol #t) + +(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control) + (arg1 (function sparticle-system sparticle-cpuinfo none)) + (arg2 sparticle-system) + ) + (local-vars (sv-16 int)) + (let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0))) + (s2-0 (&+ (-> arg2 vecdata-table) 0)) + (s1-0 (+ (-> arg2 blocks 0) (-> arg2 blocks 1))) + ) + (dotimes (s0-0 s1-0) + (cond + ((!= (-> arg2 alloc-table s0-0) -1) + (set! sv-16 0) + (while (< sv-16 64) + (if (and (nonzero? (-> (the-as sparticle-cpuinfo s3-0) valid)) (= (-> (the-as sparticle-cpuinfo s3-0) key) arg0)) + (arg1 arg2 (the-as sparticle-cpuinfo s3-0)) + ) + (set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1)) + (&+! s2-0 48) + (set! sv-16 (+ sv-16 1)) + ) + ) + (else + (set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 64)) + (&+! s2-0 3072) + ) + ) + ) + ) + 0 + (none) + ) + +(defun forall-particles-with-key ((arg0 sparticle-launch-control) + (arg1 (function sparticle-system sparticle-cpuinfo none)) + (arg2 symbol) + (arg3 symbol) + ) + (if arg2 + (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*) + ) + (if arg3 + (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*) + ) + 0 + (none) + ) + +(defun sparticle-kill-it ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (set! (-> arg1 timer) 0) + (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) + (when (and (-> arg1 binding) (nonzero? (-> arg1 binding))) + (logclear! (-> arg1 binding flags) (sp-launch-state-flags sp0 sp1)) + (set! (-> arg1 binding) #f) + ) + 0 + (none) + ) + +(define *sparticle-kill-it-level* 0) + +(defun sparticle-kill-it-level ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (if (= (logand (shr (the-as int (-> arg1 flags)) 9) 15) *sparticle-kill-it-level*) + (sparticle-kill-it arg0 arg1) + ) + 0 + (none) + ) + +(defun sparticle-60-to-50 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (let ((gp-0 (-> arg1 rotvel3d)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-angle<-quaternion! s5-0 gp-0) + (set! (-> s5-0 w) (* 12516.455 (-> s5-0 w))) + (quaternion-vector-angle! gp-0 s5-0 (-> s5-0 w)) + ) + 0 + (none) + ) + +(defun sparticle-50-to-60 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (let ((gp-0 (-> arg1 rotvel3d)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-angle<-quaternion! s5-0 gp-0) + (set! (-> s5-0 w) (* 8691.982 (-> s5-0 w))) + (quaternion-vector-angle! gp-0 s5-0 (-> s5-0 w)) + ) + 0 + (none) + ) + +(defun kill-all-particles-with-key ((arg0 sparticle-launch-control)) + (forall-particles-with-key arg0 sparticle-kill-it #t #t) + 0 + (none) + ) + +(defun forall-particles-runner ((arg0 (function sparticle-system sparticle-cpuinfo pointer none)) (arg1 sparticle-system)) + (let ((s4-0 (the-as object (-> arg1 cpuinfo-table 0))) + (s3-0 (&+ (-> arg1 vecdata-table) 0)) + (s2-0 (+ (-> arg1 blocks 0) (-> arg1 blocks 1))) + ) + (dotimes (s1-0 s2-0) + (cond + ((!= (-> arg1 alloc-table s1-0) -1) + (dotimes (s0-0 64) + (if (nonzero? (-> (the-as sparticle-cpuinfo s4-0) valid)) + (arg0 arg1 (the-as sparticle-cpuinfo s4-0) s3-0) + ) + (set! s4-0 (+ (the-as uint s4-0) 144)) + (&+! s3-0 48) + ) + ) + (else + (set! s4-0 (&+ (the-as pointer s4-0) 9216)) + (&+! s3-0 3072) + ) + ) + ) + ) + 0 + (none) + ) + +(defun forall-particles ((arg0 function) (arg1 symbol) (arg2 symbol)) + (if arg1 + (forall-particles-runner + (the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0) + *sp-particle-system-2d* + ) + ) + (if arg2 + (forall-particles-runner + (the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0) + *sp-particle-system-3d* + ) + ) + 0 + (none) + ) + +(defun kill-all-particles-in-level ((arg0 level)) + (set! *sparticle-kill-it-level* (-> arg0 index)) + (forall-particles sparticle-kill-it-level #t #t) + 0 + ) + +(defun all-particles-50-to-60 () + (forall-particles-runner sparticle-50-to-60 *sp-particle-system-3d*) + (none) + ) + +(defun all-particles-60-to-50 () + (forall-particles-runner sparticle-60-to-50 *sp-particle-system-3d*) + (none) + ) + +;; WARN: Return type mismatch gs-miptbp vs none. +(defun remap-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (let* ((gp-0 (-> arg1 adgif)) + (a0-1 (-> gp-0 texture-id)) + (v1-0 (lookup-texture-by-id-fast a0-1)) + ) + (when v1-0 + (set! (-> gp-0 tex0 tbp0) (-> v1-0 dest 0)) + (set! (-> gp-0 tex0 cbp) (-> v1-0 clutdest)) + (set! (-> gp-0 miptbp1 tbp1) (-> v1-0 dest 1)) + (set! (-> gp-0 miptbp1 tbp2) (-> v1-0 dest 2)) + (set! (-> gp-0 miptbp1 tbp3) (-> v1-0 dest 3)) + ) + ) + (none) + ) + +(defun remap-all-particles () + (forall-particles remap-particle #t #t) + (none) + ) + +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 gp, Count] +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defun process-particles () + (local-vars (v1-53 int) (gp-0 int)) + (with-pp + (when *particles-flag* + 0 + 0 + (.mfc0 gp-0 Count) + (set! *sp-launcher-lock* #t) + (when *debug-segment* + (let ((s5-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-12 'particle) + (s4-0 *profile-particle-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s3-0 (-> s5-0 data (-> s5-0 count)))) + (let ((s2-0 (-> s5-0 base-time))) + (set! (-> s3-0 name) v1-12) + (set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0)))) + ) + (set! (-> s3-0 depth) (the-as uint (-> s5-0 depth))) + (set! (-> s3-0 color) s4-0) + (set! (-> s5-0 segment (-> s5-0 depth)) s3-0) + ) + (set! (-> s5-0 count) (min 1023 (+ (-> s5-0 count) 1))) + (+! (-> s5-0 depth) 1) + (set! (-> s5-0 max-depth) (max (-> s5-0 max-depth) (-> s5-0 depth))) + ) + ) + 0 + ) + (logand (the-as int (-> pp clock sparticle-data x)) 255) + (cond + (*sp-60-hz* + (when (= (-> *setting-control* user-current video-mode) 'pal) + (set! *sp-60-hz* #f) + (all-particles-60-to-50) + ) + ) + (else + (when (= (-> *setting-control* user-current video-mode) 'ntsc) + (set! *sp-60-hz* #t) + (all-particles-50-to-60) + ) + ) + ) + (clear-sprite-aux-list) + (sp-process-particle-system *sp-particle-system-2d* 0 *sprite-array-2d*) + (sp-process-particle-system *sp-particle-system-2d* 1 *sprite-array-2d*) + (sp-process-particle-system *sp-particle-system-3d* 0 (the-as sprite-array-2d *sprite-array-3d*)) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-47 (+ (-> s5-1 depth) -1)) + (s4-1 (-> s5-1 segment v1-47)) + (s3-1 (-> s5-1 base-time)) + ) + (when (>= v1-47 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1)))) + (+! (-> s5-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (set! *sp-launcher-lock* #f) + (sp-clear-queue) + (.mfc0 v1-53 Count) + (- v1-53 gp-0) + (when *display-sprite-info* + (if (movie?) + (format *stdcon* "~%~%~%") + ) + (format + *stdcon* + "2d: ~4d~100h3d: ~4d~200hwarp/glow: ~3D~350hhud:~3D~%" + (-> *sp-particle-system-2d* num-alloc 0) + (-> *sp-particle-system-3d* num-alloc 0) + (-> *sprite-aux-list* entry) + (-> *sp-particle-system-2d* num-alloc 1) + ) + ) + ) + 0 + (none) + ) + ) diff --git a/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc index 600e10634e..4c9387a76c 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite-distort.gc @@ -93,7 +93,7 @@ (none) ) -(define sprite-distort-vu1-block (new 'static 'vu-function :length 63 :qlength 32)) +(define sprite-distort-vu1-block (new 'static 'vu-function #|:length 63 :qlength 32|#)) (defun sprite-init-distorter ((arg0 dma-buffer)) "Generate DMA to initialize the distort renderer." @@ -111,6 +111,24 @@ ) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) ) + ;; send current aspect used by the sine tables (PC only) + (#when PC_PORT + (let ((packet (the-as dma-packet (-> arg0 base)))) + (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 1)) + (set! (-> packet vif0) (new 'static 'vif-tag)) + (set! (-> packet vif1) (new 'static 'vif-tag :cmd (vif-cmd pc-port))) + (&+! (-> arg0 base) 16) + ) + (let ((aspect-vec (the-as vector (-> arg0 base)))) + (set-vector! aspect-vec + (-> *sprite-distorter-sine-tables* aspx) + (-> *sprite-distorter-sine-tables* aspy) + 0.0 + 0.0 + ) + (&+! (-> arg0 base) 16) + ) + ) (let* ((v1-3 arg0) (a1-6 (the-as dma-packet (-> v1-3 base))) ) diff --git a/goal_src/jak3/engine/gfx/sprite/sprite.gc b/goal_src/jak3/engine/gfx/sprite/sprite.gc index abff81bcd2..7fcfed9b86 100644 --- a/goal_src/jak3/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak3/engine/gfx/sprite/sprite.gc @@ -287,7 +287,7 @@ The glow and distort renderers will pull sprites from here." ) ) (set! (-> arg0 screen-shader prims 9) (gs-reg64 alpha-1)) - (set! (-> arg0 screen-shader alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> arg0 screen-shader alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> arg0 sincos-01 z) 0.999998) (set! (-> arg0 sincos-23 z) -0.16666014) (set! (-> arg0 sincos-45 z) 0.008326521) @@ -332,7 +332,7 @@ The glow and distort renderers will pull sprites from here." (none) ) -(define sprite-vu1-block (new 'static 'vu-function :length #x37b :qlength #x1be)) +(define sprite-vu1-block (new 'static 'vu-function #|:length #x37b :qlength #x1be|#)) (defmethod new sprite-array-2d ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) (let* ((v1-0 (+ arg0 arg1)) diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc index 15103b19b6..b6ee17969e 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-funcs.gc @@ -5,5 +5,7 @@ ;; name in dgo: texture-anim-funcs ;; dgos: GAME +(define *fog-texture-work* (new 'static 'fog-texture-work :const (new 'static 'vector :x 0.00390625))) + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc index 388c16b53f..2612a95bb8 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc @@ -152,7 +152,7 @@ (alpha-near float) (alpha-far float) (alpha-delta float) - (color uint32) + (color rgba) ) ) diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc index 5a6b90e4cf..6d8f060098 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-tables.gc @@ -11,6 +11,10 @@ (define-extern *skull-gem-texture-anim-array* (texture-anim-array texture-anim)) (define-extern *default-water-texture-anim-array* (texture-anim-array texture-anim)) (define-extern *default-warp-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern set-darkjak-texture-morph! (function float none)) ;; DECOMP BEGINS +(defun set-darkjak-texture-morph! ((arg0 float)) + (none) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/texture/texture-finish.gc b/goal_src/jak3/engine/gfx/texture/texture-finish.gc index 47e2ac5429..2fc7199f1f 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-finish.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-finish.gc @@ -7,3 +7,22 @@ ;; DECOMP BEGINS +(setup-font-texture *texture-pool*) + +(let ((v1-2 (get-texture skull-gem-dest programmer))) + (when v1-2 + (set! (-> v1-2 w) 32) + (set! (-> v1-2 h) 32) + (set! (-> v1-2 dest 0) (-> *skull-gem-texture-base* vram-block)) + ) + ) + +(format #t "skipping init in texture-finish.~%") +; (init! *sky-texture-anim-array*) +; (init! *darkjak-texture-anim-array*) +; (init! *skull-gem-texture-anim-array*) +; (init! *default-water-texture-anim-array*) +; (init! *default-warp-texture-anim-array*) + +(kmemclose) + diff --git a/goal_src/jak3/engine/gfx/texture/texture-h.gc b/goal_src/jak3/engine/gfx/texture/texture-h.gc index 7587a3c5e1..b9027ade5d 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-h.gc @@ -278,22 +278,24 @@ to have a smaller impact on frame times when loading." These are used by many different renderers and partially managed by the texture system. For example, the texture system will automatically update tbp to point to the location of the texture." - ((quad qword 5 :inline) - (prims gs-reg64 10 :overlay-at quad) - (reg-0 uint8 :overlay-at (-> quad 0 data 2)) - (reg-1 uint8 :overlay-at (-> prims 3)) - (reg-2 uint8 :overlay-at (-> prims 5)) - (reg-3 uint8 :overlay-at (-> prims 7)) - (reg-4 uint8 :overlay-at (-> prims 9)) - (tex0 gs-tex0 :overlay-at (-> quad 0 data 0)) - (tex1 gs-tex1 :overlay-at (-> prims 2)) - (miptbp1 gs-miptbp :overlay-at (-> prims 4)) - (clamp gs-clamp :overlay-at (-> prims 6)) - (clamp-reg gs-reg64 :overlay-at reg-3) - (alpha gs-alpha :overlay-at (-> prims 8)) - (link-test link-test-flags :overlay-at (-> quad 0 data 2)) - (texture-id texture-id :overlay-at reg-1) - (next shader-ptr :overlay-at reg-2) + ((quad qword 5 :inline) + (prims gs-reg64 10 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> quad 0 data 2)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (reg-3 uint8 :overlay-at (-> prims 7)) + (reg-4 uint8 :overlay-at (-> prims 9)) + (tex0 gs-tex0 :overlay-at (-> quad 0 data 0)) + (tex1 gs-tex1 :overlay-at (-> prims 2)) + (miptbp1 gs-miptbp :overlay-at (-> prims 4)) + (clamp gs-clamp :overlay-at (-> prims 6)) + (clamp-reg gs-reg64 :overlay-at reg-3) + (alpha gs-miptbp :overlay-at (-> prims 8)) + (link-test link-test-flags :overlay-at (-> quad 0 data 2)) + (texture-id texture-id :overlay-at reg-1) + (next shader-ptr :overlay-at reg-2) + (alpha-as-miptb2 gs-miptbp :overlay-at alpha) + (reg-4-u32 gs-reg32 :overlay-at reg-4) ) ) diff --git a/goal_src/jak3/engine/gfx/texture/texture-upload.gc b/goal_src/jak3/engine/gfx/texture/texture-upload.gc index d7b7ccf86e..8affc76e50 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-upload.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-upload.gc @@ -7,3 +7,23 @@ ;; DECOMP BEGINS +(define *generic-envmap-texture* (get-texture pal-environment-front environment-generic)) +(define *default-envmap-shader* (new 'global 'adgif-shader)) + +(let ((gp-0 *default-envmap-shader*)) + (let ((a1-1 *generic-envmap-texture*)) + (adgif-shader<-texture! gp-0 a1-1) + ) + (set! (-> gp-0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> gp-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) + (set! (-> gp-0 alpha) (new 'static 'gs-miptbp :tbp1 #x58)) + (set! (-> gp-0 prims 1) (gs-reg64 tex0-1)) + (set! (-> gp-0 prims 3) (gs-reg64 tex1-1)) + (set! (-> gp-0 prims 5) (gs-reg64 miptbp1-1)) + (set! (-> gp-0 clamp-reg) (gs-reg64 clamp-1)) + (set! (-> gp-0 prims 9) (gs-reg64 alpha-1)) + ) + +(set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate) + +(kmemopen global "tpages") \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/texture/texture.gc b/goal_src/jak3/engine/gfx/texture/texture.gc index 75837aacff..ef94914aa1 100644 --- a/goal_src/jak3/engine/gfx/texture/texture.gc +++ b/goal_src/jak3/engine/gfx/texture/texture.gc @@ -716,6 +716,10 @@ ;; WARN: Return type mismatch symbol vs none. (defun upload-vram-data ((dma-buf dma-buffer) (dest int) (data-ptr pointer) (h int) (w int)) "Add DMA to later upload a texture, by reference. Sets up the GIF for receiving the texture." + (#when PC_PORT + ;; disabled. + (return #f) + ) (let ((v1-0 *display*) (a0-2 (* 96 (+ (sar h 11) 1))) ) @@ -829,6 +833,13 @@ (+! s5-0 sv-32) ) (dma-buffer-add-gs-set s3-0 (texflush 1)) + + (#when PC_PORT + (dma-buffer-add-cnt-vif2 s3-0 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port)) (the-as vif-tag 3)) + (dma-buffer-add-uint64 s3-0 page) + (dma-buffer-add-uint64 s3-0 mode) + ) + (let ((a3-3 (-> s3-0 base))) (when (!= s4-0 a3-3) (let ((v1-56 (the-as dma-packet (-> s3-0 base)))) @@ -906,6 +917,76 @@ 0 ) +;; og:preserve-this pc port function +(defun upload-vram-pages-pris-pc ((pool texture-pool) + (dest-seg texture-pool-segment) + (tpage texture-page) + (bucket bucket-id) + (mask (pointer int32)) + ) + "Build DMA for uploading the given texture-page in pc format. + We don't use the mask system of the original game properly." + (if (not tpage) + (return 0) + ) + (let* ((dma-buf (-> *display* frames (-> *display* on-screen) global-buf)) + (s4-0 (-> dma-buf base)) + (any-uploads #f) + (vram-ptr (shr (-> tpage segment 0 dest) 12)) + (tpage-num-chunks (the-as int (-> tpage size))) + (tpage-id (-> tpage id)) + ) + ;; align and truncate + (set! tpage-num-chunks (shr (min (the-as int (-> dest-seg size)) (the-as int (+ tpage-num-chunks 4095))) 12)) + + ;; loop over chunks, seeing if any need to be uploaded. + (dotimes (chunk-idx tpage-num-chunks) + (let ((mask-work (-> mask (/ chunk-idx 32)))) + (when (logtest? mask-work (ash 1 (logand chunk-idx 31))) + (set! any-uploads #t) + ) + ) + ) + + ;; not used at all. we don't set merc masks on PC, so this should happen most of the time. + ; (when (not any-uploads) + ; (return 0) + ; ) + + ;; but non-merc users of this function (like map/hud) will get here + + ;; upload everything in the tpage. + ;; uploads are "free" on PC, so no harm, but we have to tell the game we're doing this + ;; otherwise it might think that an old texture was left behind and skip a later upload + (dotimes (chunk-idx tpage-num-chunks) + (let ((chunk-dest (+ vram-ptr chunk-idx))) + (set! (-> pool ids chunk-dest) tpage-id) + ) + ) + + ;; tell pc port we upload everything. + (dma-buffer-add-cnt-vif2 dma-buf 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port)) (the-as vif-tag 3)) + (dma-buffer-add-uint64 dma-buf tpage) + (dma-buffer-add-uint64 dma-buf -1) + + (let ((a3-5 (-> dma-buf base))) + (let ((v1-43 (the-as dma-packet (-> dma-buf base)))) + (set! (-> v1-43 dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> v1-43 vif0) (new 'static 'vif-tag)) + (set! (-> v1-43 vif1) (new 'static 'vif-tag)) + (set! (-> dma-buf base) (the-as pointer (&+ v1-43 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + bucket + s4-0 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + 0 + ) + (defun upload-vram-pages-pris ((pool texture-pool) (pool-segment texture-pool-segment) (page texture-page) @@ -1345,71 +1426,74 @@ ) ) ) - (let ((a1-26 (-> lev texture-anim-array category))) - (cond - ((= category (tpage-category warp)) - (when (= (-> lev index) 10) - (dotimes (s2-1 11) - (let ((v1-55 (-> *level* level s2-1))) - (when (or (= (-> v1-55 status) 'active) (= (-> v1-55 status) 'reserved)) - (let ((a1-30 (-> v1-55 texture-anim-array 5))) - (if a1-30 - (update-texture-anim bucket a1-30) - ) + ;; added nonzero check. + (when (nonzero? update-texture-anim) + (let ((a1-26 (-> lev texture-anim-array category))) + (cond + ((= category (tpage-category warp)) + (when (= (-> lev index) 10) + (dotimes (s2-1 11) + (let ((v1-55 (-> *level* level s2-1))) + (when (or (= (-> v1-55 status) 'active) (= (-> v1-55 status) 'reserved)) + (let ((a1-30 (-> v1-55 texture-anim-array 5))) + (if a1-30 + (update-texture-anim bucket a1-30) + ) + ) ) ) ) ) ) - ) - ((= category (tpage-category sprite)) - (when (= (-> lev index) 10) - (dotimes (s2-2 11) - (let ((v1-64 (-> *level* level s2-2))) - (when (or (= (-> v1-64 status) 'active) (= (-> v1-64 status) 'reserved)) - (let ((a1-34 (-> v1-64 texture-anim-array 7))) - (if a1-34 - (update-texture-anim bucket a1-34) - ) + ((= category (tpage-category sprite)) + (when (= (-> lev index) 10) + (dotimes (s2-2 11) + (let ((v1-64 (-> *level* level s2-2))) + (when (or (= (-> v1-64 status) 'active) (= (-> v1-64 status) 'reserved)) + (let ((a1-34 (-> v1-64 texture-anim-array 7))) + (if a1-34 + (update-texture-anim bucket a1-34) + ) + ) ) ) ) ) ) - ) - ((= category (tpage-category hud)) - (when (= (-> lev index) 10) - (dotimes (s2-3 11) - (let ((v1-73 (-> *level* level s2-3))) - (when (or (= (-> v1-73 status) 'active) (= (-> v1-73 status) 'reserved)) - (let ((a1-38 (-> v1-73 texture-anim-array 8))) - (if a1-38 - (update-texture-anim bucket a1-38) - ) + ((= category (tpage-category hud)) + (when (= (-> lev index) 10) + (dotimes (s2-3 11) + (let ((v1-73 (-> *level* level s2-3))) + (when (or (= (-> v1-73 status) 'active) (= (-> v1-73 status) 'reserved)) + (let ((a1-38 (-> v1-73 texture-anim-array 8))) + (if a1-38 + (update-texture-anim bucket a1-38) + ) + ) ) ) ) ) ) - ) - ((= category (tpage-category sky)) - (when (-> *time-of-day-context* sky) - (if a1-26 - (update-texture-anim bucket a1-26) - ) + ((= category (tpage-category sky)) + (when (-> *time-of-day-context* sky) + (if a1-26 + (update-texture-anim bucket a1-26) + ) + ) ) - ) - ((= bucket (bucket-id tex-lcom-sky-post)) - (when (and (-> *time-of-day-context* sky) *ocean-map*) - (if a1-26 - (update-texture-anim bucket a1-26) - ) + ((= bucket (bucket-id tex-lcom-sky-post)) + (when (and (-> *time-of-day-context* sky) *ocean-map*) + (if a1-26 + (update-texture-anim bucket a1-26) + ) + ) ) - ) - (else - (if a1-26 - (update-texture-anim bucket a1-26) - ) + (else + (if a1-26 + (update-texture-anim bucket a1-26) + ) + ) ) ) ) @@ -1456,7 +1540,8 @@ (defun upload-textures ((pool texture-pool)) "Set up DMA for all texture uploads for this frame." (cond - ((not (get-screen-copied *blit-displays-work*)) + ;; added the nonzero check here. + ((and (nonzero? *blit-displays-work*) (not (get-screen-copied *blit-displays-work*))) (set-skull-gem-masks) (set! (-> *level* level-default texture-anim-array 0) *skull-gem-texture-anim-array*) ) @@ -1490,7 +1575,7 @@ (add-level-tpage-dma pool s3-0 (the-as tpage-category (-> s4-0 level-texture-page)) (-> s4-0 bucket)) ) (else - (if (not (get-menu-mode *blit-displays-work*)) + (if (or (zero? *blit-displays-work*) (not (get-menu-mode *blit-displays-work*))) ;; added or check. (add-level-tpage-dma pool s3-0 (the-as tpage-category (-> s4-0 level-texture-page)) (-> s4-0 bucket)) ) ) @@ -1521,7 +1606,11 @@ (defmethod upload-now! ((this texture-page) (mode tex-upload-mode)) "Upload a texture to VRAM immediately, wait for DMA to finish." - (format 0 "TODO: upload-now!~%") + ;; og:preserve-this + (#when PC_PORT + ;; load it to the PC Port's texture pool. + (__pc-texture-upload-now this mode) + ) (let ((gp-0 *txt-dma-list*)) (let ((v1-0 gp-0)) (set! (-> v1-0 base) (-> v1-0 data)) @@ -1577,6 +1666,13 @@ (defun texture-relocate ((dma-buf dma-buffer) (tex texture) (dest int) (tex-format gs-psm) (clut-dest int)) "Move a texture in VRAM." + + ;; og:preserve-this + (#when PC_PORT + ;; as far as I know this is only used for fonts which have 1 mip level. + (__pc-texture-relocate (/ dest 64) (-> tex dest 0) tex-format) + (return dma-buf) + ) (dotimes (v1-0 (the-as int (-> tex num-mips))) (let ((t1-1 (ash (-> tex w) (- v1-0))) (t2-3 (ash (-> tex h) (- v1-0))) @@ -1718,7 +1814,9 @@ (set! (-> (the-as (pointer uint64) a0-32) 1) (the-as uint 0)) (set! (-> v1-30 base) (&+ a0-32 16)) ) - (dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0) + (#unless PC_PORT + (dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0) + ) ) (dma-sync (the-as pointer #x10009000) 0 0) (if (and s5-0 (-> s5-0 page) (= (-> this cur) (+ sv-16 (-> s5-0 page size)))) @@ -1804,6 +1902,9 @@ ) (set! (-> this segment 1 dest) (-> this segment 0 size)) (set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size))) + + ;; todo, if needed, pc texture remaps (__pc-get-tex-remap) + (set! (-> this vram-size) (-> this size)) (let* ((a3-0 (-> this id)) (s4-0 (-> *texture-page-dir* entries a3-0)) @@ -2247,7 +2348,12 @@ ) ) -(when (not *debug-segment*) +;; modified for PC port: never bother with the debug-mode texture login. +;; it will never work on PC, and it causes problems with custom levels, due to the way that it allocates the link +;; array for texture-pages that don't exist, which are never then set to false, causing them to be referenced +;; after the level is unloaded. This probably works fine if you are playing one level at a time, or if the backup +;; texture page loading actually works. +(when (or (not *debug-segment*) PC_PORT) (set! adgif-shader-login adgif-shader-login-fast) (set! adgif-shader-login-no-remap adgif-shader-login-no-remap-fast) ) @@ -2261,7 +2367,7 @@ (adgif-shader<-texture! shader tex) ) (set! (-> shader clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) - (set! (-> shader alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> shader alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> shader prims 1) (gs-reg64 tex0-1)) (set! (-> shader prims 3) (gs-reg64 tex1-1)) (set! (-> shader prims 5) (gs-reg64 miptbp1-1)) @@ -2395,5 +2501,47 @@ (none) ) +(defun adgif-shader<-texture! ((arg0 adgif-shader) (arg1 texture)) + "Set up an adgif-shader from a texture." + (set! (-> arg0 tex1 mxl) (+ (-> arg1 num-mips) -1)) + (set! (-> arg0 tex1 l) (-> arg1 mip-shift)) + (set! (-> arg0 tex1 mmag) (logand (-> arg1 tex1-control) 1)) + (set! (-> arg0 tex1 mmin) (shr (-> arg1 tex1-control) 1)) + (set! (-> arg0 tex0) (new 'static 'gs-tex0 + :tcc #x1 + :cld #x1 + :cpsm (-> arg1 clutpsm) + :cbp (-> arg1 clutdest) + :tfx (-> arg0 tex0 tfx) + :th (log2 (-> arg1 h)) + :tw (log2 (-> arg1 w)) + :tbw (-> arg1 width 0) + :tbp0 (-> arg1 dest 0) + :psm (the-as int (-> arg1 psm)) + ) + ) + (set! (-> arg0 miptbp1) (new 'static 'gs-miptbp + :tbp1 (-> arg1 dest 1) + :tbw1 (-> arg1 width 1) + :tbp2 (-> arg1 dest 2) + :tbw2 (-> arg1 width 2) + :tbp3 (-> arg1 dest 3) + :tbw3 (-> arg1 width 3) + ) + ) + (when (< (the-as uint 4) (-> arg1 num-mips)) + (set! (-> arg0 alpha-as-miptb2) (new 'static 'gs-miptbp + :tbp1 (-> arg1 dest 4) + :tbw1 (-> arg1 width 4) + :tbp2 (-> arg1 dest 5) + :tbw2 (-> arg1 width 5) + :tbp3 (-> arg1 dest 6) + :tbw3 (-> arg1 width 6) + ) + ) + (set! (-> (&-> arg0 reg-4-u32) 0) (gs-reg32 miptbp2-1)) + ) + arg0 + ) (define *texture-pool* (new 'global 'texture-pool)) diff --git a/goal_src/jak3/engine/gfx/vu1-user-h.gc b/goal_src/jak3/engine/gfx/vu1-user-h.gc index 447389fd8c..95007f153d 100644 --- a/goal_src/jak3/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak3/engine/gfx/vu1-user-h.gc @@ -28,7 +28,7 @@ :type int32 (bucket0 0) (bucket1 1) - (bucket2 2) + (bucket2 2) ;; pc vis stuff (bucket3 3) ;; blit? (tex-lcom-sky-pre 4) (bucket5 5) ;; sky @@ -304,7 +304,7 @@ (tex-l2-alpha 252) (tfrag-l2-alpha 253) (tie-l2-alpha 254) - (etie-l02alpha 255) + (etie-l2-alpha 255) (merc-l2-alpha 256) (emerc-l2-alpha 257) (gmerc-l2-alpha 258) @@ -679,9 +679,9 @@ (tex-hud-pris2 580) (hud-draw-pris2 581) (bucket582 582) - (bucket583 583) + (debug 583) (debug-no-zbuf2 584) - (bucket585 585) + (debug-menu 585) (bucket586 586) ) diff --git a/goal_src/jak3/engine/level/bsp-h.gc b/goal_src/jak3/engine/level/bsp-h.gc index 4a416f7569..e36f313879 100644 --- a/goal_src/jak3/engine/level/bsp-h.gc +++ b/goal_src/jak3/engine/level/bsp-h.gc @@ -74,6 +74,7 @@ This probably started as a very simple structure, but now it is extremely compli (nav-meshes (array entity-nav-mesh)) (actor-groups (array actor-group)) (region-trees (array drawable-tree-region-prim) :offset 188) + (region-array region-array) (collide-hash collide-hash :offset 196) (wind-array uint32 :offset 200) (wind-array-length int32 :offset 204) diff --git a/goal_src/jak3/engine/level/bsp.gc b/goal_src/jak3/engine/level/bsp.gc index c01012693c..c1fab62459 100644 --- a/goal_src/jak3/engine/level/bsp.gc +++ b/goal_src/jak3/engine/level/bsp.gc @@ -574,7 +574,7 @@ ) (when (zero? (+ s2-0 s3-0 s4-0 gp-0)) (dotimes (a0-5 (-> v1-0 length)) - (let ((a1-2 (-> v1-0 data a0-5))) + (let ((a1-2 (-> v1-0 trees a0-5))) (cond ((= (-> a1-2 type) drawable-tree-tfrag) (let* ((a2-5 (-> (the-as drawable-tree-tfrag a1-2) arrays (+ (-> (the-as drawable-tree-tfrag a1-2) length) -1))) diff --git a/goal_src/jak3/engine/level/level.gc b/goal_src/jak3/engine/level/level.gc index 6614dba694..f9f76e2004 100644 --- a/goal_src/jak3/engine/level/level.gc +++ b/goal_src/jak3/engine/level/level.gc @@ -11,7 +11,31 @@ (defmacro start-debug (str &rest args) `(format 0 ,(string-append "[START] " str) ,@args) - 0) + ) + +(defun give-all-stuff () + (send-event *target* 'get-pickup (pickup-type health) 1000.0) + (send-event *target* 'get-pickup (pickup-type shield) 1000.0) + ;; (send-event *target* 'get-pickup (pickup-type skill) 100.0) + ;; (send-event *target* 'get-pickup (pickup-type gem) 100.0) + (send-event *target* 'get-pickup (pickup-type ammo-yellow) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-red) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-blue) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-dark) 1000.0) + ;; (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + (logior! (-> *game-info* features) + (game-feature + board board-launch feature39 + darkeco + darkjak darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 + lighteco + lightjak lightjak-regen lightjak-swoop lightjak-freeze lightjak-shield + gun + gun-red-1 gun-yellow-1 gun-blue-1 gun-dark-1 + gun-red-2 gun-yellow-2 gun-blue-2 gun-dark-2 + gun-red-3 gun-yellow-3 gun-blue-3 gun-dark-3)) + ) (defmacro test-play () "Temporary start macro" @@ -20,7 +44,23 @@ (define *kernel-boot-message* 'play) (start-debug "loading GAME.DGO~%") (load-package "game" global) - ;; (play-boot) + (play-boot) + + ;; wait 10 frames and then turn on profile bars. + ;; they get shut off as part of startup, so we can't do it here. + (process-spawn-function + process + (lambda () + (dotimes (i 10) + (suspend) + ) + (true! *display-profile*) + (true! *stats-profile-bars*) + (true! *display-actor-marks*) + (true! *display-bones*) + (give-all-stuff) + ) + ) ) ) @@ -411,11 +451,15 @@ it will kick out levels as needed to make a free slot, and set up a new level, and start the load. This should only be used when you might want to start a load." (local-vars (s5-1 level)) + + (start-debug "level-get-for-use: ~A ~A~%" arg0 arg1) (init-level-system this #f) (let* ((s2-0 (lookup-level-info arg0)) (s1-0 (remap-level-name s2-0)) ) + (start-debug " remapped name: ~A~%" s1-0) (let ((s5-0 (level-get this s1-0))) + (start-debug " existing? ~A~%" s5-0) (when s5-0 (level-status-update! s5-0 arg1) (set! s5-1 s5-0) @@ -423,6 +467,7 @@ ) ) (let ((a0-7 (level-get-most-disposable this))) + (start-debug " most disposable: ~A~%" a0-7) (set! s5-1 (if a0-7 (level-status-update! a0-7 'inactive) a0-7 @@ -560,6 +605,7 @@ This can do both loading, linking, login, and activation. This is somewhat similar to level-get-for-use, but requires that you already have the level object. This function is the way to transition from loaded to alive/active." + (start-debug "level-status-update: ~A ~A (current ~A)~%" this arg0 (-> this status)) (case arg0 (('inactive) (-> this status) @@ -1649,8 +1695,10 @@ (defmethod login-begin ((this level)) "Start logging in loaded level data." (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) + (format 0 "LOGIN-BEGIN: ~A~%" this) (cond ((-> this bsp) + (format 0 " and with a bsp too~%") (let ((s5-0 (-> this bsp))) (set! (-> s5-0 level tfrag-gs-test) (if (logtest? (-> s5-0 texture-flags 0) (texture-page-flag alpha-enable)) @@ -1733,20 +1781,20 @@ (s2-0 (-> s3-0 drawable-trees)) ) 0 - (.mfc0 s5-0 Count) + ; (.mfc0 s5-0 Count) (label cfg-1) 0 - (.mfc0 v1-4 Count) - (let ((v1-5 (- v1-4 s5-0))) - (when (< #x186a0 v1-5) - (set! arg0 arg0) - (goto cfg-116) - ) - ) + ; (.mfc0 v1-4 Count) + ; (let ((v1-5 (- v1-4 s5-0))) + ; (when (< #x186a0 v1-5) + ; (set! arg0 arg0) + ; (goto cfg-116) + ; ) + ; ) (let ((s0-0 (the-as int (-> arg1 pos)))) (when (= (-> arg1 state) -1) (when (< s0-0 (-> s2-0 length)) - (let ((s1-0 (-> s2-0 data (the-as uint s0-0)))) + (let ((s1-0 (-> s2-0 trees (the-as uint s0-0)))) (cond ((= (-> (the-as drawable-tree-tfrag s1-0) type) drawable-tree-tfrag) (dotimes (s0-1 (-> (the-as drawable-tree-tfrag s1-0) length)) @@ -1895,7 +1943,7 @@ ) (set! (-> sv-96 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) (set! (-> sv-96 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) - (set! (-> sv-96 alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + (set! (-> sv-96 alpha) (new 'static 'gs-miptbp :tbp1 #x58)) (set! (-> sv-96 reg-0) (the-as uint 6)) (set! (-> sv-96 reg-1) (the-as uint 20)) (set! (-> sv-96 reg-2) (the-as uint 52)) @@ -2041,7 +2089,10 @@ (let ((s1-2 (-> this status))) (set! (-> this status) 'active) (do-nothing *level*) - (update-task-masks 'level) + (when (nonzero? update-task-masks) ;; added check + (format 0 "skipping update-task-masks~%") + (update-task-masks 'level) + ) (assign-draw-indices *level*) (let ((s0-0 (-> this bsp nav-meshes))) (when (nonzero? s0-0) @@ -2257,7 +2308,7 @@ (set! (-> this loaded-texture-page-count) 0) (unlink-shaders-in-heap *texture-page-dir* (-> this heap)) (unlink-part-group-by-heap (-> this heap)) - (unlink-lightning-spec-by-heap (-> this heap)) + ;; (unlink-lightning-spec-by-heap (-> this heap)) (particle-adgif-cache-flush) (set! (-> this loaded-text-info-count) 0) (dotimes (s5-6 2) @@ -2425,6 +2476,7 @@ (defmethod init-level-system ((this level-group) (arg0 symbol)) "If needed, initialize the level system by loading common/art packages and allocating level heaps." (when (zero? (-> *level* heap base)) + (start-debug "allocating levels~%") (kmemopen global "level-heaps") (when (nmember "game" *kernel-packages*) (set! *kernel-packages* (cons "art" *kernel-packages*)) @@ -2446,6 +2498,10 @@ (set! (-> gp-1 top-base) (&+ (-> gp-1 base) s5-1)) (set! (-> gp-1 top) (-> gp-1 top-base)) ) + (start-debug "GLOBAL~%") + (inspect global) + (start-debug "LEVEL~%") + (inspect (-> this heap)) (kmemclose) ) 0 @@ -2706,9 +2762,12 @@ (none) ) +(defconstant *default-boot-level* 'halfpipe) + (defun play ((arg0 symbol) (arg1 symbol)) "Start (or restart) the game! This will start up the display process, and load the initial level." + (start-debug "call to play!~%") (kmemopen global "level-boot") (when *kernel-boot-level* (bg (string->symbol (the-as string *kernel-boot-level*))) @@ -2719,7 +2778,7 @@ ) *kernel-boot-message* (let ((s5-0 (if *debug-segment* - 'wasall + *default-boot-level* 'title ) ) @@ -2738,11 +2797,15 @@ ) ) (set! *time-of-day-fast* #f) - (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) - (send-event (ppointer->process *time-of-day*) 'change 'hour 7) - (send-event (ppointer->process *time-of-day*) 'change 'minutes 0) - (send-event (ppointer->process *time-of-day*) 'change 'seconds 0) - (send-event (ppointer->process *time-of-day*) 'change 'frames 0) + + ;; added nonzero check here. + (when (nonzero? *time-of-day*) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 7) + (send-event (ppointer->process *time-of-day*) 'change 'minutes 0) + (send-event (ppointer->process *time-of-day*) 'change 'seconds 0) + (send-event (ppointer->process *time-of-day*) 'change 'frames 0) + ) (set! (-> *time-of-day-context* mode) (time-of-day-palette-id unk3)) (set! (-> *mood-control* overide-weather-flag) #f) (set-blackout-frames (seconds 0.02)) @@ -2790,6 +2853,8 @@ (defun play-boot () "Function called by the C Kernel to start the game (wrapper around play)." + + (start-debug "call to play-boot!~%") (process-spawn-function process (lambda () (play #t #t) (none)) @@ -3720,6 +3785,25 @@ ) ) ) + ;; og:preserve-this added + (let ((lev-names (new 'stack-no-clear 'array 'string 10)) + (active-lev-names (new 'stack-no-clear 'array 'string 10))) + (dotimes (i 10) + (set! (-> active-lev-names i) "none") + (set! (-> lev-names i) "none") + (cond + ((or (= (-> this level i status) 'active) + (= (-> this level i status) 'alive) + (= (-> this level i status) 'loaded)) + (set! (-> lev-names i) (symbol->string (-> this level i nickname))) + (if (-> this level i display?) + (set! (-> active-lev-names i) (symbol->string (-> this level i nickname)))) + ) + ) + ) + (__pc-set-levels lev-names) + (__pc-set-active-levels active-lev-names) + ) 0 (none) ) diff --git a/goal_src/jak3/engine/level/region.gc b/goal_src/jak3/engine/level/region.gc index ecf0190a65..eaabe34ef0 100644 --- a/goal_src/jak3/engine/level/region.gc +++ b/goal_src/jak3/engine/level/region.gc @@ -7,3 +7,641 @@ ;; DECOMP BEGINS +;; WARN: Return type mismatch int vs drawable-region-prim. +(defmethod mem-usage ((this drawable-region-prim) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 51 (-> usage length))) + (set! (-> usage data 50 name) "region") + (+! (-> usage data 50 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 50 used) v1-6) + (+! (-> usage data 50 total) (logand -16 (+ v1-6 15))) + ) + (mem-usage (-> this region) usage (logior flags 128)) + (the-as drawable-region-prim 0) + ) + +;; WARN: Return type mismatch int vs drawable-inline-array-region-prim. +(defmethod mem-usage ((this drawable-inline-array-region-prim) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 1 (-> usage length))) + (set! (-> usage data 0 name) "drawable-group") + (+! (-> usage data 0 count) 1) + (let ((v1-5 32)) + (+! (-> usage data 0 used) v1-5) + (+! (-> usage data 0 total) (logand -16 (+ v1-5 15))) + ) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) usage flags) + ) + (the-as drawable-inline-array-region-prim 0) + ) + +(defmethod draw ((this drawable-tree-region-prim)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + 0 + (none) + ) + +(defmethod unpack-vis ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) + arg1 + ) + +(defmethod collect-regions ((this drawable-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Fill the region-prim-list with regions that intersect the sphere." + (dotimes (s2-0 arg1) + (when (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) + (set! (-> arg2 items (-> arg2 num-items)) this) + (+! (-> arg2 num-items) 1) + ) + (&+! this 32) + ) + 0 + (none) + ) + +(defmethod collect-regions ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Fill the region-prim-list with regions that intersect the sphere." + (collect-regions (the-as drawable-region-prim (-> this data)) arg0 (-> this length) arg2) + 0 + (none) + ) + +(defmethod collect-regions ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Fill the region-prim-list with regions that intersect the sphere." + (collect-regions (-> this data2 0) arg0 (-> this length) arg2) + 0 + (none) + ) + +(defmethod debug-draw-region ((this drawable-region-prim) (arg0 int)) + (local-vars (sv-32 vector2h) (sv-36 vector)) + (set! sv-32 (new 'stack 'vector2h)) + (set! sv-36 (-> this bsphere)) + (add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (when (nonzero? (-> this region)) + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 577) + ) + (format (clear *temp-string*) "region-~D~%" (-> this region id)) + (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + (let ((s5-1 (-> this region on-enter))) + (when s5-1 + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 577) + ) + (format (clear *temp-string*) "(on-enter ~S)" s5-1) + (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + ) + ) + (let ((s5-2 (-> this region on-inside))) + (when s5-2 + (let ((s4-2 add-debug-text-3d) + (s3-2 #t) + (s2-2 577) + ) + (format (clear *temp-string*) "(on-inside ~S)" s5-2) + (s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + ) + ) + (let ((gp-1 (-> this region on-exit))) + (when gp-1 + (let ((s5-3 add-debug-text-3d) + (s4-3 #t) + (s3-3 577) + ) + (format (clear *temp-string*) "(on-exit ~S)" gp-1) + (s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + ) + ) + ) + 0 + (none) + ) + +(defmethod track-region ((this drawable-region-prim) (arg0 region-prim-area)) + #f + ) + +(defmethod within-area? ((this drawable-region-prim) (arg0 region-prim-area)) + "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" + #f + ) + +(defmethod track-entered-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-enter-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-enter-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-enter-list v1-0) a2-0) + ) + (set! (-> this region-enter-prim-list v1-0) arg0) + (set! (-> this region-enter-count) (+ v1-0 1)) + ) + 0 + ) + +(defmethod track-exited-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-exit-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-exit-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-exit-list v1-0) a2-0) + ) + (set! (-> this region-exit-prim-list v1-0) arg0) + (set! (-> this region-exit-count) (+ v1-0 1)) + ) + 0 + ) + +(defmethod track-inside-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-inside-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-inside-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-inside-list v1-0) a2-0) + ) + (set! (-> this region-inside-prim-list v1-0) arg0) + (set! (-> this region-inside-count) (+ v1-0 1)) + ) + 0 + ) + +(defmethod track-start-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-start-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-start-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-start-list v1-0) a2-0) + ) + (set! (-> this region-start-prim-list v1-0) arg0) + (set! (-> this region-start-count) (+ v1-0 1)) + ) + 0 + ) + +(defmethod debug-draw-region ((this drawable-region-sphere) (arg0 int)) + (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) + (t9-0 this arg0) + ) + (let ((a2-0 (-> this bsphere))) + (add-debug-sphere #t (bucket-id debug) a2-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x80)) + ) + 0 + (none) + ) + +(defmethod track-region ((this drawable-region-sphere) (arg0 region-prim-area)) + (-> this region) + (let ((s4-0 (-> this bsphere))) + (if (< 0.0 (ray-sphere-intersect (-> arg0 pos) (-> arg0 ray) s4-0 (-> s4-0 w))) + (track-entered-region! arg0 this) + ) + (if (< 0.0 (ray-sphere-intersect (-> arg0 exit-pos) (-> arg0 exit-ray) s4-0 (-> s4-0 w))) + (track-exited-region! arg0 this) + ) + (if (spheres-overlap? (the-as sphere (-> arg0 pos)) (the-as sphere s4-0)) + (track-start-region! arg0 this) + ) + (when (spheres-overlap? (the-as sphere (-> arg0 exit-pos)) (the-as sphere s4-0)) + (track-inside-region! arg0 this) + #t + ) + ) + ) + +(defmethod within-area? ((this drawable-region-sphere) (arg0 region-prim-area)) + "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" + (spheres-overlap? (the-as sphere (-> arg0 pos)) (the-as sphere (-> this bsphere))) + ) + +(defmethod debug-draw-region ((this drawable-region-face) (arg0 int)) + (when (zero? arg0) + (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) + (t9-0 this arg0) + ) + ) + (let ((s5-0 (-> this bsphere))) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + s5-0 + (-> this data normal) + (meters 2) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere #t (bucket-id debug) s5-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x30)) + ) + ;; (add-debug-bound + ;; (bucket-id debug) + ;; (-> this data points) + ;; (the-as int (-> this data num-points)) + ;; (new 'static 'rgba :r #x80 :g #x80 :a #x40) + ;; (new 'static 'rgba :r #x80 :a #x40) + ;; 0 + ;; ) + 0 + (none) + ) + +(defmethod track-region ((this drawable-region-face) (arg0 region-prim-area)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 (inline-array vector))) + (-> this region) + (let* ((s4-0 (-> this data)) + (v1-1 (-> s4-0 normal)) + (a0-3 (>= 0.0 (- (vector-dot (-> arg0 pos) v1-1) (-> v1-1 w)))) + (s3-0 (>= 0.0 (- (vector-dot (-> arg0 exit-pos) v1-1) (-> v1-1 w)))) + ) + (when (!= a0-3 s3-0) + (when (nonzero? (-> s4-0 num-points)) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (-> s4-0 points)) + (ray-plane-intersect sv-48 sv-52 (-> arg0 pos) (-> arg0 ray) (-> sv-56 0) (-> sv-56 1) (-> sv-56 2)) + (let ((s4-1 (-> s4-0 num-points)) + (s2-0 0) + (s1-0 (vector-negate! (new 'stack-no-clear 'vector) sv-52)) + ) + (while (< (+ s2-0 2) (the-as int s4-1)) + (if (or (point-in-triangle-cross + sv-48 + sv-52 + (-> (the-as (inline-array vector) sv-56) 0) + (-> (the-as (inline-array vector) sv-56) 1) + (-> (the-as (inline-array vector) sv-56) 2) + ) + (point-in-triangle-cross + sv-48 + s1-0 + (-> (the-as (inline-array vector) sv-56) 0) + (-> (the-as (inline-array vector) sv-56) 1) + (-> (the-as (inline-array vector) sv-56) 2) + ) + ) + (goto cfg-17) + ) + (+! s2-0 1) + (set! sv-56 (the-as (inline-array vector) (-> (the-as (inline-array vector) sv-56) 1))) + ) + ) + (set! s3-0 s3-0) + (goto cfg-20) + ) + (label cfg-17) + (if s3-0 + (track-entered-region! arg0 (the-as drawable-region-sphere this)) + (track-exited-region! arg0 (the-as drawable-region-sphere this)) + ) + ) + (label cfg-20) + s3-0 + ) + ) + +(defmethod debug-draw-region ((this drawable-region-volume) (arg0 int)) + (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) + (t9-0 this arg0) + ) + (let* ((s5-0 (-> this faces length)) + (s4-0 0) + (a0-3 (-> this faces data s4-0)) + ) + (while (< s4-0 s5-0) + (debug-draw-region a0-3 1) + (+! s4-0 1) + (set! a0-3 (-> this faces data s4-0)) + ) + ) + 0 + (none) + ) + +(defmethod track-region ((this drawable-region-volume) (arg0 region-prim-area)) + (if (within-area? this arg0) + (track-start-region! arg0 (the-as drawable-region-sphere this)) + ) + (let* ((s4-0 (-> this faces length)) + (s3-0 0) + (a0-4 (-> this faces data s3-0)) + ) + (while (< s3-0 s4-0) + (if (not (track-region a0-4 arg0)) + (return #f) + ) + (+! s3-0 1) + (set! a0-4 (-> this faces data s3-0)) + ) + ) + (track-inside-region! arg0 (the-as drawable-region-sphere this)) + #t + ) + +(defmethod within-area? ((this drawable-region-volume) (arg0 region-prim-area)) + "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" + (let* ((v1-1 (-> this faces length)) + (a2-0 0) + (a3-2 (-> this faces data a2-0)) + ) + (while (< a2-0 v1-1) + (let ((a3-4 (-> a3-2 data normal))) + (if (< 0.0 (- (vector-dot (-> arg0 pos) a3-4) (-> a3-4 w))) + (return #f) + ) + ) + (+! a2-0 1) + (set! a3-2 (-> this faces data a2-0)) + ) + ) + #t + ) + +(defmethod drawable-tree-region-prim-method-17 ((this drawable-tree-region-prim) (arg0 vector)) + ;; og:preserve-this + (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) pos)) arg0 0.0) + (let* ((s5-0 (-> this data2 (+ (-> this length) -1) length)) + (s4-0 0) + (a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) + ) + (while (< s4-0 s5-0) + ;; og:preserve-this + (if (within-area? (the-as drawable-region-prim a0-8) (scratchpad-object region-prim-area)) + (return #t) + ) + (+! s4-0 1) + (set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) + ) + ) + #f + ) + +;; WARN: Return type mismatch int vs symbol. +(defmethod point-in-region-debug! ((this region) (arg0 vector)) + "Debug check to see if point is in region. This is not efficient, since it has to find the parent geometry of this region." + (local-vars (sv-16 int) (sv-32 int)) + ;; og:preserve-this + (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) pos)) arg0 0.0) + (dotimes (s5-0 (-> *level* length)) + (let ((s4-0 (-> *level* level s5-0))) + (when (= (-> s4-0 status) 'active) + (when (nonzero? (-> s4-0 bsp region-trees)) + (let* ((s3-0 (-> s4-0 bsp region-trees length)) + (s2-0 0) + (s1-0 (-> s4-0 bsp region-trees s2-0)) + ) + (while (< s2-0 s3-0) + (let ((s0-0 (-> s1-0 data2 (+ (-> s1-0 length) -1) length))) + (set! sv-16 0) + (set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1))))) + (while (< sv-16 s0-0) + (if (and (= (-> (the-as drawable-region-prim sv-32) region) this) + (within-area? + (the-as drawable-region-prim sv-32) + ;; og:preserve-this + (the-as region-prim-area (-> (scratchpad-object region-prim-area) region-prim-list)) + ) + ) + (return (the-as symbol sv-32)) + ) + (set! sv-16 (+ sv-16 1)) + (set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1))))) + ) + ) + (+! s2-0 1) + (set! s1-0 (-> s4-0 bsp region-trees s2-0)) + ) + ) + ) + ) + ) + ) + (the-as symbol #f) + ) + +(defmethod debug-print ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) + ;; og:preserve-this + (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) pos)) arg0 0.0) + (let* ((s4-0 (-> this data2 (+ (-> this length) -1) length)) + (s3-0 0) + (s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) + ) + (while (< s3-0 s4-0) + ;; og:preserve-this + (if (within-area? (the-as drawable-region-prim s2-0) (scratchpad-object region-prim-area)) + (format + arg1 + " splitbox-~D ~A~%" + (-> (the-as drawable-region-prim s2-0) id) + (the-as drawable-region-prim s2-0) + ) + ) + (+! s3-0 1) + (set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) + ) + ) + 0 + (none) + ) + +(defun region-tree-execute ((arg0 symbol) (arg1 vector) (arg2 vector)) + (local-vars (sv-32 vector)) + (set! sv-32 (vector-average! (new 'stack-no-clear 'vector) arg1 arg2)) + (set! (-> sv-32 w) (* 0.5 (vector-vector-distance arg1 arg2))) + ;; og:preserve-this + (set! (-> (scratchpad-object region-prim-area) region-prim-list num-items) 0) + (set! (-> (scratchpad-object region-prim-area) region-enter-count) 0) + (set! (-> (scratchpad-object region-prim-area) region-exit-count) 0) + (set! (-> (scratchpad-object region-prim-area) region-inside-count) 0) + (set! (-> (scratchpad-object region-prim-area) region-start-count) 0) + (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) pos)) arg1 0.0) + (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) exit-pos)) arg2 0.0) + (vector-! (-> (scratchpad-object region-prim-area) ray) arg2 arg1) + (vector-! (-> (scratchpad-object region-prim-area) exit-ray) arg1 arg2) + (dotimes (s5-1 (-> *level* length)) + (let ((v1-17 (-> *level* level s5-1))) + (when (= (-> v1-17 status) 'active) + (let ((s4-1 (-> v1-17 bsp region-trees))) + (when (nonzero? s4-1) + (let* ((s3-0 (-> s4-1 length)) + (s2-0 0) + (a0-14 (-> s4-1 s2-0)) + ) + (while (< s2-0 s3-0) + (if (= (-> a0-14 name) arg0) + ;; og:preserve-this + (collect-regions a0-14 (the-as sphere sv-32) 0 (-> (scratchpad-object region-prim-area) region-prim-list)) + ) + (+! s2-0 1) + (set! a0-14 (-> s4-1 s2-0)) + ) + ) + ) + ) + ) + ) + ) + ;; og:preserve-this + (countdown (gp-1 (-> (scratchpad-object region-prim-area) region-prim-list num-items)) + (track-region + (-> (scratchpad-object region-prim-area) region-prim-list items gp-1) + (the-as region-prim-area (-> (scratchpad-object region-prim-area) region-prim-list)) + ) + ) + (let ((gp-2 (-> (scratchpad-object region-prim-area) region-enter-count))) + (while (begin (label cfg-22) (nonzero? gp-2)) + (+! gp-2 -1) + (let* ((a2-5 (-> (scratchpad-object region-prim-area) region-enter-list gp-2)) + (s5-2 (-> a2-5 on-enter)) + ) + (when s5-2 + (countdown (v1-47 (-> (scratchpad-object region-prim-area) region-start-count)) + (if (= a2-5 (-> (scratchpad-object region-prim-area) region-start-list v1-47)) + (goto cfg-22) + ) + ) + (script-eval + s5-2 + :key a2-5 + :vector (-> (scratchpad-object region-prim-area) region-enter-prim-list gp-2 bsphere) + ) + ) + ) + ) + ) + ;; og:preserve-this + (let ((gp-3 (-> (scratchpad-object region-prim-area) region-exit-count))) + (while (begin (label cfg-31) (nonzero? gp-3)) + (+! gp-3 -1) + (let* ((a2-6 (-> (scratchpad-object region-prim-area) region-exit-list gp-3)) + (s5-3 (-> a2-6 on-exit)) + ) + (when s5-3 + (countdown (v1-64 (-> (scratchpad-object region-prim-area) region-inside-count)) + (if (= a2-6 (-> (scratchpad-object region-prim-area) region-inside-list v1-64)) + (goto cfg-31) + ) + ) + (script-eval + s5-3 + :key a2-6 + :vector (-> (scratchpad-object region-prim-area) region-exit-prim-list gp-3 bsphere) + ) + ) + ) + ) + ) + ;; og:preserve-this + (countdown (gp-4 (-> (scratchpad-object region-prim-area) region-inside-count)) + (let* ((a2-7 (-> (scratchpad-object region-prim-area) region-inside-list gp-4)) + (s5-4 (-> a2-7 on-inside)) + ) + (if s5-4 + (script-eval + s5-4 + :key a2-7 + :vector (-> (scratchpad-object region-prim-area) region-inside-prim-list gp-4 bsphere) + ) + ) + ) + ) + 0 + (none) + ) + +(defun region-execute () + (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) + (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) + (when (and *execute-regions* (-> *setting-control* user-current region-mode) (not (paused?))) + (region-tree-execute 'camera (-> *level* camera-pos 1) (the-as vector (-> *level* camera-pos))) + (region-tree-execute 'target (-> *level* target-pos 1) (the-as vector (-> *level* target-pos))) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs drawable-region-prim. +(defun region-prim-lookup-by-id ((arg0 int) (arg1 symbol) (arg2 int)) + (let ((v1-0 -1)) + (dotimes (a3-0 (-> *level* length)) + (let ((t0-3 (-> *level* level a3-0))) + (when (= (-> t0-3 status) 'active) + (when (nonzero? (-> t0-3 bsp region-trees)) + (let* ((t1-8 (-> t0-3 bsp region-trees length)) + (t2-1 0) + (t3-2 (-> t0-3 bsp region-trees t2-1)) + ) + (while (< t2-1 t1-8) + (when (or (not arg1) (= (-> t3-2 name) arg1)) + (let* ((t4-10 (-> t3-2 data2 (+ (-> t3-2 length) -1) length)) + (t5-0 0) + (t6-2 (the-as object (+ (+ (* t5-0 32) 32) (the-as int (-> t3-2 data2 (+ (-> t3-2 length) -1)))))) + ) + (while (< t5-0 t4-10) + (when (= (-> (the-as drawable-region-prim t6-2) region id) arg0) + (+! v1-0 1) + (if (= v1-0 arg2) + (return (the-as drawable-region-prim t6-2)) + ) + ) + (+! t5-0 1) + (set! t6-2 (+ (+ (* t5-0 32) 32) (the-as int (-> t3-2 data2 (+ (-> t3-2 length) -1))))) + ) + ) + ) + (+! t2-1 1) + (set! t3-2 (-> t0-3 bsp region-trees t2-1)) + ) + ) + ) + ) + ) + ) + ) + (the-as drawable-region-prim #f) + ) + +(defun region-lookup-by-id ((arg0 int)) + (dotimes (v1-0 (-> *level* length)) + (let ((a1-3 (-> *level* level v1-0))) + (when (= (-> a1-3 status) 'active) + (when (nonzero? (-> a1-3 bsp region-array)) + (let* ((a2-8 (-> a1-3 bsp region-array length)) + (a3-1 0) + (t0-2 (-> a1-3 bsp region-array data a3-1)) + ) + (while (< a3-1 a2-8) + (if (= (-> t0-2 id) arg0) + (return t0-2) + ) + (+! a3-1 1) + (set! t0-2 (-> a1-3 bsp region-array data a3-1)) + ) + ) + ) + ) + ) + ) + (the-as region #f) + ) diff --git a/goal_src/jak3/engine/load/decomp.gc b/goal_src/jak3/engine/load/decomp.gc index 4069aa1469..c99650612c 100644 --- a/goal_src/jak3/engine/load/decomp.gc +++ b/goal_src/jak3/engine/load/decomp.gc @@ -316,8 +316,9 @@ ) ) ) - (s1-0 (&-> (the-as (pointer int8) #x70000000) 0)) - (s0-0 (the-as (pointer int8) (+ 2048 #x70000000))) + ;; og:preserve-this + (s1-0 (&-> (the-as (pointer int8) *fake-scratchpad-data*) 0)) + (s0-0 (the-as (pointer int8) (&+ *fake-scratchpad-data* 2048))) (s4-1 (-> this bsp visible-list-length)) ) (when (zero? (the-as vis-info-flag s2-0)) diff --git a/goal_src/jak3/engine/load/file-io.gc b/goal_src/jak3/engine/load/file-io.gc index a16e942505..fd658610fd 100644 --- a/goal_src/jak3/engine/load/file-io.gc +++ b/goal_src/jak3/engine/load/file-io.gc @@ -145,20 +145,22 @@ NOTE: this is a special type in three ways: (format *file-temp-string* "map~D/~S-mp" MAP_FILE_VERSION name) ) ((= kind (file-kind art-group)) - (format - *file-temp-string* - "art-group~D/~S-ag" - (cond - ((> ag-version-override 0) - (empty) - ag-version-override - ) - (else - ART_GROUP_FILE_VERSION - ) - ) - name - ) + ;; og:preserve-this removed art group prefix + ; (format + ; *file-temp-string* + ; "art-group~D/~S-ag" + ; (cond + ; ((> ag-version-override 0) + ; (empty) + ; ag-version-override + ; ) + ; (else + ; ART_GROUP_FILE_VERSION + ; ) + ; ) + ; name + ; ) + (format *file-temp-string* "~S-ag" name) ) ) *file-temp-string* diff --git a/goal_src/jak3/engine/math/matrix-compose.gc b/goal_src/jak3/engine/math/matrix-compose.gc index c04d1cfef9..7f8e1688b1 100644 --- a/goal_src/jak3/engine/math/matrix-compose.gc +++ b/goal_src/jak3/engine/math/matrix-compose.gc @@ -21,7 +21,7 @@ arg0 ) -(defun matrix-fr-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) +(defun matrix-fr-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) (set! (-> arg0 fvec quad) (-> arg1 quad)) (set! (-> arg0 rvec quad) (-> arg2 quad)) (vector-cross! (-> arg0 uvec) arg1 arg2) @@ -43,7 +43,7 @@ arg0 ) -(defun matrix-f-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) +(defun matrix-f-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) (set! (-> arg0 fvec quad) (-> arg1 quad)) (vector-cross! (-> arg0 uvec) arg1 arg2) (vector-normalize! (-> arg0 uvec) 1.0) diff --git a/goal_src/jak3/engine/nav/nav-mesh.gc b/goal_src/jak3/engine/nav/nav-mesh.gc index cd7f7e83b0..5f90dcac16 100644 --- a/goal_src/jak3/engine/nav/nav-mesh.gc +++ b/goal_src/jak3/engine/nav/nav-mesh.gc @@ -5,5 +5,19 @@ ;; name in dgo: nav-mesh ;; dgos: GAME +(defmethod initialize-nav-mesh! ((this entity-nav-mesh)) + (format #t "skipping initialize-nav-mesh~%") + (none)) + +(defmethod birth! ((this entity-nav-mesh)) + (format #t "skipping birth! for entity-nav-mesh~%") + this + ) + +(defun nav-mesh-connect-from-ent ((arg0 process-drawable)) + #f + ) + + ;; DECOMP BEGINS diff --git a/goal_src/jak3/engine/physics/rigid-body.gc b/goal_src/jak3/engine/physics/rigid-body.gc index 30f7b06e09..eae6e9879c 100644 --- a/goal_src/jak3/engine/physics/rigid-body.gc +++ b/goal_src/jak3/engine/physics/rigid-body.gc @@ -397,7 +397,7 @@ (countdown (s0-0 (-> s4-0 num-prims)) (when (logtest? (-> s3-0 prim-core collide-with) (-> s1-0 prim-core collide-as)) (if (>= (-> s1-0 prim-core prim-type) 0) - ((method-of-object s3-0 collide-shape-prim-method-15)) + (collide-with-collide-cache-prim-mesh s3-0 arg1 s1-0) (collide-with-collide-cache-prim-sphere s3-0 arg1 s1-0) ) ) @@ -493,7 +493,7 @@ (set! (-> s5-0 step-count) 0) (until (not (and (< 0.05 (-> s5-0 time-step-scale)) (< (-> s5-0 step-count) (the-as int (-> this max-iteration-count)))) ) - (set! (-> s5-0 best-dist) -100000000.0) + (set! (-> s5-0 cquery best-dist) -100000000.0) (set! (-> s5-0 cquery best-my-prim) #f) (set! (-> s5-0 cquery best-other-prim) #f) (set! (-> s5-0 orig-position quad) (-> arg0 position quad)) @@ -505,7 +505,7 @@ (rigid-body-control-method-26 arg0) (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (collide-with-all-collide-cache-prims this (-> s5-0 mat) (-> s5-0 cquery)) - (let ((f30-0 (-> s5-0 best-dist))) + (let ((f30-0 (-> s5-0 cquery best-dist))) (b! (>= f30-0 0.0) cfg-3 :delay #f) (rigid-body-control-method-14 arg0 (* (-> s5-0 time-step-scale) (-> s5-0 time-step))) (init-velocities! arg0) @@ -513,8 +513,7 @@ (set! (-> s5-0 time-step-scale) 0.0) (b! #t cfg-55 :delay (nop!)) (label cfg-3) - *touching-list* - ((method-of-type touching-list touching-list-method-11)) + (update-from-step-size *touching-list* f30-0) (rigid-body-control-method-14 arg0 (* (-> s5-0 time-step-scale) (-> s5-0 time-step) f30-0)) ) (init-velocities! arg0) @@ -681,7 +680,7 @@ ) (rigid-body-control-method-12 arg0 1.0) (init-velocities! arg0) - (let ((f30-3 (-> s5-0 best-dist))) + (let ((f30-3 (-> s5-0 cquery best-dist))) (when (< f30-3 0.0001) (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 impact-info normal) 40.96) (rigid-body-control-method-26 arg0) @@ -962,7 +961,7 @@ (set! (-> s5-0 total-prims) (the-as uint 1)) (set! (-> s5-0 root-prim) s4-0) ) - ((method-of-object s5-0 collide-shape-method-54)) + (pusher-init s5-0) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (let ((v1-16 (-> s5-0 root-prim))) (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable.gc b/goal_src/jak3/engine/process-drawable/process-drawable.gc index ed4e018d26..22e784c31d 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable.gc @@ -13,6 +13,36 @@ (define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process)) +(#when PC_PORT + +(define *display-bones* #f) +(define *display-joint-names* #f) + +(defun draw-joint-spheres ((arg0 process-drawable)) + (dotimes (s5-0 (-> arg0 node-list length)) + (let ((a2-0 (vector<-cspace! (new-stack-vector0) (-> arg0 node-list data s5-0)))) + (add-debug-sphere #t (bucket-id debug) a2-0 (meters 0.2) (new 'static 'rgba :g #xff :a #x40)) + (#when PC_PORT + (add-debug-text-sphere (!= (-> arg0 node-list data s5-0 joint) #f) (bucket-id debug) a2-0 (meters 0.1) (the string (-> arg0 node-list data s5-0 joint name)) (static-rgba 0 #xff 0 #x40))) + ) + ) + #f + ) + +(defun-debug draw-bone-lines ((this process-drawable)) + "Added in PC port to debug bones" + (dotimes (i (-> this node-list length)) + (let ((parent (-> this node-list data i parent))) + (when (and parent (nonzero? parent) (-> parent joint) (-> parent parent)) + (let ((child (vector<-cspace! (new-stack-vector0) (-> this node-list data i))) + ) + (add-debug-line #t (bucket-id debug) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :r #xff :a #x40) #f (the rgba -1)) + ) + ) + ) + ) + )) + ;; DECOMP BEGINS (defmethod add-to-loading-level ((this skeleton-group)) @@ -68,6 +98,19 @@ (init-vf0-vector) (.lvf vf2 (&-> (-> arg1 bone) transform trans quad)) (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + + ;; og:preserve-this ADDED (also added in jak1) + ;; there's a bug in swamp-blimp where they vector<-cspace! + ;; on some default-initialized-to-zero bones + ;; we have to return 0s for this to avoid NaNs getting everywhere. + (let ((temp (new-stack-vector0))) + (.svf (&-> temp quad) vf2) + (when (= (-> temp w) 0.0) + (set-vector! arg0 0. 0. 0. 1.) + (return arg0) + ) + ) + (.wait.vf) (.mul.vf vf2 vf2 Q :mask #b111) (.nop.vf) @@ -391,28 +434,25 @@ ) ) (let ((s3-0 (+ s5-0 2))) - ((-> arg1 generate-frame-function) (the-as joint-anim-frame (+ 2400 #x70000000)) s3-0 arg1) + ;; og:preserve-this + ((-> arg1 generate-frame-function) (the-as joint-anim-frame (+ 2400 (scratchpad-object int))) s3-0 arg1) (if (-> arg1 prebind-function) - ((-> arg1 prebind-function) (the-as joint-anim-frame (+ 2400 #x70000000)) s3-0 arg1) + ((-> arg1 prebind-function) (the-as joint-anim-frame (+ 2400 (scratchpad-object int))) s3-0 arg1) ) ) (dotimes (s3-1 1) (let* ((v1-11 (-> arg0 data s3-1)) - (t9-2 (-> v1-11 param0)) + (t9-2 (the-as function (-> v1-11 param0))) ) - (when t9-2 - (let ((a0-6 v1-11) - (a1-3 (-> v1-11 param1)) - ) - (-> v1-11 param2) - (t9-2 a0-6 (the-as transformq a1-3)) + (if (the-as (function cspace transformq none) t9-2) + ((the-as (function object object object none) t9-2) v1-11 (-> v1-11 param1) (-> v1-11 param2)) ) - ) ) ) (dotimes (s3-2 2) (let* ((a0-8 (-> arg0 data (+ s3-2 1))) - (a1-5 (+ (* s3-2 64) 2400 #x70000000)) + ;; og:preserve-this + (a1-5 (+ (* s3-2 64) 2400 (scratchpad-object int))) (t9-3 (-> a0-8 param0)) ) (if t9-3 @@ -426,14 +466,16 @@ (dotimes (s4-1 s5-0) (cspace<-parented-transformq-joint! (-> arg0 data (+ s4-1 s3-3)) - (the-as transformq (+ (* 48 s4-1) 2528 #x70000000)) + ;; og:preserve-this + (the-as transformq (+ (* 48 s4-1) 2528 (scratchpad-object int))) ) ) ) (else (dotimes (s4-2 s5-0) (let ((a0-10 (-> arg0 data (+ s4-2 s3-3))) - (a1-9 (+ (* 48 s4-2) 2528 #x70000000)) + ;; og:preserve-this + (a1-9 (+ (* 48 s4-2) 2528 (scratchpad-object int))) ) (if (-> a0-10 param0) ((-> a0-10 param0) a0-10 (the-as transformq a1-9)) @@ -487,6 +529,13 @@ ) ) ) + ;; og:preserve-this + (#when PC_PORT (when *debug-segment* + (when *display-bones* + (draw-bone-lines (the-as process-drawable (-> this process)))) + (if *display-joint-names* + (draw-joint-spheres (the-as process-drawable (-> this process)))) + )) 0 (none) ) @@ -1463,18 +1512,18 @@ (if (or (zero? s4-0) (or (not (-> gp-0 root-channel 0 frame-group)) (zero? (-> gp-0 active-channels)))) (logior! (-> this draw status) (draw-control-status no-draw-temp)) ) - (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid)) - (merc-blend-shape this) - ) - (if (logtest? (-> this skel status) (joint-control-status eye-anim-valid eye-anim)) - (merc-eye-anim this) - ) + ;; (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid)) + ;; (merc-blend-shape this) + ;; ) + ;; (if (logtest? (-> this skel status) (joint-control-status eye-anim-valid eye-anim)) + ;; (merc-eye-anim this) + ;; ) (label cfg-45) - (let ((a0-26 (-> gp-0 effect))) - (if a0-26 - (effect-control-method-9 a0-26) - ) - ) + ;; (let ((a0-26 (-> gp-0 effect))) + ;; (if a0-26 + ;; (effect-control-method-9 a0-26) + ;; ) + ;; ) ) 0 (none) diff --git a/goal_src/jak3/engine/spatial-hash/actor-hash.gc b/goal_src/jak3/engine/spatial-hash/actor-hash.gc index 95d57281ba..5d1a6552d6 100644 --- a/goal_src/jak3/engine/spatial-hash/actor-hash.gc +++ b/goal_src/jak3/engine/spatial-hash/actor-hash.gc @@ -7,3 +7,1312 @@ ;; DECOMP BEGINS +(kmemopen global "actor-hash") + +(define *actor-hash* (new 'global 'spatial-hash 4096 256)) + +(kmemclose) + +(deftype actor-cshape-ptr (structure) + ((cshape collide-shape) + ) + ) + + +(deftype actor-hash-bucket (structure) + ((length int16) + (max-length int16) + (data (inline-array actor-cshape-ptr)) + ) + :allow-misaligned + (:methods + (add-actor-cshape (_type_ collide-shape) none) + ) + ) + + +(defmethod add-actor-cshape ((this actor-hash-bucket) (arg0 collide-shape)) + (let ((v1-0 (-> this length))) + (when (< v1-0 (-> this max-length)) + (set! (-> this data v1-0 cshape) arg0) + (set! (-> this length) (+ v1-0 1)) + ) + ) + 0 + (none) + ) + +(deftype actor-hash-buckets (structure) + ((hash spatial-hash) + (list engine) + (data actor-hash-bucket 4 :inline) + (tpos vector :inline) + ) + (:methods + (hash-actors (_type_) none) + ) + ) + + +(defmethod hash-actors ((this actor-hash-buckets)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (set! (-> this hash) *actor-hash*) + (set! (-> this list) *collide-hit-by-others-list*) + (clear-objects! (-> this hash)) + (cond + ((>= 256 (-> this list length)) + (let ((a0-4 (-> this list alive-list next0))) + (-> this list) + (let ((v1-8 (-> a0-4 next0))) + (while (!= a0-4 (-> this list alive-list-end)) + (let* ((a0-5 (-> (the-as connection a0-4) param1)) + (a1-0 (-> this hash)) + (t0-0 (-> (the-as collide-shape a0-5) root-prim prim-core)) + (a3-0 a0-5) + (a2-1 (-> a1-0 object-count)) + ) + (set! a2-1 (cond + ((< a2-1 (-> a1-0 max-object-count)) + (let ((t1-2 (-> a1-0 sphere-array a2-1)) + (t2-2 (-> a1-0 object-array a2-1)) + ) + (let ((t3-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((t5-0 (-> t3-1 0))) + (let ((t4-0 t0-0)) + (let ((t6-0 (- (-> t0-0 world-sphere w)))) + (.mov vf6 t6-0) + ) + (.lvf vf4 (&-> t4-0 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t5-0 quad) vf5) + ) + (let ((t5-1 (-> t3-1 1))) + (let ((t4-1 t0-0)) + (let ((t6-1 (-> t0-0 world-sphere w))) + (.mov vf6 t6-1) + ) + (.lvf vf4 (&-> t4-1 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t5-1 quad) vf5) + ) + (dotimes (t4-2 3) + (set! (-> a1-0 box-min t4-2) (fmin (-> a1-0 box-min t4-2) (-> (&-> t3-1 0 data t4-2) 0))) + (set! (-> a1-0 box-max t4-2) (fmax (-> a1-0 box-max t4-2) (-> (&-> t3-1 0 data t4-2) 4))) + ) + ) + (set! (-> t1-2 quad) (-> t0-0 world-sphere quad)) + (set! (-> t2-2 object) a3-0) + ) + (+! (-> a1-0 object-count) 1) + a2-1 + ) + (else + -1 + ) + ) + ) + (set! (-> (the-as collide-shape a0-5) actor-hash-index) a2-1) + ) + (set! a0-4 v1-8) + (-> this list) + (set! v1-8 (-> v1-8 next0)) + ) + ) + ) + ) + (else + (set! (-> this tpos quad) (-> (target-pos 0) quad)) + (dotimes (v1-13 4) + (set! (-> this data v1-13 length) 0) + ) + (let ((v1-17 (-> this list alive-list next0))) + (-> this list) + (let ((s5-1 (-> v1-17 next0))) + (while (!= v1-17 (-> this list alive-list-end)) + (let* ((s4-0 (-> (the-as connection v1-17) param1)) + (f0-7 (vector-vector-distance-squared (-> this tpos) (-> (the-as collide-shape s4-0) trans))) + (f1-2 102400.0) + ) + (cond + ((< f0-7 (* f1-2 f1-2)) + ((method-of-type actor-hash-bucket add-actor-cshape) + (the-as actor-hash-bucket (-> this data)) + (the-as collide-shape s4-0) + ) + ) + ((let ((f1-5 204800.0)) + (< f0-7 (* f1-5 f1-5)) + ) + (add-actor-cshape (-> this data 1) (the-as collide-shape s4-0)) + ) + ((let ((f1-8 307200.0)) + (< f0-7 (* f1-8 f1-8)) + ) + (add-actor-cshape (-> this data 2) (the-as collide-shape s4-0)) + ) + (else + (add-actor-cshape (-> this data 3) (the-as collide-shape s4-0)) + ) + ) + ) + (set! v1-17 s5-1) + (-> this list) + (set! s5-1 (-> s5-1 next0)) + ) + ) + ) + (dotimes (v1-34 4) + (let ((a0-22 (-> this data v1-34))) + (countdown (a1-10 (-> a0-22 length)) + (let* ((a2-4 (-> a0-22 data a1-10 cshape)) + (a3-4 (-> this hash)) + (t2-3 (-> a2-4 root-prim prim-core)) + (t1-3 a2-4) + (t0-3 (-> a3-4 object-count)) + ) + (set! t0-3 + (cond + ((< t0-3 (-> a3-4 max-object-count)) + (let ((t3-6 (-> a3-4 sphere-array t0-3)) + (t4-5 (-> a3-4 object-array t0-3)) + ) + (let ((t5-15 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((t7-0 (-> t5-15 0))) + (let ((t6-2 t2-3)) + (let ((t8-0 (- (-> t2-3 world-sphere w)))) + (.mov vf6 t8-0) + ) + (.lvf vf4 (&-> t6-2 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t7-0 quad) vf5) + ) + (let ((t7-1 (-> t5-15 1))) + (let ((t6-3 t2-3)) + (let ((t8-1 (-> t2-3 world-sphere w))) + (.mov vf6 t8-1) + ) + (.lvf vf4 (&-> t6-3 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t7-1 quad) vf5) + ) + (dotimes (t6-4 3) + (set! (-> a3-4 box-min t6-4) (fmin (-> a3-4 box-min t6-4) (-> (&-> t5-15 0 data t6-4) 0))) + (set! (-> a3-4 box-max t6-4) (fmax (-> a3-4 box-max t6-4) (-> (&-> t5-15 0 data t6-4) 4))) + ) + ) + (set! (-> t3-6 quad) (-> t2-3 world-sphere quad)) + (set! (-> t4-5 object) t1-3) + ) + (+! (-> a3-4 object-count) 1) + t0-3 + ) + (else + -1 + ) + ) + ) + (set! (-> a2-4 actor-hash-index) t0-3) + ) + ) + ) + ) + ) + ) + (update-from-spheres (-> this hash)) + 0 + (none) + ) + ) + +(define *actor-hash-buckets* + (new 'static 'actor-hash-buckets + :data (new 'static 'inline-array actor-hash-bucket 4 + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + ) + ) + ) + +(defun update-actor-hash () + (local-vars (a0-3 int) (a0-5 int)) + (let* ((v1-1 (-> *perf-stats* data 6)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (hash-actors *actor-hash-buckets*) + (let ((v1-6 (-> *perf-stats* data 6))) + (b! (zero? (-> v1-6 ctrl)) cfg-4 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-3 pcr0) + (+! (-> v1-6 accum0) a0-3) + (.mfpc a0-5 pcr1) + (+! (-> v1-6 accum1) a0-5) + ) + (label cfg-4) + 0 + 0 + (none) + ) diff --git a/goal_src/jak3/engine/spatial-hash/collide-hash-h.gc b/goal_src/jak3/engine/spatial-hash/collide-hash-h.gc index e30484cb27..72d9820f57 100644 --- a/goal_src/jak3/engine/spatial-hash/collide-hash-h.gc +++ b/goal_src/jak3/engine/spatial-hash/collide-hash-h.gc @@ -43,6 +43,7 @@ and a pointer to the actual collide-hash-fragment, or possibly a TIE." ((id uint32) (collidable basic) ) + :pack-me ) diff --git a/goal_src/jak3/engine/spatial-hash/collide-hash.gc b/goal_src/jak3/engine/spatial-hash/collide-hash.gc index d56b497989..4a6fd9bd34 100644 --- a/goal_src/jak3/engine/spatial-hash/collide-hash.gc +++ b/goal_src/jak3/engine/spatial-hash/collide-hash.gc @@ -5,5 +5,673 @@ ;; name in dgo: collide-hash ;; dgos: GAME +(defmacro .sll (result in sa) + `(set! ,result (sext32 (the-as int (shl (logand ,in #xffffffff) ,sa)))) + ) + ;; DECOMP BEGINS +;; WARN: Return type mismatch symbol vs none. +(defun add-collide-debug-box ((arg0 vector) (arg1 rgba)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((a3-0 (new 'stack-no-clear 'bounding-box))) + (nop!) + (.lvf vf1 (&-> arg0 quad)) + (.sub.w.vf vf2 vf1 vf1) + (nop!) + (.add.w.vf vf3 vf1 vf1) + (nop!) + (nop!) + (.svf (&-> a3-0 min quad) vf2) + (nop!) + (.svf (&-> a3-0 max quad) vf3) + (add-debug-box #t (bucket-id debug) (-> a3-0 min) (-> a3-0 max) arg1) + ) + (none) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defun-debug print-collide-cache-tri-count () + (let ((gp-0 0) + (s4-0 0) + (s5-0 0) + (s3-0 0) + ) + (let ((v1-0 *collide-cache*)) + (dotimes (a0-0 (-> v1-0 num-tris)) + (case (-> v1-0 tris a0-0 pat mode) + (((pat-mode ground)) + (+! gp-0 1) + ) + (((pat-mode wall)) + (+! s5-0 1) + ) + (((pat-mode obstacle)) + (+! s4-0 1) + ) + (else + (+! s3-0 1) + ) + ) + ) + (format *stdcon* "tris ~d (~4,,1f%) " (-> v1-0 num-tris) (* 0.2173913 (the float (-> v1-0 num-tris)))) + ) + (format *stdcon* "(ground ~d, wall ~d, obstacle ~d, other ~d)~%" gp-0 s5-0 s4-0 s3-0) + ) + (none) + ) + +(defun-debug print-exceeded-max-cache-tris () + (with-pp + (when (not (or *already-printed-exeeded-max-cache-tris* *display-capture-mode*)) + (set! *already-printed-exeeded-max-cache-tris* #t) + (if pp + (format *stdcon* "Exceeded collide cache max # of tris (~s)!~%" (-> pp name)) + (format *stdcon* "Exceeded collide cache max # of tris!~%") + ) + (print-collide-cache-tri-count) + ) + 0 + (none) + ) + ) + +(defmethod-mips2c "(method 11 collide-hash)" 11 collide-hash) + +(defmethod-mips2c "(method 12 collide-hash)" 12 collide-hash) + +(def-mips2c fill-bg-using-box-new (function collide-cache object collide-query none)) + +(def-mips2c fill-bg-using-line-sphere-new (function collide-cache object collide-query none)) + +(defun collide-list-fill-bg-using-box ((arg0 collide-cache) (arg1 collide-list) (arg2 collide-query)) + (local-vars + (v1-12 uint128) + (v1-14 uint128) + (v1-15 uint128) + (a0-10 uint128) + (a0-11 uint128) + (a1-3 uint128) + (a2-3 uint128) + (a2-4 uint128) + (sv-16 int) + (sv-20 collide-list) + (sv-640 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (set! sv-16 (-> arg1 num-items)) + (set! sv-20 arg1) + (dotimes (s4-0 sv-16) + (let ((s3-0 (-> sv-20 items s4-0 mesh))) + (cond + ((= (-> s3-0 type) instance-tie) + (let* ((v1-4 s3-0) + (s1-0 (-> v1-4 bucket-ptr)) + ) + (when (not (or (logtest? (-> s1-0 flags) (prototype-flags no-collide)) + (logtest? (-> v1-4 flags) (instance-flags no-collide)) + ) + ) + (if *collide-list-boxes* + (add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :a #x80)) + ) + (let ((s0-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'collide-query)) + ) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg2) 540) + (nop!) + (nop!) + (let ((v1-11 (the-as uint128 (-> s3-0 origin long 3)))) + (nop!) + (let ((a2-2 (the-as uint128 (-> s3-0 origin long 0)))) + (.pextlh v1-12 v1-11 0) + (let ((a0-9 (the-as uint128 (-> s3-0 origin long 1)))) + (.pw.sra a1-3 v1-12 10) + (let ((v1-13 (the-as uint128 (-> s3-0 origin long 2)))) + (.pextlh a2-3 a2-2 0) + (nop!) + (.pw.sra a2-4 a2-3 16) + (nop!) + (.pextlh a0-10 a0-9 0) + (.mov vf4 a1-3) + (.pw.sra a0-11 a0-10 16) + (.mov vf1 a2-4) + (.pextlh v1-14 v1-13 0) + ) + ) + ) + ) + (.mov vf2 a0-11) + (.pw.sra v1-15 v1-14 16) + (.lvf vf5 (&-> s3-0 bsphere quad)) + (nop!) + (.mov vf3 v1-15) + (.itof.vf vf4 vf4) + (nop!) + (vitof12.xyzw vf1 vf1) + (nop!) + (vitof12.xyzw vf2 vf2) + (nop!) + (vitof12.xyzw vf3 vf3) + (nop!) + (.add.vf vf4 vf4 vf5 :mask #b111) + (nop!) + (nop!) + (.svf (&-> s2-0 instance-mat rvec quad) vf1) + (nop!) + (.svf (&-> s2-0 instance-mat uvec quad) vf2) + (nop!) + (.svf (&-> s2-0 instance-mat fvec quad) vf3) + (nop!) + (.svf (&-> s2-0 instance-mat trans quad) vf4) + (matrix-4x4-inverse! s0-0 (-> s2-0 instance-mat)) + (nop!) + (nop!) + (.lvf vf7 (&-> arg2 bbox min quad)) + (nop!) + (.lvf vf14 (&-> arg2 bbox max quad)) + (nop!) + (.lvf vf1 (&-> s0-0 rvec quad)) + (nop!) + (.lvf vf2 (&-> s0-0 uvec quad)) + (nop!) + (.lvf vf3 (&-> s0-0 fvec quad)) + (nop!) + (.lvf vf4 (&-> s0-0 trans quad)) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf8 vf3 vf14 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf9 vf3 vf7 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf10 vf3 vf14 acc) + (nop!) + (.min.vf vf5 vf8 vf9) + (nop!) + (.max.vf vf6 vf8 vf9) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf11 vf3 vf7 acc) + (nop!) + (.min.vf vf5 vf5 vf10) + (nop!) + (.max.vf vf6 vf6 vf10) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf12 vf3 vf14 acc) + (nop!) + (.min.vf vf5 vf5 vf11) + (nop!) + (.max.vf vf6 vf6 vf11) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf13 vf3 vf7 acc) + (nop!) + (.min.vf vf5 vf5 vf12) + (nop!) + (.max.vf vf6 vf6 vf12) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf14 vf3 vf14 acc) + (nop!) + (.min.vf vf5 vf5 vf13) + (nop!) + (.max.vf vf6 vf6 vf13) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf7 vf3 vf7 acc) + (nop!) + (.min.vf vf5 vf5 vf14) + (nop!) + (.max.vf vf6 vf6 vf14) + (nop!) + (.min.vf vf5 vf5 vf7) + (nop!) + (.max.vf vf6 vf6 vf7) + (nop!) + (.ftoi.vf vf16 vf5) + (nop!) + (.ftoi.vf vf17 vf6) + (nop!) + (nop!) + (.svf (&-> s2-0 bbox min quad) vf5) + (nop!) + (.svf (&-> s2-0 bbox max quad) vf6) + (nop!) + (.svf (&-> s2-0 bbox4w min quad) vf16) + (nop!) + (.svf (&-> s2-0 bbox4w max quad) vf17) + (let ((s1-1 (-> s1-0 collide-hash-fragment-array))) + (set! sv-640 (-> s1-1 length)) + (set! (-> s2-0 instance-ptr) s3-0) + (dotimes (s3-1 sv-640) + ;; og:preserve-this + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 0) (the-as uint128 0)) + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 1) (the-as uint128 0)) + (set! (-> (scratchpad-object collide-hash-scratch) tris) (the-as uint 0)) + (fill-bg-using-box-new arg0 (-> s1-1 fragments s3-1) s2-0) + (+! (-> *collide-stats* tris) (-> (scratchpad-object collide-hash-scratch) tris)) + ) + ) + ) + ) + ) + ) + (else + (if *collide-list-boxes* + (add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ;; og:preserve-this + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 0) (the-as uint128 0)) + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 1) (the-as uint128 0)) + (set! (-> arg2 instance-ptr) #f) + (set! (-> (scratchpad-object collide-hash-scratch) tris) (the-as uint 0)) + (fill-bg-using-box-new arg0 s3-0 arg2) + (+! (-> *collide-stats* tris) (-> (scratchpad-object collide-hash-scratch) tris)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; ERROR: Unsupported inline assembly instruction kind - [sll v1, v1, 16] +(defun collide-list-fill-bg-using-line-sphere ((arg0 collide-cache) (arg1 collide-list) (arg2 collide-query)) + (local-vars + (v1-12 uint128) + (v1-14 uint128) + (v1-15 uint128) + (v1-17 number) + (v1-26 float) + (a0-10 uint128) + (a0-11 uint128) + (a1-3 uint128) + (a2-3 uint128) + (a2-4 uint128) + (sv-16 int) + (sv-640 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (set! sv-16 (-> arg1 num-items)) + (dotimes (s3-0 sv-16) + (let ((s2-0 (-> arg1 items s3-0 mesh))) + (cond + ((= (-> s2-0 type) instance-tie) + (let ((v1-4 s2-0)) + (when (not (or (logtest? (-> v1-4 bucket-ptr flags) (prototype-flags no-collide)) + (logtest? (-> v1-4 flags) (instance-flags no-collide)) + ) + ) + (if *collide-list-boxes* + (add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :a #x80)) + ) + (let ((s0-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'collide-query)) + ) + (mem-copy! (the-as pointer s1-0) (the-as pointer arg2) 540) + (nop!) + (let ((v1-11 (the-as uint128 (-> s2-0 origin long 3)))) + (nop!) + (let ((a2-2 (the-as uint128 (-> s2-0 origin long 0)))) + (.pextlh v1-12 v1-11 0) + (let ((a0-9 (the-as uint128 (-> s2-0 origin long 1)))) + (.pw.sra a1-3 v1-12 10) + (let ((v1-13 (the-as uint128 (-> s2-0 origin long 2)))) + (.pextlh a2-3 a2-2 0) + (nop!) + (.pw.sra a2-4 a2-3 16) + (nop!) + (.pextlh a0-10 a0-9 0) + (.mov vf4 a1-3) + (.pw.sra a0-11 a0-10 16) + (.mov vf1 a2-4) + (.pextlh v1-14 v1-13 0) + ) + ) + ) + ) + (.mov vf2 a0-11) + (.pw.sra v1-15 v1-14 16) + (.lvf vf5 (&-> s2-0 bsphere quad)) + (nop!) + (.mov vf3 v1-15) + (.itof.vf vf4 vf4) + (nop!) + (vitof12.xyzw vf1 vf1) + (nop!) + (vitof12.xyzw vf2 vf2) + (nop!) + (vitof12.xyzw vf3 vf3) + (nop!) + (.add.vf vf4 vf4 vf5 :mask #b111) + (nop!) + (nop!) + (.svf (&-> s1-0 instance-mat rvec quad) vf1) + (nop!) + (.svf (&-> s1-0 instance-mat uvec quad) vf2) + (nop!) + (.svf (&-> s1-0 instance-mat fvec quad) vf3) + (nop!) + (.svf (&-> s1-0 instance-mat trans quad) vf4) + (matrix-4x4-inverse! s0-0 (-> s1-0 instance-mat)) + (nop!) + (nop!) + (.lvf vf7 (&-> arg2 start-pos quad)) + (nop!) + (.lvf vf8 (&-> arg2 move-dist quad)) + (nop!) + (.lvf vf1 (&-> s0-0 rvec quad)) + (nop!) + (.lvf vf2 (&-> s0-0 uvec quad)) + (nop!) + (.lvf vf3 (&-> s0-0 fvec quad)) + (nop!) + (.lvf vf4 (&-> s0-0 trans quad)) + (.add.vf vf8 vf7 vf8) + (let ((v1-16 (-> s2-0 rmin-scale))) + (.mul.x.vf acc vf1 vf7) + (let ((f2-0 (-> arg2 radius))) + (.add.mul.y.vf acc vf2 vf7 acc) + (.sll v1-17 v1-16 16) + (.add.mul.z.vf acc vf3 vf7 acc) + (let ((f1-0 (the-as float v1-17))) + (.add.mul.w.vf vf7 vf4 vf0 acc) + (nop!) + (.mul.x.vf acc vf1 vf8) + (let ((f2-1 (* f2-0 f1-0))) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf8 vf4 vf0 acc) + (nop!) + (nop!) + (.svf (&-> s1-0 start-pos quad) vf7) + (.min.vf vf5 vf7 vf8) + (set! (-> s1-0 radius) f2-1) + ) + ) + ) + ) + (.max.vf vf6 vf7 vf8) + (nop!) + (nop!) + (.lvf vf9 (&-> s1-0 exit-planes 0 quad)) + (.sub.vf vf8 vf8 vf7) + (nop!) + (.sub.w.vf vf5 vf5 vf9) + (nop!) + (.add.w.vf vf6 vf6 vf9) + (nop!) + (nop!) + (.svf (&-> s1-0 move-dist quad) vf8) + (.ftoi.vf vf10 vf5) + (nop!) + (.ftoi.vf vf11 vf6) + (nop!) + (nop!) + (.svf (&-> s1-0 bbox min quad) vf5) + (nop!) + (.svf (&-> s1-0 bbox max quad) vf6) + (nop!) + (.svf (&-> s1-0 bbox4w min quad) vf10) + (nop!) + (.svf (&-> s1-0 bbox4w max quad) vf11) + (set! (-> s1-0 rlength x) (if (= (-> s1-0 move-dist x) 0.0) + 0.0 + (/ 1.0 (-> s1-0 move-dist x)) + ) + ) + (set! (-> s1-0 rlength y) (if (= (-> s1-0 move-dist y) 0.0) + 0.0 + (/ 1.0 (-> s1-0 move-dist y)) + ) + ) + (set! (-> s1-0 rlength z) (if (= (-> s1-0 move-dist z) 0.0) + 0.0 + (/ 1.0 (-> s1-0 move-dist z)) + ) + ) + (let ((f0-12 1.0)) + (.lvf vf1 (&-> (-> s1-0 move-dist) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-26 vf1) + (set! (-> s1-0 rlength w) (/ f0-12 v1-26)) + ) + (set! (-> s1-0 exit-planes 0 x) (if (< 0.0 (-> s1-0 move-dist x)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 0 y) (if (< 0.0 (-> s1-0 move-dist y)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 0 z) (if (< 0.0 (-> s1-0 move-dist z)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 1 x) (if (< (-> s1-0 move-dist x) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 1 y) (if (< (-> s1-0 move-dist y) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 1 z) (if (< (-> s1-0 move-dist z) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (let ((s0-1 (-> s2-0 bucket-ptr collide-hash-fragment-array))) + (set! sv-640 (-> s0-1 length)) + (set! (-> s1-0 instance-ptr) s2-0) + (dotimes (s2-1 sv-640) + ;; og:preserve-this + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 0) (the-as uint128 0)) + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 1) (the-as uint128 0)) + (set! (-> (scratchpad-object collide-hash-scratch) tris) (the-as uint 0)) + (fill-bg-using-line-sphere-new arg0 (-> s0-1 fragments s2-1) s1-0) + (+! (-> *collide-stats* tris) (-> (scratchpad-object collide-hash-scratch) tris)) + ) + ) + ) + ) + ) + ) + (else + (if *collide-list-boxes* + (add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ;; og:preserve-this + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 0) (the-as uint128 0)) + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits 1) (the-as uint128 0)) + (set! (-> arg2 instance-ptr) #f) + (set! (-> (scratchpad-object collide-hash-scratch) tris) (the-as uint 0)) + (fill-bg-using-line-sphere-new arg0 s2-0 arg2) + (+! (-> *collide-stats* tris) (-> (scratchpad-object collide-hash-scratch) tris)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod mem-usage ((this collide-hash) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 52 (-> usage length))) + (set! (-> usage data 51 name) "collision") + (+! (-> usage data 51 count) 1) + (let ((v1-8 (+ (* (-> this num-items) 8) 96 (* (-> this num-buckets) 4)))) + (+! (-> usage data 51 used) v1-8) + (+! (-> usage data 51 total) (logand -16 (+ v1-8 15))) + ) + (dotimes (v1-12 (the-as int (-> this qwc-id-bits))) + (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits v1-12) (the-as uint128 0)) + ) + (dotimes (s3-0 (the-as int (-> this num-items))) + (let* ((a0-11 (-> this item-array s3-0 id)) + (v1-17 (shr a0-11 5)) + ) + ;; og:preserve-this + (when (not (logtest? (->(scratchpad-object collide-hash-scratch) id-bits v1-17) (ash 1 (the-as int (logand a0-11 31)))) + ) + (logior! (-> (scratchpad-object collide-hash-scratch) id-bits v1-17) (ash 1 (the-as int (logand a0-11 31)))) + (if (= (-> this item-array s3-0 collidable type) collide-hash-fragment) + (mem-usage (-> this item-array s3-0 collidable) usage flags) + ) + ) + ) + ) + this + ) + +(defmethod mem-usage ((this collide-hash-fragment) (usage memory-usage-block) (flags int)) + (cond + ((logtest? flags 1) + (set! (-> usage length) (max 59 (-> usage length))) + (set! (-> usage data 56 name) "prototype-fragment") + (+! (-> usage data 56 count) 1) + (set! (-> usage data 57 name) "prototype-poly") + (+! (-> usage data 57 count) (-> this stats num-polys)) + (set! (-> usage data 58 name) "prototype-vertex") + (+! (-> usage data 58 count) (-> this stats num-verts)) + (let ((a3-0 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-6 (* (-> this stats num-polys) 4)) + (v1-16 (* (the-as uint 6) (-> this stats num-verts))) + ) + (+! (-> usage data 56 used) a3-0) + (+! (-> usage data 56 total) (- (logand -16 (+ v1-16 15 a2-6 a3-0)) (the-as int (+ a2-6 v1-16)))) + (+! (-> usage data 57 used) a2-6) + (+! (-> usage data 57 total) a2-6) + (+! (-> usage data 58 used) v1-16) + (+! (-> usage data 58 total) v1-16) + ) + ) + (else + (set! (-> usage length) (max 55 (-> usage length))) + (set! (-> usage data 52 name) "collision-fragment") + (+! (-> usage data 52 count) 1) + (set! (-> usage data 53 name) "collision-poly") + (+! (-> usage data 53 count) (-> this stats num-polys)) + (set! (-> usage data 54 name) "collision-vertex") + (+! (-> usage data 54 count) (-> this stats num-verts)) + (let ((a3-8 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-16 (* (-> this stats num-polys) 4)) + (v1-33 (* (the-as uint 6) (-> this stats num-verts))) + ) + (+! (-> usage data 52 used) a3-8) + (+! (-> usage data 52 total) (- (logand -16 (+ v1-33 15 a2-16 a3-8)) (the-as int (+ a2-16 v1-33)))) + (+! (-> usage data 53 used) a2-16) + (+! (-> usage data 53 total) a2-16) + (+! (-> usage data 54 used) v1-33) + (+! (-> usage data 54 total) v1-33) + ) + ) + ) + this + ) + +(defmethod mem-usage ((this collide-hash-fragment-array) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 56 (-> usage length))) + (set! (-> usage data 55 name) "prototype-collision") + (+! (-> usage data 55 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 55 used) v1-6) + (+! (-> usage data 55 total) (logand -16 (+ v1-6 15))) + ) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this fragments s3-0) usage flags) + ) + this + ) diff --git a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc index 8e69a1027f..beed387cfa 100644 --- a/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak3/engine/spatial-hash/spatial-hash-h.gc @@ -113,10 +113,10 @@ O(n^2) 'check everybody against everybody' collision loop." ) (:methods (new (symbol type int int) _type_) - (spatial-hash-method-33 () none) - (add-an-object (_type_ vector hash-object-info) int) + (spatial-hash-method-33 (_type_ vector hash-object-info) none) + (add-an-object (_type_ bounding-box (pointer collide-shape) int) int) (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int) - (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int) + (fill-actor-list-for-sphere (_type_ vector vector float (pointer collide-shape) int int) int) (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) (spatial-hash-method-39 (_type_ object hash-object-info) int) diff --git a/goal_src/jak3/engine/spatial-hash/spatial-hash.gc b/goal_src/jak3/engine/spatial-hash/spatial-hash.gc index ae542e474d..d008573423 100644 --- a/goal_src/jak3/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak3/engine/spatial-hash/spatial-hash.gc @@ -7,3 +7,898 @@ ;; DECOMP BEGINS +(deftype grid-hash-work (basic) + ((result-words uint8 32 :offset 16) + (result-bits uint8 32 :overlay-at (-> result-words 0)) + (object-id int32) + (temp-box-min vector :inline) + (temp-box-max vector :inline) + (visit-count int32) + (temp-time uint32) + (queue-object-time uint32) + (make-hash-time uint32) + (search-time uint32) + (add-object-time uint32) + ) + ) + + +(define *grid-hash-work* (new 'static 'grid-hash-work)) + +;; WARN: Return type mismatch object vs grid-hash. +(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as grid-hash gp-0)) + (set! gp-0 0) + (goto cfg-4) + ) + (set! (-> (the-as grid-hash gp-0) work) *grid-hash-work*) + (set! (-> (the-as grid-hash gp-0) object-count) 0) + (set! (-> (the-as grid-hash gp-0) bucket-memory-size) arg0) + (set! (-> (the-as grid-hash gp-0) vertical-cell-count) 1) + (set! (-> (the-as grid-hash gp-0) min-cell-size) 16384.0) + (set! (-> (the-as grid-hash gp-0) mem-bucket-array) + (the-as (pointer grid-hash-word) (malloc allocation arg0)) + ) + (set! (-> (the-as grid-hash gp-0) spr-bucket-array) (the-as (pointer grid-hash-word) #x70000000)) + (set! (-> (the-as grid-hash gp-0) bucket-array) (-> (the-as grid-hash gp-0) mem-bucket-array)) + (set! (-> (the-as grid-hash gp-0) debug-draw) #f) + (set! (-> (the-as grid-hash gp-0) use-scratch-ram) #f) + (label cfg-4) + (the-as grid-hash gp-0) + ) + ) + +(defmethod verify-bits-in-bucket ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) + (let ((s5-0 0)) + 0 + (let ((v1-1 8) + (a0-1 (-> this object-count)) + (a1-2 (* (-> this bucket-size) 8)) + ) + (while (< a0-1 a1-2) + (let ((a3-0 (- a0-1 (* (/ a0-1 v1-1) v1-1)))) + (set! s5-0 (logior s5-0 (ash 1 a3-0))) + ) + (+! a0-1 1) + ) + ) + (dotimes (s4-0 (-> this bucket-count)) + (let ((a3-2 (-> this bucket-array (+ (-> this bucket-size) -1 (* s4-0 (-> this bucket-size)))))) + (when (logtest? a3-2 s5-0) + (format 0 "bad bits in bucket ~d bucket-word ~8x test-word ~8x~%" s4-0 a3-2 s5-0) + (break!) + 0 + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod box-of-everything ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) + (dotimes (v1-0 3) + (set! (-> arg1 min v1-0) (-> this dimension-array v1-0)) + (set! (-> arg1 max v1-0) -1) + ) + (let* ((v1-3 (-> this bucket-size)) + (a3-4 (* (-> this dimension-array 0) v1-3)) + (t0-3 (* (-> this dimension-array 2) a3-4)) + (t1-0 (-> this dimension-array 0)) + (t2-0 (-> this dimension-array 2)) + (t3-0 (-> this dimension-array 1)) + (a0-2 (&-> (-> this bucket-array) (/ (the-as int arg0) 8))) + (a1-2 (ash 1 (logand (the-as int arg0) 7))) + ) + (dotimes (t4-3 t3-0) + (let ((t5-0 a0-2)) + (dotimes (t6-0 t2-0) + (let ((t7-0 t5-0)) + (dotimes (t8-0 t1-0) + (when (logtest? (-> t7-0 0) a1-2) + (set! (-> arg1 min 0) (min (-> arg1 min 0) t8-0)) + (set! (-> arg1 min 1) (min (-> arg1 min 1) t4-3)) + (set! (-> arg1 min 2) (min (-> arg1 min 2) t6-0)) + (set! (-> arg1 max 0) (max (-> arg1 max 0) t8-0)) + (set! (-> arg1 max 1) (max (-> arg1 max 1) t4-3)) + (set! (-> arg1 max 2) (max (-> arg1 max 2) t6-0)) + ) + (&+! t7-0 v1-3) + ) + ) + (&+! t5-0 a3-4) + ) + ) + (&+! a0-2 t0-3) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs symbol. +(defun-debug validate-bucket-bits ((arg0 grid-hash) (arg1 (pointer grid-hash-word))) + (let ((s3-0 (-> arg0 object-count)) + (s2-0 (* (-> arg0 bucket-size) 8)) + (gp-0 0) + (s5-0 0) + ) + (while (< s3-0 s2-0) + (let* ((s1-0 (/ s3-0 8)) + (a0-1 (- s3-0 (* s1-0 8))) + ) + (when (logtest? (-> arg1 s1-0) (ash 1 a0-1)) + (format 0 "bit ~d, " s3-0) + (+! gp-0 1) + (set! s5-0 (the-as int (-> arg1 s1-0))) + ) + ) + (+! s3-0 1) + ) + (when (> gp-0 0) + (format 0 "~%~d bad bits found~%" gp-0) + (format 0 "bad-word ~x~%" s5-0) + (break!) + 0 + ) + ) + (the-as symbol 0) + ) + +(defmethod-mips2c "(method 18 grid-hash)" 18 grid-hash) + +(defmethod-mips2c "(method 19 grid-hash)" 19 grid-hash) + +(defmethod-mips2c "(method 20 grid-hash)" 20 grid-hash) + +(defmethod set-up-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) + (dotimes (v1-0 3) + (set! (-> arg0 min v1-0) + (the int + (fmax + 0.0 + (fmin + (* (- (-> arg1 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) + ) + ) + ) + ) + (set! (-> arg0 max v1-0) + (the int (fmax 0.0 (fmin + (* (- (-> arg2 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod-mips2c "(method 22 grid-hash)" 22 grid-hash) + +(defmethod line-sphere-to-grid-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) + (s5-0 (new 'stack-no-clear 'grid-hash-box)) + ) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> arg1 quad)) + (vector+! s2-0 arg1 arg2) + (set! (-> v1-0 w) arg3) + (set! (-> s2-0 w) arg3) + (sphere-to-grid-box this s4-0 (the-as sphere v1-0)) + (sphere-to-grid-box this s5-0 (the-as sphere s2-0)) + ) + (set! (-> arg0 min 0) (min (-> s4-0 min 0) (-> s5-0 min 0))) + (set! (-> arg0 min 1) (min (-> s4-0 min 1) (-> s5-0 min 1))) + (set! (-> arg0 min 2) (min (-> s4-0 min 2) (-> s5-0 min 2))) + (set! (-> arg0 max 0) (max (-> s4-0 max 0) (-> s5-0 max 0))) + (set! (-> arg0 max 1) (max (-> s4-0 max 1) (-> s5-0 max 1))) + (set! (-> arg0 max 2) (max (-> s4-0 max 2) (-> s5-0 max 2))) + ) + 0 + (none) + ) + +(defmethod clear-bucket-array ((this grid-hash)) + (let ((v1-5 (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) + (-> this bucket-size) + ) + 15 + ) + 16 + ) + ) + (a0-1 (the-as (pointer uinteger) (-> this bucket-array))) + ) + (while (nonzero? v1-5) + (+! v1-5 -1) + (set! (-> (the-as (pointer uint128) a0-1) 0) (the-as uint128 0)) + (set! a0-1 (&-> (the-as (pointer grid-hash-word) a0-1) 16)) + ) + ) + 0 + (none) + ) + +(defmethod update-grid ((this grid-hash)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (dotimes (a0-1 3) + (set! (-> v1-0 data a0-1) (fmax (-> this min-cell-size) (- (-> this box-max a0-1) (-> this box-min a0-1)))) + ) + (b! + (and (> (-> this object-count) 0) (< 0.0 (-> v1-0 x)) (< 0.0 (-> v1-0 y)) (< 0.0 (-> v1-0 z))) + cfg-23 + :delay (empty-form) + ) + (set! (-> this bucket-count) 1) + (set! (-> this bucket-size) 1) + (dotimes (v1-3 3) + (set! (-> this box-min v1-3) 0.0) + (set! (-> this box-max v1-3) 0.0) + (set! (-> this axis-scale v1-3) 0.0) + (set! (-> this dimension-array v1-3) 1) + ) + (let ((v1-11 + (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) + (-> this bucket-size) + ) + 15 + ) + 16 + ) + ) + (a0-19 (the-as (pointer uinteger) (-> this bucket-array))) + ) + (while (nonzero? v1-11) + (+! v1-11 -1) + (set! (-> (the-as (pointer uint128) a0-19) 0) (the-as uint128 0)) + (set! a0-19 (&-> (the-as (pointer grid-hash-word) a0-19) 16)) + ) + ) + 0 + (b! #t cfg-46 :delay (nop!)) + (label cfg-23) + (let ((a0-20 8)) + (set! (-> this bucket-size) (/ (+ a0-20 -1 (-> this object-count)) a0-20)) + ) + (set! (-> this bucket-count) + (min (* (-> this object-count) 16) (/ (-> this bucket-memory-size) (-> this bucket-size))) + ) + (let ((f0-11 + (sqrtf + (/ (the float (-> this bucket-count)) (* (-> v1-0 x) (-> v1-0 z) (the float (-> this vertical-cell-count)))) + ) + ) + ) + (let ((a0-29 (min 126 (+ (-> this bucket-count) -1)))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-11 (-> v1-0 x))) a0-29))) + (set! (-> this dimension-array 1) (-> this vertical-cell-count)) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-11 (-> v1-0 z))) a0-29))) + ) + (let* ((f1-15 (* f0-11 (-> v1-0 z))) + (f1-17 (- f1-15 (the float (the int f1-15)))) + (f0-12 (* f0-11 (-> v1-0 x))) + ) + (cond + ((< f1-17 (- f0-12 (the float (the int f0-12)))) + (if (>= (-> this bucket-count) + (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2)) + ) + (+! (-> this dimension-array 0) 1) + ) + ) + (else + (if (>= (-> this bucket-count) + (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1)) + ) + (+! (-> this dimension-array 2) 1) + ) + ) + ) + ) + ) + (dotimes (a0-42 2) + (let* ((a1-26 (* a0-42 2)) + (a2-12 (max 1 (the int (/ (-> v1-0 data a1-26) (-> this min-cell-size))))) + ) + (set! (-> (the-as (pointer uint8) (+ a1-26 (the-as int this))) 24) + (the-as uint (min (-> (the-as (pointer int8) (+ a1-26 (the-as int this))) 24) a2-12)) + ) + ) + ) + (dotimes (a0-45 3) + (set! (-> this axis-scale a0-45) (/ (the float (-> this dimension-array a0-45)) (-> v1-0 data a0-45))) + ) + ) + (let ((a2-13 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)))) + (b! (< (-> this bucket-count) a2-13) cfg-40) + (let* ((v1-20 this) + (a0-53 + (/ (+ (* (* (* (-> v1-20 dimension-array 0) (-> v1-20 dimension-array 1)) (-> v1-20 dimension-array 2)) + (-> v1-20 bucket-size) + ) + 15 + ) + 16 + ) + ) + (v1-21 (the-as (pointer uinteger) (-> v1-20 bucket-array))) + ) + (while (nonzero? a0-53) + (+! a0-53 -1) + (set! (-> (the-as (pointer uint128) v1-21) 0) (the-as uint128 0)) + (set! v1-21 (&-> (the-as (pointer grid-hash-word) v1-21) 16)) + ) + ) + 0 + (b! #t cfg-46 :delay (nop!)) + (label cfg-40) + (when *debug-segment* + (format + *stdcon* + "grid-hash::update-grid: bucket overflow! ~d dim ~d ~d ~d~%" + a2-13 + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) + ) + (break!) + 0 + ) + ) + (set! (-> this bucket-count) 1) + (set! (-> this bucket-size) 1) + (dotimes (v1-30 3) + (set! (-> this axis-scale v1-30) 0.0) + (set! (-> this dimension-array v1-30) 1) + ) + (label cfg-46) + 0 + (none) + ) + +(defmethod update-grid-for-objects-in-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) + (set! (-> this object-count) arg0) + (dotimes (v1-0 3) + (set! (-> this box-min v1-0) (-> arg1 data v1-0)) + (set! (-> this box-max v1-0) (-> arg2 data v1-0)) + ) + (update-grid this) + 0 + (none) + ) + +(defmethod setup-search-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (t1-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (t2-0 3) + (set! (-> v1-0 data t2-0) (fmin (fmin (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) + (set! (-> t1-0 data t2-0) (fmax (fmax (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) + ) + (let ((a2-3 this) + (a3-1 (-> this search-box)) + ) + (dotimes (t0-1 3) + (set! (-> a3-1 min t0-1) + (the int + (fmax + 0.0 + (fmin + (* (- (-> v1-0 data t0-1) (-> a2-3 box-min t0-1)) (-> a2-3 axis-scale t0-1)) + (the float (+ (-> a2-3 dimension-array t0-1) -1)) + ) + ) + ) + ) + (set! (-> a3-1 max t0-1) + (the int (fmax 0.0 (fmin + (* (- (-> t1-0 data t0-1) (-> a2-3 box-min t0-1)) (-> a2-3 axis-scale t0-1)) + (the float (+ (-> a2-3 dimension-array t0-1) -1)) + ) + ) + ) + ) + ) + ) + ) + 0 + (set! (-> this work object-id) arg0) + (let* ((t1-1 this) + (t2-21 (-> this search-box)) + (a3-2 arg0) + (v1-5 (-> t1-1 bucket-size)) + (a0-2 (* (-> t1-1 dimension-array 0) v1-5)) + (a1-2 (* (-> t1-1 dimension-array 2) a0-2)) + (a2-6 (+ (- 1 (-> t2-21 min 0)) (-> t2-21 max 0))) + (t0-6 (+ (- 1 (-> t2-21 min 2)) (-> t2-21 max 2))) + (t3-22 (+ (- 1 (-> t2-21 min 1)) (-> t2-21 max 1))) + (t1-3 (the-as + object + (+ (+ (* (-> t2-21 min 0) v1-5) (* (-> t2-21 min 1) a1-2) (* (-> t2-21 min 2) a0-2) (/ a3-2 8) 0) + (the-as int (the-as pointer (-> t1-1 bucket-array))) + ) + ) + ) + (a3-4 (ash 1 (logand a3-2 7))) + (t2-28 t3-22) + ) + (label cfg-10) + (let ((t3-23 t0-6) + (t4-6 t1-3) + ) + (label cfg-11) + (let ((t5-2 a2-6) + (t6-0 t4-6) + ) + (label cfg-12) + (nop!) + (let ((t7-0 (-> (the-as (pointer uint8) t6-0)))) + (nop!) + (let ((t7-1 (logior t7-0 a3-4))) + (+! t5-2 -1) + (set! (-> (the-as (pointer uint8) t6-0)) t7-1) + ) + ) + ;; og:preserve-this + (b! (nonzero? t5-2) cfg-12 :delay (set! t6-0 (&+ (the-as pointer t6-0) v1-5))) + ) + (+! t3-23 -1) + (nop!) + ;; og:preserve-this + (b! (nonzero? t3-23) cfg-11 :delay (set! t4-6 (&+ (the-as pointer t4-6) a0-2))) + ) + (+! t2-28 -1) + (nop!) + ;; og:preserve-this + (b! (nonzero? t2-28) cfg-10 :delay (set! t1-3 (&+ (the-as pointer t1-3) a1-2))) + ) + 0 + 0 + (none) + ) + +(defmethod search-for-point ((this grid-hash) (arg0 vector)) + (let ((v1-0 this) + (a0-1 (-> this search-box)) + (a2-0 arg0) + ) + (dotimes (a3-0 3) + (set! (-> a0-1 min a3-0) + (the int + (fmax + 0.0 + (fmin + (* (- (-> a2-0 data a3-0) (-> v1-0 box-min a3-0)) (-> v1-0 axis-scale a3-0)) + (the float (+ (-> v1-0 dimension-array a3-0) -1)) + ) + ) + ) + ) + (set! (-> a0-1 max a3-0) + (the int (fmax 0.0 (fmin + (* (- (-> arg0 data a3-0) (-> v1-0 box-min a3-0)) (-> v1-0 axis-scale a3-0)) + (the float (+ (-> v1-0 dimension-array a3-0) -1)) + ) + ) + ) + ) + ) + ) + 0 + (do-search! this (-> this search-box) (-> this work result-words)) + (-> this work result-words) + ) + +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +(defmethod search-for-sphere ((this grid-hash) (arg0 vector) (arg1 float)) + (let ((v1-0 (new 'stack-no-clear 'sphere))) + (set! (-> v1-0 quad) (-> arg0 quad)) + (set! (-> v1-0 r) arg1) + (sphere-to-grid-box this (-> this search-box) v1-0) + ) + (let ((s5-0 (-> this work result-words)) + (s4-0 0) + ) + (label cfg-1) + (do-search! this (-> this search-box) s5-0) + (dotimes (v1-5 (-> this bucket-size)) + (set! s4-0 (logior s4-0 (-> s5-0 v1-5))) + ) + (when (zero? s4-0) + (when (or (> (-> this search-box min 0) 0) + (> (-> this search-box min 2) 0) + (< (-> this search-box max 0) (+ (-> this dimension-array 0) -1)) + (< (-> this search-box max 2) (+ (-> this dimension-array 2) -1)) + ) + (set! (-> this search-box min 0) (max 0 (+ (-> this search-box min 0) -1))) + (set! (-> this search-box min 2) (max 0 (+ (-> this search-box min 2) -1))) + (set! (-> this search-box max 0) (min (+ (-> this dimension-array 0) -1) (+ (-> this search-box max 0) 1))) + (set! (-> this search-box max 2) (min (+ (-> this dimension-array 2) -1) (+ (-> this search-box max 2) 1))) + (goto cfg-1) + ) + ) + ) + (-> this work result-words) + ) + +(defun-debug draw-grid ((arg0 vector) (arg1 vector) (arg2 (pointer int8)) (arg3 rgba)) + (local-vars (sv-64 vector) (sv-68 vector) (sv-72 vector)) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (new 'stack-no-clear 'vector)) + (set! sv-72 (new 'stack-no-clear 'vector)) + (dotimes (v1-3 3) + (set! (-> sv-64 data v1-3) (/ (- (-> arg1 data v1-3) (-> arg0 data v1-3)) (the float (-> arg2 v1-3)))) + ) + (set! (-> sv-68 x) (-> arg0 x)) + (set! (-> sv-72 x) (-> arg1 x)) + (dotimes (s2-0 (+ (-> arg2 1) 1)) + (set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-0) (-> sv-64 y)))) + (set! (-> sv-72 y) (-> sv-68 y)) + (dotimes (s1-0 (+ (-> arg2 2) 1)) + (set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s1-0) (-> sv-64 z)))) + (set! (-> sv-72 z) (-> sv-68 z)) + (add-debug-line #t (bucket-id debug) sv-68 sv-72 arg3 #f (the-as rgba -1)) + ) + ) + (set! (-> sv-68 z) (-> arg0 z)) + (set! (-> sv-72 z) (-> arg1 z)) + (dotimes (s2-1 (+ (-> arg2 1) 1)) + (set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-1) (-> sv-64 y)))) + (set! (-> sv-72 y) (-> sv-68 y)) + (dotimes (s1-1 (+ (-> arg2 0) 1)) + (set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s1-1) (-> sv-64 x)))) + (set! (-> sv-72 x) (-> sv-68 x)) + (add-debug-line #t (bucket-id debug) sv-68 sv-72 arg3 #f (the-as rgba -1)) + ) + ) + (set! (-> sv-68 y) (-> arg0 y)) + (set! (-> sv-72 y) (-> arg1 y)) + (dotimes (s3-1 (+ (-> arg2 0) 1)) + (set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s3-1) (-> sv-64 x)))) + (set! (-> sv-72 x) (-> sv-68 x)) + (dotimes (s2-2 (+ (-> arg2 2) 1)) + (set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s2-2) (-> sv-64 z)))) + (set! (-> sv-72 z) (-> sv-68 z)) + (add-debug-line #t (bucket-id debug) sv-68 sv-72 arg3 #f (the-as rgba -1)) + ) + ) + 0 + (none) + ) + +(defmethod draw ((this grid-hash) (arg0 rgba)) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (a2-0 3) + (set! (-> v1-0 data a2-0) (-> this box-min a2-0)) + (set! (-> t0-0 data a2-0) (-> this box-max a2-0)) + ) + (draw-grid v1-0 t0-0 (-> this dimension-array) arg0) + ) + 0 + (none) + ) + +(defmethod dump-grid-info ((this grid-hash)) + (if (-> this debug-draw) + (draw this *color-light-blue*) + ) + (format + *stdcon* + "bucket memory ~d, bucket-size ~d, word-size ~d bits~%" + (-> this bucket-memory-size) + (-> this bucket-size) + 8 + ) + (format + *stdcon* + "bucket dimensions ~d ~d ~d~%" + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) + ) + (format *stdcon* "object-count ~d, bucket-count ~d~%" (-> this object-count) (-> this bucket-count)) + 0 + (none) + ) + +(defun-debug draw-sphere-box ((arg0 sphere) (arg1 rgba)) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (a3-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (v1-0 3) + (set! (-> a2-0 data v1-0) (- (-> arg0 data v1-0) (-> arg0 r))) + (set! (-> a3-0 data v1-0) (+ (-> arg0 data v1-0) (-> arg0 r))) + ) + (add-debug-box #t (bucket-id debug-no-zbuf1) a2-0 a3-0 arg1) + ) + 0 + (none) + ) + +(defun-debug draw-line-sphere ((arg0 vector) (arg1 vector) (arg2 float) (arg3 rgba)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector+! gp-0 arg0 arg1) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) arg0 arg2 arg3) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) gp-0 arg2 arg3) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs sphere-hash. +(defmethod new sphere-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) + (let ((s5-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as sphere-hash s5-0)) + (set! s5-0 0) + (goto cfg-4) + ) + (set! (-> (the-as sphere-hash s5-0) work) *grid-hash-work*) + (set! (-> (the-as sphere-hash s5-0) object-count) 0) + (set! (-> (the-as sphere-hash s5-0) bucket-memory-size) arg0) + (set! (-> (the-as sphere-hash s5-0) vertical-cell-count) 1) + (set! (-> (the-as sphere-hash s5-0) min-cell-size) 16384.0) + (set! (-> (the-as sphere-hash s5-0) mem-bucket-array) + (the-as (pointer grid-hash-word) (malloc allocation arg0)) + ) + (set! (-> (the-as sphere-hash s5-0) spr-bucket-array) (the-as (pointer grid-hash-word) #x70000000)) + (set! (-> (the-as sphere-hash s5-0) bucket-array) (-> (the-as sphere-hash s5-0) mem-bucket-array)) + (set! (-> (the-as sphere-hash s5-0) debug-draw) #f) + (set! (-> (the-as sphere-hash s5-0) use-scratch-ram) #f) + (set! (-> (the-as sphere-hash s5-0) max-object-count) arg1) + (set! (-> (the-as sphere-hash s5-0) mem-sphere-array) (the-as uint (malloc allocation (* arg1 16)))) + (set! (-> (the-as sphere-hash s5-0) spr-sphere-array) (the-as uint (+ #x70000000 arg0))) + (set! (-> (the-as sphere-hash s5-0) sphere-array) + (the-as (inline-array sphere) (-> (the-as sphere-hash s5-0) mem-sphere-array)) + ) + (label cfg-4) + (the-as sphere-hash s5-0) + ) + ) + +(defmethod clear-objects! ((this sphere-hash)) + (set! (-> this object-count) 0) + (dotimes (v1-0 3) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) + ) + (cond + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this bucket-array) (-> this spr-bucket-array)) + ) + (else + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this bucket-array) (-> this mem-bucket-array)) + ) + ) + 0 + (none) + ) + +(defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) + +(defmethod add-a-sphere ((this sphere-hash) (arg0 vector)) + (let ((gp-0 (-> this object-count))) + (cond + ((< gp-0 (-> this max-object-count)) + (let ((a0-2 (-> this sphere-array gp-0))) + (mem-copy! (the-as pointer a0-2) (the-as pointer arg0) 16) + ) + (dotimes (v1-2 3) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + ) + (+! (-> this object-count) 1) + gp-0 + ) + (else + -1 + ) + ) + ) + ) + +(defmethod add-a-sphere-with-flag ((this sphere-hash) (arg0 vector) (arg1 int)) + (let ((gp-0 (-> this object-count))) + (cond + ((< gp-0 (-> this max-object-count)) + (let ((s2-0 (the-as object (-> this sphere-array gp-0)))) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg0) 16) + (dotimes (v1-2 3) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + ) + (set! (-> (the-as (pointer int8) s2-0) 12) arg1) + ) + (+! (-> this object-count) 1) + gp-0 + ) + (else + -1 + ) + ) + ) + ) + +(defmethod-mips2c "(method 32 sphere-hash)" 32 sphere-hash) + +(defmethod-mips2c "(method 29 sphere-hash)" 29 sphere-hash) + +(defmethod-mips2c "(method 30 sphere-hash)" 30 sphere-hash) + +(defmethod-mips2c "(method 31 sphere-hash)" 31 sphere-hash) + +(defmethod dump-grid-info ((this sphere-hash)) + (call-parent-method this) + (new 'stack-no-clear 'vector) + (let ((f30-0 6144.0)) + (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) + (+! (-> this work temp-box-min y) f30-0) + ) + (set! (-> this work temp-box-max quad) (-> this work temp-box-min quad)) + (set! (-> this work visit-count) 0) + (set! (-> this debug-draw) #t) + (set! (-> this work add-object-time) (the-as uint 0)) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs spatial-hash. +(defmethod new spatial-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) + (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as spatial-hash gp-0)) + (set! gp-0 0) + (goto cfg-4) + ) + (set! (-> (the-as spatial-hash gp-0) work) *grid-hash-work*) + (set! (-> (the-as spatial-hash gp-0) object-count) 0) + (set! (-> (the-as spatial-hash gp-0) bucket-memory-size) arg0) + (set! (-> (the-as spatial-hash gp-0) vertical-cell-count) 1) + (set! (-> (the-as spatial-hash gp-0) min-cell-size) 16384.0) + (set! (-> (the-as spatial-hash gp-0) mem-bucket-array) + (the-as (pointer grid-hash-word) (malloc allocation arg0)) + ) + (set! (-> (the-as spatial-hash gp-0) spr-bucket-array) (the-as (pointer grid-hash-word) #x70000000)) + (set! (-> (the-as spatial-hash gp-0) bucket-array) (-> (the-as spatial-hash gp-0) mem-bucket-array)) + (set! (-> (the-as spatial-hash gp-0) debug-draw) #f) + (set! (-> (the-as spatial-hash gp-0) use-scratch-ram) #f) + (set! (-> (the-as spatial-hash gp-0) max-object-count) arg1) + (set! (-> (the-as spatial-hash gp-0) mem-sphere-array) (the-as uint (malloc allocation (* arg1 16)))) + (set! (-> (the-as spatial-hash gp-0) mem-object-array) + (the-as (inline-array hash-object-info) (malloc allocation (* arg1 16))) + ) + (set! (-> (the-as spatial-hash gp-0) spr-sphere-array) (the-as uint (+ #x70000000 arg0))) + (set! (-> (the-as spatial-hash gp-0) spr-object-array) + (the-as (inline-array hash-object-info) (+ #x70000000 (* arg1 16) arg0)) + ) + (set! (-> (the-as spatial-hash gp-0) sphere-array) + (the-as (inline-array sphere) (-> (the-as spatial-hash gp-0) mem-sphere-array)) + ) + (set! (-> (the-as spatial-hash gp-0) object-array) (-> (the-as spatial-hash gp-0) mem-object-array)) + (label cfg-4) + (the-as spatial-hash gp-0) + ) + ) + +(defmethod clear-objects! ((this spatial-hash)) + (set! (-> this object-count) 0) + (dotimes (v1-0 3) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) + ) + (cond + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this object-array) (-> this spr-object-array)) + (set! (-> this bucket-array) (-> this spr-bucket-array)) + ) + (else + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this object-array) (-> this mem-object-array)) + (set! (-> this bucket-array) (-> this mem-bucket-array)) + ) + ) + 0 + (none) + ) + +(defmethod-mips2c "(method 32 spatial-hash)" 32 spatial-hash) + +(defmethod spatial-hash-method-33 ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 (-> this object-count))) + (cond + ((< v0-0 (-> this max-object-count)) + (let ((v1-2 (-> this sphere-array v0-0)) + (a3-2 (-> this object-array v0-0)) + ) + (let ((t0-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((t2-0 (-> t0-1 0))) + (let ((t1-0 arg0)) + (let ((t3-0 (- (-> arg0 w)))) + (.mov vf6 t3-0) + ) + (.lvf vf4 (&-> t1-0 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t2-0 quad) vf5) + ) + (let ((t2-1 (-> t0-1 1))) + (let ((t1-1 arg0)) + (let ((t3-1 (-> arg0 w))) + (.mov vf6 t3-1) + ) + (.lvf vf4 (&-> t1-1 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t2-1 quad) vf5) + ) + (dotimes (t1-2 3) + (set! (-> this box-min t1-2) (fmin (-> this box-min t1-2) (-> (&-> t0-1 0 data t1-2) 0))) + (set! (-> this box-max t1-2) (fmax (-> this box-max t1-2) (-> (&-> t0-1 0 data t1-2) 4))) + ) + ) + (set! (-> v1-2 quad) (-> arg0 quad)) + (set! (-> a3-2 object) (the-as basic arg1)) + ) + (+! (-> this object-count) 1) + ) + (else + -1 + ) + ) + ) + (none) + ) + ) + +(defmethod-mips2c "(method 38 spatial-hash)" 38 spatial-hash) + +(defmethod-mips2c "(method 35 spatial-hash)" 35 spatial-hash) + +(defmethod-mips2c "(method 36 spatial-hash)" 36 spatial-hash) + +(defmethod-mips2c "(method 34 spatial-hash)" 34 spatial-hash) + +(defmethod fill-actor-list-for-line-sphere ((this spatial-hash) + (arg0 vector) + (arg1 vector) + (arg2 float) + (arg3 (pointer collide-shape)) + (arg4 int) + (arg5 int) + ) + (let ((v1-0 (new 'stack-no-clear 'bounding-box))) + (set! (-> v1-0 min quad) (-> arg0 quad)) + (set! (-> v1-0 min w) 0.0) + (fill-actor-list-for-box this v1-0 (the-as (pointer collide-shape) arg1) (the-as int arg2)) + ) + ) + +(defmethod spatial-hash-method-39 ((this spatial-hash) (arg0 object) (arg1 hash-object-info)) + (dotimes (s5-0 (-> this object-count)) + (let ((a0-2 (-> this object-array s5-0 object))) + (when (not (valid? a0-2 basic "" #t 0)) + (break!) + 0 + ) + ) + ) + 0 + ) diff --git a/goal_src/jak3/engine/target/board/board-h.gc b/goal_src/jak3/engine/target/board/board-h.gc index 5c24f91557..ff6da723dc 100644 --- a/goal_src/jak3/engine/target/board/board-h.gc +++ b/goal_src/jak3/engine/target/board/board-h.gc @@ -321,7 +321,7 @@ (+! (-> s5-0 2 y) 16384.0) (set! (-> s5-0 2 r) 2867.2) (let ((v1-60 gp-0)) - (set! (-> v1-60 spheres) s5-0) + (set! (-> v1-60 best-dist) (the-as float s5-0)) (set! (-> v1-60 best-other-prim) (the-as collide-shape-prim 3)) (set! (-> v1-60 collide-with) (logclear diff --git a/goal_src/jak3/engine/target/board/board-part.gc b/goal_src/jak3/engine/target/board/board-part.gc index 4cd776b410..675fe6d4f0 100644 --- a/goal_src/jak3/engine/target/board/board-part.gc +++ b/goal_src/jak3/engine/target/board/board-part.gc @@ -7,3 +7,415 @@ ;; DECOMP BEGINS +(defpartgroup group-board-land-straight + :id 189 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 249)) + ) + +(defpartgroup group-board-quick-jump + :id 190 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 249)) + ) + +(defpartgroup group-board-launch + :id 191 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 666 :flags (sp3)) (sp-item 667 :flags (sp3)) (sp-item 668 :flags (sp3 sp7))) + ) + +(defpart 668 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -0.125)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409600.0) + ) + ) + +(defpart 667 + :init-specs ((:texture (middot level-default-sprite)) + (:num 100.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.33333334) (meters 0.006666667)) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.9 0.04) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 666 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 30.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-target-board-duck-charge + :id 186 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 669 :flags (is-3d sp7))) + ) + +(defpart 669 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:y (meters 0.5)) + (:scale-x (meters 10) (meters 5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.85333335) + (:fade-g 0.85333335) + (:fade-a 0.85333335 0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'board-charge-track) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 670 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.85 -1.7) + (:fade-b -8.0) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.95) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 45) (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-target-board + :id 185 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 671) (sp-item 672 :flags (is-3d)) (sp-item 673)) + ) + +(defpart 671 + :init-specs ((:num 3.0) + (:y (meters 0.25)) + (:rot-x 7) + (:r 2048.0) + (:g 1638.4) + (:b 1843.2) + (:fade-b -0.08533333) + (:timer (seconds 0.135)) + (:flags (distort)) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 672 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 4) (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters -0.02) (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + ) + ) + +(defpart 673 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.05)) + (:r 128.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.05625)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -3.0) + (:fade-g -3.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 10)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +(defpart 674 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.0) + (:y (meters 0)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 32.0) + (:a 8.0 56.0) + (:vel-y (meters 0.13333334) (meters 0.16666667)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.4222223) + (:fade-a -0.35555556) + (:accel-y (meters 0.00008333333)) + (:friction 0.7) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-board-spin-attack + :id 184 + :duration (seconds 1) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 90) (degrees 180) (degrees 90)) + :parts ((sp-item 675 :flags (is-3d sp3 sp6 sp7)) + (sp-item 676 :flags (is-3d sp3 sp6 sp7)) + (sp-item 677 :flags (sp3 sp6)) + ) + ) + +(defpart 677 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4) (meters 0.5)) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.4) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +(defpart 676 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 12)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 9)) + (:r 0.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.086666666)) + (:scalevel-y (meters -0.09)) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 675 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1.4)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.9)) + (:r 0.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-a -3.1875) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-board-zap-attack + :id 188 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 678 :flags (is-3d) :period (seconds 20) :length (seconds 0.335))) + ) + +(defpartgroup group-board-green-eco-zap-attack + :id 187 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 679 :flags (is-3d) :period (seconds 20) :length (seconds 0.335))) + ) + +(defun board-charge-track ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-0 *target*) + (a1-1 37) + ) + (when *target* + (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data a1-1)))) + (set! (-> arg2 x) (-> v1-2 x)) + (set! (-> arg2 y) (-> v1-2 y)) + (set! (-> arg2 z) (-> v1-2 z)) + ) + ) + ) + 0 + (none) + ) + +(defun board-zap-track ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-2 (ppointer->process (-> arg1 key proc parent))) + (a1-1 (the int (-> arg1 user-float))) + (v1-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-2) node-list data a1-1))) + ) + (set! (-> arg2 x) (-> v1-5 x)) + (set! (-> arg2 y) (-> v1-5 y)) + (set! (-> arg2 z) (-> v1-5 z)) + ) + 0 + (none) + ) + +(defpart 678 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:num 0.25) + (:y (meters 0.5)) + (:scale-x (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 80.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.16666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 37.0) + (:func 'board-zap-track) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 680 + :init-specs ((:func 'none)) + ) + +(defpart 679 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:num 0.25) + (:y (meters 0.5)) + (:scale-x (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 255.0) + (:b 80.0) + (:a 255.0) + (:scalevel-x (meters 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-b -1.6) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 37.0) + (:func 'board-zap-track) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/engine/target/board/board-states.gc b/goal_src/jak3/engine/target/board/board-states.gc index 5dc5b6e98d..85006db0b1 100644 --- a/goal_src/jak3/engine/target/board/board-states.gc +++ b/goal_src/jak3/engine/target/board/board-states.gc @@ -2602,16 +2602,16 @@ (set! (-> self board ride-rot-old) (-> self board ride-rot)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) - (let* ((s5-0 (new 'stack-no-clear 'collide-query)) - (a0-16 (-> self control)) - (t9-2 (method-of-object a0-16 find-ground)) - (a1-0 s5-0) - (a2-3 (logclear (-> self control root-prim prim-core collide-with) (collide-spec water))) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (if (t9-2 a0-16 a1-0 a2-3 a3-0 t0-0 t1-0) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (if (find-ground + (-> self control) + s5-0 + (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) (set! (-> self control gspot-pat-surfce) (-> s5-0 best-other-tri pat)) ) ) diff --git a/goal_src/jak3/engine/target/collide-reaction-target.gc b/goal_src/jak3/engine/target/collide-reaction-target.gc index c1df80bd12..5d04729a83 100644 --- a/goal_src/jak3/engine/target/collide-reaction-target.gc +++ b/goal_src/jak3/engine/target/collide-reaction-target.gc @@ -46,36 +46,38 @@ (arg5 (pointer symbol)) ) (local-vars - (sv-16 vector) + (contact-normal vector) (sv-20 (pointer cshape-reaction-flags)) (sv-24 (pointer collide-status)) (sv-28 (pointer symbol)) (sv-32 cshape-reaction-flags) (sv-40 collide-status) (sv-48 symbol) - (sv-52 vector) - (sv-56 vector) + (tangent vector) + (overhang-nrm vector) ) - (set! sv-16 arg2) + (set! contact-normal arg2) (set! sv-20 arg3) (set! sv-24 arg4) (set! sv-28 arg5) (set! sv-32 (-> arg3 0)) (set! sv-40 (-> arg4 0)) (set! sv-48 (-> arg5 0)) - (set! sv-52 (-> arg0 low-coverage-tangent)) - (set! sv-56 (vector-cross! (-> arg0 low-coverage-overhang-plane-normal) (-> arg0 poly-normal) sv-16)) - (vector-normalize! sv-56 1.0) - (if (>= (fabs (vector-dot (-> arg0 dynam gravity-normal) sv-56)) 0.866) + (set! tangent (-> arg0 low-coverage-tangent)) + (set! overhang-nrm + (vector-cross! (-> arg0 low-coverage-overhang-plane-normal) (-> arg0 poly-normal) contact-normal) + ) + (vector-normalize! overhang-nrm 1.0) + (if (>= (fabs (vector-dot (-> arg0 dynam gravity-normal) overhang-nrm)) 0.866) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf09))) ) - (vector-cross! sv-52 sv-16 sv-56) - (if (< 0.0 (vector-dot (-> arg0 dynam gravity-normal) sv-52)) - (vector-negate! sv-52 sv-52) + (vector-cross! tangent contact-normal overhang-nrm) + (if (< 0.0 (vector-dot (-> arg0 dynam gravity-normal) tangent)) + (vector-negate! tangent tangent) ) - (vector-normalize! sv-52 1.0) + (vector-normalize! tangent 1.0) (let ((s4-0 (new 'stack-no-clear 'collide-query))) - (let ((s3-0 (vector-flatten! (-> arg0 low-coverage-tangent-xz) sv-52 (-> arg0 dynam gravity-normal)))) + (let ((s3-0 (vector-flatten! (-> arg0 low-coverage-tangent-xz) tangent (-> arg0 dynam gravity-normal)))) (let ((v1-19 s4-0)) (set! (-> v1-19 radius) 409.6) (set! (-> v1-19 collide-with) (-> arg1 best-my-prim prim-core collide-with)) @@ -85,7 +87,7 @@ (set! (-> v1-19 action-mask) (collide-action solid)) ) (vector-normalize! s3-0 1.0) - (if (< (vector-dot s3-0 sv-16) 0.0) + (if (< (vector-dot s3-0 contact-normal) 0.0) (vector-negate! s3-0 s3-0) ) (set! (-> arg0 low-coverage-slope-to-next1) 4095996000.0) @@ -133,7 +135,7 @@ (set-time! (-> arg0 time-of-last-lc-touch-edge)) (set! sv-40 (logior sv-40 (collide-status touch-edge))) (set-time! (-> arg0 time-of-last-lc)) - (let ((f30-0 (vector-dot sv-52 (-> arg0 turn-to-target))) + (let ((f30-0 (vector-dot tangent (-> arg0 turn-to-target))) (f0-27 (if (logtest? sv-32 (cshape-reaction-flags csrf01)) (cos (- 16384.0 (acos (-> arg0 coverage)))) (-> arg0 coverage) @@ -152,7 +154,7 @@ (and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3)) (< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w))) ) - (>= (vector-dot sv-52 sv-16) -0.000001) + (>= (vector-dot tangent contact-normal) -0.000001) ) (set! (-> arg0 surf) *edge-surface*) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf10))) @@ -221,7 +223,7 @@ (set! (-> sv-88 rvec quad) (-> arg3 quad)) (set! (-> sv-88 uvec quad) (-> arg3 quad)) (let ((a1-3 (new 'stack-no-clear 'vector))) - (vector-float*! a1-3 (-> arg1 move-dist) (the-as float (-> arg1 spheres))) + (vector-float*! a1-3 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-3) ) (set! sv-104 (logior sv-104 (react-to-pat! arg0 (-> arg1 best-other-tri pat)))) @@ -248,7 +250,7 @@ (let ((v1-35 (-> sv-80 quad))) (set! (-> sv-84 quad) v1-35) ) - (if (= (the-as float (-> arg1 spheres)) 0.0) + (if (= (-> arg1 best-dist) 0.0) (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) ) (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) diff --git a/goal_src/jak3/engine/target/darkjak-h.gc b/goal_src/jak3/engine/target/darkjak-h.gc index 9fb900b5c1..edb4ddf0dd 100644 --- a/goal_src/jak3/engine/target/darkjak-h.gc +++ b/goal_src/jak3/engine/target/darkjak-h.gc @@ -23,10 +23,10 @@ (clock-on symbol) (hud handle 1) (tone sound-id) - (bomb uint32) + (bomb (pointer process)) (mode-sound-bank connection) ) (:methods - (darkjak-info-method-9 () none) + (update-clock! (_type_ int) none) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc index 43a991e904..877731733a 100644 --- a/goal_src/jak3/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-blue-shot.gc @@ -5,5 +5,2759 @@ ;; name in dgo: gun-blue-shot ;; dgos: GAME +(declare-type gun-blue-shot projectile) +(declare-type gun-blue-shot-2 gun-blue-shot) +(declare-type gun-blue-2-target-info structure) +(define-extern *blue-shot-trail* light-trail-composition) +(define-extern *gun-blue-2-targets* (inline-array gun-blue-2-target-info)) +(define-extern *uv-loop-curve* curve2d-piecewise) +(define-extern *blue-light-test* lightning-appearance) +(define-extern *blue-light-test-end* lightning-appearance) +(define-extern *blue-light-test-big* lightning-appearance) +(define-extern *blue-light-test-big-intense* lightning-appearance) +(define-extern *blue-light-test-small-fade* lightning-appearance) + +;; +++gun-blue-lightning-cmd-msg +(defenum gun-blue-lightning-cmd-msg + :type uint64 + (active 0) + (inactive 1) + ) +;; ---gun-blue-lightning-cmd-msg + + ;; DECOMP BEGINS +(defun sparticle-fade-alpha-dist ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (let ((a0-1 (math-camera-pos)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> v1-0 x) (- (-> arg2 rvec x) (-> a0-1 x))) + (set! (-> v1-0 y) (- (-> arg2 rvec y) (-> a0-1 y))) + (set! (-> v1-0 z) (- (-> arg2 rvec z) (-> a0-1 z))) + (let ((f1-3 (vector-length v1-0))) + (set! (-> arg2 fvec w) (* 128.0 (- 1.0 (* 0.0000024414062 f1-3)))) + ) + ) + 0 + (none) + ) + +(format 0 "SKIP: gun-blue-shot removed lightning specs~%") +;; (set! (-> *lightning-spec-id-table* 12) (new 'static 'lightning-spec +;; :name "lightning-blue-shot-attack-explode" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 1.0 +;; :fade-time 30.0 +;; :texture (new 'static 'texture-id :index #x8f :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 8192.0 +;; :merge-factor 0.6 +;; :merge-count 2 +;; :radius 3276.8 +;; :duration 45.0 +;; :duration-rand 60.0 +;; :sound #f +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 13) (new 'static 'lightning-spec +;; :name "lightning-blue-shot-terminal" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 1.0 +;; :fade-time 30.0 +;; :texture (new 'static 'texture-id :index #x8f :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 8192.0 +;; :merge-factor 0.6 +;; :merge-count 2 +;; :radius 3276.8 +;; :duration 75.0 +;; :sound #f +;; ) +;; ) + +;; WARN: Return type mismatch (pointer process) vs object. +(defbehavior gun-fire-blue-1 target () + (let ((gp-0 (-> self gun)) + (s4-0 (-> self gun laser-dir)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s3-0 s4-0 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (vector-rotate-y! s5-0 s4-0 (* 182.04445 (rand-vu-float-range 0.0 1.1))) + (vector-orient-by-quat! s5-0 s5-0 s3-0) + ) + (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-1 ent) (-> self entity)) + (set! (-> s4-1 charge) 1.0) + (set! (-> s4-1 options) (projectile-options po17)) + (logclear! (-> s4-1 options) (projectile-options po14 po15 po16)) + (set! (-> s4-1 pos quad) (-> gp-0 fire-point quad)) + (set! (-> s4-1 vel quad) (-> s5-0 quad)) + (set! (-> s4-1 notify-handle) (the-as handle #f)) + (set! (-> s4-1 owner-handle) (the-as handle #f)) + (set! (-> s4-1 target-handle) (the-as handle #f)) + (set! (-> s4-1 target-pos quad) (the-as uint128 0)) + (set! (-> s4-1 ignore-handle) (process->handle (send-event self 'get-vehicle))) + (let* ((v1-16 *game-info*) + (a0-16 (+ (-> v1-16 attack-id) 1)) + ) + (set! (-> v1-16 attack-id) a0-16) + (set! (-> s4-1 attack-id) a0-16) + ) + (set! (-> s4-1 timeout) (seconds 4)) + (spawn-projectile gun-blue-shot s4-1 (ppointer->process (-> gp-0 gun)) *default-dead-pool*) + ) + ) + ) + +(defun fmod-2 ((arg0 float) (arg1 float)) + (- arg0 (* (the float (the int (/ arg0 arg1))) arg1)) + ) + +(deftype gun-blue-shot-3 (projectile) + ((hit-actor? symbol) + (start-pos vector :inline) + (track-mode uint64) + (random-travel-distance float) + ) + ) + + +(deftype dist-dot-val (structure) + ((dot float) + (dist float) + (current-dir-vec vector :inline) + (vec-to-target vector :inline) + ) + ) + + +;; WARN: Return type mismatch float vs object. +(defun get-dist-and-dot ((arg0 gun-blue-shot) (arg1 dist-dot-val)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg0 desired-target-pos quad)) + (let ((s5-0 (vector-normalize-copy! (-> arg1 current-dir-vec) (-> arg0 root transv) 1.0))) + (let ((a0-2 (-> arg1 vec-to-target))) + (vector-! a0-2 s4-0 (-> arg0 root trans)) + (set! (-> arg1 dist) (vector-normalize-ret-len! a0-2 1.0)) + ) + (set! (-> arg1 dot) (vector-dot s5-0 (-> arg1 vec-to-target))) + ) + ) + ) + +(defun gun-blue-shot-3-move ((arg0 gun-blue-shot-3)) + (with-pp + (let ((v1-0 (-> arg0 track-mode))) + (cond + ((or (= v1-0 1) (zero? v1-0)) + (let ((s5-0 #f) + (a0-4 (the-as process #f)) + ) + (when (handle->process (-> arg0 desired-target)) + (let ((s4-0 (handle->process (-> arg0 desired-target)))) + (set! a0-4 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if a0-4 + (set! s5-0 #t) + ) + ) + (cond + (s5-0 + (let ((a0-9 (get-trans (the-as process-focusable a0-4) 3))) + (set! (-> arg0 desired-target-pos quad) (-> a0-9 quad)) + ) + ) + ((= (-> arg0 track-mode) 1) + (set! (-> arg0 track-mode) (the-as uint 2)) + ) + ) + ) + ) + ((= v1-0 2) + (if (< (vector-vector-distance-squared (-> arg0 root trans) (-> arg0 desired-target-pos)) 1073741800.0) + (set! (-> arg0 track-mode) (the-as uint 3)) + ) + ) + ) + ) + (when (zero? (-> arg0 track-mode)) + (let ((f0-1 (vector-vector-distance (-> arg0 start-pos) (-> arg0 root trans)))) + (cond + ((< (-> arg0 random-travel-distance) f0-1) + (set! (-> arg0 track-mode) (the-as uint 1)) + (set-time! (-> arg0 state-time)) + ) + (else + (when (< (vector-vector-distance (-> arg0 root trans) (-> arg0 desired-target-pos)) 40960.0) + (set! (-> arg0 track-mode) (the-as uint 1)) + (set-time! (-> arg0 state-time)) + ) + ) + ) + ) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + (let ((v1-40 (-> arg0 track-mode))) + (cond + ((zero? v1-40) + (let ((s5-1 (new 'stack-no-clear 'dist-dot-val))) + (get-dist-and-dot (the-as gun-blue-shot arg0) s5-1) + (let* ((f0-4 (* 0.5 (+ 1.0 (-> s5-1 dot)))) + (f0-5 (* f0-4 f0-4)) + ) + (vector-normalize! (-> arg0 root transv) (lerp 122880.0 409600.0 f0-5)) + ) + ) + (let ((s5-3 (-> arg0 child))) + (while s5-3 + (send-event (ppointer->process s5-3) 'notice 'add-crumb) + (set! s5-3 (-> s5-3 0 brother)) + ) + ) + ) + ((or (= v1-40 1) (= v1-40 2)) + (let ((s5-4 (new 'stack-no-clear 'vector))) + (set! (-> s5-4 quad) (-> arg0 root trans quad)) + (let ((f30-0 2.0) + (f24-0 65536.0) + ) + 327680.0 + 0.0 + (let* ((f28-0 (/ (the float (- (current-time) (-> pp clock old-frame-counter))) f30-0)) + (f26-0 f28-0) + ) + (dotimes (s4-2 (the int f30-0)) + (let ((s3-0 (new 'stack-no-clear 'dist-dot-val))) + (get-dist-and-dot (the-as gun-blue-shot arg0) s3-0) + (when (< (-> s3-0 dist) 49152.0) + (let ((f0-12 (* 0.000020345053 (-> s3-0 dist))) + (f24-1 (* 0.5 (+ 1.0 (-> s3-0 dot)))) + ) + (set! f24-0 (* (lerp 65536.0 131072.0 f0-12) (- 2.0 f24-1))) + ) + (when (and (= (-> arg0 track-mode) 1) (time-elapsed? (-> arg0 state-time) (seconds 1))) + (let ((f0-15 (* 1.3333334 (+ -0.75 (* 0.0033333334 (the float (- (current-time) (-> arg0 state-time)))))))) + (set! f24-0 (* f24-0 (lerp 1.0 2.0 f0-15))) + ) + ) + ) + (cond + ((< 0.99 (-> s3-0 dot)) + (set! (-> s3-0 current-dir-vec quad) (-> s3-0 vec-to-target quad)) + ) + (else + (let* ((s2-0 (new 'stack-no-clear 'vector)) + (f22-0 0.0) + (f0-19 (acos (-> s3-0 dot))) + (f22-1 (deg-seek f22-0 f0-19 (/ (* f24-0 (seconds-per-frame)) f30-0))) + ) + (vector-cross! s2-0 (-> s3-0 vec-to-target) (-> s3-0 current-dir-vec)) + (vector-normalize! s2-0 1.0) + (vector-rotate-around-axis! + (-> s3-0 current-dir-vec) + (the-as quaternion (-> s3-0 current-dir-vec)) + (* -1.0 f22-1) + s2-0 + ) + ) + ) + ) + (set! (-> arg0 root transv quad) (-> s3-0 current-dir-vec quad)) + (let* ((f0-26 (* 0.5 (+ 1.0 (-> s3-0 dot)))) + (f0-27 (* f0-26 f0-26)) + (f0-28 (lerp 122880.0 409600.0 f0-27)) + ) + (vector-normalize! (-> arg0 root transv) f0-28) + ) + ) + (let ((a1-27 (vector-float*! (new 'stack-no-clear 'vector) (-> arg0 root transv) (/ 1.0 f30-0)))) + (vector-v++! (-> arg0 root trans) a1-27) + ) + (let ((s3-1 (-> arg0 child))) + (while s3-1 + (send-event (ppointer->process s3-1) 'notice 'add-crumb-elapsed f26-0) + (set! s3-1 (-> s3-1 0 brother)) + ) + ) + (when (< (vector-vector-distance (-> arg0 root trans) (-> arg0 desired-target-pos)) 8192.0) + 0 + (goto cfg-70) + ) + (+! f26-0 f28-0) + ) + ) + ) + (label cfg-70) + (vector-! (-> arg0 root transv) (-> arg0 root trans) s5-4) + (set! (-> arg0 root trans quad) (-> s5-4 quad)) + ) + (vector-float*! (-> arg0 root transv) (-> arg0 root transv) (/ 1.0 (seconds-per-frame))) + ) + ) + ) + (projectile-move-fill-line-sphere arg0) + (none) + ) + ) + +(deftype light-trail-tracker-blue-3 (light-trail-tracker-projectile) + () + ) + + +(defmethod light-trail-tracker-method-17 ((this light-trail-tracker-blue-3) (arg0 process-focusable)) + #f + ) + +(if (or (zero? *blue-shot-trail*) (!= loading-level global)) + (set! *blue-shot-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *blue-shot-trail* color-mode) (the-as uint 0)) + +(set! (-> *blue-shot-trail* color-repeat-dist) 40960.0) + +(set! (-> *blue-shot-trail* alpha-1-mode) (the-as uint 0)) + +(set! (-> *blue-shot-trail* alpha-2-mode) (the-as uint 6)) + +(set! (-> *blue-shot-trail* base-alpha) 1.0) + +(set! (-> *blue-shot-trail* alpha-repeat-dist) 94208.0) + +(set! (-> *blue-shot-trail* width-mode) (the-as uint 2)) + +(set! (-> *blue-shot-trail* base-width) 2048.0) + +(set! (-> *blue-shot-trail* width-repeat-dist) 12288.0) + +(set! (-> *blue-shot-trail* uv-mode) (the-as uint 0)) + +(set! (-> *blue-shot-trail* uv-repeat-dist) 163840.0) + +(set! (-> *blue-shot-trail* lie-mode) (the-as uint 0)) + +(set! (-> *blue-shot-trail* max-age) (seconds 0.5)) + +(if #f + (set! (-> *blue-shot-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *blue-shot-trail* tex-id) (the-as uint #x500f00)) + ) + +(set! (-> *blue-shot-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +(set! (-> *blue-shot-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-white*)) + +(set! (-> *blue-shot-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *blue-shot-trail* alpha-curve-2) #f) + +(set! (-> *blue-shot-trail* zbuffer?) #f) + +(set! (-> *blue-shot-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *blue-shot-trail* use-tape-mode?) #f) + +(set! (-> *blue-shot-trail* blend-mode) (the-as uint 1)) + +(set! (-> *blue-shot-trail* frame-stagger) (the-as uint 1)) + +(defmethod init-proj-settings! ((this gun-blue-shot-3)) + (+! (-> *game-info* shots-fired 2) 1.0) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) 327680.0) + (set! (-> this move) gun-blue-shot-3-move) + (set! (-> this timeout) (seconds 3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) 1.0) + (set! (-> this vehicle-damage-factor) 2.0) + (set! (-> this vehicle-impulse-factor) 2.0) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this track-mode) (the-as uint 0)) + (set! (-> this start-pos quad) (-> this root trans quad)) + (let* ((f30-0 12288.0) + (f28-0 28672.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (set! (-> this random-travel-distance) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-17))))) + ) + (let ((s5-0 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> s5-0 tracked-obj) (process->handle this)) + (set! (-> s5-0 appearance) *blue-shot-trail*) + (set! (-> s5-0 max-num-crumbs) (the int (* 0.2 (the float (-> s5-0 appearance max-age))))) + (set! (-> s5-0 track-immediately?) #t) + (let* ((v1-30 (estimate-light-trail-mem-usage + (the-as uint (-> s5-0 max-num-crumbs)) + (the-as uint (= (-> s5-0 appearance lie-mode) 3)) + ) + ) + (s4-0 (get-process *default-dead-pool* light-trail-tracker-blue-3 (+ v1-30 8192) 1)) + ) + (when s4-0 + (let ((t9-4 (method-of-type process activate))) + (t9-4 s4-0 this "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 light-trail-tracker-init-by-other s5-0) + (-> s4-0 ppointer) + ) + ) + ) + 0 + (none) + ) + +(defmethod projectile-method-32 ((this gun-blue-shot-3)) + (if (not (do-fire-backcheck (-> this root trans) (-> this root transv))) + (go (method-of-object this impact)) + (call-parent-method this) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this gun-blue-shot-3) (arg0 projectile-options)) + (case arg0 + (((projectile-options po0)) + (sound-play "blue-gun3-ricco" :position (-> this root trans)) + ) + ) + (none) + ) + +(defmethod projectile-method-25 ((this gun-blue-shot-3)) + 0 + (none) + ) + +(deftype target-quality-info (structure) + ((targ handle) + (value float) + ) + ) + + +;; WARN: Return type mismatch (pointer process) vs object. +(defbehavior gun-fire-blue-3 target () + (local-vars + (sv-144 gun-info) + (sv-148 projectile-init-by-other-params) + (sv-1280 vector) + (sv-1284 (inline-array target-quality-info)) + (sv-1288 int) + (sv-1296 float) + (sv-1300 object) + ) + (set! sv-144 (-> self gun)) + (set! sv-148 (new 'stack-no-clear 'projectile-init-by-other-params)) + (draw-beam (-> *part-id-table* 364) (-> sv-144 fire-point) (-> sv-144 fire-dir-out) #f) + (set! sv-1280 (new 'stack-no-clear 'vector)) + (set! sv-1284 (new 'stack-no-clear 'inline-array 'target-quality-info 384)) + (set! sv-1288 0) + (set! sv-1296 (the-as float 0.0)) + (set! sv-1300 (send-event *target* 'get-vehicle)) + (set! (-> sv-1280 quad) (-> sv-144 fire-point quad)) + (set! (-> sv-1280 w) 163840.0) + (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s5-0 (fill-actor-list-for-box *actor-hash* (the-as bounding-box sv-1280) gp-0 384)) + (let* ((s4-0 (-> gp-0 s5-0)) + (v1-16 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (when v1-16 + (let* ((s3-0 (-> v1-16 process)) + (s4-1 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s4-1 + (when (and (!= *target* s4-1) + (!= sv-1300 s4-1) + (not (focus-test? (the-as process-focusable s4-1) disable dead inactive gun-no-target)) + (or (logtest? (process-mask crate enemy vehicle civilian) (-> s4-1 mask)) + (and (logtest? (process-mask guard) (-> s4-1 mask)) (-> *setting-control* user-current gun-target-guards?)) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s3-1 start-pos) (-> sv-144 fire-point) (-> sv-144 fire-dir-out) 40960.0) + (+! (-> s3-1 start-pos y) 24576.0) + (vector-! (-> s3-1 move-dist) (get-trans (the-as process-focusable s4-1) 3) (-> sv-144 fire-point)) + (let ((v1-32 s3-1)) + (set! (-> v1-32 radius) 40.96) + (set! (-> v1-32 collide-with) (collide-spec backgnd)) + (set! (-> v1-32 ignore-process0) #f) + (set! (-> v1-32 ignore-process1) #f) + (set! (-> v1-32 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-32 action-mask) (collide-action solid)) + ) + (when (< (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) + (let ((s3-3 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s4-1) 3) (-> self control trans)) + ) + ) + (vector-normalize! s3-3 1.0) + (when (< (-> s3-3 y) 0.5) + (set! (-> sv-1284 sv-1288 targ) (process->handle s4-1)) + (let ((f30-0 1.0)) + (if (and (nonzero? (-> s4-1 draw)) (logtest? (-> s4-1 draw status) (draw-control-status on-screen))) + (set! f30-0 (+ 2.0 f30-0)) + ) + (if (< (vector-vector-xz-distance-squared (-> sv-144 fire-point) (get-trans (the-as process-focusable s4-1) 3)) + 2415919000.0 + ) + (set! f30-0 (+ 4.0 f30-0)) + ) + (if (logtest? (process-mask enemy guard) (-> s4-1 mask)) + (set! f30-0 (+ 28.0 f30-0)) + ) + (if (logtest? (process-mask vehicle civilian) (-> s4-1 mask)) + (set! f30-0 (* 0.25 f30-0)) + ) + (set! (-> sv-1284 sv-1288 value) f30-0) + (set! sv-1296 (+ sv-1296 f30-0)) + ) + (set! sv-1288 (+ sv-1288 1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s5-1 *target*) + (gp-1 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (when (and gp-1 (< (vector-vector-distance (get-trans gp-1 0) sv-1280) (-> sv-1280 w))) + (when (and (!= *target* gp-1) + (!= sv-1300 gp-1) + (not (focus-test? gp-1 disable dead inactive gun-no-target)) + (or (logtest? (process-mask crate enemy vehicle civilian) (-> gp-1 mask)) + (and (logtest? (process-mask guard) (-> gp-1 mask)) (-> *setting-control* user-current gun-target-guards?)) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s5-3 start-pos) (-> sv-144 fire-point) (-> sv-144 fire-dir-out) 40960.0) + (+! (-> s5-3 start-pos y) 24576.0) + (vector-! (-> s5-3 move-dist) (get-trans gp-1 3) (-> sv-144 fire-point)) + (let ((v1-91 s5-3)) + (set! (-> v1-91 radius) 40.96) + (set! (-> v1-91 collide-with) (collide-spec backgnd)) + (set! (-> v1-91 ignore-process0) #f) + (set! (-> v1-91 ignore-process1) #f) + (set! (-> v1-91 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-91 action-mask) (collide-action solid)) + ) + (when (< (fill-and-probe-using-line-sphere *collide-cache* s5-3) 0.0) + (let ((s5-5 (vector-! (new 'stack-no-clear 'vector) (get-trans gp-1 3) (-> self control trans)))) + (vector-normalize! s5-5 1.0) + (when (< (-> s5-5 y) 0.5) + (set! (-> sv-1284 sv-1288 targ) (process->handle gp-1)) + (let ((f30-1 1.0)) + (if (and (nonzero? (-> gp-1 draw)) (logtest? (-> gp-1 draw status) (draw-control-status on-screen))) + (set! f30-1 (+ 2.0 f30-1)) + ) + (if (< (vector-vector-xz-distance-squared (-> sv-144 fire-point) (get-trans gp-1 3)) 2415919000.0) + (set! f30-1 (+ 4.0 f30-1)) + ) + (if (logtest? (process-mask enemy guard) (-> gp-1 mask)) + (set! f30-1 (+ 28.0 f30-1)) + ) + (if (logtest? (process-mask vehicle civilian) (-> gp-1 mask)) + (set! f30-1 (* 0.25 f30-1)) + ) + (set! (-> sv-1284 sv-1288 value) f30-1) + (set! sv-1296 (+ sv-1296 f30-1)) + ) + (set! sv-1288 (+ sv-1288 1)) + ) + ) + ) + ) + ) + ) + ) + (let* ((v1-132 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-133 (the-as number (logior #x3f800000 v1-132))) + (f0-32 (* (+ -1.0 (the-as float v1-133)) sv-1296)) + (s5-7 (the-as process #f)) + ) + (let ((f1-11 0.0) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (dotimes (v1-136 sv-1288) + (+! f1-11 (-> sv-1284 v1-136 value)) + (when (< f0-32 f1-11) + (set! s5-7 (handle->process (-> sv-1284 v1-136 targ))) + 0 + (goto cfg-91) + ) + ) + (label cfg-91) + (let ((s4-5 (new 'stack-no-clear 'vector))) + (let ((s3-5 s4-5)) + (let* ((f30-2 -1.0) + (f28-0 2.0) + (v1-148 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-149 (the-as number (logior #x3f800000 v1-148))) + ) + (set! (-> s3-5 x) (+ f30-2 (* f28-0 (+ -1.0 (the-as float v1-149))))) + ) + (let* ((f30-3 -0.2) + (f28-1 0.7) + (v1-154 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-155 (the-as number (logior #x3f800000 v1-154))) + ) + (set! (-> s3-5 y) (+ f30-3 (* f28-1 (+ -1.0 (the-as float v1-155))))) + ) + (let* ((f30-4 -1.0) + (f28-2 2.0) + (v1-160 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-161 (the-as number (logior #x3f800000 v1-160))) + ) + (set! (-> s3-5 z) (+ f30-4 (* f28-2 (+ -1.0 (the-as float v1-161))))) + ) + (set! (-> s3-5 w) 1.0) + ) + (vector-normalize! s4-5 163840.0) + (vector+! gp-2 (-> sv-144 fire-point) s4-5) + ) + (let ((s4-6 (new 'stack-no-clear 'vector))) + (set! (-> s4-6 quad) (-> gp-2 quad)) + (when s5-7 + (let ((s3-6 s4-6) + (s2-3 s5-7) + ) + (set! (-> s3-6 quad) (-> (get-trans + (the-as process-focusable (if (type? s2-3 process-focusable) + (the-as process-focusable s2-3) + ) + ) + 3 + ) + quad + ) + ) + ) + ) + (let ((s3-7 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> sv-144 fire-dir-out) 2730.6667)) + (v1-174 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> sv-144 fire-dir-out) -2730.6667)) + (a0-114 (vector-! (new 'stack-no-clear 'vector) s4-6 (-> sv-144 fire-point))) + (s4-7 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-dot s3-7 a0-114) (vector-dot v1-174 a0-114)) + (set! (-> s4-7 quad) (-> s3-7 quad)) + (set! (-> s4-7 quad) (-> v1-174 quad)) + ) + (vector-normalize! a0-114 1.0) + (let* ((s3-8 vector-rotate-y!) + (s2-4 s4-7) + (s1-0 s4-7) + (f30-5 -2730.6667) + (f28-3 5461.3335) + (v1-180 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-181 (the-as number (logior #x3f800000 v1-180))) + ) + (s3-8 s2-4 s1-0 (+ f30-5 (* f28-3 (+ -1.0 (the-as float v1-181))))) + ) + (let* ((f30-6 -0.1) + (f28-4 0.5) + (v1-186 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-187 (the-as number (logior #x3f800000 v1-186))) + ) + (set! (-> s4-7 y) (+ f30-6 (* f28-4 (+ -1.0 (the-as float v1-187))) (-> s4-7 y))) + ) + (vector-normalize! s4-7 1.0) + (set! (-> sv-148 ent) (-> self entity)) + (set! (-> sv-148 charge) 1.0) + (set! (-> sv-148 options) (projectile-options)) + (logclear! (-> sv-148 options) (projectile-options po14 po15 po16)) + (set! (-> sv-148 pos quad) (-> sv-144 fire-point quad)) + (set! (-> sv-148 notify-handle) (the-as handle #f)) + (set! (-> sv-148 owner-handle) (the-as handle #f)) + (set! (-> sv-148 target-handle) (process->handle s5-7)) + (set! (-> sv-148 target-pos quad) (-> gp-2 quad)) + (set! (-> sv-148 ignore-handle) (process->handle (send-event self 'get-vehicle))) + (let* ((v1-209 *game-info*) + (a0-143 (+ (-> v1-209 attack-id) 1)) + ) + (set! (-> v1-209 attack-id) a0-143) + (set! (-> sv-148 attack-id) a0-143) + ) + (set! (-> sv-148 timeout) (seconds 4)) + (vector-float*! (-> sv-148 vel) s4-7 327680.0) + ) + ) + ) + ) + (spawn-projectile gun-blue-shot-3 sv-148 (ppointer->process (-> sv-144 gun)) *default-dead-pool*) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun draw-beam-segment () + (none) + ) + +(define *found-objects* (the-as (pointer handle) (malloc 'global 112))) + +(define *gun-blue-2-last-attack-id* (the-as uint 0)) + +(deftype timeframe-wrapper (structure) + ((time time-frame) + ) + ) + + +(define *gun-blue-2-last-attack-id-time* (new 'static 'timeframe-wrapper)) + +;; WARN: Return type mismatch (pointer process) vs (pointer gun-blue-shot-2). +(defun fire-projectile-if-necessary ((arg0 vector) (arg1 vector) (arg2 handle)) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (s3-0 #f) + ) + (vector-! (-> s5-0 move-dist) arg1 arg0) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) 2.0) + (let ((v1-5 s5-0)) + (set! (-> v1-5 radius) 12288.0) + (set! (-> v1-5 collide-with) (collide-spec crate civilian enemy obstacle vehicle-sphere hit-by-others-list)) + (set! (-> v1-5 ignore-process0) (handle->process arg2)) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (if (and (< f0-2 1.0) (!= f0-2 -100000000.0)) + (set! s3-0 #t) + ) + ) + (the-as + (pointer gun-blue-shot-2) + (when s3-0 + (when (>= (- (-> *display* game-clock frame-counter) (-> *gun-blue-2-last-attack-id-time* time)) (seconds 0.4)) + (let* ((v1-19 *game-info*) + (a0-16 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-16) + (set! *gun-blue-2-last-attack-id* a0-16) + ) + (set! (-> *gun-blue-2-last-attack-id-time* time) (-> *display* game-clock frame-counter)) + ) + (let ((a1-8 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-8 ent) (-> *target* entity)) + (set! (-> a1-8 charge) 1.0) + (set! (-> a1-8 options) (projectile-options)) + (logclear! (-> a1-8 options) (projectile-options po14 po15 po16)) + (set! (-> a1-8 pos quad) (-> arg0 quad)) + (set! (-> a1-8 vel quad) + (-> (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) (/ 2.0 (seconds-per-frame))) quad) + ) + (set! (-> a1-8 notify-handle) (the-as handle #f)) + (set! (-> a1-8 owner-handle) (process->handle *target*)) + (set! (-> a1-8 target-handle) (the-as handle #f)) + (set! (-> a1-8 target-pos quad) (the-as uint128 0)) + (set! (-> a1-8 ignore-handle) (ppointer->handle (-> arg2 process))) + (set! (-> a1-8 attack-id) *gun-blue-2-last-attack-id*) + (set! (-> a1-8 timeout) (seconds 4)) + (spawn-projectile gun-blue-shot-2 a1-8 (ppointer->process (-> *target* gun gun)) *default-dead-pool*) + ) + ) + ) + ) + ) + +(deftype gun-blue-2-lightning-info (structure) + ((pts vector 32 :inline) + (num-pts int8) + (should-draw-terminal-sparks? symbol) + (terminal-spark-pos vector :inline) + (should-draw-extension? symbol) + (extension-end-point vector :inline) + ) + ) + + +(deftype gun-blue-lightning-command (structure) + ((msg gun-blue-lightning-cmd-msg) + (lightning-info gun-blue-2-lightning-info :inline) + ) + ) + + +(deftype gun-blue-2-lightning-tracker (process-drawable) + ((lt-array (array lightning-bolt)) + (should-draw-this-frame? symbol) + (last-spark-time time-frame :offset 216) + (spark-time-interval time-frame) + (last-deduct-ammo-time time-frame) + (snd-lightning sound-id) + (active-enter-time time-frame) + (revolve-angle float) + (sway-angle float) + (snd-spin sound-id) + (spin-intensity float) + (prev-targ-pos vector :inline) + (last-probe-index int16) + ) + (:state-methods + active + inactive + die + test + ) + (:methods + (setup-draw! (_type_ gun-blue-2-lightning-info) none) + (gun-blue-2-lightning-tracker-method-25 (_type_) object) + (gun-blue-2-lightning-tracker-method-26 (_type_ vector vector gun-blue-lightning-command) symbol) + ) + ) + + +(defmethod deactivate ((this gun-blue-2-lightning-tracker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this snd-spin)) + (sound-stop (-> this snd-lightning)) + (call-parent-method this) + (none) + ) + +(deftype gun-blue-2-target-info (structure) + ((target handle) + (start-time time-frame) + ) + ) + + +(if (zero? *gun-blue-2-targets*) + (set! *gun-blue-2-targets* (the-as (inline-array gun-blue-2-target-info) (malloc 'global 192))) + ) + +(deftype constraint-knot (structure) + ((pt vector :inline) + (dir vector :inline) + (length float) + ) + ) + + +(deftype rope-constraint (structure) + ((constraints constraint-knot 12 :inline) + (num-knots uint8) + ) + (:methods + (rope-constraint-method-9 (_type_ int) symbol) + ) + ) + + +(defmethod rope-constraint-method-9 ((this rope-constraint) (arg0 int)) + (local-vars (sv-64 vector) (sv-80 vector) (sv-96 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 arg0) + (s3-0 (+ (-> this num-knots) -2)) + ) + (while (>= (the-as int s3-0) s4-0) + (dotimes (s2-0 1) + (set! sv-64 (the-as vector (+ (the-as uint (-> this constraints 0 dir)) (* 48 s4-0)))) + (let ((s1-0 (-> this constraints s4-0)) + (s0-0 (-> this constraints (+ s4-0 1))) + ) + (set! sv-96 (new 'stack-no-clear 'vector)) + (let ((v1-6 s0-0) + (a0-7 s1-0) + ) + (.lvf vf4 (&-> v1-6 pt quad)) + (.lvf vf5 (&-> a0-7 pt quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-96 quad) vf6) + 0.0 + (let ((f30-0 (vector-normalize-ret-len! sv-96 1.0))) + (vector-normalize! sv-64 1.0) + (let ((f0-2 (vector-dot sv-96 sv-64))) + (when (< f0-2 0.9999) + (set! sv-80 (new 'stack-no-clear 'vector)) + 0.0 + (let* ((f28-0 (acos f0-2)) + (f0-4 (* 0.000030517578 f28-0)) + ) + 0.0 + 0.0 + (- 32768.0 f28-0) + (let* ((f0-6 (fmax 0.0 (fmin 1.0 f0-4))) + (f0-7 (* f0-6 f0-6)) + (f28-1 + (fmin (fmin f28-0 (* (lerp 5461.3335 2184533.2 f0-7) (seconds-per-frame))) (* 131072.0 (seconds-per-frame))) + ) + ) + (let ((v1-20 sv-80)) + (.lvf vf1 (&-> sv-96 quad)) + (.lvf vf2 (&-> sv-64 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> v1-20 quad) vf3) + ) + (vector-normalize! sv-80 1.0) + (vector-rotate-around-axis! sv-96 (the-as quaternion sv-96) f28-1 sv-80) + ) + ) + (vector-normalize! sv-96 1.0) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this constraints 0 dir)) (* 48 (+ s4-0 1))))) + (-> sv-96 quad) + ) + (vector+float*! (the-as vector s0-0) (the-as vector s1-0) sv-96 f30-0) + ) + ) + ) + ) + ) + (+! s4-0 1) + ) + ) + (let ((s4-1 (+ (-> this num-knots) -2))) + (while (>= (the-as int s4-1) arg0) + (+ (the-as uint (-> this constraints 0 dir)) (* 48 arg0)) + (let* ((s3-1 (-> this constraints arg0)) + (s2-1 (-> this constraints (+ arg0 1))) + (s1-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector s2-1) (the-as vector s3-1))) + ) + 0.0 + (vector-normalize-ret-len! s1-2 1.0) + (vector+float*! (the-as vector s2-1) (the-as vector s3-1) s1-2 (-> this constraints arg0 length)) + ) + (+! arg0 1) + ) + ) + #f + ) + ) + +(define *blue-2-lightning-shape* (new 'static 'rope-constraint)) + +(defstate die (gun-blue-2-lightning-tracker) + :virtual #t + :code (behavior () + '() + ) + ) + +(defstate inactive (gun-blue-2-lightning-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun-blue-lightning) + (when (= (-> (the-as gun-blue-lightning-command (-> block param 0)) msg) (gun-blue-lightning-cmd-msg active)) + (if (= (-> *target* gun using-gun-type) (pickup-type gun-blue-2)) + (go-virtual active) + ) + ) + ) + (('notice) + (case (-> block param 0) + (('die) + (go-virtual die) + ) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'active))) + (sound-stop (-> self snd-spin)) + ) + ) + :trans (behavior () + (if (not (time-elapsed? (-> self state-time) (seconds 0.2))) + (sound-play-by-name + (static-sound-name "blue-gun2-loop") + (-> self snd-lightning) + 768 + (the int (* 1524.0 (lerp 0.0 -0.5 (* 0.016666668 (the float (- (current-time) (-> self state-time))))))) + 0 + (sound-group) + #t + ) + (sound-stop (-> self snd-lightning)) + ) + (let ((f0-6 (lerp-scale-clamp 0.0 1.0 (-> *target* gun fire-spinv) 0.0 218453.33))) + 0.0 + (seek! (-> self spin-intensity) f0-6 (* 2.0 (seconds-per-frame))) + ) + (if (< 0.001 (-> self spin-intensity)) + (sound-play-by-name + (static-sound-name "blue-gun2-spin") + (-> self snd-spin) + (the int (* 1024.0 (lerp 0.3 1.0 (-> self spin-intensity)))) + (the int (* 1524.0 (lerp -0.5 0.0 (-> self spin-intensity)))) + 0 + (sound-group) + #t + ) + (sound-stop (-> self snd-spin)) + ) + (if (!= (lightning-bolt-method-14 (-> self lt-array 0)) 3) + (gun-blue-2-lightning-tracker-method-25 self) + ) + (dotimes (gp-3 (-> self lt-array length)) + (let ((s5-2 (-> self lt-array gp-3))) + (lightning-bolt-method-11 s5-2) + (lightning-bolt-method-12 s5-2) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 8)) + (go-virtual die) + ) + ) + :code sleep-code + ) + +(when (or (zero? *uv-loop-curve*) (!= loading-level global)) + (set! *uv-loop-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *uv-loop-curve* 2 'loading-level (the-as int #t)) + ) + +(set! (-> *uv-loop-curve* pts data 0 first) 0.0) + +(set! (-> *uv-loop-curve* pts data 0 second) 0.0) + +(set! (-> *uv-loop-curve* pts data 1 first) 1.0) + +(set! (-> *uv-loop-curve* pts data 1 second) 1.0) + +(if (or (zero? *blue-light-test*) (!= loading-level global)) + (set! *blue-light-test* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *blue-light-test* base-alpha) 1.0) + +(set! (-> *blue-light-test* tex-id) (the-as uint #x408f00)) + +(set! (-> *blue-light-test* blend-mode) (the-as uint 1)) + +(set! (-> *blue-light-test* alpha-1-curve) *curve-linear-down*) + +(set! (-> *blue-light-test* alpha-1-mode) (the-as uint 0)) + +(set! (-> *blue-light-test* alpha-1-repeat-dist) 262144.0) + +(set! (-> *blue-light-test* alpha-2-curve) #f) + +(set! (-> *blue-light-test* alpha-2-mode) (the-as uint 3)) + +(set! (-> *blue-light-test* alpha-2-repeat-dist) 4096.0) + +(set! (-> *blue-light-test* width-curve) *curve-linear-down*) + +(set! (-> *blue-light-test* width-mode) (the-as uint 3)) + +(set! (-> *blue-light-test* width-repeat-dist) 4096.0) + +(set! (-> *blue-light-test* uv-repeat-dist) 28672.0) + +(set! (-> *blue-light-test* regenerate-time-start) (seconds 0.167)) + +(set! (-> *blue-light-test* regenerate-time-end) (seconds 0.25)) + +(set! (-> *blue-light-test* width-range-start) 1228.8) + +(set! (-> *blue-light-test* width-range-end) 2048.0) + +(set! (-> *blue-light-test* fade-time) (seconds 0.3)) + +(set! (-> *blue-light-test* uv-shift?) #t) + +(set! (-> *blue-light-test* uv-shift-speed) (seconds -0.5)) + +(set! (-> *blue-light-test* use-sprite-bucket?) #t) + +(set! (-> *blue-light-test* use-accurate-interp?) #t) + +(if (or (zero? *blue-light-test-end*) (!= loading-level global)) + (set! *blue-light-test-end* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *blue-light-test-end* base-alpha) 1.0) + +(set! (-> *blue-light-test-end* tex-id) (the-as uint #x408f00)) + +(set! (-> *blue-light-test-end* blend-mode) (the-as uint 1)) + +(set! (-> *blue-light-test-end* alpha-1-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-end* alpha-1-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-end* alpha-1-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-end* alpha-2-curve) #f) + +(set! (-> *blue-light-test-end* alpha-2-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-end* alpha-2-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-end* width-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-end* width-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-end* width-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-end* uv-repeat-dist) 28672.0) + +(set! (-> *blue-light-test-end* regenerate-time-start) (seconds 0.085)) + +(set! (-> *blue-light-test-end* regenerate-time-end) (seconds 0.117)) + +(set! (-> *blue-light-test-end* width-range-start) 5324.8) + +(set! (-> *blue-light-test-end* width-range-end) 6144.0) + +(set! (-> *blue-light-test-end* fade-time) (seconds 0.3)) + +(set! (-> *blue-light-test-end* uv-shift?) #t) + +(set! (-> *blue-light-test-end* uv-shift-speed) (seconds -0.5)) + +(set! (-> *blue-light-test-end* use-sprite-bucket?) #t) + +(set! (-> *blue-light-test-end* use-accurate-interp?) #t) + +(if (or (zero? *blue-light-test-big*) (!= loading-level global)) + (set! *blue-light-test-big* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *blue-light-test-big* base-alpha) 1.0) + +(set! (-> *blue-light-test-big* tex-id) (the-as uint #x403f00)) + +(set! (-> *blue-light-test-big* blend-mode) (the-as uint 1)) + +(set! (-> *blue-light-test-big* alpha-1-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-big* alpha-1-mode) (the-as uint 0)) + +(set! (-> *blue-light-test-big* alpha-1-repeat-dist) 262144.0) + +(set! (-> *blue-light-test-big* alpha-2-curve) #f) + +(set! (-> *blue-light-test-big* alpha-2-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-big* alpha-2-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-big* width-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-big* width-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-big* width-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-big* uv-repeat-dist) 28672.0) + +(set! (-> *blue-light-test-big* regenerate-time-start) (seconds 0.035)) + +(set! (-> *blue-light-test-big* regenerate-time-end) (seconds 0.067)) + +(set! (-> *blue-light-test-big* width-range-start) 8192.0) + +(set! (-> *blue-light-test-big* width-range-end) 8192.0) + +(set! (-> *blue-light-test-big* fade-time) (seconds 0.3)) + +(set! (-> *blue-light-test-big* uv-shift?) #t) + +(set! (-> *blue-light-test-big* uv-shift-speed) (seconds -0.5)) + +(set! (-> *blue-light-test-big* use-sprite-bucket?) #t) + +(set! (-> *blue-light-test-big* use-accurate-interp?) #t) + +(if (or (zero? *blue-light-test-big-intense*) (!= loading-level global)) + (set! *blue-light-test-big-intense* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *blue-light-test-big-intense* base-alpha) 0.7) + +(set! (-> *blue-light-test-big-intense* tex-id) (the-as uint #x403f00)) + +(set! (-> *blue-light-test-big-intense* blend-mode) (the-as uint 1)) + +(set! (-> *blue-light-test-big-intense* alpha-1-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-big-intense* alpha-1-mode) (the-as uint 0)) + +(set! (-> *blue-light-test-big-intense* alpha-1-repeat-dist) 409600.0) + +(set! (-> *blue-light-test-big-intense* alpha-2-curve) #f) + +(set! (-> *blue-light-test-big-intense* alpha-2-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-big-intense* alpha-2-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-big-intense* width-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-big-intense* width-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-big-intense* width-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-big-intense* uv-repeat-dist) 28672.0) + +(set! (-> *blue-light-test-big-intense* regenerate-time-start) (seconds 0.035)) + +(set! (-> *blue-light-test-big-intense* regenerate-time-end) (seconds 0.067)) + +(set! (-> *blue-light-test-big-intense* width-range-start) 28672.0) + +(set! (-> *blue-light-test-big-intense* width-range-end) 28672.0) + +(set! (-> *blue-light-test-big-intense* fade-time) (seconds 0.3)) + +(set! (-> *blue-light-test-big-intense* uv-shift?) #t) + +(set! (-> *blue-light-test-big-intense* uv-shift-speed) (seconds -0.5)) + +(set! (-> *blue-light-test-big-intense* use-sprite-bucket?) #t) + +(set! (-> *blue-light-test-big-intense* use-accurate-interp?) #t) + +(if (or (zero? *blue-light-test-small-fade*) (!= loading-level global)) + (set! *blue-light-test-small-fade* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *blue-light-test-small-fade* base-alpha) 1.0) + +(set! (-> *blue-light-test-small-fade* tex-id) (the-as uint #x408f00)) + +(set! (-> *blue-light-test-small-fade* blend-mode) (the-as uint 1)) + +(set! (-> *blue-light-test-small-fade* alpha-1-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-small-fade* alpha-1-mode) (the-as uint 0)) + +(set! (-> *blue-light-test-small-fade* alpha-1-repeat-dist) 409600.0) + +(set! (-> *blue-light-test-small-fade* alpha-2-curve) #f) + +(set! (-> *blue-light-test-small-fade* alpha-2-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-small-fade* alpha-2-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-small-fade* width-curve) *curve-linear-down*) + +(set! (-> *blue-light-test-small-fade* width-mode) (the-as uint 3)) + +(set! (-> *blue-light-test-small-fade* width-repeat-dist) 4096.0) + +(set! (-> *blue-light-test-small-fade* uv-repeat-dist) 28672.0) + +(set! (-> *blue-light-test-small-fade* regenerate-time-start) (seconds 0.167)) + +(set! (-> *blue-light-test-small-fade* regenerate-time-end) (seconds 0.25)) + +(set! (-> *blue-light-test-small-fade* width-range-start) 32768.0) + +(set! (-> *blue-light-test-small-fade* width-range-end) 32768.0) + +(set! (-> *blue-light-test-small-fade* fade-time) (seconds 0.3)) + +(set! (-> *blue-light-test-small-fade* uv-shift?) #t) + +(set! (-> *blue-light-test-small-fade* uv-shift-speed) (seconds -0.5)) + +(set! (-> *blue-light-test-small-fade* use-sprite-bucket?) #t) + +(set! (-> *blue-light-test-small-fade* use-accurate-interp?) #t) + +(defmethod setup-draw! ((this gun-blue-2-lightning-tracker) (arg0 gun-blue-2-lightning-info)) + (cond + ((-> arg0 should-draw-extension?) + (set! (-> *blue-light-test-big* alpha-1-repeat-dist) 262144.0) + (set! (-> *blue-light-test* alpha-1-repeat-dist) 262144.0) + ) + ((> (-> arg0 num-pts) 0) + (let* ((f0-2 (vector-vector-distance (the-as vector (-> arg0 pts)) (-> arg0 pts (+ (-> arg0 num-pts) -1)))) + (f0-3 (+ 16384.0 f0-2)) + ) + (set! (-> *blue-light-test-big* alpha-1-repeat-dist) (fmin 262144.0 f0-3)) + (set! (-> *blue-light-test* alpha-1-repeat-dist) (fmin 262144.0 f0-3)) + ) + ) + ) + (dotimes (s4-0 4) + (let ((s3-0 (-> this lt-array s4-0))) + (set! (-> s3-0 inner-point-travel-time) (seconds 0.5)) + (set! (-> s3-0 snap-inner-points?) #t) + (set! (-> s3-0 appearance) *blue-light-test*) + (set! (-> s3-0 fractal-reduction) (/ (* 0.4 (logf 9.0)) (logf 12.0))) + (set! (-> s3-0 generate-mode) (the-as uint 1)) + (when (< 1 (-> arg0 num-pts)) + ) + (set! (-> s3-0 num-active-spans) (+ (-> arg0 num-pts) -1)) + (dotimes (v1-31 (-> s3-0 num-active-spans)) + (let ((a0-8 (-> s3-0 spans data v1-31))) + (let ((a1-5 (-> s3-0 spans-internal data v1-31))) + (set! (-> s3-0 span-pts-start data v1-31 quad) (-> arg0 pts v1-31 quad)) + (set! (-> a0-8 random-offset-size-start) 0.0) + (if (> v1-31 0) + (set! (-> a0-8 random-offset-size-start) 8192.0) + ) + (set! (-> a1-5 num-inner-points) 4) + ) + (set! (-> a0-8 inner-random-offset-size) 8192.0) + ) + ) + (let ((v1-37 (-> s3-0 spans data (-> s3-0 num-active-spans)))) + (set! (-> s3-0 span-pts-start data (-> s3-0 num-active-spans) quad) + (-> arg0 pts (-> s3-0 num-active-spans) quad) + ) + (set! (-> v1-37 random-offset-size-start) 0.0) + ) + (lightning-bolt-method-11 s3-0) + (lightning-bolt-method-12 s3-0) + ) + ) + (dotimes (s4-1 2) + (let ((s3-1 (-> this lt-array (+ s4-1 4)))) + (set! (-> s3-1 inner-point-travel-time) (seconds 0.085)) + (set! (-> s3-1 snap-inner-points?) #t) + (set! (-> s3-1 appearance) *blue-light-test-big*) + (set! (-> s3-1 fractal-reduction) (/ (* 0.4 (logf 9.0)) (logf 12.0))) + (set! (-> s3-1 generate-mode) (the-as uint 1)) + (when (< 1 (-> arg0 num-pts)) + ) + (set! (-> s3-1 num-active-spans) (+ (-> arg0 num-pts) -1)) + (dotimes (v1-58 (-> s3-1 num-active-spans)) + (let ((a0-24 (-> s3-1 spans data v1-58))) + (let ((a1-16 (-> s3-1 spans-internal data v1-58))) + (set! (-> s3-1 span-pts-start data v1-58 quad) (-> arg0 pts v1-58 quad)) + (set! (-> a0-24 random-offset-size-start) 0.0) + (if (> v1-58 0) + (set! (-> a0-24 random-offset-size-start) 4096.0) + ) + (set! (-> a1-16 num-inner-points) 3) + ) + (set! (-> a0-24 inner-random-offset-size) 4096.0) + ) + ) + (let ((v1-64 (-> s3-1 spans data (-> s3-1 num-active-spans)))) + (set! (-> s3-1 span-pts-start data (-> s3-1 num-active-spans) quad) + (-> arg0 pts (-> s3-1 num-active-spans) quad) + ) + (set! (-> v1-64 random-offset-size-start) 0.0) + ) + (lightning-bolt-method-11 s3-1) + (lightning-bolt-method-12 s3-1) + ) + ) + (set! (-> this root trans quad) (-> arg0 pts (+ (-> arg0 num-pts) -1) quad)) + (when (-> arg0 should-draw-terminal-sparks?) + (when (time-elapsed? (-> this last-spark-time) (-> this spark-time-interval)) + (set-time! (-> this last-spark-time)) + (set! (-> this spark-time-interval) + (the-as + time-frame + (the int (* 5.0000005 (the float (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 3)))) + ) + ) + (let ((s4-2 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 3))) + (let ((v1-90 (-> this lt-array 5))) + (-> v1-90 spans data (-> v1-90 num-active-spans)) + (set! (-> arg0 terminal-spark-pos quad) (-> v1-90 span-pts-start data (-> v1-90 num-active-spans) quad)) + ) + (set! (-> this root trans quad) (-> arg0 terminal-spark-pos quad)) + (dotimes (s5-1 s4-2) + (process-drawable-shock-effect-replace + this + (-> *lightning-spec-id-table* 13) + lightning-probe-callback + 256 + 0 + 40960.0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate active (gun-blue-2-lightning-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notice) + (case (-> block param 0) + (('die) + (go-virtual die) + ) + ) + ) + (('gun-blue-lightning) + (case (-> (the-as gun-blue-lightning-command (-> block param 0)) msg) + (((gun-blue-lightning-cmd-msg inactive)) + (go-virtual inactive) + ) + ) + #t + ) + ) + ) + :enter (behavior () + (set! (-> self prev-targ-pos quad) (-> (target-pos 0) quad)) + (set-time! (-> self state-time)) + (set-time! (-> self active-enter-time)) + (set-time! (-> self last-deduct-ammo-time)) + (dotimes (gp-1 (-> self lt-array length)) + (lightning-bolt-method-13 (-> self lt-array gp-1) 0) + ) + (set! (-> *blue-2-lightning-shape* num-knots) (the-as uint 12)) + (let ((v1-17 (new 'stack-no-clear 'vector))) + (set! (-> v1-17 quad) (-> *target* gun fire-point quad)) + (let ((a0-9 (vector-float*! (new 'stack-no-clear 'vector) (-> *target* gun laser-dir) 24576.0))) + (dotimes (a1-4 (the-as int (-> *blue-2-lightning-shape* num-knots))) + (set! (-> *blue-2-lightning-shape* constraints a1-4 pt quad) (-> v1-17 quad)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 a1-4)))) + (-> *target* gun laser-dir quad) + ) + (vector+! v1-17 v1-17 a0-9) + (set! (-> *blue-2-lightning-shape* constraints a1-4 length) 24576.0) + ) + ) + ) + (adjust-player-ammo -1.0 (pickup-type ammo-blue)) + (dotimes (v1-20 12) + (set! (-> *gun-blue-2-targets* v1-20 target) (the-as handle #f)) + (set! (-> *gun-blue-2-targets* v1-20 start-time) 0) + ) + (when (or (>= (- (-> *display* game-clock frame-counter) (-> *gun-blue-2-last-attack-id-time* time)) (seconds 0.4)) + (< (-> *display* game-clock frame-counter) (-> *gun-blue-2-last-attack-id-time* time)) + ) + (let* ((v1-31 *game-info*) + (a0-21 (+ (-> v1-31 attack-id) 1)) + ) + (set! (-> v1-31 attack-id) a0-21) + (set! *gun-blue-2-last-attack-id* a0-21) + ) + (set! (-> *gun-blue-2-last-attack-id-time* time) (-> *display* game-clock frame-counter)) + ) + ) + :exit (behavior () + (kill-particles (-> self part)) + (dotimes (gp-0 (-> self lt-array length)) + (let ((s5-0 (-> self lt-array gp-0))) + (when (zero? (lightning-bolt-method-14 s5-0)) + (lightning-bolt-method-13 s5-0 2) + (lightning-bolt-method-11 s5-0) + (lightning-bolt-method-12 s5-0) + ) + ) + ) + ) + :trans (behavior () + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 76 (seconds 0.5)) + (if (not (time-elapsed? (-> self active-enter-time) (seconds 0.2))) + (sound-play-by-name + (static-sound-name "blue-gun2-loop") + (-> self snd-lightning) + 768 + (the int (* 1524.0 (lerp -0.5 0.0 (* 0.016666668 (the float (- (current-time) (-> self state-time))))))) + 0 + (sound-group) + #t + ) + (sound-play "blue-gun2-loop" :id (-> self snd-lightning) :vol 75) + ) + (let ((f0-6 (lerp-scale-clamp 0.0 1.0 (-> *target* gun fire-spinv) 0.0 109226.664))) + 0.0 + (let ((f0-9 (- 1.0 (* (- 1.0 f0-6) (- 1.0 f0-6))))) + (seek! (-> self spin-intensity) f0-9 (* 2.0 (seconds-per-frame))) + ) + ) + (if (< 0.1 (-> self spin-intensity)) + (sound-play-by-name + (static-sound-name "blue-gun2-spin") + (-> self snd-spin) + (the int (* 1024.0 (lerp 0.75 1.0 (-> self spin-intensity)))) + (the int (* 1524.0 (lerp -0.5 0.0 (-> self spin-intensity)))) + 0 + (sound-group) + (-> self root trans) + ) + ) + (+! (-> self revolve-angle) (* 65536.0 (seconds-per-frame))) + (+! (-> self sway-angle) (* 65536.0 (seconds-per-frame))) + (gun-blue-2-lightning-tracker-method-25 self) + (when (time-elapsed? (-> self last-deduct-ammo-time) (seconds 0.1)) + (adjust-player-ammo-over-time + (the-as int (- (current-time) (-> self last-deduct-ammo-time))) + 7.5 + (pickup-type ammo-blue) + 10000.0 + ) + (set-time! (-> self last-deduct-ammo-time)) + ) + (spawn (-> self part) (-> *target* gun fire-point)) + (if (or (not (cpad-hold? 0 r1)) + (or (>= 0.0 (get-remaining-player-ammo (pickup-type ammo-blue))) + (!= (-> *target* gun using-gun-type) 33) + (not (-> *target* gun active?)) + (and (-> *target* next-state) (= (-> *target* next-state name) 'target-attack-air)) + ) + ) + (go-virtual inactive) + ) + ) + :code sleep-code + :post (behavior () + '() + ) + ) + +(defmethod relocate ((this gun-blue-2-lightning-tracker) (offset int)) + (dotimes (v1-0 (-> this lt-array length)) + (if (nonzero? (-> this lt-array v1-0)) + (&+! (-> this lt-array v1-0) offset) + ) + ) + (if (nonzero? (-> this lt-array)) + (&+! (-> this lt-array) offset) + ) + (call-parent-method this offset) + ) + +(deftype gun-blue-2-lightning-init-params (structure) + ((num-beams int8) + ) + ) + + +(defskelgroup skel-gun-blue-2-tracker scenecamera scenecamera-lod0-jg -1 + ((scenecamera-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 10 + ) + +(defstate test (gun-blue-2-lightning-tracker) + :virtual #t + :code sleep-code + ) + +(defbehavior gun-blue-2-lightning-init-by-other gun-blue-2-lightning-tracker ((arg0 gun-blue-2-lightning-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-blue-2-tracker" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self lt-array) (new 'process 'boxed-array lightning-bolt (-> arg0 num-beams))) + (dotimes (v1-5 6) + (set! (-> self lt-array v1-5) (the-as lightning-bolt 0)) + ) + (dotimes (gp-1 4) + (set! (-> self lt-array gp-1) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> self lt-array gp-1) 12 6 *blue-light-test*) + ) + (set! (-> self lt-array 4) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> self lt-array 4) 12 5 *blue-light-test-big*) + (set! (-> self lt-array 5) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> self lt-array 5) 12 5 *blue-light-test-big*) + (set! (-> self revolve-angle) 0.0) + (set! (-> self sway-angle) 0.0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 107) self)) + (set! (-> self last-spark-time) 0) + (set! (-> self spark-time-interval) 0) + (set! (-> self snd-lightning) (new-sound-id)) + (set! (-> self snd-spin) (new-sound-id)) + (set! (-> self should-draw-this-frame?) #f) + (go-virtual active) + ) + +;; WARN: Return type mismatch int vs handle. +(defbehavior create-lightning-tracker-if-necessary target () + (the-as + handle + (when (or (not (handle->process (-> self gun gun 0 extra))) + (!= (-> (handle->process (-> self gun gun 0 extra)) type) gun-blue-2-lightning-tracker) + ) + (let ((gp-0 (new 'stack-no-clear 'gun-blue-2-lightning-init-params))) + (set! (-> gp-0 num-beams) 6) + (let ((v0-0 (ppointer->handle (process-spawn + gun-blue-2-lightning-tracker + :init gun-blue-2-lightning-init-by-other + gp-0 + :name "gun-blue-2-lightning-tracker" + :to self + :stack-size #x29400 + ) + ) + ) + ) + (set! (-> self gun gun 0 extra) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + ) + +(defun is-valid-blue-2-target ((arg0 process-focusable) (arg1 int)) + (local-vars (v0-1 symbol)) + (with-pp + (when (and (!= *target* arg0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'get-vehicle) + (and (!= (send-event-function *target* a1-1) arg0) + (not (focus-test? arg0 disable dead inactive gun-no-target)) + (or (logtest? (process-mask enemy vehicle civilian) (-> arg0 mask)) + (and (logtest? (process-mask guard) (-> arg0 mask)) (-> *setting-control* user-current gun-target-guards?)) + ) + ) + ) + ) + (let ((v1-16 (process->handle arg0))) + (dotimes (a0-11 arg1) + (if (= (-> *found-objects* a0-11) v1-16) + (return #f) + ) + ) + ) + (return #t) + ) + (return #f) + v0-1 + ) + ) + +(defun find-gun-blue-2-target ((arg0 vector) (arg1 int)) + (local-vars (sv-32 process-drawable) (sv-36 number) (sv-40 vector)) + (set! sv-32 (the-as process-drawable #f)) + (set! sv-36 4096000.0) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (set! (-> v1-1 quad) (-> arg0 quad)) + (set! sv-40 v1-1) + ) + (set! (-> sv-40 w) 0.0) + (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* (the-as bounding-box arg0) s4-0 384)) + (let* ((s2-0 (-> s4-0 s3-0)) + (a0-5 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when a0-5 + (let* ((s1-0 (-> a0-5 process)) + (s2-1 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-1 + (when (is-valid-blue-2-target (the-as process-focusable s2-1) arg1) + (let* ((s1-2 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s2-1) 3) sv-40)) + (f0-2 (vector-normalize-ret-len! s1-2 1.0)) + ) + (when (< f0-2 (the-as float sv-36)) + (set! sv-32 s2-1) + (set! sv-36 f0-2) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s3-1 *target*) + (s4-1 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) arg0) (-> arg0 w))) + (when (is-valid-blue-2-target s4-1 arg1) + (let* ((gp-2 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-1 3) sv-40)) + (f0-4 (vector-normalize-ret-len! gp-2 1.0)) + ) + (when (< f0-4 (the-as float sv-36)) + (set! sv-32 s4-1) + (set! sv-36 f0-4) + ) + ) + ) + ) + ) + sv-32 + ) + +(defun find-gun-blue-2-target-old ((arg0 vector) (arg1 int) (arg2 vector)) + (local-vars (sv-32 process-drawable) (sv-36 number) (sv-40 vector)) + (set! sv-32 (the-as process-drawable #f)) + (set! sv-36 16384.0) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (set! (-> v1-1 quad) (-> arg0 quad)) + (set! sv-40 v1-1) + ) + (set! (-> arg0 w) 16384.0) + (set! (-> sv-40 w) 1.0) + (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* (the-as bounding-box arg0) s3-0 384)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-5 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-5 + (let* ((s0-0 (-> a0-5 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when s1-1 + (when (is-valid-blue-2-target (the-as process-focusable s1-1) arg1) + (let* ((s0-2 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s1-1) 3) sv-40)) + (f0-3 (vector-normalize-ret-len! s0-2 1.0)) + (f1-1 (vector-dot s0-2 arg2)) + ) + (when (< f0-3 (the-as float sv-36)) + (when (< 0.6 f1-1) + (set! sv-32 s1-1) + (set! sv-36 f0-3) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s2-1 *target*) + (s3-1 (if (type? s2-1 process-focusable) + s2-1 + ) + ) + ) + (when (and s3-1 (< (vector-vector-distance (get-trans s3-1 0) arg0) (-> arg0 w))) + (when (is-valid-blue-2-target s3-1 arg1) + (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) (get-trans s3-1 3) sv-40)) + (f0-5 (vector-normalize-ret-len! s5-2 1.0)) + (f1-4 (vector-dot s5-2 arg2)) + ) + (when (< f0-5 (the-as float sv-36)) + (when (< 0.6 f1-4) + (set! sv-32 s3-1) + (set! sv-36 f0-5) + ) + ) + ) + ) + ) + ) + sv-32 + ) + +(define *lightning-pts-cache* (new 'static 'inline-array vector 20 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +(defmethod gun-blue-2-lightning-tracker-method-26 ((this gun-blue-2-lightning-tracker) (arg0 vector) (arg1 vector) (arg2 gun-blue-lightning-command)) + (let ((s3-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector+float*! + (-> s3-0 start-pos) + arg1 + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + -7372.8 + ) + (vector-! (-> s3-0 move-dist) arg1 (-> s3-0 start-pos)) + (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) 1.2) + (let ((s2-1 s3-0)) + (set! (-> s2-1 radius) 409.6) + (set! (-> s2-1 collide-with) + (collide-spec backgnd obstacle vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> s2-1 ignore-process0) (the-as process-tree (send-event *target* 'get-vehicle))) + (set! (-> s2-1 ignore-process1) #f) + (set! (-> s2-1 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> s2-1 action-mask) (collide-action solid)) + ) + (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (when (>= f0-3 0.0) + (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) f0-3) + (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) + (set! (-> arg2 lightning-info terminal-spark-pos quad) (-> s4-0 quad)) + (set! (-> arg2 lightning-info num-pts) 1) + (set! (-> arg2 lightning-info pts 0 quad) (-> s4-0 quad)) + (set! (-> arg2 lightning-info should-draw-terminal-sparks?) #t) + (set! (-> arg2 lightning-info should-draw-extension?) #f) + (setup-draw! this (-> arg2 lightning-info)) + (return #f) + ) + ) + (let ((s5-1 fire-projectile-if-necessary) + (s3-1 (-> s3-0 start-pos)) + ) + (s5-1 s3-1 s4-0 (process->handle (send-event this 'get-vehicle))) + ) + ) + #t + ) + +(defmethod gun-blue-2-lightning-tracker-method-25 ((this gun-blue-2-lightning-tracker)) + (local-vars + (sv-624 gun-info) + (sv-628 vector) + (sv-632 gun-blue-lightning-command) + (sv-640 int) + (sv-648 int) + (sv-656 (pointer int32)) + (sv-1440 symbol) + (sv-1456 collide-query) + (sv-1472 collide-query) + ) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this prev-targ-pos)))) + (set! (-> s5-1 y) 0.0) + (dotimes (v1-1 12) + (vector+! + (the-as vector (-> *blue-2-lightning-shape* constraints v1-1)) + (the-as vector (-> *blue-2-lightning-shape* constraints v1-1)) + s5-1 + ) + ) + ) + (set! (-> this prev-targ-pos quad) (-> (target-pos 0) quad)) + (set! sv-624 (-> *target* gun)) + (set! sv-628 (-> *target* gun laser-dir)) + (set! sv-632 (new 'stack-no-clear 'gun-blue-lightning-command)) + (set! sv-640 0) + (set! sv-648 -1) + (set! sv-656 (new 'static 'array int32 12 0 0 0 0 0 0 0 0 0 0 0 0)) + (vector-normalize! sv-628 1.0) + (set! (-> *blue-2-lightning-shape* constraints 0 pt quad) (-> sv-624 fire-point quad)) + (set! (-> *blue-2-lightning-shape* constraints 0 dir quad) (-> sv-628 quad)) + (rope-constraint-method-9 *blue-2-lightning-shape* 0) + (if (zero? (-> this last-probe-index)) + (+! (-> this last-probe-index) 1) + ) + (dotimes (v1-22 12) + (set! (-> *lightning-pts-cache* v1-22 quad) (-> *blue-2-lightning-shape* constraints v1-22 pt quad)) + ) + (if (not (gun-blue-2-lightning-tracker-method-26 this sv-628 (-> sv-624 fire-point) sv-632)) + (return 0) + ) + (set! (-> sv-632 msg) (gun-blue-lightning-cmd-msg active)) + (set! (-> sv-632 lightning-info num-pts) 1) + (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #f) + (set! (-> sv-632 lightning-info should-draw-extension?) #f) + (let ((s5-3 1) + (s4-0 (+ (-> *blue-2-lightning-shape* num-knots) -1)) + ) + (while (>= (the-as int s4-0) s5-3) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> *lightning-pts-cache* s5-3 quad)) + (let ((s2-0 (the-as process-drawable #f))) + (let ((a0-19 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set! (-> a0-19 quad) (-> s3-0 quad)) + (set! (-> a0-19 w) 12288.0) + (if (not (the-as symbol s2-0)) + (set! s2-0 (find-gun-blue-2-target-old + a0-19 + sv-640 + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) + ) + ) + ) + ) + (cond + (s2-0 + (set! (-> *found-objects* sv-640) (process->handle s2-0)) + (set! (-> *gun-blue-2-targets* s5-3 target) (process->handle s2-0)) + (set! (-> sv-656 s5-3) 1) + (set! sv-640 (+ sv-640 1)) + (set! sv-648 s5-3) + (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable s2-0) 3) quad)) + (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (vector-! + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) + (-> *lightning-pts-cache* s5-3) + (the-as vector (-> *blue-2-lightning-shape* constraints (+ s5-3 -1))) + ) + (vector-normalize! + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) + 1.0 + ) + (dotimes (v1-65 1) + ) + ) + (else + (set! (-> sv-656 s5-3) 0) + 0 + ) + ) + (let ((s0-0 s3-0) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-1 quad) (-> *lightning-pts-cache* (+ s5-3 -1) quad)) + (set! sv-1440 (the-as symbol #f)) + (set! sv-1456 (new 'stack-no-clear 'collide-query)) + (set! (-> sv-1456 start-pos quad) (-> s1-1 quad)) + (vector-! (-> sv-1456 move-dist) s0-0 s1-1) + (set! sv-1472 sv-1456) + (set! (-> sv-1472 radius) 860.16) + (set! (-> sv-1472 collide-with) + (collide-spec backgnd obstacle vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> sv-1472 ignore-process0) (the-as process-tree (send-event *target* 'get-vehicle))) + (set! (-> sv-1472 ignore-process1) #f) + (set! (-> sv-1472 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> sv-1472 action-mask) (collide-action solid)) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* sv-1456))) + (when (>= f0-3 0.0) + (vector-float*! (-> sv-1456 move-dist) (-> sv-1456 move-dist) f0-3) + (vector+! s0-0 s1-1 (-> sv-1456 move-dist)) + (set! sv-1440 #t) + (set! (-> this last-probe-index) s5-3) + (cond + ((> s5-3 0) + (let ((v0-11 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> sv-1456 move-dist) 1.0))) + (vector+float*! (-> sv-632 lightning-info terminal-spark-pos) s0-0 v0-11 -6144.0) + ) + ) + (else + (set! (-> sv-632 lightning-info terminal-spark-pos quad) (-> s0-0 quad)) + ) + ) + ) + ) + (when (not s2-0) + ) + (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (+! (-> sv-632 lightning-info num-pts) 1) + (let ((s3-1 fire-projectile-if-necessary) + (a2-13 (if (< 1 sv-640) + (the-as int (-> *found-objects* (+ sv-640 -2))) + (process->handle (send-event this 'get-vehicle)) + ) + ) + ) + (s3-1 s1-1 s0-0 (the-as handle a2-13)) + ) + ) + ) + ) + (when sv-1440 + (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #t) + (set! (-> sv-632 lightning-info should-draw-extension?) #f) + 0 + (goto cfg-54) + ) + (+! s5-3 1) + ) + ) + (label cfg-54) + (if (and (= sv-648 (+ (-> sv-632 lightning-info num-pts) -2)) + (not (-> sv-632 lightning-info should-draw-extension?)) + ) + (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #f) + ) + (dotimes (s5-4 (-> sv-632 lightning-info num-pts)) + (set! (-> sv-632 lightning-info pts s5-4 quad) (-> *lightning-pts-cache* s5-4 quad)) + (when (and (> s5-4 0) (zero? (-> sv-656 s5-4))) + (let ((s4-1 + (matrix-f-u-compose + (new 'stack-no-clear 'matrix) + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-4))) + *up-vector* + ) + ) + (f0-9 (the float (sar (shl (the int (+ (-> this revolve-angle) (* 6144.0 (the float s5-4)))) 48) 48))) + (s3-2 (-> sv-632 lightning-info pts s5-4)) + ) + (the float (sar (shl (the int (+ (-> this sway-angle) (* 5461.3335 (the float s5-4)))) 48) 48)) + (vector-rotate-around-axis! + (-> s4-1 uvec) + (the-as quaternion (-> s4-1 uvec)) + f0-9 + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-4))) + ) + (vector-normalize! (-> s4-1 uvec) 1.0) + (vector+float*! s3-2 s3-2 (-> s4-1 uvec) 2048.0) + ) + ) + ) + (setup-draw! this (-> sv-632 lightning-info)) + ) + +;; WARN: Return type mismatch int vs object. +(defbehavior gun-fire-blue-2 target () + (if (and (-> *target* next-state) (= (-> *target* next-state name) 'target-attack-air)) + (return (the-as object 0)) + ) + (create-lightning-tracker-if-necessary) + (let ((v1-8 (new 'stack-no-clear 'gun-blue-lightning-command))) + (set! (-> v1-8 msg) (gun-blue-lightning-cmd-msg active)) + (send-event (handle->process (-> self gun gun 0 extra)) 'gun-blue-lightning v1-8) + ) + 0 + ) + +(defbehavior gun-fire-blue-2-old target () + (local-vars + (sv-608 gun-info) + (sv-612 vector) + (sv-616 gun-blue-lightning-command) + (sv-768 vector) + (sv-772 vector) + (sv-776 vector) + (sv-784 int) + (sv-792 int) + (sv-800 vector) + (sv-848 vector) + (sv-852 vector) + ) + (create-lightning-tracker-if-necessary) + (set! sv-608 (-> self gun)) + (set! sv-612 (-> self gun fire-dir-out)) + (set! sv-616 (new 'stack-no-clear 'gun-blue-lightning-command)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (set! (-> sv-616 msg) (gun-blue-lightning-cmd-msg active)) + (set! (-> sv-616 lightning-info num-pts) 0) + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #f) + (set! (-> sv-616 lightning-info should-draw-extension?) #t) + (vector-normalize! sv-612 1.0) + (when (not (do-fire-backcheck (-> sv-608 fire-point) sv-612)) + (let ((a0-5 (handle->process (-> sv-608 gun 0 extra)))) + (send-event a0-5 'gun-blue-lightning sv-616) + ) + (return 0) + ) + (let ((v1-23 (new 'stack-no-clear 'vector))) + (set! (-> v1-23 quad) (-> sv-608 fire-point quad)) + (set! sv-768 v1-23) + ) + (set! sv-772 (vector+float*! (new 'stack-no-clear 'vector) (-> sv-608 fire-point) sv-612 409600.0)) + (let ((v1-26 (new 'stack-no-clear 'vector))) + (set! (-> v1-26 quad) (-> sv-612 quad)) + (set! sv-776 v1-26) + ) + (set! sv-784 0) + (set! sv-792 -1) + (set! sv-800 (new 'stack-no-clear 'vector)) + (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> sv-768 quad)) + (+! (-> sv-616 lightning-info num-pts) 1) + (vector-! sv-800 sv-772 sv-768) + (dotimes (gp-0 8) + (let ((f30-0 32768.0)) + (set! sv-848 (new 'stack-no-clear 'vector)) + (set! sv-852 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-612 f30-0)) + (set! (-> sv-848 quad) (-> sv-852 quad)) + (set! (-> sv-848 w) 20480.0) + (let ((s5-0 (the-as process #f))) + (let ((s4-0 #f)) + (when (< gp-0 7) + (when (and (handle->process (-> *gun-blue-2-targets* gp-0 target)) + (not (time-elapsed? (-> *gun-blue-2-targets* gp-0 start-time) (seconds 0.5))) + ) + (let* ((s2-0 (handle->process (-> *gun-blue-2-targets* gp-0 target))) + (s3-0 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when (is-valid-blue-2-target (the-as process-focusable s3-0) sv-784) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s3-0) 3) sv-852))) + (vector-normalize-ret-len! s2-2 1.0) + (let ((f0-5 (vector-dot s2-2 sv-776))) + (when (< 0.87 f0-5) + (set! s4-0 #t) + (set! s5-0 s3-0) + ) + ) + ) + ) + ) + ) + (when (not s4-0) + (set! (-> *gun-blue-2-targets* gp-0 target) (the-as handle #f)) + (set-time! (-> *gun-blue-2-targets* gp-0 start-time)) + ) + (if (not s5-0) + (set! s5-0 (find-gun-blue-2-target-old sv-848 sv-784 sv-776)) + ) + ) + ) + (cond + (s5-0 + (set! (-> *found-objects* sv-784) (process->handle s5-0)) + (set! (-> *gun-blue-2-targets* gp-0 target) (process->handle s5-0)) + (set! sv-784 (+ sv-784 1)) + (set! sv-792 gp-0) + (vector-! sv-800 (get-trans (the-as process-focusable s5-0) 3) sv-768) + (vector-normalize! sv-800 1.0) + ) + (else + (vector-normalize! sv-800 1.0) + (let ((f0-7 (vector-dot sv-800 sv-776))) + (when (< f0-7 0.866) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f28-0 0.0) + ) + (acos f0-7) + 5461.3335 + (vector-cross! s5-1 sv-800 sv-776) + (vector-normalize! s5-1 1.0) + (vector-rotate-around-axis! sv-800 (the-as quaternion sv-776) f28-0 s5-1) + ) + ) + ) + (vector-normalize! sv-800 1.0) + ) + ) + ) + (set! (-> sv-776 quad) (-> sv-800 quad)) + (let ((s5-3 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-800 f30-0))) + (let ((s4-3 #f)) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> sv-768 quad)) + (vector-! (-> s3-1 move-dist) s5-3 sv-768) + (let ((v1-99 s3-1)) + (set! (-> v1-99 radius) 40.96) + (set! (-> v1-99 collide-with) + (collide-spec backgnd vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> v1-99 ignore-process0) #f) + (set! (-> v1-99 ignore-process1) #f) + (set! (-> v1-99 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-99 action-mask) (collide-action solid)) + ) + (let ((f0-11 (fill-and-probe-using-line-sphere *collide-cache* s3-1))) + (when (>= f0-11 0.0) + (vector-float*! (-> s3-1 move-dist) (-> s3-1 move-dist) f0-11) + (vector+! s5-3 sv-768 (-> s3-1 move-dist)) + (set! s4-3 #t) + (cond + ((> gp-0 0) + (let ((a0-80 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-1 move-dist) 1.0))) + (vector+float*! (-> sv-616 lightning-info terminal-spark-pos) s5-3 a0-80 -12288.0) + ) + ) + (else + (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + ) + ) + ) + ) + ) + (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> s5-3 quad)) + (+! (-> sv-616 lightning-info num-pts) 1) + (let ((s3-2 fire-projectile-if-necessary) + (s2-3 sv-768) + (s1-0 s5-3) + (a2-7 (if (< 1 sv-784) + (the-as int (-> *found-objects* (+ sv-784 -2))) + (process->handle (send-event self 'get-vehicle)) + ) + ) + ) + (s3-2 s2-3 s1-0 (the-as handle a2-7)) + ) + (set! (-> sv-768 quad) (-> s5-3 quad)) + (when s4-3 + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) + (set! (-> sv-616 lightning-info should-draw-extension?) #f) + 0 + (goto cfg-70) + ) + ) + (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + ) + ) + ) + (label cfg-70) + (if (and (= sv-792 (+ (-> sv-616 lightning-info num-pts) -2)) + (not (-> sv-616 lightning-info should-draw-extension?)) + ) + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #f) + ) + (let ((s5-4 (-> sv-616 lightning-info pts (+ (-> sv-616 lightning-info num-pts) -1)))) + (when (-> sv-616 lightning-info should-draw-extension?) + (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) s5-4 sv-800 409600.0)) + (s4-4 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s4-4 start-pos quad) (-> s5-4 quad)) + (vector-! (-> s4-4 move-dist) gp-2 s5-4) + (let ((v1-154 s4-4)) + (set! (-> v1-154 radius) 40.96) + (set! (-> v1-154 collide-with) + (collide-spec backgnd vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> v1-154 ignore-process0) #f) + (set! (-> v1-154 ignore-process1) #f) + (set! (-> v1-154 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-154 action-mask) (collide-action solid)) + ) + (let ((f0-15 (fill-and-probe-using-line-sphere *collide-cache* s4-4))) + (when (>= f0-15 0.0) + (vector-float*! (-> s4-4 move-dist) (-> s4-4 move-dist) f0-15) + (vector+! gp-2 s5-4 (-> s4-4 move-dist)) + ) + ) + (set! (-> sv-616 lightning-info extension-end-point quad) (-> gp-2 quad)) + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) + (let ((a0-122 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-4 move-dist) 1.0))) + (vector+float*! (-> sv-616 lightning-info terminal-spark-pos) gp-2 a0-122 -12288.0) + ) + ) + ) + ) + (let ((a0-124 (handle->process (-> sv-608 gun 0 extra)))) + (send-event a0-124 'gun-blue-lightning sv-616) + ) + ) + +(defbehavior target-gun-can-fire-blue? target ((arg0 pickup-type)) + #t + ) + +(define *last-fire-blue-time* (the-as time-frame 0)) + +;; WARN: Return type mismatch object vs (pointer process). +(defbehavior target-gun-fire-blue target ((arg0 pickup-type)) + (the-as (pointer process) (case arg0 + (((pickup-type gun-blue-1)) + (gun-fire-blue-1) + ) + (((pickup-type gun-blue-2)) + (gun-fire-blue-2) + ) + (((pickup-type gun-blue-3)) + (let ((f0-0 -2.0)) + (if (logtest? (game-secrets gun-upgrade-blue-3) (-> *game-info* secrets)) + (set! f0-0 -1.5) + ) + (adjust-player-ammo f0-0 (pickup-type ammo-blue)) + ) + (when (time-elapsed? *last-fire-blue-time* (seconds 0.1)) + (sound-play "blue-gun3-shot") + (set! *last-fire-blue-time* (current-time)) + ) + (sound-play "blue-gun3-trace") + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.1)) + (dotimes (s5-2 3) + (gun-fire-blue-3) + ) + #f + ) + ) + ) + ) + +(deftype gun-blue-shot (projectile) + ((init-pos vector :inline) + (init-dir vector :inline) + (collide-normal vector :inline) + ) + ) + + +(deftype gun-blue-shot-2 (gun-blue-shot) + () + ) + +(format 0 "SKIP: gun-blue-shot removed lightning spec 14~%") +;; (set! (-> *lightning-spec-id-table* 14) (new 'static 'lightning-spec +;; :name "lightning-blue-2-impact-shot-attack-thick" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 1.0 +;; :fade-time 30.0 +;; :texture (new 'static 'texture-id :index #x3f :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 8192.0 +;; :merge-factor 0.6 +;; :merge-count 2 +;; :radius 3276.8 +;; :duration 60.0 +;; :sound (static-sound-spec "stretched-zap" :group 1) +;; ) +;; ) + +(defmethod deal-damage! ((this gun-blue-shot-2) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (set! (-> this damage) 0.0) + ) + (when (logtest? (game-secrets gun-upgrade-blue-2) (-> *game-info* secrets)) + (if (logtest? (process-mask kg-robot) (-> arg0 mask)) + (set! (-> this damage) (* 2.0 (-> this damage))) + ) + ) + (if (< (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 2) + (process-drawable-shock-effect + (the-as process-drawable arg0) + (-> *lightning-spec-id-table* 12) + lightning-probe-callback + (-> *part-id-table* 664) + 0 + 0 + 40960.0 + ) + ) + (call-parent-method this arg0 arg1) + ) + +(defmethod projectile-method-24 ((this gun-blue-shot)) + (with-pp + (let* ((s4-0 (-> *part-id-table* 236)) + (s3-0 (get-field-spec-by-id s4-0 (sp-field-id spt-omega))) + (a1-1 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'eject-point) + (set! (-> a1-1 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let ((s5-0 (the-as vector (send-event-function (ppointer->process (-> this parent)) a1-1)))) + (when s5-0 + (when s3-0 + (let ((s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 1.0)) + (s2-0 (new 'stack-no-clear 'collide-query)) + ) + (vector-rotate-y! s1-0 s1-0 16384.0) + (vector+float*! s1-0 s5-0 s1-0 -8806.4) + (set! (-> s2-0 start-pos quad) (-> s1-0 quad)) + (vector-float*! (-> s2-0 move-dist) (-> this root dynam gravity-normal) -81920.0) + (let ((v1-15 s2-0)) + (set! (-> v1-15 radius) 1228.8) + (set! (-> v1-15 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) + (set! (-> v1-15 ignore-process0) this) + (set! (-> v1-15 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-15 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-15 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (set! (-> s3-0 initial-valuef) + (fmin (+ 1638.4 (-> s2-0 best-other-tri intersect y)) (+ -1228.8 (-> this starting-pos y))) + ) + (set! (-> s3-0 initial-valuef) (+ -81920.0 (-> this starting-pos y))) + ) + ) + ) + (let ((s4-1 (get-field-spec-by-id s4-0 (sp-field-id spt-rotate-y)))) + (if s4-1 + (set! (-> s4-1 initial-valuef) (y-angle (-> this root))) + ) + ) + (launch-particles (-> *part-id-table* 236) s5-0) + (let ((s4-2 (get-field-spec-by-id (-> *part-id-table* 235) (sp-field-id spt-rotate-y)))) + (if s4-2 + (set! (-> s4-2 initial-valuef) (y-angle (-> this root))) + ) + ) + (launch-particles (-> *part-id-table* 235) s5-0) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this gun-blue-shot)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this init-pos)))) + (draw-beam (-> *part-id-table* 231) (-> this init-pos) s3-1 #t) + (draw-beam (-> *part-id-table* 234) (-> this init-pos) (-> this starting-dir) #f) + (let ((s5-0 (-> *part-id-table* 246)) + (s4-0 (-> *part-id-table* 245)) + ) + (new 'stack-no-clear 'vector) + (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> this collide-normal)))) + (vector-normalize! s2-0 1.0) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-x)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-y)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-z)) + (let ((a1-7 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) + (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) + (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (matrix->eul (the-as euler-angles s1-0) a1-7 21) + (vector-negate! s3-2 s1-0) + (let ((a0-14 s3-2)) + (let ((v1-16 s3-2)) + (let ((a1-10 -3640.889)) + (.mov vf6 a1-10) + ) + (.lvf vf4 (&-> v1-16 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-14 quad) vf5) + ) + (sparticle-set-conerot s5-0 s3-2) + (sparticle-set-conerot s4-0 s3-2) + ) + ) + ) + ) + (let ((v1-24 (cond + ((logtest? (-> *part-group-id-table* 90 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 90)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 90)) + ) + ) + ) + ) + (send-event (ppointer->process v1-24) 'clock this) + ) + 0 + (none) + ) + ) + +(defmethod deal-damage! ((this gun-blue-shot) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (set! (-> this damage) 0.0) + ) + (+! (-> *game-info* shots-hit 2) 1.0) + (call-parent-method this arg0 arg1) + ) + +(defmethod projectile-method-27 ((this gun-blue-shot)) + (draw-beam (-> *part-id-table* 231) (-> this init-pos) (-> this init-dir) #f) + (draw-beam (-> *part-id-table* 234) (-> this init-pos) (-> this starting-dir) #f) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this gun-blue-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "blue-shot-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +(defmethod made-impact? ((this gun-blue-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -12288.0 12697.6 -2048.0 t1-0) + ) + ) + +(defun gun-blue-shot-move ((arg0 gun-blue-shot)) + (projectile-move-fill-line-sphere arg0) + (when (logtest? (-> arg0 root status) (collide-status touch-actor)) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs collide-status. +(defun cshape-reaction-blue-shot ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (vector-reset! arg2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (set! (-> (the-as gun-blue-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (let ((v0-1 4)) + (logior! (-> arg0 status) v0-1) + (the-as collide-status v0-1) + ) + ) + +(defmethod setup-collision! ((this gun-blue-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-blue-shot) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-blue-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 1228.8) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd obstacle pusher shield)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this gun-blue-shot)) + (with-pp + (+! (-> *game-info* shots-fired 2) 1.0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) gun-blue-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) 2.0) + (if (logtest? (game-secrets gun-upgrade-blue-1) (-> *game-info* secrets)) + (set! (-> this damage) 2.5) + ) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + ) + +(defmethod init-proj-settings! ((this gun-blue-shot-2)) + (with-pp + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) gun-blue-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) 2.5) + (set! (-> this vehicle-damage-factor) 2.0) + (set! (-> this vehicle-impulse-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + ) + +(defmethod projectile-method-24 ((this gun-blue-shot-2)) + 0 + (none) + ) + +(defmethod projectile-method-27 ((this gun-blue-shot-2)) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this gun-blue-shot-2)) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this gun-blue-shot-3)) + (let ((s5-0 sphere-in-view-frustum?) + (a0-2 (new 'stack 'sphere)) + ) + (set! (-> a0-2 quad) (-> this root trans quad)) + (set! (-> a0-2 r) 4096.0) + (when (s5-0 a0-2) + (let ((v1-11 + (cond + ((logtest? (-> *part-group-id-table* 108 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 108)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 108)) + ) + ) + ) + ) + (send-event (ppointer->process v1-11) 'clock this) + ) + ) + ) + 0 + (none) + ) + +(defstate dissipate (gun-blue-shot-3) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (go-virtual die) + ) + ) + +(defstate impact (gun-blue-shot-3) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (go-virtual die) + ) + ) + +(defmethod deal-damage! ((this gun-blue-shot-3) (arg0 process) (arg1 event-message-block)) + (+! (-> *game-info* shots-hit 2) 1.0) + (if (and (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (set! (-> this damage) 0.0) + ) + (call-parent-method this arg0 arg1) + ) + +(defmethod projectile-method-26 ((this gun-blue-shot-2)) + 0 + (none) + ) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index 63d58d588a..327651b5c1 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -108,7 +108,7 @@ ;; WARN: Return type mismatch float vs none. (defun sparticle-lightning-2d-spline-align-plus-rotz ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object)) - (sparticle-2d-spline-align-instant arg0 arg1 arg2 arg3) + (sparticle-2d-spline-align-instant arg0 arg1 arg2) (+! (-> arg2 flag-rot-sy z) (-> *part-id-table* 664 init-specs 4 initial-valuef)) (none) ) @@ -337,13 +337,14 @@ ) +;; WARN: Return type mismatch matrix vs none. (defmethod projectile-method-25 ((this gun-dark-3-nuke)) (when (not (logtest? (-> this draw status) (draw-control-status no-draw))) (let ((s5-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) (set! (-> s5-0 trans quad) (-> this root trans quad)) - (sparticle-launch-control-method-17 (-> this part) s5-0) - (sparticle-subsampler-method-10 (-> this smoke-trail) s5-0) + (spawn-from-mat (-> this part) s5-0) + (init-with-mat! (-> this smoke-trail) s5-0) ) ) (none) @@ -3577,7 +3578,7 @@ ) (set! (-> a1-7 trans quad) (-> s4-2 start-pos quad)) (set! (-> a1-7 trans y) f30-2) - (sparticle-launch-control-method-17 (-> self part) a1-7) + (spawn-from-mat (-> self part) a1-7) ) ) ) diff --git a/goal_src/jak3/engine/target/gun/gun-part.gc b/goal_src/jak3/engine/target/gun/gun-part.gc index acabf66290..025829cc09 100644 --- a/goal_src/jak3/engine/target/gun/gun-part.gc +++ b/goal_src/jak3/engine/target/gun/gun-part.gc @@ -8,6 +8,24 @@ (define-extern *yellow-shot-2-trail* light-trail-composition) (define-extern *red-shot-3-trail* light-trail-composition) (define-extern *last-player-pos* vector) +(define-extern *range-explo-dust-color* curve-color-fast) +(define-extern *range-explo-dust-alpha* curve2d-fast) +(define-extern *range-explo-dust-scale-x* curve2d-fast) +(define-extern *range-explo-dust-scale-y* curve2d-fast) +(define-extern *curve-explo-dust-alpha* curve2d-fast) +(define-extern *curve-explo-dust-scale-x* curve2d-fast) +(define-extern *curve-explo-dust-scale-y* curve2d-fast) +(define-extern *range-explo-color* curve-color-fast) +(define-extern *range-explo-alpha* curve2d-fast) +(define-extern *range-explo-scale-x* curve2d-fast) +(define-extern *range-explo-scale-y* curve2d-fast) +(define-extern *curve-explo-alpha* curve2d-fast) +(define-extern *curve-explo-scale-x* curve2d-fast) +(define-extern *curve-explo-scale-y* curve2d-fast) +(define-extern *curve-linear-up-red* curve2d-piecewise) +(define-extern *curve-yellow2-shot-alpha* curve2d-piecewise) +(define-extern *curve-yellow2-shot-color* curve-color-fast) +(define-extern *curve-linear-down-long* curve2d-fast) (define-extern *gun-dark-3-nuke-fade-time-small* time-frame) (define-extern *gun-dark-3-nuke-blur-time-small* time-frame) (define-extern *gun-dark-3-nuke-blur-curve-small* curve2d-piecewise) @@ -25,3 +43,4666 @@ ;; DECOMP BEGINS +gun + +(defpart 207 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:birth-func 'birth-func-laser-pointer) + (:num 1.0) + (:scale-x (meters 0.075) (meters 0.05)) + (:scale-y (meters 40)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0 8.0) + (:fade-a -1.6) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x401a00 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + #x403900 + ) + ) + (:func 'sparticle-texture-animate) + ) + ) + +(defun sparticle-track-gun-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (-> arg1 key) + (let ((v1-1 *target*) + (a1-1 36) + ) + (when v1-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1)) + (set! (-> arg2 x) (-> *target* gun fire-point x)) + (set! (-> arg2 y) (-> *target* gun fire-point y)) + (set! (-> arg2 z) (-> *target* gun fire-point z)) + ) + ) + 0 + (none) + ) + +(defpartgroup group-laser-glow + :id 83 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 208 :flags (sp6)) (sp-item 209 :flags (sp6))) + ) + +(defpart 209 + :init-specs ((:texture (glow level-default-sprite)) + (:birth-func 'birth-func-set-alpha-from-userdata) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b :copy g) + (:a 48.0 16.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1.0) + ) + ) + +(defpart 208 + :init-specs ((:texture (glow level-default-sprite)) + (:birth-func 'birth-func-set-alpha-from-userdata) + (:num 1.0) + (:scale-x (meters 0.25) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b :copy g) + (:a 64.0 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 1.0) + ) + ) + +(defpart 210 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.05)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b :copy g) + (:a 100.0 28.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 211 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 32.0) + (:b :copy g) + (:a 32.0 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 212 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 0.0) + (:b :copy g) + (:a 96.0 32.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +(defpart 213 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 8)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-gun-red-shot-fired + :id 84 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 214) (sp-item 215)) + ) + +(defpart 214 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.5)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -12.75) + (:fade-a -2.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +(defpart 215 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.5)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters 0.21333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -12.8) + (:fade-b -3.2) + (:fade-a -4.8) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +(defpartgroup group-gun-red-shot-reload + :id 85 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 216)) + ) + +(defpart 216 + :init-specs ((:texture (common-white common)) + (:num 2.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.08)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.053333335) (meters 0.10666667)) + (:rotvel-z (degrees -1440) (degrees 2880)) + (:fade-a -0.42666668) + (:accel-y (meters -0.005) (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees -60) (degrees 120)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(define *red-shot-colors* (new 'static 'array rgba 36 + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :a #x4) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe :a #x4) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe :a #x4) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe :a #x4) + ) + ) + +(defpart 217 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 8)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-gun-red3-shot-fired + :id 86 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 214) (sp-item 215)) + ) + +(defpartgroup group-gun-red3-shot-glow + :id 87 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 218)) + ) + +(defpart 218 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-gun-red3-shot-explode + :id 88 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 219 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 220 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 221 :period (seconds 30) :length (seconds 0.035)) + (sp-item 222 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 223 :period (seconds 30) :length (seconds 0.167)) + (sp-item 224 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +(defpart 219 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 220 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 225 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 221 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-explo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-gun-red3-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 221 init-specs 14 initial-valuef) + (the-as float *part-gun-red3-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* color-start) *range-explo-dust-color*) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* alpha-start) *range-explo-dust-alpha*) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-x-start) *range-explo-dust-scale-x*) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-y-start) *range-explo-dust-scale-y*) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* a-scalar) *curve-explo-dust-alpha*) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-x-scalar) *curve-explo-dust-scale-x*) + +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-y-scalar) *curve-explo-dust-scale-y*) + +(defpart 223 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 224 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-gun-red3-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 224 init-specs 16 initial-valuef) + (the-as float *part-gun-red3-explosion-texture-curve-settings*) + ) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* color-start) *range-explo-color*) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* alpha-start) *range-explo-alpha*) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-x-start) *range-explo-scale-x*) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-y-start) *range-explo-scale-y*) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* a-scalar) *curve-explo-alpha*) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-x-scalar) *curve-explo-scale-x*) + +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-y-scalar) *curve-explo-scale-y*) + +(defpart 222 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-gun-red-3-scorched-earth + :id 89 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 226 :flags (is-3d sp3 sp7))) + ) + +(defpart 226 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:scale-y (meters 5) (meters 5)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 0.85333335 0.85333335) + (:timer (seconds 3)) + (:flags (left-multiply-quat)) + (:next-time (seconds 0.25)) + (:next-launcher 227) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 227 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.75)) (:next-launcher 228)) + ) + +(defpart 228 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpart 229 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 230 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-b -2.56) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(when (or (zero? *curve-linear-up-red*) (!= loading-level global)) + (set! *curve-linear-up-red* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-linear-up-red* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *curve-linear-up-red* pts data 0 first) 0.0) + +(set! (-> *curve-linear-up-red* pts data 0 second) 0.3) + +(set! (-> *curve-linear-up-red* pts data 1 first) 1.0) + +(set! (-> *curve-linear-up-red* pts data 1 second) 1.0) + +(if (or (zero? *red-shot-3-trail*) (!= loading-level global)) + (set! *red-shot-3-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *red-shot-3-trail* color-mode) (the-as uint 0)) + +(set! (-> *red-shot-3-trail* color-repeat-dist) 40960.0) + +(set! (-> *red-shot-3-trail* alpha-1-mode) (the-as uint 0)) + +(set! (-> *red-shot-3-trail* alpha-2-mode) (the-as uint 1)) + +(set! (-> *red-shot-3-trail* base-alpha) 0.5) + +(set! (-> *red-shot-3-trail* alpha-repeat-dist) 6144.0) + +(set! (-> *red-shot-3-trail* width-mode) (the-as uint 2)) + +(set! (-> *red-shot-3-trail* base-width) 2048.0) + +(set! (-> *red-shot-3-trail* width-repeat-dist) 20480.0) + +(set! (-> *red-shot-3-trail* uv-mode) (the-as uint 0)) + +(set! (-> *red-shot-3-trail* uv-repeat-dist) 16384000.0) + +(set! (-> *red-shot-3-trail* lie-mode) (the-as uint 0)) + +(set! (-> *red-shot-3-trail* max-age) (seconds 0.5)) + +(if #f + (set! (-> *red-shot-3-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *red-shot-3-trail* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *red-shot-3-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +(set! (-> *red-shot-3-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-red*)) + +(set! (-> *red-shot-3-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *red-shot-3-trail* alpha-curve-2) *curve-linear-up-red*) + +(set! (-> *red-shot-3-trail* zbuffer?) #f) + +(set! (-> *red-shot-3-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *red-shot-3-trail* use-tape-mode?) #f) + +(set! (-> *red-shot-3-trail* blend-mode) (the-as uint 1)) + +(set! (-> *red-shot-3-trail* frame-stagger) (the-as uint 1)) + +(when (or (zero? *curve-yellow2-shot-alpha*) (!= loading-level global)) + (set! *curve-yellow2-shot-alpha* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-yellow2-shot-alpha* 21 'loading-level (the-as int #f)) + ) + +(set! (-> *curve-yellow2-shot-alpha* pts data 0 first) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 0 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 1 first) 0.1) + +(set! (-> *curve-yellow2-shot-alpha* pts data 1 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 2 first) 0.4) + +(set! (-> *curve-yellow2-shot-alpha* pts data 2 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 3 first) 0.401) + +(set! (-> *curve-yellow2-shot-alpha* pts data 3 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 4 first) 0.45) + +(set! (-> *curve-yellow2-shot-alpha* pts data 4 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 5 first) 0.451) + +(set! (-> *curve-yellow2-shot-alpha* pts data 5 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 6 first) 0.5) + +(set! (-> *curve-yellow2-shot-alpha* pts data 6 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 7 first) 0.501) + +(set! (-> *curve-yellow2-shot-alpha* pts data 7 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 8 first) 0.55) + +(set! (-> *curve-yellow2-shot-alpha* pts data 8 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 9 first) 0.551) + +(set! (-> *curve-yellow2-shot-alpha* pts data 9 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 10 first) 0.6) + +(set! (-> *curve-yellow2-shot-alpha* pts data 10 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 11 first) 0.601) + +(set! (-> *curve-yellow2-shot-alpha* pts data 11 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 12 first) 0.65) + +(set! (-> *curve-yellow2-shot-alpha* pts data 12 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 13 first) 0.651) + +(set! (-> *curve-yellow2-shot-alpha* pts data 13 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 14 first) 0.7) + +(set! (-> *curve-yellow2-shot-alpha* pts data 14 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 15 first) 0.701) + +(set! (-> *curve-yellow2-shot-alpha* pts data 15 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 16 first) 0.75) + +(set! (-> *curve-yellow2-shot-alpha* pts data 16 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 17 first) 0.751) + +(set! (-> *curve-yellow2-shot-alpha* pts data 17 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 18 first) 0.8) + +(set! (-> *curve-yellow2-shot-alpha* pts data 18 second) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 19 first) 0.801) + +(set! (-> *curve-yellow2-shot-alpha* pts data 19 second) 0.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 20 first) 1.0) + +(set! (-> *curve-yellow2-shot-alpha* pts data 20 second) 0.0) + +(if #t + (set! *curve-yellow2-shot-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 0.8 :z 0.8 :w 128.0) + (new 'static 'vector :x 1.0 :y 0.5 :z 0.5 :w 128.0) + (new 'static 'vector :x 1.0 :y 0.5 :z 0.5 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.25 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-linear-down-long* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.9 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if (or (zero? *yellow-shot-2-trail*) (!= loading-level global)) + (set! *yellow-shot-2-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *yellow-shot-2-trail* color-mode) (the-as uint 0)) + +(set! (-> *yellow-shot-2-trail* color-repeat-dist) 286720.0) + +(set! (-> *yellow-shot-2-trail* alpha-1-mode) (the-as uint 0)) + +(set! (-> *yellow-shot-2-trail* alpha-2-mode) (the-as uint 1)) + +(set! (-> *yellow-shot-2-trail* base-alpha) 1.0) + +(set! (-> *yellow-shot-2-trail* alpha-repeat-dist) 286720.0) + +(set! (-> *yellow-shot-2-trail* width-mode) (the-as uint 2)) + +(set! (-> *yellow-shot-2-trail* base-width) 2867.2) + +(set! (-> *yellow-shot-2-trail* width-repeat-dist) 163840.0) + +(set! (-> *yellow-shot-2-trail* uv-mode) (the-as uint 0)) + +(set! (-> *yellow-shot-2-trail* uv-repeat-dist) 20480.0) + +(set! (-> *yellow-shot-2-trail* lie-mode) (the-as uint 0)) + +(set! (-> *yellow-shot-2-trail* max-age) (seconds 0.5)) + +(if #f + (set! (-> *yellow-shot-2-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *yellow-shot-2-trail* tex-id) (the-as uint #x501e00)) + ) + +(set! (-> *yellow-shot-2-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +(set! (-> *yellow-shot-2-trail* color-curve) (the-as curve-color-piecewise *curve-yellow2-shot-color*)) + +(set! (-> *yellow-shot-2-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down-long*)) + +(set! (-> *yellow-shot-2-trail* alpha-curve-2) *curve-yellow2-shot-alpha*) + +(set! (-> *yellow-shot-2-trail* zbuffer?) #f) + +(set! (-> *yellow-shot-2-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *yellow-shot-2-trail* use-tape-mode?) #f) + +(set! (-> *yellow-shot-2-trail* blend-mode) (the-as uint 1)) + +(set! (-> *yellow-shot-2-trail* frame-stagger) (the-as uint 1)) + +(defpart 231 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-setup-beam) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y (meters 100) (meters 20)) + (:r 0.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:fade-a 3.2) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x401000 #x401200)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.05)) + (:next-launcher 232) + ) + ) + +(defpart 232 + :init-specs ((:r 64.0) + (:g 128.0) + (:b 255.0) + (:a 48.0) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters -0.016666668)) + (:fade-r 1.2) + (:fade-g 0.8) + (:fade-a -0.10666667 -0.2) + (:accel-y (meters 0.000033333334)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 233) + ) + ) + +(defpart 233 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 234 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1) (meters 1.5)) + (:scale-y (meters 10) (meters 0.6)) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r 3.2) + (:fade-g 3.2) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 235 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 32.0 16.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:friction 0.85 0.04) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -45) (degrees 10)) + (:conerot-y (degrees 85) (degrees 10)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.4)) + ) + ) + +(defpart 236 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 260) (degrees 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:rotvel-z (degrees -4.8) (degrees 2.4)) + (:accel-y (meters -0.008333334) (meters -0.0016666667)) + (:friction 0.9 0.02) + (:timer (seconds 1.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408700 #x408700 #x408800)) + (:func 'check-shell-level1) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 237) + (:conerot-x (degrees -40) (degrees 20)) + (:conerot-y (degrees 80) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 237 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 238) + ) + ) + +(defpart 238 + :init-specs ((:r 128.0) (:g 128.0) (:b 255.0) (:a 128.0)) + ) + +(defpart 239 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-shell" :group 1)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.026666667) (meters 0.016666668)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0026666666) (meters -0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408800 #x408900)) + (:func 'check-shell-level2) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 237) + (:conerot-x (degrees 0) (degrees 45)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 240 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-shell" :group 1)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 30) (degrees 120)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:vel-x (meters 0) (meters 0.0033333334)) + (:vel-y (meters 0.016666668)) + (:vel-z (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408800 #x408800 #x408900)) + (:next-time (seconds 0.25)) + (:next-launcher 241) + (:conerot-x (degrees 30) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 241 + :init-specs ((:sound (static-sound-spec "blue-gun-shell" :group 1)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:next-time (seconds 2) (seconds 0.997)) + (:next-launcher 242) + ) + ) + +(defpart 242 + :init-specs ((:sound (static-sound-spec "blue-gun-shell" :group 1)) (:fade-a -0.512)) + ) + +(defun check-shell-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (set! (-> *part-id-table* 239 init-specs 11 initial-valuef) (-> gp-0 y)) + (launch-particles (-> *part-id-table* 239) gp-0) + (launch-particles (-> *part-id-table* 243) gp-0) + ) + ) + 0 + (none) + ) + +(defun check-shell-level2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 240) gp-0) + (launch-particles (-> *part-id-table* 243) gp-0) + ) + ) + 0 + (none) + ) + +(defpart 243 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.0 1 2.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.03) (meters 0.005)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.01125) (degrees 0.0045)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -2.55 -2.55) + (:fade-b -8.0) + (:fade-a -0.64 -0.64) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.8 0.02) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 60) (degrees 20)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-gun-blue-shot-hit + :id 90 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 244 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 245 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.017)) + (sp-item 246 :fade-after (meters 120) :falloff-to (meters 140) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 246 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 1)) + (:rot-x 4) + (:scale-y (meters 0.02) (meters 0.02)) + (:r 0.0) + (:g 64.0 128.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.2)) + (:fade-r -0.42666668) + (:fade-g -0.42666668) + (:accel-y (meters -0.0013333333) (meters -0.001)) + (:friction 0.875) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017) (seconds 0.98)) + (:next-launcher 247) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 80) (degrees 20)) + (:conerot-z (degrees 80) (degrees 20)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +(defpart 247 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668)) + ) + +(defpart 245 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 32.0) + (:vel-z (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0013333333) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-b 0.21333334) + (:fade-a -0.32) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90) (degrees 20)) + (:conerot-y (degrees 90) (degrees 20)) + (:conerot-z (degrees 90) (degrees 20)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +(defpart 244 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-rico" :group 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:rotvel-z (degrees 0.3)) + (:fade-r -5.1) + (:fade-g -3.92) + (:fade-b 0.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.035)) + (:next-launcher 248) + ) + ) + +(defpart 248 + :init-specs ((:scale-x (meters 1)) (:scale-y :copy scale-x) (:scalevel-x (meters 0.06)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-gun-blue-shot-die + :id 91 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(defpart 250 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 6)) + (:scale-y (meters 8)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 128.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-gun-dark-shot-fired + :id 92 + :duration (seconds 0.017) + :linger-duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 251 :flags (sp3 sp6)) (sp-item 252)) + ) + +(defpart 251 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5) (meters 0.5)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -6.4) + (:fade-g -6.375) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 252 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 32.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.04) (meters 0.03)) + (:r 0.0) + (:g 0.0 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.01125) (degrees 0.01125)) + (:vel-y (meters 0.1) (meters 0.3)) + (:fade-g -2.55 -2.55) + (:fade-a -0.256 -0.256) + (:accel-y (meters -0.0033333334)) + (:friction 0.8 0.02) + (:timer (seconds 0.335) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-jak-peacemaker-shot-hit + :id 93 + :duration (seconds 0.067) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 253 :flags (sp3 sp6)) + (sp-item 254 :flags (sp3 sp6)) + (sp-item 255 :fade-after (meters 160) :falloff-to (meters 160)) + (sp-item 256) + ) + ) + +(defpart 255 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.08) (meters 0.04)) + (:r 0.0) + (:g 0.0 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.005625) (degrees 0.005625)) + (:vel-y (meters 0.3) (meters 0.3)) + (:fade-g -0.85 -0.85) + (:fade-a -0.48 -0.10666667) + (:accel-y (meters -0.0033333334)) + (:friction 0.8 0.02) + (:timer (seconds 1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 256 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 16.0) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +(defpart 257 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 32.0 32.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +(defpart 254 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 32)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -1.6)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +(defpart 253 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:scalevel-x (meters 0.21333334) (meters 0.21333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -12.75) + (:fade-g -3.1875) + (:fade-a -0.4) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +(defun sparticle-dark-shot-lightning ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-3 (-> arg1 key proc root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + (sparticle-texture-animate arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-gun-dark-shot-trail + :id 94 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 258) (sp-item 259 :flags (sp6)) (sp-item 260 :flags (sp6)) (sp-item 261 :flags (sp6))) + ) + +(defpart 260 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.25) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 261 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpart 259 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b 128.0 128.0) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 258 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.9)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-y (meters 0.04)) + (:fade-r 6.4) + (:fade-g 6.4) + (:fade-a 6.4) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-dark-shot-lightning) + (:next-time (seconds 0.05) (seconds 0.015)) + (:next-launcher 262) + ) + ) + +(defpart 262 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-r -8.533334) + (:fade-g -8.533334) + (:fade-a -8.533334) + (:next-time (seconds 0.05) (seconds 0.015)) + (:next-launcher 263) + ) + ) + +(defpart 263 + :init-specs ((:scalevel-x (meters -0.00093750004) (meters -0.00093750004)) + (:scalevel-y (meters -0.00078125) (meters -0.00078125)) + (:fade-r -0.8) + (:fade-g -0.8) + (:fade-a -0.8) + ) + ) + +(defpart 264 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:scalevel-x (meters -0.005)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 265 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 6.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +(defpart 266 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.5 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.55 -1.28) + (:fade-b -1.28) + (:fade-a -0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 267 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 0.25) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.0020833334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.6) + (:fade-g -1.6) + (:fade-b -3.2 -6.4) + (:accel-y (meters -0.000033333334) (meters -0.00033333333)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defun sparticle-track-gun-joint-3d ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (-> arg1 key) + (let ((v1-1 *target*) + (a1-1 36) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1)) + ) + (set! (-> arg2 x) (-> *target* gun fire-point x)) + (set! (-> arg2 y) (-> *target* gun fire-point y)) + (set! (-> arg2 z) (-> *target* gun fire-point z)) + 0 + (none) + ) + +(defpart 268 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 269 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:scalevel-x (meters -0.005)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 270 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.01)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 6.0) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 271 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 0.55) (meters 0.1)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-z (meters -0.016666668) (meters -0.083333336)) + (:scalevel-x (meters -0.0020833334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.6) + (:fade-g -1.6) + (:fade-b -3.2 -6.4) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 272 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.067) (seconds 0.015)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 273 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 2.0) + (:scale-x (meters 0.01) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 30.0) + (:a 40.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.0) + (:fade-b -0.2) + (:fade-a -0.26666668) + (:timer (seconds 0.25) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 274 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 275 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.15)) + (:scale-y (meters 0.8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.025)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 276 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:scalevel-x (meters -0.005)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 277 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 30.2)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +(defpart 278 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 0.55) (meters 0.1)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-z (meters -0.016666668) (meters -0.083333336)) + (:scalevel-x (meters -0.0020833334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.6) + (:fade-g -1.6) + (:fade-b -3.2 -6.4) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-gun-yellow-saucer-lights + :id 95 + :linger-duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 279 :flags (sp6)) (sp-item 280 :flags (is-3d sp6 sp7)) (sp-item 281 :flags (is-3d sp6 sp7))) + ) + +(defpartgroup group-gun-yellow-saucer-lights-dark + :id 96 + :duration (seconds 2) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 282 :flags (sp3)) (sp-item 283 :flags (is-3d sp3 sp7)) (sp-item 284 :flags (is-3d sp3 sp7))) + ) + +(defpartgroup group-gun-yellow-saucer-fizz + :id 97 + :duration (seconds 30) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 285 :period (seconds 2) :length (seconds 0.017)) + (sp-item 286 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 287 :flags (sp3 sp7)) + ) + ) + +(defpart 287 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 15.0) + (:scale-x (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.05) (meters 0.016666668)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111) + (:accel-y (meters 0.00033333333)) + (:friction 0.9 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.167)) + (:next-launcher 288) + (:conerot-x (degrees 10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 288 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpart 279 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.1)) + (:scale-y (meters 0.8)) + (:r 40.0) + (:g 40.0) + (:b 40.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + (:func 'sparticle-track-root) + ) + ) + +(defpart 280 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 40.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +(defpart 281 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 40.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +(defpart 282 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.1)) + (:scale-y (meters 0.8)) + (:r 10.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 1.5)) + (:next-launcher 289) + ) + ) + +(defpart 283 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 1.5)) + (:next-launcher 289) + ) + ) + +(defpart 284 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 1.5)) + (:next-launcher 289) + ) + ) + +(defpart 289 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpartgroup group-gun-yellow-shot-hit-3 + :id 98 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 290 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 291 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 290 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 1.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 1.2)) + (:r 255.0) + (:g 200.0 55.0) + (:b 128.0) + (:a 32.0 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 291 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0013333333) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-gun-yellow-shot-hit-object-3 + :id 99 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 292 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 293 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.167)) + ) + ) + +(defpart 292 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 55.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 293 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 6.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.013333334)) + (:fade-g -0.21333334 -0.21333334) + (:fade-a -0.42666668) + (:accel-y (meters -0.001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-gun-yellow3-muzzle-smoke + :id 100 + :duration (seconds 0.067) + :linger-duration (seconds 1.667) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 294 :period (seconds 2) :length (seconds 0.017)) (sp-item 295 :flags (sp7))) + ) + +(defpart 294 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 55.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 295 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 30.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 64.0) + (:vel-z (meters 0.16666667) (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.016666668)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:friction 0.95 0.04) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-13)) + (:next-time (seconds 0.667)) + (:next-launcher 296) + (:conerot-x (degrees 10) (degrees 10)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 296 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.26666668) (:friction 0.99)) + ) + +(defpart 297 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-a -3.6571429) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-gun-yellow-shot-hit + :id 101 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 299 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 300 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 301 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 1)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.667)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.5)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.417)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.335)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.25)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.185)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.15)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.117)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.085)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.05)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.035)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017)) + (sp-item 303 :fade-after (meters 40) :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 304 :fade-after (meters 130) :falloff-to (meters 130) :period (seconds 2) :length (seconds 0.017) :binding 298) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + ) + ) + +(defpartgroup group-gun-yellow-shot-hit-object + :id 102 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 305 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 306 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 301 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 303 :fade-after (meters 40) :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 304 :fade-after (meters 130) :falloff-to (meters 130) :period (seconds 2) :length (seconds 0.017) :binding 298) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + ) + ) + +(defpart 298 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 0.15) (meters 0.1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 64.0) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:fade-g -3.4 -3.4) + (:fade-a -0.21333334 -1.28) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.95 0.02) + (:timer (seconds 0.667) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 304 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 4.0 12.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.225) (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 64.0 32.0) + (:omega (degrees 0.016875) (degrees 0.03375)) + (:vel-y (meters 0.2)) + (:fade-g -1.7 -1.7) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.95 0.02) + (:timer (seconds 0.667) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335) (seconds 0.33)) + (:next-launcher 307) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 308 + :init-specs ((:fade-a -0.96 -0.96)) + ) + +(defpart 301 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 32.0) + (:a 24.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.6857143) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 303 + :init-specs ((:num 1.0) + (:rot-x 12) + (:r 4096.0) + (:g 2867.2) + (:b 1638.4) + (:fade-b 5.12) + (:timer (seconds 0.8)) + (:flags (distort)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 302 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 32.0 8.0) + (:a 96.0) + (:vel-y (meters 0.026666667) (meters 0.053333335)) + (:scalevel-x (meters -0.0005) (meters -0.0005)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.7) + (:fade-b -0.53333336) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 309) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 309 + :init-specs ((:fade-r -1.28) (:fade-a -0.96)) + ) + +(defpart 300 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0 8.0) + (:a 24.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.117)) + (:next-launcher 310) + ) + ) + +(defpart 310 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.010958904)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.38356164) + (:fade-b 0.0) + (:fade-a -0.13150685) + ) + ) + +(defpart 306 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0 8.0) + (:a 24.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.117)) + (:next-launcher 311) + ) + ) + +(defpart 311 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.75) + (:fade-b 0.0) + (:fade-a -0.6) + ) + ) + +(defpart 299 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 0.5625)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.05)) + (:next-launcher 312) + ) + ) + +(defpart 312 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-b -5.1) + (:next-time (seconds 0.167)) + (:next-launcher 313) + ) + ) + +(defpart 313 + :init-specs ((:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.0018691589)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.14222223) + (:fade-b 0.0) + (:next-time (seconds 1.5)) + (:next-launcher 314) + ) + ) + +(defpart 314 + :init-specs ((:fade-g -2.2588236) (:fade-a -0.7529412)) + ) + +(defpart 305 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 0.5625)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.05)) + (:next-launcher 315) + ) + ) + +(defpart 315 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.04)) + (:scalevel-y :copy scalevel-x) + (:fade-b -5.1) + (:next-time (seconds 0.167)) + (:next-launcher 316) + ) + ) + +(defpart 316 + :init-specs ((:fade-g -4.8) (:fade-a -1.6)) + ) + +(defpartgroup group-gun-yellow-shot-die + :id 103 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(defpartgroup group-gun-dark-shot-hit + :id 104 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 317 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 318 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 319 :period (seconds 3) :length (seconds 0.05)) + (sp-item 320 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 321 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 322 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 323 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 323 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -6.2) + (:fade-b -0.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 324) + (:conerot-x '*sp-temp*) + ) + ) + +(defpart 322 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -6.2) + (:fade-b -0.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 324) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 324 + :init-specs ((:fade-r -2.1666667) + (:fade-g -5.0) + (:fade-b -1.3333334) + (:fade-a -0.062068965 -0.72) + (:next-time (seconds 0.05) (seconds 0.047)) + (:next-launcher 325) + ) + ) + +(defpart 325 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.7) + (:fade-g 0.0) + (:fade-b -0.8) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 326) + ) + ) + +(defpart 326 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.5833333) + (:fade-g 0.0) + (:fade-b -0.9444444) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 327) + ) + ) + +(defpart 327 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 318 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.13333334)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b 0.0) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 328) + ) + ) + +(defpart 328 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +(defpart 317 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b 0.0) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 329) + ) + ) + +(defpart 329 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.8285714) + (:fade-g -3.6571429) + (:fade-b -3.6571429) + (:fade-a -1.3714286) + ) + ) + +(defpart 321 + :init-specs ((:texture (specs level-default-sprite)) + (:num 6.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.1) + (:fade-b -0.1) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 330) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 330 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14444445) + (:fade-g -0.33333334) + (:fade-b -0.08888889) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 331) + ) + ) + +(defpart 331 + :init-specs ((:fade-r 0.0) (:fade-g -0.08695652) (:fade-a -0.18478261)) + ) + +(defpart 319 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 1.2) + (:fade-b 3.2) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 332) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +(defpart 332 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.0833334) + (:fade-g -2.1666667) + (:fade-b -0.6666667) + (:fade-a -0.46666667) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 333) + ) + ) + +(defpart 333 + :init-specs ((:fade-r -1.7) (:fade-g 0.0) (:fade-b -0.8) (:fade-a -1.0) (:next-time (seconds 0.167)) (:next-launcher 334)) + ) + +(defpart 334 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.17) + (:fade-g 0.0) + (:fade-b -0.3) + (:fade-a -0.1) + ) + ) + +(defpart 320 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 192.0 64.0) + (:g 128.0) + (:b 192.0 64.0) + (:a 32.0 96.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-r -1.4222223) + (:fade-g -1.4222223) + (:fade-b -1.4222223) + (:fade-a -1.4222223) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpartgroup group-gun-green-shot-hit + :id 105 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 335 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 336 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 337 :period (seconds 3) :length (seconds 0.05)) + (sp-item 338 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 339 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 340 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 341 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 341 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -6.2) + (:fade-g 0.0) + (:fade-b -10.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 342) + (:conerot-x '*sp-temp*) + ) + ) + +(defpart 340 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r -6.2) + (:fade-g 0.0) + (:fade-b -10.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 342) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 342 + :init-specs ((:fade-r -5.0) + (:fade-g -2.1666667) + (:fade-a -0.062068965 -0.72) + (:next-time (seconds 0.05) (seconds 0.047)) + (:next-launcher 343) + ) + ) + +(defpart 343 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.7) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 344) + ) + ) + +(defpart 344 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.5833333) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 345) + ) + ) + +(defpart 345 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 336 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.13333334)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667) + (:fade-g 0.0) + (:fade-b -8.5) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 346) + ) + ) + +(defpart 346 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.7066667) + (:fade-g -0.85333335) + (:fade-a -0.64) + ) + ) + +(defpart 335 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667) + (:fade-g 0.0) + (:fade-b -8.5) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 347) + ) + ) + +(defpart 347 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.6571429) + (:fade-g -1.8285714) + (:fade-a -1.3714286) + ) + ) + +(defpart 339 + :init-specs ((:texture (specs level-default-sprite)) + (:num 6.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.1) + (:fade-g 0.0) + (:fade-b -5.1) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 348) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 348 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.33333334) + (:fade-g -0.14444445) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 349) + ) + ) + +(defpart 349 + :init-specs ((:fade-r -0.08695652) (:fade-g 0.0) (:fade-a -0.18478261)) + ) + +(defpart 337 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.2) + (:fade-g 3.3) + (:fade-b 0.4) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 350) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +(defpart 350 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.1666667) + (:fade-g -1.0833334) + (:fade-b -2.1666667) + (:fade-a -0.46666667) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 351) + ) + ) + +(defpart 351 + :init-specs ((:fade-r 0.0) (:fade-g -1.7) (:fade-b -0.8) (:fade-a -1.0) (:next-time (seconds 0.167)) (:next-launcher 352)) + ) + +(defpart 352 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.17) + (:fade-b -0.3) + (:fade-a -0.1) + ) + ) + +(defpart 338 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 192.0 64.0) + (:b 64.0) + (:a 32.0 96.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-r -1.4222223) + (:fade-g -1.4222223) + (:fade-b -1.4222223) + (:fade-a -1.4222223) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpart 353 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 20.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0)) + (:vel-z (meters 0.13333334)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a 3.4) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-red-2-glow-trail-halt) + (:next-time (seconds 0.25)) + (:next-launcher 354) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 354 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:next-time (seconds 0.017) (seconds 0.247)) + (:next-launcher 355) + ) + ) + +(defpart 355 + :init-specs ((:scalevel-x (meters -0.0033333334) (meters -0.006666667)) (:scalevel-y :copy scalevel-x) (:fade-a -1.7)) + ) + +(defpart 356 + :init-specs ((:texture (blue-beam-dest level-default-water)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1.5)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 357 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-fade-alpha-dist) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup gun-blue-muzzle-flare + :id 106 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 358) (sp-item 359)) + ) + +(defpartgroup group-gun-blue-2-muzzle-flare + :id 107 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 360) (sp-item 361) (sp-item 362)) + ) + +(defpart 360 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 20.0 10.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 361 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 20.0) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.035)) + (:next-launcher 363) + ) + ) + +(defpart 362 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 5.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:next-time (seconds 0.035)) + (:next-launcher 363) + ) + ) + +(defpart 363 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -2.0) (:fade-g -0.8) (:fade-a -4.0)) + ) + +(defpart 364 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:scale-y (meters 3) (meters 0.6)) + (:r 40.0) + (:g 200.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r -4.0) + (:fade-g -3.2) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-gun-blue3-shot-impact + :id 108 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 285 :fade-after (meters 120) :falloff-to (meters 140) :period (seconds 2) :length (seconds 0.017)) + (sp-item 286 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 285 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 2) (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.05) (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 128.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.016666668) (meters 0.1)) + (:fade-r -10.2 -10.2) + (:fade-g -5.1 -5.1) + (:friction 0.85) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 286 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 200.0 30.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -10.2) + (:fade-g -6.375) + (:fade-a -8.5 -8.5) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 358 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:fade-a -5.1) + (:timer (seconds 0.05) (seconds 0.097)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + (:func 'sparticle-track-gun-joint) + ) + ) + +(defpart 359 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.3) + (:scale-x (meters 0.2) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0) (meters -0.006666667)) + (:rotvel-z (degrees -0.26666668) (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-track-gun-joint) + ) + ) + +(defpart 365 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 366 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 2)) + (:r 50.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0) (meters 0.006666667)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.065)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 367 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.1 0.3) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.64) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 368 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.3) + (:scale-x (meters 0.2) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0) (meters -0.006666667)) + (:rotvel-z (degrees -0.26666668) (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-track-gun-joint) + ) + ) + +(defpartgroup group-red-2-charge + :id 109 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 369 :flags (sp7)) + (sp-item 370 :flags (sp7)) + (sp-item 371 :flags (sp7)) + (sp-item 372 :flags (sp6)) + (sp-item 373 :flags (sp6)) + ) + ) + +(defpart 369 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-converge) + (:num 0.5 0.5) + (:x (meters 1)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.035555556) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-red-2-converge) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defpart 370 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-converge) + (:num 0.5 0.5) + (:x (meters 1)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.035555556) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (left-multiply-quat)) + (:func 'sparticle-red-2-converge) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defpart 371 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 20.0) + (:b 32.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334) (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-gun-joint-player-y) + (:next-time (seconds 0.335)) + (:next-launcher 374) + ) + ) + +(defpart 374 + :init-specs ((:fade-a 0.0)) + ) + +(defpart 372 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 128.0) + (:a 20.0 40.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.167)) + (:flags (glow)) + (:userdata 409.6) + (:func 'sparticle-track-gun-joint) + ) + ) + +(defpart 373 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 10.0 5.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:func 'sparticle-track-gun-joint) + ) + ) + +(defun sparticle-track-gun-joint-player-y ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (-> arg1 key) + (let ((v1-1 *target*) + (a1-1 36) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1)) + ) + (set! (-> arg2 x) (-> *target* gun fire-point x)) + (set! (-> arg2 y) (+ 4096.0 (-> *target* control trans y))) + (set! (-> arg2 z) (-> *target* gun fire-point z)) + 0 + (none) + ) + +(define *last-player-pos* (new 'static 'vector)) + +(defun birth-func-converge ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (local-vars (v1-2 uint128) (v1-3 uint128)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack 'vector4w)) + ) + (set! (-> s3-0 quad) (-> *target* gun fire-point quad)) + (set! (-> s5-0 x) (- (-> arg2 x) (-> s3-0 x))) + (set! (-> s5-0 y) (- (-> arg2 y) (-> s3-0 y))) + (set! (-> s5-0 z) (- (-> arg2 z) (-> s3-0 z))) + (vector-normalize! s5-0 1.0) + (.lvf vf1 (&-> s5-0 quad)) + (vftoi12.xyzw vf2 vf1) + (.mov v1-2 vf2) + (.ppach v1-3 (the-as uint128 0) v1-2) + (set! (-> s4-0 quad) v1-3) + (vitof15.xyzw vf1 vf2) + (.svf (&-> s5-0 quad) vf1) + (set! (-> arg1 user-float) (the-as float (-> s4-0 x))) + (set! (-> arg1 omega) (the-as float (-> s4-0 y))) + ) + (none) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-red-2-converge ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (local-vars (v1-4 uint128) (v1-5 uint128) (v1-6 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (-> arg1 key) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 (new 'stack 'vector4w))) + (set! (-> v1-2 x) (the-as int (-> arg1 user-float))) + (set! (-> v1-2 y) (the-as int (-> arg1 omega))) + (let ((v1-3 (-> v1-2 quad))) + (.pextlh v1-4 v1-3 0) + ) + ) + (.pw.sra v1-5 v1-4 16) + (.mov vf2 v1-5) + (vitof12.xyzw vf1 vf2) + (.svf (&-> s4-0 quad) vf1) + (.mov v1-6 vf1) + (-> arg1 timer) + 0.0 + 0.0 + (let* ((f0-3 (* 0.0022222223 (the float (-> arg1 timer)))) + (f0-4 (* f0-3 f0-3)) + (f0-5 (- 1.0 f0-4)) + ) + (vector-normalize! s4-0 (lerp 10240.0 0.0 f0-5)) + ) + (set! (-> s5-0 quad) (-> *target* gun fire-point quad)) + (set! (-> arg2 x) (+ (-> s4-0 x) (-> s5-0 x))) + (set! (-> arg2 y) (+ (-> s4-0 y) (-> s5-0 y))) + (set! (-> arg2 z) (+ (-> s4-0 z) (-> s5-0 z))) + ) + (none) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun sparticle-red-2-glow-trail-halt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((f30-0 (-> arg1 omega)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s5-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s5-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s5-0 w) 1.0) + (let* ((f0-4 (vector-normalize-ret-len! s5-0 1.0)) + (f0-6 (- (* 300.0 f0-4) (* f30-0 (seconds-per-frame)))) + (f0-7 (fmax 0.0 f0-6)) + (f0-8 (* 0.0033333334 f0-7)) + ) + (vector-normalize! s5-0 f0-8) + ) + (set! (-> arg1 vel-sxvel x) (-> s5-0 x)) + (set! (-> arg1 vel-sxvel y) (-> s5-0 y)) + (set! (-> arg1 vel-sxvel z) (-> s5-0 z)) + ) + (none) + ) + +(define *gun-dark-3-nuke-fade-time* (seconds 2)) + +(when (or (zero? *gun-dark-3-nuke-fade-curve*) (!= loading-level global)) + (set! *gun-dark-3-nuke-fade-curve* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *gun-dark-3-nuke-fade-curve* 5 'loading-level (the-as uint #f)) + ) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 first) 0.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second w) 0.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 first) 0.05) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second w) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 first) 0.2) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second w) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 first) 0.5) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second w) 0.78125) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 first) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second y) 0.78125) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second z) 0.0) + +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second w) 0.0) + +(define *gun-dark-3-nuke-blur-segs* (the-as uint 10)) + +(define *gun-dark-3-nuke-blur-time* (seconds 5)) + +(when (or (zero? *gun-dark-3-nuke-blur-curve*) (!= loading-level global)) + (set! *gun-dark-3-nuke-blur-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-blur-curve* 4 'loading-level (the-as int #f)) + ) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 0 first) 0.0) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 0 second) 0.0) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 1 first) 0.1) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 1 second) 1.0) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 2 first) 0.5) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 2 second) 0.8) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 3 first) 1.0) + +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 3 second) 0.0) + +(define *gun-dark-3-mushroom-speed* 8192.0) + +(define *gun-dark-3-mushroom-size-time* (seconds 5)) + +(when (or (zero? *gun-dark-3-nuke-mushroom-size-curve-x*) (!= loading-level global)) + (set! *gun-dark-3-nuke-mushroom-size-curve-x* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-mushroom-size-curve-x* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 0 first) 0.0) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 0 second) 32768.0) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 1 first) 1.0) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 1 second) 49152.0) + +(when (or (zero? *gun-dark-3-nuke-mushroom-size-curve-y*) (!= loading-level global)) + (set! *gun-dark-3-nuke-mushroom-size-curve-y* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-mushroom-size-curve-y* 2 'loading-level (the-as int #f)) + ) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 0 first) 0.0) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 0 second) 16384.0) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 1 first) 1.0) + +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 1 second) 20480.0) + +(defpartgroup group-gun-dark3-stalk + :id 110 + :duration (seconds 0.085) + :linger-duration (seconds 8) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 375 :flags (sp3)) (sp-item 376) (sp-item 377) (sp-item 378 :flags (sp3))) + ) + +(defpart 377 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 10.0) + (:x (meters 0.5) (meters 1)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-x 4) + (:rot-z (degrees -90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 120.0 40.0) + (:b 40.0 10.0) + (:a 128.0) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:scalevel-y (meters 0.00066666666) (meters 0.00066666666)) + (:fade-r -0.042666666) + (:fade-g -0.042666666) + (:fade-b -0.042666666) + (:fade-a -0.042666666) + (:accel-y (meters 0.00033333333) (meters 0.0016666667)) + (:friction 0.82) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 5)) + (:next-launcher 379) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 379 + :init-specs ((:fade-a -0.08533333)) + ) + +(defpart 376 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters 0.5) (meters 1)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-x 4) + (:rot-z (degrees -90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 160.0 40.0) + (:b 90.0 30.0) + (:a 255.0) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:scalevel-y (meters 0.00066666666) (meters 0.00066666666)) + (:fade-a -0.1275 -0.1275) + (:accel-y (meters 0.00033333333) (meters 0.0016666667)) + (:friction 0.82) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 378 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 5.5)) + (:scale-x (meters 17)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 90)) + (:scale-y (meters 7.2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:vel-y (meters 0.0056666667)) + (:fade-a -0.10333333) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 375 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 5)) + (:scale-x (meters 30)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 50)) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:fade-a -0.102) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-gun-dark3-ring + :id 111 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 380 :flags (is-3d sp3)) + (sp-item 381 :flags (is-3d sp3)) + (sp-item 382 :flags (is-3d sp3)) + (sp-item 383 :period (seconds 10) :length (seconds 3)) + (sp-item 384 :flags (sp7) :period (seconds 10) :length (seconds 6)) + ) + ) + +(defpart 380 + :init-specs ((:texture (ring level-default-sprite)) + (:num 5.0) + (:y (meters 7) (meters 0.3)) + (:scale-x (meters 6)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 50.0) + (:b 0.0) + (:a 1.0) + (:fade-a 0.000100000005) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 3.335)) + (:next-launcher 385) + ) + ) + +(defpart 385 + :init-specs ((:scalevel-x (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:next-time (seconds 2)) + (:next-launcher 386) + ) + ) + +(defpart 386 + :init-specs ((:fade-a -0.425)) + ) + +(defpart 381 + :init-specs ((:texture (ring level-default-sprite)) + (:num 3.0) + (:y (meters 8) (meters 0.3)) + (:scale-x (meters 10)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 50.0) + (:b 0.0) + (:a 1.0) + (:fade-a 0.000100000005) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 3.835)) + (:next-launcher 385) + ) + ) + +(defpart 382 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters 9) (meters 0.3)) + (:scale-x (meters 14)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 50.0) + (:b 0.0) + (:a 1.0) + (:fade-a 0.000100000005) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 4.335)) + (:next-launcher 385) + ) + ) + +(defpart 383 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 30.0) + (:a 64.0 64.0) + (:vel-z (meters 0.026666667) (meters 0.026666667)) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 384 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:y (meters -2)) + (:scale-x (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 30.0) + (:a 64.0) + (:vel-y (meters -0.006666667) (meters -0.01)) + (:scalevel-x (meters -0.006666667) (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 160) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(define *gun-dark-3-nuke-fade-time-small* (seconds 6)) + +(when (or (zero? *gun-dark-3-nuke-fade-curve-small*) (!= loading-level global)) + (set! *gun-dark-3-nuke-fade-curve-small* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *gun-dark-3-nuke-fade-curve-small* 5 'loading-level (the-as uint #f)) + ) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 first) 0.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second w) 0.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 first) 0.05) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second w) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 first) 0.2) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second w) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 first) 0.5) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second y) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second z) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second w) 0.78125) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 first) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second x) 1.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second y) 0.78125) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second z) 0.0) + +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second w) 0.0) + +(define *gun-dark-3-nuke-blur-segs-small* (the-as uint 10)) + +(define *gun-dark-3-nuke-blur-time-small* (seconds 6)) + +(when (or (zero? *gun-dark-3-nuke-blur-curve-small*) (!= loading-level global)) + (set! *gun-dark-3-nuke-blur-curve-small* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-blur-curve-small* 4 'loading-level (the-as int #f)) + ) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 0 first) 0.0) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 0 second) 0.0) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 1 first) 0.1) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 1 second) 1.0) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 2 first) 0.5) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 2 second) 0.8) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 3 first) 1.0) + +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 3 second) 0.0) + +(defpartgroup group-gun-dark3-missile-trail + :id 112 + :duration (seconds 3) + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 387)) + ) + +(defpartgroup group-gun-dark3-missile-trail-smoke + :id 113 + :duration (seconds 3) + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 388 :flags (sp7))) + ) + +(defpart 387 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 100.0) + (:b 30.0) + (:a 128.0 55.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 388 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 24.0 32.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-gun-dark3-small + :id 114 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 389 :period (seconds 15) :length (seconds 6)) + (sp-item 390 :period (seconds 15) :length (seconds 3)) + (sp-item 391 :period (seconds 15) :length (seconds 0.035)) + (sp-item 392 :flags (sp3)) + ) + ) + +(defpart 389 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0) + (:x (meters -10) (meters 20)) + (:y (meters -10) (meters 20)) + (:z (meters -10) (meters 20)) + (:scale-x (meters 0.04) (meters 0.04)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 20.0 40.0) + (:b 0.0) + (:a 128.0 128.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.2125 -0.2125) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017)) + (:next-launcher 393) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 393 + :init-specs ((:accel-x (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-y (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-z (meters -0.0033333334) 1 (meters 0.006666667)) + (:next-time (seconds 0.067) (seconds 0.03)) + (:next-launcher 393) + ) + ) + +(defpart 390 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 60.0 20.0) + (:b 30.0) + (:a 64.0) + (:vel-z (meters 0.026666667) (meters 0.026666667)) + (:scalevel-x (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -8) (degrees 16)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 391 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 3)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.00033333333) (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.032) + (:fade-b -0.012) + (:fade-a -0.102 -0.102) + (:friction 0.999) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 392 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 50)) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:fade-a -0.17) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-gun3-dark-scorched-earth + :id 115 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 394 :flags (is-3d sp3 sp7))) + ) + +(defpart 394 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 3.0) + (:scale-x (meters 4) (meters 6)) + (:scale-y (meters 5) (meters 7)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 10)) + (:flags (left-multiply-quat)) + (:next-time (seconds 6)) + (:next-launcher 395) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 395 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpartgroup group-gun-dark2-black-hole + :id 116 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 396 :flags (sp6)) (sp-item 397 :flags (sp6))) + ) + +(defpartgroup group-gun-dark2-black-hole-glow + :id 117 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 396 :flags (sp6)) (sp-item 397 :flags (sp6))) + ) + +(defpart 396 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +(defpart 397 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 100.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-gravity-gun-rise + :id 118 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 398 :flags (sp7)) (sp-item 399 :flags (sp7))) + ) + +(defpartgroup group-gravity-gun-rise-no-flare + :id 119 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 398 :flags (sp7))) + ) + +(defpart 398 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -0.3)) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 200.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:scalevel-y (meters -0.00006666667)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 399 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.06) + (:scale-x (meters 0)) + (:rot-x (degrees 45)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 100.0 50.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:next-time (seconds 0.5) (seconds 0.497)) + (:next-launcher 400) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 400 + :init-specs ((:scalevel-x (meters -0.0033333334) (meters -0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-gravity-gun-muzzle + :id 120 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 401 :period (seconds 5) :length (seconds 0.017)) + (sp-item 402 :period (seconds 5) :length (seconds 0.017)) + ) + ) + +(defpart 401 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y (meters 0.4)) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 402 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 15)) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-gun-dark-1-upgrade-shot + :id 121 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 403 :flags (sp7)) (sp-item 404 :flags (sp7)) (sp-item 405 :flags (sp3 sp7))) + ) + +(defpart 403 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 3) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 404 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 2.0) + (:scale-x (meters 5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 1)) + (:r 16.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.016666668)) + (:scalevel-x (meters -0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters -0.0016666667)) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017)) + (:next-launcher 406) + (:conerot-x (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 406 + :init-specs ((:a 255.0) (:fade-a -1.28)) + ) + +(defpart 405 + :init-specs ((:num 1.0) + (:rot-x 8) + (:r 16384.0) + (:g 1024.0) + (:b 4096.0) + (:timer (seconds 1.335)) + (:flags (distort)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +(defun spt-func-part-gun-dark-1-upgrade-shot-edges ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-track-root arg0 arg1 arg2) + (sparticle-2d-spline-align-instant arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (none) + ) diff --git a/goal_src/jak3/engine/target/gun/gun-red-shot.gc b/goal_src/jak3/engine/target/gun/gun-red-shot.gc index 962c1b30d8..db30608193 100644 --- a/goal_src/jak3/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-red-shot.gc @@ -2533,7 +2533,7 @@ ) (add-debug-vector #t - (bucket-id bucket583) + (bucket-id debug) (-> self start-pos) (-> self start-dir) (meters 6) diff --git a/goal_src/jak3/engine/target/gun/gun-states.gc b/goal_src/jak3/engine/target/gun/gun-states.gc index 11eeea1608..8556b70c51 100644 --- a/goal_src/jak3/engine/target/gun/gun-states.gc +++ b/goal_src/jak3/engine/target/gun/gun-states.gc @@ -7,3 +7,476 @@ ;; DECOMP BEGINS +(defstate target-gun-stance (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun) + (let ((gp-0 (-> block param 0)) + (v0-0 (target-standard-event-handler proc argc message block)) + ) + (when v0-0 + (cond + ((= gp-0 26) + (if (logtest? (game-secrets gun-upgrade-red-1) (-> *game-info* secrets)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-fast-ja)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-ja)) + ) + ) + ((= gp-0 28) + (if (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-fast-ja)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-ja)) + ) + ) + ((= gp-0 27) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-2-ja)) + ) + ((or (= gp-0 35) (= gp-0 27) (= gp-0 36) (= gp-0 37)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-dark-fire-ja)) + ) + ((or (= gp-0 29) (= gp-0 30)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-yellow-fire-low-ja)) + ) + ((= gp-0 31) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-yellow-fire-3-ja)) + ) + ((or (= gp-0 32) (= gp-0 34)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-blue-fire-single-ja)) + ) + ((= gp-0 33) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-blue-fire-2-ja)) + ) + ) + ) + v0-0 + ) + ) + (('wade) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control mod-surface) *gun-walk-mods*) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self control bend-target) 0.0) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (target-state-hook-exit) + (target-gun-exit) + ) + :trans (behavior () + ((-> self state-hook)) + (when (= (-> self control ground-pat material) (pat-material ice)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-ice-stance) + ) + (when (or (move-legs?) (< 8192.0 (fabs (-> self gun gun-roty-rel)))) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-gun-walk) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-duck-stance #f) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-feature lightjak-regen) (-> self game features)) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code (behavior () + (local-vars (v1-344 object)) + (let ((gp-0 (-> self skel top-anim frame-targ))) + (cond + ((or (= gp-0 jakb-gun-red-takeout-ja) + (= gp-0 jakb-gun-yellow-takeout-ja) + (= gp-0 jakb-gun-blue-takeout-ja) + (= gp-0 jakb-gun-dark-takeout-ja) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((or (= gp-0 jakb-gun-red-fire-2-ja) (= gp-0 jakb-gun-dark-fire-ja) (= gp-0 jakb-gun-blue-fire-2-ja)) + (set! (-> self control unknown-word04) (the-as uint gp-0)) + ) + ) + ) + (let ((s5-0 (-> self game gun-type))) + (b! #t cfg-143 :delay (nop!)) + (label cfg-19) + (let* ((v1-47 (gun->eco (-> self gun gun-type))) + (gp-1 (cond + ((= v1-47 (pickup-type eco-blue)) + jakb-gun-stance-blue-ja + ) + ((= v1-47 (pickup-type eco-yellow)) + jakb-gun-stance-yellow-ja + ) + ((= v1-47 (pickup-type eco-dark)) + jakb-gun-stance-dark-ja + ) + (else + jakb-gun-stance-ja + ) + ) + ) + ) + (cond + ((and (ja-group? gp-1) (= s5-0 (-> self gun gun-type))) + ) + ((let ((v1-67 (ja-group))) + (and (and v1-67 (or (= v1-67 jakb-gun-stance-ja) (= v1-67 jakb-gun-stance-dark-ja))) + (or (= gp-1 jakb-gun-stance-ja) (= gp-1 jakb-gun-stance-dark-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-transformation-twirl-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((let ((v1-106 (ja-group))) + (and (and v1-106 (or (= v1-106 jakb-gun-stance-ja) (= v1-106 jakb-gun-stance-dark-ja))) + (or (= gp-1 jakb-gun-stance-yellow-ja) (= gp-1 jakb-gun-stance-blue-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-front-to-side-hop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((let ((v1-146 (ja-group))) + (and (and v1-146 (or (= v1-146 jakb-gun-stance-yellow-ja) (= v1-146 jakb-gun-stance-blue-ja))) + (or (= gp-1 jakb-gun-stance-ja) (= gp-1 jakb-gun-stance-dark-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-side-to-front-hop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((let ((v1-186 (ja-group))) + (and (and v1-186 (or (= v1-186 jakb-gun-stance-yellow-ja) (= v1-186 jakb-gun-stance-blue-ja))) + (or (= gp-1 jakb-gun-stance-blue-ja) (= gp-1 jakb-gun-stance-yellow-ja)) + (!= (gun->eco s5-0) (gun->eco (-> self gun gun-type))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-blue-to-yellow-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((and (!= s5-0 (-> self gun gun-type)) (= (gun->eco s5-0) (gun->eco (-> self gun gun-type)))) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((= (-> self skel top-anim frame-targ) jakb-gun-side-to-side-hop-1-ja) + (ja-no-eval :group! jakb-gun-side-to-side-hop-1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (-> self skel top-anim frame-targ) jakb-gun-side-to-side-hop-2-ja) + (ja-no-eval :group! jakb-gun-side-to-side-hop-2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (gun->eco s5-0) (pickup-type eco-yellow)) + ) + (else + (ja-no-eval :group! jakb-gun-transformation-twirl-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ) + ) + (set! s5-0 (-> self gun gun-type)) + (suspend) + (ja :num! (loop!)) + (when (can-play-stance-amibent?) + (set-time! (-> self ambient-time)) + (target-gun-end-mode #t) + ) + (cond + ((not (-> self control unknown-spool-anim00)) + ) + (else + (b! + (not (or (= (-> self control unknown-spool-anim00) jakb-gun-dark-fire-ja) + (= (-> self control unknown-spool-anim00) jakb-gun-red-fire-2-ja) + (= (-> self control unknown-spool-anim00) jakb-gun-blue-fire-2-ja) + ) + ) + cfg-140 + :delay (nop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self control unknown-spool-anim00)) + (suspend) + (b! #t cfg-131 :delay (nop!)) + (label cfg-130) + (suspend) + (label cfg-131) + (let ((v1-343 (get-channel (-> self skel top-anim) 0))) + (b! (not v1-343) cfg-138 :likely-delay (set! v1-344 v1-343)) + (let ((a1-37 (= (-> v1-343 frame-group) (-> self control unknown-spool-anim00)))) + (b! (not a1-37) cfg-138 :likely-delay (set! v1-344 a1-37)) + ) + (let ((a0-110 (-> self skel root-channel 0))) + (set! (-> a0-110 num-func) num-func-identity) + (let ((f0-57 (-> v1-343 frame-num))) + (set! (-> a0-110 frame-num) f0-57) + (let ((v1-345 f0-57)) + (b! (not (the int v1-345)) cfg-138 :likely-delay (set! v1-344 v1-345)) + ) + ) + ) + ) + (set! v1-344 (= s5-0 (-> self game gun-type))) + (label cfg-138) + (b! v1-344 cfg-130 :delay (nop!)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (b! #t cfg-143 :delay (nop!)) + (label cfg-140) + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self control unknown-spool-anim00) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (label cfg-143) + (b! (using-gun? self) cfg-19 :delay (nop!)) + (let ((gp-2 (-> self skel top-anim frame-targ))) + (cond + ((or (= gp-2 jakb-gun-red-takeout-ja) (= gp-2 jakb-gun-yellow-takeout-ja) (= gp-2 jakb-gun-dark-takeout-ja)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-2 :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ((= gp-2 jakb-gun-blue-takeout-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-2 :num! (seek! 0.0) :frame-num (ja-aframe -34.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + (go target-stance) + ) + :post target-gun-post + ) + +(defstate target-gun-walk (target) + :event target-standard-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *gun-walk-mods*) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow) (pickup-type eco-blue)) + (set! (-> self control unknown-word04) (the-as uint 0)) + 0 + ) + (else + (set! (-> self control unknown-word04) (the-as uint 1)) + ) + ) + ) + :exit (behavior () + (target-effect-exit) + (target-state-hook-exit) + (target-gun-exit) + ) + :trans (behavior () + (cond + ((zero? (-> self control unknown-spool-anim00)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + (remove-exit) + (go target-gun-walk) + ) + ) + ) + (else + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow) (pickup-type eco-blue)) + (remove-exit) + (go target-gun-walk) + ) + ) + ) + ) + ((-> self state-hook)) + (if (not (using-gun? self)) + (go target-walk) + ) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-walk) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (target-effect-exit) + (remove-exit) + (go target-ice-walk) + ) + (when (not (or (move-legs?) (< 182.04445 (fabs (-> self gun gun-roty-rel))))) + (target-effect-exit) + (remove-exit) + (go target-gun-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons l1) + ) + (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (can-roll?)) + ) + (go target-roll) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (target-effect-exit) + (remove-exit) + (go target-duck-walk #f) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (wall-hide?) + (go target-hide) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code (behavior () + (target-walk-anim -300) + ) + :post target-gun-post + ) diff --git a/goal_src/jak3/engine/target/logic-target.gc b/goal_src/jak3/engine/target/logic-target.gc index 2b22f084e3..f88f12766e 100644 --- a/goal_src/jak3/engine/target/logic-target.gc +++ b/goal_src/jak3/engine/target/logic-target.gc @@ -2195,7 +2195,7 @@ (send-event self 'end-mode 'edge-grab) ) (if *display-edge-collision-marks* - ((method-of-type edge-grab-info edge-grab-info-method-10)) + (edge-grab-info-method-10 s5-0) ) (set! (-> self control ground-pat) (-> s5-0 edge-tri-pat)) (vector-normalize! @@ -2349,7 +2349,7 @@ (send-event self 'end-mode 'edge-grab) ) (if *display-edge-collision-marks* - ((method-of-type edge-grab-info edge-grab-info-method-10)) + (edge-grab-info-method-10 gp-0) ) (vector-normalize! (vector-! @@ -2412,7 +2412,7 @@ ) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> self control midpoint-of-hands) (meters 0.2) (the-as rgba (new 'static 'rgba :r #xff :a #x80)) @@ -2651,6 +2651,7 @@ (none) ) +;; WARN: disable def twice: 76. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defbehavior do-target-gspot target () (cond ((and (logtest? (-> self control status) (collide-status on-surface)) @@ -2676,15 +2677,13 @@ (a3-0 8192.0) (t0-0 81920.0) (t1-0 1024.0) + (t2-1 (if (nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) + (the-as process #f) + ) + ) ) - (cond - ((nonzero? (-> self pilot)) - (handle->process (-> self pilot vehicle)) - ) - (else - ) - ) - (if (t9-0 a0-15 a1-0 (the-as collide-spec a2-1) a3-0 t0-0 t1-0) + (if (t9-0 a0-15 a1-0 (the-as collide-spec a2-1) a3-0 t0-0 t1-0 t2-1) (set! (-> self control gspot-pat-surfce) (-> gp-0 best-other-tri pat)) ) ) @@ -3232,7 +3231,7 @@ (if (and *debug-segment* (!= (-> this tobot?) 'tobot)) (add-connection *debug-engine* this target-print-stats this *stdcon0* #f) ) - (activate-hud this) + ;; (activate-hud this) (set! (-> this fp-hud) (the-as handle #f)) (set! (-> this burn-proc) (the-as handle #f)) (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) diff --git a/goal_src/jak3/engine/target/sidekick.gc b/goal_src/jak3/engine/target/sidekick.gc index c0a5505c42..7383b39b70 100644 --- a/goal_src/jak3/engine/target/sidekick.gc +++ b/goal_src/jak3/engine/target/sidekick.gc @@ -537,17 +537,17 @@ ) ) ) - (let ((a0-84 (-> self skel effect))) - (if a0-84 - (effect-control-method-9 a0-84) - ) - ) - (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) - (merc-blend-shape self) - ) - (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) - (merc-eye-anim self) - ) + ;; (let ((a0-84 (-> self skel effect))) + ;; (if a0-84 + ;; (effect-control-method-9 a0-84) + ;; ) + ;; ) + ;; (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid)) + ;; (merc-blend-shape self) + ;; ) + ;; (if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim)) + ;; (merc-eye-anim self) + ;; ) (when (!= (not (-> *setting-control* user-current mirror)) (not (-> self mirror))) (cond ((-> self mirror) diff --git a/goal_src/jak3/engine/target/target-darkjak.gc b/goal_src/jak3/engine/target/target-darkjak.gc index 38b1bb9270..4ddd4aae8d 100644 --- a/goal_src/jak3/engine/target/target-darkjak.gc +++ b/goal_src/jak3/engine/target/target-darkjak.gc @@ -5,5 +5,2489 @@ ;; name in dgo: target-darkjak ;; dgos: GAME +(define-extern *darkjak-ball-lightning* lightning-appearance) + ;; DECOMP BEGINS +(deftype darkjak-ball (projectile) + ((impact? symbol) + (fire-point vector :inline) + (explode-sound uint32) + (bolts (array lightning-bolt)) + (ball-pos vector 2 :inline) + (trail sparticle-launch-control) + (ball1 sparticle-launch-control) + (last-ground-height float) + (fire-sound sound-id) + ) + (:methods + (setup-bolts! (_type_ vector vector) none) + ) + ) + + +(defmethod relocate ((this darkjak-ball) (offset int)) + (dotimes (v1-0 (-> this bolts length)) + (if (nonzero? (-> this bolts v1-0)) + (&+! (-> this bolts v1-0) offset) + ) + ) + (if (nonzero? (-> this bolts)) + (&+! (-> this bolts) offset) + ) + (if (nonzero? (-> this trail)) + (&+! (-> this trail) offset) + ) + (if (nonzero? (-> this ball1)) + (&+! (-> this ball1) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this darkjak-ball)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this fire-sound)) + (if (nonzero? (-> this trail)) + (kill-particles (-> this trail)) + ) + (if (nonzero? (-> this ball1)) + (kill-particles (-> this ball1)) + ) + (call-parent-method this) + (none) + ) + +(defun darkjak-ball-slide-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg3 1.0))) + 0.0 + (if (< (vector-dot a0-3 (-> arg0 surface-normal)) -0.3) + (set! (-> (the-as darkjak-ball (-> arg0 process)) impact?) #t) + ) + ) + (let ((f0-4 (vector-dot arg3 (-> arg0 surface-normal))) + (s3-0 (new 'stack-no-clear 'vector)) + (f30-0 (vector-length arg3)) + ) + (vector-float*! s3-0 (-> arg0 surface-normal) (* 1.2 f0-4)) + (vector-! s3-0 arg3 s3-0) + (vector-normalize! s3-0 1.0) + (set! (-> s3-0 y) (fmin 0.4 (-> s3-0 y))) + (set-vector! arg2 (-> arg3 x) (-> s3-0 y) (-> arg3 z) 1.0) + (vector-normalize! arg2 f30-0) + ) + (-> arg0 status) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod deal-damage! ((this darkjak-ball) (arg0 process) (arg1 event-message-block)) + (local-vars (sv-288 process) (sv-304 vector)) + (let ((s4-0 (new 'stack 'attack-info))) + (let ((v1-1 s4-0)) + (set! (-> v1-1 mode) (-> this attack-mode)) + (set! (-> v1-1 id) (-> this attack-id)) + (set! (-> v1-1 mask) (attack-mask mode id)) + (set! (-> v1-1 penetrate-using) (penetrate dark-smack)) + ) + (when (!= (-> this owner-handle) #f) + (set! (-> s4-0 attacker) (-> this owner-handle)) + (logior! (-> s4-0 mask) (attack-mask attacker)) + ) + (when (logtest? (-> this options) (projectile-options po13)) + (set! (-> s4-0 attacker-velocity quad) (-> this pre-move-transv quad)) + (logior! (-> s4-0 mask) (attack-mask attacker-velocity)) + ) + (set! (-> s4-0 damage) (-> this damage)) + (set! (-> s4-0 vehicle-damage-factor) (-> this vehicle-damage-factor)) + (set! (-> s4-0 vehicle-impulse-factor) (-> this vehicle-impulse-factor)) + (logior! (-> s4-0 mask) (attack-mask damage vehicle-damage-factor vehicle-impulse-factor)) + (when (logtest? (projectile-options po18) (-> this options)) + (set! (-> s4-0 invinc-time) (-> this invinc-time)) + (logior! (-> s4-0 mask) (attack-mask invinc-time)) + ) + (when arg1 + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry arg1) + (-> this root) + (the-as uint -1) + ) + ) + ) + (set! sv-288 arg0) + (let ((s0-0 (if (type? sv-288 process-focusable) + sv-288 + ) + ) + ) + (when s0-0 + (set! sv-304 s2-0) + (let ((v1-27 (-> (get-trans (the-as process-focusable s0-0) 3) quad))) + (set! (-> sv-304 quad) v1-27) + ) + (when (not (focus-test? (the-as process-focusable s0-0) hit)) + (if s1-0 + (get-intersect-point s2-0 s1-0 (-> this root) (the-as touching-shapes-entry arg1)) + ) + (cond + ((logtest? (-> *part-group-id-table* 77 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 77)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 77)) + ) + ) + (sound-play "djak-strike-ko") + ) + ) + ) + ) + ) + (the-as symbol (send-event + arg0 + (if (logtest? (projectile-options po19) (-> this options)) + 'attack-invinc + 'attack + ) + arg1 + s4-0 + ) + ) + ) + ) + +(defmethod setup-collision! ((this darkjak-ball)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) darkjak-ball-slide-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate dark-smack)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defun darkjak-ball-move ((arg0 darkjak-ball)) + (projectile-move-fill-line-sphere arg0) + (sound-play "hadouken-loop" :id (-> arg0 fire-sound) :position (-> arg0 root trans)) + (seek! (-> arg0 root transv y) 0.0 (* 81920.0 (seconds-per-frame))) + (seek! (-> arg0 root root-prim local-sphere w) 24576.0 (* 24576.0 (seconds-per-frame))) + (let ((v1-16 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 0)) + (a0-10 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 1)) + ) + (set! (-> v1-16 local-sphere w) (* 0.1 (-> arg0 root root-prim local-sphere w))) + (set! (-> a0-10 local-sphere w) (-> arg0 root root-prim local-sphere w)) + ) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (v1-20 (new 'stack-no-clear 'vector)) + (f30-0 (* 0.5 (-> arg0 root root-prim local-sphere w))) + ) + (set! (-> v1-20 quad) (-> arg0 root trans quad)) + (vector+float*! (-> s5-0 start-pos) v1-20 *up-vector* 0.0) + (set! (-> s5-0 move-dist quad) (the-as uint128 0)) + (set! (-> s5-0 move-dist y) (- f30-0)) + (let ((v1-22 s5-0)) + (set! (-> v1-22 radius) f30-0) + (set! (-> v1-22 collide-with) (collide-spec backgnd)) + (set! (-> v1-22 ignore-process0) #f) + (set! (-> v1-22 ignore-process1) #f) + (set! (-> v1-22 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-22 action-mask) (collide-action solid)) + ) + (when (!= (fill-and-probe-using-line-sphere *collide-cache* s5-0) -100000000.0) + (set! (-> arg0 last-ground-height) (-> s5-0 best-other-tri intersect y)) + (let ((f0-18 (- (+ (-> s5-0 best-other-tri intersect y) f30-0) (-> arg0 root trans y)))) + (if (< 0.0 f0-18) + (seek! (-> arg0 root trans y) (+ (-> s5-0 best-other-tri intersect y) f30-0) (* 40960.0 (seconds-per-frame))) + ) + ) + ) + ) + (if (and (< (fabs (- (-> arg0 root trans y) (-> arg0 fire-point y))) 6144.0) + (< 16384.0 (vector-length (-> arg0 root transv))) + ) + (set! (-> arg0 impact?) #f) + ) + (if (-> arg0 impact?) + (go (method-of-object arg0 impact)) + ) + (sound-play "djak-bolt-throw" :id (-> arg0 sound-id) :position (-> arg0 root trans)) + 0 + (none) + ) + +;; WARN: Return type mismatch smush-control vs none. +(defmethod projectile-method-26 ((this darkjak-ball)) + (sound-play "djak-strike-hit") + (cond + ((logtest? (-> *part-group-id-table* 76 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 76)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 76)) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (none) + ) + +(defstate impact (darkjak-ball) + :virtual #t + :enter (behavior () + (sound-stop (-> self fire-sound)) + (dotimes (gp-0 (-> self bolts length)) + (lightning-bolt-method-13 (-> self bolts gp-0) 2) + ) + (when (nonzero? (-> self ball1)) + (kill-particles (-> self ball1)) + (set! (-> self ball1) (the-as sparticle-launch-control 0)) + 0 + ) + (when (nonzero? (-> self part)) + (kill-particles (-> self part)) + (set! (-> self part) (the-as sparticle-launch-control 0)) + 0 + ) + (let ((t9-5 (-> (find-parent-state) enter))) + (if t9-5 + (t9-5) + ) + ) + ) + :trans (behavior () + (dotimes (gp-0 (-> self bolts length)) + (lightning-bolt-method-11 (-> self bolts gp-0)) + (lightning-bolt-method-12 (-> self bolts gp-0)) + ) + ) + :code (behavior () + (set-time! (-> self state-time)) + (while (and (not (time-elapsed? (-> self state-time) (seconds 10))) (-> self child)) + (suspend) + ) + (go-virtual die) + ) + ) + +(if (or (zero? *darkjak-ball-lightning*) (!= loading-level global)) + (set! *darkjak-ball-lightning* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *darkjak-ball-lightning* base-alpha) 1.0) + +(set! (-> *darkjak-ball-lightning* tex-id) (the-as uint #x403f00)) + +(set! (-> *darkjak-ball-lightning* blend-mode) (the-as uint 1)) + +(set! (-> *darkjak-ball-lightning* alpha-1-curve) *curve-linear-down*) + +(set! (-> *darkjak-ball-lightning* alpha-1-mode) (the-as uint 0)) + +(set! (-> *darkjak-ball-lightning* alpha-1-repeat-dist) 262144.0) + +(set! (-> *darkjak-ball-lightning* alpha-2-curve) #f) + +(set! (-> *darkjak-ball-lightning* alpha-2-mode) (the-as uint 3)) + +(set! (-> *darkjak-ball-lightning* alpha-2-repeat-dist) 4096.0) + +(set! (-> *darkjak-ball-lightning* width-curve) *curve-linear-down*) + +(set! (-> *darkjak-ball-lightning* width-mode) (the-as uint 3)) + +(set! (-> *darkjak-ball-lightning* width-repeat-dist) 4096.0) + +(set! (-> *darkjak-ball-lightning* uv-repeat-dist) 28672.0) + +(set! (-> *darkjak-ball-lightning* regenerate-time-start) (seconds 0.017)) + +(set! (-> *darkjak-ball-lightning* regenerate-time-end) (seconds 0.05)) + +(set! (-> *darkjak-ball-lightning* width-range-start) 12288.0) + +(set! (-> *darkjak-ball-lightning* width-range-end) 12288.0) + +(set! (-> *darkjak-ball-lightning* fade-time) (seconds 0.3)) + +(set! (-> *darkjak-ball-lightning* uv-shift?) #t) + +(set! (-> *darkjak-ball-lightning* uv-shift-speed) (seconds -0.5)) + +(set! (-> *darkjak-ball-lightning* use-sprite-bucket?) #t) + +(set! (-> *darkjak-ball-lightning* use-accurate-interp?) #t) + +(defpartgroup group-darkjak-hadouken + :id 172 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 624 :flags (sp7) :period (seconds 20) :length (seconds 4)) + (sp-item 625 :flags (sp7) :period (seconds 20) :length (seconds 4)) + (sp-item 626 :flags (sp7) :period (seconds 20) :length (seconds 4)) + (sp-item 627 :flags (sp3 sp7)) + ) + ) + +(defpartgroup group-darkjak-hadouken-trail + :id 173 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 628 :flags (sp7))) + ) + +(defpart 628 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-x (meters -0.0016666667) 2.0 (meters 0.0033333334)) + (:scalevel-y (meters -0.001) (meters -0.006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defmethod init-proj-settings! ((this darkjak-ball)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) + (set! (-> this attack-mode) 'dark-smack) + (set! (-> this max-speed) 163840.0) + (set! (-> this move) darkjak-ball-move) + (set! (-> this timeout) (seconds 4)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this explode-sound) (the-as uint (new-sound-id))) + (set! (-> this damage) 8.0) + (set! (-> this vehicle-damage-factor) 2.0) + (set! (-> this vehicle-impulse-factor) 3.0) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 172) this)) + (set! (-> this ball1) (create-launch-control (-> *part-group-id-table* 172) this)) + (set! (-> this trail) (create-launch-control (-> *part-group-id-table* 173) this)) + (set! (-> this impact?) #f) + (set! (-> this max-hits) 1000) + (set! (-> this fire-point quad) (-> this root trans quad)) + (set! (-> this bolts) (new 'process 'boxed-array lightning-bolt 3)) + (dotimes (s5-0 (-> this bolts length)) + (set! (-> this bolts s5-0) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> this bolts s5-0) 2 16 *darkjak-ball-lightning*) + ) + (set! (-> this fire-sound) (new-sound-id)) + (let ((a0-13 (-> this root transv))) + (set! (-> a0-13 quad) (-> this root transv quad)) + (set! (-> a0-13 y) 0.0) + (vector-normalize! a0-13 1.0) + ) + (vector-float*! (-> this root transv) (-> this root transv) 245760.0) + 0 + (none) + ) + +(define *darkjak-ball-lightning-colors* (new 'static 'boxed-array :type rgba + (new 'static 'rgba :r #xff :g #x20 :b #x80 :a #x80) + (new 'static 'rgba :r #x20 :g #x20 :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod setup-bolts! ((this darkjak-ball) (arg0 vector) (arg1 vector)) + (dotimes (s3-0 (-> this bolts length)) + (let ((s2-0 (-> this bolts s3-0))) + (set! (-> s2-0 base-color) (-> *darkjak-ball-lightning-colors* s3-0)) + (set! (-> s2-0 inner-point-travel-time) (seconds 0.085)) + (set! (-> s2-0 snap-inner-points?) #t) + (set! (-> s2-0 fractal-reduction) 0.7) + (set! (-> s2-0 generate-mode) (the-as uint 1)) + (set! (-> s2-0 appearance) *darkjak-ball-lightning*) + (set! (-> s2-0 num-active-spans) 2) + (set! (-> s2-0 spans data 0 random-offset-size-start) 2048.0) + (set! (-> s2-0 spans data 1 random-offset-size-start) 2048.0) + (set! (-> s2-0 spans-internal data 0 num-inner-points) 14) + (set! (-> s2-0 spans data 0 inner-random-offset-size) 8192.0) + (set! (-> s2-0 spans data 1 inner-random-offset-size) 8192.0) + (if arg0 + (set! (-> s2-0 span-pts-start data 0 quad) (-> arg0 quad)) + ) + (if arg1 + (set! (-> s2-0 span-pts-start data 1 quad) (-> arg1 quad)) + ) + (set! (-> s2-0 spans-internal data 1 num-inner-points) 0) + (lightning-bolt-method-11 s2-0) + (lightning-bolt-method-12 s2-0) + ) + ) + (none) + ) + +(defun sparticle-track-hadouken ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((a3-0 (the-as darkjak-ball (-> arg1 key proc))) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-1 quad) + (-> (the-as (pointer uint128) (+ (+ (* (-> arg1 user-float) 16) 556) (the-as int a3-0)))) + ) + (set! (-> arg2 x) (-> v1-1 x)) + (set! (-> arg2 y) (-> v1-1 y)) + (set! (-> arg2 z) (-> v1-1 z)) + ) + 0 + (none) + ) + +(defpart 624 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 625 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.1) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -5.12) + (:fade-g -10.2) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 626 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 4.0) + (:scale-x (meters 4)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 16.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.016666668)) + (:scalevel-x (meters -0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters -0.0033333334)) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:next-time (seconds 0.017)) + (:next-launcher 629) + (:conerot-x (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 629 + :init-specs ((:a 255.0) (:fade-a -5.12)) + ) + +(defpart 627 + :init-specs ((:num 1.0) + (:rot-x 8) + (:r 32768.0) + (:g 2048.0) + (:b 8192.0) + (:timer (seconds 4)) + (:flags (distort)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:rotate-y (degrees 0)) + ) + ) + +(defmethod projectile-method-25 ((this darkjak-ball)) + (let* ((f0-0 0.75) + (f1-0 65536.0) + (f2-1 (* 0.0033333334 (the float (current-time)))) + (f0-2 (* f1-0 (/ (- f2-1 (* (the float (the int (/ f2-1 f0-0))) f0-0)) f0-0))) + (s3-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *x-vector* f0-2)) + (s5-0 (-> this ball-pos)) + (s4-0 (-> this ball-pos 1)) + ) + (vector-float*! s3-0 s3-0 (* 0.75 (-> this root root-prim local-sphere w))) + (vector+! (the-as vector s5-0) (-> this root trans) s3-0) + (set! (-> *part-id-table* 625 init-specs 16 initial-valuef) 0.0) + (set! (-> *part-id-table* 626 init-specs 16 initial-valuef) 0.0) + (set! (-> *part-id-table* 627 init-specs 7 initial-valuef) 0.0) + (set! (-> *part-id-table* 624 init-specs 11 initial-valuef) 0.0) + (spawn (-> this part) (the-as vector s5-0)) + (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) + (set! (-> *part-id-table* 625 init-specs 16 initial-valuef) (the-as float #x1)) + (set! (-> *part-id-table* 626 init-specs 16 initial-valuef) (the-as float #x1)) + (set! (-> *part-id-table* 627 init-specs 7 initial-valuef) (the-as float #x1)) + (set! (-> *part-id-table* 624 init-specs 11 initial-valuef) (the-as float #x1)) + (spawn (-> this ball1) s4-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> this root trans quad)) + (let ((s2-0 matrix-f-u-compose) + (s1-0 (new 'stack-no-clear 'matrix)) + (a0-21 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-21 quad) (-> this root transv quad)) + (set! (-> a0-21 y) 0.0) + (let ((a1-10 (s2-0 s1-0 (vector-normalize! a0-21 1.0) *up-vector*))) + (set! (-> s3-1 y) (-> this last-ground-height)) + (+! (-> s3-1 y) 1638.4) + (set! (-> a1-10 trans quad) (-> s3-1 quad)) + (spawn-from-mat (-> this trail) a1-10) + ) + ) + ) + (setup-bolts! this (the-as vector s5-0) s4-0) + ) + (none) + ) + +(defbehavior target-darkjak-setup target ((arg0 symbol)) + (when (zero? (-> self darkjak)) + (set! (-> self darkjak) (new 'process 'darkjak-info)) + (set! (-> self darkjak process) (the-as (pointer target) (process->ppointer self))) + (let* ((v1-4 (-> self game)) + (a0-5 (+ (-> v1-4 attack-id) 1)) + ) + (set! (-> v1-4 attack-id) a0-5) + (set! (-> self darkjak attack-id) a0-5) + ) + (set! (-> self darkjak hud 0) (the-as handle #f)) + (set! (-> self darkjak charge-effect) (the-as handle #f)) + (set! (-> self darkjak tone) (new-sound-id)) + (set! (-> self darkjak-giant-interp) 1.0) + (set! (-> self darkjak mode-sound-bank) #f) + (set! (-> self darkjak latch-out-time) 0) + 0 + ) + 0 + (none) + ) + +(defbehavior want-to-darkjak? target () + (and (not *pause-lock*) + (-> *setting-control* user-current darkjak) + (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + light + board + pilot + mech + carry + indax + teleporting + ) + ) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (and (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (and (time-elapsed? (-> self fact darkjak-start-time) (seconds 0.05)) (< 0.0 (-> self game eco-pill-dark))) + ) + (zero? (-> self darkjak latch-out-time)) + ) + ) + ) + +(let ((v1-56 (copy *walk-mods* 'global))) + (set! (-> v1-56 name) 'darkjak) + (set! (-> v1-56 flags) (surface-flag gun-off)) + (set! *darkjak-trans-mods* v1-56) + ) + +(defbehavior target-darkjak-end-mode target ((arg0 symbol)) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (cond + (arg0 + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self darkjak lightning-count) 0) + (logclear! (-> self focus-status) (focus-status dark)) + (send-event self 'reset-collide) + (logclear! (-> self target-flags) (target-flags tf4)) + (remove-setting! 'sound-flava) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (setting-control-method-14 *setting-control* (-> self darkjak mode-sound-bank)) + (set! (-> self darkjak mode-sound-bank) #f) + (sound-stop (-> self darkjak tone)) + (set! (-> self pending-ext-anim) (target-anim default)) + (if (< (-> self game eco-pill-dark) 1.0) + (send-event self 'get-pickup (pickup-type eco-pill-dark) -1.0) + ) + (target-invisible-stop) + (let ((v1-45 (ja-group))) + (when (not (and (and v1-45 + (or (= v1-45 jakb-darkjak-get-off-ja) + (= v1-45 jakb-darkjak-get-off-end-ja) + (= v1-45 jakb-darkjak-get-on-fast-ja) + (= v1-45 (-> self draw art-group data 461)) + ) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (sound-play "djak-off") + (countdown (v1-57 (+ (-> self skel active-channels) (-> self skel float-channels))) + (let ((a0-36 (-> self skel channel v1-57))) + (cond + ((= (-> a0-36 frame-group) (-> self draw art-group data 442)) + (set! (-> a0-36 frame-group) (the-as art-joint-anim jakb-walk-ja)) + ) + ((= (-> a0-36 frame-group) (-> self draw art-group data 443)) + (set! (-> a0-36 frame-group) (the-as art-joint-anim jakb-run-ja)) + ) + ) + ) + ) + (joint-control-cleanup + (-> self skel) + (-> self ext-anim-control heap) + (the-as art-joint-anim jakb-stance-loop-ja) + ) + (send-event (ppointer->process (-> self sidekick)) 'cleanup) + ) + ) + (set! (-> self darkjak latch-out-time) 0) + 0 + ) + ((zero? (-> self darkjak latch-out-time)) + (if (!= (-> self darkjak-interp) 0.0) + (set-time! (-> self darkjak latch-out-time)) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-darkjak-process target () + (local-vars (a3-3 vector)) + (cond + ((nonzero? (-> self darkjak latch-out-time)) + (if (time-elapsed? (-> self darkjak latch-out-time) (seconds 0.4)) + (target-darkjak-end-mode #t) + ) + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (let ((a1-0 'eco-red)) + (target-danger-set! (-> self control danger-mode) a1-0) + ) + (update-transforms (-> self control)) + (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-1 options) (overlaps-others-options)) + (set! (-> a1-1 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-1 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-1) + ) + (target-danger-set! (-> self control danger-mode) #f) + (update-transforms (-> self control)) + (if (and (or (< (-> self game eco-pill-dark) 1.0) + (or (not (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + (not (-> *setting-control* user-current darkjak)) + ) + ) + (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (let ((v1-37 (-> self next-state name))) + (or (= v1-37 'target-darkjak-get-on) (= v1-37 'target-darkjak-get-off)) + ) + ) + ) + (or (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (not (-> *setting-control* user-current darkjak)) + (not (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + ) + ) + (go target-darkjak-get-off) + ) + ) + (else + (seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame))) + (if (= (-> self darkjak-interp) 0.0) + (set! (-> self darkjak-giant-interp) 1.0) + ) + ) + ) + (seekl! (-> self darkjak lightning-count) 0 1) + (let ((f30-0 (-> self darkjak-interp))) + (let ((f28-0 (lerp-scale 1.0 (* 1.05 (-> self darkjak-giant-interp)) f30-0 0.0 1.0)) + (f26-0 (lerp-scale 1.0 (* 0.20000002 (+ 5.0 (-> self darkjak-giant-interp))) f30-0 0.0 1.0)) + ) + (set-vector! (-> self control scale) f28-0 f28-0 f28-0 1.0) + (let ((a3-2 (new 'stack-no-clear 'vector))) + (set! (-> a3-2 x) f26-0) + (set! (-> a3-2 y) 1.0) + (set! (-> a3-2 z) f26-0) + (set! (-> a3-2 w) 1.0) + (trs-set! (-> self upper-body) (the-as vector #f) (the-as quaternion #f) a3-2) + ) + (let ((f0-15 (* 1.1 f26-0))) + (cond + ((= (-> self ext-geo) (target-geo jakb)) + (set! a3-3 (new 'stack-no-clear 'vector)) + (set! (-> a3-3 x) (/ f28-0 (* f28-0 f0-15))) + (set! (-> a3-3 y) (/ f28-0 f28-0)) + (set! (-> a3-3 z) (/ f28-0 (* f28-0 f0-15))) + (set! (-> a3-3 w) 1.0) + ) + (else + (set! a3-3 (new 'stack-no-clear 'vector)) + (set! (-> a3-3 x) (* 0.95 (/ f28-0 (* f28-0 f0-15)))) + (set! (-> a3-3 y) (* 0.92 (/ f28-0 f28-0))) + (set! (-> a3-3 z) (* 0.95 (/ f28-0 (* f28-0 f0-15)))) + (set! (-> a3-3 w) 1.0) + ) + ) + ) + ) + (cond + ((logtest? (game-secrets little-head) (-> self game secrets)) + (dotimes (v1-73 3) + (set! (-> a3-3 data v1-73) (* 0.4 (-> a3-3 data v1-73))) + ) + ) + ((logtest? (game-secrets big-head) (-> self game secrets)) + (dotimes (v1-79 3) + (set! (-> a3-3 data v1-79) (* 2.0 (-> a3-3 data v1-79))) + ) + ) + ) + (trs-set! (-> self neck) (the-as vector #f) (the-as quaternion #f) a3-3) + (let* ((a0-42 (-> self horns)) + (t9-13 (method-of-object a0-42 trs-set!)) + (a1-14 #f) + (a2-6 #f) + (a3-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-4 x) f30-0) + (set! (-> a3-4 y) f30-0) + (set! (-> a3-4 z) f30-0) + (set! (-> a3-4 w) 1.0) + (t9-13 a0-42 (the-as vector a1-14) (the-as quaternion a2-6) a3-4) + ) + (when (and (>= f30-0 0.5) (and (not (focus-test? self in-head)) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) + (not (movie?)) + ) + ) + (if (= (-> self invisible-interp) 0.0) + (launch-particles + (-> *part-id-table* 173) + (process-drawable-random-point! self (new 'stack-no-clear 'vector)) + ) + ) + (cond + ((!= (-> self invisible-interp) 0.0) + ) + ((rand-vu-percent? 0.25) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.02)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (process-drawable-shock-wall-effect + self + (-> *lightning-spec-id-table* 9) + lightning-probe-callback + (-> *part-id-table* 187) + ) + ) + ) + ((rand-vu-percent? 0.1) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.02)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 7) + lightning-probe-callback + (-> *part-id-table* 187) + 0 + 0 + 40960.0 + ) + ) + ) + ) + ) + (set-darkjak-texture-morph! (if (logtest? (-> self target-effect) 64) + 1.0 + f30-0 + ) + ) + ) + 0 + (none) + ) + +(defstate target-darkjak-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('darkjak) + (when (zero? (-> self darkjak want-stage)) + (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> block param 0))) + #t + ) + ) + (('touched) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (target-generic-event-handler proc argc message block) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self darkjak-interp) 1.0) + (remove-setting! 'bg-r) + (remove-setting! 'bg-g) + (remove-setting! 'bg-b) + (remove-setting! 'bg-a) + (persist-with-delay *setting-control* 'bg-a-speed (seconds 3) 'bg-a-speed 'abs 0.5 0) + (target-danger-set! 'harmless #f) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior ((arg0 darkjak-stage)) + (send-event (handle->process (-> self notify)) 'notify 'attack 19) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-lightjak-end-mode #t) + (set! (-> self darkjak latch-out-time) 0) + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self darkjak stage) (logior arg0 (darkjak-stage bomb0))) + (if (logtest? (game-feature darkjak-bomb0) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage invinc)) + ) + (if (logtest? (game-feature darkjak-bomb1) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage giant)) + ) + (if (logtest? (game-feature feature45) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage disable-force-on)) + ) + (if (logtest? (game-feature feature44) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage no-anim)) + ) + (if (logtest? (game-feature darkjak-smack) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage bomb1)) + ) + (set! (-> self darkjak want-stage) (-> self darkjak stage)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *darkjak-trans-mods*) + (set-time! (-> self darkjak start-time)) + (set! (-> self darkjak attack-count) (the-as uint 0)) + (set! (-> self darkjak-giant-interp) 1.0) + (logior! (-> self focus-status) (focus-status dark)) + (set! (-> self pending-ext-anim) (target-anim dark)) + (set-time! (-> self fact darkjak-start-time)) + (set! (-> self fact darkjak-effect-time) (seconds 20)) + (set! (-> self darkjak mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modedark 0.0 0))) + (set! (-> self darkjak lightning-count) 0) + (cond + ((logtest? (-> self darkjak stage) (darkjak-stage ds8)) + (logclear! (-> self target-flags) (target-flags tf4)) + (logclear! (-> self darkjak stage) (darkjak-stage bomb1 invinc giant no-anim disable-force-on)) + (target-invisible-start (-> *TARGET-bank* invisible-duration)) + (set! (-> self fact darkjak-effect-time) (-> *TARGET-bank* invisible-duration)) + ) + ((logtest? (-> self darkjak stage) (darkjak-stage disable-force-on)) + (logior! (-> self target-flags) (target-flags tf4)) + ) + (else + (logclear! (-> self target-flags) (target-flags tf4)) + ) + ) + (if (logtest? arg0 (darkjak-stage ds9)) + (go target-stance) + ) + (target-start-attack) + (target-danger-set! 'get-on #f) + (set-setting! 'bg-r 'abs 0.1 0) + (set-setting! 'bg-b 'abs 0.1 0) + (set-forward-vel 0.0) + (let ((gp-1 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-1 (- (current-time) (-> self clock old-frame-counter))) + (if (>= gp-1 300) + (go target-falling #f) + ) + (suspend) + ) + ) + (sound-play "djak-transform") + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-darkjak-get-on-fast-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 0.0 1.0 (ja-aframe-num 0) 5.0 15.0)) + (set-setting! 'bg-a 'abs (* 0.45 (-> self darkjak-interp)) 0) + (suspend) + (ja :num! (seek!)) + ) + (while (!= (-> self ext-anim) (target-anim dark)) + (let ((v1-135 (ja-group))) + (when (not (and v1-135 (= v1-135 jakb-darkjak-get-on-fast-loop-ja))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-darkjak-get-on-fast-loop-ja :num! min) + ) + ) + (suspend) + (ja :num! (loop!)) + ) + (go target-stance) + ) + :post (-> target-grab post) + ) + +(defstate target-darkjak-get-off (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'lightjak 'slide 'wade 'launch 'edge-grab) + #f + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *darkjak-trans-mods*) + (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (target-darkjak-end-mode #t) + ) + :trans (-> target-darkjak-get-on trans) + :code (behavior () + (let ((v1-1 (-> self water flags))) + (cond + ((and (logtest? (water-flag touch-water) v1-1) + (logtest? (water-flag under-water swimming) v1-1) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (go target-swim-stance) + ) + ((let ((v1-10 (ja-group))) + (not (and v1-10 (= v1-10 jakb-darkjak-get-on-fast-ja))) + ) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= gp-0 300) + (go target-falling #f) + ) + (suspend) + ) + ) + ) + ) + ) + (cond + ((logtest? (-> self control status) (collide-status on-water)) + ) + (else + (let ((v1-30 (ja-group))) + (cond + ((and v1-30 (= v1-30 jakb-darkjak-get-on-fast-ja)) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame))) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + ((let ((v1-43 (ja-group))) + (and v1-43 (or (= v1-43 (-> self draw art-group data 451)) + (= v1-43 (-> self draw art-group data 466)) + (= v1-43 (-> self draw art-group data 467)) + (= v1-43 (-> self draw art-group data 468)) + ) + ) + ) + (sound-play "djak-off") + (ja-no-eval :group! (-> self draw art-group data 461) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-74 (ja-group))) + (and v1-74 (= v1-74 (-> self draw art-group data 461))) + ) + (sound-play "djak-off") + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) + (suspend) + (ja-eval) + ) + ) + (else + (sound-play "djak-off") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-darkjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (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)) + (goto cfg-79) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-darkjak-get-off-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (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)) + (goto cfg-79) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + (label cfg-79) + (vector-reset! (-> self control transv)) + ((-> target-darkjak-get-off exit)) + (go target-stance) + ) + :post (-> target-grab post) + ) + +(defstate target-darkjak-running-attack (target) + :event (-> target-running-attack event) + :enter (-> target-running-attack enter) + :exit (behavior () + (remove-setting! 'rapid-tracking) + ((-> target-running-attack exit)) + ) + :trans (-> target-running-attack trans) + :code (behavior () + (local-vars + (sv-16 float) + (sv-20 float) + (sv-24 int) + (sv-32 int) + (sv-40 int) + (sv-48 float) + (sv-56 handle) + (sv-64 int) + ) + (set-setting! 'rapid-tracking #f 0.0 0) + ((lambda :behavior target + () + (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (if (logtest? (water-flag touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (cond + ((zero? (-> self control unknown-word000)) + (set! (-> self control unknown-word000) 1) + (-> self draw art-group data 452) + ) + (else + (set! (-> self control unknown-word000) 0) + (-> self draw art-group data 459) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! gp-1 :num! (seek!)) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-punch-inc))) + ) + (let ((a0-11 (-> self control impact-ctrl)) + (t9-7 (method-of-type impact-control initialize)) + (a1-5 self) + (v1-44 (ja-group)) + ) + (t9-7 + a0-11 + a1-5 + (if (and v1-44 (= v1-44 (-> self draw art-group data 452))) + 28 + 19 + ) + 3276.8 + (-> self control root-prim prim-core collide-with) + ) + ) + ) + ) + (set! sv-16 (the-as float 0.0)) + (set! sv-20 (the-as float 1.0)) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 0) + (set! sv-48 (the-as float 1.0)) + (set! sv-56 (the-as handle #f)) + (set! sv-64 0) + (until (ja-done? 0) + (if (and (cpad-pressed? (-> self control cpad number) square) + (not (logtest? (-> self target-flags) (target-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) (darkjak-stage bomb0)) + ) + (< sv-32 2) + ) + (set! sv-40 (the-as int (current-time))) + ) + (when (time-elapsed? (the-as time-frame sv-40) (seconds 0.5)) + (set! sv-40 0) + 0 + ) + (if (and (nonzero? sv-40) + (< (- (the float (+ (-> (ja-group) frames num-frames) -1)) (/ 2.0 (-> (ja-group) artist-step))) + (ja-frame-num 0) + ) + ) + ((lambda :behavior target + ((arg0 (pointer float)) (arg1 (pointer int64)) (arg2 (pointer int64))) + (let ((s3-0 (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage no-anim)) + ) + (combo-tracker-method-13 + (-> self control unknown-combo-tracker00) + (-> self control send-attack-dest) + (-> self control trans) + 24576.0 + (-> self control c-R-w fvec) + 65536.0 + ) + ) + ) + ) + (when #t + (+! (-> arg1 0) 1) + (if s3-0 + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + (-> self control trans) + (get-trans s3-0 3) + s3-0 + (current-time) + ) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-punch-inc))) + ) + (let ((v1-34 (ja-group))) + (cond + ((and v1-34 (or (= v1-34 (-> self draw art-group data 452)) (= v1-34 (-> self draw art-group data 459)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 454) :num! (seek!)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 463) :num! (seek!)) + ) + ) + ) + (initialize (-> self control impact-ctrl) self 28 3276.8 (-> self control root-prim prim-core collide-with)) + (set! (-> arg0 0) (fmax 0.0 (-> arg0 0))) + ) + ) + (set! (-> arg2 0) 0) + 0 + ) + (& sv-16) + (the-as (pointer int64) (& sv-32)) + (the-as (pointer int64) (& sv-40)) + ) + ) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-frame-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((and (nonzero? sv-32) + (>= sv-16 -40960.0) + (let ((v1-83 (ja-group))) + (not (and (and v1-83 (= v1-83 jakb-darkjak-attack-combo3-ja)) (>= (ja-aframe-num 0) 77.0))) + ) + (send-event (handle->process (-> self control unknown-combo-tracker00 target)) 'combo) + ) + (let* ((s5-0 (handle->process (-> self control unknown-combo-tracker00 target))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (let ((s5-1 (get-trans (the-as process-focusable gp-0) 3))) + (when (and (< 2048.0 (vector-vector-distance (-> self control trans) s5-1)) + (or (and (= gp-0 (handle->process sv-56)) (not (time-elapsed? (the-as time-frame sv-64) (seconds 0.1)))) + (time-elapsed? (the-as time-frame sv-64) (seconds 1)) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) s5-1 (-> self control trans)) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (let ((v1-124 + (point-tracker-method-11 + (-> self control unknown-combo-tracker00) + (new 'stack-no-clear 'vector) + (-> self control trans) + s5-1 + (* 0.009107469 (the float (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)))) + ) + ) + ) + (set! sv-16 (fmin 163840.0 (sqrtf (+ (* (-> v1-124 x) (-> v1-124 x)) (* (-> v1-124 z) (-> v1-124 z)))))) + ) + (set-forward-vel sv-16) + ) + ) + (when (!= gp-0 (handle->process sv-56)) + (set! sv-56 (process->handle gp-0)) + (set! sv-64 (the-as int (current-time))) + ) + ) + ) + ((< sv-16 0.0) + (set! sv-16 (seek sv-16 -0.04096 (* 491520.0 (seconds-per-frame)))) + (set-forward-vel sv-16) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (not (cpad-hold? (-> self control cpad number) square)) + (zero? sv-32) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.2)) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) + (set-forward-vel (* 0.8 (-> self control ctrl-xz-vel))) + ) + ) + ((ja-done? 0) + (set-forward-vel sv-16) + ) + (else + (set! sv-16 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) sv-20) + ) + (set-forward-vel sv-16) + ) + ) + ) + (let ((gp-1 (new-stack-vector0))) + (vector-matrix*! gp-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> gp-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) gp-1 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! sv-16 (the-as float (-> self control unknown-word04))) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (when (and (>= sv-16 0.0) + (let ((gp-2 (ja-group)) + (f30-2 (ja-aframe-num 0)) + ) + (if (or (and (= gp-2 (-> self draw art-group data 452)) + (>= f30-2 11.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 452)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= gp-2 (-> self draw art-group data 459)) + (>= f30-2 11.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 459)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= gp-2 (-> self draw art-group data 454)) + (>= f30-2 49.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 454)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= gp-2 jakb-darkjak-attack-combo3-ja) + (or (and (>= f30-2 62.0) (>= 77.0 f30-2)) + (and (>= f30-2 82.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-darkjak-attack-combo3-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + ) + (and (= gp-2 (-> self draw art-group data 463)) + (>= f30-2 62.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 463)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + #t + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + (when (and (>= (impact-control-method-11 + (-> self control impact-ctrl) + gp-3 + (the-as process #f) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + 0.0 + ) + (>= 0.0 (vector-dot (-> gp-3 best-other-tri normal) (-> self control impact-ctrl dir))) + ) + (when (= (-> gp-3 best-other-tri pat mode) (pat-mode wall)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) + ) + ) + (let ((name (static-sound-name "djak-punch-hit"))) + (play-effect-sound + (-> self skel effect) + (the-as symbol "punch") + -1.0 + (-> self control impact-ctrl joint) + (the-as basic #f) + (the-as sound-name name) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! sv-16 (the-as float -61440.0)) + ) + ) + ) + ) + (let ((gp-6 (ja-group)) + (f0-59 (ja-aframe-num 0)) + ) + (if (and (= gp-6 jakb-darkjak-attack-combo3-ja) + (>= f0-59 80.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-darkjak-attack-combo3-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.6 1.0) + ) + ) + (suspend) + (ja :num! (seek! max (* (-> self control current-surface align-speed) sv-48))) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 sv-24) + (set! sv-20 (* sv-20 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + (set! sv-24 (+ sv-24 1)) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (go target-stance) + ) + :post target-post + ) + +(defstate target-darkjak-smack-charge (target) + :event target-standard-event-handler + :enter (-> (the-as (state target) target-duck-stance) enter) + :exit (behavior () + (remove-setting! 'bg-r) + (remove-setting! 'bg-g) + (remove-setting! 'bg-b) + (remove-setting! 'bg-a) + (update-rates! (-> *display* entity-clock) 1.0) + (persist-with-delay *setting-control* 'bg-a-speed (seconds 3) 'bg-a-speed 'abs 0.5 0) + (let ((gp-0 (handle->process (-> self darkjak charge-effect)))) + (when gp-0 + (let ((v1-18 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-18 command) (sound-command set-param)) + (set! (-> v1-18 id) (-> self control unknown-sound-id00)) + (set! (-> v1-18 params volume) -4) + (set! (-> v1-18 auto-time) 120) + (set! (-> v1-18 auto-from) 2) + (set! (-> v1-18 params mask) (the-as uint 17)) + (-> v1-18 id) + ) + (deactivate gp-0) + ) + ) + ((-> target-duck-stance exit)) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (not (cpad-hold? (-> self control cpad number) r1)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (zero? (-> self darkjak latch-out-time)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack) + ) + (if (or (or (not (cpad-hold? (-> self control cpad number) r1)) + (logtest? (-> self target-flags) (target-flags prevent-attack prevent-duck)) + ) + (!= (-> self ext-anim) 2) + ) + (go target-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and (and v1-2 (= v1-2 (-> self draw art-group data 478))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.2)) + ) + (else + (go target-stance) + ) + ) + ) + (until #f + (set-setting! 'bg-r 'abs 0.1 0) + (set-setting! 'bg-b 'abs 0.1 0) + (set-setting! 'bg-a 'abs 0.45 0) + (update-rates! (-> *display* entity-clock) 0.4) + (ja-no-eval :group! (-> self draw art-group data 478) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((v1-46 (and (= (-> self skel root-channel 0) (-> self skel channel)) + (not (handle->process (-> self darkjak charge-effect))) + ) + ) + ) + (when v1-46 + (set! (-> self control unknown-sound-id00) (sound-play "djak-bolt-charg")) + (set! (-> self darkjak charge-effect) + (ppointer->handle (if (logtest? (-> *part-group-id-table* 75 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 75) + :duration -1 + :target self + :mat-joint 59 + ) + (part-tracker-spawn + part-tracker + :to self + :group (-> *part-group-id-table* 75) + :duration -1 + :target self + :mat-joint 59 + ) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post target-post + ) + +(defstate target-darkjak-smack (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + ((-> target-running-attack event) proc argc message block) + ) + :enter (behavior () + ((-> target-running-attack enter)) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + ) + :exit (behavior () + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* part-clock) 1.0) + (remove-setting! 'gun) + ((-> target-darkjak-running-attack exit)) + ) + :trans (-> target-running-attack trans) + :code (behavior () + (target-start-attack) + (target-danger-set! 'dark-smack #f) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-smack-inc))) + ) + (set! (-> self control lightjak-sound-id) (sound-play "djak-pnch-swing")) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (-> self draw art-group data 476))) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! gp-1 :num! (seek!)) + ) + (initialize (-> self control impact-ctrl) self 28 3276.8 (-> self control root-prim prim-core collide-with)) + (let ((f28-0 (the-as number 0.0))) + 0.8 + (let ((gp-2 0) + (f30-0 1.0) + (s5-1 #f) + (f26-0 0.6) + ) + (until (ja-done? 0) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((< (the-as float f28-0) 0.0) + (set! f28-0 (seek (the-as float f28-0) -0.04096 (* 491520.0 (seconds-per-frame)))) + (set-forward-vel (the-as float f28-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f28-0)) + ) + (else + (set-forward-vel (the-as float f28-0)) + ) + ) + ) + (set! f26-0 (seek f26-0 0.3 (* 2.0 (seconds-per-frame)))) + (update-rates! (-> *display* entity-clock) f26-0) + (update-rates! (-> *display* bg-clock) f26-0) + (update-rates! (-> *display* part-clock) f26-0) + (let ((s4-0 (new-stack-vector0))) + (vector-matrix*! s4-0 (-> self control transv) (-> self control w-R-c)) + (set! (-> s4-0 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s4-0 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f28-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint (the-as float 0.0))) + ) + (let ((v1-96 + (and (not s5-1) + (let ((s4-1 (ja-group)) + (f0-19 (ja-aframe-num 0)) + ) + (if (and (= s4-1 (-> self draw art-group data 476)) + (>= f0-19 16.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 476)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + #t + ) + ) + ) + ) + ) + (when v1-96 + (set! s5-1 #t) + (let ((s4-2 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-2 ent) (-> self entity)) + (set! (-> s4-2 charge) 1.0) + (set! (-> s4-2 options) (projectile-options)) + (logclear! (-> s4-2 options) (projectile-options po14 po15 po16)) + (set! (-> s4-2 pos quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_rhand)) quad) + ) + (set! (-> s4-2 notify-handle) (the-as handle #f)) + (set! (-> s4-2 owner-handle) (the-as handle #f)) + (set! (-> s4-2 target-handle) (the-as handle #f)) + (set! (-> s4-2 target-pos quad) (the-as uint128 0)) + (set! (-> s4-2 ignore-handle) (process->handle self)) + (let* ((v1-125 *game-info*) + (a0-43 (+ (-> v1-125 attack-id) 1)) + ) + (set! (-> v1-125 attack-id) a0-43) + (set! (-> s4-2 attack-id) a0-43) + ) + (set! (-> s4-2 timeout) (seconds 4)) + (vector-float*! (-> s4-2 vel) (-> self control c-R-w fvec) 245760.0) + (let ((s3-1 (get-process *default-dead-pool* darkjak-ball #x8000 1))) + (when s3-1 + (let ((t9-28 (method-of-type process activate))) + (t9-28 s3-1 self "projectile" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-1 projectile-init-by-other s4-2) + (-> s3-1 ppointer) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (+! gp-2 1) + ) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (go target-stance) + ) + :post target-post + ) + +(defmethod update-clock! ((this darkjak-info) (arg0 int)) + (when (-> this clock-on) + (+! (-> this clock-pos) (* (-> this clock-vel) (seconds-per-frame))) + (+! (-> this clock-vel) (* 4.0 (seconds-per-frame))) + (cond + ((< 1.0 (-> this clock-pos)) + (set! (-> this clock-pos) 1.0) + (set! (-> this clock-vel) 0.0) + ) + ((< (-> this clock-pos) 0.05) + (set! (-> this clock-pos) 0.05) + (set! (-> this clock-vel) 1.0) + ) + ) + (update-rates! (-> *display* entity-clock) (-> this clock-pos)) + (update-rates! (-> *display* bg-clock) (-> this clock-pos)) + (if (= arg0 16) + (update-rates! (-> *display* target-clock) (-> this clock-pos)) + ) + (when *sound-player-enable* + (let ((v1-27 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-27 command) (sound-command set-param)) + (set! (-> v1-27 id) (-> this process 0 control unknown-sound-id00)) + (set! (-> v1-27 params pitch-mod) (the int (* 1524.0 (- (- 1.0 (-> this clock-pos)))))) + (set! (-> v1-27 params mask) (the-as uint 2)) + (-> v1-27 id) + ) + ) + ) + 0 + (none) + ) + +(defbehavior target-darkjak-bomb-collide target ((arg0 (pointer float)) (arg1 float)) + (seek! (-> arg0 0) arg1 (* 4.0 (seconds-per-frame))) + (set! (-> self control bomb-scale) (-> arg0 0)) + (target-danger-set! 'bomb #f) + (update-transforms (-> self control)) + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options)) + (set! (-> a1-2 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-2) + ) + (set! (-> self control bomb-scale) 0.0) + (target-danger-set! 'bomb #f) + (update-transforms (-> self control)) + 0 + (none) + ) + +(defstate target-darkjak-bomb0 (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) + #f + ) + (('hit) + (let ((v1-1 (the-as object (-> block param 1)))) + (when (and (= (-> block param 0) 'bomb) + (logtest? (process-mask enemy) (-> (the-as process v1-1) mask)) + (let ((v1-7 (ja-group))) + (and v1-7 (= v1-7 (-> self draw art-group data 468))) + ) + (>= (ja-aframe-num 0) 35.0) + (not (-> self darkjak clock-on)) + ) + (set! (-> self darkjak clock-vel) -8.0) + (let ((v0-0 (the-as object #t))) + (set! (-> self darkjak clock-on) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + (('change-mode) + #f + ) + (('attack 'attack-or-shove 'swim) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags tf4)) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self darkjak clock-pos) 1.0) + (set! (-> self darkjak clock-vel) 0.0) + (set! (-> self darkjak clock-on) #f) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "darkbom0" -99.0 0) + ) + ) + :exit (behavior () + (set-action! + *gui-control* + (gui-action fade) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (logclear! (-> self target-flags) (target-flags tf6)) + (target-exit) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (remove-setting! 'gun) + (set! (-> self darkjak clock-pos) 1.0) + (set! (-> self darkjak clock-vel) 0.0) + (set! (-> self darkjak clock-on) #f) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) + ((-> target-darkjak-get-off exit)) + ) + ) + :trans (behavior () + (update-clock! (-> self darkjak) 16) + ) + :code (behavior () + (local-vars + (v1-100 symbol) + (sv-16 float) + (sv-20 float) + (sv-160 vector) + (sv-164 (function object :behavior target)) + ) + (set! (-> self darkjak stage) (-> self darkjak want-stage)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *roll-flip-mods*) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (set! sv-16 (the-as float 0.0)) + (set! sv-20 (the-as float 1.0)) + (ja-channel-push! 1 (seconds 0.15)) + (when (jump-hit-ground-stuck?) + (ja-no-eval :group! (-> self draw art-group data 451) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self alt-cam-pos x) (-> self control trans x)) + (set! (-> self alt-cam-pos z) (-> self control trans z)) + (set-forward-vel (* 0.85 (-> self control ctrl-xz-vel))) + (suspend) + (ja :num! (seek!)) + ) + ) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'sfx-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) + (ja-no-eval :group! (-> self draw art-group data 466) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (set! (-> self alt-cam-pos x) (-> self control trans x)) + (set! (-> self alt-cam-pos z) (-> self control trans z)) + (set-forward-vel (* 0.98 (-> self control ctrl-xz-vel))) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! (-> self draw art-group data 467) :num! (seek!) :frame-num 0.0) + (let ((f30-0 (the float (target-time-to-ground)))) + (until v1-100 + (set! (-> self alt-cam-pos x) (-> self control trans x)) + (set! (-> self alt-cam-pos z) (-> self control trans z)) + (set-forward-vel (* 0.98 (-> self control ctrl-xz-vel))) + (let ((v1-92 (new-stack-vector0)) + (f0-35 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-92 (-> self control transv) (vector-float*! v1-92 (-> self control dynam gravity-normal) f0-35)) + (let* ((f1-5 (vector-length v1-92)) + (f2-0 f1-5) + (f0-36 (+ f0-35 (* -491520.0 (seconds-per-frame)))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-36) + (vector-float*! v1-92 v1-92 (/ f1-5 f2-0)) + ) + ) + ) + (suspend) + (ja :num! (seek! max (lerp-scale 1.5 0.3 f30-0 30.0 210.0))) + (set! v1-100 (or (ja-done? 0) (logtest? (-> self control status) (collide-status on-surface)))) + ) + ) + (logclear! (-> self target-flags) (target-flags tf6)) + (while (not (jump-hit-ground-stuck?)) + (let ((v1-105 (new-stack-vector0)) + (f0-42 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-105 + (-> self control transv) + (vector-float*! v1-105 (-> self control dynam gravity-normal) f0-42) + ) + (let* ((f1-8 (vector-length v1-105)) + (f2-1 f1-8) + (f0-43 (+ f0-42 (* -491520.0 (seconds-per-frame)))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-43) + (vector-float*! v1-105 v1-105 (/ f1-8 f2-1)) + ) + ) + ) + (ja :num! (seek! (ja-aframe 33.0 0))) + (suspend) + ) + (set-forward-vel 0.0) + (ja-no-eval :group! (-> self draw art-group data 468) :num! (seek! (ja-aframe 35.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 35.0 0))) + ) + (set-action! + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (target-start-attack) + (target-danger-set! 'bomb #f) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-bomb0-inc))) + (set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand))) + (set! sv-164 (lambda :behavior target + () + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (cond + ((>= 10.0 (ja-aframe-num 0)) + (let ((v0-1 (the-as vector (-> self draw color-emissive)))) + (set! (-> (the-as rgbaf v0-1) x) 1.0) + (set! (-> (the-as rgbaf v0-1) y) 1.0) + (set! (-> (the-as rgbaf v0-1) z) 1.0) + (set! (-> (the-as rgbaf v0-1) w) 1.0) + v0-1 + ) + ) + ((>= 20.0 (ja-aframe-num 0)) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 10.0 20.0) + ) + ) + (else + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (new 'static 'vector :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 20.0 30.0) + ) + ) + ) + ) + ) + (set! (-> sv-160 y) (-> self control root-prim prim-core world-sphere y)) + (cond + ((logtest? (-> *part-group-id-table* 71 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 71)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 71)) + ) + ) + (let ((gp-6 (process-spawn + manipy + :init manipy-init + sv-160 + (-> self entity) + (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when gp-6 + (send-event (ppointer->process gp-6) 'anim-mode 'play1) + (send-event (ppointer->process gp-6) 'anim "idle") + (set-vector! (-> (the-as process-drawable (-> gp-6 0)) root scale) sv-20 1.0 sv-20 1.0) + (send-event (ppointer->process gp-6) 'trans-hook sv-164) + ) + ) + (let ((gp-8 (process-spawn + manipy + :init manipy-init + sv-160 + (-> self entity) + (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when gp-8 + (send-event (ppointer->process gp-8) 'anim-mode 'play1) + (send-event (ppointer->process gp-8) 'anim "idle") + (set-vector! (-> (the-as manipy (-> gp-8 0)) root scale) sv-20 1.0 sv-20 1.0) + ) + ) + (ja-no-eval :num! (seek! (ja-aframe 38.0 0))) + (while (not (ja-done? 0)) + (target-darkjak-bomb-collide (& sv-16) sv-20) + (set-forward-vel 0.0) + (suspend) + (ja-eval) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (target-darkjak-bomb-collide (& sv-16) sv-20) + (set-forward-vel 0.0) + (suspend) + (ja-eval) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (ja-no-eval :group! (-> self draw art-group data 461) :num! (seek! (ja-aframe 90.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (target-darkjak-bomb-collide (& sv-16) sv-20) + (suspend) + (ja :num! (seek! (ja-aframe 90.0 0))) + ) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (send-event (handle->process (-> self notify)) 'notify 'attack 20) + (go target-darkjak-get-off) + ) + :post target-no-stick-post + ) + +(format 0 "SKIP: target-darkjak removed lightning spec~%") +;; (set! (-> *lightning-spec-id-table* 11) (new 'static 'lightning-spec +;; :name "lightning-darkjak-bomb1" +;; :flags (lightning-spec-flags lsf0 lsf4) +;; :adjust-distance #xa +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3a :page #x4) +;; :reduction 0.42 +;; :num-points 80 +;; :box-size 32768.0 +;; :merge-factor 0.2 +;; :merge-count 2 +;; :radius 2048.0 +;; :duration 300.0 +;; :duration-rand 90.0 +;; :sound (static-sound-spec "transform-zap" :group 1) +;; ) +;; ) + +(defbehavior target-bomb1-fire-shot target ((arg0 (array handle)) (arg1 int) (arg2 int)) + (local-vars (sv-128 target) (sv-144 int) (sv-160 vector) (sv-176 vector) (sv-192 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cond + ((and (>= arg1 0) (< arg1 (-> arg0 length))) + (let ((s5-0 (handle->process (-> arg0 arg1)))) + (when s5-0 + (get-trans (the-as process-focusable s5-0) 3) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 11) + 0 + lightning-probe-callback + s5-0 + 3 + 3 + :name "lightning-tracker" + :to self + :unk 0 + ) + (send-event + s5-0 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint arg2)) + (damage 15.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'ice) + (penetrate-using (penetrate touch dark-skin dark-bomb)) + ) + ) + ) + ) + ) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when gp-1 + (let ((t9-6 (method-of-type lightning-tracker activate))) + (t9-6 (the-as lightning-tracker gp-1) self "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((s5-1 run-function-in-process) + (s4-1 gp-1) + (s3-0 lightning-tracker-init) + (s2-0 (-> *lightning-spec-id-table* 11)) + (s1-0 0) + (s0-0 lightning-probe-callback) + ) + (set! sv-128 self) + (set! sv-144 3) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! sv-160 (-> self control trans)) + (set! sv-176 (new 'stack-no-clear 'vector)) + (set! (-> sv-176 x) (rand-vu-float-range -40960.0 40960.0)) + (set! (-> sv-176 y) (rand-vu-float-range -8192.0 8192.0)) + (set! (-> sv-176 z) (rand-vu-float-range -40960.0 40960.0)) + (set! (-> sv-176 w) 1.0) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-160 quad)) + (.lvf vf5 (&-> sv-176 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-192 quad) vf6) + ((the-as (function object object object object object object object object none) s5-1) + s4-1 + s3-0 + s2-0 + s1-0 + s0-0 + sv-128 + sv-144 + sv-192 + ) + ) + (-> gp-1 ppointer) + ) + ) + #f + ) + ) + ) + ) + +(defstate target-darkjak-bomb1 (target) + :event (-> target-darkjak-bomb0 event) + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-attack-uppercut-jump enter) arg0 arg1) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + ) + :exit (-> target-darkjak-bomb0 exit) + :trans (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-darkjak-get-off) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (if (and (= (-> self control danger-mode) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) + (target-danger-set! 'harmless #f) + ) + (slide-down-test) + (update-clock! (-> self darkjak) 32) + ) + :code (behavior ((arg0 float) (arg1 float)) + (local-vars + (sv-112 (array collide-shape)) + (sv-120 int) + (sv-128 vector) + (sv-132 (array handle)) + (sv-136 int) + (sv-144 time-frame) + (sv-152 time-frame) + (sv-160 float) + (sv-164 float) + (sv-168 time-frame) + (sv-176 uint) + ) + (logior! (-> self target-flags) (target-flags tf4)) + (set! (-> self neck flex-blend) 0.0) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) + (compute-alignment! (-> self align)) + (set-action! + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (let ((f0-1 0.9)) + (ja-no-eval :num! (seek! max f0-1)) + ) + (while (not (ja-done? 0)) + (compute-alignment! (-> self align)) + (set! (-> self control turn-go-the-long-way) 1.0) + (set! (-> self darkjak clock-vel) -4.0) + (set! (-> self darkjak clock-on) #t) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (suspend) + (ja-eval) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-bomb1-inc))) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (let ((gp-0 (-> self post-hook))) + (set! (-> self post-hook) target-no-move-post) + (set! sv-112 (-> self focus-search)) + (set! sv-120 0) + (set! sv-128 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg main))) + (set! sv-132 (-> self handle-search)) + (set! (-> sv-132 length) 0) + (set! (-> sv-128 w) 327680.0) + (set! sv-120 (fill-actor-list-for-box + *actor-hash* + (the-as bounding-box sv-128) + (-> sv-112 data) + (-> sv-112 allocated-length) + ) + ) + (set! (-> sv-112 length) sv-120) + (countdown (s5-0 sv-120) + (let* ((s4-0 (-> sv-112 s5-0 process)) + (v1-56 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when (and v1-56 (logtest? (process-mask crate enemy guard vehicle) (-> v1-56 mask))) + (set! (-> sv-132 (-> sv-132 length)) (process->handle v1-56)) + (+! (-> sv-132 length) 1) + (if (< (-> sv-132 allocated-length) (-> sv-132 length)) + (set! (-> sv-132 length) (-> sv-132 allocated-length)) + ) + ) + ) + ) + (set! (-> self control mod-surface) (new 'static 'surface + :name 'uppercut + :turnv 524288.0 + :turnvf 15.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 32768.0 + :target-speed 32768.0 + :fric 0.2 + :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 + :mode 'air + :flags (surface-flag air attack spin gun-off laser-hide) + ) + ) + (set! sv-136 0) + (set! sv-144 (current-time)) + (set! sv-152 (current-time)) + (set! sv-160 (the-as float 0.0)) + (set! sv-164 (the-as float 0.0)) + (set! sv-168 (current-time)) + (let* ((v1-77 (-> self game)) + (a0-34 (+ (-> v1-77 attack-id) 1)) + ) + (set! (-> v1-77 attack-id) a0-34) + (set! sv-176 a0-34) + ) + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! (-> self draw art-group data 469)) + (ja :chan 1 :group! (-> self draw art-group data 470)) + (while (or (< sv-136 (-> sv-132 length)) (not (time-elapsed? sv-152 (seconds 1.5)))) + (let ((v1-84 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-84 (-> self control transv) (vector-float*! v1-84 (-> self control dynam gravity-normal) f0-10)) + ) + (let* ((f0-11 (vector-length v1-84)) + (f1-3 f0-11) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-84 v1-84 (/ f0-11 f1-3)) + ) + ) + ) + (set! (-> self darkjak clock-vel) -4.0) + (set! (-> self darkjak clock-on) #t) + (send-event *camera* 'joystick -0.25 1.0) + (when (time-elapsed? sv-144 (seconds 0.1)) + (set! sv-144 (current-time)) + (target-bomb1-fire-shot sv-132 sv-136 (the-as int sv-176)) + (set! sv-136 (+ sv-136 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) + (set! sv-164 (the-as float 1.0)) + ) + ) + (set! sv-160 (seek sv-160 sv-164 (* 6.0 (seconds-per-frame)))) + (ja :num! (loop!)) + (let ((a0-61 (-> self skel root-channel 1))) + (let ((f0-21 sv-160)) + (set! (-> a0-61 frame-interp 1) f0-21) + (set! (-> a0-61 frame-interp 0) f0-21) + ) + (set! (-> a0-61 param 0) 0.0) + (joint-control-channel-group-eval! a0-61 (the-as art-joint-anim #f) num-func-chan) + ) + (suspend) + ) + (set! (-> self post-hook) gp-0) + ) + (set! (-> self control mod-surface) *double-jump-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 471) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (compute-alignment! (-> self align)) + (set! (-> self control turn-go-the-long-way) 1.0) + (set! (-> self darkjak clock-vel) 4.0) + (suspend) + (ja :num! (seek!)) + ) + (set-time! (-> self gun surpress-time)) + (send-event (handle->process (-> self notify)) 'notify 'attack 21) + (go target-darkjak-get-off) + ) + :post target-post + ) diff --git a/goal_src/jak3/engine/target/target-gun.gc b/goal_src/jak3/engine/target/target-gun.gc index c9621e86bd..bb679d9dae 100644 --- a/goal_src/jak3/engine/target/target-gun.gc +++ b/goal_src/jak3/engine/target/target-gun.gc @@ -2088,7 +2088,7 @@ (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-214 gp-3)) - (set! (-> v1-214 spheres) s5-2) + (set! (-> v1-214 best-dist) (the-as float s5-2)) (set! (-> v1-214 best-other-prim) (the-as collide-shape-prim 1)) (set! (-> v1-214 collide-with) (-> self control root-prim prim-core collide-with)) (set! (-> v1-214 ignore-process0) #f) diff --git a/goal_src/jak3/engine/target/target-h.gc b/goal_src/jak3/engine/target/target-h.gc index 70972d3a21..18a46d65ee 100644 --- a/goal_src/jak3/engine/target/target-h.gc +++ b/goal_src/jak3/engine/target/target-h.gc @@ -164,6 +164,12 @@ ;; powerups (define-extern target-darkjak-process (function none :behavior target)) +;; target-darkjak +(define-extern *darkjak-trans-mods* surface) + +;; target-ladder +(define-extern *ladder-mods* surface) + ;; +++lightjak-stage (defenum lightjak-stage :bitfield #t @@ -347,7 +353,7 @@ (target-continue continue-point) (target-credits int) target-darkjak-bomb0 - target-darkjak-bomb1 + (target-darkjak-bomb1 float float) target-darkjak-get-off (target-darkjak-get-on darkjak-stage) target-darkjak-running-attack @@ -416,9 +422,15 @@ target-indax-walk (target-invisible-get-on handle time-frame) (target-jump float float surface) - (target-jump-forward float float) + (target-jump-forward float float symbol) target-ladder + target-ladder-jump-off + target-ladder-slide-down + target-ladder-stance (target-ladder-start handle) + target-ladder-switch + target-ladder-walk-down + target-ladder-walk-up (target-launch float symbol vector int) target-launch-dir target-lightjak-freeze @@ -471,7 +483,7 @@ (target-pole-flip-forward float float float) (target-pole-flip-forward-jump float float) (target-pole-flip-up float float float) - (target-pole-flip-up-jump float float) + (target-pole-flip-up-jump float float symbol) target-powerjak-get-on (target-racing-start handle) target-roll diff --git a/goal_src/jak3/engine/target/target-invisible.gc b/goal_src/jak3/engine/target/target-invisible.gc index bd059f7658..3f0d1018fa 100644 --- a/goal_src/jak3/engine/target/target-invisible.gc +++ b/goal_src/jak3/engine/target/target-invisible.gc @@ -422,7 +422,7 @@ ) (set! (-> a1-2 trans quad) (-> s5-1 quad)) (if (and (nonzero? (-> self part)) (not gp-0)) - (sparticle-launch-control-method-17 (-> self part) a1-2) + (spawn-from-mat (-> self part) a1-2) ) ) (update-vol! (-> self humming-sound) (if gp-0 @@ -491,7 +491,7 @@ (a1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) ) (set! (-> a1-4 trans quad) (-> gp-2 quad)) - (sparticle-launch-control-method-17 (-> self part) a1-4) + (spawn-from-mat (-> self part) a1-4) ) ) (ja-post) @@ -523,9 +523,9 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-maker-idol" (the-as (pointer level) #f))) (the-as pair 0) ) - (if (task-node-closed? (game-task-node volcano-darkeco-resolution)) - (set! (-> this part) (create-launch-control (-> *part-group-id-table* 82) this)) - ) + ;; (if (task-node-closed? (game-task-node volcano-darkeco-resolution)) + ;; (set! (-> this part) (create-launch-control (-> *part-group-id-table* 82) this)) + ;; ) (set! (-> this humming-sound) (new 'process 'ambient-sound "dark-maker-amb" (-> this root trans) 0.0)) (set-falloff-far! (-> this humming-sound) 122880.0) (update-vol! (-> this humming-sound) 0.8) diff --git a/goal_src/jak3/engine/target/target-ladder.gc b/goal_src/jak3/engine/target/target-ladder.gc index e1c5929d3e..c7d6790c5d 100644 --- a/goal_src/jak3/engine/target/target-ladder.gc +++ b/goal_src/jak3/engine/target/target-ladder.gc @@ -5,5 +5,631 @@ ;; name in dgo: target-ladder ;; dgos: HALFPIPE, SED, WWD, VOCA +;; +++ladder-options +(defenum ladder-options + :type uint32 + :bitfield #t + (lo0 0) + (lo1 1) + (lo2 2) + (nodraw 3) + ) +;; ---ladder-options + + ;; DECOMP BEGINS +(deftype ladder-info (basic) + ((ladder handle) + (flip degrees) + (interp float) + (start-mat matrix :inline) + ) + ) + + +(let ((v1-2 (copy *walk-mods* 'global))) + (set! (-> v1-2 name) 'ladder) + (set! (-> v1-2 flags) (surface-flag turn-when-centered turn-to-alt gun-hide)) + (set! (-> v1-2 bend-factor) 1.0) + (set! (-> v1-2 bend-speed) 1.0) + (set! (-> v1-2 tiltv) 262144.0) + (set! (-> v1-2 tiltvf) 30.0) + (set! (-> v1-2 tiltvv) 1048576.0) + (set! (-> v1-2 tiltvvf) 30.0) + (set! *ladder-mods* v1-2) + ) + +(defstate target-ladder (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) + 'target-ladder + (target-standard-event-handler proc argc message block) + ) + ) + :exit (behavior () + (when (not (and (-> self next-state) (begin (-> self next-state name) (state-type? (-> self next-state) 'target-ladder))) + ) + (target-collide-set! 'normal 0.0) + (logclear! (-> self focus-status) (focus-status pole)) + (set! (-> self ladder ladder) (the-as handle #f)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + ) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + (b! (not (cpad-pressed? (-> self control cpad number) x)) cfg-2 :delay (empty-form)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons x)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons x)) + (go target-ladder-jump-off) + (b! #t cfg-41 :delay (nop!)) + (label cfg-2) + (cond + ((and (cpad-hold? (-> self control cpad number) circle) + (not (and (-> self next-state) (let ((v1-26 (-> self next-state name))) + (or (= v1-26 'target-ladder-slide-down) (= v1-26 'target-ladder-switch)) + ) + ) + ) + (!= (send-event (handle->process (-> self ladder ladder)) 'move 0) 0.0) + ) + (go target-ladder-slide-down) + ) + ((and (cpad-pressed? (-> self control cpad number) square) + (not (and (-> self next-state) (let ((v1-49 (-> self next-state name))) + (or (= v1-49 'target-ladder-slide-down) (= v1-49 'target-ladder-switch)) + ) + ) + ) + (begin + (let ((gp-1 #t) + (a1-7 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'options) + (let ((v1-57 + (the-as int (logand (the-as int (send-event-function (handle->process (-> self ladder ladder)) a1-7)) 3)) + ) + ) + (cmove-#f-nonzero gp-0 v1-57 gp-1) + ) + ) + gp-0 + ) + ) + (go target-ladder-switch) + ) + ) + (label cfg-41) + ) + :code nothing + :post (behavior () + (let ((gp-0 (handle->process (-> self ladder ladder)))) + (seek! (-> self ladder interp) 1.0 (* 10.0 (seconds-per-frame))) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'matrix) + (set! (-> a1-2 param 0) (the-as uint (new 'stack-no-clear 'matrix))) + (let ((gp-1 (the-as matrix (send-event-function gp-0 a1-2)))) + (if (= (-> self ladder flip) -1.0) + (set! (-> self ladder flip) + (if (< (vector-dot (-> gp-1 fvec) (vector-! (new 'stack-no-clear 'vector) (-> gp-1 trans) (-> self control trans))) + 0.0 + ) + 32768.0 + 0.0 + ) + ) + ) + (cond + (gp-1 + (set! (-> self control bend-amount) 1.0) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let ((a1-5 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (-> self ladder flip)))) + (matrix*! s4-0 a1-5 gp-1) + ) + (let ((s5-0 (new 'static 'vector :w 1.0)) + (gp-2 (matrix-lerp! (new 'stack-no-clear 'matrix) (-> self ladder start-mat) s4-0 (-> self ladder interp))) + ) + (set! (-> s5-0 z) (* -1597.44 (-> self ladder interp))) + (vector-matrix*! (-> self control trans) s5-0 gp-2) + (set! (-> self control turn-to-alt-heading quad) (-> gp-2 fvec quad)) + (set! (-> self control local-normal quad) (-> gp-2 uvec quad)) + (set! (-> self control bent-gravity-normal quad) (-> gp-2 uvec quad)) + (set! (-> self control gspot-normal quad) (-> gp-2 uvec quad)) + ) + ) + (update-transforms (-> self control)) + ) + (else + (go target-falling #f) + ) + ) + ) + ) + ) + (target-no-move-post) + ) + ) + +(defstate target-ladder-start (target) + :parent target-ladder + :enter (behavior ((arg0 handle)) + (when (zero? (-> self ladder)) + (set! (-> self ladder) (new 'process 'ladder-info)) + (set! (-> self ladder ladder) (the-as handle #f)) + ) + (set! (-> self ladder ladder) arg0) + (set! (-> self ladder flip) -1.0) + (set! (-> self ladder interp) 0.0) + (let* ((v1-10 (-> self ladder start-mat)) + (a3-0 (-> self node-list data 0 bone transform)) + (a0-4 (-> a3-0 rvec quad)) + (a1-1 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-10 rvec quad) a0-4) + (set! (-> v1-10 uvec quad) a1-1) + (set! (-> v1-10 fvec quad) a2-0) + (set! (-> v1-10 trans quad) a3-1) + ) + (set! (-> self control bend-target) 1.0) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *ladder-mods*) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (target-collide-set! 'pole 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (set! (-> self control transv quad) (the-as uint128 0)) + ) + :code (behavior ((arg0 handle)) + (cond + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.05)) + (ja-channel-push! 1 (seconds 0.065)) + (ja-no-eval :group! jakb-ladder-jump-on-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! jakb-ladder-get-on-ja :num! (seek! max 4.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 4.0)) + ) + ) + ) + (go target-ladder-stance) + ) + :post (behavior () + (send-event (handle->process (-> self ladder ladder)) 'stance) + (let ((v1-8 (-> self state parent))) + (when v1-8 + (let ((t9-1 (-> v1-8 post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + ) + ) + +(defstate target-ladder-stance (target) + :parent target-ladder + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-ladder-walk-up) + ) + (can-play-stance-amibent?) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-ladder-up-to-stance-ja) (= v1-2 jakb-ladder-slide-stop-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (or (= v1-16 jakb-ladder-slide-start-ja) (= v1-16 jakb-ladder-slide-loop-ja))) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-ladder-slide-stop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let ((v1-45 (ja-group))) + (cond + ((and v1-45 (or (= v1-45 jakb-ladder-stance-to-up-ja) (= v1-45 jakb-ladder-stance-to-down-ja))) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.25)) + ) + ) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! jakb-ladder-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (-> target-ladder-start post) + ) + +(defstate target-ladder-walk-up (target) + :parent target-ladder + :trans (behavior () + (local-vars (gp-0 symbol)) + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (cond + ((and (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'move) + (set! (-> a1-0 param 0) (the-as uint 0)) + (let* ((f0-1 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-0))) + (f0-2 (- f0-1 (* (the float (the int (/ f0-1 0.5))) 0.5))) + ) + (or (< 0.4 f0-2) (< f0-2 0.01)) + ) + ) + ) + (go target-ladder-stance) + ) + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + ) + ((< (the-as uint 128) (-> self control cpad lefty)) + (go target-ladder-walk-down) + ) + ((let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'pos) + (set! (-> a1-1 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (and (= (send-event-function (handle->process (-> self ladder ladder)) a1-1) 1.0) + (begin + (let ((gp-1 #t) + (a1-2 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'options) + (let ((v1-56 + (the-as int (logand (the-as int (send-event-function (handle->process (-> self ladder ladder)) a1-2)) 4)) + ) + ) + (cmove-#f-nonzero gp-0 v1-56 gp-1) + ) + ) + gp-0 + ) + ) + ) + (go + target-edge-grab-jump + (-> *TARGET-bank* edge-grab-jump-height-min) + (-> *TARGET-bank* edge-grab-jump-height-max) + 'ladder + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 jakb-ladder-up-to-stance-ja)) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-13 (ja-group))) + (and v1-13 (= v1-13 jakb-ladder-stance-to-up-ja)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-ladder-up-ja) + (until #f + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'move) + (set! (-> a1-3 param 0) + (the-as + uint + (* (-> *TARGET-bank* ladder-walk-up-speed) (fmax 0.4 (-> self control cpad stick0-speed)) (seconds-per-frame)) + ) + ) + (let ((f0-8 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-3))) + (a0-20 (-> self skel root-channel 0)) + ) + (let ((f0-9 (- f0-8 (* (the float (the int (/ f0-8 1.0))) 1.0))) + (v1-49 (ja-group)) + ) + (set! (-> a0-20 param 0) (* f0-9 (the float (+ (-> v1-49 frames num-frames) -1)))) + ) + (set! (-> a0-20 param 1) 1000.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate target-ladder-walk-down (target) + :parent target-ladder + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (cond + ((and (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'move) + (set! (-> a1-0 param 0) (the-as uint 0)) + (let* ((f0-1 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-0))) + (f0-2 (- f0-1 (* (the float (the int (/ f0-1 0.5))) 0.5))) + ) + (or (< 0.49 f0-2) (< f0-2 0.1)) + ) + ) + ) + (go target-ladder-stance) + ) + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + ) + ((< (-> self control cpad lefty) (the-as uint 128)) + (go target-ladder-walk-up) + ) + ((= (the-as float (send-event (handle->process (-> self ladder ladder)) 'pos (new 'stack-no-clear 'vector))) + 0.0 + ) + (go target-stance) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (= v1-2 jakb-ladder-stance-to-down-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-ladder-down-ja) + (until #f + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'move) + (set! (-> a1-2 param 0) (the-as uint (* (- (-> *TARGET-bank* ladder-walk-down-speed)) + (fmax 0.4 (-> self control cpad stick0-speed)) + (seconds-per-frame) + ) + ) + ) + (let ((f0-7 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-2))) + (a0-14 (-> self skel root-channel 0)) + ) + (let ((f0-9 (- 1.0 (- f0-7 (* (the float (the int (/ f0-7 1.0))) 1.0)))) + (v1-39 (ja-group)) + ) + (set! (-> a0-14 param 0) (* f0-9 (the float (+ (-> v1-39 frames num-frames) -1)))) + ) + (set! (-> a0-14 param 1) 1000.0) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate target-ladder-slide-down (target) + :parent target-ladder + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control unknown-sound-id00) (new-sound-id)) + ) + :exit (behavior () + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> self control unknown-sound-id00)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 24) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + (let ((v1-3 (-> self prev-state parent))) + (when v1-3 + (let ((t9-1 (-> v1-3 exit))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + ) + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (if (and (not (cpad-hold? (-> self control cpad number) circle)) + (time-elapsed? (-> self state-time) (seconds 0.25)) + ) + (go target-ladder-stance) + ) + (set! (-> self control unknown-sound-id00) + (sound-play "ladder-slide" :id (-> self control unknown-sound-id00)) + ) + ) + :code (behavior () + (set! (-> self control unknown-word04) (the-as uint 0.0)) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (= v1-3 jakb-ladder-slide-start-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-17 (ja-group))) + (and v1-17 (= v1-17 jakb-ladder-slide-loop-ja)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-ladder-slide-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (ja :group! jakb-ladder-slide-loop-ja) + (until #f + (ja :num! (loop!)) + (suspend) + ) + #f + ) + :post (behavior () + (set! (-> self control unknown-word04) + (the-as uint (seek + (the-as float (-> self control unknown-word04)) + (- (-> *TARGET-bank* ladder-slide-speed)) + (* 2.0 (seconds-per-frame) (-> *TARGET-bank* ladder-slide-speed)) + ) + ) + ) + (if (= (the-as float (send-event + (handle->process (-> self ladder ladder)) + 'move + (* (the-as float (-> self control unknown-word04)) (seconds-per-frame)) + ) + ) + 0.0 + ) + (go target-ladder-stance) + ) + (let ((v1-21 (-> self state parent))) + (when v1-21 + (let ((t9-3 (-> v1-21 post))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + ) + ) + +(defstate target-ladder-switch (target) + :parent target-ladder + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (-> self ladder flip))) + (ja-no-eval :group! jakb-ladder-switch-ja :num! (seek! max 1.25) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (set! (-> self ladder flip) + (the float (sar (shl (the int (lerp-scale f30-0 (+ 32768.0 f30-0) (ja-aframe-num 0) 0.0 30.0)) 48) 48)) + ) + (suspend) + (ja :num! (seek! max 1.25)) + ) + (set! (-> self ladder flip) (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + (go target-ladder-stance) + ) + :post (-> target-ladder-start post) + ) + +(defstate target-ladder-jump-off (target) + :parent target-ladder + :trans #f + :code (behavior () + (set! (-> self control mod-surface) *turn-around-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-ladder-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + (rot->dir-targ! (-> self control)) + (set-forward-vel 16384.0) + (go target-jump-forward (-> *TARGET-bank* jump-height-max) (-> *TARGET-bank* jump-height-max) #f) + ) + ) diff --git a/goal_src/jak3/engine/target/target-part.gc b/goal_src/jak3/engine/target/target-part.gc index ba6defe34b..b97255a22b 100644 --- a/goal_src/jak3/engine/target/target-part.gc +++ b/goal_src/jak3/engine/target/target-part.gc @@ -5,8 +5,4294 @@ ;; name in dgo: target-part ;; dgos: GAME -(define-extern process-drawable2-shock-effect (function process-drawable process-drawable lightning-spec (function lightning-tracker none) sparticle-launcher none)) -(define-extern process-drawable-shock-effect-replace (function process-drawable lightning-spec (function lightning-tracker none) int int float none)) - ;; DECOMP BEGINS +;; og:preserve-this this function was stubbed out +(defun process-drawable-shock-wall-effect ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 sparticle-launcher) + ) + #f + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-part-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 41) 100)) + (s3-0 (mod (the-as int (rand-uint31-gen *random-generator*)) 21)) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 71) 20)) + (v1-7 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 41) 70)) + ) + (set! (-> arg2 r-g-b-a x) (the float (- s5-0 s3-0))) + (set! (-> arg2 r-g-b-a y) (the float (- s5-0 s4-0))) + (set! (-> arg2 r-g-b-a z) (the float (- s5-0 v1-7))) + ) + (none) + ) + +(defun birth-func-copy-target-y-rot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 *target*)) + (when v1-0 + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 rvec quad) (the-as uint128 0)) + (set! (-> s5-0 uvec quad) (the-as uint128 0)) + (set! (-> s5-0 fvec quad) (the-as uint128 0)) + (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((f0-1 (+ -16384.0 (y-angle (-> v1-0 control))))) + (matrix-rotate-y! s5-0 f0-1) + ) + (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) + ) + ) + ) + 0 + (none) + ) + +(defun birth-func-ground-orient ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-10 float) (v1-11 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 *target*) + ) + (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -20480.0 0.0 1.0) + (+! (-> s4-0 start-pos y) 4096.0) + (let ((v1-3 s4-0)) + (set! (-> v1-3 radius) 40.96) + (set! (-> v1-3 collide-with) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + vehicle-mesh-no-block-use + ) + ) + (set! (-> v1-3 ignore-process0) s5-0) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> s2-0 x) (-> s4-0 best-other-tri normal z)) + (set! (-> s2-0 y) 0.0) + (set! (-> s2-0 z) (- (-> s4-0 best-other-tri normal x))) + (vector-normalize! s2-0 1.0) + (quaternion-vector-angle! s3-1 s2-0 (acos (-> s4-0 best-other-tri normal y))) + (let ((s4-1 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s4-1 *up-vector* (+ 32768.0 (y-angle (-> s5-0 control)))) + (quaternion-normalize! (quaternion*! s3-1 s4-1 s3-1)) + ) + (cond + ((< (-> s3-1 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-10 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-11 vf1) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defun birth-func-target-orient ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-10 float) (v1-11 float) (sv-16 target)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-16 *target*) + (when sv-16 + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((s2-0 (-> sv-16 control local-normal))) + (set! (-> s3-0 x) (-> s2-0 z)) + (set! (-> s3-0 y) 0.0) + (set! (-> s3-0 z) (- (-> s2-0 x))) + (vector-normalize! s3-0 1.0) + (quaternion-vector-angle! s5-0 s3-0 (acos (-> s2-0 y))) + ) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s3-1 *up-vector* (+ 32768.0 (-> arg1 user-float) (y-angle (-> sv-16 control)))) + (quaternion-normalize! (quaternion*! s5-0 s5-0 s3-1)) + ) + (cond + ((< (-> s5-0 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-10 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-11 vf1) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +(defun birth-func-vector-orient ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-3 float) (v1-4 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when *target* + (let ((s4-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (the-as sprite-vec-data-2d (-> arg1 user-float))) + ) + (when (nonzero? s3-0) + (set! (-> s4-0 x) (-> s3-0 x-y-z-sx z)) + (set! (-> s4-0 y) 0.0) + (set! (-> s4-0 z) (- (-> s3-0 x-y-z-sx x))) + (vector-normalize! s4-0 1.0) + (quaternion-vector-angle! (the-as quaternion s5-0) s4-0 (acos (-> s3-0 x-y-z-sx y))) + (cond + ((< (-> s5-0 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-3 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-4 vf1) + ) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +(defun birth-func-set-alpha-from-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((f0-0 (-> arg1 user-float))) + (set! (-> arg2 coneradius) (* (-> arg2 coneradius) f0-0)) + ) + ) + +(defun part-tracker-track-target-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-0 *target*) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data (the int (-> arg1 user-float))))) + ) + (set! (-> arg2 x) (-> v1-2 x)) + (set! (-> arg2 y) (-> v1-2 y)) + (set! (-> arg2 z) (-> v1-2 z)) + ) + 0 + (none) + ) + +(defpartgroup group-target-hit + :id 10 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 70 :period (seconds 0.5) :length (seconds 0.017)) + (sp-item 71 :period (seconds 0.5) :length (seconds 0.017)) + ) + ) + +(defpart 71 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 128.0 128.0) + (:g 128.0 128.0) + (:b 128.0 128.0) + (:a 32.0 12.0) + (:scalevel-x (meters 0.3) (meters 0.2)) + (:scalevel-y (meters 0.00125)) + (:fade-a -0.8 -0.8) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +(defpart 70 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 64)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.7)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 16384.0) + (:func 'sparticle-track-root) + ) + ) + +(defpartgroup group-spin-hit + :id 11 + :duration (seconds 0.017) + :linger-duration (seconds 0.167) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 72 :flags (sp6))) + ) + +(defpartgroup group-punch-hit + :id 12 + :duration (seconds 0.017) + :linger-duration (seconds 0.167) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 72 :flags (sp6))) + ) + +(defpart 72 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 5)) + (:rot-x (degrees 5.625)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 196.0) + (:b 196.0) + (:a 12.0) + (:scalevel-x (meters 1)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.2) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-smack-surface + :id 13 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 74) + (sp-item 75) + (sp-item 76 :binding 73) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + ) + ) + +(defpart 74 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-copy-target-y-rot) + (:num 16.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0 32.0) + (:b 96.0 32.0) + (:a 32.0 32.0) + (:vel-y (meters 0.04) (meters 0.02)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 75 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-copy-target-y-rot) + (:num 8.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0 32.0) + (:b 96.0 32.0) + (:a 32.0 32.0) + (:vel-y (meters 0.08) (meters 0.02)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 76 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 12.0 8.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:a 0.0) + (:timer (seconds 2.015)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 9.0) + (:func 'part-tracker-track-target-joint) + ) + ) + +(defpart 73 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -1.3333334) (meters 2.6666667)) + (:z (meters 0.5) (meters 0.5)) + (:scale-x (meters 0.1) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 32.0 96.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0.0033333334)) + (:fade-a -0.30476192) + (:timer (seconds 2.015)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +(defpartgroup group-land-poof-san + :id 14 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 77) (sp-item 78) (sp-item 79)) + ) + +(defpart 77 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 78 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 79 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00066666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-land-poof-drt + :id 15 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 80) (sp-item 81) (sp-item 82)) + ) + +(defpart 80 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 81 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 82 + :init-specs ((:texture (rockbit07 level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00066666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-land-poof-snw + :id 16 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 83) (sp-item 84) (sp-item 85)) + ) + +(defpart 83 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 196.0 64.0) + (:b 196.0 64.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 84 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 196.0 64.0) + (:b 196.0 64.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 85 + :init-specs ((:texture (middot level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00066666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-land-poof-ice + :id 17 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 83) (sp-item 84) (sp-item 85)) + ) + +(defpartgroup group-land-poof-grs + :id 18 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 86) (sp-item 87) (sp-item 88)) + ) + +(defpart 86 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 87 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 88 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-land-poof-for + :id 19 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 89) (sp-item 90) (sp-item 91)) + ) + +(defpart 89 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 90 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 91 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-land-droppings-for) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defun spt-birth-func-part-land-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 (the-as sparticle-launchinfo arg2)) + (none) + ) + +(defpartgroup group-land-poof-wod + :id 20 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 92) (sp-item 93)) + ) + +(defpart 92 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 93 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-land-poof-cwd + :id 21 + :duration (seconds 0.017) + :linger-duration (seconds 2.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 92) (sp-item 93) (sp-item 94) (sp-item 94)) + ) + +(when *debug-segment* +(defpartgroup group-land-poof-unk + :id 22 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 95) (sp-item 96)) + ) + +(defpart 95 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-clean) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 96.0) + (:a 255.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 96 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-clean) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +) +(defpartgroup group-land-poof-stn + :id 23 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 97) (sp-item 98)) + ) + +(defpart 97 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 98 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-land-poof-pmt + :id 24 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 99) (sp-item 100)) + ) + +(defpart 99 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 24.0 24.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 100 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(when *debug-segment* +(defpartgroup group-run-poof-unk + :id 25 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 101)) + ) + +(defpartgroup group-just-poof-unk + :id 26 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 101)) + ) + +(defpart 101 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-clean) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 32.0) + (:a 255.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.45714286) + (:friction 0.965) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +) +(defpartgroup group-run-poof-stn + :id 27 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 102)) + ) + +(defpartgroup group-just-poof-stn + :id 28 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 102)) + ) + +(defpart 102 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-run-poof-snw + :id 29 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103) (sp-item 104 :flags (is-3d))) + ) + +(defpartgroup group-just-poof-snw + :id 30 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103)) + ) + +(defpartgroup group-just-footprint-snw + :id 31 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 104 :flags (is-3d))) + ) + +(defpart 104 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 64.0) + (:fade-a -0.07111111) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 103 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 196.0 64.0) + (:b 196.0 64.0) + (:a 24.0 24.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-run-poof-ice + :id 32 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103)) + ) + +(defpartgroup group-just-poof-ice + :id 33 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103)) + ) + +(defpartgroup group-run-poof-cwd + :id 34 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 105) (sp-item 105) (sp-item 94)) + ) + +(defpartgroup group-just-poof-cwd + :id 35 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 106)) + ) + +(defpart 94 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:y (meters -1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 0.0) + (:vel-y (meters 0) (meters -0.0033333334)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:accel-y (meters -0.00006666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.25) (seconds 0.247)) + (:next-launcher 107) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 3)) + ) + ) + +(defpart 107 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.5) (seconds 0.497)) (:next-launcher 108)) + ) + +(defpart 108 + :init-specs ((:fade-a -0.08)) + ) + +(defpartgroup group-run-poof-wod + :id 36 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 105)) + ) + +(defpartgroup group-just-poof-wod + :id 37 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 105)) + ) + +(defpart 105 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-run-poof-pmt + :id 38 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 109)) + ) + +(defpartgroup group-just-poof-pmt + :id 39 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 109)) + ) + +(defpart 109 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-run-poof-grs + :id 40 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 110) (sp-item 111 :flags (is-3d))) + ) + +(defpartgroup group-just-poof-grs + :id 41 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 110)) + ) + +(defpartgroup group-just-footprint-grs + :id 42 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 111 :flags (is-3d))) + ) + +(defpart 110 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 111 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 48.0) + (:fade-a -0.053333335) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-run-poof-for + :id 43 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 112) (sp-item 113 :flags (is-3d))) + ) + +(defpartgroup group-just-poof-for + :id 44 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 110)) + ) + +(defpartgroup group-just-footprint-for + :id 45 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 111 :flags (is-3d))) + ) + +(defpart 112 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 113 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 48.0) + (:fade-a -0.053333335) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-run-poof-san + :id 46 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 106) (sp-item 114 :flags (is-3d))) + ) + +(defpartgroup group-just-poof-san + :id 47 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 106)) + ) + +(defpartgroup group-just-footprint-san + :id 48 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 114 :flags (is-3d))) + ) + +(defpart 106 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 114 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-run-poof-drt + :id 49 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 115)) + ) + +(defpartgroup group-just-poof-drt + :id 50 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 115)) + ) + +(defpartgroup group-just-footprint-drt + :id 51 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 116 :flags (is-3d))) + ) + +(defpart 115 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 116 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 117 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 0.0 6.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:rotate-z (degrees 0) (degrees 360)) + ) + ) + +(defpart 118 + :init-specs ((:texture (rockbit15 level-default-sprite)) + (:num 0.0 6.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 119 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 0.0 2.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 96.0 32.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 120 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-droppings-for) + (:num 0.0 0.5) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + ) + ) + +(defun spt-birth-func-part-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for arg0 arg1 (the-as sprite-vec-data-2d arg2) arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2) + (none) + ) + +(defpart 121 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 6.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 64.0 64.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-slide-poof-san + :id 52 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 122) (sp-item 123)) + ) + +(defpart 122 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 123 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-slide-poof-drt + :id 53 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 124) (sp-item 125)) + ) + +(defpart 124 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 125 + :init-specs ((:texture (rockbit15 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-slide-poof-grs + :id 54 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 126) (sp-item 127)) + ) + +(defpart 126 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 127 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defpartgroup group-slide-poof-for + :id 55 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 128) (sp-item 129)) + ) + +(defpart 128 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 129 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-slide-droppings-for) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +(defun spt-birth-func-part-slide-droppings-for ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for + (the-as sparticle-system arg0) + arg1 + (the-as sprite-vec-data-2d arg2) + arg3 + arg4 + ) + (birth-func-texture-group-2d arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-slide-poof-stn + :id 56 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 130)) + ) + +(defpart 130 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-slide-poof-pmt + :id 57 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 131)) + ) + +(defpart 131 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-slide-poof-snw + :id 58 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 132)) + ) + +(defpart 132 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-slide-poof-ice + :id 59 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 132)) + ) + +(defpartgroup group-slide-poof-wod + :id 60 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 133)) + ) + +(defpart 133 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpartgroup group-slide-poof-cwd + :id 61 + :duration (seconds 0.017) + :linger-duration (seconds 2.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 133)) + ) + +(defpart 134 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 135 + :init-specs ((:texture (rockbit15 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 136 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 64.0 64.0) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 137 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 138 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-jump-droppings-for) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + ) + ) + +(defun spt-birth-func-part-jump-droppings-for ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for + (the-as sparticle-system arg0) + arg1 + (the-as sprite-vec-data-2d arg2) + arg3 + arg4 + ) + (birth-func-texture-group-2d arg0 arg1 arg2) + (none) + ) + +(defpart 139 + ) + +(defpart 140 + ) + +(defpart 141 + ) + +(defpart 142 + ) + +(defpartgroup group-dark-eco-death + :id 62 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 145 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 143) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 146 :period (seconds 2) :length (seconds 0.017)) + (sp-item 147 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135)) + (sp-item 148 :period (seconds 2) :length (seconds 0.067)) + ) + ) + +(defpartgroup group-slime-death + :id 63 + :linger-duration (seconds 3) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 149 :period (seconds 10) :length (seconds 1.667)) + (sp-item 150 :period (seconds 10) :length (seconds 3)) + ) + ) + +(defpart 149 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 0.8) + (:scale-x (meters -1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 200.0) + (:b 200.0) + (:a 0.0) + (:omega (degrees 0.225)) + (:vel-y (meters 0.06666667)) + (:scalevel-x (meters 0.01) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32 0.32) + (:accel-y (meters 0.0016666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.167)) + (:next-launcher 151) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 151 + :init-specs ((:fade-a -0.10666667 -0.10666667) (:func 'none)) + ) + +(defpart 150 + :init-specs ((:texture (mud-bubble ctywide-sprite)) + (:num 4.0) + (:x (meters 0.2) (meters 1.5)) + (:y (meters 0)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 80.0 40.0) + (:g 110.0) + (:b 60.0) + (:a 128.0) + (:scalevel-x (meters 0.00066666666) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.167) (seconds 0.33)) + (:flags ()) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-lava-death + :id 64 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 152) (sp-item 153) (sp-item 154) (sp-item 155)) + ) + +(defpartgroup group-explode-death + :id 65 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 153) (sp-item 154)) + ) + +(defpartgroup group-burn-death + :id 66 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 152)) + ) + +(defpart 155 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0 128.0) + (:a 128.0 128.0) + (:vel-y (meters 0.013333334) (meters 0.04)) + (:scalevel-x (meters -0.0023333333)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0013333333)) + (:timer (seconds 1.2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 1)) + ) + ) + +(defpart 152 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:x (meters 0) (meters 0.5)) + (:y (meters 0) (meters 3)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 32.0 64.0) + (:vel-y (meters 0.053333335) (meters 0.053333335)) + (:scalevel-x (meters 0.023529412)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.5058824) + (:friction 0.98) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 153 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 32.0) + (:x (meters 0.5) (meters 2)) + (:y (meters 0.5) (meters 0.5)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 32.0 64.0) + (:vel-y (meters 0) (meters 0.0016666667)) + (:scalevel-x (meters 0.04444444)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.8444443) + (:friction 0.98) + (:timer (seconds 0.14)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 154 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:scalevel-x (meters 0.008888889)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.56666666) + (:fade-g -0.56666666) + (:fade-b -0.56666666) + (:fade-a 0.15) + (:friction 0.97) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.27) (seconds 0.267)) + (:next-launcher 156) + (:conerot-x (degrees 0) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 156 + :init-specs ((:fade-a -0.08)) + ) + +(defpart 157 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 32.0 32.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:friction 0.98) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.05) (seconds 0.197)) + (:next-launcher 158) + ) + ) + +(defpart 158 + :init-specs ((:fade-a -0.28444445)) + ) + +(defbehavior process-drawable-burn-effect target ((arg0 time-frame)) + (sound-play "get-burned") + (let ((s5-1 (new 'stack 'rgbaf)) + (s3-0 (current-time)) + (s4-1 (-> self parent)) + ) + (set! (-> s5-1 quad) (-> (the-as process-drawable (-> s4-1 0)) draw color-mult quad)) + (let ((s2-1 (vector-float*! (the-as vector (new 'stack 'rgbaf)) (the-as vector s5-1) 0.0))) + (while (not (time-elapsed? s3-0 arg0)) + (let ((v1-8 (- (current-time) s3-0))) + (if (< v1-8 (the-as time-frame (/ arg0 2))) + (vector-lerp! + (-> (the-as process-drawable (-> s4-1 0)) draw color-mult) + s5-1 + s2-1 + (/ (the float v1-8) (the float arg0)) + ) + (vector-lerp! + (-> (the-as process-drawable (-> s4-1 0)) draw color-mult) + s5-1 + s2-1 + (- 1.0 (/ (the float v1-8) (the float arg0))) + ) + ) + ) + (let ((v1-13 (process-drawable-random-point! + (the-as process-drawable (ppointer->process s4-1)) + (new 'stack-no-clear 'vector) + ) + ) + (t9-7 sp-launch-particles-var) + (a0-18 *sp-particle-system-2d*) + (a1-7 (-> *part-id-table* 157)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> v1-13 quad)) + (t9-7 a0-18 a1-7 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (suspend) + 0 + ) + ) + (let ((v0-8 (-> (the-as process-drawable (-> s4-1 0)) draw color-mult))) + (set! (-> v0-8 quad) (-> s5-1 quad)) + v0-8 + ) + ) + ) + +(defpart 159 + :init-specs ((:texture (gun-blue-puffs level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:y (meters 0.02)) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 110.0 32.0) + (:g 128.0 32.0) + (:b 96.0 32.0) + (:a 8.0 40.0) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata -8192.0) + ) + ) + +(defpart 160 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.017)) + (:next-launcher 161) + ) + ) + +(defpart 161 + :init-specs ((:scale-x (meters 0.2) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 24.0 32.0) + (:next-time (seconds 0.017)) + (:next-launcher 161) + ) + ) + +(defpartgroup group-lightning-glow + :id 67 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 162 :flags (sp6)) (sp-item 163 :flags (sp6))) + ) + +(defpart 162 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 32.0 96.0) + (:b 128.0 128.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 2)) + ) + ) + +(defpart 163 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 6.0 12.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defpartgroup group-lightning-green-glow + :id 68 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 164 :flags (sp6)) (sp-item 165 :flags (sp6))) + ) + +(defpart 164 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 128.0 128.0) + (:b 32.0 96.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 2)) + ) + ) + +(defpart 165 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 128.0 128.0) + (:b 32.0 96.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defpartgroup group-lightning-red-glow + :id 69 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 166 :flags (sp6)) (sp-item 167 :flags (sp6))) + ) + +(defpart 166 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b 0.0 32.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 2)) + ) + ) + +(defpart 167 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b 0.0 32.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +(defun lightning-probe-callback ((arg0 lightning-tracker)) + (let ((v1-1 (+ (-> arg0 user-time 0) 1))) + (set! (-> arg0 user-time 0) v1-1) + (when (= v1-1 (seconds 0.007)) + (let* ((v1-2 (rand-vu-int-range 64 128)) + (v0-3 (logior (logior (logior #x800000 v1-2) (* v1-2 256)) (shl (rand-vu-int-range 32 64) 24))) + (v1-6 (-> arg0 lightning state)) + ) + (set! (-> v1-6 start-color) (the-as rgba v0-3)) + (set! (-> v1-6 end-color) (the-as rgba v0-3)) + ) + ) + ) + (none) + ) + +(format 0 "SKIP: target-part remove lightning specs~%") +;; (set! (-> *lightning-spec-id-table* 1) (new 'static 'lightning-spec +;; :name "lightning-shock" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3f :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 16384.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 2048.0 +;; :duration 30.0 +;; :sound (static-sound-spec "shock" :group 1) +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 2) (new 'static 'lightning-spec +;; :name "lightning-shock-dim" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3f :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 16384.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 2048.0 +;; :duration 30.0 +;; :sound (static-sound-spec "shock" :group 1) +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 3) (new 'static 'lightning-spec +;; :name "lightning-shock-red" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x40 :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 16384.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 2048.0 +;; :duration 30.0 +;; :sound (static-sound-spec "shock" :group 1) +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 4) (new 'static 'lightning-spec +;; :name "lightning-shock-green" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3b :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 16384.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 2048.0 +;; :duration 30.0 +;; :sound (static-sound-spec "shock" :group 1) +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 5) (new 'static 'lightning-spec +;; :name "lightning-dark" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3a :page #x4) +;; :reduction 0.52 +;; :num-points 32 +;; :box-size 16384.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 1228.8 +;; :duration 30.0 +;; :sound (static-sound-spec "shock" :group 1) +;; ) +;; ) + +(defpartgroup group-lightning-dark-shot-tip-hit-replace + :id 70 + :duration (seconds 0.017) + :linger-duration (seconds 0.085) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 168 :flags (sp7) :period (seconds 10) :length (seconds 0.017))) + ) + +(defpart 168 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0 3.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters 0.01) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.7) + (:friction 0.99) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-lightning-2d-spline-align-plus-rotz) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun process-drawable-shock-effect-replace ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 int) + (arg4 int) + (arg5 float) + ) + (local-vars + (sv-640 (pointer process)) + (sv-720 float) + (sv-736 int) + (sv-752 matrix) + (sv-768 collide-query) + (sv-784 symbol) + (sv-800 vector) + (sv-816 int) + (sv-832 process) + ) + (set! sv-720 arg5) + (let ((s5-0 *lightning-probe-vars*)) + (if (= arg3 256) + (set! sv-736 arg3) + (set! sv-736 (rand-vu-int-range 3 (/ (+ (-> arg0 node-list length) -1) 2))) + ) + (set! sv-752 (new 'stack-no-clear 'matrix)) + (set! sv-768 (new 'stack-no-clear 'collide-query)) + (set! sv-784 (the-as symbol #f)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> *up-vector* quad)) + (when (nonzero? arg3) + (set! sv-736 arg3) + sv-736 + ) + (if (= arg3 256) + (set! (-> sv-768 start-pos quad) (-> arg0 root trans quad)) + (vector<-cspace! (-> sv-768 start-pos) (-> arg0 node-list data sv-736)) + ) + (set! sv-800 (-> sv-768 move-dist)) + (set! (-> sv-800 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-800 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-800 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-800 w) 1.0) + (matrix-rotate-zyx! sv-752 (-> sv-768 move-dist)) + (set! sv-816 6) + (while (nonzero? sv-816) + (set! sv-816 (+ sv-816 -1)) + (vector-rotate*! (-> sv-768 move-dist) (-> s5-0 probe-dirs sv-816) sv-752) + (vector-normalize! (-> sv-768 move-dist) sv-720) + (let ((v1-31 sv-768)) + (set! (-> v1-31 radius) 409.6) + (set! (-> v1-31 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) + (set! (-> v1-31 ignore-process0) arg0) + (set! (-> v1-31 ignore-process1) #f) + (set! (-> v1-31 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-31 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-768) 0.0) + (set-time! (-> s5-0 last-valid-time)) + (set! (-> s5-0 src-joint-index) (the-as uint sv-736)) + (set! (-> s5-0 end-pos quad) (-> sv-768 best-other-tri intersect quad)) + (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-768 start-pos))) + (set! (-> gp-0 quad) (-> sv-768 best-other-tri normal quad)) + (set! sv-784 #t) + (goto cfg-15) + ) + ) + ) + (label cfg-15) + (when sv-784 + (let* ((a0-24 *default-dead-pool*) + (t9-10 (method-of-object a0-24 get-process)) + (a1-14 lightning-tracker) + (a2-2 (the-as object #x4000)) + (a3-1 0) + ) + (set! sv-832 (t9-10 a0-24 a1-14 (the-as int a2-2) a3-1)) + (set! sv-640 + (when sv-832 + (let ((t9-11 (method-of-type lightning-tracker activate))) + (t9-11 (the-as lightning-tracker sv-832) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (set! a2-2 arg1) + (set! a3-1 arg4) + (run-now-in-process + sv-832 + lightning-tracker-init + (the-as lightning-spec a2-2) + a3-1 + arg2 + arg0 + (if (= arg3 256) + (-> arg0 root trans) + (-> s5-0 src-joint-index) + ) + (-> s5-0 end-pos) + ) + (-> sv-832 ppointer) + ) + ) + (when sv-640 + (set! (-> (the-as lightning-tracker (-> sv-640 0)) user-time 0) 0) + (let ((v1-63 (get-field-spec-by-id (-> *part-id-table* 168) (sp-field-id spt-timer)))) + (if v1-63 + (set! (-> v1-63 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> sv-640 0)) duration))) + ) + ) + (let ((s4-1 (matrix-u-compose (new 'stack-no-clear 'matrix) gp-0 (the-as vector a2-2) (the-as vector a3-1)))) + (set! (-> s4-1 trans quad) (-> s5-0 end-pos quad)) + (vector+float*! (-> s4-1 trans) (-> s4-1 trans) gp-0 409.6) + (if (logtest? (-> *part-group-id-table* 70 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 70) + :mat-joint s4-1 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 70) :mat-joint s4-1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defun process-drawable-shock-effect ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 sparticle-launcher) + (arg4 int) + (arg5 int) + (arg6 float) + ) + (local-vars + (sv-624 (pointer process)) + (sv-640 float) + (sv-656 int) + (sv-672 matrix) + (sv-688 collide-query) + (sv-704 symbol) + (sv-720 vector) + (sv-736 int) + (sv-752 process) + ) + (set! sv-640 arg6) + (when (or (= arg4 256) (and (nonzero? (-> arg0 node-list)) (> (-> arg0 node-list length) 0))) + (let ((s5-0 *lightning-probe-vars*)) + (if (= arg4 256) + (set! sv-656 arg4) + (set! sv-656 (rand-vu-int-range 3 (/ (+ (-> arg0 node-list length) -1) 2))) + ) + (set! sv-672 (new 'stack-no-clear 'matrix)) + (set! sv-688 (new 'stack-no-clear 'collide-query)) + (set! sv-704 (the-as symbol #f)) + (when (nonzero? arg4) + (set! sv-656 arg4) + sv-656 + ) + (if (= arg4 256) + (set! (-> sv-688 start-pos quad) (-> arg0 root trans quad)) + (vector<-cspace! (-> sv-688 start-pos) (-> arg0 node-list data sv-656)) + ) + (set! sv-720 (-> sv-688 move-dist)) + (set! (-> sv-720 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 w) 1.0) + (matrix-rotate-zyx! sv-672 (-> sv-688 move-dist)) + (set! sv-736 6) + (while (nonzero? sv-736) + (set! sv-736 (+ sv-736 -1)) + (vector-rotate*! (-> sv-688 move-dist) (-> s5-0 probe-dirs sv-736) sv-672) + (vector-normalize! (-> sv-688 move-dist) sv-640) + (let ((v1-35 sv-688)) + (set! (-> v1-35 radius) 409.6) + (set! (-> v1-35 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) + (set! (-> v1-35 ignore-process0) arg0) + (set! (-> v1-35 ignore-process1) #f) + (set! (-> v1-35 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-35 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) + (set-time! (-> s5-0 last-valid-time)) + (set! (-> s5-0 src-joint-index) (the-as uint sv-656)) + (set! (-> s5-0 end-pos quad) (-> sv-688 best-other-tri intersect quad)) + (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-688 start-pos))) + (set! sv-704 #t) + (goto cfg-21) + ) + ) + ) + (label cfg-21) + (when sv-704 + (set! sv-752 (get-process *default-dead-pool* lightning-tracker #x4000 0)) + (set! sv-624 + (when sv-752 + (let ((t9-11 (method-of-type lightning-tracker activate))) + (t9-11 (the-as lightning-tracker sv-752) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (run-now-in-process + sv-752 + lightning-tracker-init + arg1 + arg5 + arg2 + arg0 + (if (= arg4 256) + (-> arg0 root trans) + (-> s5-0 src-joint-index) + ) + (-> s5-0 end-pos) + ) + (-> sv-752 ppointer) + ) + ) + (when sv-624 + (set! (-> (the-as lightning-tracker (-> sv-624 0)) user-time 0) 0) + (when arg3 + (let ((v1-66 (get-field-spec-by-id arg3 (sp-field-id spt-timer)))) + (if v1-66 + (set! (-> v1-66 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> sv-624 0)) duration))) + ) + ) + (let ((t9-14 sp-launch-particles-var) + (a0-30 *sp-particle-system-2d*) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (t9-14 a0-30 arg3 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + ) + 0 + ) + +(defun process-drawable2-shock-effect ((arg0 process-drawable) + (arg1 process-drawable) + (arg2 lightning-spec) + (arg3 (function lightning-tracker none)) + (arg4 sparticle-launcher) + ) + (local-vars (sv-16 int) (sv-64 vector) (sv-68 vector) (sv-72 (pointer process))) + (when (and (nonzero? (-> arg0 skel)) (nonzero? (-> arg1 skel))) + (let* ((v1-7 (-> arg0 draw lod-set lod (-> arg0 draw lod-set max-lod) geo length)) + (s0-0 (-> arg1 draw lod-set lod (-> arg1 draw lod-set max-lod) geo length)) + (s1-0 (rand-vu-int-range 3 (+ v1-7 -1))) + ) + (set! sv-16 (rand-vu-int-range 3 (+ s0-0 -1))) + (set! sv-64 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data s1-0))) + (set! sv-68 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg1 node-list data sv-16))) + (set! sv-72 (process-spawn + lightning-tracker + :init lightning-tracker-init + arg2 + 0 + arg3 + arg0 + s1-0 + sv-16 + :name "lightning-tracker" + :to arg1 + :unk 0 + ) + ) + ) + (when (and arg4 sv-72) + (let ((v1-19 (get-field-spec-by-id arg4 (sp-field-id spt-timer)))) + (if v1-19 + (set! (-> v1-19 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> sv-72 0)) duration))) + ) + ) + (let ((t9-8 sp-launch-particles-var) + (a0-20 *sp-particle-system-2d*) + (a1-14 arg4) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> sv-64 quad)) + (t9-8 a0-20 a1-14 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-9 sp-launch-particles-var) + (a0-21 *sp-particle-system-2d*) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> sv-68 quad)) + (t9-9 a0-21 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + 0 + (none) + ) + +(format 0 "SKIP: target-part remove lightning specs 2~%") +;; (set! (-> *lightning-spec-id-table* 6) (new 'static 'lightning-spec +;; :name "lightning-shock-skel" +;; :flags (lightning-spec-flags lsf0) +;; :rand-func #x2 +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :fade-time 120.0 +;; :texture (new 'static 'texture-id :index #x3f :page #x4) +;; :reduction 0.5 +;; :num-points 32 +;; :box-size 6144.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 2048.0 +;; :duration 30.0 +;; :sound #f +;; ) +;; ) + +;; WARN: new jak 2 until loop case, check carefully +;; WARN: new jak 2 until loop case, check carefully +(defun process-drawable-shock-skel-effect ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 sparticle-launcher) + (arg4 float) + (arg5 int) + (arg6 int) + ) + (local-vars + (sv-416 int) + (sv-432 vector) + (sv-448 vector) + (sv-464 vector) + (sv-480 quaternion) + (sv-496 vector) + (sv-512 matrix) + (sv-528 vector) + (sv-544 vector) + (sv-560 process) + (sv-576 int) + (sv-592 (function lightning-control int vector none)) + (sv-608 lightning-control) + (sv-624 int) + (sv-640 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (-> arg0 draw lod-set lod (-> arg0 draw cur-lod) geo length))) + (set! sv-416 (rand-vu-int-range 4 (+ s1-0 -1))) + (let ((s1-1 (rand-vu-int-range 4 (+ s1-0 -1)))) + (when (!= arg5 -1) + (set! sv-416 arg5) + sv-416 + ) + (if (!= arg6 -1) + (set! s1-1 arg6) + ) + (-> arg0 node-list data sv-416) + (let ((s0-1 (-> arg0 node-list data sv-416)) + (a0-9 (-> arg0 node-list data s1-1)) + (v1-18 #t) + ) + (until #f + (let ((a1-3 a0-9)) + (until #f + (cond + ((and (-> a1-3 joint) (>= (-> a1-3 joint number) 2)) + (when (= s0-1 a1-3) + #t + (goto cfg-24) + ) + (set! a1-3 (-> a1-3 parent)) + ) + (else + (set! s0-1 (-> s0-1 parent)) + (when (or (not (-> s0-1 joint)) (< (-> s0-1 joint number) 2)) + (set! v1-18 #f) + (goto cfg-24) + ) + (goto cfg-23) + ) + ) + ) + ) + #f + (label cfg-23) + ) + #f + (label cfg-24) + (when v1-18 + (let ((s5-1 (the-as (array cspace) (new 'stack 'boxed-array cspace 32)))) + (let ((v1-21 0)) + (set! (-> s5-1 length) 0) + (let ((a1-12 (-> arg0 node-list data sv-416)) + (a0-19 (-> arg0 node-list data s1-1)) + ) + (set! (-> s5-1 (-> s5-1 length)) a1-12) + (+! (-> s5-1 length) 1) + (while (!= a1-12 s0-1) + (set! a1-12 (-> a1-12 parent)) + (set! (-> s5-1 (-> s5-1 length)) a1-12) + (+! (-> s5-1 length) 1) + ) + (while (!= a0-19 s0-1) + (set! a0-19 (-> a0-19 parent)) + (+! (-> s5-1 length) 1) + ) + ) + (let ((a0-23 (-> arg0 node-list data s1-1))) + (while (!= a0-23 s0-1) + (let ((a1-18 (-> a0-23 parent))) + (+! v1-21 1) + (set! (-> s5-1 (- (-> s5-1 length) v1-21)) a0-23) + (set! a0-23 a1-18) + ) + ) + ) + ) + (when (< 2 (-> s5-1 length)) + (let ((s1-2 (new 'stack-no-clear 'vector))) + (set! sv-512 (new 'stack-no-clear 'matrix)) + (let ((s0-2 (new 'stack-no-clear 'vector))) + (set! sv-432 (new 'stack-no-clear 'vector)) + (set! sv-448 (new 'stack-no-clear 'vector)) + (set! sv-464 (new 'stack-no-clear 'vector)) + (set! sv-480 (new 'stack-no-clear 'quaternion)) + (set! sv-496 s1-2) + (set! (-> sv-496 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-496 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-496 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-496 w) 1.0) + (matrix-rotate-zyx! sv-512 s1-2) + (vector-rotate*! sv-448 *up-vector* sv-512) + (vector<-cspace! sv-432 (-> s5-1 0)) + (set! sv-544 s0-2) + (set! sv-528 (vector<-cspace! (new 'stack-no-clear 'vector) (-> s5-1 0))) + (let ((v0-10 (vector<-cspace! (new 'stack-no-clear 'vector) (-> s5-1 1)))) + (.lvf vf4 (&-> sv-528 quad)) + (.lvf vf5 (&-> v0-10 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-544 quad) vf6) + (vector-normalize! s0-2 1.0) + (set! sv-560 (get-process *default-dead-pool* lightning-tracker #x4000 0)) + (let ((a0-35 (when sv-560 + (let ((t9-13 (method-of-type lightning-tracker activate))) + (t9-13 (the-as lightning-tracker sv-560) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (run-now-in-process sv-560 lightning-tracker-init arg1 0 arg2 arg0 #f #f) + (-> sv-560 ppointer) + ) + ) + ) + (when a0-35 + (set! (-> (the-as lightning-tracker (-> a0-35 0)) user-time 0) 0) + (let ((s4-1 (-> (the-as lightning-tracker (-> a0-35 0)) lightning)) + (s3-1 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 state points-to-draw) 0) + (let ((a1-32 s3-1)) + (let ((v1-44 sv-432)) + (let ((a0-38 sv-448)) + (let ((a2-30 arg4)) + (.mov vf7 a2-30) + ) + (.lvf vf5 (&-> a0-38 quad)) + ) + (.lvf vf4 (&-> v1-44 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-32 quad) vf6) + ) + (set-point! s4-1 (-> s4-1 state points-to-draw) s3-1) + (+! (-> s4-1 state points-to-draw) 1) + (set! sv-576 0) + (while (< sv-576 (+ (-> s5-1 length) -1)) + (set! sv-640 (new 'stack-no-clear 'vector)) + (vector<-cspace! sv-640 (-> s5-1 (+ sv-576 1))) + (vector-! sv-464 sv-640 sv-432) + (vector-normalize! sv-464 1.0) + (quaternion-from-two-vectors! sv-480 s0-2 sv-464) + (vector-orient-by-quat! s1-2 sv-448 sv-480) + (set! (-> s1-2 quad) (-> sv-448 quad)) + (let ((a1-40 s2-1)) + (let ((v1-56 sv-640)) + (let ((a0-47 s1-2)) + (let ((a2-34 arg4)) + (.mov vf7 a2-34) + ) + (.lvf vf5 (&-> a0-47 quad)) + ) + (.lvf vf4 (&-> v1-56 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-40 quad) vf6) + ) + (set! sv-608 s4-1) + (set! sv-592 (method-of-object sv-608 set-point!)) + (set! sv-624 (-> s4-1 state points-to-draw)) + (let ((a2-36 (vector-average! (new 'stack-no-clear 'vector) s2-1 s3-1))) + (sv-592 sv-608 sv-624 a2-36) + ) + (+! (-> s4-1 state points-to-draw) 1) + (set-point! s4-1 (-> s4-1 state points-to-draw) s2-1) + (+! (-> s4-1 state points-to-draw) 1) + (set! (-> s3-1 quad) (-> s2-1 quad)) + (set! (-> s0-2 quad) (-> sv-464 quad)) + (set! (-> sv-448 quad) (-> s1-2 quad)) + (set! (-> sv-432 quad) (-> sv-640 quad)) + (set! sv-576 (+ sv-576 1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defpartgroup group-darkjak-bomb + :id 71 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 169 :period (seconds 10) :length (seconds 0.167)) + (sp-item 170 :period (seconds 10) :length (seconds 0.017)) + (sp-item 171 :flags (sp6) :period (seconds 10) :length (seconds 0.017)) + ) + ) + +(defpart 169 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 3.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 128.0 128.0) + (:a 16.0) + (:scalevel-x (meters 0.53333336) (meters 0.53333336)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.45714286) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 170 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 128.0 128.0) + (:a 24.0) + (:scalevel-x (meters 0.34285715)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.117)) + (:next-launcher 172) + ) + ) + +(defpart 172 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.05625)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.875) + (:fade-b 0.0) + (:fade-a -0.15) + ) + ) + +(defpart 171 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 1.6)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-darkjak-transform + :id 72 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 169 :period (seconds 10) :length (seconds 0.167)) + (sp-item 170 :period (seconds 10) :length (seconds 0.017)) + (sp-item 171 :period (seconds 10) :length (seconds 0.017)) + ) + ) + +(format 0 "SKIP: target-part remove lightning specs 3~%") +;; (set! (-> *lightning-spec-id-table* 7) (new 'static 'lightning-spec +;; :name "lightning-darkjak-transform" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3a :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 8192.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 1638.4 +;; :duration 30.0 +;; :duration-rand 90.0 +;; :sound (static-sound-spec "transform-zap" :group 1) +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 8) (new 'static 'lightning-spec +;; :name "lightning-darkjak-pill" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3a :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 8192.0 +;; :merge-factor 0.5 +;; :merge-count 2 +;; :radius 1638.4 +;; :duration 30.0 +;; :duration-rand 90.0 +;; :sound (static-sound-spec "transform-zap" :group 1) +;; :delay 60.0 +;; :delay-rand 120.0 +;; ) +;; ) + +(define *lightning-darkjak-pill* (the lightning-spec #f)) + +(defpart 173 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.15)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 8.0 12.0) + (:omega (degrees 0.225)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.26666668) + (:friction 0.99 0.005) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-darkjak-smack-trail + :id 73 + :flags (sp0 sp4 sp13) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 174 :flags (sp7))) + ) + +(defpart 174 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.64) + (:fade-b -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-darkjak-smack + :id 74 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 175 :flags (sp3 sp7) :period (seconds 10) :length (seconds 0.017))) + ) + +(defpart 175 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 50.0) + (:y (meters 0) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 200.0) + (:a 1.0) + (:omega (degrees 0.1125)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.006666667) + (:accel-z (meters 0.0026666666)) + (:friction 1.1) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-darkjak-smack-charge + :id 75 + :flags (sp12) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 176 :flags (sp6)) (sp-item 177 :flags (sp6)) (sp-item 178)) + ) + +(defpart 176 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 50.0 10.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1.0) + ) + ) + +(defpart 177 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.01)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 5.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 1.0) + ) + ) + +(defpart 178 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.42666668) + (:fade-a 0.4) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 1.0) + (:func 'spt-func-relative-pos) + ) + ) + +(defpartgroup group-darkjak-smack-wall-explode + :id 76 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 179 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 180 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.667)) + (sp-item 181 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.667)) + ) + ) + +(defpart 179 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 100.0) + (:x (meters 0.1) (meters 0.1)) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 16.0 1 84.0) + (:g 0.0 1 100.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters 0.3) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:fade-r -0.16666667) + (:fade-g -0.6666667) + (:fade-a -0.85) + (:friction 0.83) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.25)) + (:next-launcher 182) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 182 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.033333335) + (:fade-b -0.033333335) + (:friction 0.99) + ) + ) + +(defpart 180 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 5.0) + (:scale-x (meters 2) (meters 4)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 3)) + (:r 20.0 1 60.0) + (:g 0.0 1 80.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 181 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 4) (meters 8)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 3)) + (:r 20.0 1 60.0) + (:g 0.0 1 80.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpartgroup group-darkjak-smack-hit + :id 77 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 183 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 184 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.5)) + (sp-item 185 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.5)) + ) + ) + +(defpart 183 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 50.0) + (:x (meters 0.1) (meters 0.1)) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 80.0 1 80.0) + (:g 0.0 1 64.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters 0.1)) + (:fade-g -2.6666667) + (:fade-b -0.6666667 -0.6666667) + (:fade-a -0.85 -0.85) + (:friction 0.83) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.25)) + (:next-launcher 186) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 186 + :init-specs ((:fade-g -0.06666667) (:fade-b -0.06666667) (:friction 0.99)) + ) + +(defpart 184 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 10.0) + (:scale-x (meters 0.3) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 1)) + (:r 80.0 1 80.0) + (:g 0.0 1 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpart 185 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 3)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 1)) + (:r 80.0 1 80.0) + (:g 0.0 1 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(format 0 "SKIP: target-part remove lightning specs 4~%") +;; (set! (-> *lightning-spec-id-table* 9) (new 'static 'lightning-spec +;; :name "lightning-darkjak-local" +;; :flags (lightning-spec-flags lsf0) +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3a :page #x4) +;; :reduction 0.42 +;; :num-points 16 +;; :box-size 8192.0 +;; :merge-factor 0.6 +;; :merge-count 2 +;; :radius 1638.4 +;; :duration 30.0 +;; :duration-rand 150.0 +;; :sound (static-sound-spec "transform-zap" :group 1) +;; ) +;; ) + +;; (set! (-> *lightning-spec-id-table* 10) (new 'static 'lightning-spec +;; :name "lightning-darkjak-attack" +;; :flags (lightning-spec-flags lsf0 lsf4) +;; :adjust-distance #xa +;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) +;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) +;; :fade-start-factor 0.2 +;; :texture (new 'static 'texture-id :index #x3a :page #x4) +;; :reduction 0.42 +;; :num-points 20 +;; :box-size 8192.0 +;; :merge-factor 0.6 +;; :merge-count 2 +;; :radius 1638.4 +;; :duration 30.0 +;; :duration-rand 150.0 +;; :sound (static-sound-spec "stretched-zap" :group 1) +;; ) +;; ) + +(defpart 187 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.017)) + (:next-launcher 188) + ) + ) + +(defpart 188 + :init-specs ((:scale-x (meters 0.2) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0 55.0) + (:g 0.0 128.0) + (:b 200.0 55.0) + (:a 24.0 8.0) + (:next-time (seconds 0.017)) + (:next-launcher 188) + ) + ) + +(defpartgroup group-daxter-death-freeze + :id 78 + :flags (sp4) + :bounds (static-bspherem 0 -2 0 40) + :parts ((sp-item 189 :flags (is-3d)) (sp-item 190 :flags (is-3d))) + ) + +(defpart 189 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 1.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667)) + (:timer (seconds 5)) + (:func 'sparticle-track-root) + (:next-time (seconds 1.835)) + (:next-launcher 191) + ) + ) + +(defpart 191 + :init-specs ((:rot-x (degrees 90)) (:rotvel-x (degrees -0.6)) (:next-time (seconds 0.45)) (:next-launcher 192)) + ) + +(defpart 192 + :init-specs ((:rotvel-x (degrees 0))) + ) + +(defpart 190 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 0)) + (:scale-y (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters -0.05)) + (:timer (seconds 5)) + (:func 'sparticle-track-root) + (:next-time (seconds 1.835)) + (:next-launcher 193) + ) + ) + +(defpart 193 + :init-specs ((:rot-x (degrees 0)) (:rotvel-x (degrees -0.6)) (:next-time (seconds 0.45)) (:next-launcher 194)) + ) + +(defpart 195 + :init-specs ((:rotvel-x (degrees 0))) + ) + +(defpartgroup group-daxter-death-zap + :id 79 + :flags (sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 196) (sp-item 197) (sp-item 198)) + ) + +(defpart 196 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 10.0 5.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 197 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.4 1.0) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.92) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.035)) + (:next-launcher 199) + ) + ) + +(defpart 198 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.4 1.0) + (:scale-x (meters 0.3) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.92) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:next-time (seconds 0.035)) + (:next-launcher 199) + ) + ) + +(defpart 199 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.2) (:fade-g -0.48) (:fade-a -2.4)) + ) + +(defpartgroup group-daxter-death-zap-smoke + :id 80 + :flags (sp4) + :bounds (static-bspherem 0 -2 0 24) + :parts ((sp-item 201 :binding 200) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + ) + ) + +(defpart 201 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.39) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.00033333333)) + (:timer (seconds 2.5)) + (:flags ()) + ) + ) + +(defpart 200 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.03)) + (:scale-y (meters 0.3) (meters 0.03)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:omega (degrees 0)) + (:vel-x (meters 0.029629631)) + (:fade-a -0.08533333) + (:timer (seconds 2.5)) + (:flags (ready-to-launch sp-cpuinfo-flag-13)) + ) + ) + +(defpartgroup group-daxter-death-limb-zap + :id 81 + :flags (sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 202) (sp-item 203 :flags (sp3))) + ) + +(defpart 202 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 10.0 5.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 203 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6761.25)) + (:vel-y (meters 0.0033333334)) + (:rotvel-z (degrees 0.6)) + (:fade-a -1.28) + (:timer (seconds 0.085) (seconds 0.165)) + (:flags (glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-dark-maker-idol-eye-part + :id 82 + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 204 :flags (sp7)) (sp-item 205 :flags (sp7)) (sp-item 206 :flags (sp7))) + ) + +(defpart 204 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:x (meters 0.25)) + (:y (meters 0.1)) + (:z (meters 0.1)) + (:scale-x (meters 0)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y (meters 0)) + (:r 178.0) + (:g 100.0 30.0) + (:b 155.0) + (:a 7.0) + (:vel-y (meters 0)) + (:scalevel-x (meters 0.06) (meters 0.02)) + (:rotvel-z (degrees 0)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 206 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 1.0) + (:x (meters 2)) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 55.0) + (:b 155.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.12444445) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.835)) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defpart 205 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:x (meters -0.25)) + (:y (meters 0.1)) + (:z (meters 0.1)) + (:scale-x (meters 0)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y (meters 0)) + (:r 178.0) + (:g 100.0 30.0) + (:b 155.0) + (:a 7.0) + (:vel-y (meters 0)) + (:scalevel-x (meters 0.06) (meters 0.02)) + (:rotvel-z (degrees 0)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/engine/target/target-util.gc b/goal_src/jak3/engine/target/target-util.gc index 56f2aac4fe..7faaea1e73 100644 --- a/goal_src/jak3/engine/target/target-util.gc +++ b/goal_src/jak3/engine/target/target-util.gc @@ -1479,7 +1479,7 @@ (set! (-> s4-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s4-0 1 y))) (set! (-> s4-0 1 r) (-> *TARGET-bank* body-radius)) (let ((v1-12 gp-0)) - (set! (-> v1-12 spheres) s4-0) + (set! (-> v1-12 best-dist) (the-as float s4-0)) (set! (-> v1-12 best-other-prim) (the-as collide-shape-prim 2)) (set! (-> v1-12 collide-with) (logclear @@ -1633,12 +1633,7 @@ (set! (-> arg1 control invul2-off-time) arg0) ) ) - (let ((t9-0 (method-of-object (-> arg1 control) collide-shape-method-49))) - 2 - #x8000 - 0 - (t9-0) - ) + (modify-collide-as! (-> arg1 control) 2 (collide-spec jak-vulnerable) (collide-spec)) (logior! (-> arg1 focus-status) (focus-status ignore)) 0 (none) @@ -1660,12 +1655,7 @@ ) (when (not (logtest? (target-flags tinvuln1 tinvuln2) (-> arg0 target-flags))) (logclear! (-> arg0 draw status) (draw-control-status no-draw-bounds)) - (let ((t9-0 (method-of-object (-> arg0 control) collide-shape-method-49))) - 2 - 0 - #x8000 - (t9-0) - ) + (modify-collide-as! (-> arg0 control) 2 (collide-spec) (collide-spec jak-vulnerable)) ) 0 (none) diff --git a/goal_src/jak3/engine/target/target.gc b/goal_src/jak3/engine/target/target.gc index dec8fbeca7..e3b6c3cb4e 100644 --- a/goal_src/jak3/engine/target/target.gc +++ b/goal_src/jak3/engine/target/target.gc @@ -1385,13 +1385,13 @@ (defstate target-jump-forward (target) :event target-jump-event-handler - :enter (behavior ((arg0 float) (arg1 float)) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control mod-surface) *forward-jump-mods*) ) :exit target-exit :trans (-> target-jump trans) - :code (behavior ((arg0 float) (arg1 float)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (when (and (using-gun? self) (not (-> self gun charge-active?))) (set! (-> self gun top-anim-low-high) 0.0) (case (gun->eco (-> self gun gun-type)) @@ -3275,7 +3275,7 @@ (suspend) (ja :num! (seek! (ja-aframe 7.0 0))) ) - (go target-darkjak-bomb1) + (go target-darkjak-bomb1 arg0 arg1) ) (else (ja-no-eval :group! jakb-attack-uppercut-ja :num! (seek! (ja-aframe 7.0 0)) :frame-num (ja-aframe f30-0 0)) diff --git a/goal_src/jak3/engine/target/target2.gc b/goal_src/jak3/engine/target/target2.gc index fd5466200e..e9342a06d1 100644 --- a/goal_src/jak3/engine/target/target2.gc +++ b/goal_src/jak3/engine/target/target2.gc @@ -796,23 +796,33 @@ :event target-standard-event-handler :exit (-> target-pole-cycle exit) :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (local-vars (a2-2 (function joint-control-channel float float float float :behavior process))) (let ((f0-2 (+ 1.0 (fmin 17.0 (ja-aframe-num 0))))) (ja-no-eval :group! jakb-pole-flip-up-ja :num! (seek!) :frame-num (ja-aframe f0-2 0)) ) (until (ja-done? 0) (suspend) - (ja :num! (seek!)) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) 1.0) + (let ((t9-3 joint-control-channel-group-eval!) + (a1-3 #f) + ) + (set! a2-2 num-func-seek!) + (t9-3 a0-4 (the-as art-joint-anim a1-3) a2-2) + ) + ) ) (set-forward-vel arg2) - (go target-pole-flip-up-jump arg0 arg1) + (go target-pole-flip-up-jump arg0 arg1 (the-as symbol a2-2)) ) :post target-no-move-post ) (defstate target-pole-flip-up-jump (target) :event target-standard-event-handler - :enter (behavior ((arg0 float) (arg1 float)) - ((-> target-jump-forward enter) arg0 arg1) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + ((-> target-jump-forward enter) arg0 arg1 arg2) (set! (-> self control mod-surface) *forward-pole-jump-mods*) ) :exit target-exit @@ -820,7 +830,7 @@ ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) ) - :code (behavior ((arg0 float) (arg1 float)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (send-event *camera* 'damp-up) (ja :group! jakb-pole-jump-loop-ja :num! min) (let ((f0-1 (target-height-above-ground)) @@ -946,7 +956,7 @@ ((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) (let ((v1-25 a1-2)) - (set! (-> v1-25 spheres) (-> *collide-edge-work* world-player-leap-up-spheres)) + (set! (-> v1-25 best-dist) (the-as float (-> *collide-edge-work* world-player-leap-up-spheres))) (set! (-> v1-25 best-other-prim) (the-as collide-shape-prim 6)) (set! (-> v1-25 collide-with) (-> self control root-prim prim-core collide-with)) (set! (-> v1-25 ignore-process0) #f) @@ -1085,6 +1095,7 @@ ) :exit (-> target-edge-grab exit) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (local-vars (a2-4 (function joint-control-channel float float float float :behavior process))) (case arg2 (('ladder) (ja-channel-push! 1 (seconds 0.1)) @@ -1139,7 +1150,16 @@ (move-by-vector! (-> self control) s3-0) ) (suspend) - (ja :num! (seek!)) + (let ((a0-18 (-> self skel root-channel 0))) + (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group frames num-frames) -1))) + (set! (-> a0-18 param 1) 1.0) + (let ((t9-10 joint-control-channel-group-eval!) + (a1-7 #f) + ) + (set! a2-4 num-func-seek!) + (t9-10 a0-18 (the-as art-joint-anim a1-7) a2-4) + ) + ) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1147,7 +1167,7 @@ (set-forward-vel 16384.0) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (send-event *camera* 'damp-up) - (go target-jump-forward arg0 arg1) + (go target-jump-forward arg0 arg1 (the-as symbol a2-4)) ) :post target-no-move-post ) @@ -1749,12 +1769,7 @@ :event target-generic-event-handler :enter (behavior ((arg0 string) (arg1 handle)) (set! (-> self control anim-handle) arg1) - (let ((t9-0 (method-of-object (-> self control) collide-shape-moving-method-60))) - #x47200000 - #x47200000 - (-> self control root-prim prim-core collide-with) - (t9-0) - ) + (move-to-ground (-> self control) 40960.0 40960.0 #f (-> self control root-prim prim-core collide-with)) (logior! (-> self focus-status) (focus-status grabbed)) (set! (-> self neck flex-blend) 0.0) ) @@ -1810,13 +1825,7 @@ (move-to-point! (-> self control) a1-2) (matrix->quaternion (-> self control quat-for-control) (-> gp-0 bone transform)) (quaternion-copy! (-> self control quat) (-> self control quat-for-control)) - (let ((t9-5 (method-of-object (-> self control) collide-shape-moving-method-60))) - #x45800000 - #x47200000 - #t - (-> self control root-prim prim-core collide-with) - (t9-5) - ) + (move-to-ground (-> self control) 4096.0 40960.0 #t (-> self control root-prim prim-core collide-with)) (when (logtest? (-> self control status) (collide-status on-water)) (let ((a1-6 (new-stack-vector0))) (set! (-> a1-6 x) (-> self control trans x)) diff --git a/goal_src/jak3/engine/util/glist-h.gc b/goal_src/jak3/engine/util/glist-h.gc index 3e167b0b42..5c5ccc0f20 100644 --- a/goal_src/jak3/engine/util/glist-h.gc +++ b/goal_src/jak3/engine/util/glist-h.gc @@ -7,3 +7,72 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(deftype glst-node (structure) + ((next glst-node) + (prev glst-node) + ) + ) + + +(deftype glst-named-node (glst-node) + ((privname string) + ) + ) + + +(deftype glst-list (structure) + ((head glst-node) + (tail glst-node) + (tailpred glst-node) + (numelem int32) + ) + :pack-me + ) + + +(defun glst-next ((arg0 glst-node)) + "return the next node in the list" + (-> arg0 next) + ) + +(defun glst-prev ((arg0 glst-node)) + "return the previous node in the list" + (-> arg0 prev) + ) + +(defun glst-head ((arg0 glst-list)) + "return the start of the list" + (-> arg0 head) + ) + +(defun glst-tail ((arg0 glst-list)) + "return the tail of the list" + (-> arg0 tailpred) + ) + +(defun glst-end-of-list? ((arg0 glst-node)) + "is this node the end of the list. #t = end" + (not (-> arg0 next)) + ) + +(defun glst-start-of-list? ((arg0 glst-node)) + "is this node the start of the list. #t = start" + (not (-> arg0 prev)) + ) + +(defun glst-empty? ((arg0 glst-list)) + "is the list empty, #t = empty" + (= (-> arg0 tailpred) arg0) + ) + +(defun glst-node-name ((arg0 glst-named-node)) + (-> arg0 privname) + ) + +(defun glst-set-name! ((arg0 glst-named-node) (arg1 string)) + (set! (-> arg0 privname) arg1) + arg1 + ) diff --git a/goal_src/jak3/engine/util/glist.gc b/goal_src/jak3/engine/util/glist.gc index 1903f6d33a..ba673d1d10 100644 --- a/goal_src/jak3/engine/util/glist.gc +++ b/goal_src/jak3/engine/util/glist.gc @@ -7,3 +7,182 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) + +(defun glst-num-elements ((arg0 glst-list)) + (-> arg0 numelem) + ) + +(defun glst-remove ((arg0 glst-list) (arg1 glst-node)) + (let ((v1-0 arg1)) + "return the previous node in the list" + (let ((v1-1 (-> v1-0 prev)) + (a2-1 arg1) + ) + "return the next node in the list" + (let ((a2-2 (-> a2-1 next))) + (set! (-> v1-1 next) a2-2) + (set! (-> a2-2 prev) v1-1) + ) + ) + ) + (+! (-> arg0 numelem) -1) + arg1 + ) + +(defun glst-remove-tail ((arg0 glst-list)) + (let ((v1-0 arg0)) + "return the tail of the list" + (let* ((a1-1 (-> v1-0 tailpred)) + (v1-1 a1-1) + ) + "is this node the start of the list. #t = start" + (if (not (not (-> v1-1 prev))) + (glst-remove arg0 a1-1) + (the-as glst-node #f) + ) + ) + ) + ) + +(defun glst-remove-head ((arg0 glst-list)) + (let ((v1-0 arg0)) + "return the start of the list" + (let* ((a1-1 (-> v1-0 head)) + (v1-1 a1-1) + ) + "is this node the end of the list. #t = end" + (if (not (not (-> v1-1 next))) + (glst-remove arg0 a1-1) + (the-as glst-node #f) + ) + ) + ) + ) + +(defun glst-insert-before ((arg0 glst-list) (arg1 glst-node) (arg2 glst-node)) + (let ((v1-0 arg1)) + "return the previous node in the list" + (let ((v1-1 (-> v1-0 prev))) + (set! (-> arg2 prev) v1-1) + (set! (-> arg2 next) arg1) + (set! (-> v1-1 next) arg2) + ) + ) + (set! (-> arg1 prev) arg2) + (+! (-> arg0 numelem) 1) + arg2 + ) + +(defun glst-insert-after ((arg0 glst-list) (arg1 glst-node) (arg2 glst-node)) + (let ((v1-0 arg1)) + "return the next node in the list" + (let ((v1-1 (-> v1-0 next))) + (set! (-> arg2 prev) arg1) + (set! (-> arg2 next) v1-1) + (set! (-> v1-1 prev) arg2) + ) + ) + (set! (-> arg1 next) arg2) + (+! (-> arg0 numelem) 1) + arg2 + ) + +(defun glst-add-tail ((arg0 glst-list) (arg1 glst-node)) + (glst-insert-before arg0 (the-as glst-node (&-> arg0 tail)) arg1) + arg1 + ) + +(defun glst-add-head ((arg0 glst-list) (arg1 glst-node)) + (glst-insert-after arg0 (the-as glst-node arg0) arg1) + arg1 + ) + +(defun glst-init-list! ((arg0 glst-list)) + (set! (-> arg0 head) (the-as glst-node (&-> arg0 tail))) + (set! (-> arg0 tail) #f) + (set! (-> arg0 tailpred) (the-as glst-node (&-> arg0 head))) + (set! (-> arg0 numelem) 0) + arg0 + ) + +(defun glst-find-node-by-name ((arg0 glst-list) (arg1 string)) + (let ((v1-0 arg0)) + "return the start of the list" + (let ((s5-0 (-> v1-0 head))) + (while (let ((v1-6 s5-0)) + "is this node the end of the list. #t = end" + (not (not (-> v1-6 next))) + ) + (if (name= (-> (the-as glst-named-node s5-0) privname) arg1) + (return s5-0) + ) + "return the next node in the list" + (set! s5-0 (-> s5-0 next)) + ) + ) + ) + (the-as glst-node #f) + ) + +(defun glst-get-node-by-index ((arg0 glst-list) (arg1 int)) + (when (and (< arg1 (glst-num-elements arg0)) (>= arg1 0)) + "return the start of the list" + (let ((v1-3 (-> arg0 head))) + (dotimes (a0-3 arg1) + (nop!) + (nop!) + (nop!) + (nop!) + "return the next node in the list" + (set! v1-3 (-> v1-3 next)) + ) + (return v1-3) + ) + ) + (the-as glst-node #f) + ) + +(defun glst-length-of-longest-name ((arg0 glst-list)) + (let ((gp-0 0)) + (let ((v1-0 arg0)) + "return the start of the list" + (let ((s5-0 (-> v1-0 head))) + (while (let ((v1-6 s5-0)) + "is this node the end of the list. #t = end" + (not (not (-> v1-6 next))) + ) + (let ((v1-3 (length (-> (the-as glst-named-node s5-0) privname)))) + (if (< gp-0 v1-3) + (set! gp-0 v1-3) + ) + ) + "return the next node in the list" + (set! s5-0 (-> s5-0 next)) + ) + ) + ) + gp-0 + ) + ) + +(defun glst-get-node-index ((arg0 glst-list) (arg1 glst-node)) + (let ((v1-0 0)) + "return the start of the list" + (let ((a0-1 (-> arg0 head))) + (while (let ((a2-3 a0-1)) + "is this node the end of the list. #t = end" + (not (not (-> a2-3 next))) + ) + (if (= a0-1 arg1) + (return v1-0) + ) + (+! v1-0 1) + "return the next node in the list" + (set! a0-1 (-> a0-1 next)) + ) + ) + ) + -1 + ) diff --git a/goal_src/jak3/engine/util/profile.gc b/goal_src/jak3/engine/util/profile.gc index 6651babc6d..2b829992cd 100644 --- a/goal_src/jak3/engine/util/profile.gc +++ b/goal_src/jak3/engine/util/profile.gc @@ -76,7 +76,8 @@ ) ) -(define *profile-translate-array* (new 'static 'array uint64 584 +;; the size of this is not quite right... +(define *profile-translate-array* (new 'static 'array uint64 587 #x0 #x0 #x0 @@ -661,6 +662,8 @@ #xc #xc #xc + 0 ;; hack... + 0 ;; another hack ) ) diff --git a/goal_src/jak3/engine/util/script-h.gc b/goal_src/jak3/engine/util/script-h.gc index e930320287..cdd5f9e86a 100644 --- a/goal_src/jak3/engine/util/script-h.gc +++ b/goal_src/jak3/engine/util/script-h.gc @@ -5,6 +5,9 @@ ;; name in dgo: script-h ;; dgos: GAME +(declare-type script-context structure) +(define-extern *syntax-context* script-context) +(define-extern *script-context* script-context) (declare-type script-context structure) (declare-type load-state structure) @@ -25,6 +28,7 @@ (spec pair) (func (function script-context object)) ) + :pack-me (:methods (script-form-method-9 () none) ) @@ -46,8 +50,8 @@ (:methods (new (symbol type object process vector) _type_) (eval! (_type_ pair) object) - (script-context-method-10 () none) - (script-context-method-11 () none) + (script-context-method-10 (_type_ object pair) object) + (script-context-method-11 (_type_ pair pair symbol) symbol) ) ) diff --git a/goal_src/jak3/engine/util/script.gc b/goal_src/jak3/engine/util/script.gc index 4c122a0826..4de2b37d2e 100644 --- a/goal_src/jak3/engine/util/script.gc +++ b/goal_src/jak3/engine/util/script.gc @@ -5,5 +5,4066 @@ ;; name in dgo: script ;; dgos: GAME +(declare-type script-form structure) +(define-extern *script-form* (inline-array script-form)) + ;; DECOMP BEGINS +'script + +'idle + +'bigmap? + +(defun command-get-int ((arg0 object) (arg1 int)) + (cond + ((null? arg0) + (empty) + arg1 + ) + ((type? arg0 binteger) + (the-as int (/ (the-as int arg0) 8)) + ) + ((type? arg0 bfloat) + (the int (-> (the-as bfloat arg0) data)) + ) + (else + (empty) + arg1 + ) + ) + ) + +(defun command-get-float ((arg0 object) (arg1 float)) + (cond + ((null? arg0) + (empty) + arg1 + ) + ((type? arg0 binteger) + (the float (/ (the-as int arg0) 8)) + ) + ((type? arg0 bfloat) + (-> (the-as bfloat arg0) data) + ) + (else + (empty) + arg1 + ) + ) + ) + +;; WARN: Return type mismatch int vs time-frame. +(defun command-get-time ((arg0 object) (arg1 int)) + (the-as time-frame (cond + ((null? arg0) + (empty) + arg1 + ) + ((and (pair? arg0) (= (car arg0) 'seconds)) + (the int (* 300.0 (command-get-float (car (cdr arg0)) 0.0))) + ) + ((and (pair? arg0) (= (car arg0) 'frame-time)) + (the int (* 5.0000005 (command-get-float (car (cdr arg0)) 0.0))) + ) + ((and (pair? arg0) (= (car arg0) 'frame-time-30)) + (the int (* 10.000001 (command-get-float (car (cdr arg0)) 0.0))) + ) + ((and (pair? arg0) (= (car arg0) 'frame-range)) + (let ((f30-3 (command-get-float (car (cdr arg0)) 0.0)) + (f28-0 (command-get-float (car (cdr (cdr arg0))) 0.0)) + (f0-9 (command-get-float (car (cdr (cdr (cdr arg0)))) 0.0)) + ) + (if (= f0-9 0.0) + (set! f0-9 30.0) + ) + (the int (* 300.0 (/ (- f28-0 f30-3) f0-9))) + ) + ) + ((type? arg0 binteger) + (the-as int (/ (the-as int arg0) 8)) + ) + ((type? arg0 bfloat) + (the int (-> (the-as bfloat arg0) data)) + ) + (else + (empty) + arg1 + ) + ) + ) + ) + +(defun command-get-param ((arg0 object) (arg1 object)) + (cond + ((null? arg0) + arg1 + ) + ((and (pair? arg0) (= (car arg0) 'seconds)) + (the int (* 300.0 (command-get-float (car (cdr arg0)) 0.0))) + ) + ((and (pair? arg0) (= (car arg0) 'meters)) + (* 4096.0 (command-get-float (car (cdr arg0)) 0.0)) + ) + ((and (pair? arg0) (= (car arg0) 'deg)) + (* 182.04445 (command-get-float (car (cdr arg0)) 0.0)) + ) + ((and (pair? arg0) (= (car arg0) 'static-vectorm)) + (let ((s4-0 (the-as object (new 'static 'vector)))) + (set-vector! + (the-as vector s4-0) + (* 4096.0 (command-get-float (car (cdr arg0)) 0.0)) + (* 4096.0 (command-get-float (car (cdr (cdr arg0))) 0.0)) + (* 4096.0 (command-get-float (car (cdr (cdr (cdr arg0)))) 0.0)) + 1.0 + ) + s4-0 + ) + ) + ((type? arg0 binteger) + (/ (the-as int arg0) 8) + ) + ((type? arg0 bfloat) + (-> (the-as bfloat arg0) data) + ) + (else + arg0 + ) + ) + ) + +(defun command-get-quoted-param ((arg0 object) (arg1 object)) + (if (and (pair? arg0) (= (car arg0) 'quote)) + (command-get-param (car (cdr arg0)) arg1) + (command-get-param arg0 arg1) + ) + ) + +;; WARN: Return type mismatch object vs process. +;; ERROR: Failed load: (set! v1-30 (l.wu 0)) at op 111 +;; WARN: disable def twice: 125. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defun command-get-process ((arg0 object) (arg1 process)) + (with-pp + (set! arg1 + (cond + ((or (null? arg0) (not arg0)) + (empty) + arg1 + ) + ((or (type? arg0 process) (= (rtype-of arg0) actor-group)) + (the-as process arg0) + ) + ((type? arg0 entity-actor) + (-> (the-as entity-actor arg0) extra process) + ) + ((or (= arg0 'target) (= arg0 '*target*)) + *target* + ) + ((= arg0 'sidekick) + (when *target* + (let ((v1-13 (-> *target* sidekick))) + (if v1-13 + (the-as process (-> v1-13 0 self)) + ) + ) + ) + ) + ((= arg0 'parent) + (let ((v1-16 (-> pp parent))) + (if v1-16 + (the-as process (-> v1-16 0 self)) + ) + ) + ) + ((= arg0 'camera) + *camera* + ) + ((= arg0 '*task-manager*) + (when (nonzero? (-> *setting-control* user-current exclusive-task-count)) + (let ((v1-24 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (let ((a0-10 (-> v1-24 next0))) + (while (!= v1-24 (-> *task-manager-engine* alive-list-end)) + (when (= (-> (the-as game-task-node-info (-> (the-as connection v1-24) param2)) task) + (-> *setting-control* user-current exclusive-task 0) + ) + (set! arg1 (the-as process (-> (the-as connection v1-24) param1))) + (goto cfg-97) + ) + (set! v1-24 a0-10) + *task-manager-engine* + (set! a0-10 (-> a0-10 next0)) + ) + ) + ) + ) + (let ((v1-30 (-> *task-manager-engine* alive-list next0))) + *task-manager-engine* + (-> v1-30 next0) + (while (!= v1-30 (-> *task-manager-engine* alive-list-end)) + (set! arg1 (the-as process (-> (the-as connection v1-30) param1))) + (b! #t cfg-97 :delay (nop!)) + (the-as none 0) + (the-as none *task-manager-engine*) + (the-as none 0) + (the-as none 0) + (set! v1-30 (the-as connectable (l.wu 0))) + ) + ) + (the-as process #f) + ) + ((= arg0 '*desert-duststorm*) + (handle->process (-> *game-info* dust-storm)) + ) + ((type? arg0 string) + (set! arg1 (process-by-ename (the-as string arg0))) + (cond + (arg1 + (empty) + arg1 + ) + ((-> *setting-control* user-current movie) + (let ((s5-1 (ppointer->process (-> *setting-control* user-current movie 0 child)))) + (while s5-1 + (when (name= arg0 (-> s5-1 name)) + (set! arg1 (the-as process s5-1)) + (goto cfg-97) + ) + (set! s5-1 (ppointer->process (-> s5-1 brother))) + ) + ) + (let ((s5-2 (ppointer->process (-> *setting-control* user-current movie 0 child)))) + (while s5-2 + (let* ((s3-0 s5-2) + (s4-0 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + ) + (format (clear *temp-string*) "~S-lod0" arg0) + (let ((s3-2 *temp-string*)) + (when (and s4-0 + (nonzero? (-> (the-as process-drawable s4-0) draw)) + (or (and (nonzero? (-> (the-as process-drawable s4-0) draw art-group)) + (string= (the-as string arg0) (-> (the-as process-drawable s4-0) draw art-group name)) + ) + (and (nonzero? (-> (the-as process-drawable s4-0) draw jgeo)) + (string= s3-2 (-> (the-as process-drawable s4-0) draw jgeo name)) + ) + ) + ) + (format 0 "WARNING: command-get-process returning art-group or jgeo named ~A~%" arg0) + (set! arg1 (the-as process s4-0)) + (goto cfg-97) + ) + ) + ) + (set! s5-2 (ppointer->process (-> s5-2 brother))) + ) + ) + (the-as process #f) + ) + (else + (let ((v1-76 (process-by-name (the-as string arg0) *active-pool*))) + (if v1-76 + v1-76 + ) + ) + ) + ) + ) + (else + (empty) + arg1 + ) + ) + ) + (label cfg-97) + (the-as process arg1) + ) + ) + +;; WARN: Return type mismatch object vs entity. +(defun command-get-entity ((arg0 object) (arg1 entity)) + (the-as entity (cond + ((null? arg0) + (empty) + arg1 + ) + ((type? arg0 process) + (-> (the-as process arg0) entity) + ) + ((type? arg0 entity) + (the-as entity arg0) + ) + ((type? arg0 string) + (entity-by-name (the-as string arg0)) + ) + (else + (empty) + arg1 + ) + ) + ) + ) + +(defun command-get-trans ((arg0 object) (arg1 vector)) + (cond + ((or (not arg0) (null? arg0)) + (empty) + arg1 + ) + ((= arg0 'null) + *null-vector* + ) + ((= arg0 'target) + (target-pos 0) + ) + ((= (rtype-of arg0) string) + (let ((v1-5 (command-get-process arg0 *target*))) + (cond + ((and v1-5 (nonzero? (-> (the-as process-drawable v1-5) root))) + (-> (the-as process-drawable v1-5) root trans) + ) + (else + (empty) + arg1 + ) + ) + ) + ) + ((pair? arg0) + (let* ((s3-0 (command-get-process (car arg0) *target*)) + (s4-0 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + (a1-7 (car (cdr arg0))) + ) + (cond + ((and s4-0 + (nonzero? (-> (the-as process-drawable s4-0) draw)) + (nonzero? (-> (the-as process-drawable s4-0) node-list)) + ) + (let ((a0-12 + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable s4-0) draw jgeo) (the-as string a1-7) (the-as type #f)) + ) + ) + ) + (cond + (a0-12 + (-> (the-as process-drawable s4-0) node-list data (+ (-> a0-12 number) 1) bone transform trans) + ) + (else + (empty) + arg1 + ) + ) + ) + ) + (else + (empty) + arg1 + ) + ) + ) + ) + (else + (empty) + arg1 + ) + ) + ) + +(defmethod script-context-method-10 ((this script-context) (arg0 object) (arg1 pair)) + (let* ((s5-0 (rtype-of arg0)) + (s4-0 arg1) + (s3-0 (car s4-0)) + ) + (while (not (null? s4-0)) + (cond + ((not s3-0) + (if (not arg0) + (return 'symbol) + ) + ) + (else + (let ((a1-1 (-> (the-as symbol s3-0) value))) + (if (type-type? s5-0 (the-as type a1-1)) + (return s3-0) + ) + ) + ) + ) + (set! s4-0 (cdr s4-0)) + (set! s3-0 (car s4-0)) + ) + ) + #f + ) + +;; WARN: Return type mismatch object vs pair. +(defun key-assoc ((arg0 object) (arg1 pair) (arg2 vector4w)) + (set! (-> arg2 dword 0) (the-as uint 0)) + (let ((v1-0 arg1)) + (while (not (or (null? v1-0) (= (car (car v1-0)) arg0))) + (+! (-> arg2 dword 0) 1) + (set! v1-0 (cdr v1-0)) + ) + (the-as pair (if (not (null? v1-0)) + (car v1-0) + ) + ) + ) + ) + +(defmethod script-context-method-11 ((this script-context) (arg0 pair) (arg1 pair) (arg2 symbol)) + (local-vars (sv-16 symbol) (sv-20 pair) (sv-24 pair) (sv-28 int) (sv-32 int) (sv-40 pair)) + (let ((s3-0 (cdr arg1))) + (set! sv-16 (the-as symbol #f)) + (set! sv-20 arg0) + (set! sv-24 s3-0) + (set! (-> this param-count) 0) + (set! (-> this expr) arg0) + (let ((a1-1 (car sv-20)) + (s2-0 (car s3-0)) + ) + (while (not (and (null? sv-20) (null? sv-24))) + (cond + ((= s2-0 '&rest) + (let ((v1-2 (-> this param-count))) + (set! (-> this param v1-2) sv-20) + (set! (-> this param-type v1-2) 'pair) + (set! (-> this param-count) (+ v1-2 1)) + ) + (return (not sv-16)) + ) + ((= s2-0 '&key) + (set! sv-28 (-> this param-count)) + (set! sv-32 0) + (set! sv-24 (cdr sv-24)) + (let ((v1-11 sv-28)) + (let* ((a0-3 sv-24) + (a1-6 (car a0-3)) + ) + (while (not (null? a0-3)) + (set! (-> this param v1-11) (car (cdr (cdr (cdr a1-6))))) + (let ((a1-13 (-> this param v1-11))) + (set! (-> this param-type v1-11) (-> (rtype-of a1-13) symbol)) + ) + (+! v1-11 1) + (set! a0-3 (cdr a0-3)) + (set! a1-6 (car a0-3)) + ) + ) + (set! (-> this param-count) v1-11) + ) + (while (not (null? sv-20)) + (set! sv-40 (key-assoc (car sv-20) sv-24 (the-as vector4w (& sv-32)))) + (cond + (sv-40 + (set! sv-20 (cdr sv-20)) + (let* ((v1-18 (car (cdr sv-40))) + (s3-1 (if (= v1-18 'eval) + (eval! this (the-as pair (car sv-20))) + (car sv-20) + ) + ) + (s2-1 (+ sv-28 sv-32)) + ) + (set! (-> this param s2-1) s3-1) + (let ((v1-29 (script-context-method-10 this s3-1 (the-as pair (car (cdr (cdr sv-40))))))) + (set! (-> this param-type s2-1) v1-29) + (when (not v1-29) + (set! sv-16 #t) + (if arg2 + (format + 0 + "ERROR: SCRIPT: param ~A = ~A is type ~A, needed type ~A.~%" + (car sv-40) + s3-1 + (rtype-of s3-1) + (car (cdr (cdr sv-40))) + ) + ) + ) + ) + ) + ) + (else + (set! sv-16 #t) + (if arg2 + (format 0 "ERROR: SCRIPT: found unknown keyword ~A in expression ~A.~%" (car sv-20) arg0) + ) + (set! sv-20 (cdr sv-20)) + ) + ) + (set! sv-20 (cdr sv-20)) + ) + (return (not sv-16)) + ) + ((null? s2-0) + (if arg2 + (format 0 "ERROR: SCRIPT: got too many params matching ~A to ~A~%" arg0 s3-0) + ) + (return #f) + ) + ((null? a1-1) + (cond + ((null? (car (cdr (cdr (cdr s2-0))))) + (if arg2 + (format 0 "ERROR: SCRIPT: got too few params matching ~A to ~A~%" arg0 s3-0) + ) + (return #f) + ) + (else + (let ((v1-62 (-> this param-count))) + (set! (-> this param v1-62) (car (cdr (cdr (cdr s2-0))))) + (let ((a0-28 (-> this param v1-62))) + (set! (-> this param-type v1-62) (-> (rtype-of a0-28) symbol)) + ) + (set! (-> this param-count) (+ v1-62 1)) + ) + (set! sv-24 (cdr sv-24)) + ) + ) + ) + (else + (let* ((v1-67 (car (cdr s2-0))) + (s0-0 (if (= v1-67 'eval) + (eval! this (the-as pair a1-1)) + a1-1 + ) + ) + (s1-0 (-> this param-count)) + ) + (set! (-> this param s1-0) s0-0) + (let ((v1-74 (script-context-method-10 this s0-0 (the-as pair (car (cdr (cdr s2-0))))))) + (set! (-> this param-type s1-0) v1-74) + (when (not v1-74) + (set! sv-16 #t) + (if arg2 + (format + 0 + "ERROR: SCRIPT: param ~A = ~A is type ~A, needed type ~A.~%" + (car s2-0) + s0-0 + (rtype-of s0-0) + (car (cdr (cdr s2-0))) + ) + ) + ) + ) + (set! (-> this param-count) (+ s1-0 1)) + ) + (set! sv-20 (cdr sv-20)) + (set! sv-24 (cdr sv-24)) + ) + ) + (set! a1-1 (car sv-20)) + (set! s2-0 (car sv-24)) + ) + ) + ) + (not sv-16) + ) + +(defmethod eval! ((this script-context) (arg0 pair)) + (let ((s5-0 (the-as object #f))) + (set! (-> this expr) arg0) + (case (rtype-of arg0) + ((pair) + (let* ((s4-0 arg0) + (a2-0 (car s4-0)) + ) + (cond + ((null? s4-0) + (set! s5-0 '()) + ) + (else + (let ((s3-0 (-> *script-form* 0))) + (while (nonzero? (-> s3-0 name)) + (when (= a2-0 (-> s3-0 name)) + (let ((s2-0 (new 'stack-no-clear 'script-context))) + (set! (-> s2-0 load-state) (-> this load-state)) + (set! (-> s2-0 key) (-> this key)) + (set! (-> s2-0 process) (-> this process)) + (set! (-> s2-0 trans) (-> this trans)) + (set! (-> s2-0 side-effect?) (-> this side-effect?)) + (set! (-> s2-0 got-error?) #f) + (cond + ((script-context-method-11 s2-0 s4-0 (-> s3-0 spec) #t) + (set! (-> s2-0 expr) s4-0) + (set! s5-0 ((-> s3-0 func) s2-0)) + ) + (else + (set! (-> s2-0 got-error?) #t) + ) + ) + (set! (-> this got-error?) (or (-> this got-error?) (-> s2-0 got-error?))) + ) + (goto cfg-23) + ) + (&+! s3-0 12) + ) + ) + (format 0 "ERROR: SCRIPT: taking the value of unknown symbol ~A in ~A for application.~%" a2-0 s4-0) + (set! (-> this got-error?) #t) + ) + ) + ) + (label cfg-23) + s5-0 + ) + ((symbol) + (let ((a0-8 (the-as object arg0))) + (cond + ((= (the-as pair a0-8) 'MINIMAP_FLAG_MINIMAP) + (set! s5-0 1024) + ) + ((= (the-as pair a0-8) 'FACT_SUPER_SKILL_INC) + (set! s5-0 (* (the int (-> *FACT-bank* super-skill-inc)) 8)) + ) + ((= (the-as pair a0-8) 'self) + (set! s5-0 (-> this process)) + ) + ((= (the-as pair a0-8) 'key) + (set! s5-0 (-> this key)) + ) + ((= (the-as pair a0-8) '*target*) + (set! s5-0 (command-get-process (the-as pair a0-8) *target*)) + ) + ((= (the-as pair a0-8) '*time-of-day*) + (set! s5-0 (ppointer->process *time-of-day*)) + ) + ((= (the-as pair a0-8) '*task-manager*) + (set! s5-0 (command-get-process (the-as pair a0-8) *target*)) + ) + ((= (the-as pair a0-8) '*desert-duststorm*) + (set! s5-0 (command-get-process (the-as pair a0-8) *target*)) + ) + (else + (set! s5-0 (-> (the-as symbol a0-8) value)) + ) + ) + ) + s5-0 + ) + (else + arg0 + ) + ) + ) + ) + +(define *script-form* (the-as (inline-array script-form) (malloc 'global 1536))) + +(let ((v1-13 (-> *script-form* 0))) + (set! (-> v1-13 name) 'quote) + (set! (-> v1-13 spec) '((return macro (object)) (function macro (symbol)) (value macro (object)))) + (set! (-> v1-13 func) (lambda ((arg0 script-context)) (-> arg0 param 1))) + ) + +(let ((v1-15 (-> *script-form* 1))) + (set! (-> v1-15 name) 'meters) + (set! (-> v1-15 spec) '((return macro (float)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-15 func) (lambda ((arg0 script-context)) (* 4096.0 (command-get-float (-> arg0 param 1) 0.0)))) + ) + +(let ((v1-17 (-> *script-form* 2))) + (set! (-> v1-17 name) 'seconds) + (set! (-> v1-17 spec) '((return macro (integer)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-17 func) + (lambda ((arg0 script-context)) (the int (* 300.0 (command-get-float (-> arg0 param 1) 0.0)))) + ) + ) + +(let ((v1-19 (-> *script-form* 3))) + (set! (-> v1-19 name) 'secondsf) + (set! (-> v1-19 spec) '((return macro (integer)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-19 func) (lambda ((arg0 script-context)) (* 300.0 (command-get-float (-> arg0 param 1) 0.0)))) + ) + +(let ((v1-21 (-> *script-form* 4))) + (set! (-> v1-21 name) 'deg) + (set! (-> v1-21 spec) '((return macro (integer)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-21 func) + (lambda ((arg0 script-context)) (* 182.04445 (command-get-float (-> arg0 param 1) 0.0))) + ) + ) + +(let ((v1-23 (-> *script-form* 5))) + (set! (-> v1-23 name) 'float) + (set! (-> v1-23 spec) '((return macro (float)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-23 func) (lambda ((arg0 script-context)) (command-get-float (-> arg0 param 1) 0.0))) + ) + +(let ((v1-25 (-> *script-form* 6))) + (set! (-> v1-25 name) 'int) + (set! (-> v1-25 spec) '((return macro (integer)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-25 func) (lambda ((arg0 script-context)) (command-get-int (-> arg0 param 1) 0))) + ) + +(let ((v1-27 (-> *script-form* 7))) + (set! (-> v1-27 name) 'begin) + (set! (-> v1-27 spec) '((return macro (object)) (function macro (symbol)) &rest body)) + (set! (-> v1-27 func) (lambda ((arg0 script-context)) (let ((v0-0 (the-as object #f))) + (let* ((s5-0 (-> arg0 param 1)) + (a1-0 (-> (the-as pair s5-0) car)) + ) + (while (not (null? s5-0)) + (set! v0-0 (eval! arg0 (the-as pair a1-0))) + (set! s5-0 (-> (the-as pair s5-0) cdr)) + (set! a1-0 (-> (the-as pair s5-0) car)) + ) + ) + v0-0 + ) + ) + ) + ) + +(let ((v1-29 (-> *script-form* 8))) + (set! (-> v1-29 name) 'print) + (set! (-> v1-29 spec) '((return macro (object)) (function macro (symbol)) (value eval (object)))) + (set! (-> v1-29 func) (lambda ((arg0 script-context)) (if (-> arg0 side-effect?) + (printl (-> arg0 param 1)) + (-> arg0 param 1) + ) + ) + ) + ) + +(let ((v1-31 (-> *script-form* 9))) + (set! (-> v1-31 name) 'if) + (set! (-> v1-31 spec) '((return macro (object)) + (function macro (symbol)) + (condition eval (object)) + (if macro + (object) + ) + (else + macro + (object) + #f + ) + ) + ) + (set! (-> v1-31 func) (lambda ((arg0 script-context)) (if (-> arg0 param 1) + (eval! arg0 (the-as pair (-> arg0 param 2))) + (eval! arg0 (the-as pair (-> arg0 param 3))) + ) + ) + ) + ) + +(let ((v1-33 (-> *script-form* 10))) + (set! (-> v1-33 name) 'not) + (set! (-> v1-33 spec) '((return macro (object)) (function macro (symbol)) (condition eval (object)))) + (set! (-> v1-33 func) (lambda ((arg0 script-context)) (not (-> arg0 param 1)))) + ) + +(let ((v1-35 (-> *script-form* 11))) + (set! (-> v1-35 name) 'and) + (set! (-> v1-35 spec) '((return macro (object)) (function macro (symbol)) &rest body)) + (set! (-> v1-35 func) (lambda ((arg0 script-context)) (let ((s5-0 (-> arg0 param 1)) + (v0-0 (the-as object #f)) + ) + (let ((a1-0 (-> (the-as pair s5-0) car))) + (while (not (null? s5-0)) + (set! v0-0 (eval! arg0 (the-as pair a1-0))) + (if (not v0-0) + (return #f) + ) + (set! s5-0 (-> (the-as pair s5-0) cdr)) + (set! a1-0 (-> (the-as pair s5-0) car)) + ) + ) + v0-0 + ) + ) + ) + ) + +(let ((v1-37 (-> *script-form* 12))) + (set! (-> v1-37 name) 'or) + (set! (-> v1-37 spec) '((return macro (object)) (function macro (symbol)) &rest body)) + (set! (-> v1-37 func) (lambda ((arg0 script-context)) + (let ((s5-0 (-> arg0 param 1))) + (let ((a1-0 (-> (the-as pair s5-0) car))) + (while (not (null? s5-0)) + (let ((v1-2 (eval! arg0 (the-as pair a1-0)))) + (if v1-2 + (return v1-2) + ) + ) + (set! s5-0 (-> (the-as pair s5-0) cdr)) + (set! a1-0 (-> (the-as pair s5-0) car)) + ) + ) + ) + #f + ) + ) + ) + +(let ((v1-39 (-> *script-form* 13))) + (set! (-> v1-39 name) 'when) + (set! (-> v1-39 spec) + '((return macro (object)) (function macro (symbol)) (condition eval (object)) &rest body) + ) + (set! (-> v1-39 func) (lambda ((arg0 script-context)) (let ((v0-0 (the-as object #f))) + (when (-> arg0 param 1) + (let* ((s5-0 (-> arg0 param 2)) + (a1-0 (-> (the-as pair s5-0) car)) + ) + (while (not (null? s5-0)) + (set! v0-0 (eval! arg0 (the-as pair a1-0))) + (set! s5-0 (-> (the-as pair s5-0) cdr)) + (set! a1-0 (-> (the-as pair s5-0) car)) + ) + ) + ) + v0-0 + ) + ) + ) + ) + +(let ((v1-41 (-> *script-form* 14))) + (set! (-> v1-41 name) 'unless) + (set! (-> v1-41 spec) + '((return macro (object)) (function macro (symbol)) (condition eval (object)) &rest body) + ) + (set! (-> v1-41 func) (lambda ((arg0 script-context)) (let ((v0-0 (the-as object #f))) + (when (not (-> arg0 param 1)) + (let* ((s5-0 (-> arg0 param 2)) + (a1-0 (-> (the-as pair s5-0) car)) + ) + (while (not (null? s5-0)) + (set! v0-0 (eval! arg0 (the-as pair a1-0))) + (set! s5-0 (-> (the-as pair s5-0) cdr)) + (set! a1-0 (-> (the-as pair s5-0) car)) + ) + ) + ) + v0-0 + ) + ) + ) + ) + +(let ((v1-43 (-> *script-form* 15))) + (set! (-> v1-43 name) 'cond) + (set! (-> v1-43 spec) '((return macro (object)) (function macro (symbol)) &rest body)) + (set! (-> v1-43 func) + (lambda ((arg0 script-context)) (let ((gp-0 (the-as object #f))) + (let* ((s4-0 (-> arg0 param 1)) + (s3-0 (-> (the-as pair s4-0) car)) + ) + (while (not (null? s4-0)) + (when (pair? s3-0) + (let ((a1-0 (-> (the-as pair s3-0) car))) + (when (or (= a1-0 'else) (eval! arg0 (the-as pair a1-0))) + (let* ((s4-1 (-> (the-as pair s3-0) cdr)) + (a1-1 (-> (the-as pair s4-1) car)) + ) + (while (not (null? s4-1)) + (set! gp-0 (eval! arg0 (the-as pair a1-1))) + (set! s4-1 (-> (the-as pair s4-1) cdr)) + (set! a1-1 (-> (the-as pair s4-1) car)) + ) + ) + (set! gp-0 gp-0) + (goto cfg-14) + ) + ) + ) + (set! s4-0 (-> (the-as pair s4-0) cdr)) + (set! s3-0 (-> (the-as pair s4-0) car)) + ) + ) + (label cfg-14) + gp-0 + ) + ) + ) + ) + +(let ((v1-45 (-> *script-form* 16))) + (set! (-> v1-45 name) 'case) + (set! (-> v1-45 spec) '((return macro (object)) (function macro (symbol)) (value eval (object)) &rest body)) + (set! (-> v1-45 func) + (lambda ((arg0 script-context)) + (let ((gp-0 (the-as object #f))) + (let* ((s4-0 (-> arg0 param 1)) + (s3-0 (-> arg0 param 2)) + (s2-0 (-> (the-as pair s3-0) car)) + ) + (while (not (null? s3-0)) + (when (pair? s2-0) + (let ((s1-0 (-> (the-as pair s2-0) car))) + (when (or (= s1-0 'else) (and (pair? s1-0) (member s4-0 s1-0)) (= s1-0 s4-0)) + (let* ((s4-1 (-> (the-as pair s2-0) cdr)) + (a1-1 (-> (the-as pair s4-1) car)) + ) + (while (not (null? s4-1)) + (set! gp-0 (eval! arg0 (the-as pair a1-1))) + (set! s4-1 (-> (the-as pair s4-1) cdr)) + (set! a1-1 (-> (the-as pair s4-1) car)) + ) + ) + (set! gp-0 gp-0) + (goto cfg-19) + ) + ) + ) + (set! s3-0 (-> (the-as pair s3-0) cdr)) + (set! s2-0 (-> (the-as pair s3-0) car)) + ) + ) + (label cfg-19) + gp-0 + ) + ) + ) + ) + +(let ((v1-47 (-> *script-form* 17))) + (set! (-> v1-47 name) 'set!) + (set! (-> v1-47 spec) + '((return macro (object)) (function macro (symbol)) (symbol macro (symbol)) (value eval (object))) + ) + (set! (-> v1-47 func) + (lambda ((arg0 script-context)) (when (-> arg0 side-effect?) + (let ((v0-0 (-> arg0 param 2))) + (set! (-> (the-as symbol (-> arg0 param 1)) value) v0-0) + v0-0 + ) + ) + ) + ) + ) + +(let ((v1-49 (-> *script-form* 18))) + (set! (-> v1-49 name) 'eval) + (set! (-> v1-49 spec) '((return macro (object)) (function macro (symbol)) (value eval (object)))) + (set! (-> v1-49 func) (lambda ((arg0 script-context)) (if (-> arg0 side-effect?) + (eval! arg0 (the-as pair (-> arg0 param 1))) + ) + ) + ) + ) + +(let ((v1-51 (-> *script-form* 19))) + (set! (-> v1-51 name) 'apply) + (set! (-> v1-51 spec) '((return macro (object)) (function macro (symbol)) (value eval (function)))) + (set! (-> v1-51 func) (lambda ((arg0 script-context)) (if (-> arg0 side-effect?) + ((the-as (function none) (-> arg0 param 1))) + ) + ) + ) + ) + +(let ((v1-53 (-> *script-form* 20))) + (set! (-> v1-53 name) '=) + (set! (-> v1-53 spec) + '((return macro (object)) + (function macro (symbol)) + (test1 eval (bfloat binteger)) + (test2 eval (bfloat binteger)) + ) + ) + (set! (-> v1-53 func) + (lambda ((arg0 script-context)) + (= (command-get-float (-> arg0 param 1) 0.0) (command-get-float (-> arg0 param 2) 0.0)) + ) + ) + ) + +(let ((v1-55 (-> *script-form* 21))) + (set! (-> v1-55 name) '<=) + (set! (-> v1-55 spec) + '((return macro (object)) + (function macro (symbol)) + (test1 eval (bfloat binteger)) + (test2 eval (bfloat binteger)) + ) + ) + (set! (-> v1-55 func) + (lambda ((arg0 script-context)) + (>= (command-get-float (-> arg0 param 2) 0.0) (command-get-float (-> arg0 param 1) 0.0)) + ) + ) + ) + +(let ((v1-57 (-> *script-form* 22))) + (set! (-> v1-57 name) '<) + (set! (-> v1-57 spec) + '((return macro (object)) + (function macro (symbol)) + (test1 eval (bfloat binteger)) + (test2 eval (bfloat binteger)) + ) + ) + (set! (-> v1-57 func) + (lambda ((arg0 script-context)) + (< (command-get-float (-> arg0 param 1) 0.0) (command-get-float (-> arg0 param 2) 0.0)) + ) + ) + ) + +(let ((v1-59 (-> *script-form* 23))) + (set! (-> v1-59 name) 'eq?) + (set! (-> v1-59 spec) + '((return macro (object)) (function macro (symbol)) (test1 eval (object)) (test2 eval (object))) + ) + (set! (-> v1-59 func) + (lambda ((arg0 script-context)) (let ((gp-0 (-> arg0 param 1)) + (s5-0 (-> arg0 param 2)) + ) + (if (and (type? gp-0 string) (type? s5-0 string)) + (string= (the-as string gp-0) (the-as string s5-0)) + (= gp-0 s5-0) + ) + ) + ) + ) + ) + +(let ((v1-61 (-> *script-form* 24))) + (set! (-> v1-61 name) 'unbox) + (set! (-> v1-61 spec) '((return macro (object)) (function macro (symbol)) (value eval (bfloat binteger)))) + (set! (-> v1-61 func) + (lambda ((arg0 script-context)) (the-as meters (cond + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) + (/ (the-as int (-> arg0 param 1)) 8) + ) + (else + (let ((v1-3 bfloat) + (a1-0 (-> arg0 param 1)) + ) + (if (= (rtype-of a1-0) v1-3) + (-> (the-as bfloat (-> arg0 param 1)) data) + (-> arg0 param 1) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-63 (-> *script-form* 25))) + (set! (-> v1-63 name) 'static-vectorm) + (set! (-> v1-63 spec) + '((return macro (vector)) + (function macro (symbol)) + (x eval (bfloat binteger)) + (y eval (bfloat binteger)) + (z eval (bfloat binteger)) + ) + ) + (set! (-> v1-63 func) + (lambda ((arg0 script-context)) (let ((s5-0 (new 'static 'vector))) + (set-vector! + s5-0 + (* 4096.0 (command-get-float (-> arg0 param 1) 0.0)) + (* 4096.0 (command-get-float (-> arg0 param 2) 0.0)) + (* 4096.0 (command-get-float (-> arg0 param 3) 0.0)) + 1.0 + ) + s5-0 + ) + ) + ) + ) + +(defun level-from-heap ((arg0 int)) + (dotimes (v1-0 (-> *level* length)) + (let ((a1-3 (-> *level* level v1-0))) + (when (= (-> a1-3 status) 'active) + (let ((a3-1 (-> a1-3 heap base)) + (a2-3 (-> a1-3 heap top-base)) + ) + (if (and (>= arg0 (the-as int a3-1)) (< arg0 (the-as int a2-3))) + (return a1-3) + ) + ) + ) + ) + ) + (the-as level #f) + ) + +(let ((v1-66 (-> *script-form* 26))) + (set! (-> v1-66 name) 'level-status?) + (set! (-> v1-66 spec) '((return macro (symbol)) (function macro (symbol)) (level eval (symbol)))) + (set! (-> v1-66 func) + (lambda ((arg0 script-context)) (status-of-level-and-borrows *level* (the-as symbol (-> arg0 param 1)) #f)) + ) + ) + +(let ((v1-68 (-> *script-form* 27))) + (set! (-> v1-68 name) 'want-vis) + (set! (-> v1-68 spec) '((return macro (none)) (function macro (symbol)) (level eval (symbol)))) + (set! (-> v1-68 func) + (lambda ((arg0 script-context)) (if (and (-> arg0 side-effect?) (-> *level* border?)) + (want-vis-level (-> arg0 load-state) (the-as symbol (-> arg0 param 1))) + ) + ) + ) + ) + +(let ((v1-70 (-> *script-form* 28))) + (set! (-> v1-70 name) 'want-load) + (set! (-> v1-70 spec) '((return macro (none)) (function macro (symbol)) &rest levels)) + (set! (-> v1-70 func) + (lambda ((arg0 script-context)) + (let ((s5-0 10) + (a0-1 (-> arg0 param 1)) + ) + (cond + ((>= s5-0 ((method-of-type (rtype-of a0-1) length) a0-1)) + (when (and (-> arg0 side-effect?) + (-> *level* border?) + (is-load-allowed? *level* (the-as (pointer symbol) (level-from-heap (the-as int (-> arg0 key))))) + ) + (let ((s5-2 (new 'static 'boxed-array :type symbol :length 0 :allocated-length 10))) + (dotimes (s4-1 10) + (let ((a1-4 (ref (-> arg0 param 1) s4-1))) + (set! (-> s5-2 s4-1) (the-as symbol (if (not (null? a1-4)) + (eval! arg0 (the-as pair a1-4)) + ) + ) + ) + ) + ) + (want-levels (-> arg0 load-state) (-> s5-2 data)) + ) + ) + ) + (else + (format 0 "ERROR: SCRIPT: got too many params to want-load ~A~%" (-> arg0 param 1)) + (set! (-> arg0 got-error?) #t) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-72 (-> *script-form* 29))) + (set! (-> v1-72 name) 'want-sound) + (set! (-> v1-72 spec) '((return macro (none)) (function macro (symbol)) &rest sounds)) + (set! (-> v1-72 func) + (lambda ((arg0 script-context)) + (let ((s5-0 3) + (a0-1 (-> arg0 param 1)) + ) + (cond + ((>= s5-0 ((method-of-type (rtype-of a0-1) length) a0-1)) + (when (and (-> arg0 side-effect?) + (-> *level* border?) + (is-load-allowed? *level* (the-as (pointer symbol) (level-from-heap (the-as int (-> arg0 key))))) + ) + (let ((s5-2 (new 'static 'boxed-array :type symbol :length 0 :allocated-length 3))) + (dotimes (s4-1 3) + (let ((a1-4 (ref (-> arg0 param 1) s4-1))) + (set! (-> s5-2 s4-1) (the-as symbol (if (not (null? a1-4)) + (eval! arg0 (the-as pair a1-4)) + ) + ) + ) + ) + ) + (want-sound-banks (-> arg0 load-state) (-> s5-2 data)) + ) + ) + ) + (else + (format 0 "ERROR: SCRIPT: got too many params to want-sound ~A~%" (-> arg0 param 1)) + (set! (-> arg0 got-error?) #t) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-74 (-> *script-form* 30))) + (set! (-> v1-74 name) 'want-display) + (set! (-> v1-74 spec) + '((return macro (none)) (function macro (symbol)) (level eval (symbol)) (mode eval (symbol) display)) + ) + (set! (-> v1-74 func) + (lambda ((arg0 script-context)) + (if (and (-> arg0 side-effect?) + (-> *level* border?) + (is-load-allowed? *level* (the-as (pointer symbol) (level-from-heap (the-as int (-> arg0 key))))) + ) + (want-display-level (-> arg0 load-state) (the-as symbol (-> arg0 param 1)) (the-as symbol (-> arg0 param 2))) + ) + 0 + ) + ) + ) + +(let ((v1-76 (-> *script-form* 31))) + (set! (-> v1-76 name) 'want-force-vis) + (set! (-> v1-76 spec) + '((return macro (none)) (function macro (symbol)) (level eval (symbol)) (mode eval (symbol) #t)) + ) + (set! (-> v1-76 func) + (lambda ((arg0 script-context)) + (if (and (-> arg0 side-effect?) (-> *level* border?)) + (want-force-vis (-> arg0 load-state) (the-as symbol (-> arg0 param 1)) (the-as symbol (-> arg0 param 2))) + ) + 0 + ) + ) + ) + +(let ((v1-78 (-> *script-form* 32))) + (set! (-> v1-78 name) 'want-force-inside) + (set! (-> v1-78 spec) + '((return macro (none)) (function macro (symbol)) (level eval (symbol)) (mode eval (symbol) #t)) + ) + (set! (-> v1-78 func) + (lambda ((arg0 script-context)) + (if (and (-> arg0 side-effect?) (-> *level* border?)) + (want-force-inside (-> arg0 load-state) (the-as symbol (-> arg0 param 1)) (the-as symbol (-> arg0 param 2))) + ) + 0 + ) + ) + ) + +(let ((v1-80 (-> *script-form* 33))) + (set! (-> v1-80 name) 'want-continue) + (set! (-> v1-80 spec) '((return macro (none)) (function macro (symbol)) (continue-point eval (string)))) + (set! (-> v1-80 func) (lambda ((arg0 script-context)) + (when (and (-> arg0 side-effect?) (-> *setting-control* user-current allow-continue)) + (set-continue! *game-info* (the-as basic (-> arg0 param 1)) #f) + (send-event *target* 'want-continue (-> arg0 param 1)) + ) + 0 + ) + ) + ) + +(let ((v1-82 (-> *script-form* 34))) + (set! (-> v1-82 name) 'want-vehicle) + (set! (-> v1-82 spec) + '((return macro (none)) (function macro (symbol)) (vehicle eval (string)) &key (force eval (symbol) #t)) + ) + (set! (-> v1-82 func) + (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (if (and (not (-> arg0 param 2)) (= (-> *game-info* current-vehicle) 27)) + (return (the-as object 0)) + ) + (let ((gp-0 (-> arg0 param 1))) + (cond + ((string= (the-as string gp-0) "turtle") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-scorpion v-toad)) + ) + ((string= (the-as string gp-0) "scorpion") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-snake v-scorpion v-toad)) + ) + ((string= (the-as string gp-0) "toad") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-snake v-scorpion v-toad)) + ) + ((string= (the-as string gp-0) "snake") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-scorpion v-toad)) + ) + ((string= (the-as string gp-0) "rhino") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-fox)) + ) + ((string= (the-as string gp-0) "fox") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-fox)) + ) + ((string= (the-as string gp-0) "mirage") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-snake v-fox)) + ) + ((string= (the-as string gp-0) "x-ride") + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-snake v-fox)) + ) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-84 (-> *script-form* 35))) + (set! (-> v1-84 name) 'want-anim) + (set! (-> v1-84 spec) '((return macro (none)) (function macro (symbol)) (name eval (string)))) + (set! (-> v1-84 func) (lambda ((arg0 script-context)) + "we want to preload this anim." + (if (-> arg0 side-effect?) + (gui-control-method-12 + *gui-control* + (-> arg0 process) + (gui-channel art-load) + (gui-action queue) + (the-as string (-> arg0 param 1)) + 0 + -1.0 + (new 'static 'sound-id) + ) + ) + 0 + ) + ) + ) + +(let ((v1-86 (-> *script-form* 36))) + (set! (-> v1-86 name) 'send-event) + (set! (-> v1-86 spec) + '((return macro (object)) + (function macro (symbol)) + (target eval (string symbol process entity-actor actor-group #f binteger)) + (message eval (symbol)) + &rest + params + ) + ) + (set! (-> v1-86 func) + (lambda ((arg0 script-context)) + (local-vars (sv-96 (function script-context pair object))) + (when (-> arg0 side-effect?) + (let ((gp-0 (command-get-process (-> arg0 param 1) (the-as process #f))) + (s5-0 (new 'stack-no-clear 'event-message-block)) + (s2-0 (-> arg0 param 3)) + (s4-0 (the-as object #f)) + ) + (when gp-0 + (set! (-> s5-0 from) (process->ppointer (-> arg0 process))) + (set! (-> s5-0 message) (the-as symbol (-> arg0 param 2))) + (let ((a0-3 s2-0)) + (set! (-> s5-0 num-params) ((method-of-type (rtype-of a0-3) length) a0-3)) + ) + (dotimes (s1-0 (-> s5-0 num-params)) + (let ((s0-0 arg0)) + (set! sv-96 (method-of-type script-context eval!)) + (let ((a1-4 (ref s2-0 s1-0))) + (set! (-> s5-0 param s1-0) (the-as uint (sv-96 s0-0 (the-as pair a1-4)))) + ) + ) + ) + (cond + ((= (-> gp-0 type) actor-group) + (dotimes (s3-1 (the-as int (-> gp-0 name))) + (let ((t9-4 send-event-function) + (v1-18 (the-as object (-> (the-as (pointer uint32) (+ (+ (* s3-1 8) 12) (the-as int gp-0)))))) + ) + (set! s4-0 (t9-4 + (if (the-as uint v1-18) + (-> (the-as process v1-18) child 3) + ) + s5-0 + ) + ) + ) + ) + ) + (else + (set! s4-0 (send-event-function gp-0 s5-0)) + ) + ) + ) + s4-0 + ) + ) + ) + ) + ) + +(let ((v1-88 (-> *script-form* 37))) + (set! (-> v1-88 name) 'send-event-attack) + (set! (-> v1-88 spec) + '((return macro (object)) + (function macro (symbol)) + (target eval (string process entity-actor actor-group #f binteger)) + (none macro (object)) + &key + (mode eval (symbol) generic) + (message eval (symbol) attack) + ) + ) + (set! (-> v1-88 func) + (lambda ((arg0 script-context)) + (with-pp + (when (-> arg0 side-effect?) + (let ((s5-0 (command-get-process (-> arg0 param 1) (the-as process #f))) + (v0-0 (the-as object #f)) + ) + (when s5-0 + (cond + ((= (-> s5-0 type) actor-group) + (dotimes (s4-0 (the-as int (-> s5-0 name))) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) (the-as symbol (-> arg0 param 4))) + (set! (-> a1-1 param 0) (the-as uint #f)) + (set! (-> a1-1 param 1) + (the-as uint (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode (the-as symbol (-> arg0 param 3))) + ) + ) + ) + ) + (let ((t9-1 send-event-function) + (v1-10 (the-as object (-> (the-as (pointer uint32) (+ (+ (* s4-0 8) 12) (the-as int s5-0)))))) + ) + (set! v0-0 (t9-1 + (if (the-as uint v1-10) + (-> (the-as process v1-10) child 3) + ) + a1-1 + ) + ) + ) + ) + ) + ) + (else + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) (the-as symbol (-> arg0 param 4))) + (set! (-> a1-2 param 0) (the-as uint #f)) + (set! (-> a1-2 param 1) + (the-as uint (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode (the-as symbol (-> arg0 param 3))) + ) + ) + ) + ) + (set! v0-0 (send-event-function s5-0 a1-2)) + ) + ) + ) + ) + v0-0 + ) + ) + ) + ) + ) + ) + +(let ((v1-90 (-> *script-form* 38))) + (set! (-> v1-90 name) 'focus-test?) + (set! (-> v1-90 spec) + '((return macro (symbol)) + (function macro (symbol)) + (target eval (string process entity-actor actor-group #f binteger)) + &rest + params + ) + ) + (set! (-> v1-90 func) + (lambda ((arg0 script-context)) + (let* ((s4-0 (command-get-process (-> arg0 param 1) (the-as process #f))) + (gp-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when gp-0 + (let* ((s5-1 (-> arg0 param 2)) + (v1-0 (-> (the-as pair s5-1) car)) + ) + (while (not (null? s5-1)) + (cond + ((logtest? (the-as int v1-0) 1) + (cond + ((= v1-0 'board) + (if (focus-test? gp-0 board) + (return #t) + ) + ) + ((= v1-0 'gun) + (if (focus-test? gp-0 gun) + (return #t) + ) + ) + ((= v1-0 'mech) + (if (focus-test? gp-0 mech) + (return #t) + ) + ) + ((= v1-0 'pilot) + (if (focus-test? gp-0 pilot) + (return #t) + ) + ) + ((= v1-0 'grabbed) + (if (focus-test? gp-0 grabbed) + (return #t) + ) + ) + ((= v1-0 'indax) + (if (focus-test? gp-0 indax) + (return #t) + ) + ) + ((= v1-0 'hang) + (if (and (= (-> gp-0 type) target) (logtest? (state-flags sf26) (-> gp-0 state-flags))) + (return #t) + ) + ) + ((= v1-0 'flut) + (if (focus-test? gp-0 flut) + (return #t) + ) + ) + ((= v1-0 'dark) + (if (focus-test? gp-0 dark) + (return #t) + ) + ) + ((= v1-0 'light) + (if (focus-test? gp-0 light) + (return #t) + ) + ) + ((= v1-0 'tube) + (if (focus-test? gp-0 tube) + (return #t) + ) + ) + ((= v1-0 'invisible) + (if (and (= (-> gp-0 type) target) (logtest? (state-flags sf28) (-> gp-0 state-flags))) + (return #t) + ) + ) + ) + ) + (else + (format 0 "ERROR: SCRIPT: param bit = ~A is type ~A, needed type ~A.~%" v1-0 (rtype-of v1-0) 'symbol) + ) + ) + (set! s5-1 (-> (the-as pair s5-1) cdr)) + (set! v1-0 (-> (the-as pair s5-1) car)) + ) + ) + #f + ) + ) + ) + ) + ) + +(let ((v1-92 (-> *script-form* 39))) + (set! (-> v1-92 name) 'game-feature!) + (set! (-> v1-92 spec) + '((return macro (none)) (function macro (symbol)) (feature macro (symbol)) (value eval (symbol))) + ) + (set! (-> v1-92 func) (lambda ((arg0 script-context)) + (case (-> arg0 param 1) + (('board) + (if (-> arg0 param 2) + (logior! (-> *game-info* features) (game-feature board)) + (logclear! (-> *game-info* features) (game-feature board)) + ) + ) + (else + (format 0 "ERROR: SCRIPT: unknown feature type ~A~%" (-> arg0 param 1)) + ) + ) + (the-as symbol 0) + ) + ) + ) + +(let ((v1-94 (-> *script-form* 40))) + (set! (-> v1-94 name) 'game-feature?) + (set! (-> v1-94 spec) '((return macro (boolean)) (function macro (symbol)) (feature macro (symbol)))) + (set! (-> v1-94 func) + (lambda ((arg0 script-context)) (case (-> arg0 param 1) + (('board) + (logtest? (game-feature board) (-> *game-info* features)) + ) + (else + (format 0 "ERROR: SCRIPT: unknown feature type ~A~%" (-> arg0 param 1)) + #f + ) + ) + ) + ) + ) + +(let ((v1-96 (-> *script-form* 41))) + (set! (-> v1-96 name) 'entity-status?) + (set! (-> v1-96 spec) + '((return macro (symbol)) + (function macro (symbol)) + (target eval (string process entity-actor actor-group #f binteger)) + &rest + params + ) + ) + (set! (-> v1-96 func) + (lambda ((arg0 script-context)) + (let ((v1-0 (command-get-entity (-> arg0 param 1) (the-as entity #f)))) + (when v1-0 + (let* ((gp-1 (-> arg0 param 2)) + (s5-0 (-> v1-0 extra perm status)) + (v1-2 (-> (the-as pair gp-1) car)) + ) + (while (not (null? gp-1)) + (cond + ((logtest? (the-as int v1-2) 1) + (cond + ((or (= v1-2 'no-birth) (= v1-2 'dead)) + (if (logtest? s5-0 (entity-perm-status dead)) + (return #t) + ) + ) + ((= v1-2 'subtask-complete) + (if (logtest? s5-0 (entity-perm-status subtask-complete bit-12)) + (return #t) + ) + ) + ) + ) + (else + (format 0 "ERROR: SCRIPT: param bit = ~A is type ~A, needed type ~A.~%" v1-2 (rtype-of v1-2) 'symbol) + ) + ) + (set! gp-1 (-> (the-as pair gp-1) cdr)) + (set! v1-2 (-> (the-as pair gp-1) car)) + ) + ) + #f + ) + ) + ) + ) + ) + +(let ((v1-98 (-> *script-form* 42))) + (set! (-> v1-98 name) 'entity-status!) + (set! (-> v1-98 spec) + '((return macro (none)) + (function macro (symbol)) + (target eval (string process entity-actor actor-group #f binteger)) + (value eval (symbol)) + &rest + params + ) + ) + (set! (-> v1-98 func) + (lambda ((arg0 script-context)) + (let ((s5-0 (command-get-entity (-> arg0 param 1) (the-as entity #f)))) + (when s5-0 + (let ((s4-0 (-> arg0 param 3))) + (-> s5-0 extra perm status) + (let ((v1-3 (-> (the-as pair s4-0) car))) + (while (not (null? s4-0)) + (cond + ((logtest? (the-as int v1-3) 1) + (if (= v1-3 'subtask-complete) + (toggle-status + (the-as entity-actor s5-0) + (entity-perm-status subtask-complete) + (the-as symbol (-> arg0 param 2)) + ) + ) + ) + (else + (format 0 "ERROR: SCRIPT: param bit = ~A is type ~A, needed type ~A.~%" v1-3 (rtype-of v1-3) 'symbol) + ) + ) + (set! s4-0 (-> (the-as pair s4-0) cdr)) + (set! v1-3 (-> (the-as pair s4-0) car)) + ) + ) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-100 (-> *script-form* 43))) + (set! (-> v1-100 name) 'setting-set) + (set! (-> v1-100 spec) '((return macro (none)) + (function macro (symbol)) + (setting macro (symbol)) + &key + (mode eval (object)) + (value eval (bfloat)) + (mask eval (binteger)) + ) + ) + (set! (-> v1-100 func) (lambda ((arg0 script-context)) + " + '(setting-set bg-a :mode 'abs :value 1.0) + " + (if (-> arg0 side-effect?) + (add-setting + *setting-control* + (-> arg0 process) + (the-as symbol (-> arg0 param 1)) + (-> arg0 param 2) + (command-get-float (-> arg0 param 3) 0.0) + (command-get-int (-> arg0 param 4) 0) + ) + ) + ) + ) + ) + +(let ((v1-102 (-> *script-form* 44))) + (set! (-> v1-102 name) 'setting-reset) + (set! (-> v1-102 spec) '((return macro (none)) + (function macro (symbol)) + (setting macro (symbol)) + &key + (mode eval (object)) + (value eval (bfloat)) + (mask eval (binteger)) + ) + ) + (set! (-> v1-102 func) (lambda ((arg0 script-context)) (if (-> arg0 side-effect?) + (set-setting + *setting-control* + (-> arg0 process) + (the-as symbol (-> arg0 param 1)) + (-> arg0 param 2) + (command-get-float (-> arg0 param 3) 0.0) + (command-get-int (-> arg0 param 4) 0) + ) + ) + ) + ) + ) + +(let ((v1-104 (-> *script-form* 45))) + (set! (-> v1-104 name) 'setting-pers) + (set! (-> v1-104 spec) + '((return macro (none)) + (function macro (symbol)) + (setting macro (symbol)) + &key + (mode eval (object) #f) + (value macro (bfloat pair) (new 'static 'bfloat)) + (mask eval (binteger) 0) + (time macro (pair) 0) + ) + ) + (set! (-> v1-104 func) + (lambda ((arg0 script-context)) + " + (setting-pers ambient-volume :mode 'rel :value 0.5) + " + (local-vars (sv-16 pair) (sv-24 object) (sv-32 float) (sv-48 float)) + (when (-> arg0 side-effect?) + (set! sv-16 (-> arg0 expr)) + (set! sv-24 (eval! arg0 (the-as pair (-> arg0 param 5)))) + (set! sv-32 (the-as float (if (pair? (-> arg0 param 3)) + (eval! arg0 (the-as pair (-> arg0 param 3))) + (command-get-float (-> arg0 param 3) 0.0) + ) + ) + ) + (let* ((s5-0 *setting-control*) + (s4-0 (method-of-object s5-0 persist-with-delay)) + (s3-0 sv-16) + (s2-0 sv-24) + (s1-0 (-> arg0 param 1)) + (s0-0 (-> arg0 param 2)) + ) + (set! sv-48 sv-32) + (let ((t2-0 (command-get-int (-> arg0 param 4) 0))) + (s4-0 s5-0 (the-as symbol s3-0) (the-as time-frame s2-0) (the-as symbol s1-0) (the-as symbol s0-0) sv-48 t2-0) + ) + ) + ) + ) + ) + ) + +(let ((v1-106 (-> *script-form* 46))) + (set! (-> v1-106 name) 'setting-unset) + (set! (-> v1-106 spec) '((return macro (none)) (function macro (symbol)) (setting macro (symbol)))) + (set! (-> v1-106 func) + (lambda ((arg0 script-context)) + (if (-> arg0 side-effect?) + (remove-setting *setting-control* (-> arg0 process) (the-as symbol (-> arg0 param 1))) + ) + ) + ) + ) + +(let ((v1-108 (-> *script-form* 47))) + (set! (-> v1-108 name) 'setting-value) + (set! (-> v1-108 spec) + '((return macro (object)) + (function macro (symbol)) + (setting macro (symbol)) + &key + (min eval (bfloat binteger) (new 'static 'bfloat)) + (max eval (bfloat binteger) (new 'static 'bfloat :data 1.0)) + ) + ) + (set! (-> v1-108 func) + (lambda ((arg0 script-context)) + "return the value of a setting." + (case (-> arg0 param 1) + (('entity-name) + (-> *setting-control* cam-current entity-name) + ) + (('airlock) + (-> *setting-control* user-current airlock) + ) + (('dynamic-ambient-volume) + (let ((s5-0 (the-as object (new 'static 'bfloat)))) + (let ((f30-0 (-> *setting-control* user-current dynamic-ambient-volume))) + (set! (-> (the-as bfloat s5-0) data) + (lerp-scale (command-get-float (-> arg0 param 2) 0.0) (command-get-float (-> arg0 param 3) 0.0) f30-0 0.0 1.0) + ) + ) + s5-0 + ) + ) + (('exclusive-task) + (* (-> *setting-control* user-current exclusive-task 0) 8) + ) + ) + ) + ) + ) + +(let ((v1-110 (-> *script-form* 48))) + (set! (-> v1-110 name) 'setting-update) + (set! (-> v1-110 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-110 func) (lambda ((arg0 script-context)) + "update settings" + (if (-> arg0 side-effect?) + (apply-settings *setting-control*) + ) + 0 + ) + ) + ) + +(let ((v1-112 (-> *script-form* 49))) + (set! (-> v1-112 name) 'sound-play) + (set! (-> v1-112 spec) '((return macro (none)) + (function macro (symbol)) + (name eval (string)) + &key + (volume eval (bfloat binteger) (new 'static 'bfloat :data 1.0)) + (pitch-mod eval (bfloat binteger) (new 'static 'bfloat)) + (bend eval (bfloat binteger) (new 'static 'bfloat)) + (trans eval (vector) #f) + (ground-effect (symbol) #t) + ) + ) + (set! (-> v1-112 func) (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((s5-0 sound-play-by-name) + (s4-0 (string->sound-name (the-as string (-> arg0 param 1)))) + (s3-0 (new-sound-id)) + (s2-0 (the int (* 1024.0 (command-get-float (-> arg0 param 2) 0.0)))) + (s1-0 (the int (* 1524.0 (command-get-float (-> arg0 param 3) 0.0)))) + (t0-0 (the int (* 327.66998 (command-get-float (-> arg0 param 4) 0.0)))) + (t1-0 0) + (t2-0 (-> arg0 param 5)) + ) + (set! t2-0 (cond + (t2-0 + (empty) + t2-0 + ) + (else + (-> arg0 trans) + ) + ) + ) + (s5-0 s4-0 s3-0 s2-0 s1-0 t0-0 (the-as sound-group t1-0) t2-0) + ) + ) + ) + ) + ) + +(let ((v1-114 (-> *script-form* 50))) + (set! (-> v1-114 name) 'sound-play-loop) + (set! (-> v1-114 spec) + '((return macro (none)) + (function macro (symbol)) + (name eval (string)) + &key + (volume eval (bfloat binteger) (new 'static 'bfloat :data 1.0)) + (pitch-mod eval (bfloat binteger) (new 'static 'bfloat)) + (bend eval (bfloat binteger) (new 'static 'bfloat)) + (trans eval (vector) #f) + ) + ) + (set! (-> v1-114 func) + (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((s3-0 (schedule-callback *sound-loop-engine* (-> arg0 expr) 0))) + (when s3-0 + (if (zero? (-> s3-0 param-int64 0)) + (set! (-> s3-0 param-int64 0) (the-as int (new-sound-id))) + ) + (let ((s5-0 sound-play-by-name) + (s4-0 (string->sound-name (the-as string (-> arg0 param 1)))) + (s3-1 (-> s3-0 param-int64 0)) + (s2-0 (the int (* 1024.0 (command-get-float (-> arg0 param 2) 0.0)))) + (a3-0 (the int (* 1524.0 (command-get-float (-> arg0 param 3) 0.0)))) + (t0-0 0) + (t1-0 0) + (t2-0 (-> arg0 param 5)) + ) + (set! t2-0 (cond + (t2-0 + (empty) + t2-0 + ) + (else + (-> arg0 trans) + ) + ) + ) + (s5-0 s4-0 (the-as sound-id s3-1) s2-0 a3-0 t0-0 (the-as sound-group t1-0) t2-0) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-116 (-> *script-form* 51))) + (set! (-> v1-116 name) 'blackout) + (set! (-> v1-116 spec) '((return macro (none)) (function macro (symbol)) (time macro (binteger bfloat pair)))) + (set! (-> v1-116 func) + (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((a2-0 (if (pair? (-> arg0 param 1)) + (the-as int (command-get-time (-> arg0 param 1) 1)) + (the int (* 5.0000005 (the float (command-get-int (-> arg0 param 1) 0)))) + ) + ) + ) + (persist-with-delay *setting-control* 'blackout (the-as time-frame a2-0) 'bg-a-force 'abs 1.0 0) + ) + ) + ) + ) + ) + +(let ((v1-118 (-> *script-form* 52))) + (set! (-> v1-118 name) 'fadeout) + (set! (-> v1-118 spec) '((return macro (none)) (function macro (symbol)) (time macro (binteger bfloat pair)))) + (set! (-> v1-118 func) + (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((gp-0 (command-get-time (-> arg0 param 1) 1))) + (persist-with-delay + *setting-control* + 'bg-a-speed + (+ gp-0 (seconds 1)) + 'bg-a-speed + 'abs + (/ 300.0 (the float gp-0)) + 0 + ) + (persist-with-delay *setting-control* 'bg-a (+ gp-0 (seconds 1)) 'bg-a 'abs 1.0 0) + ) + ) + 0 + ) + ) + ) + +(let ((v1-120 (-> *script-form* 53))) + (set! (-> v1-120 name) 'fadein) + (set! (-> v1-120 spec) '((return macro (none)) (function macro (symbol)) (time macro (binteger bfloat pair)))) + (set! (-> v1-120 func) (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((gp-0 (command-get-time (-> arg0 param 1) 1))) + (set! (-> *setting-control* user-current bg-a) 1.0) + (apply-settings *setting-control*) + (persist-with-delay + *setting-control* + 'bg-a-speed + (+ gp-0 (seconds 1)) + 'bg-a-speed + 'abs + (/ 300.0 (the float gp-0)) + 0 + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-122 (-> *script-form* 54))) + (set! (-> v1-122 name) 'time-of-day) + (set! (-> v1-122 spec) '((return macro (none)) (function macro (symbol)) (value eval (binteger bfloat)))) + (set! (-> v1-122 func) + (lambda ((arg0 script-context)) (when (-> arg0 side-effect?) + (let ((v1-1 (command-get-int (-> arg0 param 1) 0))) + (cond + ((< v1-1 0) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0) + ) + (else + (send-event (ppointer->process *time-of-day*) 'change 'hour v1-1) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-124 (-> *script-form* 55))) + (set! (-> v1-124 name) 'time-of-day?) + (set! (-> v1-124 spec) '((return macro (boolean)) (function macro (symbol)) (value macro (symbol)))) + (set! (-> v1-124 func) + (lambda ((arg0 script-context)) + (with-pp + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer pp)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'hour) + (let ((v1-4 (send-event-function (ppointer->process *time-of-day*) a1-0))) + (case (-> arg0 param 1) + (('night) + (or (>= (the-as int v1-4) 18) (< (the-as int v1-4) 6)) + ) + (('day) + (and (>= (the-as int v1-4) 6) (< (the-as int v1-4) 18)) + ) + (('dawn) + (and (>= (the-as int v1-4) 4) (< (the-as int v1-4) 7)) + ) + (('dusk) + (and (>= (the-as int v1-4) 16) (< (the-as int v1-4) 19)) + ) + (else + (format 0 "ERROR: SCRIPT: unknown time-of-day? test '~A'~%" (-> arg0 param 1)) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-126 (-> *script-form* 56))) + (set! (-> v1-126 name) 'region-prim) + (set! (-> v1-126 spec) + '((return macro (drawable-region-prim)) (function macro (symbol)) (id eval (binteger))) + ) + (set! (-> v1-126 func) (lambda ((arg0 script-context)) + "lookup a region by number and return the region-prim." + (region-prim-lookup-by-id (command-get-int (-> arg0 param 1) 0) #f 0) + ) + ) + ) + +(let ((v1-128 (-> *script-form* 57))) + (set! (-> v1-128 name) 'region) + (set! (-> v1-128 spec) + '((return macro (drawable-region-prim)) (function macro (symbol)) (id eval (binteger))) + ) + (set! (-> v1-128 func) (lambda ((arg0 script-context)) + "lookup a region by number and return the region-prim." + (region-lookup-by-id (command-get-int (-> arg0 param 1) 0)) + ) + ) + ) + +(let ((v1-130 (-> *script-form* 58))) + (set! (-> v1-130 name) 'part-tracker) + (set! (-> v1-130 spec) + '((return macro (none)) + (function macro (symbol)) + (name eval (string)) + &key + (entity eval (string process entity-actor drawable-region-prim #f) #f) + (joint eval (string) #f) + (track eval (symbol) #f) + (duration macro (object) 0) + (subsample-num eval (binteger bfloat) (new 'static 'bfloat)) + (parent eval (symbol) unknown) + ) + ) + (set! (-> v1-130 func) + (lambda ((arg0 script-context)) + " spawn a part tracker. If the :entity is given, do it at that process's location. Otherwise use the (-> context process), if not that then the (-> context trans). + " + (local-vars + (a1-17 process-tree) + (a1-21 process-tree) + (sv-80 sparticle-launch-group) + (sv-84 process) + (sv-88 entity) + (sv-92 drawable-region-prim) + (sv-96 matrix) + (sv-104 int) + (sv-112 object) + (sv-120 time-frame) + ) + (the-as + symbol + (when (-> arg0 side-effect?) + (if (not (-> arg0 param 2)) + (set! (-> arg0 param 2) (-> arg0 process)) + ) + (set! sv-80 (if (type? (-> arg0 param 1) string) + (lookup-part-group-by-name (the-as string (-> arg0 param 1))) + (the-as sparticle-launch-group #f) + ) + ) + (let ((gp-0 (command-get-process (-> arg0 param 2) (the-as process #f)))) + (set! sv-84 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (set! sv-88 (the-as entity #f)) + (set! sv-92 (the-as drawable-region-prim #f)) + (set! sv-96 (matrix-identity! (new 'stack-no-clear 'matrix))) + (set! sv-104 0) + (set! sv-112 (-> arg0 param 4)) + (set! sv-120 (command-get-time (-> arg0 param 5) 1)) + (let* ((s4-0 sv-80) + (gp-1 (if (type? s4-0 sparticle-launch-group) + s4-0 + ) + ) + (v1-8 (-> arg0 param 2)) + (s4-1 (and (= (rtype-of v1-8) string) (string= (the-as string (-> arg0 param 2)) "zero"))) + ) + (cond + (gp-1 + (when (not sv-84) + (set! sv-112 #f) + (set! sv-88 (command-get-entity (-> arg0 param 2) (the-as entity #f))) + (when (not sv-88) + (let ((s3-0 (-> arg0 param 2))) + (set! sv-92 (if (type? s3-0 drawable-region-prim) + (the-as drawable-region-prim s3-0) + ) + ) + ) + ) + ) + (if (and (not sv-84) (and (not sv-88) (-> arg0 param 2) (not s4-1))) + (format 0 "ERROR: SCRIPT: part-tracker: unknown entity ~A in:~%~T~A~%" (-> arg0 param 2) (-> arg0 expr)) + ) + (when (or sv-84 sv-88 sv-92 (-> arg0 trans) s4-1) + (cond + ((and sv-84 (nonzero? (-> (the-as process-drawable sv-84) root))) + (let ((a1-10 (-> arg0 param 3))) + (cond + (a1-10 + (let ((v1-33 + (if (nonzero? (-> (the-as process-drawable sv-84) draw)) + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable sv-84) draw jgeo) (the-as string a1-10) (the-as type #f)) + ) + ) + ) + ) + (cond + (v1-33 + (set! sv-104 (+ (-> v1-33 number) 1)) + (let ((a1-11 (-> (the-as process-drawable sv-84) node-list data sv-104))) + (let* ((v1-42 sv-96) + (t0-0 (-> a1-11 bone transform)) + (a0-22 (-> t0-0 rvec quad)) + (a2-2 (-> t0-0 uvec quad)) + (a3-1 (-> t0-0 fvec quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-42 rvec quad) a0-22) + (set! (-> v1-42 uvec quad) a2-2) + (set! (-> v1-42 fvec quad) a3-1) + (set! (-> v1-42 trans quad) t0-1) + ) + (vector<-cspace! (-> sv-96 trans) a1-11) + ) + ) + (else + (format 0 "ERROR: SCRIPT: part-tracker: unknown joint ~A in:~%~T~A~%" (-> arg0 param 3) (-> arg0 expr)) + (set! (-> sv-96 trans quad) (-> (the-as process-drawable sv-84) root trans quad)) + ) + ) + ) + ) + (else + (set! (-> sv-96 trans quad) (-> (the-as process-drawable sv-84) root trans quad)) + ) + ) + ) + ) + (sv-88 + (set! (-> sv-96 trans quad) (-> sv-88 extra trans quad)) + ) + (sv-92 + (set! (-> sv-96 trans quad) (-> sv-92 bsphere quad)) + ) + (s4-1 + (set! (-> sv-96 trans quad) (-> *null-vector* quad)) + ) + (else + (set! (-> sv-96 trans quad) (-> arg0 trans quad)) + ) + ) + ) + (when (logtest? (-> sv-80 flags) (sp-group-flag sp2)) + (let* ((a2-4 sv-96) + (a3-3 *identity-matrix*) + (v1-63 (-> a3-3 rvec quad)) + (a0-44 (-> a3-3 uvec quad)) + (a1-13 (-> a3-3 fvec quad)) + (a3-4 (-> a3-3 trans quad)) + ) + (set! (-> a2-4 rvec quad) v1-63) + (set! (-> a2-4 uvec quad) a0-44) + (set! (-> a2-4 fvec quad) a1-13) + (set! (-> a2-4 trans quad) a3-4) + ) + ) + (cond + ((logtest? (-> sv-80 flags) (sp-group-flag sp13)) + (let ((s4-2 (new 'stack-no-clear 'part-tracker-subsampler-init-params)) + (f30-0 (command-get-float (-> arg0 param 6) 0.0)) + (s3-1 (get-process *default-dead-pool* part-tracker-subsampler #x4000 1)) + ) + (when s3-1 + (let ((t9-16 (method-of-type part-tracker-subsampler activate)) + (a0-47 s3-1) + ) + (set! a1-17 (cond + ((or sv-112 (= (-> arg0 param 7) #t)) + sv-84 + ) + ((= (-> arg0 param 7) #f) + *entity-pool* + ) + (else + (set! a1-17 (ppointer->process (-> *setting-control* user-current movie))) + (cond + (a1-17 + (empty) + a1-17 + ) + (else + *entity-pool* + ) + ) + ) + ) + ) + (t9-16 (the-as part-tracker-subsampler a0-47) a1-17 "part-tracker-subsampler" (the-as pointer #x70004000)) + ) + (let ((t9-17 run-function-in-process) + (a0-48 s3-1) + (a1-18 part-tracker-subsampler-init) + ) + (set! (-> s4-2 group) gp-1) + (set! (-> s4-2 duration) sv-120) + (set! (-> s4-2 callback) #f) + (set! (-> s4-2 userdata) (the-as uint #f)) + (set! (-> s4-2 target) (the-as process-drawable (if sv-112 + sv-84 + (the-as process #f) + ) + ) + ) + (set! (-> s4-2 mat-joint) (if sv-112 + sv-104 + sv-96 + ) + ) + (set! (-> s4-2 subsample-num) f30-0) + ((the-as (function object object object none) t9-17) a0-48 a1-18 s4-2) + ) + (-> s3-1 ppointer) + ) + ) + ) + (else + (let ((s4-3 (new 'stack-no-clear 'part-tracker-init-params)) + (s3-2 (get-process *default-dead-pool* part-tracker #x4000 1)) + ) + (when s3-2 + (let ((t9-19 (method-of-type part-tracker activate)) + (a0-50 s3-2) + ) + (set! a1-21 (cond + ((or sv-112 (= (-> arg0 param 7) #t)) + sv-84 + ) + ((= (-> arg0 param 7) #f) + *entity-pool* + ) + (else + (set! a1-21 (ppointer->process (-> *setting-control* user-current movie))) + (cond + (a1-21 + (empty) + a1-21 + ) + (else + *entity-pool* + ) + ) + ) + ) + ) + (t9-19 (the-as part-tracker a0-50) a1-21 "part-tracker" (the-as pointer #x70004000)) + ) + (let ((t9-20 run-function-in-process) + (a0-51 s3-2) + (a1-22 part-tracker-init) + ) + (set! (-> s4-3 group) gp-1) + (set! (-> s4-3 duration) sv-120) + (set! (-> s4-3 callback) #f) + (set! (-> s4-3 userdata) (the-as uint #f)) + (set! (-> s4-3 target) (the-as process-drawable (if sv-112 + sv-84 + (the-as process #f) + ) + ) + ) + (set! (-> s4-3 mat-joint) (if sv-112 + sv-104 + sv-96 + ) + ) + ((the-as (function object object object none) t9-20) a0-51 a1-22 s4-3) + ) + (-> s3-2 ppointer) + ) + ) + ) + ) + ) + (else + (format + 0 + "ERROR: SCRIPT: part-tracker: unknown particle group \"~S\" in:~%~T~A~%" + (-> arg0 param 1) + (-> arg0 expr) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-132 (-> *script-form* 59))) + (set! (-> v1-132 name) 'lightning-tracker) + (set! (-> v1-132 spec) + '((return macro (none)) + (function macro (symbol)) + (name eval (string)) + &key + (from-entity eval (string process entity-actor drawable-region-prim #f) #f) + (to-entity eval (string process entity-actor drawable-region-prim #f) #f) + (from-joint eval (string) #f) + (to-joint eval (string) #f) + (duration macro (object) 0) + ) + ) + (set! (-> v1-132 func) + (lambda ((arg0 script-context)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 int) (sv-64 int) (sv-72 time-frame) (sv-80 lightning-spec)) + (when (-> arg0 side-effect?) + (if (not (-> arg0 param 2)) + (set! (-> arg0 param 2) (-> arg0 process)) + ) + (if (type? (-> arg0 param 1) string) + (set! sv-80 (lookup-lightning-spec-by-name (the-as string (-> arg0 param 1)))) + (set! sv-80 (the-as lightning-spec #f)) + ) + (let* ((s5-0 (command-get-process (-> arg0 param 2) (the-as process #f))) + (gp-0 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + (s5-1 (command-get-process (-> arg0 param 3) (the-as process #f))) + (s4-0 (if (type? s5-1 process-drawable) + s5-1 + ) + ) + (s0-0 (the-as entity #f)) + (s1-0 (the-as entity #f)) + (s5-2 #f) + ) + (set! sv-48 (vector-reset! (new 'stack-no-clear 'vector))) + (set! sv-52 (vector-reset! (new 'stack-no-clear 'vector))) + (set! sv-56 0) + (set! sv-64 0) + (set! sv-72 (command-get-time (-> arg0 param 6) 1)) + (let ((s3-0 (if (type? sv-80 lightning-spec) + sv-80 + ) + ) + ) + (when s3-0 + (if (not gp-0) + (set! s0-0 (command-get-entity (-> arg0 param 2) (the-as entity #f))) + ) + (if (not (the-as process s4-0)) + (set! s1-0 (command-get-entity (-> arg0 param 3) (the-as entity #f))) + ) + (when (or (and gp-0 (the-as process s4-0)) (and s0-0 s1-0)) + (cond + ((and gp-0 (the-as process s4-0)) + (set! s5-2 #t) + (let ((s0-1 (-> arg0 param 4)) + (s1-1 (-> arg0 param 5)) + ) + (cond + (s0-1 + (let ((v1-17 + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable gp-0) draw jgeo) (the-as string s0-1) (the-as type #f)) + ) + ) + ) + (cond + (v1-17 + (set! sv-56 (+ (-> v1-17 number) 1)) + (let ((a1-10 (-> (the-as process-drawable gp-0) node-list data sv-56))) + (vector<-cspace! sv-48 a1-10) + ) + ) + (else + (format 0 "ERROR: SCRIPT: lightning-tracker: unknown from-joint ~A in:~%~T~A~%" s0-1 (-> arg0 expr)) + (set! (-> sv-48 quad) (-> (the-as process-drawable gp-0) root trans quad)) + ) + ) + ) + ) + (else + (set! (-> sv-48 quad) (-> (the-as process-drawable gp-0) root trans quad)) + ) + ) + (cond + (s1-1 + (let ((v1-28 + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable s4-0) draw jgeo) (the-as string s1-1) (the-as type #f)) + ) + ) + ) + (cond + (v1-28 + (set! sv-64 (+ (-> v1-28 number) 1)) + (let ((a1-13 (-> (the-as process-drawable s4-0) node-list data sv-64))) + (vector<-cspace! sv-52 a1-13) + ) + ) + (else + (format 0 "ERROR: SCRIPT: lightning-tracker: unknown to-joint ~A in:~%~T~A~%" s1-1 (-> arg0 expr)) + (set! (-> sv-52 quad) (-> (the-as process-drawable s4-0) root trans quad)) + ) + ) + ) + ) + (else + (set! (-> sv-52 quad) (-> (the-as process-drawable s4-0) root trans quad)) + ) + ) + ) + ) + ((and s0-0 s1-0) + (set! (-> sv-48 quad) (-> s0-0 extra trans quad)) + (set! (-> sv-52 quad) (-> s1-0 extra trans quad)) + ) + ) + ) + (process-spawn + lightning-tracker + :init lightning-tracker-init + s3-0 + sv-72 + #f + (cond + (s5-2 + (empty) + gp-0 + ) + (else + (the-as process #f) + ) + ) + (if s5-2 + sv-56 + sv-48 + ) + (if s5-2 + sv-64 + sv-52 + ) + :name "lightning-tracker" + :to (cond + (s5-2 + (empty) + s4-0 + ) + (else + (set! s4-0 (ppointer->process (-> *setting-control* user-current movie))) + (cond + (s4-0 + (empty) + s4-0 + ) + (else + *entity-pool* + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-134 (-> *script-form* 60))) + (set! (-> v1-134 name) 'joint-eval) + (set! (-> v1-134 spec) + '((return macro (none)) + (function macro (symbol)) + (lambda eval (function)) + &key + (entity eval (string process entity-actor #f) #f) + (joint eval (string) #f) + ) + ) + (set! (-> v1-134 func) + (lambda ((arg0 script-context)) + " call a (lambda (process vector cspace)) on the specified location. + + e.g `(joint-eval ,(lambda ((proc process) (trans vector) (cs cspace)) (format #t \"~A ~`vector`P ~`cspace`P~%\" proc trans cs)) :entity *target* :joint \"neckB\") + + proc - the process or #f + trans - the position specified (will always be true) + cs - the cspace, or #f + + " + (when (-> arg0 side-effect?) + (if (not (-> arg0 param 2)) + (set! (-> arg0 param 2) (-> arg0 process)) + ) + (let* ((s4-0 (-> arg0 param 1)) + (gp-0 (if (type? s4-0 function) + s4-0 + ) + ) + (s3-0 (command-get-process (-> arg0 param 2) (the-as process #f))) + (s4-1 (if (type? s3-0 process-drawable) + s3-0 + ) + ) + (v1-5 (the-as entity #f)) + ) + (let ((s3-1 (the-as object #f))) + (if (not s4-1) + (set! v1-5 (command-get-entity (-> arg0 param 2) (the-as entity #f))) + ) + (if (or s4-1 v1-5 (-> arg0 trans)) + ((the-as (function process-drawable cspace none) gp-0) + (the-as process-drawable s4-1) + (the-as + cspace + (cond + ((and s4-1 + (nonzero? (-> (the-as process-drawable s4-1) draw)) + (nonzero? (-> (the-as process-drawable s4-1) node-list)) + ) + (let ((a1-5 (-> arg0 param 3))) + (cond + (a1-5 + (let ((v1-8 + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable s4-1) draw jgeo) (the-as string a1-5) (the-as type #f)) + ) + ) + ) + (cond + (v1-8 + (set! s3-1 (-> (the-as process-drawable s4-1) node-list data (+ (-> v1-8 number) 1))) + (vector<-cspace! (new 'stack-no-clear 'vector) (the-as cspace s3-1)) + ) + (else + (format 0 "ERROR: SCRIPT: joint-eval: unknown joint ~A in:~%~T~A~%" (-> arg0 param 3) (-> arg0 expr)) + (set! s3-1 (-> (the-as process-drawable s4-1) node-list data)) + (-> (the-as process-drawable s4-1) root trans) + ) + ) + ) + ) + (else + (set! s3-1 (-> (the-as process-drawable s4-1) node-list data)) + (-> (the-as process-drawable s4-1) root trans) + ) + ) + ) + ) + (v1-5 + (-> v1-5 extra trans) + ) + (else + (-> arg0 trans) + ) + ) + ) + ) + (format 0 "ERROR: SCRIPT: joint-eval: unknown entity ~A in:~%~T~A~%" (-> arg0 param 2) (-> arg0 expr)) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-136 (-> *script-form* 61))) + (set! (-> v1-136 name) 'auto-save) + (set! (-> v1-136 spec) '((return macro (none)) (function macro (symbol)) (value eval (symbol)))) + (set! (-> v1-136 func) (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (case *kernel-boot-message* + (('play 'preview) + (auto-save-command (the-as symbol (-> arg0 param 1)) 0 0 *default-pool* #f) + ) + ) + ) + ) + ) + ) + +(let ((v1-138 (-> *script-form* 62))) + (set! (-> v1-138 name) 'teleport) + (set! (-> v1-138 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-138 func) (lambda ((arg0 script-context)) (when (-> arg0 side-effect?) + (set! *teleport* #t) + (let ((v0-0 1000)) + (set! (-> *ACTOR-bank* birth-max) v0-0) + v0-0 + ) + ) + ) + ) + ) + +(let ((v1-140 (-> *script-form* 63))) + (set! (-> v1-140 name) 'scene-play) + (set! (-> v1-140 spec) + '((return macro (none)) + (function macro (symbol)) + (name eval (string pair)) + &key + (continue eval (string #f) #f) + ) + ) + (set! (-> v1-140 func) + (lambda ((arg0 script-context)) (if (and (-> arg0 side-effect?) + *target* + (not *scene-player*) + (not (logtest? (-> *target* focus-status) (focus-status dead))) + ) + (process-spawn + scene-player + :init scene-player-init + (-> arg0 param 1) + #t + (-> arg0 param 2) + :name "scene-player" + ) + ) + ) + ) + ) + +(let ((v1-142 (-> *script-form* 64))) + (set! (-> v1-142 name) 'kill-by-type) + (set! (-> v1-142 spec) + '((return macro (none)) (function macro (symbol)) (type macro (symbol)) &key (store eval (symbol) #t)) + ) + (set! (-> v1-142 func) + (lambda ((arg0 script-context)) + "Kill all processes that are of type type." + (local-vars (v1-11 int) (s4-0 process)) + (when (-> arg0 side-effect?) + (let ((s5-0 (-> (the-as symbol (-> arg0 param 1)) value))) + (set! *global-search-name* (the-as basic (if (type? s5-0 type) + s5-0 + ) + ) + ) + ) + (when *global-search-name* + (let ((s5-1 (-> arg0 load-state))) + (while (begin + (set! s4-0 + (search-process-tree + *active-pool* + (the-as (function process-tree object) (lambda ((arg0 basic)) (= (-> arg0 type) *global-search-name*))) + ) + ) + s4-0 + ) + (let ((a0-3 (if (type? s4-0 process-drawable) + s4-0 + ) + ) + ) + (when a0-3 + (let* ((s3-0 (-> a0-3 entity)) + (s4-1 (if (type? s3-0 entity-actor) + s3-0 + ) + ) + ) + (when s4-1 + (let ((a0-6 (res-lump-struct s4-1 'name structure))) + (cond + ((-> arg0 param 2) + (dotimes (v1-10 256) + (when (not (-> s5-1 object-name v1-10)) + (set! (-> s5-1 object-name v1-10) (the-as string a0-6)) + (set! (-> s5-1 object-status v1-10) (the-as basic (-> s4-1 extra perm status))) + (set! v1-11 v1-10) + (goto cfg-19) + ) + ) + (set! v1-11 -1) + (label cfg-19) + (when (>= v1-11 0) + (if (-> s4-1 extra process) + (kill! s4-1) + ) + (logior! (-> s4-1 extra perm status) (entity-perm-status dead)) + ) + ) + (else + (if (-> s4-1 extra process) + (kill! s4-1) + ) + (logior! (-> s4-1 extra perm status) (entity-perm-status dead)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + ) + ) + +(let ((v1-144 (-> *script-form* 65))) + (set! (-> v1-144 name) 'kill) + (set! (-> v1-144 spec) + '((return macro (none)) + (function macro (symbol)) + (entity eval (string entity-actor process #f)) + &key + (store eval (symbol) #t) + ) + ) + (set! (-> v1-144 func) + (lambda ((arg0 script-context)) + "Store an entity's state in the load-state and then kill him and set him to be dead." + (local-vars (v0-0 entity-perm-status) (v1-5 int)) + (when (-> arg0 side-effect?) + (let* ((s5-0 (-> arg0 load-state)) + (s3-0 (command-get-entity (-> arg0 param 1) (the-as entity #f))) + (gp-0 (if (type? s3-0 entity-actor) + s3-0 + ) + ) + ) + (when gp-0 + (let ((a0-4 (res-lump-struct gp-0 'name structure))) + (cond + ((-> arg0 param 2) + (dotimes (v1-4 256) + (when (not (-> s5-0 object-name v1-4)) + (set! (-> s5-0 object-name v1-4) (the-as string a0-4)) + (set! (-> s5-0 object-status v1-4) (the-as basic (-> gp-0 extra perm status))) + (set! v1-5 v1-4) + (goto cfg-12) + ) + ) + (set! v1-5 -1) + (label cfg-12) + (when (>= v1-5 0) + (if (-> gp-0 extra process) + (kill! gp-0) + ) + (set! v0-0 (logior (-> gp-0 extra perm status) (entity-perm-status dead))) + (set! (-> gp-0 extra perm status) v0-0) + v0-0 + ) + ) + (else + (if (-> gp-0 extra process) + (kill! gp-0) + ) + (set! v0-0 (logior (-> gp-0 extra perm status) (entity-perm-status dead))) + (set! (-> gp-0 extra perm status) v0-0) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-146 (-> *script-form* 66))) + (set! (-> v1-146 name) 'alive) + (set! (-> v1-146 spec) + '((return macro (none)) + (function macro (symbol)) + (entity eval (string entity-actor process #f)) + &key + (store eval (symbol) #t) + ) + ) + (set! (-> v1-146 func) + (lambda ((arg0 script-context)) + "Store an entity's state in the load-state and then force him to be alive." + (local-vars (v1-12 int)) + (when (-> arg0 side-effect?) + (let* ((s5-0 (-> arg0 load-state)) + (s3-0 (command-get-entity (-> arg0 param 1) (the-as entity #f))) + (gp-0 (if (type? s3-0 entity-actor) + s3-0 + ) + ) + ) + (when gp-0 + (cond + ((-> arg0 param 2) + (dotimes (s4-1 256) + (when (not (-> s5-0 object-name s4-1)) + (set! (-> s5-0 object-name s4-1) (res-lump-struct gp-0 'name string)) + (set! (-> s5-0 object-status s4-1) (the-as basic (-> gp-0 extra perm status))) + (set! v1-12 s4-1) + (goto cfg-12) + ) + ) + (set! v1-12 -1) + (label cfg-12) + (when (>= v1-12 0) + (entity-birth-no-kill gp-0) + (let ((v1-16 (-> gp-0 extra process))) + (when v1-16 + (logclear! (-> v1-16 mask) (process-mask actor-pause)) + (let ((v0-0 (the-as object (logclear (-> v1-16 mask) (-> *kernel-context* prevent-from-run))))) + (set! (-> v1-16 mask) (the-as process-mask v0-0)) + v0-0 + ) + ) + ) + ) + ) + (else + (entity-birth-no-kill gp-0) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-148 (-> *script-form* 67))) + (set! (-> v1-148 name) 'restore) + (set! (-> v1-148 spec) + '((return macro (none)) (function macro (symbol)) (entity eval (string entity-actor process #f))) + ) + (set! (-> v1-148 func) + (lambda ((arg0 script-context)) + "restore an entity's state fromt he load-state storage. Will reset him if he is alive." + (when (-> arg0 side-effect?) + (let* ((gp-0 (-> arg0 load-state)) + (s4-0 (command-get-entity (-> arg0 param 1) (the-as entity #f))) + (s5-0 (if (type? s4-0 entity-actor) + s4-0 + ) + ) + ) + (when s5-0 + (let ((s3-0 (res-lump-struct s5-0 'name structure))) + (dotimes (s4-1 256) + (when (string= (-> gp-0 object-name s4-1) (the-as string s3-0)) + (set! (-> s5-0 extra perm status) (the-as entity-perm-status (-> gp-0 object-status s4-1))) + (if (-> s5-0 extra process) + (kill! s5-0) + ) + (set! (-> gp-0 object-name s4-1) #f) + (return #f) + ) + ) + ) + #f + ) + ) + ) + ) + ) + ) + +(let ((v1-150 (-> *script-form* 68))) + (set! (-> v1-150 name) 'special) + (set! (-> v1-150 spec) + '((return macro (none)) + (function macro (symbol)) + (entity eval (string entity-actor process #f)) + (value eval (symbol)) + ) + ) + (set! (-> v1-150 func) + (lambda ((arg0 script-context)) + "make a guy special or not." + (when (-> arg0 side-effect?) + (let* ((s5-0 (command-get-entity (-> arg0 param 1) (the-as entity #f))) + (a0-3 (if (type? s5-0 entity-actor) + s5-0 + ) + ) + ) + (if a0-3 + (toggle-status (the-as entity-actor a0-3) (entity-perm-status bit-7) (the-as symbol (-> arg0 param 2))) + ) + ) + ) + ) + ) + ) + +(let ((v1-152 (-> *script-form* 69))) + (set! (-> v1-152 name) 'save) + (set! (-> v1-152 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-152 func) (lambda ((arg0 script-context)) + "make changes permanent." + (when (-> arg0 side-effect?) + (mem-copy! (&-> *backup-load-state* type) (&-> (-> arg0 load-state) type) 2664) + (set! (-> *backup-load-state* command-list) '()) + (dotimes (v1-5 256) + (if (-> *backup-load-state* object-name v1-5) + (set! (-> *backup-load-state* object-name v1-5) #f) + ) + ) + #f + ) + ) + ) + ) + +(let ((v1-154 (-> *script-form* 70))) + (set! (-> v1-154 name) 'task-close!) + (set! (-> v1-154 spec) '((return macro (none)) (function macro (symbol)) (task eval (binteger string)))) + (set! (-> v1-154 func) + (lambda ((arg0 script-context)) + "close a task stage." + (when (-> arg0 side-effect?) + (cond + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) + (let ((s5-0 task-node-close!) + (a0-2 (command-get-int (-> arg0 param 1) 0)) + ) + 'event + (s5-0 (the-as game-task-node a0-2)) + ) + ) + (else + (let ((s5-1 (-> arg0 param 1))) + (let ((s4-0 (-> *game-info* sub-task-list))) + (dotimes (s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((s2-0 (-> s4-0 s3-0))) + (when (string= (the-as string s5-1) (-> s2-0 name)) + (open! s2-0 'event) + (return 0) + ) + ) + ) + ) + ) + (format 0 "ERROR: SCRIPT: unknown task-node ~A in command ~A.~%" s5-1 (-> arg0 expr)) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-156 (-> *script-form* 71))) + (set! (-> v1-156 name) 'task-open!) + (set! (-> v1-156 spec) '((return macro (none)) (function macro (symbol)) (task eval (binteger string)))) + (set! (-> v1-156 func) + (lambda ((arg0 script-context)) + "close a task stage." + (when (-> arg0 side-effect?) + (cond + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) + (task-node-open! (the-as game-task-node (command-get-int (-> arg0 param 1) 0)) 'event) + ) + (else + (let ((s4-0 (-> arg0 param 1))) + (let ((s3-0 (-> *game-info* sub-task-list))) + (dotimes (s2-0 (-> s3-0 length)) + (when (nonzero? s2-0) + (let ((gp-1 (-> s3-0 s2-0))) + (when (string= (the-as string s4-0) (-> gp-1 name)) + (dotimes (s5-1 4) + (if (nonzero? (-> gp-1 parent-node s5-1)) + (open! (-> *game-info* sub-task-list (-> gp-1 parent-node s5-1)) 'event) + ) + ) + (game-task-node-info-method-11 gp-1 'event) + (return 0) + ) + ) + ) + ) + ) + (format 0 "ERROR: SCRIPT: unknown task-node ~A in command ~A.~%" s4-0 (-> arg0 expr)) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-158 (-> *script-form* 72))) + (set! (-> v1-158 name) 'task-complete?) + (set! (-> v1-158 spec) '((return macro (none)) (function macro (symbol)) (task eval (binteger)))) + (set! (-> v1-158 func) + (lambda ((arg0 script-context)) + "test whether the need resolution stage of a task is closed (actually tests the bit array)" + (task-complete? *game-info* (the-as game-task (command-get-int (-> arg0 param 1) 0))) + ) + ) + ) + +(let ((v1-160 (-> *script-form* 73))) + (set! (-> v1-160 name) 'task-closed?) + (set! (-> v1-160 spec) '((return macro (boolean)) (function macro (symbol)) (task eval (binteger string)))) + (set! (-> v1-160 func) + (lambda ((arg0 script-context)) + "test whether the need resolution stage of a task is closed (actually tests the bit array)" + (cond + ((not (logtest? (the-as int (-> arg0 param 1)) 7)) + (task-node-closed? (the-as game-task-node (command-get-int (-> arg0 param 1) 0))) + ) + (else + (let ((s5-1 (-> arg0 param 1))) + (let ((s4-0 (-> *game-info* sub-task-list))) + (dotimes (s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((s2-0 (-> s4-0 s3-0))) + (if (string= (the-as string s5-1) (-> s2-0 name)) + (return (logtest? (-> s2-0 flags) (game-task-node-flag closed))) + ) + ) + ) + ) + ) + (format 0 "ERROR: SCRIPT: unknown task-node ~A in command ~A.~%" s5-1 (-> arg0 expr)) + ) + ) + ) + #f + ) + ) + ) + +(let ((v1-162 (-> *script-form* 74))) + (set! (-> v1-162 name) 'bigmap?) + (set! (-> v1-162 spec) '((return macro (boolean)) (function macro (symbol)) (task eval (binteger string)))) + (set! (-> v1-162 func) (lambda ((arg0 script-context)) + (cond + ((not *bigmap*) + (return #f) + ) + (else + (let ((a0-1 (-> arg0 param 1)) + (v1-3 (-> *bigmap* bigmap-index)) + ) + (cond + ((zero? v1-3) + (if (string= (the-as string a0-1) "city") + (return #t) + ) + ) + ((= v1-3 1) + (if (string= (the-as string a0-1) "comb") + (return #t) + ) + ) + ((= v1-3 2) + (if (string= (the-as string a0-1) "desert") + (return #t) + ) + ) + ((= v1-3 3) + (if (string= (the-as string a0-1) "factory") + (return #t) + ) + ) + ((= v1-3 4) + (if (string= (the-as string a0-1) "forest") + (return #t) + ) + ) + ((= v1-3 5) + (if (string= (the-as string a0-1) "metalhead-city") + (return #t) + ) + ) + ((= v1-3 6) + (if (string= (the-as string a0-1) "mine") + (return #t) + ) + ) + ((= v1-3 7) + (if (string= (the-as string a0-1) "nest") + (return #t) + ) + ) + ((= v1-3 8) + (if (string= (the-as string a0-1) "nest2") + (return #t) + ) + ) + ((= v1-3 9) + (if (string= (the-as string a0-1) "none") + (return #t) + ) + ) + ((= v1-3 10) + (if (string= (the-as string a0-1) "precursor1") + (return #t) + ) + ) + ((= v1-3 11) + (if (string= (the-as string a0-1) "precursor2") + (return #t) + ) + ) + ((= v1-3 12) + (if (string= (the-as string a0-1) "rubble") + (return #t) + ) + ) + ((= v1-3 13) + (if (string= (the-as string a0-1) "sewer-hum-kg") + (return #t) + ) + ) + ((= v1-3 14) + (if (string= (the-as string a0-1) "sewer-kg-met") + (return #t) + ) + ) + ((= v1-3 15) + (if (string= (the-as string a0-1) "sewer-met-hum") + (return #t) + ) + ) + ((= v1-3 16) + (if (string= (the-as string a0-1) "stadium") + (return #t) + ) + ) + ((= v1-3 17) + (if (string= (the-as string a0-1) "temple1") + (return #t) + ) + ) + ((= v1-3 18) + (if (string= (the-as string a0-1) "temple2") + (return #t) + ) + ) + ((= v1-3 19) + (if (string= (the-as string a0-1) "temple3") + (return #t) + ) + ) + ((= v1-3 20) + (if (string= (the-as string a0-1) "temple4") + (return #t) + ) + ) + ((= v1-3 21) + (if (string= (the-as string a0-1) "tower") + (return #t) + ) + ) + ((= v1-3 22) + (if (string= (the-as string a0-1) "volcano") + (return #t) + ) + ) + ((= v1-3 23) + (if (string= (the-as string a0-1) "wascity") + (return #t) + ) + ) + ) + ) + ) + ) + #f + ) + ) + ) + +(let ((v1-164 (-> *script-form* 75))) + (set! (-> v1-164 name) 'task-open?) + (set! (-> v1-164 spec) '((return macro (boolean)) (function macro (symbol)) (task eval (string)))) + (set! (-> v1-164 func) + (lambda ((arg0 script-context)) + "test whether the need resolution stage of a task is closed (actually tests the bit array)" + (let ((s5-0 (-> arg0 param 1))) + (let ((s4-0 (-> *game-info* sub-task-list)) + (s3-0 0) + ) + (while (< s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((v1-5 (-> s4-0 s3-0))) + (if (string= (the-as string s5-0) (-> v1-5 name)) + (return (the-as object (task-node-open? (the-as game-task-node s3-0)))) + ) + ) + ) + (set! s3-0 (+ s3-0 1)) + ) + ) + (format 0 "ERROR: SCRIPT: unknown task-node ~A in command ~A.~%" s5-0 (-> arg0 expr)) + ) + #f + ) + ) + ) + +(let ((v1-166 (-> *script-form* 76))) + (set! (-> v1-166 name) 'play-task) + (set! (-> v1-166 spec) '((return macro (none)) (function macro (symbol)) (task eval (binteger)))) + (set! (-> v1-166 func) (lambda ((arg0 script-context)) + "set the attributes for a task." + (if (-> arg0 side-effect?) + (play-task (the-as game-task (command-get-int (-> arg0 param 1) 0)) 'debug #f) + ) + ) + ) + ) + +(let ((v1-168 (-> *script-form* 77))) + (set! (-> v1-168 name) 'task-manager) + (set! (-> v1-168 spec) + '((return macro (process)) + (function macro (symbol)) + &key + (type macro (symbol) task-manager) + (level macro (symbol) #f) + ) + ) + (set! (-> v1-168 func) + (lambda ((arg0 script-context)) + "set the attributes for a task." + (the-as + symbol + (when (-> arg0 side-effect?) + (let* ((s4-0 (-> arg0 key)) + (gp-0 (if (type? s4-0 game-task-node-info) + (the-as game-task-node-info s4-0) + ) + ) + (s3-0 (-> (the-as symbol (-> arg0 param 1)) value)) + (s4-1 (if (type? s3-0 type) + s3-0 + ) + ) + (s5-1 (-> arg0 param 2)) + ) + (set! s5-1 (cond + (s5-1 + (empty) + s5-1 + ) + (else + (if (and gp-0 (-> gp-0 manager)) + (-> gp-0 manager level) + ) + ) + ) + ) + (cond + ((not (and gp-0 (-> gp-0 manager))) + (the-as int #f) + ) + ((begin + (when (= s4-1 task-manager) + (let ((s3-1 (-> gp-0 manager type-to-spawn value))) + (set! s4-1 (if (type? s3-1 type) + s3-1 + ) + ) + ) + ) + (and s4-1 (or (not s5-1) (= (status-of-level-and-borrows *level* (the-as symbol s5-1) #f) 'active))) + ) + (when (not (handle->process (-> gp-0 manager manager))) + (let* ((s4-2 (get-process *default-dead-pool* (the-as type s4-1) #x4000 1)) + (v0-0 (ppointer->handle (when s4-2 + (let ((t9-5 (method-of-type process activate))) + (t9-5 s4-2 *entity-pool* (-> gp-0 name) (the-as pointer #x70004000)) + ) + (run-now-in-process s4-2 task-manager-init-by-other gp-0 s5-1) + (-> s4-2 ppointer) + ) + ) + ) + ) + (set! (-> gp-0 manager manager) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-170 (-> *script-form* 78))) + (set! (-> v1-170 name) 'water) + (set! (-> v1-170 spec) '((return macro (pair)) + (function macro (symbol)) + (mode macro (symbol)) + (data eval (object)) + (params macro (pair)) + ) + ) + (set! (-> v1-170 func) (lambda ((arg0 script-context)) + "define a water volume. command does nothing, just defines the syntax." + (-> arg0 expr) + ) + ) + ) + +(let ((v1-172 (-> *script-form* 79))) + (set! (-> v1-172 name) 'movie?) + (set! (-> v1-172 spec) '((return macro (boolean)) (function macro (symbol)))) + (set! (-> v1-172 func) (lambda ((arg0 script-context)) (movie?))) + ) + +(let ((v1-174 (-> *script-form* 80))) + (set! (-> v1-174 name) 'scene-select?) + (set! (-> v1-174 spec) '((return macro (boolean)) (function macro (symbol)))) + (set! (-> v1-174 func) (lambda ((arg0 script-context)) (scene-select?))) + ) + +(let ((v1-176 (-> *script-form* 81))) + (set! (-> v1-176 name) 'demo?) + (set! (-> v1-176 spec) '((return macro (boolean)) (function macro (symbol)))) + (set! (-> v1-176 func) (lambda ((arg0 script-context)) "are we in demo?" (demo?))) + ) + +(let ((v1-178 (-> *script-form* 82))) + (set! (-> v1-178 name) 'kiosk?) + (set! (-> v1-178 spec) '((return macro (boolean)) (function macro (symbol)))) + (set! (-> v1-178 func) (lambda ((arg0 script-context)) "are we in kiosk?" (kiosk?))) + ) + +(let ((v1-180 (-> *script-form* 83))) + (set! (-> v1-180 name) 'kiosk-complete) + (set! (-> v1-180 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-180 func) + (lambda ((arg0 script-context)) + "are we in kiosk?" + (when (and (or (= *kernel-boot-message* 'kiosk) (= *kernel-boot-message* 'demo) (= *kernel-boot-message* 'demo-shared)) + (and (-> arg0 side-effect?) (!= *master-mode* 'kiosk) (not *progress-process*)) + ) + (remove-setting! 'allow-progress) + (apply-settings *setting-control*) + (set-blackout-frames 0) + (set! (-> *setting-control* user-current bg-a-force) 0.0) + (initialize! *game-info* 'game (the-as game-save #f) "title-restart" (the-as resetter-spec #f)) + ) + ) + ) + ) + +(let ((v1-182 (-> *script-form* 84))) + (set! (-> v1-182 name) 'restart-mission) + (set! (-> v1-182 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-182 func) (lambda ((arg0 script-context)) "fail jak no mater what." (restart-mission) 0)) + ) + +(let ((v1-184 (-> *script-form* 85))) + (set! (-> v1-184 name) 'scene-player?) + (set! (-> v1-184 spec) '((return macro (boolean)) (function macro (symbol)))) + (set! (-> v1-184 func) + (lambda ((arg0 script-context)) + "test whether the need resolution stage of a task is closed (actually tests the bit array)" + (if *scene-player* + #t + #f + ) + ) + ) + ) + +(let ((v1-186 (-> *script-form* 86))) + (set! (-> v1-186 name) 'talker-spawn) + (set! (-> v1-186 spec) '((return macro (binteger)) (function macro (symbol)) (message eval (string)))) + (set! (-> v1-186 func) + (lambda ((arg0 script-context)) + (cond + ((-> arg0 side-effect?) + (let ((s5-0 (string->talker-speech (the-as string (-> arg0 param 1))))) + (if (= s5-0 (-> *talker-speech* 0)) + (format 0 "ERROR: talker-spawn could not find a speech named ~A.~%" (-> arg0 param 1)) + ) + ;; og:preserve-this + (* 8 + (talker-spawn-func s5-0 *entity-pool* (target-pos 0) (the-as region (-> arg0 key))) + ) + ) + ) + (else + 0 + ) + ) + ) + ) + ) + +(let ((v1-188 (-> *script-form* 87))) + (set! (-> v1-188 name) 'mark-played!) + (set! (-> v1-188 spec) '((return macro (none)) (function macro (symbol)) (message eval (string)))) + (set! (-> v1-188 func) (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((a0-2 (string->talker-speech (the-as string (-> arg0 param 1))))) + (if a0-2 + (play-communicator-speech! a0-2) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-190 (-> *script-form* 88))) + (set! (-> v1-190 name) 'yes-play!) + (set! (-> v1-190 spec) + '((return macro (none)) (function macro (symbol)) (message eval (string)) (count eval (binteger bfloat))) + ) + (set! (-> v1-190 func) (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((s5-0 (string->talker-speech (the-as string (-> arg0 param 1)))) + (a1-1 (command-get-int (-> arg0 param 2) 0)) + ) + (if s5-0 + (talker-speech-class-method-12 s5-0 a1-1) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-192 (-> *script-form* 89))) + (set! (-> v1-192 name) 'no-play!) + (set! (-> v1-192 spec) + '((return macro (none)) (function macro (symbol)) (message eval (string)) (count eval (binteger bfloat))) + ) + (set! (-> v1-192 func) (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let ((s5-0 (string->talker-speech (the-as string (-> arg0 param 1)))) + (a1-1 (command-get-int (-> arg0 param 2) 0)) + ) + (if s5-0 + (talker-speech-class-method-13 s5-0 a1-1) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-194 (-> *script-form* 90))) + (set! (-> v1-194 name) 'endlessfall) + (set! (-> v1-194 spec) '((return macro (object)) (function macro (symbol)))) + (set! (-> v1-194 func) + (lambda ((arg0 script-context)) + (if (-> arg0 side-effect?) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'endlessfall) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-196 (-> *script-form* 91))) + (set! (-> v1-196 name) 'birth-pickup) + (set! (-> v1-196 spec) + '((return macro (process)) + (function macro (symbol)) + (trans macro (vector symbol string pair)) + (pickup macro (symbol)) + (amount eval (bfloat binteger)) + &key + (flags macro (pair) ('())) + ) + ) + (set! (-> v1-196 func) + (lambda ((arg0 script-context)) + (when (-> arg0 side-effect?) + (let* ((v1-1 (-> arg0 param 2)) + (s5-0 (cond + ((= v1-1 'board) + 38 + ) + ((= v1-1 'skill) + 24 + ) + (else + 0 + ) + ) + ) + ) + (cond + ((nonzero? s5-0) + (let ((s4-0 (new 'static 'fact-info))) + (set! (-> s4-0 options) (actor-option)) + (let* ((v1-2 (-> arg0 param 4)) + (a0-3 (-> (the-as pair v1-2) car)) + ) + (while (not (null? v1-2)) + (cond + ((= a0-3 'suck-in) + (logior! (-> s4-0 options) (actor-option suck-in)) + ) + ((= a0-3 'auto-pickup) + (logior! (-> s4-0 options) (actor-option auto-pickup)) + ) + ) + (set! v1-2 (-> (the-as pair v1-2) cdr)) + (set! a0-3 (-> (the-as pair v1-2) car)) + ) + ) + (ppointer->process (birth-pickup-at-point + (command-get-trans (-> arg0 param 1) (-> arg0 trans)) + (the-as pickup-type s5-0) + (command-get-float (-> arg0 param 3) 0.0) + #t + *entity-pool* + s4-0 + ) + ) + ) + ) + (else + (format 0 "ERROR: SCRIPT: could not spawn pickup, unknown type ~A~%" (-> arg0 param 2)) + ) + ) + ) + ) + ) + ) + ) + +(let ((v1-198 (-> *script-form* 92))) + (set! (-> v1-198 name) 'test-pickup) + (set! (-> v1-198 spec) '((return macro (binteger)) (function macro (symbol)) (pickup macro (symbol)))) + (set! (-> v1-198 func) (lambda ((arg0 script-context)) + (case (-> arg0 param 1) + (('gem) + (* (the int (the float (send-event *target* 'test-pickup (pickup-type gem)))) 8) + ) + (else + 0 + ) + ) + ) + ) + ) + +(let ((v1-200 (-> *script-form* 93))) + (set! (-> v1-200 name) 'get-alert-level) + (set! (-> v1-200 spec) '((return macro (binteger)) (function macro (symbol)))) + (set! (-> v1-200 func) (lambda ((arg0 script-context)) 0)) + ) + +(let ((v1-202 (-> *script-form* 94))) + (set! (-> v1-202 name) 'pause) + (set! (-> v1-202 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-202 func) (lambda ((arg0 script-context)) (set-master-mode 'pause) 0)) + ) + +(let ((v1-204 (-> *script-form* 95))) + (set! (-> v1-204 name) 'camera-smush) + (set! (-> v1-204 spec) '((return macro (none)) + (function macro (symbol)) + &key + (size macro (binteger bfloat pair) (meters (new 'static 'bfloat :data 0.1))) + (duration macro (binteger bfloat pair) (seconds (new 'static 'bfloat :data 0.25))) + ) + ) + (set! (-> v1-204 func) (lambda ((arg0 script-context)) + (if (-> arg0 side-effect?) + (activate! + *camera-smush-control* + (the-as float (command-get-param (-> arg0 param 1) #f)) + 15 + (the-as int (command-get-time (-> arg0 param 2) 1)) + 1.0 + 0.98 + (-> *display* camera-clock) + ) + ) + 0 + ) + ) + ) + +(let ((v1-206 (-> *script-form* 96))) + (set! (-> v1-206 name) 'show-hud) + (set! (-> v1-206 spec) '((return macro (none)) (function macro (symbol)) (name eval (symbol)))) + (set! (-> v1-206 func) (lambda ((arg0 script-context)) + (if (-> arg0 side-effect?) + (show-hud (-> arg0 param 1)) + ) + 0 + ) + ) + ) + +(let ((v1-208 (-> *script-form* 97))) + (set! (-> v1-208 name) 'fma-sphere) + (set! (-> v1-208 spec) + '((return macro (none)) + (function macro (symbol)) + (mode macro (pair)) + &key + (entity eval (string process entity-actor #f) #f) + (joint eval (string) #f) + (duration macro (object) (frame-time 0)) + (sphere eval (binteger #f) #f) + (danger eval (binteger #f) #f) + ;; og:preserve-this + ;; (nav-mesh-id eval (binteger) (the integer 0)) + (nav-mesh-id eval (binteger) (integer 0)) + ) + ) + (set! (-> v1-208 func) + (lambda ((arg0 script-context)) + (local-vars + (a1-9 process-tree) + (sv-16 object) + (sv-20 int) + (sv-24 process) + (sv-32 int) + (sv-40 time-frame) + (sv-48 object) + (sv-52 object) + (sv-56 int) + ) + (when (-> arg0 side-effect?) + (set! sv-16 (-> arg0 param 1)) + (set! sv-20 0) + (let ((s5-0 (command-get-process (-> arg0 param 2) (the-as process #f)))) + (set! sv-24 (if (type? s5-0 process-drawable) + s5-0 + ) + ) + ) + (set! sv-32 -1) + (set! sv-40 (command-get-time (-> arg0 param 4) 1)) + (set! sv-48 (-> arg0 param 5)) + (set! sv-52 (-> arg0 param 6)) + (set! sv-56 (command-get-int (-> arg0 param 7) 0)) + (let* ((s5-1 sv-16) + (a2-0 (-> (the-as pair s5-1) car)) + ) + (while (not (null? s5-1)) + (case (the-as symbol a2-0) + (('nav) + (set! sv-20 (logior sv-20 1)) + ) + (('kill-once) + (set! sv-20 (logior sv-20 2)) + ) + (('danger) + (set! sv-20 (logior sv-20 4)) + ) + (('deadly-overlap) + (set! sv-20 (logior sv-20 8)) + ) + (else + (format 0 "ERROR: SCRIPT: unknown fma-sphere-mode ~A~%" a2-0) + ) + ) + (set! s5-1 (-> (the-as pair s5-1) cdr)) + (set! a2-0 (-> (the-as pair s5-1) car)) + ) + ) + (when (and sv-24 (and (nonzero? (-> (the-as process-drawable sv-24) draw)) + (nonzero? (-> (the-as process-drawable sv-24) node-list)) + ) + ) + (let ((a1-5 (-> arg0 param 3))) + (when a1-5 + (let ((v1-31 + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable sv-24) draw jgeo) (the-as string a1-5) (the-as type #f)) + ) + ) + ) + (if v1-31 + (set! sv-32 (+ (-> v1-31 number) 1)) + (format 0 "ERROR: SCRIPT: joint-eval: unknown joint ~A in:~%~T~A~%" (-> arg0 param 3) (-> arg0 expr)) + ) + ) + ) + ) + ) + (let ((gp-1 (new 'stack 'fma-sphere-params))) + (set! (-> gp-1 mode) (the-as fma-sphere-mode sv-20)) + (set! (-> gp-1 proc) (the-as process-focusable sv-24)) + (set! (-> gp-1 track-joint) sv-32) + (set! (-> gp-1 duration) sv-40) + (set! (-> gp-1 sphere) (the-as sphere sv-48)) + (set! (-> gp-1 danger) (the-as traffic-danger-info sv-52)) + (set! (-> gp-1 nav-mesh-id) (the-as uint sv-56)) + (let ((s5-2 (get-process *default-dead-pool* fma-sphere #x4000 1))) + (when s5-2 + (let ((t9-9 (method-of-type fma-sphere activate)) + (a0-16 s5-2) + ) + (set! a1-9 (cond + (sv-24 + sv-24 + ) + (else + (set! a1-9 (ppointer->process (-> *setting-control* user-current movie))) + (cond + (a1-9 + (empty) + a1-9 + ) + (else + *entity-pool* + ) + ) + ) + ) + ) + (t9-9 (the-as fma-sphere a0-16) a1-9 "fma-sphere" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-2 fma-sphere-init-by-other gp-1) + (-> s5-2 ppointer) + ) + ) + ) + ) + 0 + ) + ) + ) + +(let ((v1-210 (-> *script-form* 98))) + (set! (-> v1-210 name) 'reset-cloth) + (set! (-> v1-210 spec) '((return macro (none)) (function macro (symbol)) (manipy-name eval (string)))) + (set! (-> v1-210 func) + (lambda ((arg0 script-context)) (let ((a0-2 (command-get-process (-> arg0 param 1) *target*))) + (if (and (-> arg0 side-effect?) a0-2) + (process-drawable-reset-all-cloth (the-as process-drawable a0-2)) + ) + ) + ) + ) + ) + +(let ((v1-212 (-> *script-form* 99))) + (set! (-> v1-212 name) 'hide-cloth) + (set! (-> v1-212 spec) '((return macro (none)) (function macro (symbol)) (manipy-name eval (string)))) + (set! (-> v1-212 func) + (lambda ((arg0 script-context)) (let ((a0-2 (command-get-process (-> arg0 param 1) *target*))) + (if (and (-> arg0 side-effect?) a0-2) + (process-drawable-show-all-cloth (the-as process-drawable a0-2) #f) + ) + ) + ) + ) + ) + +(let ((v1-214 (-> *script-form* 100))) + (set! (-> v1-214 name) 'show-cloth) + (set! (-> v1-214 spec) '((return macro (none)) (function macro (symbol)) (manipy-name eval (string)))) + (set! (-> v1-214 func) + (lambda ((arg0 script-context)) (let ((a0-2 (command-get-process (-> arg0 param 1) *target*))) + (if (and (-> arg0 side-effect?) a0-2) + (process-drawable-show-all-cloth (the-as process-drawable a0-2) #t) + ) + ) + ) + ) + ) + +(let ((v1-216 (-> *script-form* 101))) + (set! (-> v1-216 name) 'cloth-slow-mo) + (set! (-> v1-216 spec) '((return macro (none)) (function macro (symbol)) (manipy-name eval (string)))) + (set! (-> v1-216 func) + (lambda ((arg0 script-context)) (let ((a0-2 (command-get-process (-> arg0 param 1) *target*))) + (if (and (-> arg0 side-effect?) a0-2) + (process-drawable-slow-mo-cloth (the-as process-drawable a0-2) #t) + ) + ) + ) + ) + ) + +(let ((v1-218 (-> *script-form* 102))) + (set! (-> v1-218 name) 'cloth-restore-mo) + (set! (-> v1-218 spec) '((return macro (none)) (function macro (symbol)) (manipy-name eval (string)))) + (set! (-> v1-218 func) + (lambda ((arg0 script-context)) (let ((a0-2 (command-get-process (-> arg0 param 1) *target*))) + (if (and (-> arg0 side-effect?) a0-2) + (process-drawable-slow-mo-cloth (the-as process-drawable a0-2) #f) + ) + ) + ) + ) + ) + +(let ((v1-220 (-> *script-form* 103))) + (set! (-> v1-220 name) 'set-cloth-ground-height) + (set! (-> v1-220 spec) '((return macro (none)) + (function macro (symbol)) + (manipy-name eval (string)) + (ground-height eval (binteger bfloat)) + ) + ) + (set! (-> v1-220 func) (lambda ((arg0 script-context)) + (let ((gp-0 (command-get-process (-> arg0 param 1) *target*)) + (f0-0 (command-get-float (-> arg0 param 2) 0.0)) + ) + (if (and (-> arg0 side-effect?) gp-0) + (process-drawable-set-cloth-ground-height (the-as process-drawable gp-0) f0-0) + ) + ) + ) + ) + ) + +(let ((v1-222 (-> *script-form* 104))) + (set! (-> v1-222 name) 'set-cloth-wind) + (set! (-> v1-222 spec) + '((return macro (none)) (function macro (symbol)) (manipy-name eval (string)) (wind eval (binteger bfloat))) + ) + (set! (-> v1-222 func) (lambda ((arg0 script-context)) + (let ((gp-0 (command-get-process (-> arg0 param 1) *target*)) + (f0-0 (command-get-float (-> arg0 param 2) 0.0)) + ) + (if (and (-> arg0 side-effect?) gp-0) + (process-drawable-set-wind-strength (the-as process-drawable gp-0) f0-0) + ) + ) + ) + ) + ) + +(let ((v1-224 (-> *script-form* 105))) + (set! (-> v1-224 name) 'los) + (set! (-> v1-224 spec) '((return macro (none)) (function macro (symbol)))) + (set! (-> v1-224 func) (lambda ((arg0 script-context)) 'los)) + ) + +;; og:preserve-this +(let ((v1-227 (new 'global 'script-context (process->ppointer PP) PP (the-as vector #f)))) + (set! (-> v1-227 side-effect?) #f) + (set! *syntax-context* v1-227) + ) + +(define *script-context* (new 'global 'script-context (process->ppointer PP) PP (the-as vector #f))) + +(let ((v0-6 (-> *script-form* 106))) + (set! (-> v0-6 name) 'beam-tracker) + (set! (-> v0-6 spec) + '((return macro (none)) + (function macro (symbol)) + &key + (entity1 eval (string process entity-actor drawable-region-prim #f) #f) + (entity2 eval (string process entity-actor drawable-region-prim #f) #f) + (joint1 eval (string) #f) + (joint2 eval (string) #f) + (duration macro (object) 0) + (beam-type eval (symbol) *default-prim-beam-appearance*) + ) + ) + (set! (-> v0-6 func) + (lambda ((arg0 script-context)) + (the-as + (pointer prim-beam-tracker) + (when (-> arg0 side-effect?) + (if (not (-> arg0 param 1)) + (set! (-> arg0 param 1) (-> arg0 process)) + ) + (if (not (-> arg0 param 2)) + (set! (-> arg0 param 2) (-> arg0 process)) + ) + (let* ((gp-0 (command-get-process (-> arg0 param 1) (the-as process #f))) + (s0-0 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + (gp-1 (command-get-process (-> arg0 param 2) (the-as process #f))) + (s2-0 (if (type? gp-1 process-drawable) + gp-1 + ) + ) + (s4-0 0) + (s3-0 0) + (s5-0 (command-get-time (-> arg0 param 5) 1)) + (gp-2 (-> arg0 param 6)) + ) + (when (and s0-0 s2-0) + (when (and s0-0 (nonzero? (-> (the-as process-drawable s0-0) root))) + (let ((a1-5 (-> arg0 param 3))) + (when a1-5 + (let ((v1-12 + (if (nonzero? (-> (the-as process-drawable s0-0) draw)) + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable s0-0) draw jgeo) (the-as string a1-5) (the-as type #f)) + ) + ) + ) + ) + (if v1-12 + (set! s4-0 (+ (-> v1-12 number) 1)) + ) + ) + ) + ) + ) + (when (and s2-0 (nonzero? (-> (the-as process-drawable s2-0) root))) + (let ((a1-6 (-> arg0 param 4))) + (when a1-6 + (let ((v1-20 + (if (nonzero? (-> (the-as process-drawable s2-0) draw)) + (the-as + joint + (get-art-by-name-method (-> (the-as process-drawable s2-0) draw jgeo) (the-as string a1-6) (the-as type #f)) + ) + ) + ) + ) + (if v1-20 + (set! s3-0 (+ (-> v1-20 number) 1)) + ) + ) + ) + ) + ) + (let ((a0-16 (new 'stack-no-clear 'prim-beam-tracker-params))) + (set! (-> a0-16 track-obj1) (process->handle s0-0)) + (set! (-> a0-16 track-obj2) (process->handle s2-0)) + (set! (-> a0-16 track-joint1) s4-0) + (set! (-> a0-16 track-joint2) s3-0) + (set! (-> a0-16 pos0) #f) + (set! (-> a0-16 pos1) #f) + (set! (-> a0-16 appearance) #f) + (set! (-> a0-16 duration) s5-0) + (let ((a2-2 (if *scene-player* + (ppointer->process *scene-player*) + *entity-pool* + ) + ) + ) + (spawn-prim-beam-tracker a0-16 (the-as symbol gp-2) (the-as process a2-2)) + ) + ) + ) + ) + ) + ) + ) + ) + ) diff --git a/goal_src/jak3/game.gp b/goal_src/jak3/game.gp index 05598460b7..9fecee4056 100644 --- a/goal_src/jak3/game.gp +++ b/goal_src/jak3/game.gp @@ -96,286 +96,327 @@ ;; the case of a .o appearing in multiple dgos. But, if we depend on the last item in both lists, it ;; works out. -#| -(define common-dep '("$OUT/obj/cty-guard-turret-button.o" "$OUT/obj/default-menu-pc.o")) -(cgo-file "preca.gd" common-dep) -(cgo-file "outrocst.gd" common-dep) -(cgo-file "ltornsam.gd" common-dep) -(cgo-file "lnstcst.gd" common-dep) -(cgo-file "combx.gd" common-dep) -(cgo-file "lfreeout.gd" common-dep) -(cgo-file "lgunrnc.gd" common-dep) -(cgo-file "ctc.gd" common-dep) -(cgo-file "ltowcity.gd" common-dep) -(cgo-file "temc.gd" common-dep) -(cgo-file "loutro.gd" common-dep) -(cgo-file "railcst.gd" common-dep) -(cgo-file "sem.gd" common-dep) -(cgo-file "dese.gd" common-dep) -(cgo-file "ljkdxvin.gd" common-dep) -(cgo-file "waspgame.gd" common-dep) -(cgo-file "wascast.gd" common-dep) -(cgo-file "lbbsdrp1.gd" common-dep) -(cgo-file "raild.gd" common-dep) -(cgo-file "lwlandm.gd" common-dep) -(cgo-file "gungame2.gd" common-dep) -(cgo-file "railc.gd" common-dep) -(cgo-file "precd.gd" common-dep) -(cgo-file "combe.gd" common-dep) -(cgo-file "lctyhijk.gd" common-dep) -(cgo-file "desoasis.gd" common-dep) -(cgo-file "ctypesc.gd" common-dep) -(cgo-file "wasseem.gd" common-dep) -(cgo-file "towb.gd" common-dep) -(cgo-file "wasstadc.gd" common-dep) -(cgo-file "gungame1.gd" common-dep) -(cgo-file "ljak.gd" common-dep) -(cgo-file "lwassig.gd" common-dep) -(cgo-file "deshover.gd" common-dep) -(cgo-file "wsd.gd" common-dep) -(cgo-file "lsamos.gd" common-dep) -(cgo-file "lfaccity.gd" common-dep) -(cgo-file "lblowtmh.gd" common-dep) -(cgo-file "ljaksig.gd" common-dep) -(cgo-file "ldmpckgn.gd" common-dep) -(cgo-file "lbbtcha1.gd" common-dep) -(cgo-file "railx.gd" common-dep) -(cgo-file "staa.gd" common-dep) -(cgo-file "wcaseem.gd" common-dep) -(cgo-file "dst.gd" common-dep) -(cgo-file "rubc.gd" common-dep) -(cgo-file "ipf.gd" common-dep) -(cgo-file "lnstoa.gd" common-dep) -(cgo-file "railf.gd" common-dep) -(cgo-file "deshunt.gd" common-dep) -(cgo-file "oasiscst.gd" common-dep) -(cgo-file "desinter.gd" common-dep) -(cgo-file "ctypesa.gd" common-dep) -(cgo-file "seo.gd" common-dep) -(cgo-file "railb.gd" common-dep) -(cgo-file "lerrol.gd" common-dep) -(cgo-file "lbbsprt3.gd" common-dep) -(cgo-file "ltowa.gd" common-dep) -(cgo-file "comba.gd" common-dep) -(cgo-file "stb.gd" common-dep) -(cgo-file "desc.gd" common-dep) -(cgo-file "lctyprot.gd" common-dep) -(cgo-file "lctyblow.gd" common-dep) -(cgo-file "voca.gd" common-dep) -(cgo-file "lbbring3.gd" common-dep) -(cgo-file "ctb.gd" common-dep) -(cgo-file "lbbring4.gd" common-dep) -(cgo-file "mic.gd" common-dep) -(cgo-file "lnstobc.gd" common-dep) -(cgo-file "ctypesb.gd" common-dep) -(cgo-file "cia.gd" common-dep) -(cgo-file "ldampksm.gd" common-dep) -(cgo-file "ljndklev.gd" common-dep) -(cgo-file "desrace2.gd" common-dep) -(cgo-file "hhg.gd" common-dep) -(cgo-file "ljakc.gd" common-dep) -(cgo-file "lbombbot.gd" common-dep) -(cgo-file "loutro2.gd" common-dep) -(cgo-file "citycast.gd" common-dep) -(cgo-file "seb.gd" common-dep) -(cgo-file "combn.gd" common-dep) -(cgo-file "lprenme.gd" common-dep) -(cgo-file "rbct.gd" common-dep) -(cgo-file "lbbsdrp2.gd" common-dep) -(cgo-file "lbbring5.gd" common-dep) -(cgo-file "rubb.gd" common-dep) -(cgo-file "ltrtwhls.gd" common-dep) -(cgo-file "ctycarc.gd" common-dep) -(cgo-file "towera.gd" common-dep) -(cgo-file "desw.gd" common-dep) -(cgo-file "lpatk.gd" common-dep) -(cgo-file "ljkdmpk.gd" common-dep) -(cgo-file "ltowb.gd" common-dep) -(cgo-file "destrack.gd" common-dep) -(cgo-file "slumbset.gd" common-dep) -(cgo-file "desboss2.gd" common-dep) -(cgo-file "combb.gd" common-dep) -(cgo-file "precc.gd" common-dep) -(cgo-file "desbcst.gd" common-dep) -(cgo-file "lctypalt.gd" common-dep) -(cgo-file "ltornjnx.gd" common-dep) -(cgo-file "factorya.gd" common-dep) -(cgo-file "ljakklev.gd" common-dep) -(cgo-file "sef.gd" common-dep) -(cgo-file "museum4.gd" common-dep) -(cgo-file "tema.gd" common-dep) -(cgo-file "lbbring1.gd" common-dep) -(cgo-file "ljakndax.gd" common-dep) -(cgo-file "vin.gd" common-dep) -(cgo-file "lfacb.gd" common-dep) -(cgo-file "lashelin.gd" common-dep) -(cgo-file "ljkcdmkl.gd" common-dep) -(cgo-file "lfacrm2.gd" common-dep) -(cgo-file "ljinx.gd" common-dep) -(cgo-file "lfactory.gd" common-dep) -(cgo-file "arenacst.gd" common-dep) -(cgo-file "lbbtcha3.gd" common-dep) -(cgo-file "wasdefen.gd" common-dep) -(cgo-file "templee.gd" common-dep) -(cgo-file "lmhcb.gd" common-dep) -(cgo-file "freecast.gd" common-dep) -(cgo-file "frstx.gd" common-dep) -(cgo-file "sek.gd" common-dep) -(cgo-file "lmhca.gd" common-dep) -(cgo-file "cwi.gd" common-dep) -(cgo-file "lprecc.gd" common-dep) -(cgo-file "hgb.gd" common-dep) -(cgo-file "desrace1.gd" common-dep) -(cgo-file "sea.gd" common-dep) -(cgo-file "nsa.gd" common-dep) -(cgo-file "lbiped.gd" common-dep) -(cgo-file "wasall.gd" common-dep) -(cgo-file "waschase.gd" common-dep) -(cgo-file "desrescc.gd" common-dep) -(cgo-file "desf.gd" common-dep) -(cgo-file "deserrol.gd" common-dep) -(cgo-file "cfb.gd" common-dep) -(cgo-file "lgunnorm.gd" common-dep) -(cgo-file "outcast3.gd" common-dep) -(cgo-file "mhca.gd" common-dep) -(cgo-file "ltnfxhip.gd" common-dep) -(cgo-file "introcst.gd" common-dep) -(cgo-file "cta.gd" common-dep) -(cgo-file "combc.gd" common-dep) -(cgo-file "seh.gd" common-dep) -(cgo-file "lfaccar.gd" common-dep) -(cgo-file "warpcast.gd" common-dep) -(cgo-file "lfacrm1.gd" common-dep) -(cgo-file "wca.gd" common-dep) -(cgo-file "lblowtkg.gd" common-dep) -(cgo-file "onintent.gd" common-dep) -(cgo-file "freehq.gd" common-dep) -(cgo-file "lform.gd" common-dep) -(cgo-file "towercst.gd" common-dep) -(cgo-file "lbbring2.gd" common-dep) -(cgo-file "ctypepc.gd" common-dep) -(cgo-file "lblowcst.gd" common-dep) -(cgo-file "see.gd" common-dep) -(cgo-file "lctysnpr.gd" common-dep) -(cgo-file "desrescg.gd" common-dep) -(cgo-file "mhctycst.gd" common-dep) -(cgo-file "ltorn.gd" common-dep) -(cgo-file "desg.gd" common-dep) -(cgo-file "facd.gd" common-dep) -(cgo-file "desboss1.gd" common-dep) -(cgo-file "lforp.gd" common-dep) -(cgo-file "ljakcklv.gd" common-dep) -(cgo-file "ctycarkg.gd" common-dep) -(cgo-file "temp.gd" common-dep) -(cgo-file "lkeira.gd" common-dep) -(cgo-file "ctypepb.gd" common-dep) -(cgo-file "sej.gd" common-dep) -(cgo-file "desh.gd" common-dep) -(cgo-file "wasstadb.gd" common-dep) -(cgo-file "lbbsprt2.gd" common-dep) -(cgo-file "lbbsdrp3.gd" common-dep) -(cgo-file "museum.gd" common-dep) -(cgo-file "ldesgcst.gd" common-dep) -(cgo-file "ltnjxhip.gd" common-dep) -(cgo-file "ldax.gd" common-dep) -(cgo-file "intpalrf.gd" common-dep) -(cgo-file "lcitysml.gd" common-dep) -(cgo-file "title.gd" common-dep) -(cgo-file "desb.gd" common-dep) -(cgo-file "facb.gd" common-dep) -(cgo-file "mia.gd" common-dep) -(cgo-file "temx.gd" common-dep) -(cgo-file "ctycarb.gd" common-dep) -(cgo-file "hga.gd" common-dep) -(cgo-file "ctycara.gd" common-dep) -(cgo-file "lnstobb.gd" common-dep) -(cgo-file "lmech.gd" common-dep) -(cgo-file "gridcst.gd" common-dep) -(cgo-file "lbbtcha2.gd" common-dep) -(cgo-file "ljkfeet.gd" common-dep) -(cgo-file "mib.gd" common-dep) -(cgo-file "facc.gd" common-dep) -(cgo-file "raile.gd" common-dep) -(cgo-file "combd.gd" common-dep) -(cgo-file "lsigklv.gd" common-dep) -(cgo-file "ldampeck.gd" common-dep) -(cgo-file "deschase.gd" common-dep) -(cgo-file "museum3.gd" common-dep) -(cgo-file "minee.gd" common-dep) -(cgo-file "lctyass.gd" common-dep) -(cgo-file "wcb.gd" common-dep) -(cgo-file "lpatkcs.gd" common-dep) -(cgo-file "cfa.gd" common-dep) -(cgo-file "ruba2.gd" common-dep) -(cgo-file "ldamsig.gd" common-dep) -(cgo-file "precb.gd" common-dep) -(cgo-file "railb2.gd" common-dep) -(cgo-file "lbbspirt.gd" common-dep) -(cgo-file "temd.gd" common-dep) -(cgo-file "mined.gd" common-dep) -(cgo-file "wwd.gd" common-dep) -(cgo-file "loutro3.gd" common-dep) -(cgo-file "sec.gd" common-dep) -(cgo-file "lsnkwhls.gd" common-dep) -(cgo-file "loninsim.gd" common-dep) +(define common-dep '("$OUT/obj/default-menu.o")) (cgo-file "halfpipe.gd" common-dep) -(cgo-file "cib.gd" common-dep) -(cgo-file "inttitle.gd" common-dep) -(cgo-file "desresc.gd" common-dep) -(cgo-file "lwasbbv.gd" common-dep) -(cgo-file "lforring.gd" common-dep) -(cgo-file "museum3b.gd" common-dep) -(cgo-file "gga.gd" common-dep) -(cgo-file "desliz.gd" common-dep) -(cgo-file "desjump.gd" common-dep) -(cgo-file "raila.gd" common-dep) -(cgo-file "lseemwca.gd" common-dep) -(cgo-file "lkleever.gd" common-dep) -(cgo-file "desd.gd" common-dep) -(cgo-file "lfaco.gd" common-dep) -(cgo-file "ldamklev.gd" common-dep) -(cgo-file "powergd.gd" common-dep) -(cgo-file "lptrl.gd" common-dep) -(cgo-file "lsig.gd" common-dep) -(cgo-file "ruba.gd" common-dep) -(cgo-file "win.gd" common-dep) -(cgo-file "wasstada.gd" common-dep) -(cgo-file "sei.gd" common-dep) -(cgo-file "cpo.gd" common-dep) -(cgo-file "waspala.gd" common-dep) -(cgo-file "museum4b.gd" common-dep) -(cgo-file "seg.gd" common-dep) -(cgo-file "frstb.gd" common-dep) -(cgo-file "nsb.gd" common-dep) -(cgo-file "cgb.gd" common-dep) -(cgo-file "lvincst.gd" common-dep) -(cgo-file "sel.gd" common-dep) -(cgo-file "lctydest.gd" common-dep) -(cgo-file "sta.gd" common-dep) -(cgo-file "wasleapr.gd" common-dep) -(cgo-file "desrally.gd" common-dep) -(cgo-file "temb.gd" common-dep) -(cgo-file "ctypepa.gd" common-dep) -(cgo-file "lwstdpck.gd" common-dep) -(cgo-file "museum2.gd" common-dep) -(cgo-file "sed.gd" common-dep) -(cgo-file "desa.gd" common-dep) -(cgo-file "towerc.gd" common-dep) -(cgo-file "desbattl.gd" common-dep) -(cgo-file "frsta.gd" common-dep) -(cgo-file "lsigjakc.gd" common-dep) -(cgo-file "vocx.gd" common-dep) -(cgo-file "lbbspid.gd" common-dep) -(cgo-file "sen.gd" common-dep) -(cgo-file "mhcb.gd" common-dep) -(cgo-file "lctypatk.gd" common-dep) -(cgo-file "lbbring6.gd" common-dep) - |# +(cgo-file "wasall.gd" common-dep) + +;; (cgo-file "preca.gd" common-dep) +;; (cgo-file "outrocst.gd" common-dep) +;; (cgo-file "ltornsam.gd" common-dep) +;; (cgo-file "lnstcst.gd" common-dep) +;; (cgo-file "combx.gd" common-dep) +;; (cgo-file "lfreeout.gd" common-dep) +;; (cgo-file "lgunrnc.gd" common-dep) +;; (cgo-file "ctc.gd" common-dep) +;; (cgo-file "ltowcity.gd" common-dep) +;; (cgo-file "temc.gd" common-dep) +;; (cgo-file "loutro.gd" common-dep) +;; (cgo-file "railcst.gd" common-dep) +;; (cgo-file "sem.gd" common-dep) +;; (cgo-file "dese.gd" common-dep) +;; (cgo-file "ljkdxvin.gd" common-dep) +;; (cgo-file "waspgame.gd" common-dep) +;; (cgo-file "wascast.gd" common-dep) +;; (cgo-file "lbbsdrp1.gd" common-dep) +;; (cgo-file "raild.gd" common-dep) +;; (cgo-file "lwlandm.gd" common-dep) +;; (cgo-file "gungame2.gd" common-dep) +;; (cgo-file "railc.gd" common-dep) +;; (cgo-file "precd.gd" common-dep) +;; (cgo-file "combe.gd" common-dep) +;; (cgo-file "lctyhijk.gd" common-dep) +;; (cgo-file "desoasis.gd" common-dep) +;; (cgo-file "ctypesc.gd" common-dep) +;; (cgo-file "wasseem.gd" common-dep) +;; (cgo-file "towb.gd" common-dep) +;; (cgo-file "wasstadc.gd" common-dep) +;; (cgo-file "gungame1.gd" common-dep) +;; (cgo-file "ljak.gd" common-dep) +;; (cgo-file "lwassig.gd" common-dep) +;; (cgo-file "deshover.gd" common-dep) +;; (cgo-file "wsd.gd" common-dep) +;; (cgo-file "lsamos.gd" common-dep) +;; (cgo-file "lfaccity.gd" common-dep) +;; (cgo-file "lblowtmh.gd" common-dep) +;; (cgo-file "ljaksig.gd" common-dep) +;; (cgo-file "ldmpckgn.gd" common-dep) +;; (cgo-file "lbbtcha1.gd" common-dep) +;; (cgo-file "railx.gd" common-dep) +;; (cgo-file "staa.gd" common-dep) +;; (cgo-file "wcaseem.gd" common-dep) +;; (cgo-file "dst.gd" common-dep) +;; (cgo-file "rubc.gd" common-dep) +;; (cgo-file "ipf.gd" common-dep) +;; (cgo-file "lnstoa.gd" common-dep) +;; (cgo-file "railf.gd" common-dep) +;; (cgo-file "deshunt.gd" common-dep) +;; (cgo-file "oasiscst.gd" common-dep) +;; (cgo-file "desinter.gd" common-dep) +;; (cgo-file "ctypesa.gd" common-dep) +;; (cgo-file "seo.gd" common-dep) +;; (cgo-file "railb.gd" common-dep) +;; (cgo-file "lerrol.gd" common-dep) +;; (cgo-file "lbbsprt3.gd" common-dep) +;; (cgo-file "ltowa.gd" common-dep) +;; (cgo-file "comba.gd" common-dep) +;; (cgo-file "stb.gd" common-dep) +;; (cgo-file "desc.gd" common-dep) +;; (cgo-file "lctyprot.gd" common-dep) +;; (cgo-file "lctyblow.gd" common-dep) +;; (cgo-file "voca.gd" common-dep) +;; (cgo-file "lbbring3.gd" common-dep) +;; (cgo-file "ctb.gd" common-dep) +;; (cgo-file "lbbring4.gd" common-dep) +;; (cgo-file "mic.gd" common-dep) +;; (cgo-file "lnstobc.gd" common-dep) +;; (cgo-file "ctypesb.gd" common-dep) +;; (cgo-file "cia.gd" common-dep) +;; (cgo-file "ldampksm.gd" common-dep) +;; (cgo-file "ljndklev.gd" common-dep) +;; (cgo-file "desrace2.gd" common-dep) +;; (cgo-file "hhg.gd" common-dep) +;; (cgo-file "ljakc.gd" common-dep) +;; (cgo-file "lbombbot.gd" common-dep) +;; (cgo-file "loutro2.gd" common-dep) +;; (cgo-file "citycast.gd" common-dep) +;; (cgo-file "seb.gd" common-dep) +;; (cgo-file "combn.gd" common-dep) +;; (cgo-file "lprenme.gd" common-dep) +;; (cgo-file "rbct.gd" common-dep) +;; (cgo-file "lbbsdrp2.gd" common-dep) +;; (cgo-file "lbbring5.gd" common-dep) +;; (cgo-file "rubb.gd" common-dep) +;; (cgo-file "ltrtwhls.gd" common-dep) +;; (cgo-file "ctycarc.gd" common-dep) +;; (cgo-file "towera.gd" common-dep) +;; (cgo-file "desw.gd" common-dep) +;; (cgo-file "lpatk.gd" common-dep) +;; (cgo-file "ljkdmpk.gd" common-dep) +;; (cgo-file "ltowb.gd" common-dep) +;; (cgo-file "destrack.gd" common-dep) +;; (cgo-file "slumbset.gd" common-dep) +;; (cgo-file "desboss2.gd" common-dep) +;; (cgo-file "combb.gd" common-dep) +;; (cgo-file "precc.gd" common-dep) +;; (cgo-file "desbcst.gd" common-dep) +;; (cgo-file "lctypalt.gd" common-dep) +;; (cgo-file "ltornjnx.gd" common-dep) +;; (cgo-file "factorya.gd" common-dep) +;; (cgo-file "ljakklev.gd" common-dep) +;; (cgo-file "sef.gd" common-dep) +;; (cgo-file "museum4.gd" common-dep) +;; (cgo-file "tema.gd" common-dep) +;; (cgo-file "lbbring1.gd" common-dep) +;; (cgo-file "ljakndax.gd" common-dep) +;; (cgo-file "vin.gd" common-dep) +;; (cgo-file "lfacb.gd" common-dep) +;; (cgo-file "lashelin.gd" common-dep) +;; (cgo-file "ljkcdmkl.gd" common-dep) +;; (cgo-file "lfacrm2.gd" common-dep) +;; (cgo-file "ljinx.gd" common-dep) +;; (cgo-file "lfactory.gd" common-dep) +;; (cgo-file "arenacst.gd" common-dep) +;; (cgo-file "lbbtcha3.gd" common-dep) +;; (cgo-file "wasdefen.gd" common-dep) +;; (cgo-file "templee.gd" common-dep) +;; (cgo-file "lmhcb.gd" common-dep) +;; (cgo-file "freecast.gd" common-dep) +;; (cgo-file "frstx.gd" common-dep) +;; (cgo-file "sek.gd" common-dep) +;; (cgo-file "lmhca.gd" common-dep) +;; (cgo-file "cwi.gd" common-dep) +;; (cgo-file "lprecc.gd" common-dep) +;; (cgo-file "hgb.gd" common-dep) +;; (cgo-file "desrace1.gd" common-dep) +;; (cgo-file "sea.gd" common-dep) +;; (cgo-file "nsa.gd" common-dep) +;; (cgo-file "lbiped.gd" common-dep) +;; (cgo-file "waschase.gd" common-dep) +;; (cgo-file "desrescc.gd" common-dep) +;; (cgo-file "desf.gd" common-dep) +;; (cgo-file "deserrol.gd" common-dep) +;; (cgo-file "cfb.gd" common-dep) +;; (cgo-file "lgunnorm.gd" common-dep) +;; (cgo-file "outcast3.gd" common-dep) +;; (cgo-file "mhca.gd" common-dep) +;; (cgo-file "ltnfxhip.gd" common-dep) +;; (cgo-file "introcst.gd" common-dep) +;; (cgo-file "cta.gd" common-dep) +;; (cgo-file "combc.gd" common-dep) +;; (cgo-file "seh.gd" common-dep) +;; (cgo-file "lfaccar.gd" common-dep) +;; (cgo-file "warpcast.gd" common-dep) +;; (cgo-file "lfacrm1.gd" common-dep) +;; (cgo-file "wca.gd" common-dep) +;; (cgo-file "lblowtkg.gd" common-dep) +;; (cgo-file "onintent.gd" common-dep) +;; (cgo-file "freehq.gd" common-dep) +;; (cgo-file "lform.gd" common-dep) +;; (cgo-file "towercst.gd" common-dep) +;; (cgo-file "lbbring2.gd" common-dep) +;; (cgo-file "ctypepc.gd" common-dep) +;; (cgo-file "lblowcst.gd" common-dep) +;; (cgo-file "see.gd" common-dep) +;; (cgo-file "lctysnpr.gd" common-dep) +;; (cgo-file "desrescg.gd" common-dep) +;; (cgo-file "mhctycst.gd" common-dep) +;; (cgo-file "ltorn.gd" common-dep) +;; (cgo-file "desg.gd" common-dep) +;; (cgo-file "facd.gd" common-dep) +;; (cgo-file "desboss1.gd" common-dep) +;; (cgo-file "lforp.gd" common-dep) +;; (cgo-file "ljakcklv.gd" common-dep) +;; (cgo-file "ctycarkg.gd" common-dep) +;; (cgo-file "temp.gd" common-dep) +;; (cgo-file "lkeira.gd" common-dep) +;; (cgo-file "ctypepb.gd" common-dep) +;; (cgo-file "sej.gd" common-dep) +;; (cgo-file "desh.gd" common-dep) +;; (cgo-file "wasstadb.gd" common-dep) +;; (cgo-file "lbbsprt2.gd" common-dep) +;; (cgo-file "lbbsdrp3.gd" common-dep) +;; (cgo-file "museum.gd" common-dep) +;; (cgo-file "ldesgcst.gd" common-dep) +;; (cgo-file "ltnjxhip.gd" common-dep) +;; (cgo-file "ldax.gd" common-dep) +;; (cgo-file "intpalrf.gd" common-dep) +;; (cgo-file "lcitysml.gd" common-dep) +;; (cgo-file "title.gd" common-dep) +;; (cgo-file "desb.gd" common-dep) +;; (cgo-file "facb.gd" common-dep) +;; (cgo-file "mia.gd" common-dep) +;; (cgo-file "temx.gd" common-dep) +;; (cgo-file "ctycarb.gd" common-dep) +;; (cgo-file "hga.gd" common-dep) +;; (cgo-file "ctycara.gd" common-dep) +;; (cgo-file "lnstobb.gd" common-dep) +;; (cgo-file "lmech.gd" common-dep) +;; (cgo-file "gridcst.gd" common-dep) +;; (cgo-file "lbbtcha2.gd" common-dep) +;; (cgo-file "ljkfeet.gd" common-dep) +;; (cgo-file "mib.gd" common-dep) +;; (cgo-file "facc.gd" common-dep) +;; (cgo-file "raile.gd" common-dep) +;; (cgo-file "combd.gd" common-dep) +;; (cgo-file "lsigklv.gd" common-dep) +;; (cgo-file "ldampeck.gd" common-dep) +;; (cgo-file "deschase.gd" common-dep) +;; (cgo-file "museum3.gd" common-dep) +;; (cgo-file "minee.gd" common-dep) +;; (cgo-file "lctyass.gd" common-dep) +;; (cgo-file "wcb.gd" common-dep) +;; (cgo-file "lpatkcs.gd" common-dep) +;; (cgo-file "cfa.gd" common-dep) +;; (cgo-file "ruba2.gd" common-dep) +;; (cgo-file "ldamsig.gd" common-dep) +;; (cgo-file "precb.gd" common-dep) +;; (cgo-file "railb2.gd" common-dep) +;; (cgo-file "lbbspirt.gd" common-dep) +;; (cgo-file "temd.gd" common-dep) +;; (cgo-file "mined.gd" common-dep) +;; (cgo-file "wwd.gd" common-dep) +;; (cgo-file "loutro3.gd" common-dep) +;; (cgo-file "sec.gd" common-dep) +;; (cgo-file "lsnkwhls.gd" common-dep) +;; (cgo-file "loninsim.gd" common-dep) +;; (cgo-file "cib.gd" common-dep) +;; (cgo-file "inttitle.gd" common-dep) +;; (cgo-file "desresc.gd" common-dep) +;; (cgo-file "lwasbbv.gd" common-dep) +;; (cgo-file "lforring.gd" common-dep) +;; (cgo-file "museum3b.gd" common-dep) +;; (cgo-file "gga.gd" common-dep) +;; (cgo-file "desliz.gd" common-dep) +;; (cgo-file "desjump.gd" common-dep) +;; (cgo-file "raila.gd" common-dep) +;; (cgo-file "lseemwca.gd" common-dep) +;; (cgo-file "lkleever.gd" common-dep) +;; (cgo-file "desd.gd" common-dep) +;; (cgo-file "lfaco.gd" common-dep) +;; (cgo-file "ldamklev.gd" common-dep) +;; (cgo-file "powergd.gd" common-dep) +;; (cgo-file "lptrl.gd" common-dep) +;; (cgo-file "lsig.gd" common-dep) +;; (cgo-file "ruba.gd" common-dep) +;; (cgo-file "win.gd" common-dep) +;; (cgo-file "wasstada.gd" common-dep) +;; (cgo-file "sei.gd" common-dep) +;; (cgo-file "cpo.gd" common-dep) +;; (cgo-file "waspala.gd" common-dep) +;; (cgo-file "museum4b.gd" common-dep) +;; (cgo-file "seg.gd" common-dep) +;; (cgo-file "frstb.gd" common-dep) +;; (cgo-file "nsb.gd" common-dep) +;; (cgo-file "cgb.gd" common-dep) +;; (cgo-file "lvincst.gd" common-dep) +;; (cgo-file "sel.gd" common-dep) +;; (cgo-file "lctydest.gd" common-dep) +;; (cgo-file "sta.gd" common-dep) +;; (cgo-file "wasleapr.gd" common-dep) +;; (cgo-file "desrally.gd" common-dep) +;; (cgo-file "temb.gd" common-dep) +;; (cgo-file "ctypepa.gd" common-dep) +;; (cgo-file "lwstdpck.gd" common-dep) +;; (cgo-file "museum2.gd" common-dep) +;; (cgo-file "sed.gd" common-dep) +;; (cgo-file "desa.gd" common-dep) +;; (cgo-file "towerc.gd" common-dep) +;; (cgo-file "desbattl.gd" common-dep) +;; (cgo-file "frsta.gd" common-dep) +;; (cgo-file "lsigjakc.gd" common-dep) +;; (cgo-file "vocx.gd" common-dep) +;; (cgo-file "lbbspid.gd" common-dep) +;; (cgo-file "sen.gd" common-dep) +;; (cgo-file "mhcb.gd" common-dep) +;; (cgo-file "lctypatk.gd" common-dep) +;; (cgo-file "lbbring6.gd" common-dep) + ;;;;;;;;;;;;;;;;;;;;; ;; ANIMATIONS ;;;;;;;;;;;;;;;;;;;;; -;; (copy-strs "") +(copy-strs + "ARF1INTR" "CIBBRES" "CIPFINTR" "DAD16" "DEAR1RES" "DEHRES" + "ARF1RES" "CIBTINTR" "CIPGINTR" "DAD17" "DEAR2INT" "DEJGOTA" + "ARF2INTR" "CIDGRES" "CIPGRES" "DAD18" "DEATIN" "DEJGOTB" + "ARF2RES" "CIFCEINT" "CIPHINTR" "DAD20" "DEATOUT" "DEJGOTC" + "ARF3INTR" "CIGC1RES" "CIPHRES" "DAD21" "DEBBINTR" "DEJMINTR" + "ARF3RES" "CIGC2INT" "CISFINTR" "DAD24" "DECLINTR" "DELC2" + "AROUTRO" "CIGC2RES" "COETEMPL" "DAD31" "DECRINTR" "DELC3" + "ART1INTR" "CIGCINTR" "COEXIT" "DAD35" "DECWIN" "DELCATCH" + "CAGSHIEL" "CIGDPUNC" "DAD06" "DAD38" "DEFBIA" "DEODRB" + "CATRES" "CIGTCINT" "DAD07" "DAD57" "DEFBINTR" "DEODRES" + "CAWRRES" "CIHVRES" "DAD10" "DAD58" "DEFBRB" "DERINTRO" + "CIATIDES" "CIPAIB" "DAD12" "DAD61" "DEFBRES" "DERRA" + "CIATOUT" "CIPAINTR" "DAD13" "DAMOLE" "DEGRES" "DESCREEN" + "CIBBINTR" "CIPARES" "DAD14" "DEAR1INT" "DEHINTRO" "DPBTURRE" + "FABINTRO" "INDROP" "JABOARD" "JAEGOLD" "JAPGLIDE" "KRWB3" + "FABRES" "INFFHQ" "JACARRY" "JAELIGHT" "JAPGUN" "MIBINTRO" + "FAI1INTR" "INLOST" "JAD1" "JAENORMA" "JAPHCAR" "MIBRES" + "FAI2INTR" "INPALACE" "JAD2" "JAEXTERN" "JAPIDAX" "MIERES" + "FAI3INTR" "INRESCUE" "JAD3" "JAFLDAX" "JAPILOT" "MIGEXIT" + "FAI4INTR" "INTIRED" "JAD4" "JAFLUT" "JAPOLE" "MITINTRO" + "FASBIB" "INTRAINI" "JAD5" "JAGUN" "JAPWCAR" "MITRES" + "FASBINTR" "JAA1" "JADARK" "JAICE" "JARACER" "MU2ANIMS" + "FASBRES" "JAA2" "JADON" "JAINDAX" "JASWIM" "MU3ANIMS" + "FORB" "JAA3" "JADUMMY" "JAKANGA" "JATENTAC" "MU4ANIMS" + "FORCRES" "JAA4" "JAEBOARD" "JALADDER" "JATUBE" "MUANIMS" + "FOTOMRES" "JAA5" "JAEDARK" "JALIGHT" "JATURRET" "NEDBARRI" + "FOTOWER" "JAA6" "JAEGC" "JAMECH" "KRWB1" "NEEINTRO" + "GRMANIMS" "JAA7" "JAEGNORM" "JAPEGASU" "KRWB2" "NEHINTRO" + "NEHRES" "PRHC" "SEMEXIT" "TEORES" "WADRES" "NSB1BREA" + "PRHFINAL" "SEMHINTR" "TETINTRO" "WAGINTRO" "NSB2BREA" "PRMINIMA" + "SEPEXIT" "TETRA" "WAGRES" "PARAINTR" "PRTRES" "SESGRUNT" + "TETRB" "WALRINTR" "PARARA" "RATA1INT" "SEWATERS" "TEWDESER" + "WALRRES" "PARARES" "RATA2INT" "TECINTRO" "TODINTRO" "WAPGINTR" + "PARPINTR" "SCBOOK" "TECRES" "TODRB" "WAPGRES" "PEFLY" + "SEEINTRO" "TEDINTRO" "TODRES" "WOMAP" "POAINTRO" "SEGENTRA" + "TEDRES" "VODRES" "PRDSERES" "SEHKENTR" "TEEANIMS" "VOI1INTR" + "PRDSLOSE" "SEHKRES" "TEELAANI" "VOI1RES" "PRDSRES" "SEKENTRA" + "TEELODS" "VOI2INTR" "PRHA" "SEKEXIT" "TEJGLGLI" "VOI2RES" + "PRHB" "SEKMINTR" "TEOINTRO" "WACINTRO") + + ;;;;;;;;;;;;;;;;;;;;; ;; MUSIC diff --git a/goal_src/jak3/kernel-defs.gc b/goal_src/jak3/kernel-defs.gc index 8f764201f7..4fbda15f8c 100644 --- a/goal_src/jak3/kernel-defs.gc +++ b/goal_src/jak3/kernel-defs.gc @@ -328,6 +328,8 @@ (define-extern __pc-texture-upload-now (function object object none)) (define-extern __pc-texture-relocate (function object object object none)) +(define-extern __pc-set-levels (function (pointer string) none)) +(define-extern __pc-set-active-levels (function (pointer string) none)) (define-extern link-resume (function int)) (define-extern unload (function string none)) diff --git a/goal_src/jak3/kernel/gstate.gc b/goal_src/jak3/kernel/gstate.gc index f0f8404a23..5a4331ccae 100644 --- a/goal_src/jak3/kernel/gstate.gc +++ b/goal_src/jak3/kernel/gstate.gc @@ -203,7 +203,10 @@ ) ) (#t - `(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + `(begin + (set! (-> ,new-state parent) #f) + (define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ) ) ) ) diff --git a/goal_src/jak3/levels/common-obs/ladder.gc b/goal_src/jak3/levels/common-obs/ladder.gc index b729bdac9f..174f0cf650 100644 --- a/goal_src/jak3/levels/common-obs/ladder.gc +++ b/goal_src/jak3/levels/common-obs/ladder.gc @@ -7,3 +7,219 @@ ;; DECOMP BEGINS +(deftype ladder (process-drawable) + ((root collide-shape :override) + (rider-unit float) + (rider-time time-frame) + (art-height meters) + (set-height meters) + (meters-per-unit meters) + (meters-per-rung meters) + (options ladder-options) + ) + (:state-methods + idle + (active handle) + ) + (:methods + (init-collision! (_type_) none) + (init-skel! (_type_) none) + (init-params! (_type_) none) + (ladder-method-25 (_type_ matrix float) matrix) + (nop (_type_) none) + ) + ) + + +(defskelgroup skel-ladder ladder ladder-lod0-jg ladder-idle-ja + ((ladder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 16) + ) + +(defstate idle (ladder) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let* ((s4-0 proc) + (s2-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s2-0 + (let ((s4-1 (ladder-method-25 self (new 'stack-no-clear 'matrix) 0.0)) + (s3-0 (ladder-method-25 self (new 'stack-no-clear 'matrix) 1.0)) + (s1-0 (get-trans (the-as process-focusable s2-0) 0)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (vector-segment-distance-point! s1-0 (-> s4-1 trans) (-> s3-0 trans) s2-1) + (when (and (time-elapsed? (-> self rider-time) (seconds 0.2)) + (if (< 0.0 (vector-dot (vector-! (new 'stack-no-clear 'vector) s1-0 s2-1) (-> s4-1 fvec))) + (not (logtest? (-> self options) (ladder-options lo0))) + (not (logtest? (-> self options) (ladder-options lo1))) + ) + (send-event proc 'ladder (-> block param 0)) + ) + (set! (-> self meters-per-unit) (vector-vector-distance (-> s4-1 trans) (-> s3-0 trans))) + (set! (-> self rider-unit) (/ (vector-vector-distance (-> s4-1 trans) s2-1) (-> self meters-per-unit))) + (set-time! (-> self rider-time)) + (go-virtual active (process->handle proc)) + ) + ) + (the-as ladder-options #f) + ) + ) + ) + (('options) + (-> self options) + ) + ) + ) + :code (behavior () + (until #f + (nop self) + (suspend) + ) + #f + ) + :post ja-post + ) + +(defstate active (ladder) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('matrix) + (let ((v0-0 (the-as object (ladder-method-25 self (the-as matrix (-> block param 0)) (-> self rider-unit))))) + (set-time! (-> self rider-time)) + v0-0 + ) + ) + (('move) + (set! (-> self rider-unit) + (fmax 0.0 (fmin 1.0 (+ (-> self rider-unit) (/ (the-as float (-> block param 0)) (-> self meters-per-unit))))) + ) + (* (-> self rider-unit) (/ (-> self meters-per-unit) (-> self meters-per-rung))) + ) + (('pos) + (if (> argc 0) + (set! (-> (the-as vector (-> block param 0)) quad) (-> self node-list data 5 bone transform uvec quad)) + ) + (-> self rider-unit) + ) + (('stance) + (let* ((f0-8 (/ (* 0.5 (-> self meters-per-rung)) (-> self meters-per-unit))) + (f1-12 (* (the float (the int (/ (+ (-> self rider-unit) (* 0.5 f0-8)) f0-8))) f0-8)) + ) + (+! (-> self rider-unit) (* 0.1 (- f1-12 (-> self rider-unit)))) + (set! (-> self rider-unit) (seek (-> self rider-unit) f1-12 (* 2.0 (seconds-per-frame) f0-8))) + ) + ) + (('options) + (-> self options) + ) + ) + ) + :code (behavior ((arg0 handle)) + (set-time! (-> self rider-time)) + (while (let ((s5-0 (handle->process arg0))) + (and (if (type? s5-0 process-focusable) + s5-0 + ) + (not (time-elapsed? (-> self rider-time) (seconds 0.1))) + ) + ) + (nop self) + (suspend) + ) + (go-virtual idle) + ) + ) + +(defmethod init-collision! ((this ladder)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 0) + (set-vector! (-> v1-2 local-sphere) 0.0 10240.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-skel! ((this ladder)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ladder" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +(defmethod init-params! ((this ladder)) + (set! (-> this meters-per-rung) 6144.0) + (set! (-> this art-height) 94208.0) + (set! (-> this set-height) (res-lump-float (-> this entity) 'height :default 94208.0)) + (set! (-> this options) (res-lump-value (-> this entity) 'options ladder-options :time -1000000000.0)) + 0 + (none) + ) + +(defmethod ladder-method-25 ((this ladder) (arg0 matrix) (arg1 float)) + (let ((s4-0 (-> this node-list data 4 bone transform)) + (s3-0 (new 'stack-no-clear 'matrix)) + ) + (let* ((a2-1 (-> this node-list data 5 bone transform)) + (v1-4 (-> a2-1 rvec quad)) + (a0-1 (-> a2-1 uvec quad)) + (a1-1 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> s3-0 rvec quad) v1-4) + (set! (-> s3-0 uvec quad) a0-1) + (set! (-> s3-0 fvec quad) a1-1) + (set! (-> s3-0 trans quad) a2-2) + ) + (vector+! + (-> s3-0 trans) + (-> s3-0 trans) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s4-0 trans) (-> s3-0 trans)) 9830.4) + ) + (matrix-lerp! arg0 s4-0 s3-0 arg1) + ) + ) + +(defmethod nop ((this ladder)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this ladder) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (init-skel! this) + (init-params! this) + (if (logtest? (-> this options) (ladder-options nodraw)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + ) + (set! (-> this root scale y) (/ (-> this set-height) (-> this art-height))) + (set! (-> this draw bounds y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) + (set! (-> this draw bounds w) (+ 2048.0 (* 0.5 (-> this set-height)))) + (set! (-> this root root-prim local-sphere y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) + (set! (-> this root root-prim local-sphere w) (+ 2048.0 (* 0.5 (-> this set-height)))) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/lib/project-lib.gp b/goal_src/jak3/lib/project-lib.gp index b10872a349..fdb35b6c49 100644 --- a/goal_src/jak3/lib/project-lib.gp +++ b/goal_src/jak3/lib/project-lib.gp @@ -112,15 +112,15 @@ ) ) -(defmacro copy-go (name) - (let* ((path (string-append "$DECOMP/raw_obj/" name ".go"))) +(defmacro copy-obj (name) + (let* ((path (string-append "$DECOMP/raw_obj/" name))) `(defstep :in ,path :tool 'copy - :out '(,(string-append "$OUT/obj/" name ".go"))))) + :out '(,(string-append "$OUT/obj/" name))))) -(defmacro copy-gos (&rest gos) +(defmacro copy-objs (&rest gos) `(begin - ,@(apply (lambda (x) `(copy-go ,x)) gos) + ,@(apply (lambda (x) `(copy-obj ,x)) gos) ) ) @@ -167,7 +167,7 @@ (set! curr-elt (cdr curr-elt))) new-list)) -(defmacro cgo-file (dgo-file-name deps) +(defmacro cgo-file (dgo-file-name deps &key (bsp-file-name #f)) ;; First read in the DGO file, it has pretty much everything we need (let ((dgo-data (car (read-data-file (string-append "goal_src/jak3/dgos/" dgo-file-name))))) ;; Get the name of the DGO @@ -175,7 +175,7 @@ (files (cadr dgo-data)) (gsrc-seq-args '()) (textures '()) - (gos '())) + (objs '())) ;; create the dgo step (cgo dgo-name dgo-file-name) ;; Now we iterate through the list of files, skipping ones we've already processed @@ -186,7 +186,9 @@ (when (not (car (hash-table-try-ref *file-entry-map* file-name))) ;; Depending on the type of file, generate the appropriate steps (cond - ((string-ends-with? file-name ".o") + ((and (string-ends-with? file-name ".o") + (neq? file-name bsp-file-name) + ) ;; build up a list of all gsrc files needing to be compiled (let ((base-name (symbol->string (first (string-split file-name "."))))) (cond @@ -211,23 +213,25 @@ ;; copy textures (let ((tpage-id (second (string-split (symbol->string (first (string-split file-name "."))) "-")))) (set! textures (cons tpage-id textures)))) - ((string-ends-with? file-name ".go") + ((or (string-ends-with? file-name ".go") + (eq? file-name bsp-file-name) + ) ;; copy art files - (set! gos (cons (stem file-name) gos)))) + (set! objs (cons file-name objs)))) ;; Update the map so this file isn't processed again (hash-table-set! *file-entry-map* file-name #f))) (set! files (cdr files))) ;; TODO - need an `append`!, reverse lists by re-cons'ing them for now (set! gsrc-seq-args (reverse-list gsrc-seq-args)) (set! textures (reverse-list textures)) - (set! gos (reverse-list gos)) + (set! objs (reverse-list objs)) `(begin ;; macros can't return nothing, so these macros assume they will be given a non-empty list (when (not (null? '(,@gsrc-seq-args))) (goal-src-sequence "" :deps ,(eval deps) ,@gsrc-seq-args)) (when (not (null? '(,@textures))) (copy-textures ,@textures)) - (when (not (null? '(,@gos))) - (copy-gos ,@gos))) + (when (not (null? '(,@objs))) + (copy-objs ,@objs))) ) )) diff --git a/test/decompiler/reference/jak3/decompiler-macros.gc b/test/decompiler/reference/jak3/decompiler-macros.gc index 5765211c53..c1c799a041 100644 --- a/test/decompiler/reference/jak3/decompiler-macros.gc +++ b/test/decompiler/reference/jak3/decompiler-macros.gc @@ -231,7 +231,10 @@ ) ) (#t - `(define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + `(begin + (set! (-> ,new-state parent) #f) + (define-state-hook ,state-name ,defstate-type ,new-state :event ,event :enter ,enter :trans ,trans :exit ,exit :code ,code :post ,post) + ) ) ) ) @@ -1680,5 +1683,40 @@ ) ) +(defmacro .sll (result in sa) + `(set! ,result (sext32 (the-as int (shl (logand ,in #xffffffff) ,sa)))) + ) + +(defmacro vftoi12.xyzw (dst src) + "convert to 20.12 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + `(begin + (rlet ((temp :class vf)) + (set! temp 4096.0) + (.mul.x.vf temp ,src temp) + (.ftoi.vf ,dst temp) + ) + ) + ) + +(defmacro vitof15.xyzw (dst src) + "convert from a 17.15 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + +`(begin + (rlet ((temp :class vf)) + (.itof.vf ,dst ,src) + (set! temp 0.000030517578125) + (.mul.x.vf ,dst ,dst temp) + ) + ) +) + (import "goal_src/jak3/engine/data/tpages.gc") (import "goal_src/jak3/engine/data/textures.gc") \ No newline at end of file diff --git a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc index 9efe877b58..e04136aa84 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy-h_REF.gc @@ -511,7 +511,7 @@ (rnd-chance? (_type_ float) symbol) (enemy-method-134 (_type_ float) symbol) (enemy-method-135 (_type_) none) - (set-ground-pat! (_type_ collide-query collide-spec float float float) pat-surface) + (set-ground-pat! (_type_ collide-query collide-spec float float float process) pat-surface) (enemy-above-ground? (_type_ collide-query vector collide-spec float float float) symbol) (try-locate-ground (_type_ meters meters symbol collide-spec) symbol) (move-above-ground! (_type_ vector move-above-ground-params) none) diff --git a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc index e8c72feadd..77836a2f6c 100644 --- a/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak3/engine/ai/enemy_REF.gc @@ -835,8 +835,8 @@ ) ;; definition for method 136 of type enemy -(defmethod set-ground-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) - (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) +(defmethod set-ground-pat! ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) (let ((v0-1 (-> arg0 best-other-tri pat))) (set! (-> this root ground-pat) v0-1) v0-1 @@ -852,17 +852,9 @@ ;; definition for method 138 of type enemy ;; INFO: Used lq/sq (defmethod try-locate-ground ((this enemy) (arg0 meters) (arg1 meters) (arg2 symbol) (arg3 collide-spec)) - (let* ((s4-0 (new 'stack-no-clear 'collide-query)) - (a0-1 this) - (t9-0 (method-of-object a0-1 set-ground-pat!)) - (v1-1 s4-0) - (t3-0 arg3) - (a3-1 arg0) - (t0-1 arg1) - (t1-0 1024.0) - ) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond - ((t9-0 a0-1 v1-1 t3-0 a3-1 t0-1 t1-0) + ((set-ground-pat! this s4-0 arg3 arg0 arg1 1024.0 (the-as process #f)) (let ((s5-1 (-> this root))) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> this root trans quad)) @@ -938,16 +930,9 @@ (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) - (let* ((s2-0 (new 'stack-no-clear 'collide-query)) - (t9-1 (method-of-object this set-ground-pat!)) - (a1-2 s2-0) - (a2-2 (-> arg1 gnd-collide-with)) - (a3-0 (-> arg1 popup)) - (t0-0 81920.0) - (t1-0 1024.0) - ) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) (cond - ((t9-1 this a1-2 a2-2 a3-0 t0-0 t1-0) + ((set-ground-pat! this s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s2-0 best-other-tri pat)) @@ -2421,18 +2406,18 @@ ) (set! (-> s5-1 quad) (-> gp-0 trans quad)) (vector-v++! s5-1 (-> gp-0 transv)) - (let* ((a0-6 gp-0) - (t9-4 (method-of-object a0-6 find-ground)) - (a2-1 (-> self enemy-info recover-gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (t9-4 a0-6 s4-1 a2-1 a3-0 t0-0 t1-0) - (when (>= (-> gp-0 gspot-pos y) (-> s5-1 y)) - (set! (-> s5-1 y) (-> gp-0 gspot-pos y)) - (vector-reset! (-> gp-0 transv)) - ) + (when (find-ground + gp-0 + s4-1 + (-> self enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) + (when (>= (-> gp-0 gspot-pos y) (-> s5-1 y)) + (set! (-> s5-1 y) (-> gp-0 gspot-pos y)) + (vector-reset! (-> gp-0 transv)) ) ) (move-to-point! gp-0 s5-1) @@ -2479,15 +2464,8 @@ (defmethod on-ground? ((this enemy)) (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) - (let* ((a1-0 (new 'stack-no-clear 'collide-query)) - (v1-0 (-> this root)) - (t9-0 (method-of-object v1-0 find-ground)) - (a2-1 (-> this gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (t9-0 v1-0 a1-0 a2-1 a3-0 t0-0 t1-0) + (let ((a1-0 (new 'stack-no-clear 'collide-query))) + (find-ground (-> this root) a1-0 (-> this gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f)) ) (>= (+ 409.6 (-> gp-0 gspot-pos y)) (-> gp-0 trans y)) ) @@ -2919,14 +2897,14 @@ (a1-0 (new 'stack-no-clear 'collide-query)) ) (if (or (< 0.0 (-> this root transv y)) (begin - (let* ((v1-3 gp-0) - (t9-0 (method-of-object v1-3 find-ground)) - (a2-1 (-> this enemy-info recover-gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (t9-0 v1-3 a1-0 a2-1 a3-0 t0-0 t1-0) + (find-ground + gp-0 + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) ) (let ((f0-2 (- (-> gp-0 trans y) (-> gp-0 gspot-pos y)))) (and (>= f0-2 -1228.8) (>= 6144.0 f0-2)) diff --git a/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc index a14b8bb8fa..1df3e0147f 100644 --- a/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/fma-sphere_REF.gc @@ -173,7 +173,7 @@ ) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> self root trans) (-> self sphere r) (new 'static 'rgba :r #x80 :g #x40 :a #x80) diff --git a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc index 52489920d0..03b43925bf 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-layout_REF.gc @@ -280,7 +280,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id bucket583) + (bucket-id debug) gp-0 (the-as (pointer dma-tag) a3-2) ) @@ -3721,7 +3721,3 @@ (cam-layout-stop) (cam-layout-start) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc b/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc index 73b5aa312c..63000e8a9f 100644 --- a/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/jak3/engine/camera/cam-update_REF.gc @@ -213,8 +213,8 @@ ) (when (= a0-45 s3-0) (if (>= v1-95 0) - (add-debug-sphere #t (bucket-id bucket583) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :b #xff :a #x80)) - (add-debug-sphere #t (bucket-id bucket583) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :r #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> s2-0 data s1-0) (meters 1) (new 'static 'rgba :r #xff :a #x80)) ) ) ) @@ -246,7 +246,7 @@ (+! (-> a3-6 z) (the float (* (-> v1-109 back-box-max z) (the int (-> s4-1 bsp bsp-scale z))))) ) ) - (add-debug-box #t (bucket-id bucket583) a2-7 a3-6 (new 'static 'rgba :g #xff :b #xff :a #x80)) + (add-debug-box #t (bucket-id debug) a2-7 a3-6 (new 'static 'rgba :g #xff :b #xff :a #x80)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc index 40c7d9018e..7e7c568c05 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-cache-h_REF.gc @@ -65,6 +65,7 @@ Contains a reference back to the source object (like a collide-shape or water-co (prim-index uint16 :overlay-at (-> extra-quad 8)) (user16 uint16 :overlay-at (-> extra-quad 10)) (user32 uint32 :overlay-at (-> extra-quad 12)) + (clear-flags uint128 :overlay-at (-> extra-quad 0)) ) ) @@ -103,8 +104,8 @@ This can represent a sphere, a triangle mesh, or a group of other primitives wit (prim-type prim-type :overlay-at (-> prim-core prim-type)) ) (:methods - (collide-cache-prim-method-9 () none) - (collide-cache-prim-method-10 () none) + (resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float) + (resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float) ) ) @@ -139,7 +140,9 @@ To use it, it must first be 'filled' with geometry. Then you can manually inspec The supported queries are 'line-sphere' (raycast) and 'spheres' (check if intersecting anything). It is not useful for ollision queries against a specific foreground object, like 'am I on top of platform X right now?'." ((num-tris int32) + (num-tris-u32 uint32 :overlay-at num-tris) (num-prims int32) + (num-prims-u32 uint32 :overlay-at num-prims) (ignore-mask pat-surface) (ignore-processes process 2) (collide-box bounding-box :inline) @@ -150,19 +153,19 @@ It is not useful for ollision queries against a specific foreground object, like (tris collide-cache-tri 461 :inline) ) (:methods - (collide-cache-method-9 () none) + (debug-draw (_type_) none) (fill-and-probe-using-line-sphere (_type_ collide-query) float) (fill-and-probe-using-spheres (_type_ collide-query) symbol) (fill-using-bounding-box (_type_ collide-query) none) (fill-using-line-sphere (_type_ collide-query) none) - (collide-cache-method-14 () none) - (collide-cache-method-15 () none) + (fill-using-spheres (_type_ collide-query) none) + (reset (_type_) none) (probe-using-line-sphere (_type_ collide-query) float) - (collide-cache-method-17 () none) - (collide-cache-method-18 () none) - (collide-cache-method-19 () none) - (collide-cache-method-20 () none) - (collide-cache-method-21 () none) + (probe-using-spheres (_type_ collide-query) symbol) + (fill-from-bg (_type_ (function collide-hash int collide-list collide-query int) (function collide-cache collide-list collide-query none) collide-query) none) + (fill-from-fg-boxes (_type_) none) + (fill-from-fg-line-sphere (_type_ collide-query) none) + (fill-from-water (_type_ water-control) none) (collide-cache-method-22 () none) (collide-cache-method-23 () none) (collide-cache-method-24 () none) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-cache_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-cache_REF.gc new file mode 100644 index 0000000000..8ace03c78f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-cache_REF.gc @@ -0,0 +1,1064 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 15 of type collide-cache +;; WARN: Return type mismatch int vs none. +(defmethod reset ((this collide-cache)) + (set! (-> this num-tris) 0) + (set! (-> this num-prims) 0) + (set! (-> this ignore-processes 0) #f) + (set! (-> this ignore-processes 1) #f) + (set! *already-printed-exeeded-max-cache-tris* #f) + 0 + (none) + ) + +;; definition for method 18 of type collide-cache +;; WARN: Return type mismatch int vs none. +(defmethod fill-from-bg ((this collide-cache) + (arg0 (function collide-hash int collide-list collide-query int)) + (arg1 (function collide-cache collide-list collide-query none)) + (arg2 collide-query) + ) + (set! *already-printed-exeeded-max-cache-tris* #f) + (set! (-> *collide-list* num-items) 0) + (if *collide-list-boxes* + (add-debug-box + #t + (bucket-id debug) + (the-as vector (-> arg2 bbox)) + (-> arg2 bbox max) + (new 'static 'rgba :g #xff :b #xff :a #x80) + ) + ) + (dotimes (s3-0 (-> *level* length)) + (let ((v1-7 (-> *level* level s3-0))) + (if (= (-> v1-7 status) 'active) + (arg0 (-> v1-7 bsp collide-hash) 0 *collide-list* arg2) + ) + ) + ) + (if (> (-> *collide-list* num-items) 0) + (arg1 *collide-cache* *collide-list* arg2) + ) + 0 + (none) + ) + +;; definition for method 21 of type collide-cache +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 21 collide-cache) has a return type of none, but the expression builder found a return statement. +(defmethod fill-from-water ((this collide-cache) (arg0 water-control)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (if (or (not arg0) (zero? arg0)) + (return #f) + ) + (when (= (-> this num-prims) 100) + (if (and (= *cheat-mode* 'debug) (not *display-capture-mode*)) + (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") + ) + (return #f) + ) + (when (< 460 (+ (-> this num-tris) 2)) + (if (and (= *cheat-mode* 'debug) (not *display-capture-mode*)) + (print-exceeded-max-cache-tris) + ) + (return #f) + ) + (if (not (and (logtest? (-> arg0 flags) (water-flag active)) + (logtest? (-> arg0 flags) (water-flag can-ground)) + (logtest? (-> arg0 flags) (water-flag swim-ground under-water)) + (logtest? (water-flag over-water) (-> arg0 flags)) + (not (logtest? (water-flag jump-out) (-> arg0 flags))) + ) + ) + (return #f) + ) + (let ((v1-31 (-> arg0 collide-height))) + (.lvf vf1 (&-> this collide-box min quad)) + (.lvf vf3 (&-> this collide-box max quad)) + (let ((a2-6 (-> this num-prims-u32)) + (a3-4 (the-as (inline-array collide-cache-tri) (-> this tris (-> this num-tris)))) + ) + (.mov vf5 v1-31) + (.add.x.vf vf1 vf0 vf5 :mask #b10) + (set! (-> a3-4 0 clear-flags) (the-as uint128 0)) + (set! (-> a3-4 0 prim-index) a2-6) + (.add.x.vf vf3 vf0 vf5 :mask #b10) + (set! (-> a3-4 1 clear-flags) (the-as uint128 0)) + (set! (-> a3-4 1 prim-index) a2-6) + (.mov.vf vf2 vf1) + (.mov.vf vf4 vf1) + (.add.z.vf vf2 vf0 vf3 :mask #b100) + (.add.x.vf vf4 vf0 vf3 :mask #b1) + (.svf (&-> a3-4 0 vertex 0 quad) vf1) + (.svf (&-> a3-4 0 vertex 1 quad) vf2) + (.svf (&-> a3-4 0 vertex 2 quad) vf3) + (set! (-> a3-4 0 pat) (new 'static 'pat-surface :material (pat-material waterbottom) :nogrind #x1)) + (set! (-> a3-4 0 collide-ptr) arg0) + (.svf (&-> a3-4 1 vertex 0 quad) vf1) + (.svf (&-> a3-4 1 vertex 1 quad) vf3) + (.svf (&-> a3-4 1 vertex 2 quad) vf4) + (set! (-> a3-4 1 pat) (new 'static 'pat-surface :material (pat-material waterbottom))) + (set! (-> a3-4 1 collide-ptr) arg0) + ) + ) + (let ((v1-34 *collide-shape-prim-water*) + (a1-5 (-> this prims (-> this num-prims))) + ) + (set! (-> a1-5 first-tri) (the-as uint (-> this num-tris))) + (set! (-> a1-5 num-tris) (the-as uint 2)) + (set! (-> a1-5 prim) v1-34) + (set! (-> a1-5 ccache) this) + (set! (-> a1-5 prim-core world-sphere quad) (-> v1-34 prim-core world-sphere quad)) + (set! (-> a1-5 prim-core quad 1) (-> v1-34 prim-core quad 1)) + ) + (+! (-> this num-prims) 1) + (+! (-> this num-tris) 2) + 0 + (none) + ) + ) + +;; definition for method 12 of type collide-cache +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fill-using-bounding-box ((this collide-cache) (arg0 collide-query)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (+! (-> *collide-stats* calls) 1) + (new 'static 'vector :x 0.5) + (nop!) + (let ((v1-4 (-> arg0 collide-with-s32))) + (nop!) + (let ((a0-2 (-> arg0 ignore-process0))) + (nop!) + (let ((a1-1 (-> arg0 ignore-process1))) + (nop!) + (let ((a2-0 (-> arg0 ignore-pat-s32))) + (nop!) + (.lvf vf1 (&-> arg0 bbox min quad)) + (nop!) + (.lvf vf2 (&-> arg0 bbox max quad)) + (nop!) + (set! (-> this ignore-processes 0) (the-as process a0-2)) + (nop!) + (set! (-> this ignore-processes 1) (the-as process a1-1)) + (.mov.vf vf1 vf0 :mask #b1000) + (nop!) + (.mov.vf vf2 vf0 :mask #b1000) + (set! (-> this ignore-mask) (the-as pat-surface a2-0)) + ) + ) + ) + (.ftoi.vf vf3 vf1) + (nop!) + (.ftoi.vf vf4 vf2) + (set! (-> this num-tris) 0) + (nop!) + (.svf (&-> this collide-box min quad) vf1) + (nop!) + (.svf (&-> this collide-box max quad) vf2) + (nop!) + (.svf (&-> this collide-box4w min quad) vf3) + (nop!) + (.svf (&-> this collide-box4w max quad) vf4) + (nop!) + (.svf (&-> arg0 bbox4w min quad) vf3) + (nop!) + (.svf (&-> arg0 bbox4w max quad) vf4) + (nop!) + (set! (-> this num-prims) 0) + (nop!) + (set! (-> this collide-with) (the-as collide-spec v1-4)) + ) + 0 + (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) + (fill-from-bg + this + (the-as + (function collide-hash int collide-list collide-query int) + (method-of-type collide-hash drawable-method-11) + ) + collide-list-fill-bg-using-box + arg0 + ) + (dotimes (s4-0 (-> *level* length)) + (let ((v1-15 (-> *level* level s4-0))) + (when (= (-> v1-15 status) 'active) + (let ((a0-6 (-> v1-15 bsp hfrag-drawable))) + (if (nonzero? a0-6) + (hfragment-method-17 (the-as hfragment a0-6) this arg0) + ) + ) + ) + ) + ) + (let ((a0-7 (-> this num-tris))) + (when (> a0-7 0) + (let ((v1-22 (-> this prims)) + (a1-9 *collide-shape-prim-backgnd*) + ) + (set! (-> v1-22 0 num-tris) (the-as uint a0-7)) + (set! (-> v1-22 0 prim) a1-9) + (set! (-> this num-prims) 1) + (set! (-> v1-22 0 first-tri) (the-as uint 0)) + (set! (-> v1-22 0 ccache) this) + (set! (-> v1-22 0 prim-core world-sphere quad) (-> a1-9 prim-core world-sphere quad)) + (set! (-> v1-22 0 prim-core quad 1) (-> a1-9 prim-core quad 1)) + ) + ) + ) + (+! (-> *collide-stats* output) (-> this num-tris)) + ) + (when (logtest? (-> arg0 collide-with) (collide-spec water)) + (let ((v1-29 (-> arg0 ignore-process0))) + (if v1-29 + (fill-from-water this (-> (the-as process-drawable v1-29) water)) + ) + ) + ) + (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) + (fill-from-fg-boxes this) + ) + 0 + (none) + ) + ) + +;; definition for method 13 of type collide-cache +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fill-using-line-sphere ((this collide-cache) (arg0 collide-query)) + (local-vars (v1-11 float) (v1-20 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf2 :class vf) + (vf20 :class vf) + (vf22 :class vf) + (vf23 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (+! (-> *collide-stats* calls) 1) + (let ((v1-3 0)) + (if (< (fabs (-> arg0 move-dist x)) 4096.0) + (+! v1-3 1) + ) + (if (< (fabs (-> arg0 move-dist y)) 4096.0) + (+! v1-3 1) + ) + (if (< (fabs (-> arg0 move-dist z)) 4096.0) + (+! v1-3 1) + ) + (when (< 1 v1-3) + (set-from-point-offset-pad! (-> arg0 bbox) (-> arg0 start-pos) (-> arg0 move-dist) (-> arg0 radius)) + (fill-using-bounding-box this arg0) + (b! #t cfg-55 :delay (nop!)) + (the-as none 0) + ) + ) + (nop!) + (let ((v1-10 (-> arg0 ignore-pat-s32))) + (nop!) + (let ((a0-14 (-> arg0 ignore-process0))) + (nop!) + (let ((a1-3 (-> arg0 ignore-process1))) + (nop!) + (let ((a2-1 (-> arg0 collide-with-s32))) + (nop!) + (.lvf vf9 (&-> arg0 exit-planes 0 quad)) + (nop!) + (.lvf vf3 (&-> arg0 move-dist quad)) + (nop!) + (.mov.vf vf13 vf0) + (nop!) + (.lvf vf1 (&-> arg0 start-pos quad)) + (.mul.vf vf8 vf3 vf3) + (nop!) + (.add.vf vf2 vf1 vf3) + (set! (-> this ignore-mask) (the-as pat-surface v1-10)) + (.add.y.vf vf8 vf8 vf8 :mask #b1) + (set! (-> this num-tris) 0) + (.min.vf vf4 vf1 vf2) + (set! (-> this num-prims) 0) + (.max.vf vf5 vf1 vf2) + (set! (-> this collide-with) (the-as collide-spec a2-1)) + ) + (.sub.w.vf vf10 vf0 vf9 :mask #b111) + (set! (-> this ignore-processes 0) (the-as process a0-14)) + (.add.z.vf vf8 vf8 vf8 :mask #b1) + (set! (-> this ignore-processes 1) (the-as process a1-3)) + ) + ) + ) + (.sub.w.vf vf4 vf4 vf9 :mask #b111) + (nop!) + (.add.w.vf vf5 vf5 vf9 :mask #b111) + (nop!) + (.ftoi.vf vf15 vf10) + (nop!) + (.isqrt.vf Q vf0 vf8 :fsf #b11 :ftf #b0) + (nop!) + (.add.w.vf vf11 vf0 vf9 :mask #b111) + (nop!) + (nop!) + (nop!) + (nop!) + (.svf (&-> arg0 local-box4w min quad) vf15) + (.ftoi.vf vf6 vf4) + (.svf (&-> this collide-box min quad) vf4) + (.ftoi.vf vf7 vf5) + (.svf (&-> this collide-box max quad) vf5) + (nop!) + (.svf (&-> arg0 bbox min quad) vf4) + (nop!) + (.svf (&-> arg0 bbox max quad) vf5) + (nop!) + (.svf (&-> this collide-box4w min quad) vf6) + (nop!) + (.svf (&-> this collide-box4w max quad) vf7) + (nop!) + (.svf (&-> arg0 bbox4w min quad) vf6) + (nop!) + (.svf (&-> arg0 bbox4w max quad) vf7) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (nop!) + (.mul.x.vf vf12 vf3 vf8) + (nop!) + (.nop.vf) + (nop!) + (.div.vf Q vf0 vf8 :fsf #b11 :ftf #b0) + (nop!) + (.mul.vf vf22 vf12 vf12) + (nop!) + (.abs.vf vf23 vf12) + (nop!) + (.add.y.vf vf22 vf22 vf22 :mask #b1) + (.mov v1-11 vf23) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (nop!) + (b! (zero? v1-11) cfg-12 :likely-delay (.add.z.vf vf13 vf0 vf12 :mask #b1)) + (.sub.y.vf vf13 vf0 vf12 :mask #b1) + (nop!) + (.isqrt.vf Q vf0 vf22 :fsf #b11 :ftf #b0) + (nop!) + (.add.x.vf vf13 vf0 vf12 :mask #b10) + (nop!) + (.wait.vf) + (nop!) + (.mul.vf vf13 vf13 Q :mask #b11) + (nop!) + (label cfg-12) + (.outer.product.a.vf acc vf12 vf13) + (nop!) + (.add.x.vf vf11 vf11 vf8 :mask #b1) + (nop!) + (.outer.product.b.vf vf14 vf13 vf12 acc) + (nop!) + (.ftoi.vf vf16 vf11) + (nop!) + (.mov.vf vf17 vf12) + (nop!) + (.mov.vf vf18 vf13) + (nop!) + (.mov.vf vf19 vf14) + (nop!) + (.mov.vf vf17 vf0 :mask #b1110) + (.svf (&-> arg0 local-box4w max quad) vf16) + (.mov.vf vf18 vf0 :mask #b1101) + (nop!) + (.mov.vf vf19 vf0 :mask #b1011) + (nop!) + (.add.x.vf vf17 vf17 vf13 :mask #b10) + (nop!) + (.add.y.vf vf18 vf18 vf12 :mask #b1) + (nop!) + (.add.z.vf vf19 vf19 vf12 :mask #b1) + (nop!) + (.add.x.vf vf17 vf17 vf14 :mask #b100) + (nop!) + (.add.y.vf vf18 vf18 vf14 :mask #b100) + (nop!) + (.add.z.vf vf19 vf19 vf13 :mask #b10) + (nop!) + (.mul.x.vf acc vf17 vf1) + (nop!) + (.add.mul.y.vf acc vf18 vf1 acc) + (.svf (&-> arg0 inv-mat rvec quad) vf17) + (.add.mul.z.vf vf20 vf19 vf1 acc) + (.svf (&-> arg0 inv-mat uvec quad) vf18) + (.sub.vf vf20 vf0 vf20) + (.svf (&-> arg0 inv-mat fvec quad) vf19) + (nop!) + (.svf (&-> arg0 inv-mat trans quad) vf20) + (set! (-> arg0 rlength x) (if (= (-> arg0 move-dist x) 0.0) + 0.0 + (/ 1.0 (-> arg0 move-dist x)) + ) + ) + (set! (-> arg0 rlength y) (if (= (-> arg0 move-dist y) 0.0) + 0.0 + (/ 1.0 (-> arg0 move-dist y)) + ) + ) + (set! (-> arg0 rlength z) (if (= (-> arg0 move-dist z) 0.0) + 0.0 + (/ 1.0 (-> arg0 move-dist z)) + ) + ) + (let ((f0-19 1.0)) + (.lvf vf1 (&-> (-> arg0 move-dist) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-20 vf1) + (set! (-> arg0 rlength w) (/ f0-19 v1-20)) + ) + (set! (-> arg0 exit-planes 0 x) (if (< 0.0 (-> arg0 move-dist x)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 0 y) (if (< 0.0 (-> arg0 move-dist y)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 0 z) (if (< 0.0 (-> arg0 move-dist z)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 1 x) (if (< (-> arg0 move-dist x) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 1 y) (if (< (-> arg0 move-dist y) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> arg0 exit-planes 1 z) (if (< (-> arg0 move-dist z) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) + (fill-from-bg + this + (the-as + (function collide-hash int collide-list collide-query int) + (method-of-type collide-hash drawable-method-12) + ) + collide-list-fill-bg-using-line-sphere + arg0 + ) + (dotimes (s4-0 (-> *level* length)) + (let ((v1-36 (-> *level* level s4-0))) + (when (= (-> v1-36 status) 'active) + (let ((a0-18 (-> v1-36 bsp hfrag-drawable))) + (if (nonzero? a0-18) + (hfragment-method-18 (the-as hfragment a0-18) this arg0) + ) + ) + ) + ) + ) + (let ((a0-19 (-> this num-tris))) + (when (> a0-19 0) + (let ((v1-43 (-> this prims)) + (a1-11 *collide-shape-prim-backgnd*) + ) + (set! (-> v1-43 0 num-tris) (the-as uint a0-19)) + (set! (-> v1-43 0 prim) a1-11) + (set! (-> this num-prims) 1) + (set! (-> v1-43 0 first-tri) (the-as uint 0)) + (set! (-> v1-43 0 ccache) this) + (set! (-> v1-43 0 prim-core world-sphere quad) (-> a1-11 prim-core world-sphere quad)) + (set! (-> v1-43 0 prim-core quad 1) (-> a1-11 prim-core quad 1)) + ) + ) + ) + (+! (-> *collide-stats* output) (-> this num-tris)) + ) + (when (logtest? (-> arg0 collide-with) (collide-spec water)) + (let ((a1-13 (-> (the-as process-drawable (-> arg0 ignore-process0)) water))) + (if (nonzero? a1-13) + (fill-from-water this a1-13) + ) + ) + ) + (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) + (fill-from-fg-line-sphere this arg0) + ) + 0 + (label cfg-55) + (none) + ) + ) + +;; definition for method 19 of type collide-cache +;; WARN: Return type mismatch int vs none. +(defmethod fill-from-fg-boxes ((this collide-cache)) + (let ((s5-0 (-> this collide-with))) + (set! *actor-list-length* 0) + (if (logtest? s5-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* (add-an-object *actor-hash* (-> this collide-box) *actor-list* 256)) + ) + (when (logtest? s5-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s5-0 (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w))) + ) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + (set! a0-2 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-13 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? s5-0 (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w))) + ) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + (set! a0-5 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s4-0 *actor-list-length*) + (let ((v1-26 (-> *actor-list* s4-0))) + (when (logtest? s5-0 (-> v1-26 root-prim prim-core collide-as)) + (let ((a0-13 (-> v1-26 process))) + (if (not (or (= a0-13 (-> this ignore-processes 0)) (= a0-13 (-> this ignore-processes 1)))) + (add-fg-prim-using-box (-> v1-26 root-prim) this) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type collide-shape-prim +;; WARN: Return type mismatch object vs none. +(defmethod add-fg-prim-using-box ((this collide-shape-prim) (arg0 collide-cache)) + (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") + (none) + ) + +;; definition for method 10 of type collide-shape-prim-mesh +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 10 collide-shape-prim-mesh)" 10 collide-shape-prim-mesh) + +;; definition for method 10 of type collide-shape-prim-sphere +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 10 collide-shape-prim-sphere)" 10 collide-shape-prim-sphere) + +;; definition for method 10 of type collide-shape-prim-group +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group) + +;; definition for method 20 of type collide-cache +;; WARN: Return type mismatch int vs none. +(defmethod fill-from-fg-line-sphere ((this collide-cache) (arg0 collide-query)) + (local-vars (v1-9 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (-> arg0 collide-with))) + (set! *actor-list-length* 0) + (if (logtest? s4-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* (fill-actor-list-for-sphere + *actor-hash* + (-> arg0 start-pos) + (-> arg0 move-dist) + (-> arg0 radius) + *actor-list* + 256 + -1 + ) + ) + ) + (let ((f30-0 0.0) + (s3-0 (new 'stack-no-clear 'matrix)) + ) + (.lvf vf1 (&-> (-> arg0 move-dist) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-9 vf1) + (let ((f0-1 v1-9)) + (if (< 0.0 f0-1) + (set! f30-0 (/ 1.0 f0-1)) + ) + ) + (when (logtest? s4-0 (collide-spec player-list)) + (let ((v1-17 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s2-0 (-> v1-17 next0))) + (while (!= v1-17 (-> *collide-player-list* alive-list-end)) + (let* ((s1-0 (-> (the-as connection v1-17) param1)) + (v1-18 (-> (the-as collide-shape s1-0) root-prim)) + ) + (when (logtest? s4-0 (-> v1-18 prim-core collide-as)) + (let ((s0-0 (-> v1-18 prim-core))) + (vector-! (-> s3-0 uvec) (the-as vector s0-0) (-> arg0 start-pos)) + (let* ((f1-2 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0)) + (f0-6 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-6) + ) + (let ((f0-7 (vector-vector-distance-squared (-> s3-0 rvec) (the-as vector s0-0))) + (f1-5 (+ (-> arg0 radius) (-> s0-0 world-sphere w))) + ) + (when (< f0-7 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-0)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! v1-17 s2-0) + *collide-player-list* + (set! s2-0 (-> s2-0 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-spec hit-by-player-list)) + (let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s2-1 (-> v1-38 next0))) + (while (!= v1-38 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((s1-1 (-> (the-as connection v1-38) param1)) + (v1-39 (-> (the-as collide-shape s1-1) root-prim)) + ) + (when (logtest? s4-0 (-> v1-39 prim-core collide-as)) + (let ((s0-1 (-> v1-39 prim-core))) + (vector-! (-> s3-0 uvec) (the-as vector s0-1) (-> arg0 start-pos)) + (let* ((f1-8 (* (vector-dot (-> arg0 move-dist) (-> s3-0 uvec)) f30-0)) + (f0-11 (fmax 0.0 (fmin 1.0 f1-8))) + ) + (vector+float*! (-> s3-0 rvec) (-> arg0 start-pos) (-> arg0 move-dist) f0-11) + ) + (let ((f0-12 (vector-vector-distance-squared (-> s3-0 rvec) (the-as vector s0-1))) + (f1-11 (+ (-> arg0 radius) (-> s0-1 world-sphere w))) + ) + (when (< f0-12 (* f1-11 f1-11)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape s1-1)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! v1-38 s2-1) + *collide-hit-by-player-list* + (set! s2-1 (-> s2-1 next0)) + ) + ) + ) + ) + ) + (dotimes (s3-1 *actor-list-length*) + (let ((v1-58 (-> *actor-list* s3-1))) + (when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as)) + (let ((a0-37 (-> v1-58 process))) + (if (not (or (= a0-37 (-> this ignore-processes 0)) (= a0-37 (-> this ignore-processes 1)))) + (add-fg-prim-using-line-sphere (-> v1-58 root-prim) this arg0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 11 of type collide-shape-prim +;; WARN: Return type mismatch object vs none. +(defmethod add-fg-prim-using-line-sphere ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) + (format + 0 + "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" + ) + (none) + ) + +;; definition for method 11 of type collide-shape-prim-mesh +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 11 collide-shape-prim-mesh)" 11 collide-shape-prim-mesh) + +;; definition for method 11 of type collide-shape-prim-sphere +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 11 collide-shape-prim-sphere)" 11 collide-shape-prim-sphere) + +;; definition for method 11 of type collide-shape-prim-group +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) + +;; definition for method 10 of type collide-cache +(defmethod fill-and-probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) + (fill-using-line-sphere this arg0) + (probe-using-line-sphere this arg0) + ) + +;; definition of type collide-puls-work +(deftype collide-puls-work (structure) + ((ignore-pat pat-surface) + (bsphere sphere :inline) + (move-dist vector :inline) + ) + ) + +;; definition for method 3 of type collide-puls-work +(defmethod inspect ((this collide-puls-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'collide-puls-work) + (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tmove-dist: #~%" (-> this move-dist)) + (label cfg-4) + this + ) + +;; definition for method 16 of type collide-cache +(defmethod probe-using-line-sphere ((this collide-cache) (arg0 collide-query)) + (rlet ((vf0 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-cache-tri))) + (.lvf vf4 (&-> arg0 exit-planes 0 quad)) + (.lvf vf3 (&-> arg0 start-pos quad)) + (.lvf vf2 (&-> arg0 move-dist quad)) + (set! (-> s5-0 vertex 0 x) (the-as float (-> arg0 ignore-pat))) + (.mul.w.vf vf3 vf0 vf4 :mask #b1000) + (.svf (&-> s5-0 vertex 2 quad) vf2) + (.svf (&-> s5-0 vertex 1 quad) vf3) + (let ((s4-0 (the-as object (-> this prims))) + (f30-0 -100000000.0) + ) + (countdown (s3-0 (-> this num-prims)) + (when (and (logtest? (-> arg0 collide-with) (-> (the-as collide-cache-prim s4-0) prim-core collide-as)) + (logtest? (-> arg0 action-mask) (-> (the-as collide-cache-prim s4-0) prim-core action)) + ) + (cond + ((>= (-> (the-as collide-cache-prim s4-0) prim-core prim-type) 0) + (let ((f0-0 ((method-of-type collide-cache-prim resolve-moving-sphere-tri) + (the-as collide-cache-prim s4-0) + (the-as collide-tri-result arg0) + (the-as collide-prim-core (-> s5-0 vertex 1)) + (-> s5-0 vertex 2) + f30-0 + (collide-action solid) + ) + ) + ) + (if (>= f0-0 0.0) + (set! f30-0 f0-0) + ) + ) + ) + (else + (when (not (logtest? (-> arg0 ignore-pat) + (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s4-0) prim)) pat) + ) + ) + (let ((f0-1 ((method-of-type collide-cache-prim resolve-moving-sphere-sphere) + (the-as collide-cache-prim s4-0) + (the-as collide-tri-result arg0) + (the-as collide-prim-core (-> s5-0 vertex 1)) + (-> s5-0 vertex 2) + f30-0 + (collide-action solid) + ) + ) + ) + (if (>= f0-1 0.0) + (set! f30-0 f0-1) + ) + ) + ) + ) + ) + ) + (set! s4-0 (-> (the-as (inline-array collide-cache-prim) s4-0) 1)) + ) + f30-0 + ) + ) + ) + ) + +;; definition of type lsmi-work +(deftype lsmi-work (structure) + ((best-u float) + (orig-best-u float) + (action uint32) + (cquery collide-query :inline) + ) + ) + +;; definition for method 3 of type lsmi-work +(defmethod inspect ((this lsmi-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lsmi-work) + (format #t "~1Tbest-u: ~f~%" (-> this best-u)) + (format #t "~1Torig-best-u: ~f~%" (-> this orig-best-u)) + (format #t "~1Taction: ~D~%" (-> this action)) + (format #t "~1Tcquery: #~%" (-> this cquery)) + (label cfg-4) + this + ) + +;; definition for method 9 of type collide-cache-prim +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 9 collide-cache-prim)" 9 collide-cache-prim) + +;; definition for method 10 of type collide-cache-prim +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) + +;; definition for method 11 of type collide-cache +(defmethod fill-and-probe-using-spheres ((this collide-cache) (arg0 collide-query)) + (fill-using-spheres this arg0) + (probe-using-spheres this arg0) + ) + +;; definition for method 14 of type collide-cache +(defmethod fill-using-spheres ((this collide-cache) (arg0 collide-query)) + (new 'stack-no-clear 'bounding-box) + (set-from-spheres! + (-> arg0 bbox) + (the-as (inline-array sphere) (-> arg0 best-dist)) + (the-as int (-> arg0 best-other-prim)) + ) + (fill-using-bounding-box this arg0) + (none) + ) + +;; definition for method 17 of type collide-cache +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 17 collide-cache)" 17 collide-cache) + +;; definition for method 9 of type collide-puss-work +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 9 collide-puss-work)" 9 collide-puss-work) + +;; definition for method 10 of type collide-puss-work +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 10 collide-puss-work)" 10 collide-puss-work) + +;; definition for function test-closest-pt-in-triangle +;; INFO: Used lq/sq +;; ERROR: failed type prop at 20: add failed: object + +;; ERROR: Failed to guess stack use for 16 in test-closest-pt-in-triangle:0 +(defun test-closest-pt-in-triangle ((a0-0 collide-cache)) + (local-vars + (v0-0 vector) + (v0-1 vector) + (v0-2 none) + (v0-3 float) + (v0-4 symbol) + (v1-1 int) + (v1-2 vector) + (v1-3 uint128) + (v1-4 symbol) + (v1-5 symbol) + (v1-7 none) + (a0-1 int) + (a0-2 none) + (a0-3 none) + (a0-4 none) + (a0-5 none) + (a0-6 none) + (a1-0 collide-cache-tri) + (a1-1 none) + (a1-2 none) + (a2-0 vector) + (a2-1 collide-cache-tri) + (a3-0 vector) + (a3-1 none) + (s0-0 none) + (s1-0 int) + (s2-0 none) + (s3-0 none) + (s4-0 none) + (s5-0 object) + (t9-0 (function int vector)) + (t9-1 (function vector vector vector vector vector)) + (t9-2 (function vector vector matrix vector none)) + (t9-3 (function vector vector float)) + (gp-0 none) + (sp-0 none) + (f0-0 float) + (f1-0 float) + (f30-0 number) + ) + (set! gp-0 (the-as none (+ sp-0 16))) + (set! v1-1 -1082130432) + (set! f30-0 (gpr->fpr v1-1)) + (set! s5-0 (-> a0-0 tris)) + (set! s4-0 (the-as none (+ sp-0 32))) + (set! s3-0 (the-as none (+ sp-0 48))) + (set! s2-0 (the-as none (+ sp-0 64))) + (set! s1-0 (-> a0-0 num-tris)) + (set! s0-0 (the-as none s4-0)) + (set! t9-0 target-pos) + (set! a0-1 0) + (set! v0-0 (call! a0-1)) + (set! v1-2 v0-0) + (set! v1-3 (-> v1-2 quad)) + (s.q! s0-0 v1-3) + (while (nonzero? s1-0) + (when (begin + (or (begin + (set! s1-0 (+ s1-0 -1)) + (set! t9-1 normal-of-plane) + (set! a0-2 (the-as none s2-0)) + (set! a1-0 (+ s5-0 0)) + (set! a2-0 (+ s5-0 16)) + (set! a3-0 (+ s5-0 32)) + (call! a0-2 a1-0 a2-0 a3-0) + (set! t9-2 closest-pt-in-triangle) + (set! a0-3 (the-as none s3-0)) + (set! a1-1 (the-as none s4-0)) + (set! a2-1 (+ s5-0 0)) + (set! a3-1 (the-as none s2-0)) + (call! a0-3 a1-1 a2-1 a3-1) + (set! t9-3 vector-vector-distance-squared) + (set! a0-4 (the-as none s3-0)) + (set! a1-2 (the-as none s4-0)) + (set! v0-3 (call! a0-4 a1-2)) + (set! f0-0 (gpr->fpr v0-3)) + (set! f1-0 (the-as float 0)) + (set! v1-4 (<.s f30-0 f1-0)) + v1-4 + ) + (set! v1-5 (<.s f0-0 f30-0)) + ) + v1-5 + ) + (set! f30-0 f0-0) + (set! v1-7 (the-as none gp-0)) + (set! a0-5 (the-as none s3-0)) + (set! a0-6 (the-as none (l.q a0-5))) + (s.q! v1-7 a0-6) + (set! v1-8 s5-0) + ) + (set! s5-0 (-> s5-0 1)) + ) + (set! v0-4 #f) + (ret-value v0-4) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc new file mode 100644 index 0000000000..3fa762f2e5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-debug_REF.gc @@ -0,0 +1,308 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition for method 9 of type collide-cache +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this collide-cache)) + (let ((gp-0 (the-as object (-> this tris)))) + (countdown (s4-0 (-> this num-tris)) + (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64))) + (add-debug-flat-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> (the-as collide-cache-tri gp-0) vertex)) + (-> (the-as collide-cache-tri gp-0) vertex 1) + (-> (the-as collide-cache-tri gp-0) vertex 2) + t1-0 + ) + ) + (set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64)) + ) + ) + (let ((gp-1 (the-as object (-> this prims)))) + (countdown (s5-1 (-> this num-prims)) + (when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) -1) + (let ((t0-1 + (copy-and-set-field + (-> *pat-mode-info* + (-> (the-as collide-shape-prim-sphere (-> (the-as collide-shape-prim gp-1) prim-core action)) pat mode) + color + ) + a + 64 + ) + ) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> (the-as collide-cache-prim gp-1) prim-core)) + (-> (the-as collide-cache-prim gp-1) prim-core world-sphere w) + t0-1 + ) + ) + ) + (set! gp-1 (&+ (the-as collide-cache-prim gp-1) 48)) + ) + ) + (print-collide-cache-tri-count) + 0 + (none) + ) + +;; definition of type col-rend-filter +(deftype col-rend-filter (structure) + ((show-pat-set pat-surface) + (show-pat-clear pat-surface) + (event-mask uint32) + ) + ) + +;; definition for method 3 of type col-rend-filter +(defmethod inspect ((this col-rend-filter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'col-rend-filter) + (format #t "~1Tshow-pat-set: ~D~%" (-> this show-pat-set)) + (format #t "~1Tshow-pat-clear: ~D~%" (-> this show-pat-clear)) + (format #t "~1Tevent-mask: ~D~%" (-> this event-mask)) + (label cfg-4) + this + ) + +;; definition for function col-rend-draw +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (set! (-> s4-0 rvec quad) (-> (math-camera-matrix) fvec quad)) + (vector-normalize! (-> s4-0 rvec) 1.0) + (let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris)))) + (countdown (s2-0 (-> *collide-cache* num-tris)) + (vector-3pt-cross! (-> s4-0 uvec) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1) (-> s3-1 vertex 2)) + (vector-normalize! (-> s4-0 uvec) 1.0) + (when (or (-> arg0 show-back-faces?) (>= 0.0 (vector-dot (-> s4-0 rvec) (-> s4-0 uvec)))) + (let ((v1-9 (-> s3-1 pat))) + (cond + ((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-9 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (the-as int (-> v1-9 event))))) + ) + (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64))) + (add-debug-flat-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + t1-0 + ) + ) + (if (-> arg0 outline?) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + (new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x80) + ) + ) + (when (-> arg0 show-normals?) + (vector+! (-> s4-0 fvec) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1)) + (vector+! (-> s4-0 fvec) (-> s4-0 fvec) (-> s3-1 vertex 2)) + (vector-float/! (-> s4-0 fvec) (-> s4-0 fvec) 3.0) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 fvec) + (-> s4-0 uvec) + (meters 0.75) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + ) + ) + ((-> arg0 ghost-hidden?) + (add-debug-flat-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + (new 'static 'rgba :r #x20 :g #x20 :b #x20 :a #x20) + ) + (if (-> arg0 outline?) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s3-1 vertex)) + (-> s3-1 vertex 1) + (-> s3-1 vertex 2) + (new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x10) + ) + ) + ) + ) + ) + ) + (&+! s3-1 64) + ) + ) + ) + (let ((s5-1 (the-as object (-> *collide-cache* prims)))) + (countdown (s4-1 (-> *collide-cache* num-prims)) + (when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) -1) + (let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat))) + (when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set))) + (or (zero? (-> arg1 show-pat-clear)) (not (logtest? v1-37 (-> arg1 show-pat-clear)))) + (or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (the-as int (-> v1-37 event))))) + ) + (let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> (the-as collide-cache-prim s5-1) prim-core)) + (-> (the-as collide-cache-prim s5-1) prim-core world-sphere w) + t0-5 + ) + ) + ) + ) + ) + (set! s5-1 (&+ (the-as collide-cache-prim s5-1) 48)) + ) + ) + (none) + ) + +;; definition for method 9 of type col-rend +;; INFO: Used lq/sq +(defmethod draw ((this col-rend)) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (let ((f30-0 (-> this bbox-radius))) + (let ((v1-0 (-> this track))) + (cond + ((zero? v1-0) + (set! (-> this bbox-center quad) (-> (target-pos 0) quad)) + (+! (-> this bbox-center y) (* 0.7 f30-0)) + ) + ((= v1-0 1) + (position-in-front-of-camera! + (-> this bbox-center) + (+ (-> this camera-to-bbox-dist) (-> this bbox-radius)) + 0.0 + ) + ) + ) + ) + (set! (-> s5-0 bbox min quad) (-> this bbox-center quad)) + (set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0)) + (set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0)) + (set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0)) + (set! (-> s5-0 bbox max quad) (-> this bbox-center quad)) + (+! (-> s5-0 bbox max x) f30-0) + (+! (-> s5-0 bbox max y) f30-0) + (+! (-> s5-0 bbox max z) f30-0) + ) + (let ((v1-9 -1)) + (let ((a0-9 (-> this cspec))) + (if (not (logtest? a0-9 (collide-spec crate))) + (set! v1-9 (logxor v1-9 1)) + ) + (if (not (logtest? a0-9 (collide-spec civilian))) + (set! v1-9 (logxor v1-9 64)) + ) + (if (not (logtest? a0-9 (collide-spec enemy))) + (set! v1-9 (logxor #x100000 v1-9)) + ) + (if (not (logtest? a0-9 (collide-spec obstacle))) + (set! v1-9 (logxor v1-9 2)) + ) + (if (not (logtest? a0-9 (collide-spec vehicle-sphere))) + (set! v1-9 (logand #x100743 v1-9)) + ) + ) + (set! (-> s5-0 collide-with) (the-as collide-spec v1-9)) + ) + (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface)) + (set! (-> s5-0 ignore-process0) #f) + (set! (-> s5-0 ignore-process1) #f) + (add-debug-box + #t + (bucket-id debug) + (the-as vector (-> s5-0 bbox)) + (-> s5-0 bbox max) + (if (logtest? (current-time) 128) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x20) + (new 'static 'rgba :a #x20) + ) + ) + (fill-using-bounding-box *collide-cache* s5-0) + ) + (let ((s5-1 (-> this show-only)) + (a1-17 (new 'stack 'col-rend-filter)) + ) + (when (nonzero? s5-1) + (cond + ((logtest? s5-1 8) + (set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :noboard #x1)) + ) + ((logtest? s5-1 16) + (set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1)) + ) + ((logtest? s5-1 32) + (set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1)) + (set! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nojak #x1 :board #x1)) + ) + (else + (if (logtest? s5-1 8192) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nolineofsight #x1)) + ) + (if (logtest? s5-1 1024) + (set! (-> a1-17 show-pat-set noentity) 1) + ) + (if (logtest? s5-1 64) + (set! (-> a1-17 show-pat-set noboard) 1) + ) + (if (logtest? s5-1 2048) + (set! (-> a1-17 show-pat-set nogrind) 1) + ) + (if (logtest? s5-1 128) + (set! (-> a1-17 show-pat-set nocamera) 1) + ) + (if (logtest? s5-1 4096) + (set! (-> a1-17 show-pat-set nojak) 1) + ) + (if (logtest? s5-1 256) + (set! (-> a1-17 show-pat-set noedge) 1) + ) + (if (logtest? s5-1 #x8000) + (set! (-> a1-17 show-pat-set nopilot) 1) + ) + (if (logtest? s5-1 512) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :noendlessfall #x1)) + ) + (if (logtest? s5-1 #x4000) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nomech #x1)) + ) + (if (logtest? #x10000 s5-1) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :noproj #x1)) + ) + (if (logtest? #x40000 s5-1) + (logior! (-> a1-17 show-pat-set) (new 'static 'pat-surface :probe #x1)) + ) + (if (logtest? #x20000 s5-1) + (logior! (-> a1-17 event-mask) 64) + ) + ) + ) + ) + (col-rend-draw this a1-17) + ) + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc index ae72824f85..46289e7be4 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab-h_REF.gc @@ -49,7 +49,7 @@ ) (:methods (edge-grab-info-method-9 (_type_) symbol) - (edge-grab-info-method-10 () none) + (edge-grab-info-method-10 (_type_) none) ) ) @@ -114,7 +114,7 @@ (edge-vec-norm vector :inline) ) (:methods - (collide-edge-edge-method-9 () none) + (no-collision-at-edge (_type_ collide-edge-work edge-grab-info) symbol) ) ) @@ -171,8 +171,8 @@ (attempts qword 32 :inline) ) (:methods - (collide-edge-hold-list-method-9 () none) - (collide-edge-hold-list-method-10 () none) + (debug-draw (_type_) object) + (add-to-list! (_type_ collide-edge-hold-item) none) ) ) @@ -257,18 +257,18 @@ (hold-list collide-edge-hold-list :inline) ) (:methods - (collide-edge-work-method-9 () none) - (collide-edge-work-method-10 () none) - (collide-edge-work-method-11 () none) - (collide-edge-work-method-12 () none) - (collide-edge-work-method-13 () none) - (collide-edge-work-method-14 () none) - (collide-edge-work-method-15 () none) - (collide-edge-work-method-16 () none) - (collide-edge-work-method-17 () none) - (collide-edge-work-method-18 () none) - (collide-edge-work-method-19 () none) - (collide-edge-work-method-20 () none) + (search-for-edges (_type_ collide-edge-hold-list) none) + (debug-draw-edges (_type_) object) + (debug-draw-tris (_type_) none) + (debug-draw-sphere (_type_) none) + (find-adjacent-edge (_type_ collide-edge-hold-item edge-grab-info) none) + (compute-center-point! (_type_ collide-edge-edge vector) float) + (get-best-hand-point (_type_ vector vector int) float) + (find-grabbable-edges (_type_) none) + (find-grabbable-tris (_type_) none) + (should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol) + (find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol) + (check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol) ) ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc new file mode 100644 index 0000000000..05399735eb --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc @@ -0,0 +1,795 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 28 of type target +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 28 target) has a return type of none, but the expression builder found a return statement. +(defmethod target-method-28 ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (set! (-> *edge-grab-info* found-edge?) #f) + (mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320) + (let ((s5-0 *collide-edge-work*)) + (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this))) + (set! (-> s5-0 num-verts) (the-as uint 0)) + (set! (-> s5-0 num-edges) (the-as uint 0)) + (set! (-> s5-0 num-tris) (the-as uint 0)) + (let ((v1-3 (-> this control))) + (set! (-> s5-0 ccache) arg0) + (.lvf vf1 (&-> s5-0 spec local-cache-fill-box min quad)) + (.lvf vf2 (&-> s5-0 spec local-cache-fill-box max quad)) + (set! (-> s5-0 cshape) v1-3) + (.lvf vf3 (&-> v1-3 trans quad)) + ) + (.add.vf vf1 vf1 vf3 :mask #b111) + (.add.vf vf2 vf2 vf3 :mask #b111) + (.svf (&-> s5-0 cache-fill-box min quad) vf1) + (.svf (&-> s5-0 cache-fill-box max quad) vf2) + (.lvf vf4 (&-> s5-0 spec local-within-reach-box min quad)) + (.lvf vf5 (&-> s5-0 spec local-within-reach-box max quad)) + (.add.vf vf4 vf4 vf3 :mask #b111) + (.add.vf vf5 vf5 vf3 :mask #b111) + (.ftoi.vf vf6 vf4) + (.ftoi.vf vf7 vf5) + (.svf (&-> s5-0 within-reach-box min quad) vf4) + (.svf (&-> s5-0 within-reach-box max quad) vf5) + (.svf (&-> s5-0 within-reach-box4w min quad) vf6) + (.svf (&-> s5-0 within-reach-box4w max quad) vf7) + (let ((s3-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-0 collide-with) (-> this control root-prim prim-core collide-with)) + (set! (-> s3-0 ignore-process0) this) + (set! (-> s3-0 ignore-process1) #f) + (set! (-> s3-0 ignore-pat) (-> s5-0 spec ignore-pat)) + (set! (-> s3-0 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> s3-0 bbox)) (the-as pointer (-> s5-0 cache-fill-box)) 32) + (fill-using-bounding-box arg0 s3-0) + ) + (find-grabbable-tris s5-0) + (when (nonzero? (-> s5-0 num-tris)) + (find-grabbable-edges s5-0) + (when (nonzero? (-> s5-0 num-edges)) + (set! (-> s5-0 search-pt quad) (-> this control midpoint-of-hands quad)) + (when (!= (-> *cpad-list* cpads (-> this control cpad number) stick0-speed) 0.0) + (set! (-> s5-0 search-dir-vec quad) (-> this control to-target-pt-xz quad)) + (search-for-edges s5-0 (-> s5-0 hold-list)) + (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) + (set! (-> *edge-grab-info* found-edge?) #t) + (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) + (send-event this 'edge-grab) + ) + (return #f) + ) + ) + (vector-z-quaternion! (-> s5-0 search-dir-vec) (-> this control quat-for-control)) + (search-for-edges s5-0 (-> s5-0 hold-list)) + (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) + (set! (-> *edge-grab-info* found-edge?) #t) + (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) + (send-event this 'edge-grab) + ) + ) + 0 + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 9 of type collide-edge-work +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 9 collide-edge-work) has a return type of none, but the expression builder found a return statement. +(defmethod search-for-edges ((this collide-edge-work) (arg0 collide-edge-hold-list)) + (set! (-> arg0 num-allocs) (the-as uint 0)) + (set! (-> arg0 num-attempts) (the-as uint 0)) + (set! (-> arg0 head) #f) + (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) + (s3-0 (the-as collide-edge-edge (-> this edges))) + ) + (countdown (s2-0 (-> this num-edges)) + (when (not (-> s3-0 ignore)) + (compute-center-point! this s3-0 (-> s4-0 center-pt)) + (when (should-add-to-list? this s4-0 s3-0) + (add-to-list! arg0 s4-0) + (+! (-> arg0 num-allocs) 1) + (when (= (-> arg0 num-allocs) 32) + (format 0 "ERROR: Reached limit of edge grab hold items!~%") + (return #f) + ) + (&+! s4-0 48) + ) + ) + (&+! s3-0 48) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type collide-edge-hold-list +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 10 collide-edge-hold-list)" 10 collide-edge-hold-list) + +;; definition of type pbhp-stack-vars +(deftype pbhp-stack-vars (structure) + ((edge collide-edge-edge) + (allocated basic) + (neg-hold-pt vector :inline) + (split-vec vector :inline) + ) + ) + +;; definition for method 3 of type pbhp-stack-vars +(defmethod inspect ((this pbhp-stack-vars)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'pbhp-stack-vars) + (format #t "~1Tedge: #~%" (-> this edge)) + (format #t "~1Tallocated: ~A~%" (-> this allocated)) + (format #t "~1Tneg-hold-pt: #~%" (-> this neg-hold-pt)) + (format #t "~1Tsplit-vec: #~%" (-> this split-vec)) + (label cfg-4) + this + ) + +;; definition for method 19 of type collide-edge-work +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 19 collide-edge-work)" 19 collide-edge-work) + +;; definition for method 20 of type collide-edge-work +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs symbol. +(defmethod check-grab-for-collisions ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) + (local-vars (sv-656 vector) (sv-672 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((s2-0 (-> arg0 edge)) + (s1-0 (-> s2-0 etri ctri)) + (s4-0 (-> s1-0 prim-index)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (let ((a1-1 s0-0)) + (let ((v1-1 (-> arg0 center-pt))) + (let ((a0-1 (-> s2-0 edge-vec-norm))) + (let ((a2-2 1105.92)) + (.mov vf7 a2-2) + ) + (.lvf vf5 (&-> a0-1 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-1 quad) vf6) + ) + (let ((f0-1 (get-best-hand-point this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (if (< 491.52 f0-1) + (return (the-as symbol #f)) + ) + ) + (set! sv-672 s0-0) + (set! sv-656 (-> arg0 center-pt)) + (let ((v0-2 (vector-negate! (new 'stack-no-clear 'vector) (-> s2-0 edge-vec-norm)))) + (let ((v1-8 1105.92)) + (.mov vf7 v1-8) + ) + (.lvf vf5 (&-> v0-2 quad)) + ) + (.lvf vf4 (&-> sv-656 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-672 quad) vf6) + (let ((f0-3 (get-best-hand-point this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (if (< 491.52 f0-3) + (return (the-as symbol #f)) + ) + ) + ) + (set! (-> arg1 tri-vertex 0 quad) (-> s1-0 vertex 0 quad)) + (set! (-> arg1 world-vertex 4 quad) (-> s1-0 vertex 1 quad)) + (set! (-> arg1 world-vertex 5 quad) (-> s1-0 vertex 2 quad)) + (set! (-> arg1 edge-tri-pat) (-> s1-0 pat)) + (set! (-> arg1 center-hold quad) (-> arg0 center-pt quad)) + (set! (-> arg1 world-vertex 0 quad) (-> s2-0 vertex-ptr 0 0 quad)) + (set! (-> arg1 world-vertex 1 quad) (-> s2-0 vertex-ptr 1 0 quad)) + (set! (-> arg1 hanging-matrix uvec quad) + (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal quad) + ) + (vector-normalize! + (vector-! (-> arg1 hanging-matrix fvec) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) + 1.0 + ) + (vector-normalize! + (vector-cross! + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix fvec) + (-> arg1 hanging-matrix uvec) + ) + 1.0 + ) + (vector-cross! + (-> arg1 hanging-matrix fvec) + (the-as vector (-> arg1 hanging-matrix)) + (-> arg1 hanging-matrix uvec) + ) + (set! (-> arg1 hanging-matrix trans quad) (-> arg1 center-hold quad)) + (transform-vectors! + (-> arg1 hanging-matrix) + (-> this world-player-spheres) + (-> this spec local-player-spheres) + 12 + ) + (let ((a1-12 (new 'stack-no-clear 'collide-query))) + (let ((v1-28 a1-12)) + (set! (-> v1-28 best-dist) (the-as float (-> this world-player-spheres))) + (set! (-> v1-28 best-other-prim) (the-as collide-shape-prim 12)) + (set! (-> v1-28 collide-with) (-> this cshape root-prim prim-core collide-with)) + (set! (-> v1-28 ignore-process0) #f) + (set! (-> v1-28 ignore-process1) #f) + (set! (-> v1-28 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-28 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-28 action-mask) (collide-action solid)) + ) + (if (probe-using-spheres (-> this ccache) a1-12) + (return (the-as symbol #f)) + ) + ) + (set! (-> arg1 status) (the-as uint 0)) + (if (logtest? (-> this spec flags) (collide-edge-spec-flags find-adjacent-edge)) + (find-adjacent-edge this arg0 arg1) + ) + (let* ((v1-41 (the-as object (-> this ccache prims s4-0 prim))) + (a0-44 (-> (the-as collide-shape-prim v1-41) cshape)) + ) + (cond + (a0-44 + (set! (-> arg1 actor-cshape-prim-offset) (- (the-as int v1-41) (the-as uint (the-as int (-> a0-44 process))))) + (set! (-> arg1 actor-handle) (process->handle (-> a0-44 process))) + (let ((a1-19 + (-> a0-44 process node-list data (-> (the-as collide-shape-prim v1-41) transform-index) bone transform) + ) + (s5-1 (new 'stack-no-clear 'matrix)) + ) + (matrix-4x4-inverse! s5-1 a1-19) + (dotimes (s4-1 8) + (vector-matrix*! (-> arg1 local-vertex s4-1) (-> arg1 world-vertex s4-1) s5-1) + ) + ) + ) + (else + (set! (-> arg1 actor-cshape-prim-offset) 0) + (set! (-> arg1 actor-handle) (the-as handle #f)) + ) + ) + ) + ) + (the-as symbol 0) + ) + ) + +;; definition of type faei-stack-vars +(deftype faei-stack-vars (structure) + ((hold-edge-vec-norm vector :inline) + (adj-edge-vec-norm vector :inline) + (found-left? symbol) + (left-dot float) + (found-right? symbol) + (right-dot float) + ) + ) + +;; definition for method 3 of type faei-stack-vars +(defmethod inspect ((this faei-stack-vars)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'faei-stack-vars) + (format #t "~1Thold-edge-vec-norm: #~%" (-> this hold-edge-vec-norm)) + (format #t "~1Tadj-edge-vec-norm: #~%" (-> this adj-edge-vec-norm)) + (format #t "~1Tfound-left?: ~A~%" (-> this found-left?)) + (format #t "~1Tleft-dot: ~f~%" (-> this left-dot)) + (format #t "~1Tfound-right?: ~A~%" (-> this found-right?)) + (format #t "~1Tright-dot: ~f~%" (-> this right-dot)) + (label cfg-4) + this + ) + +;; definition for method 9 of type collide-edge-edge +;; INFO: Used lq/sq +(defmethod no-collision-at-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) + (let ((s4-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'inline-array 'sphere 6)) + ) + (dotimes (s2-0 6) + ((method-of-type sphere new) (the-as symbol (-> s5-0 s2-0)) sphere) + ) + (set! (-> s4-0 uvec quad) + (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal quad) + ) + (vector-normalize! (vector-! (-> s4-0 fvec) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) 1.0) + (vector-normalize! (vector-cross! (-> s4-0 rvec) (-> s4-0 fvec) (-> s4-0 uvec)) 1.0) + (vector-cross! (-> s4-0 fvec) (-> s4-0 rvec) (-> s4-0 uvec)) + (vector-average! (-> s4-0 trans) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) + (transform-vectors! s4-0 s5-0 (-> arg0 spec local-player-spheres) 6) + (let ((a1-11 (new 'stack-no-clear 'collide-query))) + (let ((v1-13 a1-11)) + (set! (-> v1-13 best-dist) (the-as float s5-0)) + (set! (-> v1-13 best-other-prim) (the-as collide-shape-prim 6)) + (set! (-> v1-13 collide-with) (-> arg0 cshape root-prim prim-core collide-with)) + (set! (-> v1-13 ignore-process0) #f) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 best-my-prim) (the-as collide-shape-prim #t)) + (set! (-> v1-13 action-mask) (collide-action solid)) + ) + (not (probe-using-spheres (-> arg0 ccache) a1-11)) + ) + ) + ) + +;; definition for method 13 of type collide-edge-work +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod find-adjacent-edge ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) + (let ((s5-0 (new 'stack-no-clear 'faei-stack-vars))) + (let* ((v1-0 (-> arg0 edge)) + (s3-0 (-> v1-0 vertex-ptr 0 0)) + (s2-0 (-> v1-0 vertex-ptr 1 0)) + (s1-0 (the-as collide-edge-edge (-> this edges))) + ) + (set! (-> s5-0 found-left?) #f) + (set! (-> s5-0 found-right?) #f) + (vector-! (-> s5-0 hold-edge-vec-norm) s2-0 s3-0) + (vector-normalize! (-> s5-0 hold-edge-vec-norm) 1.0) + (countdown (s0-0 (-> this num-edges)) + (when (not (-> s1-0 ignore)) + (let ((v1-6 (-> s1-0 vertex-ptr 1 0))) + (when (= v1-6 s3-0) + (vector-! (-> s5-0 adj-edge-vec-norm) v1-6 (-> s1-0 vertex-ptr 0 0)) + (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) + (let ((f30-0 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) + (when (and (or (not (-> s5-0 found-left?)) (< (-> s5-0 left-dot) f30-0) (< -0.7 f30-0)) + (no-collision-at-edge s1-0 this arg1) + ) + (set! (-> s5-0 left-dot) f30-0) + (set! (-> s5-0 found-left?) #t) + (set! (-> arg1 adjacent-edge-left-vertex quad) (-> s1-0 vertex-ptr 0 0 quad)) + 0 + ) + ) + ) + ) + (let ((v1-18 (-> s1-0 vertex-ptr 0 0))) + (when (= v1-18 s2-0) + (vector-! (-> s5-0 adj-edge-vec-norm) (-> s1-0 vertex-ptr 1 0) v1-18) + (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) + (let ((f30-1 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) + (when (and (or (not (-> s5-0 found-right?)) (< (-> s5-0 right-dot) f30-1) (< -0.7 f30-1)) + (no-collision-at-edge s1-0 this arg1) + ) + (set! (-> s5-0 right-dot) f30-1) + (set! (-> s5-0 found-right?) #t) + (set! (-> arg1 adjacent-edge-right-vertex quad) (-> s1-0 vertex-ptr 1 0 quad)) + 0 + ) + ) + ) + ) + ) + (&+! s1-0 48) + ) + ) + (let ((v1-31 (-> arg1 status))) + (if (-> s5-0 found-left?) + (set! v1-31 (logior v1-31 1)) + ) + (if (-> s5-0 found-right?) + (set! v1-31 (logior v1-31 2)) + ) + (set! (-> arg1 status) v1-31) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type edge-grab-info +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 9 edge-grab-info)" 9 edge-grab-info) + +;; definition for method 17 of type collide-edge-work +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 17 collide-edge-work)" 17 collide-edge-work) + +;; definition for method 16 of type collide-edge-work +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) + +;; definition for method 15 of type collide-edge-work +;; INFO: Used lq/sq +(defmethod get-best-hand-point ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) + (let ((f30-0 -1.0)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (dotimes (s1-0 (the-as int (-> this num-edges))) + (let ((v1-4 (-> this edges s1-0))) + (when (not (-> v1-4 ignore)) + (when (= (-> v1-4 etri ctri prim-index) arg2) + (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-4 vertex-ptr 0 0) (-> v1-4 vertex-ptr 1 0) s2-0))) + (when (or (< f30-0 0.0) (< f0-0 f30-0)) + (set! f30-0 f0-0) + (set! (-> arg0 quad) (-> s2-0 quad)) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +;; definition for method 18 of type collide-edge-work +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) + +;; definition for method 14 of type collide-edge-work +(defmethod compute-center-point! ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) + (local-vars (v1-1 float) (v1-2 float) (v1-3 float)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.mov.vf vf7 vf0) + (.lvf vf1 (&-> this search-pt quad)) + (let ((f0-0 0.0)) + (let ((v1-0 (-> arg0 vertex-ptr 0)) + (a0-1 (-> arg0 vertex-ptr 1)) + ) + (.lvf vf2 (&-> v1-0 0 quad)) + (.lvf vf3 (&-> a0-1 0 quad)) + ) + (.sub.vf vf4 vf1 vf2) + (.sub.vf vf5 vf3 vf2) + (.mul.vf vf6 vf5 vf5) + (.add.z.vf vf6 vf6 vf6 :mask #b1) + (.sqrt.vf Q vf6 :ftf #b0) + (nop!) + (.wait.vf) + (nop!) + (.add.vf vf6 vf0 Q :mask #b1) + (.nop.vf) + (.mov v1-1 vf6) + (let ((f1-0 v1-1)) + (.div.vf Q vf0 vf6 :fsf #b11 :ftf #b0) + (.wait.vf) + (nop!) + (.add.vf vf8 vf0 Q :mask #b1) + (.mul.x.vf vf9 vf5 vf8) + (.mov v1-2 vf8) + (.mul.vf vf10 vf9 vf4) + (.add.z.vf vf10 vf10 vf10 :mask #b1) + (let ((f2-0 v1-2)) + (.mov v1-3 vf10) + (let ((f3-0 v1-3)) + (b! (< f3-0 f0-0) cfg-4 :likely-delay (set! f3-0 f0-0)) + (b! (< f1-0 f3-0) cfg-4 :likely-delay (set! f3-0 f1-0)) + (label cfg-4) + (let ((v1-4 (* f3-0 f2-0))) + (.mov vf11 v1-4) + ) + ) + ) + ) + ) + (.mul.x.vf vf7 vf5 vf11 :mask #b111) + (.add.vf vf7 vf7 vf2 :mask #b111) + (.svf (&-> arg1 quad) vf7) + 0.0 + ) + ) + +;; definition for method 10 of type edge-grab-info +;; WARN: Return type mismatch object vs none. +(defmethod edge-grab-info-method-10 ((this edge-grab-info)) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) + (new 'static 'rgba :r #xff :a #x60) + #f + (the-as rgba -1) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this center-hold) + (meters 0.05) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this left-hand-hold) + (meters 0.05) + (new 'static 'rgba :r #xff :g #xff :a #x60) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> this right-hand-hold) + (meters 0.05) + (new 'static 'rgba :r #xff :g #xff :a #x60) + ) + (if (logtest? (-> this status) 1) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> this adjacent-edge-left-vertex) + (the-as vector (-> this world-vertex)) + (new 'static 'rgba :r #x80 :a #x60) + #f + (the-as rgba -1) + ) + ) + (if (logtest? (-> this status) 2) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + (-> this world-vertex 1) + (-> this adjacent-edge-right-vertex) + (new 'static 'rgba :r #x80 :a #x60) + #f + (the-as rgba -1) + ) + ) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) + (new 'static 'rgba :r #xff :a #x30) + ) + (cond + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) + (format *stdcon* "grab: invalid handle~%") + ) + ) + (else + (format *stdcon* "grab: ground~%") + ) + ) + (none) + ) + +;; definition for method 10 of type collide-edge-work +;; INFO: Used lq/sq +(defmethod debug-draw-edges ((this collide-edge-work)) + (local-vars (sv-32 (function _varargs_ object))) + (let ((gp-0 0)) + (dotimes (s4-0 (the-as int (-> this num-edges))) + (let* ((v1-3 (-> this edges s4-0)) + (a2-0 (-> v1-3 vertex-ptr 0 0)) + (a3-0 (-> v1-3 vertex-ptr 1 0)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (vector+! s3-0 a2-0 a3-0) + (vector-float*! s3-0 s3-0 0.5) + (cond + ((-> v1-3 ignore) + (add-debug-line + #t + (bucket-id debug-no-zbuf1) + a2-0 + a3-0 + (new 'static 'rgba :r #x7f :g #x7f :b #x7f :a #x50) + #f + (the-as rgba -1) + ) + (+! gp-0 1) + gp-0 + ) + (else + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + s3-0 + (-> v1-3 outward) + (meters 0.3) + (new 'static 'rgba :r #xff :a #x80) + ) + (let ((s2-0 add-debug-text-3d) + (s1-0 #t) + (s0-0 577) + ) + (set! sv-32 format) + (let ((a0-10 (clear *temp-string*)) + (a1-4 "~D") + (a2-2 s4-0) + ) + (sv-32 a0-10 a1-4 a2-2) + ) + (s2-0 s1-0 (the-as bucket-id s0-0) *temp-string* s3-0 (font-color white) (the-as vector2h #f)) + ) + ) + ) + ) + ) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) + ) + ) + +;; definition for method 12 of type collide-edge-work +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-sphere ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-verts))) + (let ((a2-0 (-> this verts s5-0))) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 0.2) (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type collide-edge-hold-list +;; INFO: Used lq/sq +(defmethod debug-draw ((this collide-edge-hold-list)) + (let ((s4-0 (-> this head)) + (s5-0 0) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 #t) + ) + (set! (-> s3-0 quad) (-> *target* control midpoint-of-hands quad)) + (while s4-0 + (+! s5-0 1) + (set! (-> s3-0 y) (-> s4-0 center-pt y)) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) s3-0 (meters 0.1) (new 'static 'rgba :a #x80)) + (cond + (s2-0 + (set! s2-0 #f) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 center-pt) + (meters 0.15) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 outward-pt) + (meters 0.1) + (new 'static 'rgba :r #xff :a #x80) + ) + ) + (else + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 center-pt) + (meters 0.15) + (new 'static 'rgba :r #x7f :g #x7f :a #x40) + ) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s4-0 outward-pt) + (meters 0.1) + (new 'static 'rgba :r #x7f :a #x40) + ) + ) + ) + (set! s4-0 (-> s4-0 next)) + ) + ) + (format *stdcon* "hold list has ~D item(s)~%" s5-0) + ) + (dotimes (s5-1 (the-as int (-> this num-attempts))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> this attempts s5-1)) + (meters 0.1) + (new 'static 'rgba :a #x40) + ) + ) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) + ) + +;; definition for method 11 of type collide-edge-work +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-tris ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-tris))) + (let* ((v1-3 (-> this tris s5-0 ctri)) + (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) + ) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> v1-3 vertex)) + (-> v1-3 vertex 1) + (-> v1-3 vertex 2) + t1-0 + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(let ((v1-2 (new 'static 'surface + :name '*no-walk-surface* + :turnv 0.5 + :turnvf 0.5 + :turnvv 1.0 + :turnvvf 1.0 + :tiltv 1.0 + :tiltvf 1.0 + :tiltvv 1.0 + :tiltvvf 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 0.9 + :align-speed 1.0 + :flags (surface-flag no-turn-around turn-to-vel) + ) + ) + ) + (set! *no-walk-surface* v1-2) + (set! (-> v1-2 exit-hook) nothing) + (set! (-> v1-2 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-2 touch-hook) nothing) + (set! (-> v1-2 active-hook) nothing) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-frag_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-frag_REF.gc new file mode 100644 index 0000000000..5bc3806b30 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-frag_REF.gc @@ -0,0 +1,111 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type drawable-tree-collide-fragment +(defmethod login ((this drawable-tree-collide-fragment)) + "Initialize the object after it is loaded." + this + ) + +;; definition for method 10 of type drawable-tree-collide-fragment +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this drawable-tree-collide-fragment)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + (when *display-render-collision* + (dotimes (s5-0 (-> this length)) + (draw (-> this data s5-0)) + ) + ) + 0 + (none) + ) + +;; definition for method 15 of type drawable-tree-collide-fragment +(defmethod unpack-vis ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) + arg1 + ) + +;; definition for method 8 of type collide-fragment +;; WARN: Return type mismatch int vs collide-fragment. +(defmethod mem-usage ((this collide-fragment) (usage memory-usage-block) (flags int)) + (let ((s5-0 (if (logtest? flags 1) + 55 + 51 + ) + ) + (s4-0 (-> this mesh)) + ) + (set! (-> usage data s5-0 name) "collide-fragment") + (+! (-> usage data s5-0 count) 1) + (let ((v1-9 (+ (asize-of this) (asize-of s4-0)))) + (+! (-> usage data s5-0 used) v1-9) + (+! (-> usage data s5-0 total) (logand -16 (+ v1-9 15))) + ) + (set! (-> usage data (+ s5-0 1) name) "collision-poly") + (+! (-> usage data (+ s5-0 1) count) (-> s4-0 poly-count)) + (let ((v1-20 (+ (-> s4-0 strip-data-len) (-> s4-0 poly-count)))) + (+! (-> usage data (+ s5-0 1) used) v1-20) + (+! (-> usage data (+ s5-0 1) total) v1-20) + ) + (set! (-> usage data (+ s5-0 2) name) "collision-vertex") + (+! (-> usage data (+ s5-0 2) count) (-> s4-0 vertex-count)) + (let ((v1-29 (* (-> s4-0 vertex-data-qwc) 16))) + (+! (-> usage data (+ s5-0 2) used) v1-29) + (let ((v0-2 (+ (-> usage data (+ s5-0 2) total) v1-29))) + (set! (-> usage data (+ s5-0 2) total) v0-2) + (the-as collide-fragment v0-2) + ) + ) + ) + ) + +;; definition for method 9 of type drawable-inline-array-collide-fragment +(defmethod login ((this drawable-inline-array-collide-fragment)) + "Initialize the object after it is loaded." + this + ) + +;; definition for method 10 of type collide-fragment +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this collide-fragment)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + 0 + (none) + ) + +;; definition for method 10 of type drawable-inline-array-collide-fragment +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this drawable-inline-array-collide-fragment)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) + (if (sphere-cull (-> s4-0 bsphere)) + (draw s4-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 8 of type drawable-inline-array-collide-fragment +(defmethod mem-usage ((this drawable-inline-array-collide-fragment) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 1 (-> usage length))) + (set! (-> usage data 0 name) "drawable-group") + (+! (-> usage data 0 count) 1) + (let ((v1-5 32)) + (+! (-> usage data 0 used) v1-5) + (+! (-> usage data 0 total) (logand -16 (+ v1-5 15))) + ) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) usage flags) + ) + this + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc index 0414783ba6..d5e09d12dd 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-h_REF.gc @@ -11,7 +11,9 @@ This has both inputs from the user, and collision results." (ignore-process0 process-tree :overlay-at (-> ignore-processes 0)) (ignore-process1 process-tree :overlay-at (-> ignore-processes 1)) (ignore-pat pat-surface) + (ignore-pat-s32 int32 :overlay-at ignore-pat) (collide-with collide-spec) + (collide-with-s32 int32 :overlay-at collide-with) (overlay-params uint32 3 :offset 112) (bbox bounding-box :inline) (bbox4w bounding-box4w :inline) @@ -59,7 +61,7 @@ This has both inputs from the user, and collision results." (format #t "~1Tignore-process1: ~A~%" (-> this ignore-process1)) (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) - (format #t "~1Toverlay-params[3] @ #x~X~%" (&-> this spheres)) + (format #t "~1Toverlay-params[3] @ #x~X~%" (&-> this best-dist)) (format #t "~1Tbbox: #~%" (-> this bbox)) (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) (format #t "~1Tbsphere: #~%" (-> this bsphere)) @@ -69,14 +71,14 @@ This has both inputs from the user, and collision results." (format #t "~1Texit-planes[2] @ #x~X~%" (-> this exit-planes)) (format #t "~1Tradius: ~f~%" (-> this radius)) (format #t "~1Tinv-mat: #~%" (-> this inv-mat)) - (format #t "~1Tspheres: #x~X~%" (-> this spheres)) + (format #t "~1Tspheres: #x~X~%" (-> this best-dist)) (format #t "~1Tnum-spheres: ~D~%" (-> this best-other-prim)) (format #t "~1Tsolid-only: ~A~%" (-> this best-my-prim)) - (format #t "~1Tbest-dist: ~f~%" (the-as float (-> this spheres))) + (format #t "~1Tbest-dist: ~f~%" (the-as float (-> this best-dist))) (format #t "~1Tbest-other-prim: ~A~%" (-> this best-other-prim)) (format #t "~1Tbest-my-prim: ~A~%" (-> this best-my-prim)) (format #t "~1Tmove-vec: #~%" (-> this move-dist)) - (format #t "~1Tbest-u: ~f~%" (the-as float (-> this spheres))) + (format #t "~1Tbest-u: ~f~%" (the-as float (-> this best-dist))) (format #t "~1Taction-mask: ~D~%" (-> this action-mask)) (format #t "~1Tlocal-box4w: #~%" (-> this local-box4w)) (format #t "~1Tsearch-box: #~%" (-> this search-box)) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-mesh-h_REF.gc index b88c763618..114da30f6a 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-mesh-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-mesh-h_REF.gc @@ -63,13 +63,13 @@ bound to the joint specified by `joint-id`." (tris collide-mesh-tri 1 :inline :offset 32) ) (:methods - (collide-mesh-method-9 () none) - (collide-mesh-method-10 () none) - (collide-mesh-method-11 () none) - (collide-mesh-method-12 () none) - (collide-mesh-method-13 () none) - (collide-mesh-method-14 () none) - (collide-mesh-method-15 () none) + (debug-draw-tris (_type_ process-drawable int) none) + (overlap-test (_type_ collide-mesh-cache-tri vector) symbol) + (should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float) + (unpack-mesh-to-cache! (_type_ (inline-array collide-mesh-cache-tri) matrix) none) + (collide-mesh-math-1 (_type_ object object) none) + (collide-mesh-math-2 (_type_ object object object) none) ) ) @@ -109,7 +109,7 @@ bound to the joint specified by `joint-id`." (format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex)) (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) - (format #t "~1Tpat: ~D~%" (-> this normal w)) + (format #t "~1Tpat: ~D~%" (-> this pat)) (label cfg-4) this ) @@ -118,7 +118,7 @@ bound to the joint specified by `joint-id`." (deftype collide-mesh-cache-entry (structure) "A foreground mesh collide cache entry." ((mat matrix :inline) - (tris collide-mesh-cache-tri :dynamic) + (tris collide-mesh-cache-tri :inline :dynamic) ) ) @@ -144,10 +144,10 @@ bound to the joint specified by `joint-id`." (data uint8 48000) ) (:methods - (collide-mesh-cache-method-9 () none) + (populate-for-prim-mesh (_type_ collide-shape-prim-mesh) collide-mesh-cache-entry) (is-id? (_type_ int) symbol) (next-id! (_type_) uint) - (collide-mesh-cache-method-12 () none) + (allocate! (_type_ int) collide-mesh-cache-entry) ) ) @@ -192,7 +192,3 @@ bound to the joint specified by `joint-id`." ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-mesh_REF.gc new file mode 100644 index 0000000000..9cfa24ad71 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-mesh_REF.gc @@ -0,0 +1,659 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 5 of type collide-mesh +;; WARN: Return type mismatch uint vs int. +(defmethod asize-of ((this collide-mesh)) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) + ) + +;; definition for method 8 of type collide-mesh +;; WARN: Return type mismatch int vs collide-mesh. +(defmethod mem-usage ((this collide-mesh) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 83 (-> usage length))) + (set! (-> usage data 82 name) "collide-mesh") + (+! (-> usage data 82 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 82 used) v1-6) + (+! (-> usage data 82 total) (logand -16 (+ v1-6 15))) + ) + (set! (-> usage length) (max 83 (-> usage length))) + (set! (-> usage data 82 name) "collide-mesh") + (+! (-> usage data 82 count) 1) + (let ((v1-16 (* (-> this num-verts) 16))) + (+! (-> usage data 82 used) v1-16) + (+! (-> usage data 82 total) (logand -16 (+ v1-16 15))) + ) + (the-as collide-mesh 0) + ) + +;; definition for method 9 of type collide-mesh +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-tris ((this collide-mesh) (arg0 process-drawable) (arg1 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (the-as object (-> this tris))) + (s4-0 (-> arg0 node-list data arg1 bone transform)) + ) + (countdown (s3-0 (-> this num-tris)) + (let ((a2-1 (new 'stack-no-clear 'vector)) + (a3-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + ) + (.lvf vf4 (&-> s4-0 rvec quad)) + (.lvf vf5 (&-> s4-0 uvec quad)) + (.lvf vf6 (&-> s4-0 fvec quad)) + (.lvf vf7 (&-> s4-0 trans quad)) + (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) + (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) + (.lvf vf3 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) + (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-mesh-tri s5-0) pat mode) color) a 16))) + (.mul.w.vf acc vf7 vf0) + (.add.mul.x.vf acc vf4 vf1 acc) + (.add.mul.y.vf acc vf5 vf1 acc) + (.add.mul.z.vf vf1 vf6 vf1 acc) + (.mul.w.vf acc vf7 vf0) + (.add.mul.x.vf acc vf4 vf2 acc) + (.add.mul.y.vf acc vf5 vf2 acc) + (.add.mul.z.vf vf2 vf6 vf2 acc) + (.mul.w.vf acc vf7 vf0) + (.add.mul.x.vf acc vf4 vf3 acc) + (.add.mul.y.vf acc vf5 vf3 acc) + (.add.mul.z.vf vf3 vf6 vf3 acc) + (.svf (&-> a2-1 quad) vf1) + (.svf (&-> a3-0 quad) vf2) + (.svf (&-> t0-0 quad) vf3) + (add-debug-flat-triangle #t (bucket-id debug-no-zbuf1) a2-1 a3-0 t0-0 t1-0) + ) + ) + (set! s5-0 (&+ (the-as collide-mesh-tri s5-0) 8)) + ) + ) + 0 + (none) + ) + ) + +;; definition of type sopt-work +(deftype sopt-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + +;; definition for method 3 of type sopt-work +(defmethod inspect ((this sopt-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sopt-work) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) + (label cfg-4) + this + ) + +;; definition for method 12 of type collide-mesh +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 12 collide-mesh)" 12 collide-mesh) + +;; definition of type spat-work +(deftype spat-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + +;; definition for method 3 of type spat-work +(defmethod inspect ((this spat-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'spat-work) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) + (label cfg-4) + this + ) + +;; definition for method 11 of type collide-mesh +;; INFO: Used lq/sq +(defmethod should-push-away-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float)) + (local-vars + (v1-0 uint128) + (a0-1 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a1-4 uint128) + (a1-7 pat-surface) + (a2-1 uint128) + (a2-2 uint128) + (a2-4 float) + (a2-5 float) + (a2-7 float) + (f0-0 float) + (f2-1 float) + (f3-0 float) + (f4-0 float) + ) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'spat-work))) + (nop!) + (let ((s3-0 arg0)) + (.lvf vf3 (&-> arg2 quad)) + (nop!) + (let ((s2-0 (-> this num-tris))) + (.sub.w.vf vf12 vf3 vf3) + (nop!) + (.add.w.vf vf13 vf3 vf3) + (nop!) + (.ftoi.vf vf12 vf12) + (nop!) + (.ftoi.vf vf13 vf13) + (nop!) + (.mov v1-0 vf12) + (.svf (&-> s4-0 sphere-bbox4w min quad) vf12) + (.mov a0-1 vf13) + (.svf (&-> s4-0 sphere-bbox4w max quad) vf13) + (until (>= a2-7 f4-0) + (until (> f0-0 f2-1) + (until (>= f3-0 f2-1) + (label cfg-1) + (b! (zero? s2-0) cfg-10 :delay (set! a2-1 (-> s3-0 bbox4w min quad))) + (+! s2-0 -1) + (let ((a1-1 (-> s3-0 bbox4w max quad))) + (.pcgtw a2-2 a2-1 a0-1) + (nop!) + (.pcgtw a1-2 v1-0 a1-1) + ) + (nop!) + (.por a1-3 a2-2 a1-2) + (nop!) + (.ppach a1-4 (the-as uint128 0) a1-3) + (nop!) + (let ((a1-5 (shl (the-as int a1-4) 16))) + (nop!) + (b! (nonzero? a1-5) cfg-1 :likely-delay (set! s3-0 (+ s3-0 96))) + ) + (closest-pt-in-triangle (-> s4-0 intersect) arg2 (the-as matrix (-> s3-0 vertex)) (-> s3-0 normal)) + (.lvf vf2 (&-> s4-0 intersect quad)) + (.lvf vf3 (&-> arg2 quad)) + (.lvf vf1 (&-> s3-0 normal quad)) + (set! v1-0 (-> s4-0 sphere-bbox4w min quad)) + (set! a0-1 (-> s4-0 sphere-bbox4w max quad)) + (.sub.vf vf4 vf3 vf2) + (set! a1-7 (-> s3-0 pat)) + (.mul.vf vf5 vf4 vf1) + (.lvf vf7 (&-> s3-0 vertex 0 quad)) + (.mul.vf vf6 vf4 vf4) + (.lvf vf8 (&-> s3-0 vertex 1 quad)) + (.mov.vf vf1 vf0 :mask #b1000) + (.lvf vf9 (&-> s3-0 vertex 2 quad)) + (.add.x.vf vf5 vf5 vf5 :mask #b10) + (&+! s3-0 96) + (.add.y.vf vf6 vf6 vf6 :mask #b1) + (set! f3-0 arg3) + (.add.z.vf vf5 vf5 vf5 :mask #b10) + (.add.z.vf vf6 vf6 vf6 :mask #b1) + (.sqrt.vf Q vf6 :ftf #b0) + (.mov a2-4 vf5) + (set! f0-0 0.0) + (.wait.vf) + (let ((f1-0 (-> arg2 w))) + (.add.vf vf6 vf0 Q :mask #b1) + (.mov.vf vf10 vf6) + (b! (< (the-as int a2-4) 0) cfg-6 :likely-delay (.sub.vf vf10 vf0 vf10)) + (label cfg-6) + (.mov a2-5 vf10) + (set! f2-1 (- a2-5 f1-0)) + ) + (.div.vf Q vf0 vf6 :fsf #b11 :ftf #b0) + ) + ) + (.wait.vf) + (nop!) + (.mul.vf vf11 vf4 Q) + (set! f4-0 0.707) + (.mul.vf vf5 vf11 vf1) + (.add.y.vf vf5 vf5 vf5 :mask #b1) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.mov a2-7 vf5) + ) + ) + ) + ) + (set! arg3 f2-1) + (.svf (&-> arg1 vertex 0 quad) vf7) + (.svf (&-> arg1 vertex 1 quad) vf8) + (.svf (&-> arg1 vertex 2 quad) vf9) + (.svf (&-> arg1 intersect quad) vf2) + (.svf (&-> arg1 normal quad) vf1) + (b! #t cfg-1 :delay (set! (-> arg1 pat) a1-7)) + (label cfg-10) + arg3 + ) + ) + +;; definition for method 14 of type collide-mesh +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh) + +;; definition for method 15 of type collide-mesh +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh) + +;; definition for method 9 of type collide-mesh-cache +;; INFO: Used lq/sq +;; ERROR: Unsupported inline assembly instruction kind - [pxor v1, v1, a0] +;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] +;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] +;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] +(defmethod populate-for-prim-mesh ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) + (local-vars + (r0-0 uint128) + (v1-7 uint128) + (v1-8 uint128) + (v1-9 uint128) + (v1-11 uint128) + (a0-6 uint128) + (a0-8 uint128) + (a0-10 uint128) + (a0-11 uint128) + (a0-12 uint128) + ) + (let ((s5-0 (-> arg0 cshape process node-list data (-> arg0 transform-index) bone transform)) + (s4-0 (-> arg0 mesh-cache-entry)) + ) + (cond + ((= (-> arg0 mesh-cache-id) (-> this id)) + (let ((v1-6 (-> s5-0 rvec quad)) + (a0-4 (-> s4-0 mat rvec quad)) + ) + (.pxor v1-7 v1-6 a0-4) + ) + (let ((a0-5 (-> s5-0 uvec quad)) + (a1-1 (-> s4-0 mat uvec quad)) + ) + (.pxor a0-6 a0-5 a1-1) + ) + (.por v1-8 v1-7 a0-6) + (let ((a0-7 (-> s5-0 fvec quad)) + (a1-2 (-> s4-0 mat fvec quad)) + ) + (.pxor a0-8 a0-7 a1-2) + ) + (.por v1-9 v1-8 a0-8) + (let ((a0-9 (-> s5-0 trans quad)) + (a1-3 (-> s4-0 mat trans quad)) + ) + (.pxor a0-10 a0-9 a1-3) + ) + (.por a0-11 v1-9 a0-10) + (let ((v1-10 a0-11)) + (.pcpyud a0-12 a0-11 r0-0) + (.por v1-11 a0-12 v1-10) + ) + (when (nonzero? v1-11) + (set! (-> s4-0 mat rvec quad) (-> s5-0 rvec quad)) + (set! (-> s4-0 mat uvec quad) (-> s5-0 uvec quad)) + (set! (-> s4-0 mat fvec quad) (-> s5-0 fvec quad)) + (set! (-> s4-0 mat trans quad) (-> s5-0 trans quad)) + (unpack-mesh-to-cache! (-> arg0 mesh) (-> s4-0 tris) s5-0) + ) + ) + (else + (let ((v1-19 (-> arg0 mesh))) + (when v1-19 + (set! s4-0 (allocate! this (the-as int (+ (* (the-as uint 96) (-> v1-19 num-tris)) 64)))) + (set! (-> arg0 mesh-cache-entry) s4-0) + (cond + (s4-0 + (set! (-> arg0 mesh-cache-id) (-> this id)) + (set! (-> s4-0 mat rvec quad) (-> s5-0 rvec quad)) + (set! (-> s4-0 mat uvec quad) (-> s5-0 uvec quad)) + (set! (-> s4-0 mat fvec quad) (-> s5-0 fvec quad)) + (set! (-> s4-0 mat trans quad) (-> s5-0 trans quad)) + (unpack-mesh-to-cache! (-> arg0 mesh) (-> s4-0 tris) s5-0) + ) + (else + (set! (-> arg0 mesh-cache-id) (the-as uint 0)) + 0 + ) + ) + ) + ) + ) + ) + s4-0 + ) + ) + +;; definition for method 12 of type collide-mesh-cache +;; WARN: Return type mismatch (pointer uint8) vs collide-mesh-cache-entry. +(defmethod allocate! ((this collide-mesh-cache) (arg0 int)) + (local-vars (a1-2 int) (a2-2 int)) + (let* ((v1-0 (+ arg0 15)) + (a1-1 (-> this used-size)) + (v1-1 (/ v1-0 16)) + (a3-0 (-> this data)) + (a2-0 (-> this max-size)) + (v1-2 (* v1-1 16)) + (a3-1 (&+ a3-0 a1-1)) + ) + (let ((t1-0 (- a2-0 (the-as uint v1-2))) + (t0-0 (-> this id)) + ) + (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) + (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) + ) + (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) + (label cfg-4) + (set! a1-2 v1-2) + (set! a3-1 (-> this data)) + (set! (-> this id) (the-as uint a2-2)) + (label cfg-5) + (set! (-> this used-size) (the-as uint a1-2)) + (let ((v0-0 a3-1)) + (b! #t cfg-7 :delay (nop!)) + (label cfg-6) + (format 0 "ERROR: Attempted to allocate something bigger than the entire mesh cache!~%") + (set! v0-0 (the-as (pointer uint8) #f)) + (label cfg-7) + (the-as collide-mesh-cache-entry v0-0) + ) + ) + ) + +;; definition for method 13 of type collide-mesh +;; WARN: Return type mismatch int vs none. +;; ERROR: Failed load: (set! vf6 (l.vf (+ (the-as vector a3-0) 16))) at op 37 +(defmethod unpack-mesh-to-cache! ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) + (local-vars (t0-2 uint)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((t0-0 #x70000000) + (v1-0 (-> this num-verts)) + ) + (nop!) + (let ((a3-0 (the-as object (-> this vertex-data)))) + (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 rvec quad))) + (nop!) + (.lvf vf2 (&-> arg1 uvec quad)) + (let ((t0-1 (the-as object (+ t0-0 -64)))) + (.lvf vf3 (&-> arg1 fvec quad)) + (nop!) + (.lvf vf4 (&-> arg1 trans quad)) + (nop!) + (.lvf vf5 (&-> (the-as (inline-array vector) a3-0) 0 quad)) + (nop!) + (.lvf vf6 (&-> (the-as (inline-array vector) a3-0) 1 quad)) + (nop!) + (.lvf vf7 (&-> (the-as (inline-array vector) a3-0) 2 quad)) + (nop!) + (.lvf vf8 (&-> (the-as (inline-array vector) a3-0) 3 quad)) + (label cfg-2) + (.mul.w.vf acc vf4 vf0) + (set! a3-0 (-> (the-as (inline-array vector) a3-0) 4)) + (.add.mul.x.vf acc vf1 vf5 acc) + (set! t0-1 (-> (the-as (inline-array vector) t0-1) 4)) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf vf9 vf3 vf5 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (.lvf vf5 (&-> (the-as vector a3-0) quad)) + (.add.mul.x.vf acc vf1 vf6 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf vf10 vf3 vf6 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (.lvf vf6 (+ (the-as vector a3-0) 16)) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf11 vf3 vf7 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (.lvf vf7 (+ (the-as vector a3-0) 32)) + (.add.mul.x.vf acc vf1 vf8 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf vf12 vf3 vf8 acc) + (nop!) + (nop!) + (.lvf vf8 (+ (the-as vector a3-0) 48)) + (+! v1-0 -4) + (.svf (&-> (the-as (inline-array vector) t0-1) 0 quad) vf9) + (nop!) + (.svf (&-> (the-as (inline-array vector) t0-1) 1 quad) vf10) + (nop!) + (.svf (&-> (the-as (inline-array vector) t0-1) 2 quad) vf11) + (b! (> (the-as int v1-0) 0) cfg-2 :delay (.svf (&-> (the-as (inline-array vector) t0-1) 3 quad) vf12)) + ) + ) + ) + (label cfg-3) + (let ((v1-1 (the-as object (-> this tris)))) + (nop!) + (let ((a2-1 #x70000000) + (a0-1 (-> this num-tris)) + ) + (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 0))) + (let* ((a1-1 (-> arg0 -1)) + (a3-1 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 1)) + (t0-3 (* t0-2 16)) + (t2-0 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 2)) + (t1-0 (* a3-1 16)) + (a3-2 (the-as uint (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 pat))) + ) + (let* ((t2-1 (* t2-0 16)) + (t0-4 (+ t0-3 a2-1)) + (t1-1 (+ t1-0 a2-1)) + (t2-2 (+ t2-1 a2-1)) + ) + (label cfg-5) + (+! a0-1 -1) + (.lvf vf1 t0-4) + (set! v1-1 (&+ (the-as collide-mesh-tri v1-1) 8)) + (.lvf vf2 t1-1) + (&+! a1-1 96) + (.lvf vf3 t2-2) + (.sub.vf vf4 vf2 vf1) + (.svf (&-> a1-1 vertex 0 quad) vf1) + (.min.vf vf8 vf1 vf2) + (.svf (&-> a1-1 vertex 1 quad) vf2) + (.sub.vf vf5 vf3 vf1) + (.svf (&-> a1-1 vertex 2 quad) vf3) + (.max.vf vf9 vf1 vf2) + (let ((t1-2 (-> (the-as collide-mesh-tri v1-1) vertex-index 0))) + (.outer.product.a.vf acc vf4 vf5) + (let ((t2-3 (-> (the-as collide-mesh-tri v1-1) vertex-index 1))) + (.outer.product.b.vf vf6 vf5 vf4 acc) + (let ((t0-5 (-> (the-as collide-mesh-tri v1-1) vertex-index 2))) + (.mul.vf vf7 vf6 vf6) + (nop!) + (.min.vf vf8 vf8 vf3) + (let ((t1-3 (* t1-2 16))) + (.max.vf vf9 vf9 vf3) + (let ((t2-4 (* t2-3 16))) + (.mul.x.vf acc vf0 vf7 :mask #b1000) + (let ((t3-0 (* t0-5 16))) + (.add.mul.y.vf acc vf0 vf7 acc :mask #b1000) + (set! t0-4 (+ t1-3 a2-1)) + (.add.mul.z.vf vf7 vf0 vf7 acc :mask #b1000) + (set! t1-1 (+ t2-4 a2-1)) + (.isqrt.vf Q vf0 vf7 :fsf #b11 :ftf #b11) + (set! t2-2 (+ t3-0 a2-1)) + ) + ) + ) + ) + ) + ) + ) + (.ftoi.vf vf8 vf8) + (nop!) + (.ftoi.vf vf9 vf9) + (nop!) + (nop!) + (.svf (&-> a1-1 bbox4w min quad) vf8) + (.wait.vf) + (.svf (&-> a1-1 bbox4w max quad) vf9) + (.mul.vf vf6 vf6 Q :mask #b111) + (nop!) + (nop!) + (.svf (&-> a1-1 normal quad) vf6) + (nop!) + (set! (-> a1-1 pat) (the-as pat-surface a3-2)) + (b! (nonzero? a0-1) cfg-5 :delay (set! a3-2 (the-as uint (-> (the-as collide-mesh-tri v1-1) pat)))) + ) + ) + ) + (label cfg-6) + 0 + (none) + ) + ) + +;; definition of type oot-work +(deftype oot-work (structure) + ((intersect vector :inline) + (sphere-bbox4w bounding-box4w :inline) + ) + ) + +;; definition for method 3 of type oot-work +(defmethod inspect ((this oot-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'oot-work) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) + (label cfg-4) + this + ) + +;; definition for method 10 of type collide-mesh +;; INFO: Used lq/sq +(defmethod overlap-test ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) + (local-vars + (v1-0 uint128) + (a0-1 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a1-4 uint128) + (a1-7 float) + (a2-1 uint128) + (a2-2 uint128) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'oot-work)) + (s4-0 arg0) + ) + (.lvf vf2 (&-> arg1 quad)) + (let ((s3-0 (-> this num-tris))) + (.sub.w.vf vf5 vf2 vf2) + (.add.w.vf vf6 vf2 vf2) + (.ftoi.vf vf5 vf5) + (.ftoi.vf vf6 vf6) + (.mov v1-0 vf5) + (.svf (&-> s5-0 sphere-bbox4w min quad) vf5) + (.mov a0-1 vf6) + (.svf (&-> s5-0 sphere-bbox4w max quad) vf6) + (label cfg-1) + (b! (zero? s3-0) cfg-7 :delay (set! a2-1 (-> s4-0 bbox4w min quad))) + (+! s3-0 -1) + ) + (let ((a1-1 (-> s4-0 bbox4w max quad))) + (.pcgtw a2-2 a2-1 a0-1) + (nop!) + (.pcgtw a1-2 v1-0 a1-1) + ) + (nop!) + (.por a1-3 a2-2 a1-2) + (nop!) + (.ppach a1-4 (the-as uint128 0) a1-3) + (nop!) + (let ((a1-5 (shl (the-as int a1-4) 16))) + (nop!) + (b! (nonzero? a1-5) cfg-1 :likely-delay (set! s4-0 (+ s4-0 96))) + ) + (closest-pt-in-triangle (-> s5-0 intersect) arg1 (the-as matrix (-> s4-0 vertex)) (-> s4-0 normal)) + (.lvf vf1 (&-> s5-0 intersect quad)) + (.lvf vf2 (&-> arg1 quad)) + (set! v1-0 (-> s5-0 sphere-bbox4w min quad)) + (set! a0-1 (-> s5-0 sphere-bbox4w max quad)) + (.sub.vf vf3 vf2 vf1) + (.mul.w.vf vf4 vf2 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (.add.w.vf vf3 vf0 vf3 :mask #b10) + (.mov a1-7 vf3) + (b! (>= (the-as int a1-7) 0) cfg-1 :delay (set! s4-0 (+ s4-0 96))) + ) + (return #t) + (label cfg-7) + #f + ) + ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc index d47b1d794f..4dcb3ff213 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-h_REF.gc @@ -33,7 +33,7 @@ (riders collide-rider 20 :inline) ) (:methods - (collide-rider-pool-method-9 () none) + (add-rider (_type_ handle) collide-rider) (prepare (_type_) none) ) ) @@ -215,17 +215,17 @@ ) (:methods (new (symbol type collide-shape uint int) _type_) - (collide-shape-prim-method-9 () none) - (collide-shape-prim-method-10 () none) - (collide-shape-prim-method-11 () none) - (collide-shape-prim-method-12 () none) - (collide-shape-prim-method-13 () none) + (debug-draw (_type_) none) + (add-fg-prim-using-box (_type_ collide-cache) none) + (add-fg-prim-using-line-sphere (_type_ collide-cache object) none) + (overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol) + (overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol) (collide-shape-prim-method-14 () none) - (collide-shape-prim-method-15 () none) + (collide-with-collide-cache-prim-mesh (_type_ collide-query collide-cache-prim) none) (collide-with-collide-cache-prim-sphere (_type_ collide-query collide-cache-prim) none) - (collide-shape-prim-method-17 () none) - (collide-shape-prim-method-18 () none) - (collide-shape-prim-method-19 () none) + (on-platform-test (_type_ collide-shape-prim collide-query float) none) + (should-push-away-test (_type_ collide-shape-prim collide-query) none) + (should-push-away-a-group-test (_type_ collide-shape-prim-group collide-query) none) ) ) @@ -1404,31 +1404,31 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t (new (symbol type process-drawable collide-list-enum) _type_) (move-by-vector! (_type_ vector) none) (move-to-point! (_type_ vector) none) - (collide-shape-method-30 () none) + (debug-draw (_type_) none) (fill-cache-for-shape (_type_ float collide-query) none) (fill-cache-integrate-and-collide (_type_ vector collide-query meters) none) - (collide-shape-method-33 () none) - (collide-shape-method-34 () none) + (find-prim-by-id (_type_ uint) collide-shape-prim) + (find-prim-by-id-logtest (_type_ uint) collide-shape-prim) (detect-riders! (_type_) symbol) - (collide-shape-method-36 () none) + (build-bounding-box-for-shape (_type_ bounding-box float collide-spec) symbol) (integrate-and-collide! (_type_ vector) none) (find-collision-meshes (_type_) none) - (collide-shape-method-39 () none) + (on-platform (_type_ collide-shape collide-query) symbol) (find-overlapping-shapes (_type_ overlaps-others-params) symbol) - (collide-shape-method-41 () none) - (collide-shape-method-42 () none) - (collide-shape-method-43 () none) + (shove-to-closest-point-on-path (_type_ attack-info float) vector) + (should-push-away (_type_ collide-shape collide-query) symbol) + (pull-rider! (_type_ pull-rider-info) none) (pull-riders! (_type_) symbol) (do-push-aways (_type_) collide-spec) (update-transforms (_type_) none) (set-collide-with! (_type_ collide-spec) none) (set-collide-as! (_type_ collide-spec) none) - (collide-shape-method-49 () none) + (modify-collide-as! (_type_ int collide-spec collide-spec) none) (send-shoves (_type_ process touching-shapes-entry float float float) symbol) (above-ground? (_type_ collide-query vector collide-spec float float float) symbol) (water-info-init! (_type_ water-info collide-action) water-info) (iterate-prims (_type_ (function collide-shape-prim none)) none) - (collide-shape-method-54 () none) + (pusher-init (_type_) none) ) ) @@ -1507,18 +1507,18 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t ) (:methods (new (symbol type process-drawable collide-list-enum) _type_) - (find-ground (_type_ collide-query collide-spec float float float) symbol) + (find-ground (_type_ collide-query collide-spec float float float process) symbol) (react-to-pat! (_type_ pat-surface) cshape-reaction-flags) - (collide-shape-moving-method-57 () none) - (collide-shape-moving-method-58 () none) - (collide-shape-moving-method-59 () none) - (collide-shape-moving-method-60 () none) + (integrate-no-collide! (_type_ vector) none) + (integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol) + (move-above-ground (_type_ vector move-above-ground-params) none) + (move-to-ground (_type_ float float symbol collide-spec) none) (move-to-ground-point (_type_ vector vector vector) none) (compute-acc-due-to-gravity (_type_ vector float) vector) (rbody-collision (_type_ rigid-body-control float) none) - (collide-shape-moving-method-64 () none) + (try-snap-to-surface (_type_ vector float float float) symbol) (fill-and-try-snap-to-surface (_type_ vector float float float collide-query) symbol) - (collide-shape-moving-method-66 () none) + (step-collision! (_type_ vector vector float int) float) (collide-with-all-collide-cache-prims (_type_ matrix collide-query) none) ) ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc new file mode 100644 index 0000000000..ff6a3cb678 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape-rider_REF.gc @@ -0,0 +1,444 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 39 of type collide-shape +(defmethod on-platform ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) + (let ((v1-0 arg1)) + (set! (-> v1-0 best-dist) 0.0) + (set! (-> v1-0 best-my-prim) #f) + (set! (-> v1-0 best-other-prim) #f) + ) + (set! (-> arg1 best-dist) 122.88) + (let ((s5-0 (-> this root-prim)) + (s4-0 (-> arg0 root-prim)) + ) + (when (and (logtest? (-> s5-0 prim-core collide-with) (-> s4-0 prim-core collide-as)) + (logtest? (-> s5-0 prim-core action) (collide-action rideable)) + (logtest? (-> s4-0 prim-core action) (collide-action can-ride)) + ) + (let ((f0-4 (- (- (vector-vector-distance (the-as vector (-> s5-0 prim-core)) (the-as vector (-> s4-0 prim-core))) + (-> s5-0 prim-core world-sphere w) + ) + (-> s4-0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-4 122.88) + (on-platform-test s5-0 s4-0 arg1 f0-4) + ) + ) + ) + ) + (< (-> arg1 best-dist) 122.88) + ) + +;; definition for method 17 of type collide-shape-prim +;; WARN: Return type mismatch object vs none. +(defmethod on-platform-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) + (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") + (none) + ) + +;; definition for method 17 of type collide-shape-prim-group +;; WARN: Return type mismatch int vs none. +(defmethod on-platform-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) + (let ((s4-0 (-> arg0 prim-core collide-as)) + (s3-0 (-> this child 0)) + ) + (countdown (s2-0 (-> this num-children)) + (when (and (logtest? (-> s3-0 prim-core collide-with) s4-0) + (logtest? (-> s3-0 prim-core action) (collide-action rideable)) + ) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> s3-0 prim-core)) (the-as vector (-> arg0 prim-core))) + (-> s3-0 prim-core world-sphere w) + ) + (-> arg0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-2 122.88) + (on-platform-test s3-0 arg0 arg1 f0-2) + ) + ) + ) + (&+! s3-0 80) + ) + ) + 0 + (none) + ) + +;; definition for method 17 of type collide-shape-prim-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch pat-surface vs none. +(defmethod on-platform-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) + (case (-> arg0 type) + ((collide-shape-prim-group) + (let ((s4-0 (-> this prim-core collide-with)) + (s3-0 (-> (the-as collide-shape-prim-group arg0) child 0)) + (s2-1 (the-as object (-> (the-as collide-shape-prim-group arg0) num-children))) + ) + (while (nonzero? (the-as uint s2-1)) + (set! s2-1 (+ (the-as uint s2-1) -1)) + (when (and (logtest? s4-0 (-> s3-0 prim-core collide-as)) + (logtest? (-> s3-0 prim-core action) (collide-action can-ride)) + ) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s3-0 prim-core))) + (-> this prim-core world-sphere w) + ) + (-> s3-0 prim-core world-sphere w) + ) + ) + ) + (if (< f0-2 122.88) + (on-platform-test this s3-0 arg1 f0-2) + ) + ) + ) + (&+! s3-0 80) + ) + ) + ) + ((collide-shape-prim-sphere) + (let ((s3-1 (-> this mesh))) + (when s3-1 + (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* this))) + (when v1-13 + (let* ((s4-1 (new 'stack-no-clear 'collide-tri-result)) + (f0-4 (sphere-on-platform-test + s3-1 + (the-as collide-mesh-cache-tri (-> v1-13 tris)) + s4-1 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (when (< f0-4 (-> arg1 best-dist)) + (set! (-> arg1 best-dist) f0-4) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s4-1 vertex 0 quad)) + (set! (-> arg1 best-other-tri vertex 1 quad) (-> s4-1 vertex 1 quad)) + (set! (-> arg1 best-other-tri vertex 2 quad) (-> s4-1 vertex 2 quad)) + (set! (-> arg1 best-other-tri intersect quad) (-> s4-1 intersect quad)) + (set! (-> arg1 best-other-tri normal quad) (-> s4-1 normal quad)) + (set! (-> arg1 best-other-tri pat) (-> s4-1 pat)) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 9 of type collide-rider-pool +(defmethod add-rider ((this collide-rider-pool) (arg0 handle)) + (let ((v1-0 (-> this alloc-count))) + (cond + ((< v1-0 20) + (let ((v0-0 (-> this riders v1-0))) + (set! (-> this alloc-count) (+ v1-0 1)) + (set! (-> v0-0 rider-handle) arg0) + (set! (-> v0-0 sticky-prim) #f) + v0-0 + ) + ) + (else + (format 0 "ERROR: *collide-rider-pool*: exceeded max # of riders!~%") + (the-as collide-rider #f) + ) + ) + ) + ) + +;; definition for method 35 of type collide-shape +;; WARN: Return type mismatch joint-control-status vs symbol. +(defmethod detect-riders! ((this collide-shape)) + (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (set! (-> this num-riders) (the-as uint 0)) + (set! (-> this riders) (the-as (inline-array collide-rider) #f)) + (let* ((s4-0 (-> this root-prim)) + (s5-0 (-> s4-0 prim-core collide-with)) + ) + (set! *actor-list-length* 0) + (if (logtest? s5-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> s4-0 prim-core)) *actor-list* 256) + ) + ) + (when (logtest? s5-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-11 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s5-0 (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (-> s4-0 prim-core)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> s4-0 prim-core world-sphere w))) + ) + (when (< f0-0 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-11) + *collide-player-list* + (set! v1-11 (-> v1-11 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-19 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-13 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? s5-0 (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (-> s4-0 prim-core)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-14 world-sphere w) (-> s4-0 prim-core world-sphere w))) + ) + (when (< f0-1 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-19) + *collide-hit-by-player-list* + (set! v1-19 (-> v1-19 next0)) + ) + ) + ) + ) + (dotimes (s4-1 *actor-list-length*) + (let* ((s3-0 (-> *actor-list* s4-1)) + (v1-24 (-> s3-0 root-prim)) + ) + (when (logtest? s5-0 (-> v1-24 prim-core collide-as)) + (when (and (logtest? (-> v1-24 prim-core action) (collide-action can-ride)) + (!= (-> this process) (-> s3-0 process)) + ) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (when (on-platform this s3-0 s2-0) + (let ((s5-1 (add-rider *collide-rider-pool* (process->handle (-> s3-0 process))))) + (when s5-1 + (+! (-> this num-riders) 1) + (if (not (-> this riders)) + (set! (-> this riders) (the-as (inline-array collide-rider) s5-1)) + ) + (let ((a0-15 (-> s2-0 best-my-prim))) + (set! (-> s5-1 sticky-prim) a0-15) + (let ((s1-0 (-> this process node-list data (-> a0-15 transform-index) bone transform))) + (set! (-> s5-1 prim-ry) (matrix-y-angle s1-0)) + (let ((s2-1 (new 'stack-no-clear 'matrix))) + (matrix-4x4-inverse! s2-1 s1-0) + (set! (-> s3-0 trans w) 1.0) + (vector-matrix*! (-> s5-1 rider-local-pos) (-> s3-0 trans) s2-1) + ) + ) + ) + (send-event (-> this process) 'ridden s5-1) + ) + ) + (set! s5-0 (-> this root-prim prim-core collide-with)) + ) + ) + ) + ) + ) + ) + ) + (let ((v1-58 (-> this process skel))) + (the-as + symbol + (when (nonzero? v1-58) + (cond + ((or (> (-> this num-riders) 0) (logtest? (-> this root-prim prim-core action) (collide-action edge-grabbed))) + (set! v0-7 (logior (-> v1-58 status) (joint-control-status sync-math))) + (set! (-> v1-58 status) v0-7) + ) + (else + (set! v0-7 (logclear (-> v1-58 status) (joint-control-status sync-math))) + (set! (-> v1-58 status) v0-7) + ) + ) + v0-7 + ) + ) + ) + ) + ) + +;; definition for method 44 of type collide-shape +;; WARN: Return type mismatch int vs symbol. +(defmethod pull-riders! ((this collide-shape)) + (let ((s5-0 (-> this riders))) + (when s5-0 + (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) + (countdown (s3-0 (-> this num-riders)) + (let* ((v1-2 (-> s5-0 s3-0)) + (a0-1 (-> v1-2 rider-handle)) + ) + (when (handle->process a0-1) + (set! (-> s4-0 rider) v1-2) + (set! (-> s4-0 rider-cshape) + (the-as collide-shape-moving (-> (the-as process-drawable (-> a0-1 process 0)) root)) + ) + (let ((a0-5 (-> v1-2 sticky-prim))) + (when a0-5 + (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s1-0 (-> s4-0 rider-dest))) + (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) + ) + (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) + ) + (pull-rider! this s4-0) + ) + ) + ) + ) + ) + ) + ) + ) + (the-as symbol 0) + ) + +;; definition for method 43 of type collide-shape +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod pull-rider! ((this collide-shape) (arg0 pull-rider-info)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (-> arg0 rider-cshape))) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> gp-0 trans quad)) + (vector-! s2-0 (-> arg0 rider-dest) s3-0) + (cond + ((logtest? (-> this root-prim prim-core action) (collide-action pull-rider-can-collide)) + (let ((s1-0 (-> this root-prim prim-core collide-as))) + (set! (-> this root-prim prim-core collide-as) (collide-spec)) + (let ((a2-0 (new 'stack-no-clear 'collide-query))) + (set! (-> a2-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) + (set! (-> a2-0 ignore-process0) (-> gp-0 process)) + (set! (-> a2-0 ignore-process1) #f) + (set! (-> a2-0 ignore-pat) (-> gp-0 pat-ignore-mask)) + (set! (-> a2-0 action-mask) (collide-action solid)) + (fill-cache-for-shape gp-0 (+ 8192.0 (vector-length s2-0)) a2-0) + ) + (set! (-> this root-prim prim-core collide-as) s1-0) + ) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (set! (-> s1-1 quad) (-> s2-0 quad)) + (let ((v1-19 s1-1)) + (.lvf vf1 (&-> s1-1 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-19 quad) vf1) + ) + (cond + ((type? gp-0 collide-shape-moving) + (let ((s2-1 (-> gp-0 status))) + (integrate-and-collide! gp-0 s1-1) + (set! (-> gp-0 status) s2-1) + ) + ) + (else + (integrate-and-collide! gp-0 s1-1) + ) + ) + ) + ) + (else + (move-by-vector! gp-0 s2-0) + ) + ) + (when (type? gp-0 collide-shape-moving) + (let ((v1-26 (new 'stack-no-clear 'vector))) + (vector-! v1-26 (-> gp-0 trans) s3-0) + (vector-float*! + (-> gp-0 rider-last-move) + v1-26 + (* (-> pp clock frames-per-second) (-> this process clock clock-ratio)) + ) + ) + (let ((f0-5 (vector-length (-> gp-0 rider-last-move)))) + (if (< (-> this rider-max-momentum) f0-5) + (vector-normalize! (-> gp-0 rider-last-move) (-> this rider-max-momentum)) + ) + ) + (set! (-> gp-0 rider-time) (-> gp-0 process clock frame-counter)) + ) + ) + (let ((f0-7 (-> arg0 rider-delta-ry))) + (if (!= f0-7 0.0) + (send-event (-> gp-0 process) 'rotate-y-angle f0-7) + ) + ) + ) + (none) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc new file mode 100644 index 0000000000..88f3ca97c3 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-shape_REF.gc @@ -0,0 +1,3144 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 54 of type collide-shape +;; WARN: Return type mismatch collide-shape vs none. +(defmethod pusher-init ((this collide-shape)) + (when (logtest? (collide-spec pusher) (-> this root-prim prim-core collide-as)) + (let ((v1-3 (the-as process-tree (-> this process)))) + (while (not (logtest? (-> v1-3 mask) (process-mask process-tree))) + (set! v1-3 (ppointer->process (-> v1-3 parent))) + ) + (if (!= v1-3 *pusher-pool*) + (change-parent (-> this process) *pusher-pool*) + ) + ) + ) + (none) + ) + +;; definition for method 42 of type collide-shape +(defmethod should-push-away ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) + (local-vars (v1-2 uint) (v1-3 float) (a2-2 uint) (a3-2 uint)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg1)) + (set! (-> v1-0 best-dist) 0.0) + (set! (-> v1-0 best-my-prim) #f) + (set! (-> v1-0 best-other-prim) #f) + ) + (let ((a0-1 (-> this root-prim)) + (a1-1 (-> arg0 root-prim)) + ) + (let ((a3-0 (-> a0-1 prim-core collide-with)) + (t0-0 (-> a1-1 prim-core collide-as)) + (v1-1 (-> a0-1 prim-core action)) + ) + (let ((a2-1 (-> a1-1 prim-core action))) + (b! (not (logtest? a3-0 t0-0)) cfg-8 :delay (set! a3-2 (the-as uint (logand a2-1 1)))) + (b! (zero? a3-2) cfg-8 :delay (set! a2-2 (the-as uint (logand a2-1 16)))) + ) + (b! (nonzero? a2-2) cfg-8 :delay (set! v1-2 (the-as uint (logand v1-1 1)))) + ) + (b! (zero? v1-2) cfg-8 :delay (nop!)) + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.lvf vf2 (&-> a1-1 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf5 vf3 vf4 :mask #b1000) + (let ((f0-1 0.0)) + (.add.w.vf vf5 vf0 vf5 :mask #b1) + (.mov v1-3 vf5) + (b! (<= f0-1 v1-3) cfg-8) + ) + (should-push-away-test a0-1 a1-1 arg1) + ) + (let ((v0-1 (< (-> arg1 best-dist) 0.0))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (set! v0-1 #f) + (label cfg-9) + v0-1 + ) + ) + ) + +;; definition for method 18 of type collide-shape-prim +;; WARN: Return type mismatch object vs none. +(defmethod should-push-away-test ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) + (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") + (none) + ) + +;; definition for method 18 of type collide-shape-prim-group +;; WARN: Return type mismatch int vs none. +(defmethod should-push-away-test ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query)) + (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((s4-0 (the-as collide-shape-prim this)) + (s3-0 (-> this num-children)) + ) + (nop!) + (let ((v1-0 (-> arg0 prim-core collide-as))) + (nop!) + (.lvf vf1 (&-> arg0 prim-core world-sphere quad)) + (until (> f0-0 a0-3) + (until (nonzero? a0-2) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (+ s4-0 80))) + (+! s3-0 -1) + (let ((a1-1 (-> s4-0 prim-core collide-with))) + (nop!) + (let ((a0-1 (-> s4-0 prim-core action)) + (a1-2 (logand a1-1 v1-0)) + ) + (set! a0-2 (logand a0-1 (collide-action solid))) + (b! (zero? a1-2) cfg-1 :delay (.lvf vf2 (&-> s4-0 prim-core world-sphere quad))) + ) + ) + ) + (.sub.vf vf3 vf2 vf1) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (set! f0-0 0.0) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + ) + (should-push-away-test s4-0 arg0 arg1) + (set! v1-0 (-> arg0 prim-core collide-as)) + ) + ) + (b! #t cfg-1 :delay (.lvf vf1 (&-> arg0 prim-core world-sphere quad))) + (label cfg-6) + 0 + (none) + ) + ) + +;; definition for method 19 of type collide-shape-prim +;; WARN: Return type mismatch int vs none. +(defmethod should-push-away-a-group-test ((this collide-shape-prim) (arg0 collide-shape-prim-group) (arg1 collide-query)) + (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((s4-0 (the-as object arg0)) + (s3-0 (-> arg0 num-children)) + ) + (nop!) + (let ((v1-0 (-> this prim-core collide-with))) + (nop!) + (.lvf vf2 (&-> this prim-core world-sphere quad)) + (until (> f0-0 a0-3) + (until (nonzero? a0-2) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (+ (the-as collide-shape-prim s4-0) 80))) + (+! s3-0 -1) + (let ((a1-1 (-> (the-as collide-shape-prim s4-0) prim-core collide-as))) + (nop!) + (let ((a0-1 (-> (the-as collide-shape-prim s4-0) prim-core action)) + (a1-2 (logand v1-0 a1-1)) + ) + (set! a0-2 (logand a0-1 (collide-action solid))) + (b! (zero? a1-2) cfg-1 :delay (.lvf vf1 (&-> (the-as collide-shape-prim s4-0) prim-core world-sphere quad))) + ) + ) + ) + (.sub.vf vf3 vf2 vf1) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (set! f0-0 0.0) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + ) + (should-push-away-test this (the-as collide-shape-prim s4-0) arg1) + (set! v1-0 (-> this prim-core collide-with)) + ) + ) + (b! #t cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) + (label cfg-6) + 0 + (none) + ) + ) + +;; definition for method 18 of type collide-shape-prim-mesh +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod should-push-away-test ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query)) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((zero? v1-0) + (should-push-away-a-group-test this (the-as collide-shape-prim-group arg0) arg1) + ) + (else + (b! (> v1-0 0) cfg-8 :delay (nop!)) + (let ((s2-0 (-> this mesh))) + (b! (not s2-0) cfg-7 :delay (empty-form)) + (let ((v1-4 (populate-for-prim-mesh *collide-mesh-cache* this))) + (b! (not v1-4) cfg-7 :delay (empty-form)) + (let ((s5-0 (new 'stack-no-clear 'collide-tri-result))) + (let ((f0-1 (should-push-away-test + s2-0 + (the-as collide-mesh-cache-tri (-> v1-4 tris)) + s5-0 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (b! (>= f0-1 (-> arg1 best-dist)) cfg-7 :delay #f) + (set! (-> arg1 best-dist) f0-1) + ) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s5-0 vertex 0 quad)) + (set! (-> arg1 best-other-tri vertex 1 quad) (-> s5-0 vertex 1 quad)) + (set! (-> arg1 best-other-tri vertex 2 quad) (-> s5-0 vertex 2 quad)) + (set! (-> arg1 best-other-tri intersect quad) (-> s5-0 intersect quad)) + (set! (-> arg1 best-other-tri normal quad) (-> s5-0 normal quad)) + (set! (-> arg1 best-other-tri pat) (-> s5-0 pat)) + ) + ) + ) + (label cfg-7) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (format 0 "ERROR: Attempted unsupported mesh -> mesh test in collide-shape-prim::should-push-away-test!~%") + ) + ) + ) + (label cfg-9) + 0 + (none) + ) + +;; definition for method 18 of type collide-shape-prim-sphere +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod should-push-away-test ((this collide-shape-prim-sphere) (arg0 collide-shape-prim) (arg1 collide-query)) + (local-vars (v1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (cond + ((zero? v1-0) + (should-push-away-a-group-test this (the-as collide-shape-prim-group arg0) arg1) + ) + (else + (b! (> v1-0 0) cfg-5 :delay (nop!)) + (.lvf vf1 (&-> this prim-core world-sphere quad)) + (.lvf vf2 (&-> arg0 prim-core world-sphere quad)) + (.sub.vf vf3 vf2 vf1 :mask #b111) + (.add.w.vf vf5 vf1 vf2 :mask #b1000) + (.mul.vf vf4 vf3 vf3 :mask #b111) + (.mul.x.vf acc vf0 vf4 :mask #b1000) + (.add.mul.y.vf acc vf0 vf4 acc :mask #b1000) + (.add.mul.z.vf vf4 vf0 vf4 acc :mask #b1000) + (.sqrt.vf Q vf4 :ftf #b11) + (.mov.vf vf3 vf0 :mask #b1000) + (.add.w.vf vf5 vf0 vf5 :mask #b1) + (let ((f2-0 (-> arg1 best-dist))) + (.wait.vf) + (nop!) + (.add.vf vf4 vf0 Q :mask #b1) + (.sub.x.vf vf6 vf4 vf5 :mask #b1) + (.mul.x.vf vf3 vf3 vf4 :mask #b111) + (.mov v1-3 vf6) + (let ((f1-0 v1-3)) + (b! (<= f2-0 f1-0) cfg-9) + (let ((v1-4 (-> this pat))) + (set! (-> arg1 best-dist) f1-0) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (.svf (&-> arg1 best-other-tri normal quad) vf3) + (set! (-> arg1 best-other-tri pat) v1-4) + ) + ) + ) + (let ((s3-0 (-> arg1 best-other-tri normal)) + (s4-1 (-> arg1 best-other-tri intersect)) + ) + (vector-float*! s4-1 s3-0 (-> this prim-core world-sphere w)) + (vector+! s4-1 s4-1 (the-as vector (-> this prim-core))) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s4-1 quad)) + (point-in-plane-<-point+normal! (-> arg1 best-other-tri vertex 1) s4-1 s3-0) + (let* ((a0-8 (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (-> arg1 best-other-tri vertex 1) + (the-as vector (-> arg1 best-other-tri)) + ) + 1.0 + ) + ) + (v1-11 (vector-cross! (new 'stack-no-clear 'vector) s3-0 a0-8)) + (a0-9 (-> arg1 best-other-tri vertex 2)) + ) + (let ((a1-7 4096.0)) + (.mov vf7 a1-7) + ) + (.lvf vf5 (&-> v1-11 quad)) + (.lvf vf4 (&-> s4-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-9 quad) vf6) + ) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-5) + (let ((s2-0 (-> (the-as collide-shape-prim-mesh arg0) mesh))) + (when s2-0 + (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* (the-as collide-shape-prim-mesh arg0)))) + (when v1-13 + (let* ((s3-1 (new 'stack-no-clear 'collide-tri-result)) + (f0-3 (should-push-away-test + s2-0 + (the-as collide-mesh-cache-tri (-> v1-13 tris)) + s3-1 + (the-as vector (-> this prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (when (< f0-3 (-> arg1 best-dist)) + (set! (-> arg1 best-dist) f0-3) + (set! (-> arg1 best-my-prim) this) + (set! (-> arg1 best-other-prim) arg0) + (let ((s4-2 (-> arg1 best-other-tri normal))) + (vector-! s4-2 (-> s3-1 intersect) (the-as vector (-> this prim-core))) + (vector-normalize! s4-2 1.0) + (let ((s3-2 (-> arg1 best-other-tri intersect))) + (vector-float*! s3-2 s4-2 (-> this prim-core world-sphere w)) + (vector+! s3-2 s3-2 (the-as vector (-> this prim-core))) + (set! (-> arg1 best-other-tri vertex 0 quad) (-> s3-2 quad)) + (point-in-plane-<-point+normal! (-> arg1 best-other-tri vertex 1) s3-2 s4-2) + (let* ((a0-23 (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (-> arg1 best-other-tri vertex 1) + (the-as vector (-> arg1 best-other-tri)) + ) + 1.0 + ) + ) + (v1-23 (vector-cross! (new 'stack-no-clear 'vector) s4-2 a0-23)) + (a0-24 (-> arg1 best-other-tri vertex 2)) + ) + (let ((a1-18 4096.0)) + (.mov vf7 a1-18) + ) + (.lvf vf5 (&-> v1-23 quad)) + (.lvf vf4 (&-> s3-2 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-24 quad) vf6) + ) + ) + ) + (set! (-> arg1 best-other-tri pat) (-> this pat)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (label cfg-9) + 0 + (none) + ) + ) + +;; definition for method 15 of type collide-shape-prim +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") + (none) + ) + +;; definition for method 15 of type collide-shape-prim-sphere +;; WARN: Return type mismatch int vs none. +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (let* ((gp-0 (new 'stack-no-clear 'collide-tri-result)) + (f0-1 (resolve-moving-sphere-tri + arg1 + gp-0 + (-> this prim-core) + (-> arg0 move-dist) + (-> arg0 best-dist) + (-> this prim-core action) + ) + ) + ) + (when (>= f0-1 0.0) + (let ((v1-3 (-> arg1 prim-core action)) + (a0-2 (-> this prim-core action)) + (a2-2 (-> arg1 prim)) + ) + (let* ((v1-4 (logand a0-2 v1-3)) + (a0-3 (-> this cshape)) + (a1-2 (logand v1-4 (collide-action solid))) + (v1-5 (-> a2-2 cshape)) + ) + (b! (zero? a1-2) cfg-6 :delay (nop!)) + (b! (= v1-5 #f) cfg-5 :likely-delay (set! a2-2 (the-as collide-shape-prim #f))) + (b! (logtest? (-> a0-3 penetrate-using) (-> v1-5 penetrated-by)) cfg-6 :delay (nop!)) + (label cfg-5) + (.lvf vf3 (&-> gp-0 vertex 0 quad)) + (.lvf vf4 (&-> gp-0 vertex 1 quad)) + (.lvf vf5 (&-> gp-0 vertex 2 quad)) + (.lvf vf1 (&-> gp-0 intersect quad)) + (.lvf vf2 (&-> gp-0 normal quad)) + (let ((a0-6 (-> gp-0 pat)) + (a1-4 (-> gp-0 collide-ptr)) + ) + (set! (-> arg0 best-dist) f0-1) + (.svf (&-> arg0 best-other-tri vertex 0 quad) vf3) + (.svf (&-> arg0 best-other-tri vertex 1 quad) vf4) + (.svf (&-> arg0 best-other-tri vertex 2 quad) vf5) + (.svf (&-> arg0 best-other-tri intersect quad) vf1) + (.svf (&-> arg0 best-other-tri normal quad) vf2) + (set! (-> arg0 best-other-tri pat) a0-6) + (set! (-> arg0 best-other-tri collide-ptr) a1-4) + ) + (set! (-> arg0 best-other-prim) a2-2) + (set! (-> arg0 best-my-prim) this) + (label cfg-6) + (b! (not v1-5) cfg-8 :delay (empty-form)) + ) + (add-touching-prims + *touching-list* + this + a2-2 + f0-1 + (the-as collide-tri-result #f) + (the-as collide-tri-result (-> gp-0 vertex)) + ) + ) + ) + ) + (label cfg-8) + 0 + (none) + ) + ) + +;; definition for method 15 of type collide-shape-prim-mesh +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") + (none) + ) + +;; definition for method 15 of type collide-shape-prim-group +;; WARN: Return type mismatch int vs none. +(defmethod collide-with-collide-cache-prim-mesh ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) + (let ((s4-0 (-> arg1 prim-core collide-as)) + (s3-0 (-> this child 0)) + ) + (countdown (s2-0 (-> this num-children)) + (if (logtest? (-> s3-0 prim-core collide-with) s4-0) + (collide-with-collide-cache-prim-mesh s3-0 arg0 arg1) + ) + (&+! s3-0 80) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type collide-shape-prim +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") + (none) + ) + +;; definition for method 16 of type collide-shape-prim-sphere +;; WARN: Return type mismatch int vs none. +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (let* ((gp-0 (new 'stack-no-clear 'collide-tri-result)) + (f0-1 (resolve-moving-sphere-sphere + arg1 + gp-0 + (-> this prim-core) + (-> arg0 move-dist) + (-> arg0 best-dist) + (-> arg1 prim-core action) + ) + ) + ) + (b! (< f0-1 0.0) cfg-5 :delay #f) + (let ((v1-3 (-> arg1 prim-core action)) + (a0-2 (-> this prim-core action)) + (a2-2 (-> arg1 prim)) + ) + (let* ((a0-3 (logand a0-2 v1-3)) + (v1-4 (-> this cshape)) + (a1-2 (logand a0-3 (collide-action solid))) + (a0-4 (-> a2-2 cshape)) + ) + (b! (zero? a1-2) cfg-4 :delay (nop!)) + (b! (logtest? (-> v1-4 penetrate-using) (-> a0-4 penetrated-by)) cfg-4 :delay (nop!)) + ) + (.lvf vf3 (&-> gp-0 vertex 0 quad)) + (.lvf vf4 (&-> gp-0 vertex 1 quad)) + (.lvf vf5 (&-> gp-0 vertex 2 quad)) + (.lvf vf1 (&-> gp-0 intersect quad)) + (.lvf vf2 (&-> gp-0 normal quad)) + (let ((v1-7 (-> gp-0 pat)) + (a0-6 (-> gp-0 collide-ptr)) + ) + (set! (-> arg0 best-dist) f0-1) + (.svf (&-> arg0 best-other-tri vertex 0 quad) vf3) + (.svf (&-> arg0 best-other-tri vertex 1 quad) vf4) + (.svf (&-> arg0 best-other-tri vertex 2 quad) vf5) + (.svf (&-> arg0 best-other-tri intersect quad) vf1) + (.svf (&-> arg0 best-other-tri normal quad) vf2) + (set! (-> arg0 best-other-tri pat) v1-7) + (set! (-> arg0 best-other-tri collide-ptr) a0-6) + ) + (set! (-> arg0 best-other-prim) a2-2) + (set! (-> arg0 best-my-prim) this) + (label cfg-4) + (add-touching-prims + *touching-list* + this + a2-2 + f0-1 + (the-as collide-tri-result #f) + (the-as collide-tri-result (-> gp-0 vertex)) + ) + ) + ) + (label cfg-5) + 0 + (none) + ) + ) + +;; definition for method 16 of type collide-shape-prim-mesh +;; WARN: Return type mismatch object vs none. +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) + (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") + (none) + ) + +;; definition for method 16 of type collide-shape-prim-group +;; WARN: Return type mismatch int vs none. +(defmethod collide-with-collide-cache-prim-sphere ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) + (let ((s4-0 (-> arg1 prim-core collide-as)) + (s3-0 (-> this child 0)) + ) + (countdown (s2-0 (-> this num-children)) + (if (logtest? (-> s3-0 prim-core collide-with) s4-0) + (collide-with-collide-cache-prim-sphere s3-0 arg0 arg1) + ) + (&+! s3-0 80) + ) + ) + 0 + (none) + ) + +;; definition for function find-ground-point +;; INFO: Used lq/sq +(defun find-ground-point ((arg0 control-info) (arg1 vector) (arg2 float) (arg3 float)) + (local-vars (sv-560 int)) + (let* ((f0-0 819.2) + (v1-1 (-> arg0 transv)) + (f30-0 (if (< f0-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) + (vector-y-angle (-> arg0 transv)) + (y-angle arg0) + ) + ) + (s2-0 (-> arg0 trans)) + (s1-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s1-0 collide-with) (-> arg0 root-prim prim-core collide-with)) + (set! (-> s1-0 ignore-process0) (-> arg0 process)) + (set! (-> s1-0 ignore-process1) #f) + (set! (-> s1-0 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> s1-0 action-mask) (collide-action solid)) + (set! (-> arg1 w) 0.0) + (dotimes (v1-9 3) + (set! (-> s1-0 bbox min data v1-9) (- (-> s2-0 data v1-9) arg3)) + (set! (-> s1-0 bbox max data v1-9) (+ (-> s2-0 data v1-9) arg3)) + ) + (set! (-> s1-0 bbox min y) (+ -40960.0 (-> s2-0 y))) + (set! (-> s1-0 bbox max y) (+ 20480.0 (-> s2-0 y))) + (fill-using-bounding-box *collide-cache* s1-0) + (vector+! (-> s1-0 start-pos) s2-0 (new 'static 'vector :y 20480.0 :w 1.0)) + (let ((v1-16 s1-0)) + (set! (-> v1-16 radius) 2048.0) + (set! (-> v1-16 collide-with) (-> arg0 root-prim prim-core collide-with)) + (set! (-> v1-16 ignore-process0) (-> arg0 process)) + (set! (-> v1-16 ignore-process1) #f) + (set! (-> v1-16 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> v1-16 action-mask) (collide-action solid)) + ) + (dotimes (s0-0 8) + (let ((f28-0 (+ f30-0 (if (not (logtest? s0-0 1)) + (* 8192.0 (the float (/ s0-0 2))) + (* -8192.0 (the float (/ s0-0 2))) + ) + ) + ) + ) + (set! sv-560 0) + (let ((f26-0 arg3)) + (set-vector! (-> s1-0 move-dist) 0.0 0.0 arg3 1.0) + (vector-rotate-y! (-> s1-0 move-dist) (-> s1-0 move-dist) f28-0) + (if (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0) + (set! f26-0 (+ -6144.0 (vector-vector-xz-distance s2-0 (-> s1-0 best-other-tri intersect)))) + ) + (let ((f24-0 arg2)) + (while (>= f26-0 f24-0) + (set-vector! (-> s1-0 start-pos) 0.0 0.0 f24-0 1.0) + (vector-rotate-y! (-> s1-0 start-pos) (-> s1-0 start-pos) f28-0) + (vector+! (-> s1-0 start-pos) s2-0 (-> s1-0 start-pos)) + (set! (-> s1-0 start-pos y) (+ 20480.0 (-> s2-0 y))) + (set-vector! (-> s1-0 move-dist) 0.0 -61440.0 0.0 1.0) + (let ((v1-33 s1-0)) + (set! (-> v1-33 radius) 10240.0) + (set! (-> v1-33 collide-with) (-> arg0 root-prim prim-core collide-with)) + (set! (-> v1-33 ignore-process0) (-> arg0 process)) + (set! (-> v1-33 ignore-process1) #f) + (set! (-> v1-33 ignore-pat) (-> arg0 pat-ignore-mask)) + (set! (-> v1-33 action-mask) (collide-action solid)) + ) + (when (>= (probe-using-line-sphere *collide-cache* s1-0) 0.0) + (cond + ((and (or (= (-> s1-0 best-other-tri pat mode) (pat-mode ground)) + (= (-> s1-0 best-other-tri pat mode) (pat-mode halfpipe)) + ) + (and (= (-> s1-0 best-other-tri pat event) (pat-event none)) (< 0.7 (-> s1-0 best-other-tri normal y))) + ) + (set! (-> arg1 quad) (-> s1-0 best-other-tri intersect quad)) + (set! sv-560 (+ sv-560 1)) + (if (>= sv-560 2) + (return arg1) + ) + ) + ((and (= (-> s1-0 best-other-tri pat mode) (pat-mode wall)) + (< (+ 4096.0 (-> s2-0 y)) (-> s1-0 best-other-tri intersect y)) + ) + (goto cfg-38) + ) + ) + ) + (set! f24-0 (+ 4096.0 f24-0)) + ) + ) + ) + ) + (label cfg-38) + ) + ) + (the-as vector #f) + ) + +;; definition for function target-attack-up +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defun target-attack-up ((arg0 target) (arg1 symbol) (arg2 symbol)) + (when (send-event arg0 arg1 #f (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg2) + (test #t) + ) + ) + ) + (let ((s3-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) 8192.0 40960.0))) + (set! s3-0 (cond + (s3-0 + (empty) + s3-0 + ) + (else + (-> arg0 control last-trans-on-ground) + ) + ) + ) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans))) + (f0-3 8192.0) + (f1-0 40960.0) + (v1-8 s2-1) + (f30-0 (fmax f0-3 (fmin f1-0 (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z))))))) + ) + (cond + ((< (fabs + (vector-dot + (-> arg0 control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans)) + ) + ) + 40960.0 + ) + (vector-xz-normalize! s2-1 f30-0) + (send-event + arg0 + arg1 + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg2) + (vector s2-1) + (shove-up + (+ (lerp-scale 4096.0 16384.0 f30-0 4096.0 40960.0) (fmax 0.0 (- (-> s3-0 y) (-> arg0 control trans y)))) + ) + (angle 'up) + ) + ) + ) + ) + (else + (send-event + arg0 + arg1 + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode arg2) + (vector + (-> (new 'static 'attack-info :trans (new 'static 'vector :y 40960.0 :w 1.0) :speed (the-as float #x68a)) + trans + ) + ) + (shove-up (meters 10)) + (angle 'up) + (control 1.0) + ) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 56 of type collide-shape-moving +;; WARN: Return type mismatch int vs cshape-reaction-flags. +(defmethod react-to-pat! ((this collide-shape-moving) (arg0 pat-surface)) + (let ((s5-0 0)) + (set! (-> this cur-pat) arg0) + (set! (-> this poly-pat) arg0) + (case (-> arg0 material) + (((pat-material ice)) + (set! (-> this surf) *ice-surface*) + ) + (((pat-material gravel)) + (set! (-> this surf) *gravel-surface*) + ) + (((pat-material quicksand)) + (set! (-> this surf) *quicksand-surface*) + ) + (((pat-material mhshroom)) + (set! (-> this surf) *mushroom-surface*) + ) + (((pat-material tube)) + (set! (-> this surf) *no-walk-surface*) + ) + (else + (set! (-> this surf) *standard-ground-surface*) + ) + ) + (when (nonzero? (-> arg0 event)) + (case (-> arg0 event) + (((pat-event slide)) + (set! (-> this surf) *gravel-surface*) + (send-event (-> this process) 'slide) + ) + (((pat-event slippery)) + (set! (-> this surf) *gravel-surface*) + ) + (((pat-event rail)) + (let* ((s4-0 (-> this process)) + (a0-15 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if (and a0-15 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-15) focus-status)))) + (set! (-> this surf) *rail-surface*) + ) + ) + ) + (((pat-event deadly)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'deadly) + (shove-up (meters 3)) + ) + ) + ) + ) + (((pat-event burn)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'burn) + (shove-up (meters 3)) + ) + ) + ) + ) + (((pat-event deadlyup)) + (set! s5-0 (logior s5-0 #x4000)) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'deadlyup) + ) + (((pat-event shockup)) + (set! s5-0 (logior s5-0 #x4000)) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'shockup) + ) + (((pat-event burnup)) + (when (not (focus-test? (the-as process-focusable (-> this process)) pilot)) + (set! s5-0 (logior s5-0 #x4000)) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'burnup) + ) + ) + (((pat-event melt)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'melt)) + ) + ) + ) + (((pat-event fry)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 4.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'fry)) + ) + ) + ) + (((pat-event slime)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 4.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'slime)) + ) + ) + ) + (((pat-event endlessfall)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint 2)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'endlessfall) + ) + ) + ) + ) + (((pat-event shock)) + (set! s5-0 (logior s5-0 #x4000)) + (send-event + (-> this process) + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint 2)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'shock)) + ) + ) + ) + (((pat-event lip)) + (send-event (-> this process) 'lip 'lip) + ) + (((pat-event lipramp)) + (send-event (-> this process) 'lip 'lipramp) + ) + (((pat-event hang)) + (send-event (-> this process) 'change-mode 'hang #f) + ) + ) + ) + (the-as cshape-reaction-flags s5-0) + ) + ) + +;; definition for function collide-shape-moving-angle-set! +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun collide-shape-moving-angle-set! ((arg0 collide-shape-moving) (arg1 vector) (arg2 vector)) + (set! (-> arg0 surface-normal quad) (-> arg1 quad)) + (set! (-> arg0 surface-angle) (vector-dot arg1 (-> arg0 dynam gravity-normal))) + (set! (-> arg0 poly-angle) (vector-dot (-> arg0 poly-normal) (-> arg0 dynam gravity-normal))) + (set! (-> arg0 touch-angle) + (fmax + (-> arg0 touch-angle) + (vector-dot arg1 (vector-normalize! (vector-negate! (new-stack-vector0) arg2) 1.0)) + ) + ) + 0 + (none) + ) + +;; definition for function cshape-reaction-update-state +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun cshape-reaction-update-state ((arg0 control-info) (arg1 collide-query) (arg2 vector)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 collide-status) (sv-96 symbol)) + (set! sv-48 (new-stack-vector0)) + (set! sv-52 (new-stack-vector0)) + (set! sv-56 (collide-status)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (react-to-pat! arg0 (-> arg1 best-other-tri pat)) + (vector-! sv-48 (the-as vector (-> arg1 best-my-prim prim-core)) (-> arg1 best-other-tri intersect)) + (cond + ((and (= (-> arg1 best-dist) 0.0) + (< (vector-length sv-48) (+ -40.96 (-> arg1 best-my-prim prim-core world-sphere w))) + ) + (set! (-> sv-48 quad) (-> arg1 best-other-tri normal quad)) + (set! (-> arg0 coverage) 0.0) + ) + (else + (set! (-> sv-48 w) 1.0) + (vector-normalize! sv-48 1.0) + (set! (-> arg0 coverage) (vector-dot sv-48 (-> arg1 best-other-tri normal))) + (when (< (-> arg0 coverage) 0.0) + (set! (-> arg0 coverage) 0.0) + (vector-flatten! sv-48 sv-48 (-> arg1 best-other-tri normal)) + (vector-normalize! sv-48 1.0) + ) + ) + ) + (let ((v1-25 (-> sv-48 quad))) + (set! (-> sv-52 quad) v1-25) + ) + (if (= (-> arg1 best-dist) 0.0) + (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-52 6.0)) + ) + (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) + (collide-shape-moving-angle-set! arg0 sv-52 arg2) + (if (< (-> arg0 poly-angle) -0.2) + (set! sv-56 (logior sv-56 (collide-status touch-ceiling))) + ) + (set! sv-96 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) + (set! sv-56 (logior sv-56 (collide-status touch-surface))) + (if (-> arg1 best-other-prim) + (set! sv-56 (logior sv-56 (collide-status touch-actor))) + ) + (cond + (sv-96 + (set! sv-56 (logior sv-56 (collide-status touch-wall))) + (set! (-> arg0 cur-pat mode) 1) + ) + (else + (set! sv-56 (logior sv-56 (collide-status on-surface))) + (set! (-> arg0 local-normal quad) (-> sv-52 quad)) + ) + ) + (when (and (not sv-96) (>= (-> arg0 coverage) 0.9)) + (set! sv-56 (logior sv-56 (collide-status on-ground))) + (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) + (when (!= (-> arg0 poly-pat mode) (pat-mode wall)) + (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) + (set! (-> arg0 ground-touch-point quad) (-> arg1 best-other-tri intersect quad)) + ) + ) + (when (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) + (set! sv-56 (logior sv-56 (collide-status impact-surface))) + (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) + ) + (logior! (-> arg0 status) sv-56) + 0 + (none) + ) + +;; definition for function cshape-reaction-default +;; INFO: Used lq/sq +(defun cshape-reaction-default ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (set! (-> a1-1 quad) (-> arg3 quad)) + (when (and (not (logtest? (-> arg0 prev-status) (collide-status on-surface))) + (not (logtest? (-> arg0 status) (collide-status touch-wall))) + ) + (let ((f0-1 (- 1.0 (-> arg0 surf impact-fric)))) + (when (< f0-1 1.0) + (let ((v1-9 (new-stack-vector0)) + (f1-3 (vector-dot (-> arg0 dynam gravity-normal) a1-1)) + ) + 0.0 + (vector-! v1-9 a1-1 (vector-float*! v1-9 (-> arg0 dynam gravity-normal) f1-3)) + (let* ((f2-2 (vector-length v1-9)) + (f3-0 f2-2) + ) + (if (< f1-3 0.0) + (set! f1-3 (* f1-3 f0-1)) + ) + (vector+! + a1-1 + (vector-float*! a1-1 (-> arg0 dynam gravity-normal) f1-3) + (vector-float*! v1-9 v1-9 (/ f2-2 f3-0)) + ) + ) + ) + ) + ) + ) + (vector-reflect-flat! arg2 a1-1 (-> arg0 surface-normal)) + ) + (-> arg0 status) + ) + +;; definition for function cshape-reaction-just-move +(defun cshape-reaction-just-move ((arg0 control-info) (arg1 collide-query) (arg2 vector)) + (vector-reset! arg2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (let ((v1-5 4)) + (if (-> arg1 best-other-prim) + (set! v1-5 (logior v1-5 32)) + ) + (let ((v0-1 (logior (-> arg0 status) v1-5))) + (set! (-> arg0 status) v0-1) + v0-1 + ) + ) + ) + +;; definition for method 66 of type collide-shape-moving +;; INFO: Used lq/sq +(defmethod step-collision! ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) + (local-vars (sv-592 int)) + (let ((s5-0 (new 'stack 'collide-query)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! s2-0 arg1 (* arg2 (seconds-per-frame))) + (set! (-> s5-0 move-dist quad) (-> s2-0 quad)) + (set! (-> s5-0 best-dist) -100000000.0) + (set! (-> s5-0 best-my-prim) #f) + (set! (-> s5-0 best-other-prim) #f) + (let* ((s1-1 (-> this root-prim)) + (v1-5 *collide-cache*) + (s0-0 (the-as collide-cache-prim (-> v1-5 prims))) + ) + (set! sv-592 (-> v1-5 num-prims)) + (while (nonzero? sv-592) + (set! sv-592 (+ sv-592 -1)) + (when (logtest? (-> s1-1 prim-core collide-with) (-> s0-0 prim-core collide-as)) + (if (>= (-> s0-0 prim-core prim-type) 0) + (collide-with-collide-cache-prim-mesh s1-1 s5-0 s0-0) + (collide-with-collide-cache-prim-sphere s1-1 s5-0 s0-0) + ) + ) + (&+! s0-0 48) + ) + ) + (let ((f30-0 (-> s5-0 best-dist))) + (set! f30-0 (cond + ((>= f30-0 0.0) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (if *display-collision-marks* + (set! (-> s2-1 quad) (-> arg1 quad)) + ) + (set! (-> this prev-status) ((-> this reaction) (the-as control-info this) s5-0 arg0 arg1)) + (when *display-collision-marks* + (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-other-tri pat mode) hilite-color))) + (add-debug-outline-triangle + #t + (bucket-id debug-no-zbuf1) + (the-as vector (-> s5-0 best-other-tri)) + (-> s5-0 best-other-tri vertex 1) + (-> s5-0 best-other-tri vertex 2) + t1-0 + ) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 best-other-tri intersect) + s2-1 + (meters 0.00007324219) + (new 'static 'rgba :r #xff :g #xa0 :a #x80) + ) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 best-other-tri intersect) + arg0 + (meters 0.00007324219) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + (if (= (-> this process type) target) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 best-other-tri intersect) + (-> this surface-normal) + (meters 0.5) + (-> *pat-mode-info* (-> this cur-pat mode) hilite-color) + ) + ) + ) + ) + f30-0 + ) + (else + (set! (-> this reaction-flag) (cshape-reaction-flags)) + ((-> this no-reaction) this s5-0 arg0 arg1) + (set! (-> this prev-status) (collide-status)) + (move-by-vector! this s2-0) + (set! (-> arg0 quad) (-> arg1 quad)) + 1.0 + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for method 37 of type collide-shape +(defmethod integrate-and-collide! ((this collide-shape) (arg0 vector)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((t9-0 (method-of-object this move-by-vector!)) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-1 quad) vf1) + (t9-0 this v1-1) + ) + (none) + ) + ) + +;; definition for method 37 of type collide-shape-moving +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod integrate-and-collide! ((this collide-shape-moving) (arg0 vector)) + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (let ((f30-0 1.0) + (s4-0 0) + ) + (while (and (< 0.05 f30-0) (and (< s4-0 (the-as int (-> this max-iteration-count))) + (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) + ) + ) + (let ((f28-0 (step-collision! this arg0 arg0 f30-0 s4-0))) + (update-from-step-size *touching-list* f28-0) + (set! f30-0 (- f30-0 (* f28-0 f30-0))) + ) + (+! s4-0 1) + ) + ) + 0 + (none) + ) + +;; definition for method 37 of type control-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod integrate-and-collide! ((this control-info) (arg0 vector)) + (stopwatch-start (the-as stopwatch (&-> *collide-stats* junk 1))) + (when (< 1638400.0 (vector-length arg0)) + (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) + (vector-reset! arg0) + ) + (set! (-> this old-anim-collide-offset-world quad) (-> this anim-collide-offset-world quad)) + (vector-matrix*! + (-> this anim-collide-offset-world) + (-> this anim-collide-offset-local) + (-> this ctrl-orientation) + ) + (vector-! + (-> this anim-collide-offset-delta-world) + (-> this anim-collide-offset-world) + (-> this old-anim-collide-offset-world) + ) + (let ((a1-6 (vector-! (new 'stack-no-clear 'vector) (-> this draw-offset) (-> this anim-collide-offset-world)))) + (vector-seek! (-> this cspace-offset) a1-6 (* 16384.0 (seconds-per-frame))) + ) + (let ((a1-8 (vector+float*! + (new-stack-vector0) + (-> this collide-extra-velocity) + (-> this anim-collide-offset-delta-world) + 60.0 + ) + ) + ) + (when (< 0.0 (vector-length a1-8)) + (let ((s2-0 (-> this max-iteration-count)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s3-0 quad) (-> arg0 quad)) + (let ((s4-0 (-> this status))) + (let ((t9-4 (method-of-type collide-shape-moving integrate-and-collide!))) + (t9-4 this a1-8) + ) + (set! (-> this max-iteration-count) s2-0) + (set! (-> arg0 quad) (-> s3-0 quad)) + (logior! (-> this status) s4-0) + ) + ) + ) + ) + (let ((s3-1 (new-stack-vector0))) + (set! (-> s3-1 quad) (-> arg0 quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (set! (-> s4-1 quad) (-> arg0 quad)) + (let ((t9-5 (method-of-type collide-shape-moving integrate-and-collide!))) + (t9-5 this s3-1) + ) + (let ((s1-0 (new-stack-vector0))) + (set! (-> s1-0 quad) (-> s4-1 quad)) + (let ((s2-1 (new-stack-vector0))) + (set! (-> s2-1 quad) (-> s3-1 quad)) + (let ((v1-32 (new-stack-vector0))) + (let ((f0-6 (vector-dot (-> this dynam gravity-normal) s1-0))) + 0.0 + (vector-! v1-32 s1-0 (vector-float*! v1-32 (-> this dynam gravity-normal) f0-6)) + ) + (let* ((f0-7 (vector-length v1-32)) + (f1-4 f0-7) + (f2-0 0.0) + ) + (vector+! + s1-0 + (vector-float*! s1-0 (-> this dynam gravity-normal) f2-0) + (vector-float*! v1-32 v1-32 (/ f0-7 f1-4)) + ) + ) + ) + (let ((v1-33 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> this dynam gravity-normal) s2-1))) + 0.0 + (vector-! v1-33 s2-1 (vector-float*! v1-33 (-> this dynam gravity-normal) f0-10)) + ) + (let* ((f0-11 (vector-length v1-33)) + (f1-6 f0-11) + (f2-1 0.0) + ) + (vector+! + s2-1 + (vector-float*! s2-1 (-> this dynam gravity-normal) f2-1) + (vector-float*! v1-33 v1-33 (/ f0-11 f1-6)) + ) + ) + ) + (vector-normalize! s1-0 1.0) + (vector-normalize! s2-1 1.0) + (let ((f0-14 (vector-dot s1-0 s2-1))) + (cond + ((and (!= (vector-length (-> this target-transv)) 0.0) + (if (logtest? (-> this status) (collide-status touch-wall)) + (< f0-14 0.9999) + (< f0-14 0.95) + ) + ) + (seek! (-> this blocked-factor) 1.0 (* 4.0 (seconds-per-frame))) + (seek! + (-> this blocked-in-air-factor) + (if (= (-> this mod-surface mode) 'air) + 1.0 + 0.0 + ) + (* 4.0 (seconds-per-frame)) + ) + (logior! (-> this status) (collide-status blocked)) + ) + (else + (seek! (-> this blocked-factor) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame))) + ) + ) + ) + ) + ) + (set! (-> arg0 quad) (-> s3-1 quad)) + (if (and (logtest? (-> this status) (collide-status on-surface)) + (and (not (logtest? (-> this status) (collide-status touch-wall blocked))) + (< (vector-length (-> this btransv)) (vector-length s4-1)) + ) + ) + (set! (-> this btransv quad) (-> s4-1 quad)) + ) + ) + ) + (let ((v1-67 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this align-xz-vel) 1.0)) + (f0-32 (vector-length (-> this align-xz-vel))) + ) + (set! (-> this zx-vel-frac) (if (= f0-32 0.0) + 0.0 + (fmax 0.0 (/ (vector-dot (-> this transv) v1-67) f0-32)) + ) + ) + ) + (stopwatch-stop (the-as stopwatch (&-> *collide-stats* junk 1))) + 0 + (none) + ) + +;; definition for method 64 of type collide-shape-moving +;; INFO: Used lq/sq +(defmethod try-snap-to-surface ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> this trans quad)) + (vector-normalize-copy! (-> this trans) arg0 arg1) + (vector+! (-> this trans) (-> this trans) gp-0) + (update-transforms this) + (vector-normalize-copy! s2-0 arg0 (- arg2 arg1)) + (let ((v1-4 s2-0)) + (.lvf vf1 (&-> s2-0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-4 quad) vf1) + ) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (let ((f30-0 (step-collision! this s2-0 s2-0 1.0 0))) + (update-from-step-size *touching-list* f30-0) + (cond + ((< f30-0 1.0) + (let ((s1-1 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (vector-normalize-copy! s1-1 arg0 1.0) + (vector-! s2-1 (-> this trans) gp-0) + (when (< (vector-dot s1-1 s2-1) arg3) + (vector-normalize-copy! s2-1 arg0 arg3) + (vector+! s2-1 s2-1 gp-0) + (move-to-point! this s2-1) + ) + ) + #t + ) + (else + (move-to-point! this gp-0) + #f + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 65 of type collide-shape-moving +(defmethod fill-and-try-snap-to-surface ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) + (vector-normalize-copy! (-> arg4 start-pos) arg0 arg1) + (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> this trans)) + (vector-normalize-copy! (-> arg4 move-dist) arg0 (- arg2 arg1)) + (fill-using-line-sphere *collide-cache* arg4) + (try-snap-to-surface this arg0 arg1 arg2 arg3) + ) + +;; definition for method 61 of type collide-shape-moving +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-to-ground-point ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) + (move-to-point! this arg0) + (set! (-> arg1 y) 0.0) + (set! (-> this ground-touch-point quad) (-> arg0 quad)) + (set! (-> this poly-normal quad) (-> arg2 quad)) + (set! (-> this surface-normal quad) (-> arg2 quad)) + (set! (-> this local-normal quad) (-> arg2 quad)) + (set! (-> this ground-poly-normal quad) (-> arg2 quad)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + (set! (-> this ground-impact-vel) (- (vector-dot arg1 (-> this dynam gravity-normal)))) + 0 + (none) + ) + +;; definition for method 57 of type collide-shape-moving +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod integrate-no-collide! ((this collide-shape-moving) (arg0 vector)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (let ((t9-1 (method-of-object this move-by-vector!)) + (a1-5 (new 'stack-no-clear 'vector)) + ) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-2 (seconds-per-frame))) + (.mov at-0 f0-2) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a1-5 quad) vf1) + (t9-1 this a1-5) + ) + 0 + (none) + ) + ) + +;; definition for method 58 of type collide-shape-moving +(defmethod integrate-for-enemy-no-mtg ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) + (integrate-no-collide! this arg0) + (let ((s5-1 (find-overlapping-shapes this arg1))) + (if s5-1 + (move-to-point! this (-> this trans-old)) + ) + s5-1 + ) + ) + +;; definition for method 55 of type collide-shape-moving +;; INFO: Used lq/sq +(defmethod find-ground ((this collide-shape-moving) + (arg0 collide-query) + (arg1 collide-spec) + (arg2 float) + (arg3 float) + (arg4 float) + (arg5 process) + ) + (set! (-> this gspot-pos quad) (-> this trans quad)) + (set! (-> arg0 start-pos quad) (-> this trans quad)) + (vector-reset! (-> arg0 move-dist)) + (let ((f0-0 (-> this transv y))) + (if (< f0-0 0.0) + (set! arg2 (- arg2 (fmax -40960.0 (* f0-0 (seconds-per-frame))))) + ) + ) + (+! (-> arg0 start-pos y) arg2) + (set! (-> arg0 move-dist y) (- (+ arg2 arg3))) + (let ((v1-7 arg0)) + (set! (-> v1-7 radius) arg4) + (set! (-> v1-7 collide-with) arg1) + (set! (-> v1-7 ignore-process0) (-> this process)) + (set! (-> v1-7 ignore-process1) arg5) + (set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> this pat-ignore-mask))) + (set! (-> v1-7 action-mask) (collide-action solid)) + ) + (let ((f0-10 (fill-and-probe-using-line-sphere *collide-cache* arg0))) + (cond + ((>= f0-10 0.0) + (let ((v1-11 (vector+float*! (new 'stack-no-clear 'vector) (-> arg0 start-pos) (-> arg0 move-dist) f0-10))) + (set! (-> this gspot-pos y) (- (-> v1-11 y) arg4)) + (vector-! (-> this gspot-normal) v1-11 (-> arg0 best-other-tri intersect)) + ) + (vector-normalize! (-> this gspot-normal) 1.0) + #t + ) + (else + (set! (-> this gspot-pos y) -40959590.0) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + #f + ) + ) + ) + ) + +;; definition for method 51 of type collide-shape +;; INFO: Used lq/sq +(defmethod above-ground? ((this collide-shape) + (arg0 collide-query) + (arg1 vector) + (arg2 collide-spec) + (arg3 float) + (arg4 float) + (arg5 float) + ) + (set! (-> arg0 start-pos quad) (-> arg1 quad)) + (+! (-> arg0 start-pos y) arg3) + (vector-reset! (-> arg0 move-dist)) + (set! (-> arg0 move-dist y) (- (+ arg3 arg4))) + (let ((v1-2 arg0)) + (set! (-> v1-2 radius) arg5) + (set! (-> v1-2 collide-with) arg2) + (set! (-> v1-2 ignore-process0) (-> this process)) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) (-> this pat-ignore-mask)) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) + ) + +;; definition for method 59 of type collide-shape-moving +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-above-ground ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) + (when *debug-segment* + (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-7 'collide) + (s2-0 *profile-collide-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s1-0 (-> s3-0 data (-> s3-0 count)))) + (let ((s0-0 (-> s3-0 base-time))) + (set! (-> s1-0 name) v1-7) + (set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0)))) + ) + (set! (-> s1-0 depth) (the-as uint (-> s3-0 depth))) + (set! (-> s1-0 color) s2-0) + (set! (-> s3-0 segment (-> s3-0 depth)) s1-0) + ) + (set! (-> s3-0 count) (min 1023 (+ (-> s3-0 count) 1))) + (+! (-> s3-0 depth) 1) + (set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth))) + ) + ) + 0 + ) + (set! (-> arg1 on-ground?) #f) + (set! (-> arg1 do-move?) #t) + (set! (-> arg1 old-gspot-pos quad) (-> this gspot-pos quad)) + (set! (-> arg1 old-gspot-normal quad) (-> this gspot-normal quad)) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (vector-v+! (-> this trans) (-> this trans) arg0) + (set! (-> arg1 new-pos quad) (-> this trans quad)) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (cond + ((find-ground this s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0 (the-as process #f)) + (when (>= (-> this gspot-pos y) (-> arg1 new-pos y)) + (set! (-> arg1 on-ground?) #t) + (set! (-> arg1 pat) (-> s3-1 best-other-tri pat)) + (set! (-> arg1 new-pos y) (-> s3-1 best-other-tri intersect y)) + (set! (-> this ground-impact-vel) (- (vector-dot arg0 (-> this dynam gravity-normal)))) + (set! (-> arg0 y) 0.0) + ) + ) + (else + (if (-> arg1 hover-if-no-ground?) + (set! (-> arg1 new-pos y) (-> this trans-old y)) + ) + ) + ) + ) + (set! (-> this trans quad) (-> this trans-old quad)) + (move-to-point! this (-> arg1 new-pos)) + (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) + (collide-spec hit-by-player-list hit-by-others-list player-list) + ) + (-> this root-prim prim-core collide-with) + ) + (when (find-overlapping-shapes this (-> arg1 overlaps-params)) + (when (-> arg1 dont-move-if-overlaps?) + (set! (-> arg1 do-move?) #f) + (move-to-point! this (-> this trans-old)) + (set! (-> this gspot-pos quad) (-> arg1 old-gspot-pos quad)) + (set! (-> this gspot-normal quad) (-> arg1 old-gspot-normal quad)) + ) + ) + ) + (when (-> arg1 do-move?) + (cond + ((-> arg1 on-ground?) + (let ((a1-8 (-> this gspot-pos)) + (a0-31 (-> this gspot-normal)) + (v1-59 (-> arg1 pat)) + ) + (set! (-> this ground-touch-point quad) (-> a1-8 quad)) + (set! (-> this poly-normal quad) (-> a0-31 quad)) + (set! (-> this surface-normal quad) (-> a0-31 quad)) + (set! (-> this local-normal quad) (-> a0-31 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-31 quad)) + (set! (-> this poly-pat) v1-59) + (set! (-> this cur-pat) v1-59) + (set! (-> this ground-pat) v1-59) + ) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + ) + (else + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-69 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-69 quad)) + (set! (-> this surface-normal quad) (-> v1-69 quad)) + (set! (-> this poly-normal quad) (-> v1-69 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + ) + ) + ) + (when *debug-segment* + (let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-83 (+ (-> gp-1 depth) -1)) + (s5-1 (-> gp-1 segment v1-83)) + (s4-1 (-> gp-1 base-time)) + ) + (when (>= v1-83 0) + (set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-1)))) + (+! (-> gp-1 depth) -1) + ) + ) + ) + ) + 0 + ) + 0 + (none) + ) + +;; definition for method 60 of type collide-shape-moving +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-to-ground ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) + (local-vars (sv-576 profile-segment) (sv-592 int)) + (when *debug-segment* + (let ((s1-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-7 'collide) + (s0-0 *profile-collide-color*) + ) + (when (and *dproc* *debug-segment*) + (set! sv-576 (-> s1-0 data (-> s1-0 count))) + (set! sv-592 (-> s1-0 base-time)) + (set! (-> sv-576 name) v1-7) + (set! (-> sv-576 start-time) + (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint sv-592))) + ) + (set! (-> sv-576 depth) (the-as uint (-> s1-0 depth))) + (set! (-> sv-576 color) s0-0) + (set! (-> s1-0 segment (-> s1-0 depth)) sv-576) + (set! (-> s1-0 count) (min 1023 (+ (-> s1-0 count) 1))) + (+! (-> s1-0 depth) 1) + (set! (-> s1-0 max-depth) (max (-> s1-0 max-depth) (-> s1-0 depth))) + ) + ) + 0 + ) + (let ((s1-1 (new 'stack-no-clear 'collide-query))) + (cond + ((find-ground this s1-1 arg3 arg0 arg1 1024.0 (the-as process #f)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> this trans quad)) + (set! (-> a1-4 y) (-> s1-1 best-other-tri intersect y)) + (move-to-point! this a1-4) + ) + (let ((a1-5 (-> s1-1 best-other-tri intersect)) + (a0-21 (-> s1-1 best-other-tri normal)) + (v1-25 (-> s1-1 best-other-tri pat)) + ) + (set! (-> this ground-touch-point quad) (-> a1-5 quad)) + (set! (-> this poly-normal quad) (-> a0-21 quad)) + (set! (-> this surface-normal quad) (-> a0-21 quad)) + (set! (-> this local-normal quad) (-> a0-21 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-21 quad)) + (set! (-> this poly-pat) v1-25) + (set! (-> this cur-pat) v1-25) + (set! (-> this ground-pat) v1-25) + ) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + #t + ) + (else + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) + ) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-36 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-36 quad)) + (set! (-> this surface-normal quad) (-> v1-36 quad)) + (set! (-> this poly-normal quad) (-> v1-36 quad)) + ) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) + ) + (if arg2 + (format 0 "WARNING: move-to-ground: failed to locate ground for ~S!~%" (-> this process name)) + ) + ) + ) + ) + (when *debug-segment* + (let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-52 (+ (-> gp-1 depth) -1)) + (s5-1 (-> gp-1 segment v1-52)) + (s4-1 (-> gp-1 base-time)) + ) + (when (>= v1-52 0) + (set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-1)))) + (+! (-> gp-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (none) + ) + +;; definition for method 62 of type collide-shape-moving +;; INFO: Used lq/sq +(defmethod compute-acc-due-to-gravity ((this collide-shape-moving) (arg0 vector) (arg1 float)) + (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this dynam gravity))) + (a2-1 (-> this local-normal)) + (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) + ) + (vector--float*! arg0 s4-0 a2-2 (cond + ((logtest? (-> this status) (collide-status on-surface)) + (empty) + arg1 + ) + (else + 0.0 + ) + ) + ) + ) + arg0 + ) + +;; definition for method 32 of type collide-shape +(defmethod fill-cache-integrate-and-collide ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((a0-1 v1-0)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-1 quad) vf1) + ) + (fill-cache-for-shape this (+ (vector-length v1-0) arg2) arg1) + ) + (integrate-and-collide! this arg0) + (none) + ) + ) + +;; definition for method 31 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod fill-cache-for-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) + (cond + ((build-bounding-box-for-shape this (-> arg1 bbox) arg0 (-> arg1 collide-with)) + (fill-using-bounding-box *collide-cache* arg1) + (if (and *display-collide-cache* (or (= (-> this process type) target) (= (-> this process) *debug-actor*))) + (debug-draw *collide-cache*) + ) + ) + (else + (reset *collide-cache*) + ) + ) + 0 + (none) + ) + +;; definition for method 36 of type collide-shape +(defmethod build-bounding-box-for-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) + (rlet ((vf0 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + (let ((t0-0 (new 'static 'vector :x 4.096)) + (v1-0 (-> this root-prim)) + ) + (.mov vf31 arg1) + (let ((a0-2 (logand (-> v1-0 prim-core collide-with) arg2)) + (a2-1 (-> v1-0 prim-core prim-type)) + ) + (b! (zero? a0-2) cfg-9 :delay (.lvf vf28 (&-> t0-0 quad))) + (.add.x.vf vf31 vf31 vf28 :mask #b1) + (let ((a0-3 (-> v1-0 specific 0))) + (b! (zero? a2-1) cfg-3 :delay (.lvf vf24 (&-> v1-0 prim-core world-sphere quad))) + (.add.w.vf vf25 vf31 vf24 :mask #b1) + (.add.x.vf vf30 vf24 vf25 :mask #b111) + (b! #t cfg-10 :delay (.sub.x.vf vf29 vf24 vf25 :mask #b111)) + (label cfg-3) + (b! (zero? a0-3) cfg-9 :delay (set! v1-0 (+ v1-0 80))) + (+! a0-3 -1) + (let ((a2-3 (logand (-> v1-0 prim-core collide-with) arg2))) + (.lvf vf24 (&-> v1-0 prim-core world-sphere quad)) + (b! (zero? a2-3) cfg-3 :delay (.add.w.vf vf25 vf31 vf24 :mask #b1)) + ) + (.add.x.vf vf30 vf24 vf25 :mask #b111) + (.sub.x.vf vf29 vf24 vf25 :mask #b111) + (label cfg-6) + (b! (zero? a0-3) cfg-10 :delay (set! v1-0 (+ v1-0 80))) + (+! a0-3 -1) + ) + ) + (let ((a2-5 (logand (-> v1-0 prim-core collide-with) arg2))) + (.lvf vf24 (&-> v1-0 prim-core world-sphere quad)) + (b! (zero? a2-5) cfg-6 :delay (.add.w.vf vf25 vf31 vf24 :mask #b1)) + ) + ) + (.add.x.vf vf27 vf24 vf25 :mask #b111) + (.sub.x.vf vf26 vf24 vf25 :mask #b111) + (.min.vf vf29 vf29 vf26) + (.max.vf vf30 vf30 vf27) + (b! #t cfg-6 :delay (nop!)) + (label cfg-9) + (let ((v0-0 #f)) + (b! #t cfg-11 :delay (nop!)) + (label cfg-10) + (.mov.vf vf29 vf0 :mask #b1000) + (.mov.vf vf30 vf0 :mask #b1000) + (.svf (&-> arg0 min quad) vf29) + (.svf (&-> arg0 max quad) vf30) + (set! v0-0 #t) + (label cfg-11) + v0-0 + ) + ) + ) + +;; definition for method 33 of type collide-shape +(defmethod find-prim-by-id ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (if (= (-> v1-0 prim-id) arg0) + (return v1-0) + ) + (&+! v1-0 80) + ) + ) + (the-as collide-shape-prim #f) + ) + +;; definition for method 34 of type collide-shape +(defmethod find-prim-by-id-logtest ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (if (logtest? (-> v1-0 prim-id) arg0) + (return v1-0) + ) + (&+! v1-0 80) + ) + ) + (the-as collide-shape-prim #f) + ) + +;; definition (debug) for function collide-shape-draw-debug-marks +;; WARN: Return type mismatch int vs none. +(defun-debug collide-shape-draw-debug-marks () + (add-debug-sphere + (or *display-collision-marks* *display-target-marks*) + (bucket-id debug) + (target-pos 0) + (meters 0.2) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + (when *display-collision-marks* + (let ((v1-4 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((gp-1 (-> v1-4 next0))) + (while (!= v1-4 (-> *collide-player-list* alive-list-end)) + (let ((a0-4 (the-as collide-shape (-> (the-as connection v1-4) param1)))) + (if (or (not *debug-actor*) (= (-> a0-4 process) *target*) (= (-> a0-4 process) *debug-actor*)) + (debug-draw a0-4) + ) + ) + (set! v1-4 gp-1) + *collide-player-list* + (set! gp-1 (-> gp-1 next0)) + ) + ) + ) + (let ((v1-15 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((gp-2 (-> v1-15 next0))) + (while (!= v1-15 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((a0-11 (the-as collide-shape (-> (the-as connection v1-15) param1)))) + (if (or (not *debug-actor*) (= (-> a0-11 process) *target*) (= (-> a0-11 process) *debug-actor*)) + (debug-draw a0-11) + ) + ) + (set! v1-15 gp-2) + *collide-hit-by-player-list* + (set! gp-2 (-> gp-2 next0)) + ) + ) + ) + (let ((v1-26 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((gp-3 (-> v1-26 next0))) + (while (!= v1-26 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((a0-18 (the-as collide-shape (-> (the-as connection v1-26) param1)))) + (if (or (not *debug-actor*) (= (-> a0-18 process) *target*) (= (-> a0-18 process) *debug-actor*)) + (debug-draw a0-18) + ) + ) + (set! v1-26 gp-3) + *collide-hit-by-others-list* + (set! gp-3 (-> gp-3 next0)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this collide-shape)) + (if (sphere-in-view-frustum? (the-as sphere (-> this root-prim prim-core))) + (debug-draw (-> this root-prim)) + ) + 0 + (none) + ) + +;; definition for symbol *col-timer*, type stopwatch +(define *col-timer* (new 'global 'stopwatch)) + +;; definition for symbol *frame-timer*, type stopwatch +(define *frame-timer* (new 'global 'stopwatch)) + +;; definition for symbol *col-timer-enable*, type symbol +(define *col-timer-enable* #t) + +;; definition for function debug-report-col-stats +(defun debug-report-col-stats () + (when *col-timer-enable* + (stopwatch-end *frame-timer*) + (format *stdcon* "col stats:~%") + (format *stdcon* " col ~F ms~%" (* 1000.0 (stopwatch-elapsed-seconds *col-timer*))) + (format *stdcon* " frame ~F ms~%" (* 1000.0 (stopwatch-elapsed-seconds *frame-timer*))) + (stopwatch-init *col-timer*) + (stopwatch-init *frame-timer*) + (stopwatch-begin *frame-timer*) + ) + ) + +;; definition for method 46 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod update-transforms ((this collide-shape)) + (local-vars (v1-8 float) (a1-5 float) (a1-7 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> this root-prim)) + (v1-1 (-> this process node-list)) + ) + (cond + ((nonzero? v1-1) + (countdown (a0-1 (-> this total-prims)) + (let ((a1-0 (-> s5-0 transform-index))) + (cond + ((>= a1-0 0) + (let ((a1-4 (-> v1-1 data a1-0 bone transform))) + (.lvf vf5 (&-> a1-4 trans quad)) + (.lvf vf1 (&-> s5-0 local-sphere quad)) + (.lvf vf2 (&-> a1-4 rvec quad)) + (.mul.w.vf acc vf5 vf0) + (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b11) + (.lvf vf3 (&-> a1-4 uvec quad)) + (.add.mul.x.vf acc vf2 vf1 acc) + (.lvf vf4 (&-> a1-4 fvec quad)) + ) + (.add.mul.y.vf acc vf3 vf1 acc) + (.add.mul.z.vf vf1 vf4 vf1 acc :mask #b111) + (.mul.vf vf1 vf1 Q :mask #b111) + (.svf (&-> s5-0 prim-core world-sphere quad) vf1) + (.mov a1-5 vf1) + ) + (else + (when (= a1-0 -2) + (.lvf vf1 (&-> s5-0 local-sphere quad)) + (.lvf vf2 (&-> this trans quad)) + (.add.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> s5-0 prim-core world-sphere quad) vf1) + (.mov a1-7 vf1) + ) + ) + ) + ) + (&+! s5-0 80) + ) + ) + (else + (countdown (s4-0 (-> this total-prims)) + (case (-> s5-0 transform-index) + ((-3) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-orient-by-quat! s3-0 (-> s5-0 local-sphere) (-> this quat)) + (vector+! (the-as vector (-> s5-0 prim-core)) s3-0 (-> this trans)) + ) + (set! (-> s5-0 prim-core world-sphere w) (-> s5-0 local-sphere w)) + ) + ((-2) + (.lvf vf1 (&-> s5-0 local-sphere quad)) + (.lvf vf2 (&-> this trans quad)) + (.add.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> s5-0 prim-core world-sphere quad) vf1) + (.mov v1-8 vf1) + ) + ) + (&+! s5-0 80) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 28 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod move-by-vector! ((this collide-shape) (arg0 vector)) + (vector+! (-> this trans) (-> this trans) arg0) + (let ((v1-1 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (vector+! (the-as vector (-> v1-1 prim-core)) (the-as vector (-> v1-1 prim-core)) arg0) + (set! (-> v1-1 prim-core world-sphere w) (-> v1-1 local-sphere w)) + (&+! v1-1 80) + ) + ) + 0 + (none) + ) + +;; definition for method 29 of type collide-shape +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod move-to-point! ((this collide-shape) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg0 (-> this trans)) + (set! (-> this trans quad) (-> arg0 quad)) + (let ((a1-2 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (vector+! (the-as vector (-> a1-2 prim-core)) (the-as vector (-> a1-2 prim-core)) v1-0) + (set! (-> a1-2 prim-core world-sphere w) (-> a1-2 local-sphere w)) + (&+! a1-2 80) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 47 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod set-collide-with! ((this collide-shape) (arg0 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (set! (-> v1-0 prim-core collide-with) arg0) + (nop!) + (nop!) + (&+! v1-0 80) + ) + ) + 0 + (none) + ) + +;; definition for method 48 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod set-collide-as! ((this collide-shape) (arg0 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (set! (-> v1-0 prim-core collide-as) arg0) + (nop!) + (nop!) + (&+! v1-0 80) + ) + ) + 0 + (none) + ) + +;; definition for method 53 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod iterate-prims ((this collide-shape) (arg0 (function collide-shape-prim none))) + (let ((s5-0 (-> this root-prim))) + (countdown (s4-0 (-> this total-prims)) + (arg0 s5-0) + (&+! s5-0 80) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod find-collision-meshes ((this collide-shape)) + (let ((s5-0 (-> this root-prim)) + (s4-0 0) + ) + (let ((v1-0 (-> s5-0 prim-core prim-type))) + (cond + ((= v1-0 1) + (set! s4-0 1) + ) + ((zero? v1-0) + (set! s4-0 (the-as int (-> s5-0 specific 1))) + (&+! s5-0 80) + ) + ) + ) + (when (nonzero? s4-0) + (let ((s3-0 0)) + (let ((v1-7 (-> this process draw)) + (s2-0 (the-as (array collide-mesh) #f)) + ) + (when (and (nonzero? v1-7) (-> v1-7 jgeo)) + (set! s2-0 (res-lump-struct (-> v1-7 jgeo extra) 'collide-mesh-group (array collide-mesh))) + (when s2-0 + (countdown (s1-0 s4-0) + (when (= (-> s5-0 prim-core prim-type) 1) + (let ((s0-0 (-> (the-as collide-shape-prim-mesh s5-0) mesh-id))) + (cond + ((and (>= s0-0 0) (< s0-0 (length s2-0))) + (set! (-> (the-as collide-shape-prim-mesh s5-0) mesh) (-> s2-0 s0-0)) + ) + (else + (set! (-> (the-as collide-shape-prim-mesh s5-0) mesh) #f) + (+! s3-0 1) + ) + ) + ) + ) + (set! s5-0 (&+ (the-as collide-shape-prim-mesh s5-0) 80)) + ) + ) + ) + (when (not s2-0) + (while (nonzero? s4-0) + (+! s4-0 -1) + (when (= (-> (the-as collide-shape-prim-mesh s5-0) prim-core prim-type) 1) + (set! (-> (the-as collide-shape-prim-mesh s5-0) mesh) #f) + (+! s3-0 1) + ) + (set! s5-0 (&+ (the-as collide-shape-prim-mesh s5-0) 80)) + ) + ) + ) + (if (nonzero? s3-0) + (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s3-0 (-> this process name)) + ) + ) + ) + ) + (update-transforms this) + 0 + (none) + ) + +;; definition for method 9 of type collide-shape-prim +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this collide-shape-prim)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) + ) + 0 + (none) + ) + +;; definition for method 9 of type collide-shape-prim-sphere +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this collide-shape-prim-sphere)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (cond + ((and (zero? (-> this prim-core collide-as)) (zero? (-> this prim-core collide-with))) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) + ) + ((logtest? (-> this prim-core action) (collide-action solid)) + (new 'static 'rgba :r #xff :g #xff :a #x40) + ) + (else + (new 'static 'rgba :r #xff :g #x80 :a #x40) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type collide-shape-prim-mesh +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this collide-shape-prim-mesh)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (new 'static 'rgba :b #xff :a #x40) + ) + 0 + (none) + ) + +;; definition for method 9 of type collide-shape-prim-group +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw ((this collide-shape-prim-group)) + (add-debug-sphere + #t + (bucket-id debug) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) + (new 'static 'rgba :g #xff :a #x10) + ) + (countdown (s5-0 (-> this num-children)) + (debug-draw (-> this child s5-0)) + ) + 0 + (none) + ) + +;; definition for method 45 of type collide-shape +;; INFO: Used lq/sq +(defmethod do-push-aways ((this collide-shape)) + (local-vars (at-0 int) (v1-55 float) (a2-5 float) (a2-12 float)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) + (set! (-> gp-0 cspec) (collide-spec)) + (let ((s4-0 (-> this root-prim prim-core collide-with))) + (set! *actor-list-length* 0) + (if (logtest? s4-0 (collide-spec hit-by-others-list)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> this root-prim prim-core)) *actor-list* 256) + ) + ) + (when (logtest? s4-0 (collide-spec player-list)) + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? s4-0 (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-2 (-> this root-prim prim-core)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-2 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this root-prim prim-core world-sphere w))) + ) + (when (< f0-0 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 (collide-spec hit-by-player-list)) + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-14 (-> (the-as collide-shape-moving a0-6) root-prim)) + ) + (when (logtest? s4-0 (-> a1-14 prim-core collide-as)) + (let ((a1-15 (-> a1-14 prim-core))) + (let ((a2-11 a1-15) + (a3-4 (-> this root-prim prim-core)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-4 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-15 world-sphere w) (-> this root-prim prim-core world-sphere w))) + ) + (when (< f0-1 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let* ((s1-0 (-> *actor-list* s3-0)) + (s2-0 (-> s1-0 root-prim)) + ) + (when (logtest? s4-0 (-> s2-0 prim-core collide-as)) + (when (!= (-> this process) (-> s1-0 process)) + (when (and (should-push-away this s1-0 (-> gp-0 cquery)) (>= -81.92 (-> gp-0 cquery best-dist))) + (set! (-> gp-0 cquery collide-with) (-> s1-0 root-prim prim-core collide-with)) + (set! (-> gp-0 cquery ignore-process0) (-> s1-0 process)) + (set! (-> gp-0 cquery ignore-process1) #f) + (set! (-> gp-0 cquery ignore-pat) (-> s1-0 pat-ignore-mask)) + (set! (-> gp-0 cquery action-mask) (collide-action solid)) + (-> gp-0 cquery) + (fill-cache-for-shape s1-0 8192.0 (-> gp-0 cquery)) + (let ((s4-1 3)) + (until (or (<= s4-1 0) (not (should-push-away this s1-0 (-> gp-0 cquery)))) + (set! (-> gp-0 vec33 quad) (-> s1-0 trans quad)) + (let* ((f0-4 (+ 2867.2 (-> gp-0 vec33 y))) + (f2-2 (+ 5734.4 f0-4)) + (f1-11 (-> gp-0 cquery best-other-tri intersect y)) + ) + (cond + ((< f1-11 f0-4) + (set! f1-11 f0-4) + ) + ((< f2-2 f1-11) + (set! f1-11 f2-2) + ) + ) + (set! (-> gp-0 vec33 y) f1-11) + ) + (.lvf vf4 (&-> (-> gp-0 vec33) quad)) + (.lvf vf3 (&-> (-> gp-0 cquery) best-other-tri intersect quad)) + (.lvf vf5 (&-> (-> gp-0 cquery) best-other-tri normal quad)) + (.sub.vf vf2 vf4 vf3) + (.mul.vf vf1 vf5 vf2) + (.add.x.vf vf1 vf1 vf1 :mask #b10) + (.add.z.vf vf1 vf1 vf1 :mask #b10) + (.mov v1-55 vf1) + (b! (< (the-as int v1-55) 0) cfg-35 :likely-delay (.sub.vf vf2 vf0 vf2)) + (label cfg-35) + (.svf (&-> (-> gp-0 push-vel) quad) vf2) + (vector-normalize! (-> gp-0 push-vel) 1.0) + (vector-float*! (-> gp-0 push-vel) (-> gp-0 push-vel) (- (-> gp-0 cquery best-dist))) + (let ((v1-59 (-> gp-0 push-vel))) + (.lvf vf1 (&-> (-> gp-0 push-vel) quad)) + (let ((f0-7 (-> pp clock frames-per-second))) + (.mov at-0 f0-7) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-59 quad) vf1) + ) + (let ((s0-0 (-> (the-as collide-shape-moving s1-0) status))) + (integrate-and-collide! (the-as collide-shape-moving s1-0) (-> gp-0 push-vel)) + (set! (-> (the-as collide-shape-moving s1-0) status) s0-0) + ) + (+! s4-1 -1) + ) + (if (zero? s4-1) + (logior! (-> gp-0 cspec) (-> s2-0 prim-core collide-as)) + ) + ) + (set! s4-0 (-> this root-prim prim-core collide-with)) + ) + ) + ) + ) + ) + ) + (-> gp-0 cspec) + ) + ) + ) + ) + +;; definition for method 40 of type collide-shape +;; WARN: Return type mismatch object vs symbol. +(defmethod find-overlapping-shapes ((this collide-shape) (arg0 overlaps-others-params)) + (local-vars (a0-10 float) (a0-14 uint) (a2-5 float) (a2-12 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as object #f))) + (let* ((s3-0 (-> this root-prim)) + (s2-0 (the-as uint (logand (-> s3-0 prim-core collide-with) (-> arg0 collide-with-filter)))) + ) + (set! (-> arg0 filtered-root-collide-with) (the-as collide-spec s2-0)) + (set! *actor-list-length* 0) + (b! (not (logtest? (the-as collide-spec s2-0) 512)) cfg-2 :delay (empty-form)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> s3-0 prim-core)) *actor-list* 256) + ) + (label cfg-2) + (b! (not (logtest? (the-as collide-spec s2-0) 1024)) cfg-11 :delay (empty-form)) + (let ((a0-3 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-12 (-> a0-3 next0))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-4) + (let ((a0-4 (-> (the-as connection a0-3) param1))) + (let ((a1-2 (-> (the-as collide-shape a0-4) root-prim))) + (b! (not (logtest? (the-as collide-spec s2-0) (-> a1-2 prim-core collide-as))) cfg-8 :delay (empty-form)) + (let ((a1-3 (-> a1-2 prim-core))) + (let ((a2-4 a1-3) + (a3-1 (-> s3-0 prim-core)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-3 world-sphere w) (-> s3-0 prim-core world-sphere w))) + ) + (b! (>= f0-0 (* f1-1 f1-1)) cfg-8 :delay #f) + ) + ) + ) + (b! (>= *actor-list-length* 256) cfg-8 :delay #f) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-4)) + ) + (set! *actor-list-length* (+ *actor-list-length* 1)) + (label cfg-8) + (set! a0-3 v1-12) + *collide-player-list* + (set! v1-12 (-> v1-12 next0)) + ) + (label cfg-9) + (b! (!= a0-3 (-> *collide-player-list* alive-list-end)) cfg-4 :delay (nop!)) + ) + (label cfg-11) + (b! (not (logtest? (the-as collide-spec s2-0) 256)) cfg-20 :delay (empty-form)) + (let ((a0-6 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-20 (-> a0-6 next0))) + (b! #t cfg-18 :delay (nop!)) + (label cfg-13) + (let ((a0-7 (-> (the-as connection a0-6) param1))) + (let ((a1-14 (-> (the-as collide-shape-moving a0-7) root-prim))) + (b! (not (logtest? (the-as collide-spec s2-0) (-> a1-14 prim-core collide-as))) cfg-17 :delay (empty-form)) + (let ((a1-15 (-> a1-14 prim-core))) + (let ((a2-11 a1-15) + (a3-2 (-> s3-0 prim-core)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 world-sphere quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-15 world-sphere w) (-> s3-0 prim-core world-sphere w))) + ) + (b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f) + ) + ) + ) + (b! (>= *actor-list-length* 256) cfg-17 :delay #f) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-7)) + ) + (set! *actor-list-length* (+ *actor-list-length* 1)) + (label cfg-17) + (set! a0-6 v1-20) + *collide-hit-by-player-list* + (set! v1-20 (-> v1-20 next0)) + ) + (label cfg-18) + (b! (!= a0-6 (-> *collide-hit-by-player-list* alive-list-end)) cfg-13 :delay (nop!)) + ) + (label cfg-20) + (let ((s1-0 0)) + (b! #t cfg-30 :delay (nop!)) + (label cfg-21) + (let ((s0-0 (-> *actor-list* s1-0))) + (let ((a2-15 (-> s0-0 root-prim))) + (b! (not (logtest? (the-as collide-spec s2-0) (-> a2-15 prim-core collide-as))) cfg-29 :delay (empty-form)) + (.lvf vf1 (&-> s3-0 prim-core world-sphere quad)) + (.lvf vf2 (&-> a2-15 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-2 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (let ((v1-28 (-> this process))) + (.mov a0-10 vf3) + (let ((a1-26 (-> s0-0 process))) + (b! (< f0-2 a0-10) cfg-28) + (b! (= v1-28 a1-26) cfg-28 :delay (nop!)) + ) + ) + ) + (let ((v1-30 (overlaps-others-test s3-0 arg0 a2-15))) + (.lvf vf1 (&-> s3-0 prim-core world-sphere quad)) + (b! (= v1-30 #f) cfg-28 :delay (set! s2-0 (the-as uint (-> arg0 filtered-root-collide-with)))) + ) + ) + (let ((a0-12 (-> (the-as (pointer uint64) arg0) 0)) + (v1-31 (-> this penetrate-using)) + ) + (b! (not (logtest? a0-12 4)) cfg-27 :delay (set! a0-14 (the-as uint (-> arg0 tlist)))) + (b! (logtest? (-> s0-0 penetrated-by) v1-31) cfg-28 :delay (nop!)) + ) + ) + (label cfg-27) + (b! (= a0-14 #f) cfg-32 :delay (set! gp-0 0)) + (label cfg-28) + 0 + (label cfg-29) + (+! s1-0 1) + (label cfg-30) + (b! (< s1-0 *actor-list-length*) cfg-21) + ) + ) + (label cfg-32) + (b! (= (the-as uint gp-0) #f) cfg-34 :delay (nop!)) + (set! gp-0 #t) + (label cfg-34) + (the-as symbol gp-0) + ) + ) + ) + +;; definition for method 12 of type collide-shape-prim +(defmethod overlaps-others-test ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") + #f + ) + +;; definition for method 12 of type collide-shape-prim-group +;; WARN: Return type mismatch object vs symbol. +(defmethod overlaps-others-test ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (a0-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as collide-shape-prim this)) + (v1-0 (-> arg1 prim-core collide-as)) + (s2-0 (the-as object #f)) + ) + (let ((a1-1 (-> arg0 collide-with-filter))) + (nop!) + (let ((s3-0 (-> this num-children)) + (v1-1 (logand v1-0 a1-1)) + ) + (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) + (nop!) + (set! (-> arg0 filtered-other-collide-as) v1-1) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (+ s4-0 80))) + (+! s3-0 -1) + (let ((a0-2 (logand (-> s4-0 prim-core collide-with) v1-1))) + (.lvf vf2 (&-> s4-0 prim-core world-sphere quad)) + (b! (zero? a0-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) + ) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + (b! (< f0-0 a0-3) cfg-1) + ) + (let ((a0-5 (overlaps-others-test s4-0 arg0 arg1))) + (set! v1-1 (-> arg0 filtered-other-collide-as)) + (b! (= a0-5 #f) cfg-1 :delay (.lvf vf1 (&-> arg1 prim-core world-sphere quad))) + ) + ) + ) + (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) + (label cfg-6) + (b! (= (the-as uint s2-0) #f) cfg-8 :delay (nop!)) + (set! s2-0 #t) + (label cfg-8) + (the-as symbol s2-0) + ) + ) + ) + +;; definition for method 13 of type collide-shape-prim +;; WARN: Return type mismatch object vs symbol. +(defmethod overlaps-others-group ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) + (local-vars (a0-4 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (the-as collide-shape-prim arg1)) + (v1-0 (-> this prim-core collide-with)) + ) + (nop!) + (let ((a0-1 (-> arg0 collide-with-filter))) + (nop!) + (let ((s3-0 (-> arg1 num-children)) + (v1-1 (logand v1-0 a0-1)) + ) + (.lvf vf2 (&-> this prim-core world-sphere quad)) + (let ((s2-0 (the-as object #f))) + (set! (-> arg0 filtered-child-collide-with) v1-1) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (set! s4-0 (+ s4-0 80))) + (+! s3-0 -1) + (let ((a0-3 (logand v1-1 (-> s4-0 prim-core collide-as)))) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (b! (zero? a0-3) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) + ) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-4 vf3) + (b! (< f0-0 a0-4) cfg-1) + ) + (let ((a0-6 (overlaps-others-test this arg0 s4-0))) + (set! v1-1 (-> arg0 filtered-child-collide-with)) + (b! (= a0-6 #f) cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) + ) + (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) + (label cfg-6) + (b! (= (the-as uint s2-0) #f) cfg-8 :delay (nop!)) + (set! s2-0 #t) + (label cfg-8) + (the-as symbol s2-0) + ) + ) + ) + ) + ) + ) + +;; definition for method 12 of type collide-shape-prim-sphere +(defmethod overlaps-others-test ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (v1-11 uint) (s4-0 uint)) + (let ((v1-0 (-> arg1 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) + (b! #t cfg-17 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-4 :delay (nop!)) + (b! #t cfg-11 :delay (logand s4-0 2)) + (label cfg-4) + (b! (nonzero? 0) cfg-11 :delay (nop!)) + (let ((s2-0 (-> (the-as collide-shape-prim-mesh arg1) mesh))) + (b! (not s2-0) cfg-10 :delay (empty-form)) + (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* (the-as collide-shape-prim-mesh arg1)))) + (when v1-5 + (when (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> this prim-core))) + (b! #t cfg-11 :delay (nop!)) + (the-as none 0) + ) + ) + ) + ) + (label cfg-10) + (set! v0-1 #f) + (b! #t cfg-17 :delay (nop!)) + (label cfg-11) + (let ((a0-8 (-> arg0 tlist))) + (b! (= a0-8 #f) cfg-13 :delay (nop!)) + (add-touching-prims a0-8 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + ) + (label cfg-13) + (b! (not (logtest? s4-0 1)) cfg-16 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) + (let ((a0-9 (-> arg1 prim-core action))) + (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-9) cfg-16 :delay (nop!)) + ) + (set! v0-1 #f) + (b! #t cfg-17 :delay (nop!)) + (label cfg-16) + (set! v0-1 #t) + (label cfg-17) + v0-1 + ) + ) + ) + +;; definition for method 12 of type collide-shape-prim-mesh +(defmethod overlaps-others-test ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (v1-3 uint) (v1-11 uint) (s4-0 uint)) + (let ((v1-0 (-> arg1 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) + (b! #t cfg-18 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-10 :delay (set! v1-3 (logand s4-0 2))) + (b! (nonzero? v1-3) cfg-12 :delay (nop!)) + (let ((s2-0 (-> this mesh))) + (b! (not s2-0) cfg-9 :delay (empty-form)) + (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* this))) + (b! (not v1-5) cfg-9 :delay (empty-form)) + (b! + (not (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> arg1 prim-core)))) + cfg-9 + :delay (empty-form) + ) + ) + ) + (b! #t cfg-12 :delay (nop!)) + (the-as none 0) + (label cfg-9) + (set! v0-1 #f) + (b! #t cfg-18 :delay (nop!)) + (label cfg-10) + (b! (nonzero? v1-3) cfg-12 :delay (nop!)) + (format + 0 + "ERROR: Unsupported mesh -> mesh test attempted in collide-shape-prim-mesh::overlaps-others-test!~%" + ) + (set! v0-1 #f) + (b! #t cfg-18 :delay (nop!)) + (label cfg-12) + (let ((a0-9 (-> arg0 tlist))) + (b! (= a0-9 #f) cfg-14 :delay (nop!)) + (add-touching-prims a0-9 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + ) + (label cfg-14) + (b! (not (logtest? s4-0 1)) cfg-17 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) + (let ((a0-10 (-> arg1 prim-core action))) + (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-10) cfg-17 :delay (nop!)) + ) + (set! v0-1 #f) + (b! #t cfg-18 :delay (nop!)) + (label cfg-17) + (set! v0-1 #t) + (label cfg-18) + v0-1 + ) + ) + ) + +;; definition for method 49 of type collide-shape +;; WARN: Return type mismatch int vs none. +(defmethod modify-collide-as! ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) + (if (logtest? (-> v1-0 prim-id) arg0) + (set! (-> v1-0 prim-core collide-as) (logior (logclear (-> v1-0 prim-core collide-as) arg1) arg2)) + ) + (&+! v1-0 80) + ) + ) + 0 + (none) + ) + +;; definition for method 50 of type collide-shape +;; INFO: Used lq/sq +(defmethod send-shoves ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (when arg1 + (let ((s0-0 (-> arg1 head))) + (set! sv-144 arg0) + (let ((gp-0 (if (type? sv-144 process-focusable) + sv-144 + ) + ) + ) + (when (and s0-0 gp-0) + (while s0-0 + (set! sv-160 (get-touched-prim s0-0 this arg1)) + (get-touched-prim s0-0 (the-as collide-shape (-> (the-as process-drawable gp-0) root)) arg1) + (when (logtest? (-> sv-160 prim-core action) (collide-action no-standon)) + (let ((v1-12 (touching-prims-entry-method-9 s0-0 (new 'stack-no-clear 'vector)))) + (set! sv-176 (new 'stack-no-clear 'vector)) + (let ((a0-7 (-> sv-160 prim-core))) + (.lvf vf4 (&-> v1-12 quad)) + (.lvf vf5 (&-> a0-7 world-sphere quad)) + ) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-176 quad) vf6) + (vector-normalize! sv-176 1.0) + (when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech)) + (< (-> (the-as process-focusable gp-0) root transv y) 4.096) + ) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad)) + (let* ((v1-26 (-> (the-as process-focusable gp-0) root transv)) + (f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z))))) + ) + (if (= f30-0 0.0) + (set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad)) + ) + (vector-xz-normalize! s2-1 (fmax f30-0 arg4)) + ) + (set! (-> s2-1 y) arg3) + (send-event + gp-0 + 'shove + arg1 + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (vector s2-1) + (angle 'jump) + ) + ) + ) + ) + (return #t) + ) + ) + (set! s0-0 (-> s0-0 next)) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 41 of type collide-shape +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs vector. +(defmethod shove-to-closest-point-on-path ((this collide-shape) (arg0 attack-info) (arg1 float)) + (set! (-> arg0 shove-up) arg1) + (let* ((s3-0 (-> this process path)) + (s2-0 (-> s3-0 curve num-cverts)) + (s4-0 (target-pos 0)) + (s1-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 -1.0)) + (dotimes (s0-0 s2-0) + (get-point-in-path! s3-0 s1-0 (the float s0-0) 'interp) + (let ((f0-3 (vector-vector-distance-squared s4-0 s1-0))) + (when (or (< f30-0 0.0) (< f0-3 f30-0)) + (set! f30-0 f0-3) + (set! (-> s5-0 quad) (-> s1-0 quad)) + ) + ) + ) + ) + (vector-! (-> arg0 vector) s5-0 s4-0) + ) + (the-as vector 0) + ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc index 7877d970ba..7dacba3ff9 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-touch-h_REF.gc @@ -36,8 +36,8 @@ Potentially also stores the triangle that is involved." (prim2 touching-prim :inline) ) (:methods - (touching-prims-entry-method-9 () none) - (touching-prims-entry-method-10 () none) + (touching-prims-entry-method-9 (_type_ vector) vector) + (get-middle-of-bsphere-overlap (_type_ vector) vector) (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim) (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result) ) @@ -68,10 +68,10 @@ Potentially also stores the triangle that is involved." ) (:methods (new (symbol type) _type_) - (touching-prims-entry-pool-method-9 () none) - (touching-prims-entry-pool-method-10 () none) + (alloc-node (_type_) touching-prims-entry) + (get-free-node-count (_type_) int) (init-list! (_type_) none) - (touching-prims-entry-pool-method-12 () none) + (free-node (_type_ touching-prims-entry) touching-prims-entry) ) ) @@ -142,7 +142,7 @@ storing a record of the primitives involved." (get-touched-shape (_type_ collide-shape) collide-shape) (prims-touching? (_type_ collide-shape uint) touching-prims-entry) (prims-touching-action? (_type_ collide-shape collide-action collide-action) basic) - (touching-shapes-entry-method-14 () none) + (free-touching-prims-list (_type_) none) ) ) @@ -172,11 +172,11 @@ storing a record of the primitives involved." ) (:methods (new (symbol type) _type_) - (touching-list-method-9 () none) + (add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none) (free-nodes (_type_) none) - (touching-list-method-11 () none) + (update-from-step-size (_type_ float) none) (send-events-for-touching-shapes (_type_) none) - (touching-list-method-13 () none) + (get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry) ) ) @@ -231,3 +231,7 @@ storing a record of the primitives involved." ;; failed to figure out what this is: (kmemclose) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc new file mode 100644 index 0000000000..fcb16c7fc4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide-touch_REF.gc @@ -0,0 +1,552 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 10 of type touching-prims-entry-pool +(defmethod get-free-node-count ((this touching-prims-entry-pool)) + (let ((v0-0 0)) + (let ((v1-0 (-> this head))) + (while v1-0 + (+! v0-0 1) + (set! v1-0 (-> v1-0 next)) + (nop!) + (nop!) + (nop!) + ) + ) + v0-0 + ) + ) + +;; definition for method 9 of type touching-prims-entry-pool +(defmethod alloc-node ((this touching-prims-entry-pool)) + (let ((gp-0 (-> this head))) + (cond + (gp-0 + (let ((v1-0 (-> gp-0 next))) + (set! (-> this head) v1-0) + (if v1-0 + (set! (-> v1-0 prev) #f) + ) + ) + (set! (-> gp-0 allocated?) #t) + (set! (-> gp-0 next) #f) + (set! (-> gp-0 prev) #f) + ) + (else + (format 0 "ERROR: touching-prims-entry-pool::alloc-node() failed!~%") + ) + ) + gp-0 + ) + ) + +;; definition for method 12 of type touching-prims-entry-pool +(defmethod free-node ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) + (when (-> arg0 allocated?) + (set! (-> arg0 allocated?) #f) + (let ((v1-1 (-> this head))) + (set! (-> arg0 next) v1-1) + (set! (-> arg0 prev) #f) + (set! (-> this head) arg0) + (when v1-1 + (set! (-> v1-1 prev) arg0) + arg0 + ) + ) + ) + ) + +;; definition for method 14 of type touching-shapes-entry +;; WARN: Return type mismatch int vs none. +(defmethod free-touching-prims-list ((this touching-shapes-entry)) + (when (-> this cshape1) + (set! (-> this cshape1) #f) + (let ((gp-0 (-> this head))) + (when gp-0 + (set! (-> this head) #f) + (let ((s5-0 *touching-prims-entry-pool*)) + (while gp-0 + (let ((a1-0 gp-0)) + (set! gp-0 (-> a1-0 next)) + (free-node s5-0 a1-0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type touching-list +;; WARN: Return type mismatch int vs none. +(defmethod free-nodes ((this touching-list)) + (let ((s5-0 (the-as object (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) + (free-touching-prims-list (the-as touching-shapes-entry s5-0)) + (set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 32)) + ) + ) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) + 0 + (none) + ) + +;; definition for method 13 of type touching-list +;; WARN: Return type mismatch object vs touching-shapes-entry. +(defmethod get-shapes-entry ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) + (let ((v0-0 (the-as object (-> this touching-shapes)))) + (let ((v1-0 (the-as touching-shapes-entry #f))) + (countdown (a3-0 (-> this num-touching-shapes)) + (let ((t0-0 (-> (the-as touching-shapes-entry v0-0) cshape1))) + (set! v1-0 (cond + (t0-0 + (if (or (and (= t0-0 arg0) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg1)) + (and (= t0-0 arg1) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg0)) + ) + (return (the-as touching-shapes-entry v0-0)) + ) + v1-0 + ) + (else + (the-as touching-shapes-entry v0-0) + ) + ) + ) + ) + (set! v0-0 (&+ (the-as touching-shapes-entry v0-0) 32)) + ) + (cond + (v1-0 + (set! v0-0 v1-0) + ) + (else + (when (>= (-> this num-touching-shapes) 32) + (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") + (return (the-as touching-shapes-entry #f)) + ) + (+! (-> this num-touching-shapes) 1) + ) + ) + ) + (set! (-> (the-as touching-shapes-entry v0-0) cshape1) arg0) + (set! (-> (the-as touching-shapes-entry v0-0) cshape2) arg1) + (set! (-> (the-as touching-shapes-entry v0-0) head) #f) + (set! (-> (the-as touching-shapes-entry v0-0) resolve-u) 1) + (set! (-> this resolve-u) 1) + (set! (-> (the-as touching-shapes-entry v0-0) handle1) (process->handle (-> arg0 process))) + (set! (-> (the-as touching-shapes-entry v0-0) handle2) (process->handle (-> arg1 process))) + (the-as touching-shapes-entry v0-0) + ) + ) + +;; definition of type add-prims-touching-work +(deftype add-prims-touching-work (structure) + ((tri1 collide-tri-result) + (tri2 collide-tri-result) + ) + ) + +;; definition for method 3 of type add-prims-touching-work +(defmethod inspect ((this add-prims-touching-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'add-prims-touching-work) + (format #t "~1Ttri1: #~%" (-> this tri1)) + (format #t "~1Ttri2: #~%" (-> this tri2)) + (label cfg-4) + this + ) + +;; definition for method 9 of type touching-list +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. +(defmethod add-touching-prims ((this touching-list) + (arg0 collide-shape-prim) + (arg1 collide-shape-prim) + (arg2 float) + (arg3 collide-tri-result) + (arg4 collide-tri-result) + ) + (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) + (set! (-> gp-0 tri1) arg3) + (set! (-> gp-0 tri2) arg4) + (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) + (when s2-0 + (when (= (-> s2-0 cshape1) (-> arg1 cshape)) + (let ((v1-4 arg0)) + (set! arg0 arg1) + (set! arg1 v1-4) + ) + ) + (let ((s0-0 (-> s2-0 head))) + (while s0-0 + (when (and (= (-> s0-0 prim1 cprim) arg0) (= (-> s0-0 prim2 cprim) arg1)) + (when (< arg2 (-> s0-0 u)) + (-> s0-0 u) + (let ((v1-12 (-> s0-0 prim1)) + (a1-2 (-> gp-0 tri1)) + ) + (cond + (a1-2 + (set! (-> v1-12 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-12 tri)) (the-as pointer a1-2) 88) + ) + (else + (set! (-> v1-12 has-tri?) #f) + ) + ) + ) + (let ((v1-15 (-> s0-0 prim2)) + (a1-3 (-> gp-0 tri2)) + ) + (cond + (a1-3 + (set! (-> v1-15 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-15 tri)) (the-as pointer a1-3) 88) + ) + (else + (set! (-> v1-15 has-tri?) #f) + ) + ) + ) + ) + (return 0) + ) + (set! s0-0 (-> s0-0 next)) + ) + ) + (let ((s0-1 (alloc-node *touching-prims-entry-pool*))) + (when s0-1 + (let ((v1-22 (-> s2-0 head))) + (set! (-> s0-1 next) v1-22) + (set! (-> s0-1 prev) #f) + (set! (-> s2-0 head) s0-1) + (if v1-22 + (set! (-> v1-22 prev) s0-1) + ) + ) + (set! (-> s0-1 u) arg2) + (when (>= arg2 0.0) + (set! (-> s2-0 resolve-u) 1) + (set! (-> this resolve-u) 1) + ) + (let ((v1-26 (-> s0-1 prim1)) + (a1-4 (-> gp-0 tri1)) + ) + (set! (-> v1-26 cprim) arg0) + (cond + (a1-4 + (set! (-> v1-26 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-26 tri)) (the-as pointer a1-4) 88) + ) + (else + (set! (-> v1-26 has-tri?) #f) + ) + ) + ) + (let ((v1-29 (-> s0-1 prim2)) + (a1-5 (-> gp-0 tri2)) + ) + (set! (-> v1-29 cprim) arg1) + (cond + (a1-5 + (set! (-> v1-29 has-tri?) #t) + (mem-copy! (the-as pointer (-> v1-29 tri)) (the-as pointer a1-5) 88) + ) + (else + (set! (-> v1-29 has-tri?) #f) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type touching-list +;; WARN: Return type mismatch int vs none. +(defmethod update-from-step-size ((this touching-list) (arg0 float)) + (when (nonzero? (-> this resolve-u)) + (set! (-> this resolve-u) 0) + (let ((s5-0 (the-as object (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) + (when (nonzero? (-> (the-as touching-shapes-entry s5-0) resolve-u)) + (set! (-> (the-as touching-shapes-entry s5-0) resolve-u) 0) + (when (-> (the-as touching-shapes-entry s5-0) cshape1) + (let ((s3-0 (-> (the-as touching-shapes-entry s5-0) head))) + (while s3-0 + (let ((f0-0 (-> s3-0 u))) + (set! s3-0 (cond + ((>= f0-0 0.0) + (cond + ((>= arg0 f0-0) + (set! (-> s3-0 u) -1.0) + (set! s3-0 (-> s3-0 next)) + ) + (else + (let ((a1-1 s3-0)) + (let ((v1-8 (-> s3-0 next))) + (let ((a0-1 (-> s3-0 prev))) + (if a0-1 + (set! (-> a0-1 next) v1-8) + (set! (-> (the-as touching-shapes-entry s5-0) head) v1-8) + ) + (if v1-8 + (set! (-> v1-8 prev) a0-1) + ) + ) + (set! s3-0 v1-8) + ) + (free-node *touching-prims-entry-pool* a1-1) + ) + ) + ) + s3-0 + ) + (else + (-> s3-0 next) + ) + ) + ) + ) + ) + ) + (if (not (-> (the-as touching-shapes-entry s5-0) head)) + (set! (-> (the-as touching-shapes-entry s5-0) cshape1) #f) + ) + ) + ) + (set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 32)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type touching-list +;; WARN: Return type mismatch int vs none. +(defmethod send-events-for-touching-shapes ((this touching-list)) + (let ((gp-0 (the-as object (-> this touching-shapes)))) + (countdown (s5-0 (-> this num-touching-shapes)) + (let ((s3-0 (-> (the-as touching-shapes-entry gp-0) cshape1))) + (when s3-0 + (let ((s4-0 (handle->process (-> (the-as touching-shapes-entry gp-0) handle1))) + (s2-0 (handle->process (-> (the-as touching-shapes-entry gp-0) handle2))) + ) + (when (and s4-0 s2-0) + (let ((s1-0 (-> (the-as touching-shapes-entry gp-0) cshape2))) + (when (< (-> s3-0 event-priority) (-> s1-0 event-priority)) + (let ((v1-9 s3-0)) + (set! s3-0 s1-0) + (set! s1-0 v1-9) + ) + (let ((v1-11 s4-0)) + (set! s4-0 s2-0) + (set! s2-0 v1-11) + ) + ) + (let ((v1-13 (-> s3-0 event-self))) + (if v1-13 + (send-event s4-0 v1-13 :from s2-0 gp-0) + ) + ) + (let ((v1-14 (-> s3-0 event-other))) + (if v1-14 + (send-event s2-0 v1-14 :from s4-0 gp-0) + ) + ) + (let ((v1-15 (-> s1-0 event-self))) + (if v1-15 + (send-event s2-0 v1-15 :from s4-0 gp-0) + ) + ) + (let ((v1-16 (-> s1-0 event-other))) + (if v1-16 + (send-event s4-0 v1-16 :from s2-0 gp-0) + ) + ) + ) + ) + ) + ) + ) + (set! gp-0 (&+ (the-as touching-shapes-entry gp-0) 32)) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type touching-shapes-entry +(defmethod prims-touching? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) + (cond + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) + (while v1-1 + (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) + (return v1-1) + ) + (set! v1-1 (-> v1-1 next)) + ) + ) + ) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) + (while v1-4 + (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) + (return v1-4) + ) + (set! v1-4 (-> v1-4 next)) + ) + ) + ) + (else + (format 0 "ERROR: touching-shapes-entry::prims-touching? : Bogus cshape value!~%") + ) + ) + (the-as touching-prims-entry #f) + ) + +;; definition for method 13 of type touching-shapes-entry +;; WARN: Return type mismatch touching-prims-entry vs basic. +(defmethod prims-touching-action? ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) + (cond + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) + (while v1-1 + (let ((a0-1 (-> v1-1 prim1 cprim))) + (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) + (return (the-as basic v1-1)) + ) + ) + (set! v1-1 (-> v1-1 next)) + ) + ) + ) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) + (while v1-4 + (let ((a0-5 (-> v1-4 prim2 cprim))) + (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) + (return (the-as basic v1-4)) + ) + ) + (set! v1-4 (-> v1-4 next)) + ) + ) + ) + (else + (format 0 "ERROR: touching-shapes-entry::prims-touching-action? : Bogus cshape value!~%") + ) + ) + (the-as basic #f) + ) + +;; definition for method 11 of type touching-shapes-entry +(defmethod get-touched-shape ((this touching-shapes-entry) (arg0 collide-shape)) + (cond + ((= (-> this cshape1) arg0) + (return (-> this cshape2)) + ) + ((= (-> this cshape2) arg0) + (return (-> this cshape1)) + ) + ) + (the-as collide-shape #f) + ) + +;; definition for method 11 of type touching-prims-entry +(defmethod get-touched-prim ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) + (cond + ((= (-> arg1 cshape1) arg0) + (return (-> this prim1 cprim)) + ) + ((= (-> arg1 cshape2) arg0) + (return (-> this prim2 cprim)) + ) + ) + (the-as collide-shape-prim #f) + ) + +;; definition for method 12 of type touching-prims-entry +(defmethod get-touched-tri ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) + (let ((v0-0 (the-as collide-tri-result #f))) + (cond + ((not this) + ) + ((= (-> arg1 cshape1) arg0) + (let ((v1-4 (-> this prim1))) + (if (-> v1-4 has-tri?) + (set! v0-0 (-> v1-4 tri)) + ) + ) + ) + ((= (-> arg1 cshape2) arg0) + (let ((v1-7 (-> this prim2))) + (if (-> v1-7 has-tri?) + (set! v0-0 (-> v1-7 tri)) + ) + ) + ) + ) + v0-0 + ) + ) + +;; definition for method 9 of type touching-prims-entry +(defmethod touching-prims-entry-method-9 ((this touching-prims-entry) (arg0 vector)) + (let* ((s4-0 (-> this prim1 cprim)) + (v1-0 (-> this prim2 cprim)) + (gp-1 (vector-! + (new 'stack-no-clear 'vector) + (the-as vector (-> v1-0 prim-core)) + (the-as vector (-> s4-0 prim-core)) + ) + ) + ) + (let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w)))) + (vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2))) + ) + (vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core))) + ) + arg0 + ) + +;; definition for method 10 of type touching-prims-entry +(defmethod get-middle-of-bsphere-overlap ((this touching-prims-entry) (arg0 vector)) + (let ((v1-0 (-> this prim1 cprim)) + (a2-0 (-> this prim2 cprim)) + ) + (vector+! arg0 (the-as vector (-> a2-0 prim-core)) (the-as vector (-> v1-0 prim-core))) + ) + (vector-float*! arg0 arg0 0.5) + arg0 + ) + +;; definition for function get-intersect-point +;; INFO: Used lq/sq +(defun get-intersect-point ((arg0 vector) (arg1 touching-prims-entry) (arg2 collide-shape) (arg3 touching-shapes-entry)) + (when arg1 + (let ((a0-2 (get-touched-tri arg1 arg2 arg3))) + (if a0-2 + (set! (-> arg0 quad) (-> a0-2 intersect quad)) + (touching-prims-entry-method-9 arg1 arg0) + ) + ) + ) + arg0 + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide_REF.gc new file mode 100644 index 0000000000..d8da36c1e9 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/collide/collide_REF.gc @@ -0,0 +1,23 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *collide-vif0-init*, type (array uint32) +(define *collide-vif0-init* (new 'static 'boxed-array :type uint32 + #x30000000 + #x4d000000 + #x4d000000 + #x4d000000 + #x3f800000 + #x5000001 + #x20000000 + #x40404040 + #x1000404 + #x0 + #x0 + #x0 + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/main-collide_REF.gc b/test/decompiler/reference/jak3/engine/collide/main-collide_REF.gc index ee50e2a3b7..70da1b35fb 100644 --- a/test/decompiler/reference/jak3/engine/collide/main-collide_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/main-collide_REF.gc @@ -191,11 +191,7 @@ (nop!) (let ((a2-0 (new-stack-vector0))) (.svf (&-> a2-0 quad) vf9) - (add-debug-sphere #t (bucket-id bucket583) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (add-debug-sphere #t (bucket-id debug) a2-0 a3-0 (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc new file mode 100644 index 0000000000..198fcde8c5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables-part_REF.gc @@ -0,0 +1,2986 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-rod-of-god + :id 123 + :flags (sp0) + :bounds (static-bspherem 0 300 0 640) + :parts ((sp-item 409 :fade-after (meters 80) :falloff-to (meters 160)) + (sp-item 410 :flags (sp6)) + (sp-item 411 :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 409 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0) + (:x (meters 0) (meters 2.7)) + (:y (meters 0) (meters 32)) + (:scale-x (meters 0.25)) + (:scale-y (meters 0.25) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.0016666667) (meters 0.0016666667)) + (:fade-a 0.4) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.267)) + (:next-launcher 412) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 412 + :init-specs ((:fade-a -0.4)) + ) + +;; failed to figure out what this is: +(defpart 410 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters -0.25)) + (:scale-x (meters 18)) + (:rot-x (degrees 135)) + (:scale-y (meters 18)) + (:r 128.0) + (:g 128.0) + (:b 0.0 64.0) + (:a 32.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 20480.0) + ) + ) + +;; failed to figure out what this is: +(defpart 411 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters -0.25)) + (:scale-x (meters 9)) + (:rot-x (degrees 135)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 20480.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-green-collect + :id 124 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 415 :flags (sp3) :binding 413) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 413 :flags (sp2 sp3) :binding 414) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 416 :fade-after (meters 40) :flags (sp2)) + (sp-item 417 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 415 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +;; failed to figure out what this is: +(defpart 418 + :init-specs ((:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:a 0.0) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 413 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 416 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 419) + ) + ) + +;; definition for function eco-fadeout +;; WARN: Return type mismatch int vs none. +(defun eco-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (if (not (logtest? (-> arg1 key proc state-flags) (state-flags sf0))) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + 0 + (none) + ) + +;; definition for function eco-track-root-prim-fadeout +;; WARN: Return type mismatch int vs none. +(defun eco-track-root-prim-fadeout ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-1 (-> arg1 key proc))) + (let ((a0-3 (-> (the-as collide-shape (-> v1-1 root)) root-prim prim-core))) + (set! (-> arg2 x) (-> a0-3 world-sphere x)) + (set! (-> arg2 y) (-> a0-3 world-sphere y)) + (set! (-> arg2 z) (-> a0-3 world-sphere z)) + ) + (if (not (logtest? (-> v1-1 state-flags) (state-flags sf0))) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-green-pill + :id 125 + :bounds (static-bspherem 0 0 0 0.4) + :parts ((sp-item 424 :flags (sp3) :binding 420) + (sp-item 420 :flags (sp2 sp3) :binding 421) + (sp-item 421 :flags (sp2 sp3) :binding 422) + (sp-item 422 :flags (sp2 sp3) :binding 423) + (sp-item 422 :flags (sp2 sp3)) + (sp-item 422 :flags (sp2 sp3)) + (sp-item 422 :flags (sp2 sp3)) + (sp-item 423 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 424 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 425) + ) + ) + +;; failed to figure out what this is: +(defpart 420 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.1)) + (:scale-x (meters 0.6) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.026666667) (meters 0.026666667)) + (:vel-y (meters 0.0014814815)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 425) + ) + ) + +;; failed to figure out what this is: +(defpart 425 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 421 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:y (meters 0) (meters 16)) + (:z (meters 0) (meters 0.2)) + (:scale-x (meters 0.6) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.4) 1 (degrees 0.8)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-track-root-prim-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 425) + ) + ) + +;; failed to figure out what this is: +(defpart 422 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.2) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 426) + ) + ) + +;; failed to figure out what this is: +(defpart 426 + :init-specs ((:fade-r 0.0) (:fade-a -0.8466667) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 423 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.25) + (:y (meters -0.05)) + (:scale-x (meters 0.15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.00039393938)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 427) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-green-pill-collect + :id 126 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 415 :flags (sp3) :binding 428) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 428 :flags (sp2 sp3) :binding 414) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + (sp-item 414 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 428 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.25) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0.04)) + (:accel-z (meters -0.0026666666)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 414 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.0004545455)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 419) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-light-pill + :id 127 + :flags (sp0 sp4 sp7) + :bounds (static-bspherem 0 0 0 4) + :scale (1.0 10.0 1.0) + :parts ((sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 431 :flags (sp3) :binding 429) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017)) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 30) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 60) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 90) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 120) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 150) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 180) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 210) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 240) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 270) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017)) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 30) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 60) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 90) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 120) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 150) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 180) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 210) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 240) + (sp-item 429 :flags (sp2) :period (seconds 1) :length (seconds 0.017) :offset 270) + (sp-item 432 :flags (sp3) :binding 430) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 430 :flags (sp2)) + (sp-item 433) + ) + ) + +;; failed to figure out what this is: +(defpart 431 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 429 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y (meters 0.4) (meters 0.2)) + (:r 128.0 128.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters -0.0014814815) (meters 0.002962963)) + (:vel-z (meters 0.0016666667) (meters 0.00066666666)) + (:rotvel-z (degrees -0.4) 1 (degrees 0.8)) + (:fade-a 0.21333334) + (:accel-z (meters -0.00006666667)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch)) + (:next-time (seconds 0.5)) + (:next-launcher 434) + ) + ) + +;; failed to figure out what this is: +(defpart 434 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 432 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 430 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 0.8) (meters 0.2)) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 0.0) + (:g 0.0 128.0) + (:b 128.0) + (:a 8.0 8.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 1 (meters 0.035555556)) + (:vel-y (meters -0.00014814814) (meters 0.0002962963)) + (:vel-z (meters 0.0016666667)) + (:rotvel-z (degrees -0.6) 1 (degrees 1.2)) + (:accel-z (meters -0.00005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpart 433 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 0.4) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 1 20.0) + (:g 0.0 64.0) + (:b 100.0) + (:a 0.0) + (:scalevel-x (meters -0.006666667) (meters 0.015)) + (:scalevel-y :copy scalevel-x) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4.096) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.167)) + (:next-launcher 435) + ) + ) + +;; failed to figure out what this is: +(defpart 435 + :init-specs ((:fade-a -2.56)) + ) + +;; failed to figure out what this is: +(defpart 1 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0) + (:x (meters 0) (meters 0.1)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters -0.0013333333) (meters -0.0013333333)) + (:scalevel-y (meters 0.0013333333) (meters 0.0013333333)) + (:fade-a -0.21333334) + (:accel-y (meters 0.00066666666)) + (:friction 0.95 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-dark-pill + :id 128 + :flags (sp7) + :bounds (static-bspherem 0 0 0 4) + :scale (1.0 10.0 1.0) + :parts ((sp-item 438 :period (seconds 0.085) :length (seconds 0.017) :binding 436) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 436 :flags (sp1 sp2 sp3)) + (sp-item 439 :period (seconds 0.085) :length (seconds 0.017) :binding 437) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 437 :flags (sp1 sp2 sp3)) + (sp-item 440 :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 440 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 17)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 438 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 436 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 1.4) (meters 0.2)) + (:scale-y (meters 1.4) (meters 0.2)) + (:r 0.0 255.0) + (:g 0.0) + (:b 255.0) + (:a 6.0 6.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters -0.00037037037) (meters 0.00074074074)) + (:vel-z (meters 0.0016666667)) + (:rotvel-z (degrees -1.2) 1 (degrees 2.4)) + (:accel-z (meters -0.000041666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpart 439 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 437 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y (meters 0.4) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters -0.00037037037) (meters 0.00074074074)) + (:vel-z (meters 0.0016666667)) + (:rotvel-z (degrees -0.6) 1 (degrees 1.2)) + (:accel-z (meters -0.000041666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-green + :id 129 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 444 :flags (sp3) :binding 441) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 441 :flags (sp2 sp3) :binding 442) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 442 :fade-after (meters 90) :flags (sp2 sp3) :binding 443) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + (sp-item 443 :fade-after (meters 40) :falloff-to (meters 60) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 444 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:a 1.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 441 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.25)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 445) + ) + ) + +;; failed to figure out what this is: +(defpart 445 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 442 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 255.0) + (:a 64.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.053333335) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 446) + ) + ) + +;; failed to figure out what this is: +(defpart 446 + :init-specs ((:fade-a -0.42666668) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 443 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.25) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 48.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 427) + ) + ) + +;; failed to figure out what this is: +(defpart 427 + :init-specs ((:fade-r 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-dark-pill-move-collect + :id 130 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 449 :flags (sp3) :binding 447) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 447 :flags (sp2 sp3) :binding 448) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + (sp-item 448 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 449 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:b 128.0 128.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 450) + ) + ) + +;; failed to figure out what this is: +(defpart 450 + :init-specs ((:scale-x (meters 0.1)) (:scale-y :copy scale-x) (:a 0.0) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 451 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:b 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 447 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.25) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:b 255.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0.04)) + (:accel-z (meters -0.0026666666)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 452 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters -0.00075757573)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 453) + ) + ) + +;; failed to figure out what this is: +(defpart 448 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters -0.05)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters -0.0004545455)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000100000005)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 453) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-generic-collect + :id 131 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 454)) + ) + +;; failed to figure out what this is: +(defpart 455 + :init-specs ((:fade-a -0.15238096)) + ) + +;; failed to figure out what this is: +(defpart 454 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 456 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 457 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-skill-glow-red + :id 132 + :flags (sp1) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 459 :fade-after (meters 150) :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 459 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 90.0) + (:b 64.0) + (:a 16.0) + (:omega (degrees 13511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2867.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-skill-glow-yellow + :id 133 + :flags (sp1) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 460 :fade-after (meters 150) :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 460 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:omega (degrees 13511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2867.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gem-glow + :id 134 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 461 :flags (sp6 sp7)) (sp-item 462 :flags (sp6 sp7)) (sp-item 463 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 461 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.2)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2867.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 462 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters 0.3)) + (:scale-x (meters 1.75)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 12.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 463 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters -0.3)) + (:scale-x (meters 1.75)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 12.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 464 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gem-collect + :id 135 + :duration (seconds 0.1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 465 :period (seconds 0.5) :length (seconds 0.017)) + (sp-item 466 :period (seconds 0.5) :length (seconds 0.067)) + ) + ) + +;; failed to figure out what this is: +(defpart 466 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 3.0 1.0) + (:scale-x (meters 16) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 16.0) + (:scalevel-x (meters -0.4)) + (:scalevel-y (meters 0.00125)) + (:fade-a 0.2 0.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 465 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.23333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.33333334) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 467) + ) + ) + +;; failed to figure out what this is: +(defpart 467 + :init-specs ((:a 16.0) (:fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpart 468 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ammo-yellow-collect + :id 136 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ammo-red-collect + :id 137 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ammo-blue-collect + :id 138 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-ammo-dark-collect + :id 139 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-dark-pill-collect + :id 140 + :duration (seconds 0.1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 469 :period (seconds 0.5) :length (seconds 0.017)) + (sp-item 470 :period (seconds 0.5) :length (seconds 0.067)) + ) + ) + +;; failed to figure out what this is: +(defpart 470 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 3.0 1.0) + (:scale-x (meters 24) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 128.0 128.0) + (:g 0.0) + (:b 255.0) + (:a 16.0) + (:scalevel-x (meters -0.6)) + (:scalevel-y (meters 0.00125)) + (:fade-a 0.2 0.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 469 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.33333334) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 471) + ) + ) + +;; failed to figure out what this is: +(defpart 471 + :init-specs ((:a 16.0) (:fade-a -0.8)) + ) + +;; failed to figure out what this is: +(defpartgroup group-green-collect + :id 141 + :duration (seconds 1) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 474 :period (seconds 1.5) :length (seconds 0.017) :offset 100) + (sp-item 475 :period (seconds 1.5) :length (seconds 0.067) :offset 125) + (sp-item 476 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 1.5) :length (seconds 0.067) :binding 472) + (sp-item 472 :fade-after (meters 80) :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 472 :flags (sp2 sp3) :binding 473) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + (sp-item 473 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 476 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 6.0) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 472 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 8)) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 28.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.008888889) (meters 0.017777778)) + (:vel-z (meters -0.053333335)) + (:fade-r -0.8) + (:fade-a 0.8) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:next-time (seconds 1.5) (seconds 0.497)) + (:next-launcher 477) + ) + ) + +;; failed to figure out what this is: +(defpart 477 + :init-specs ((:fade-r 0.0) (:fade-a -0.8466667 -0.8466667) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 473 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters -0.0006060606)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.8333333) + (:accel-y (meters -0.000033333334) (meters -0.00006666667)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 427) + ) + ) + +;; failed to figure out what this is: +(defpart 475 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 3.0 1.0) + (:scale-x (meters 24) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 0.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 16.0) + (:scalevel-x (meters -0.6)) + (:scalevel-y (meters 0.00125)) + (:fade-a 0.2 0.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 474 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.21176471)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.5058824) + (:fade-a 0.28235295) + (:timer (seconds 0.35)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + (:next-time (seconds 0.285)) + (:next-launcher 478) + ) + ) + +;; failed to figure out what this is: +(defpart 478 + :init-specs ((:a 16.0) (:fade-r -12.8) (:fade-a -1.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-skate-point + :id 142 + :linger-duration (seconds 1) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 479 :fade-after (meters 90) :falloff-to (meters 90) :flags (is-3d)) + (sp-item 480 :flags (is-3d)) + (sp-item 481 :flags (sp6)) + (sp-item 482 :flags (is-3d sp6)) + (sp-item 483 :fade-after (meters 120) :falloff-to (meters 120)) + ) + ) + +;; failed to figure out what this is: +(defpart 483 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.1) (meters 0.15)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 32.0) + (:b 0.0 16.0) + (:a 96.0 32.0) + (:omega (degrees 0.19125001)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.7066667) + (:friction 0.97) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 479 + :init-specs ((:texture (new 'static 'texture-id :page #x17e)) + (:num 0.05) + (:scale-x (meters 0.5)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 64.0) + (:b 16.0) + (:a 64.0) + (:scalevel-x (meters 0.0055555557)) + (:rotvel-x (degrees 0.8)) + (:rotvel-y (degrees 0.8)) + (:rotvel-z (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 482 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-camera-orient) + (:num 1.0) + (:scale-x (meters 1.5) (meters 2.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 480 + :init-specs ((:texture (new 'static 'texture-id :page #x17e)) + (:birth-func 'birth-func-camera-orient) + (:num 1.0) + (:scale-x (meters 2.9) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 16.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 481 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.2)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 16.0) + (:a 32.0 8.0) + (:omega (degrees 22509)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-skate-point-explode + :id 143 + :duration (seconds 0.017) + :linger-duration (seconds 1) + :bounds (static-bspherem 0 0 0 32) + :parts ((sp-item 484 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 484 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 16.0) + (:a 128.0) + (:omega (degrees 22509)) + (:scalevel-x (meters -0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.6) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-light-active + :id 144 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 485 :flags (is-3d)) + (sp-item 486 :flags (is-3d)) + (sp-item 487 :flags (is-3d)) + (sp-item 488 :flags (is-3d)) + (sp-item 489) + (sp-item 490) + ) + ) + +;; failed to figure out what this is: +(defpart 485 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -11)) + (:scale-x (meters 40)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.5)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:fade-a 0.64 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 491 + :init-specs ((:fade-a -0.64 -0.64)) + ) + +;; failed to figure out what this is: +(defpart 486 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -11)) + (:scale-x (meters 40)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.2)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 487 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -11)) + (:scale-x (meters 40)) + (:rot-z (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 488 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters -2)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 10)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.25) (meters 0.5)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b000 #x40b100)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 1)) + (:next-launcher 492) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 492 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 489 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 0.0 1 128.0) + (:g 0.0 1 128.0) + (:b 0.0 1 128.0) + (:a 0.0) + (:vel-y (meters 0.00083333335) (meters 0.0016666667)) + (:fade-a 0.85333335) + (:timer (seconds 1) (seconds 1.665)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.5)) + (:next-launcher 493) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 493 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 490 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 0.5) + (:y (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y (meters 0.006666667) (meters 0.016666668)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:next-time (seconds 1)) + (:next-launcher 494) + ) + ) + +;; failed to figure out what this is: +(defpart 494 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-light-touched + :id 145 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 495 :flags (is-3d)) + (sp-item 496 :flags (is-3d)) + (sp-item 497 :flags (is-3d)) + (sp-item 498 :flags (is-3d)) + (sp-item 499 :flags (is-3d)) + (sp-item 500) + (sp-item 501) + ) + ) + +;; failed to figure out what this is: +(defpart 495 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.64 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 502) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 502 + :init-specs ((:fade-a -0.64 -0.64)) + ) + +;; failed to figure out what this is: +(defpart 496 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2.2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 491) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 497 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 502) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 498 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:scalevel-y (meters 0.016666668)) + (:fade-a 0.32 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 502) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 499 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.15 0.15) + (:x (meters -0.5) (meters 1)) + (:y (meters -1)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.1) (meters 0.3)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.06666667)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b000 #x40b100)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 1)) + (:next-launcher 503) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 503 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 500 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 2.0 2.0) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 10)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 0.0 1 128.0) + (:g 0.0 1 128.0) + (:b 0.0 1 128.0) + (:a 0.0) + (:vel-y (meters -0.006666667) (meters 0.0033333334)) + (:fade-a 2.56) + (:friction 1.1) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 504) + (:conerot-x (degrees -170) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 504 + :init-specs ((:fade-a -2.56)) + ) + +;; failed to figure out what this is: +(defpart 501 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.016666668) (meters 0.013333334)) + (:scalevel-y (meters 0.06666667) (meters 0.033333335)) + (:fade-a 0.16 0.16) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x408600 #x400700)) + (:next-time (seconds 0.335)) + (:next-launcher 505) + ) + ) + +;; failed to figure out what this is: +(defpart 505 + :init-specs ((:fade-a -0.32)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-dark-active + :id 146 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 10) + :parts ((sp-item 506 :flags (is-3d sp3)) + (sp-item 507 :flags (is-3d sp3)) + (sp-item 508 :flags (is-3d sp3)) + (sp-item 509) + (sp-item 510) + ) + ) + +;; definition for function sparticle-3d-rotate-xz-to-camera-eco-shaft +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sparticle-3d-rotate-xz-to-camera-eco-shaft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-4 float) (v1-5 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (-> arg1 key proc) + (let ((a0-1 (math-camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) *up-vector* s5-0)) + (s5-1 (new 'stack-no-clear 'quaternion)) + ) + (matrix->quaternion s5-1 a1-3) + (quaternion-rotate-local-z! s5-1 s5-1 -16384.0) + (quaternion-rotate-y! s5-1 s5-1 -16384.0) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-4 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function spt-func-part-vent-eco-dark-shaft +(defun spt-func-part-vent-eco-dark-shaft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-3d-rotate-xz-to-camera-eco-shaft arg0 arg1 (the-as sprite-vec-data-3d arg2)) + (sparticle-texture-animate arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 506 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 2.2)) + (:scale-y (meters 10)) + (:r 20.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 507 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 2)) + (:scale-y (meters 12)) + (:r 60.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 25 + 1 + 0 + #x403800 + #x403700 + #x403600 + #x403500 + #x403400 + #x403300 + #x403200 + #x403100 + #x403000 + #x402f00 + #x402e00 + #x402d00 + #x402c00 + #x402b00 + #x402a00 + #x402900 + #x402800 + #x402700 + #x402600 + #x402500 + #x402400 + #x402300 + #x402200 + #x402100 + #x402000 + #x401f00 + #x401e00 + #x401d00 + #x401c00 + #x401b00 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 508 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 1.8)) + (:scale-y (meters 14)) + (:r 100.0) + (:g 0.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 30 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 511 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters -2)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 20)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.25) (meters 0.5)) + (:r 40.0 40.0) + (:g 0.0) + (:b 128.0 128.0) + (:a 0.0) + (:scalevel-x (meters -0.01) (meters -0.006666667)) + (:fade-a 0.10666667 0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b000 #x40b100)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 1)) + (:next-launcher 512) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 512 + :init-specs ((:fade-a -0.21333334 -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 509 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 1.0 1.0) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0) (meters 15)) + (:z (meters -0.2) (meters 0.4)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y (meters 1) (meters 1)) + (:r 255.0) + (:g 0.0 128.0) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y (meters 0.0033333334)) + (:fade-g 0.053333335 0.053333335 :store) + (:fade-b '*sp-temp*) + (:fade-a 0.053333335 0.053333335) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 510 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:y (meters 3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0 64.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.026666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.10666667 0.21333334) + (:fade-g -0.053333335 -0.053333335) + (:fade-b 0.10666667 0.10666667) + (:fade-a 0.21333334 0.21333334) + (:accel-x (meters -0.00033333333) (meters 0.00066666666)) + (:accel-z (meters -0.00033333333) (meters 0.00066666666)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 513) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 513 + :init-specs ((:fade-a -0.42666668 -0.42666668)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-dark-touched + :id 147 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 514 :flags (is-3d) :period (seconds 2) :length (seconds 0.017)) + (sp-item 515 :flags (is-3d) :period (seconds 2) :length (seconds 0.017)) + (sp-item 516 :flags (is-3d) :period (seconds 2) :length (seconds 0.017)) + (sp-item 517 :flags (is-3d)) + (sp-item 518) + (sp-item 519) + (sp-item 520) + ) + ) + +;; failed to figure out what this is: +(defpart 514 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 2)) + (:scale-y (meters 10)) + (:r 20.0) + (:g 0.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 515 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 1.5)) + (:scale-y (meters 12)) + (:r 60.0) + (:g 0.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 15 + 1 + 0 + #x403800 + #x403700 + #x403600 + #x403500 + #x403400 + #x403300 + #x403200 + #x403100 + #x403000 + #x402f00 + #x402e00 + #x402d00 + #x402c00 + #x402b00 + #x402a00 + #x402900 + #x402800 + #x402700 + #x402600 + #x402500 + #x402400 + #x402300 + #x402200 + #x402100 + #x402000 + #x401f00 + #x401e00 + #x401d00 + #x401c00 + #x401b00 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 516 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:num 1.0) + (:y (meters 4)) + (:scale-x (meters 1)) + (:scale-y (meters 14)) + (:r 100.0) + (:g 0.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 20 + 1 + 0 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + ) + ) + (:func 'spt-func-part-vent-eco-dark-shaft) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 517 + :init-specs ((:texture (light-burst level-default-sprite)) + (:num 0.1 0.1) + (:y (meters -15)) + (:scale-x (meters 60)) + (:rot-z (degrees 90)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-y (meters -0.053333335)) + (:fade-a 0.64 0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-3d-rotate-xz-to-camera) + (:next-time (seconds 0.167)) + (:next-launcher 521) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 522 + :init-specs ((:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 518 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 2.0 2.0) + (:x (meters 8)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0.1125)) + (:fade-a 0.42666668) + (:accel-x (meters -0.0016666667)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'spt-func-part-vent-eco-dark-touched-specs) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; definition for function spt-func-part-vent-eco-dark-touched-specs +(defun spt-func-part-vent-eco-dark-touched-specs ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (check-drop-group-center arg0 arg1 (the-as sparticle-launchinfo arg2)) + (sparticle-motion-blur arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 519 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 3.0 3.0) + (:x (meters -0.2) (meters 0.4)) + (:y (meters 0) (meters 15)) + (:z (meters -0.2) (meters 0.4)) + (:scale-x (meters 0.3) (meters 1)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y (meters 1) (meters 1)) + (:r 255.0) + (:g 0.0 128.0) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y (meters 0.0033333334)) + (:fade-g 0.053333335 0.053333335 :store) + (:fade-b '*sp-temp*) + (:fade-a 0.10666667 0.10666667) + (:accel-y (meters -0.00066666666) (meters -0.00033333333)) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 520 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:y (meters 3)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.026666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.42666668 -0.42666668) + (:fade-g -0.85 -0.85) + (:fade-a 0.21333334 0.21333334) + (:accel-x (meters -0.001) (meters 0.00066666666)) + (:accel-y (meters -0.00016666666)) + (:accel-z (meters -0.001) (meters 0.00066666666)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 523) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 523 + :init-specs ((:fade-a -0.42666668 -0.42666668)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-green-active + :id 148 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 10) + :parts ((sp-item 526 :fade-after (meters 100) :period (seconds 0.167) :length (seconds 0.017) :binding 524) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 524 :fade-after (meters 100) :flags (sp2 sp3) :binding 525) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 525 :fade-after (meters 100) :flags (sp2)) + (sp-item 527 :fade-after (meters 100) :flags (is-3d sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 527 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0) + (:y (meters 1) (meters 0.2)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 92.0 32.0) + (:b 0.0) + (:a 255.0) + (:vel-y (meters 0.008333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-y (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.56666666 -0.56666666) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 528 + :init-specs ((:vel-y (meters -0.0033333334)) + (:scalevel-x (meters 0.016666668) (meters 0.006666667)) + (:rotvel-y (degrees 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.085)) + (:next-launcher 529) + ) + ) + +;; failed to figure out what this is: +(defpart 529 + :init-specs ((:vel-y (meters -0.0016666667)) + (:scalevel-x (meters 0.013333334) (meters 0.0033333334)) + (:rotvel-y (degrees 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.256 -0.256) + (:accel-y (meters 0.0019333332)) + (:next-time (seconds 0.085)) + (:next-launcher 530) + ) + ) + +;; failed to figure out what this is: +(defpart 530 + :init-specs ((:vel-y (meters 0)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-y (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0.0016666667)) + (:friction 0.9) + ) + ) + +;; failed to figure out what this is: +(defpart 531 + :init-specs ((:texture (wave-foam foresta-sprite)) + (:num 0.3) + (:y (meters 1)) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y (meters 0.2) (meters 0.2)) + (:r 8.0) + (:g 64.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.016666668)) + (:fade-a 0.85333335) + (:accel-y (meters 0.00033333333)) + (:friction 0.98) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'spt-func-turn-to-vel-radial) + (:next-time (seconds 0.5)) + (:next-launcher 532) + (:conerot-x (degrees -90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 532 + :init-specs ((:scalevel-y (meters 0.006666667)) + (:fade-a -0.17066666 -0.17066666) + (:accel-y (meters 0.00026666667) (meters 0.00006666667)) + (:friction 0.95) + ) + ) + +;; failed to figure out what this is: +(defpart 526 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 1.5) (meters 0.5)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 524 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 255.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0) (degrees 3600)) + (:vel-x (meters 0.059259262) (meters 0.0074074077)) + (:vel-y (meters 0)) + (:vel-z (meters 0.0016666667)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 533 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 525 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 64.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-placeholder-small + :id 149 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpart 534 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-placeholder-single + :id 150 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 535 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 535 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-placeholder-multiple + :id 151 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 536 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 536 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.01)) + (:timer (seconds 2)) + (:flags ()) + (:conerot-x (degrees -45) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc index 89af356e5f..605abf25d9 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/collectables_REF.gc @@ -973,10 +973,7 @@ ) :trans (behavior () (vector-v++! (-> self root transv) (compute-acc-due-to-gravity (-> self root) (new-stack-vector0) 0.0)) - (let ((t9-2 (method-of-object (-> self root) collide-shape-moving-method-57))) - (-> self root transv) - (t9-2) - ) + (integrate-no-collide! (-> self root) (-> self root transv)) (when (and (>= 0.0 (-> self root transv y)) (>= (-> self base y) (-> self root trans y))) (set! (-> self root trans y) (-> self base y)) (cond @@ -1125,7 +1122,7 @@ ) (else (if (nonzero? (-> self part)) - (set! (-> self part fade) (* 0.0033333334 f0-1)) + (set! (-> self part local-space-binding) (the-as particle-local-space-info (* 0.0033333334 f0-1))) ) (when (nonzero? (-> self draw)) (logior! (-> self draw status) (draw-control-status force-fade)) @@ -1882,7 +1879,7 @@ (a1-3 (-> this draw skeleton bones 3)) ) (if (nonzero? a0-7) - (sparticle-launch-control-method-17 a0-7 (the-as matrix a1-3)) + (spawn-from-mat a0-7 (the-as matrix a1-3)) ) ) 0 @@ -2018,10 +2015,7 @@ ) ) (else - (let ((t9-7 (method-of-object (-> self root) collide-shape-moving-method-57))) - (-> self root transv) - (t9-7) - ) + (integrate-no-collide! (-> self root) (-> self root transv)) ) ) ) @@ -3152,7 +3146,7 @@ (you-suck-stage *game-info* #f 0) (cond ((or (< 20 (-> *game-info* live-eco-pill-count)) - (not (logtest? (game-feature feature58) (-> *game-info* features))) + (not (logtest? (game-feature darkeco) (-> *game-info* features))) ) (return (the-as pickup-type #f)) ) @@ -3176,7 +3170,7 @@ ;; WARN: Return type mismatch number vs pickup-type. (defun pickup-light-set! ((arg0 fact-info) (arg1 (pointer pickup-type)) (arg2 (pointer float)) (arg3 int)) (the-as pickup-type (cond - ((logtest? (game-feature feature57) (-> *game-info* features)) + ((logtest? (game-feature lighteco) (-> *game-info* features)) (set! (-> arg1 0) (pickup-type eco-pill-light)) (set! (-> arg2 0) 20.0) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc index cb507aa9d1..0de4d01c69 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/enemy-states_REF.gc @@ -904,17 +904,9 @@ (set! (-> s5-1 quad) (-> gp-1 gspot-pos quad)) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> gp-1 gspot-normal quad)) - (let* ((a0-10 gp-1) - (t9-5 (method-of-object a0-10 find-ground)) - (a2-2 (-> self enemy-info gnd-collide-with)) - (a3-1 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (not (t9-5 a0-10 a1-5 a2-2 a3-1 t0-0 t1-0)) - (set! (-> gp-1 gspot-pos quad) (-> s5-1 quad)) - (set! (-> gp-1 gspot-normal quad) (-> s4-1 quad)) - ) + (when (not (find-ground gp-1 a1-5 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))) + (set! (-> gp-1 gspot-pos quad) (-> s5-1 quad)) + (set! (-> gp-1 gspot-normal quad) (-> s4-1 quad)) ) ) ) @@ -1049,18 +1041,18 @@ (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) ) - (let* ((v1-0 s5-0) - (t9-0 (method-of-object v1-0 find-ground)) - (a2-1 (-> this enemy-info recover-gnd-collide-with)) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (t9-0 v1-0 a1-0 a2-1 a3-0 t0-0 t1-0) - (if (< (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)) 8192.0) - (set! gp-0 #f) + (when (find-ground + s5-0 + a1-0 + (-> this enemy-info recover-gnd-collide-with) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) ) - ) + (if (< (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)) 8192.0) + (set! gp-0 #f) + ) ) gp-0 ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc index 5c680d61f5..e289ea7283 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/generic-obs_REF.gc @@ -1607,17 +1607,14 @@ (nonzero? (-> (the-as process-drawable v1-15) root)) (nonzero? (-> (the-as process-drawable v1-15) node-list)) ) - (sparticle-launch-control-method-18 - (-> self part) - (-> (the-as process-drawable v1-15) node-list data (-> self target-joint)) - ) + (spawn-from-cspace (-> self part) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint))) (set! (-> self root trans quad) (-> self part origin trans quad)) ) (else (let ((a0-11 (-> self root trans))) (set! (-> self mat trans quad) (-> a0-11 quad)) ) - (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + (spawn-from-mat (-> self part) (-> self mat)) ) ) ) @@ -1691,7 +1688,7 @@ (nonzero? (-> (the-as process-drawable v1-15) root)) (nonzero? (-> (the-as process-drawable v1-15) node-list)) ) - (sparticle-subsampler-method-10 + (init-with-mat! (-> self subsampler) (-> (the-as process-drawable v1-15) node-list data (-> self target-joint) bone transform) ) @@ -1701,7 +1698,7 @@ (let ((a0-11 (-> self root trans))) (set! (-> self mat trans quad) (-> a0-11 quad)) ) - (sparticle-subsampler-method-10 (-> self subsampler) (-> self mat)) + (init-with-mat! (-> self subsampler) (-> self mat)) ) ) ) @@ -1843,7 +1840,7 @@ (set! (-> self part) (create-launch-control (-> arg0 group) self)) (when (and (-> arg0 target) (logtest? (-> self part group flags) (sp-group-flag sp12 sp14))) (let* ((gp-0 (-> self part)) - (s5-0 (method-of-object gp-0 sparticle-launch-control-method-20)) + (s5-0 (method-of-object gp-0 set-local-space-info)) (s4-0 (add-connection *part-local-space-engine* self local-space-proc-joint (-> self target-joint) 0 0)) ) (let ((v1-10 (process->handle (-> arg0 target)))) @@ -1860,7 +1857,7 @@ (part-local-space-flags) ) ) - (s5-0 gp-0 (the-as float s4-0)) + (s5-0 gp-0 (the-as particle-local-space-info s4-0)) ) ) (set! (-> self event-hook) (-> (method-of-object self active) event)) @@ -2509,9 +2506,10 @@ ;; definition for method 11 of type part-spawner ;; INFO: Used lq/sq +;; INFO: Process stack size was changed from 16 to 64 (defmethod init-from-entity! ((this part-spawner) (arg0 entity-actor)) (local-vars (sv-16 string)) - (stack-size-set! (-> this main-thread) 16) + (stack-size-set! (-> this main-thread) 64) (logior! (-> this mask) (process-mask ambient)) (+! (-> this clock ref-count) -1) (+! (-> *display* part-clock ref-count) 1) @@ -3738,7 +3736,7 @@ ) 0 (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) - (sparticle-launch-control-method-17 (-> self part) (-> self mat)) + (spawn-from-mat (-> self part) (-> self mat)) (suspend) ) (set-time! (-> self start-time)) diff --git a/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc index 9298619a88..91a8fe92b5 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/plat_REF.gc @@ -56,7 +56,7 @@ (set! (-> s5-0 total-prims) (the-as uint 1)) (set! (-> s5-0 root-prim) s4-0) ) - ((method-of-object s5-0 collide-shape-method-54)) + (pusher-init s5-0) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (let ((v1-11 (-> s5-0 root-prim))) (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) @@ -357,7 +357,3 @@ ) :post rider-post ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/prim-beam-h_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/prim-beam-h_REF.gc index 0d63e08572..aabee20641 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/prim-beam-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/prim-beam-h_REF.gc @@ -4,7 +4,7 @@ ;; definition of type prim-beam-settings (deftype prim-beam-settings (structure) ((width float) - (color uint32) + (color rgba) (alpha float) (tex-id uint32) (num-tiles float) @@ -78,7 +78,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc index dec404f461..c203a0cc58 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/projectile_REF.gc @@ -582,20 +582,20 @@ (projectile-bounce-update-velocity self) (set! (-> s5-0 quad) (-> gp-0 trans quad)) (vector-v++! s5-0 (-> gp-0 transv)) - (let* ((a0-4 gp-0) - (t9-2 (method-of-object a0-4 find-ground)) - (a2-0 #x100249) - (a3-0 4096.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (when (t9-2 a0-4 s4-0 (the-as collide-spec a2-0) a3-0 t0-0 t1-0) - (let ((f30-0 (+ (-> gp-0 gspot-pos y) (-> self root root-prim local-sphere w)))) - (when (>= f30-0 (-> s5-0 y)) - (projectile-bounce-method-43 self) - (set! (-> s5-0 y) f30-0) - (vector-reset! (-> gp-0 transv)) + (when (find-ground + gp-0 + s4-0 + (collide-spec backgnd crate obstacle hit-by-others-list pusher) + 4096.0 + 81920.0 + 1024.0 + (the-as process #f) ) + (let ((f30-0 (+ (-> gp-0 gspot-pos y) (-> self root root-prim local-sphere w)))) + (when (>= f30-0 (-> s5-0 y)) + (projectile-bounce-method-43 self) + (set! (-> s5-0 y) f30-0) + (vector-reset! (-> gp-0 transv)) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc index 53668e36bf..6ea239a0a6 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/vent_REF.gc @@ -394,7 +394,7 @@ ) ) :trans (behavior () - (if (not (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (if (not (logtest? (the-as game-feature (logand (game-feature lighteco) (-> *setting-control* user-current features))) (-> *game-info* features) ) ) @@ -444,7 +444,7 @@ (defstate close (light-eco-vent) :virtual #t :trans (behavior () - (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (if (logtest? (the-as game-feature (logand (game-feature lighteco) (-> *setting-control* user-current features))) (-> *game-info* features) ) (go-virtual open #f) @@ -518,7 +518,7 @@ (set! (-> this sound) (new 'process 'ambient-sound "eco-bg-light" (-> this root trans) 0.0)) (set-falloff-far! (-> this sound) 81920.0) (set-falloff-mode! (-> this sound) 9) - (if (logtest? (the-as game-feature (logand (game-feature feature57) (-> *setting-control* user-current features))) + (if (logtest? (the-as game-feature (logand (game-feature lighteco) (-> *setting-control* user-current features))) (-> *game-info* features) ) (go (method-of-object this open) #t) @@ -618,7 +618,7 @@ ) ) :trans (behavior () - (if (not (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (if (not (logtest? (the-as game-feature (logand (game-feature darkeco) (-> *setting-control* user-current features))) (-> *game-info* features) ) ) @@ -668,7 +668,7 @@ (defstate close (dark-eco-vent) :virtual #t :trans (behavior () - (if (logtest? (the-as game-feature (logand (game-feature feature58) (-> *setting-control* user-current features))) + (if (logtest? (the-as game-feature (logand (game-feature darkeco) (-> *setting-control* user-current features))) (-> *game-info* features) ) (go-virtual open #f) diff --git a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc index 6984a4105c..5d76a2af41 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/voicebox_REF.gc @@ -173,7 +173,7 @@ ) (vector-float*! v1-16 a0-9 (/ 1.0 f0-2)) ) - (sparticle-launch-control-method-18 (-> this part) (-> this node-list data 3)) + (spawn-from-cspace (-> this part) (-> this node-list data 3)) ) 0 (none) diff --git a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc index 553b0407af..a21efa37f5 100644 --- a/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc +++ b/test/decompiler/reference/jak3/engine/common-obs/warp-gate_REF.gc @@ -1268,8 +1268,8 @@ (* 450.56 (cos (* 42.25403 (the float (mod (current-time) 1551))))) ) ) - (sparticle-launch-control-method-18 (-> self part-exhaust-left) (joint-node air-train-lod0-jg thruster_l)) - (sparticle-launch-control-method-18 (-> self part-exhaust-right) (joint-node air-train-lod0-jg thruster_r)) + (spawn-from-cspace (-> self part-exhaust-left) (joint-node air-train-lod0-jg thruster_l)) + (spawn-from-cspace (-> self part-exhaust-right) (joint-node air-train-lod0-jg thruster_r)) (let ((f0-9 (-> self dust-y))) (when (!= f0-9 (the-as float #x7f800000)) (let ((a1-2 (new 'stack-no-clear 'vector))) @@ -2029,7 +2029,3 @@ (:rotate-y (degrees 0)) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/common-obs/water-part_REF.gc b/test/decompiler/reference/jak3/engine/common-obs/water-part_REF.gc new file mode 100644 index 0000000000..fa71deb848 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/common-obs/water-part_REF.gc @@ -0,0 +1,800 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 756 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.1) + (:x (meters -0.25) (meters 0.5)) + (:y (meters -0.05) (meters 0.1)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters 0) (meters 0.006666667)) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'check-water-level-above-and-die) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 757 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.1) + (:x (meters -0.25) (meters 0.5)) + (:y (meters 0.15)) + (:z (meters -0.25) (meters 0.5)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters 0) (meters 0.006666667)) + (:accel-y (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'check-water-level-above-and-die) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 758 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.05) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:scalevel-x (meters 0.005) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.04 -0.04) + (:timer (seconds 2.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 759 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.06) + (:x (meters 10)) + (:scale-x (meters 0.75) (meters 1.5)) + (:rot-y (degrees 0)) + (:scale-y (meters 0.75) (meters 1.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:vel-x (meters 0.01) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004333333)) + (:scalevel-y (meters 0.0033333334) (meters 0.004333333)) + (:fade-a 0.000111111105) + (:friction 0.94) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.3)) + (:next-launcher 760) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 760 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.3) (seconds 0.397)) (:next-launcher 761)) + ) + +;; failed to figure out what this is: +(defpart 761 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 762 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.05 0.4) + (:x (meters -0.75) (meters 1.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 0.2) (meters 0.7)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.0016666667) (meters 0.003)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 763) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 763 + :init-specs ((:fade-a 0.0) (:next-time (seconds 1.2)) (:next-launcher 764)) + ) + +;; failed to figure out what this is: +(defpart 764 + :init-specs ((:fade-a -0.7111111)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-water-splash + :id 192 + :duration (seconds 5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 765 :flags (sp7) :period (seconds 10) :length (seconds 0.2)) + (sp-item 766 :flags (sp7) :period (seconds 10) :length (seconds 0.067) :offset 125) + (sp-item 767 :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.067)) + (sp-item 768 :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.167) :offset 125) + (sp-item 769 :flags (is-3d sp7) :period (seconds 10) :length (seconds 0.5) :offset 150) + (sp-item 770 :flags (sp7) :period (seconds 10) :length (seconds 0.167) :offset 20) + (sp-item 771 :flags (sp7) :period (seconds 10) :length (seconds 0.167) :offset 125) + ) + ) + +;; failed to figure out what this is: +(defpart 765 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.016666668)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wsplash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 158.0 :z 128.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 1.0 :z 2.0 :w 3.0) + :one-over-x-deltas (new 'static 'vector :x 0.5 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wsplash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wsplash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wsplash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 2.0 :z 0.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y -5.0000005 :z -1.6666666 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-water-splash-curve-settings*, type particle-curve-settings +(define *part-water-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.95) :lifetime-offset (seconds 0.1)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 765 init-specs 13 initial-valuef) (the-as float *part-water-splash-curve-settings*)) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* color-start) *range-wsplash-color*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* alpha-start) *range-wsplash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* scale-x-start) *range-wsplash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* scale-y-start) *range-wsplash-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* a-scalar) *curve-wsplash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* scale-x-scalar) *curve-wsplash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-curve-settings* scale-y-scalar) *curve-wsplash-scale-y*) + +;; failed to figure out what this is: +(defpart 766 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 2.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-splash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 128.0 :y 128.0 :z 110.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 235.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -3.3333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-splash-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :y 0.15 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -2.8333333 :y -0.21428573 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 3.0 :z 2.0) + :one-over-x-deltas (new 'static 'vector :x 6.0 :y -5.0000005 :z -6.6666665 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-water-splash-center-curve-settings*, type particle-curve-settings +(define *part-water-splash-center-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.8) :lifetime-offset (seconds 0.4)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 766 init-specs 11 initial-valuef) + (the-as float *part-water-splash-center-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* color-start) *range-splash-color*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* alpha-start) *range-splash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* scale-x-start) *range-splash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* scale-y-start) *range-splash-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* a-scalar) *curve-splash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* scale-x-scalar) *curve-splash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-center-curve-settings* scale-y-scalar) *curve-splash-scale-y*) + +;; failed to figure out what this is: +(defpart 767 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.4) + (:scale-x (meters 2) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:scalevel-y (meters 0.01) (meters 0.0033333334)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 768 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0) (meters 0.1)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 0) (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.00033333333) (meters 0.006666667)) + (:scalevel-y (meters 0.00033333333) (meters 0.006666667)) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 770 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 10.0) + (:x (meters 0) (meters 1)) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 769 + :init-specs ((:texture (ripples level-default-sprite)) + (:num 0.5 1.0) + (:x (meters 1) (meters 5)) + (:scale-x (meters 0.1) (meters 0.2)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.001) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 771 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 2.0 2.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.026666667) (meters 0.026666667)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-water-splash-small + :id 193 + :duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 772 :period (seconds 10) :length (seconds 0.2)) + (sp-item 773 :flags (is-3d) :period (seconds 10) :length (seconds 0.067)) + (sp-item 774 :period (seconds 10) :length (seconds 0.167) :offset 20) + ) + ) + +;; failed to figure out what this is: +(defpart 773 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.8) + (:scale-x (meters 0.5) (meters 0.2)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 0.5) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.01) (meters 0.0033333334)) + (:scalevel-y (meters 0.01) (meters 0.0033333334)) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 774 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 5.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.006666667) (meters 0.016666668)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-water-level-drop) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 772 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 4.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.01)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wsplash-small-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.3 :y 0.7 :z 1.7 :w 2.7) + :one-over-x-deltas (new 'static 'vector :x 0.39999998 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-wsplash-small-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 0.7 :z 0.2) + :one-over-x-deltas (new 'static 'vector :x 1.75 :y -1.6666667 :z -0.6666666 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-water-splash-small-curve-settings*, type particle-curve-settings +(define *part-water-splash-small-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.25) :lifetime-offset (seconds 0.1)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 772 init-specs 13 initial-valuef) + (the-as float *part-water-splash-small-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* color-start) *range-wsplash-color*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* alpha-start) *range-wsplash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* scale-x-start) *range-wsplash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* scale-y-start) *range-wsplash-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* a-scalar) *curve-wsplash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* scale-x-scalar) *curve-wsplash-small-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-water-splash-small-curve-settings* scale-y-scalar) *curve-wsplash-small-scale-y*) + +;; failed to figure out what this is: +(defpart 775 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g :copy r) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.16)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 10240.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 776 + :init-specs ((:fade-a -0.64)) + ) + +;; failed to figure out what this is: +(defpart 777 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 12.0) + (:y (meters 0)) + (:scale-x (meters 0.08) (meters 0.03)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 128.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.033333335) (meters 0.05)) + (:accel-y (meters -0.005) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata -208896.0) + (:func 'check-water-level-drop-motion) + (:next-time (seconds 0) (seconds 0.58)) + (:next-launcher 41) + (:conerot-x (degrees 15) (degrees 65)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 41 + :init-specs ((:r 255.0) (:g 255.0) (:b 255.0) (:next-time (seconds 0.017)) (:next-launcher 778)) + ) + +;; failed to figure out what this is: +(defpart 778 + :init-specs ((:r 32.0 32.0) (:g 32.0 32.0) (:b 64.0 32.0) (:next-time (seconds 0) (seconds 1.497)) (:next-launcher 779)) + ) + +;; failed to figure out what this is: +(defpart 780 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32 -0.32) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata :data (new 'static 'boxed-array :type int32 10 0 0 #x401800 #x403d00 #x400700 #x408200)) + (:func 'sparticle-texture-animate) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 781 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 0.08) (meters 0.03)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 0.0) + (:omega (degrees 0.01575) (degrees 0.009)) + (:vel-y (meters 0.026666667) (meters 0.05)) + (:accel-y (meters -0.005) (meters -0.00066666666)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot)) + (:userdata -208896.0) + (:func 'check-water-level-drop-and-die-motion) + (:next-time (seconds 0) (seconds 0.33)) + (:next-launcher 41) + (:conerot-x (degrees 30) (degrees 40)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 782 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.15) (meters 0.05)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g :copy r) + (:b 64.0 32.0) + (:a 0.0) + (:omega (degrees 0.0225) (degrees 0.0225)) + (:vel-x (meters -0.016666668) (meters 0.0016666667)) + (:vel-y (meters 0.016666668)) + (:vel-z (meters -0.016666668) (meters 0.0016666667)) + (:scalevel-x (meters -0.00016666666)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.001) (meters -0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'check-water-level-drop-motion) + (:next-time (seconds 2)) + (:next-launcher 783) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/debug/debug-part_REF.gc b/test/decompiler/reference/jak3/engine/debug/debug-part_REF.gc new file mode 100644 index 0000000000..1b48b60548 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/debug-part_REF.gc @@ -0,0 +1,1952 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; failed to figure out what this is: +(defpart 537 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 64.0) + (:rotvel-z (degrees 0.3)) + (:fade-a -1.6) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-eco-strike-ground + :id 152 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 538) (sp-item 539)) + ) + +;; failed to figure out what this is: +(defpart 538 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 24.0) + (:y (meters 1)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 32.0) + (:a 8.0 56.0) + (:vel-y (meters 0.13333334) (meters 0.16666667)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.4222223) + (:fade-a -0.35555556) + (:accel-y (meters 0.00008333333)) + (:friction 0.7) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.3)) + (:next-launcher 540) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 539 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 32.0) + (:y (meters 1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:a 64.0 8.0) + (:vel-y (meters 0.3)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.8444445) + (:fade-a -0.82222223) + (:friction 0.7) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 540) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-eco-spinkick + :id 153 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 541) (sp-item 542) (sp-item 543 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 541 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 32.0) + (:a 8.0 56.0) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.4222223) + (:fade-a -0.35555556) + (:accel-y (meters 0.00008333333)) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.3)) + (:next-launcher 540) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 540 + :init-specs ((:fade-r -0.7111111) (:fade-g 0.7111111) (:fade-b 0.35555556)) + ) + +;; failed to figure out what this is: +(defpart 542 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.66) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:a 64.0 8.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.8444445) + (:fade-a -0.82222223) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.15)) + (:next-launcher 540) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.1)) + ) + ) + +;; failed to figure out what this is: +(defpart 543 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0) + (:a 64.0) + (:fade-a -4.0) + (:accel-y (meters 0.00008333333)) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-blue + :id 154 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 550 :flags (sp3) :binding 544) + (sp-item 544 :fade-after (meters 40) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 60) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 80) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 100) :flags (sp2 sp3) :binding 545) + (sp-item 544 :fade-after (meters 130) :flags (sp2 sp3) :binding 545) + (sp-item 544 :flags (sp2 sp3) :binding 545) + (sp-item 545 :flags (sp2 sp3) :binding 546) + (sp-item 545 :flags (sp2 sp3) :binding 547) + (sp-item 545 :flags (sp2 sp3) :binding 548) + (sp-item 545 :flags (sp2 sp3) :binding 546) + (sp-item 545 :flags (sp2 sp3) :binding 547) + (sp-item 545 :flags (sp2 sp3) :binding 548) + (sp-item 546 :fade-after (meters 60) :flags (sp2) :binding 549) + (sp-item 547 :fade-after (meters 70) :flags (sp2) :binding 549) + (sp-item 548 :fade-after (meters 80) :flags (sp2) :binding 549) + (sp-item 546 :fade-after (meters 90) :flags (sp2) :binding 549) + (sp-item 547 :fade-after (meters 100) :flags (sp2) :binding 549) + (sp-item 548 :fade-after (meters 100) :flags (sp2) :binding 549) + (sp-item 549 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 550 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 544 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.3) (meters 0.15)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 32.0 96.0) + (:b 128.0 128.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 551) + ) + ) + +;; failed to figure out what this is: +(defpart 551 + :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 545 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.2) (meters 0.1)) + (:scale-x (meters 0.8) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0) + (:b 192.0) + (:a 32.0 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 269.52002) (degrees 208.99998)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 552) + ) + ) + +;; failed to figure out what this is: +(defpart 552 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 546 + :init-specs ((:texture (common-white common)) + (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 547 + :init-specs ((:texture (common-white common)) + (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 548 + :init-specs ((:texture (common-white common)) + (:num 0.0 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 549 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.2 0.2) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 192.0) + (:a 96.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-blue-collect + :id 155 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 558 :flags (sp3) :binding 554) + (sp-item 554 :flags (sp2 sp3) :binding 555) + (sp-item 554 :flags (sp2 sp3) :binding 556) + (sp-item 554 :flags (sp2 sp3) :binding 555) + (sp-item 554 :flags (sp2 sp3) :binding 556) + (sp-item 554 :flags (sp2 sp3) :binding 557) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 555 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 556 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + (sp-item 557 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 558 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0) + (:b 192.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +;; failed to figure out what this is: +(defpart 554 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.75) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 555 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 556 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 557 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0 64.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-blue-active + :id 156 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 562 :fade-after (meters 140) :falloff-to (meters 140) :binding 559) + (sp-item 562 :fade-after (meters 140) :falloff-to (meters 140) :binding 560) + (sp-item 562 :fade-after (meters 140) :falloff-to (meters 140) :binding 561) + (sp-item 563) + (sp-item 564 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 565 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 566 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 561 :fade-after (meters 30) :falloff-to (meters 30) :flags (sp2)) + (sp-item 560 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp2)) + (sp-item 559 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp2)) + (sp-item 561 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp2)) + (sp-item 560 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp2)) + (sp-item 559 :fade-after (meters 110) :falloff-to (meters 110) :flags (sp2)) + (sp-item 561 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp2)) + (sp-item 560 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-blue-inactive + :id 157 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 562 :fade-after (meters 100)) (sp-item 563)) + ) + +;; failed to figure out what this is: +(defpart 563 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.1 1.0) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.5) (meters 1.4)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 192.0) + (:a 64.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:fade-a -0.2) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 562 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.05 0.1) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.5) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 192.0) + (:a 96.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 559 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 560 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 561 + :init-specs ((:texture (common-white common)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 564 + :init-specs ((:texture (common-white common)) + (:num 0.1 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 565 + :init-specs ((:texture (common-white common)) + (:num 0.2 0.4) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 566 + :init-specs ((:texture (common-white common)) + (:num 0.3 0.1) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 10) (degrees 160)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.4) + (:timer (seconds 0.305)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 553) + ) + ) + +;; failed to figure out what this is: +(defpart 553 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.0) (:fade-g -1.0) (:fade-a -2.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-red + :id 158 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 571 :flags (sp3) :binding 567) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 567 :flags (sp2 sp3) :binding 568) + (sp-item 568 :flags (sp2 sp3) :binding 569) + (sp-item 568 :flags (sp2 sp3) :binding 569) + (sp-item 568 :flags (sp2 sp3) :binding 569) + (sp-item 569 :fade-after (meters 100) :flags (sp2 sp3) :binding 570) + (sp-item 569 :fade-after (meters 100) :flags (sp2 sp3) :binding 570) + (sp-item 569 :fade-after (meters 100) :flags (sp2 sp3) :binding 570) + (sp-item 570 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 570 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 570 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 571 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 567 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 6.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.15) (meters 0.2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 24.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 572) + ) + ) + +;; failed to figure out what this is: +(defpart 572 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 568 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.25) (meters 0.1)) + (:scale-x (meters 0.6) (meters 0.4)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 573) + ) + ) + +;; failed to figure out what this is: +(defpart 573 + :init-specs ((:fade-a -0.21333334) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 569 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.07) (meters 0.03)) + (:scale-x (meters 0.6) (meters 0.6)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:vel-x (meters 0.11259259)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 573) + ) + ) + +;; failed to figure out what this is: +(defpart 570 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1 1.0) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.00038095238)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.1) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 574) + ) + ) + +;; failed to figure out what this is: +(defpart 574 + :init-specs ((:fade-g 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-red-collect + :id 159 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 577 :flags (sp3) :binding 575) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 575 :flags (sp2 sp3) :binding 576) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + (sp-item 576 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 577 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +;; failed to figure out what this is: +(defpart 575 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 576 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters -0.005555555)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.0) + (:fade-a -0.22857143) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.18)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 578) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-red-active + :id 160 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 582 :fade-after (meters 30) :period (seconds 1.1) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 90) :period (seconds 3.12) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 130) :period (seconds 1.76) :length (seconds 0.017) :binding 579) + (sp-item 582 :fade-after (meters 170) :period (seconds 2.67) :length (seconds 0.017) :binding 579) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 579 :flags (sp2 sp3) :binding 580) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 580 :flags (sp2 sp3) :binding 581) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 50) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 60) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 70) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 80) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 581 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 583 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 584) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-red-inactive + :id 161 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 583 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 584)) + ) + +;; failed to figure out what this is: +(defpart 584 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 583 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 582 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 1.0) + (:vel-y (meters 0.006666667) (meters 0.0033333334)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 579 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.017777778)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.28444445) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 580 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.25) (meters 0.1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 581 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.1 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters -0.0023809525)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.07619048) + (:accel-y (meters 0.000100000005) (meters 0.00015)) + (:timer (seconds 0.1) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 578) + ) + ) + +;; failed to figure out what this is: +(defpart 578 + :init-specs ((:fade-g 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-yellow-active + :id 162 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 588 :fade-after (meters 40) :period (seconds 1.1) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 60) :period (seconds 2.455) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 80) :period (seconds 3.12) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 100) :period (seconds 1.76) :length (seconds 0.017) :binding 585) + (sp-item 588 :fade-after (meters 130) :period (seconds 2.67) :length (seconds 0.017) :binding 585) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 585 :flags (sp2 sp3) :binding 586) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 586 :flags (sp2 sp3) :binding 587) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 60) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 70) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 80) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 587 :fade-after (meters 90) :falloff-to (meters 100) :flags (sp2)) + (sp-item 589 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 590) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-yellow-inactive + :id 163 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 589 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 590)) + ) + +;; failed to figure out what this is: +(defpart 590 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.6 0.6) + (:x (meters -0.75) (meters 1.5)) + (:y (meters 0.5)) + (:z (meters -0.75) (meters 1.5)) + (:scale-x (meters 1.9) (meters 1.9)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 92.0 32.0) + (:g 32.0 92.0) + (:b 0.0) + (:a 32.0) + (:vel-y (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:fade-a -0.10666667) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 589 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.1 0.3) + (:x (meters -0.5) (meters 1)) + (:y (meters 0.5)) + (:z (meters -0.5) (meters 1)) + (:scale-x (meters 1.5) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-y (meters 0.01) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.1)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 588 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:a 1.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:timer (seconds 1.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 5)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 585 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 128.0) + (:vel-x (meters 0.10666667)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:fade-a -0.34133333) + (:timer (seconds 1.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 586 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.2)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 128.0) + (:vel-x (meters 0.11259259)) + (:rotvel-z (degrees -0.3) 1 (degrees 0.6)) + (:fade-a -0.34133333) + (:timer (seconds 1.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 587 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5 2.0) + (:y (meters -0.05)) + (:scale-x (meters 0.4) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 64.0 64.0) + (:vel-y (meters 0.0023333333) (meters 0.0016666667)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.024242423) + (:accel-y (meters -0.000100000005) (meters -0.0003)) + (:friction 0.93) + (:timer (seconds 0.1) (seconds 0.697)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.3)) + (:next-launcher 591) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 591 + :init-specs ((:fade-r 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-yellow + :id 164 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 596 :flags (sp3) :binding 592) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 592 :flags (sp2 sp3) :binding 593) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 593 :flags (sp2 sp3) :binding 594) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 594 :fade-after (meters 100) :flags (sp2 sp3) :binding 595) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + (sp-item 595 :fade-after (meters 90) :falloff-to (meters 110) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 596 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 0.01)) + (:scale-y :copy scale-x) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 592 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.15) (meters 0.2)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.0148148155) (meters 0.0044444446)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees -0.1) 1 (degrees 0.2)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 597) + ) + ) + +;; failed to figure out what this is: +(defpart 597 + :init-specs ((:fade-a -0.10666667) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 593 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:y (meters 0) (meters 16)) + (:z (meters 0.75) (meters 0.1)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters 0.017777778) (meters 0.0148148155)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 598) + ) + ) + +;; failed to figure out what this is: +(defpart 598 + :init-specs ((:fade-a -0.16) (:timer (seconds 0.5))) + ) + +;; failed to figure out what this is: +(defpart 594 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 16)) + (:y (meters 0) (meters 16)) + (:z (meters 0.12) (meters 0.03)) + (:scale-x (meters 0.4) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:a 32.0) + (:vel-x (meters 0.11259259)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + (:func 'eco-fadeout) + (:next-time (seconds 0.035)) + (:next-launcher 598) + ) + ) + +;; failed to figure out what this is: +(defpart 595 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 599) + ) + ) + +;; failed to figure out what this is: +(defpart 599 + :init-specs ((:fade-g 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-yellow-collect + :id 165 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 602 :flags (sp3) :binding 600) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 600 :flags (sp2 sp3) :binding 601) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + (sp-item 601 :fade-after (meters 40) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 602 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 64.0) + (:fade-a -3.2) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'part-tracker-track-root) + (:next-time (seconds 0.05)) + (:next-launcher 418) + ) + ) + +;; failed to figure out what this is: +(defpart 600 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 5.0) + (:y (meters -4) (meters 16)) + (:z (meters 0.08)) + (:scale-x (meters 0.3) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 127.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.017777778) 2.0 (meters 0.035555556)) + (:vel-y (meters 0)) + (:vel-z (meters 0.08)) + (:accel-z (meters -0.0053333333)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 601 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 32.0 32.0) + (:scalevel-x (meters -0.0006190476)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-a -0.01904762) + (:accel-y (meters -0.000100000005) (meters -0.00015)) + (:timer (seconds 0.1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.8)) + (:next-launcher 599) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fuel-cell-starburst + :id 166 + :bounds (static-bspherem 0 0.5 0 1.5) + :parts ((sp-item 603 :fade-after (meters 35)) + (sp-item 604 :fade-after (meters 20)) + (sp-item 605 :flags (sp1 sp3)) + (sp-item 606 :flags (sp1 sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 603 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.8)) + (:r 0.0 1 255.0) + (:g 0.0 1 255.0) + (:b 0.0 1 255.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 0.35555556) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.3)) + (:next-launcher 607) + ) + ) + +;; failed to figure out what this is: +(defpart 607 + :init-specs ((:fade-a -0.53333336)) + ) + +;; failed to figure out what this is: +(defpart 604 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.06) + (:scale-x (meters 2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2)) + (:r 0.0 1 255.0) + (:g 0.0 1 255.0) + (:b 0.0 1 255.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:fade-a 0.32) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + (:next-time (seconds 0.25)) + (:next-launcher 607) + ) + ) + +;; failed to figure out what this is: +(defpart 605 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5)) + (:rot-z (degrees 0)) + (:scale-y (meters 3)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 64.0) + (:rotvel-z (degrees -0.4)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 606 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0)) + (:scale-y (meters 3.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root-prim) + ) + ) + +;; definition for function sparticle-track-root-money +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-root-money ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-1 (-> arg1 key proc))) + (when (!= (-> v1-1 type) hud-money) + (let ((v1-3 (-> v1-1 root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (+ 2048.0 (-> v1-3 y))) + (set! (-> arg2 z) (-> v1-3 z)) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 608 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1) (meters 0.8)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 0.35555556) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.3)) + (:next-launcher 609) + ) + ) + +;; failed to figure out what this is: +(defpart 609 + :init-specs ((:fade-a -0.53333336)) + ) + +;; failed to figure out what this is: +(defpart 610 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.06) + (:scale-x (meters 2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.15) (degrees 0.3)) + (:fade-a 0.32) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.25)) + (:next-launcher 609) + ) + ) + +;; failed to figure out what this is: +(defpart 611 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-z (degrees 0)) + (:scale-y (meters 2)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 32.0) + (:rotvel-z (degrees -0.4)) + (:timer (seconds 12)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root-money) + ) + ) + +;; failed to figure out what this is: +(defpart 612 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0)) + (:scale-y (meters 2.5)) + (:r 192.0) + (:g 192.0) + (:b 0.0 128.0) + (:a 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 12)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root-money) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-money-starburst :id 167 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 613))) + +;; failed to figure out what this is: +(defpartgroup group-buzzer-effect :id 168 :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 249))) + +;; failed to figure out what this is: +(defpartgroup group-blue-collect + :id 169 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 614) (sp-item 615) (sp-item 616)) + ) + +;; failed to figure out what this is: +(defpart 614 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 615 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 616 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 60.0 20.0) + (:b 128.0 64.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-yellow-collect + :id 170 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 617) (sp-item 618) (sp-item 619)) + ) + +;; failed to figure out what this is: +(defpart 617 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 618 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 619 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 64.0 192.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + +;; failed to figure out what this is: +(defpart 458 + :init-specs ((:scalevel-x (meters -0.025)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-collect + :id 171 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 620) (sp-item 621) (sp-item 622)) + ) + +;; failed to figure out what this is: +(defpart 620 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y (meters 0.009765625)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 621 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 6.0) + (:scale-x (meters 8) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5)) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters 0.009765625)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:fade-a 2.1333334) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017) (seconds 0.065)) + (:next-launcher 455) + ) + ) + +;; failed to figure out what this is: +(defpart 622 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.1)) + (:rotvel-z (degrees -0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.2)) + (:next-launcher 458) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/debug/debug_REF.gc b/test/decompiler/reference/jak3/engine/debug/debug_REF.gc index ca95dae97d..d8f7848fdd 100644 --- a/test/decompiler/reference/jak3/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/debug_REF.gc @@ -1448,7 +1448,7 @@ (set! (-> gp-0 0 y) (* (cos (-> arg0 stick0-dir)) (-> arg0 stick0-speed))) (dotimes (s5-1 32) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket583) + (bucket-id debug) ) (draw-sprite2d-xy s3-0 @@ -1742,7 +1742,7 @@ ) (let ((s5-0 (the-as adgif-shader (-> arg1 base)))) (adgif-shader<-texture-simple! s5-0 a1-1) - (set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> s5-0 alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> s5-0 tex0 tfx) 0) (set! (-> s5-0 tex1 mmag) 0) (set! (-> s5-0 clamp) (new 'static 'gs-clamp)) @@ -1945,7 +1945,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc new file mode 100644 index 0000000000..79073761a4 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/default-menu_REF.gc @@ -0,0 +1,7275 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition for symbol *debug-menu-context*, type debug-menu-context +(define *debug-menu-context* (new 'debug 'debug-menu-context)) + +;; definition for symbol *dm-cam-mode-interpolation*, type int +(define *dm-cam-mode-interpolation* 0) + +;; definition for function dm-cam-mode-func +(defun dm-cam-mode-func ((arg0 (state camera-slave)) (arg1 debug-menu-msg)) + (if (and (= arg1 (debug-menu-msg press)) arg0) + (set-setting-by-param *setting-control* 'mode-name (-> arg0 name) 0 0) + ) + (if *camera* + (send-event *camera* 'query-state arg0) + (not arg0) + ) + ) + +;; definition for function dm-cam-mode-default +(defun dm-cam-mode-default ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (remove-setting-by-arg0 *setting-control* 'mode-name) + ) + (not (get-setting *setting-control* 'mode-name)) + ) + +;; definition for function dm-cam-settings-default +(defun dm-cam-settings-default ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (remove-setting-by-arg0 *setting-control* 'fov) + (remove-setting-by-arg0 *setting-control* 'slave-options) + ) + (and (not (get-setting *setting-control* 'fov)) (not (get-setting *setting-control* 'slave-options))) + ) + +;; definition for function dm-cam-settings-func +(defun dm-cam-settings-func ((arg0 int) (arg1 debug-menu-msg)) + (when (and (= arg1 (debug-menu-msg press)) *camera*) + (cond + ((zero? arg0) + (send-event *camera* 'toggle-slave-option (cam-slave-options BUTT_CAM)) + ) + ((= arg0 1) + (send-event *camera* 'toggle-slave-option (cam-slave-options SAME_SIDE)) + ) + ((= arg0 2) + (send-event *camera* 'toggle-slave-option (cam-slave-options MOVE_SPHERICAL)) + ) + ((= arg0 3) + (send-event *camera* 'toggle-slave-option (cam-slave-options DRAG)) + ) + ((= arg0 4) + (send-event *camera* 'toggle-slave-option (cam-slave-options ALLOW_Z_ROT)) + ) + ((= arg0 6) + (set-setting-by-param *setting-control* 'slave-options 'clear 0 16) + ) + ((= arg0 7) + (send-event *camera* 'toggle-slave-option (cam-slave-options FIND_HIDDEN_TARGET)) + ) + ((= arg0 8) + (send-event *camera* 'toggle-slave-option (cam-slave-options COLLIDE)) + ) + ((= arg0 9) + (send-event *camera* 'toggle-slave-option (cam-slave-options LINE_OF_SIGHT)) + ) + ((= arg0 10) + (send-event *camera* 'toggle-slave-option (cam-slave-options NO_ROTATE)) + ) + ((= arg0 11) + (send-event *camera* 'toggle-slave-option (cam-slave-options STICKY_ANGLE)) + ) + ) + ) + (cond + (*camera* + (cond + ((zero? arg0) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 BUTT_CAM)) + ) + ((= arg0 1) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 SAME_SIDE)) + ) + ((= arg0 2) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 MOVE_SPHERICAL)) + ) + ((= arg0 3) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 DRAG)) + ) + ((= arg0 4) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 ALLOW_Z_ROT)) + ) + ((= arg0 6) + (not (get-setting *setting-control* 'slave-options)) + ) + ((= arg0 7) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 FIND_HIDDEN_TARGET)) + ) + ((= arg0 8) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 COLLIDE)) + ) + ((= arg0 9) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 LINE_OF_SIGHT)) + ) + ((= arg0 10) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 NO_ROTATE)) + ) + ((= arg0 11) + (logtest? (-> *camera* slave-options) (cam-slave-options-u32 STICKY_ANGLE)) + ) + (else + #f + ) + ) + ) + (else + #f + ) + ) + ) + +;; definition for function dm-cam-settings-func-int +(defun dm-cam-settings-func-int ((arg0 int) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) + (when (and (= arg1 (debug-menu-msg press)) *camera*) + (if (= (/ arg0 8) 5) + (set! *dm-cam-mode-interpolation* arg2) + ) + ) + (cond + (*camera* + (if (= (/ arg0 8) 5) + *dm-cam-mode-interpolation* + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +;; definition for function dm-cam-externalize +(defun dm-cam-externalize ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((= arg0 'reset) + (if (!= *external-cam-mode* 'locked) + (external-cam-reset!) + ) + ) + ((= arg0 'allow-z) + (set! *external-cam-options* (logxor *external-cam-options* (external-cam-option allow-z))) + ) + ((= *external-cam-mode* arg0) + (set! *external-cam-mode* #f) + ) + (else + (if (not *external-cam-mode*) + (external-cam-reset!) + ) + (set! *external-cam-mode* arg0) + ) + ) + ) + (if (= arg0 'allow-z) + (logtest? *external-cam-options* (external-cam-option allow-z)) + (= *external-cam-mode* arg0) + ) + ) + +;; definition for function dm-cam-setting-float +(defun dm-cam-setting-float ((arg0 float) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (let ((v1-2 arg0)) + (when (= (the-as int v1-2) 'fov) + (if (not (get-setting *setting-control* 'fov)) + (set! arg2 64.0) + ) + (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) + (if *camera-combiner* + (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) + ) + (if (and *camera* (-> *camera* slave)) + (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) + ) + ) + ) + ) + (cond + ((= (the-as int arg0) 'fov) + (cond + ((get-setting *setting-control* 'fov) + (empty) + arg2 + ) + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + +;; definition for function dm-cam-render-float +(defun dm-cam-render-float ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (when (zero? (/ arg0 8)) + (when *math-camera* + (set! (-> *math-camera* fov) (* 182.04445 arg2)) + (update-math-camera + *math-camera* + (-> *setting-control* user-current video-mode) + (-> *setting-control* user-current aspect-ratio) + (-> *math-camera* fov) + ) + ) + ) + ) + (cond + ((zero? (/ arg0 8)) + (cond + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + +;; definition for function dm-subdiv-float +(defun dm-subdiv-float ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('close) + (when (and *math-camera* *subdivide-settings*) + (dotimes (v1-6 12) + (set! (-> *subdivide-settings* close v1-6) (* 4096.0 arg2)) + ) + ) + ) + (('far) + (when (and *math-camera* *subdivide-settings*) + (dotimes (v1-13 12) + (set! (-> *subdivide-settings* far v1-13) (* 4096.0 arg2)) + ) + ) + ) + ) + ) + (case arg0 + (('close) + (if (and *math-camera* *subdivide-settings*) + (* 0.00024414062 (-> *subdivide-settings* close 0)) + arg3 + ) + ) + (('far) + (if (and *math-camera* *subdivide-settings*) + (* 0.00024414062 (-> *subdivide-settings* far 0)) + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +;; definition for function dm-subdiv-int +(defun dm-subdiv-int ((arg0 symbol) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('anim-speed) + (if *anim-tester* + (set! (-> *anim-tester* 0 speed) arg2) + ) + ) + ) + ) + (case arg0 + (('anim-speed) + (if *anim-tester* + (-> *anim-tester* 0 speed) + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +;; definition for function dm-select-race-path +(defun dm-select-race-path ((arg0 object) (arg1 debug-menu-msg) (arg2 int)) + (if (= arg1 (debug-menu-msg press)) + (set! *select-race-path* arg2) + ) + *select-race-path* + ) + +;; definition for function dm-setting-language +(defun dm-setting-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default language) (/ arg0 8)) + ) + +;; definition for function dm-setting-subtitle-language +(defun dm-setting-subtitle-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default subtitle-language) (/ arg0 8)) + ) + +;; definition for function dm-setting-audio-language +(defun dm-setting-audio-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default audio-language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default audio-language) (/ arg0 8)) + ) + +;; definition for function dm-setting-stereo-mode +(defun dm-setting-stereo-mode ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default stereo-mode) (the-as int (/ (the-as int arg0) 8))) + ) + (= (-> *setting-control* user-default stereo-mode) (/ (the-as int arg0) 8)) + ) + +;; definition for function dm-current-continue +(defun dm-current-continue ((arg0 string) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (start 'play (get-continue-by-name *game-info* arg0)) + ) + (string= (-> (get-current-continue-forced *game-info*) name) arg0) + ) + +;; definition for function dm-subdiv-draw-func +(defun dm-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-draw-mode* (the-as subdivide-setting (/ arg0 8))) + ) + (= (/ arg0 8) *subdivide-draw-mode*) + ) + +;; definition for function dm-scissor-subdiv-draw-func +(defun dm-scissor-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-scissor-draw-mode* (the-as subdivide-setting (/ arg0 8))) + ) + (= (/ arg0 8) *subdivide-scissor-draw-mode*) + ) + +;; definition for function dm-foreground-subdiv-draw-func +(defun dm-foreground-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! *subdivide-foreground-draw-mode* (the-as subdivide-setting (/ arg0 8))) + (let ((v1-3 *generic-consts*) + (a1-1 (/ arg0 8)) + ) + (cond + ((zero? a1-1) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= a1-1 1) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= a1-1 2) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= a1-1 3) + (set! (-> v1-3 base-strgif str-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + (set! (-> v1-3 base-strgif fan-prim) + (new 'static 'gif-tag-prim + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + ) + (= (/ arg0 8) *subdivide-foreground-draw-mode*) + ) + +;; definition for function dm-col-rend-on-func +(defun dm-col-rend-on-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 draw?) (not (-> v1-0 draw?))) + ) + (-> v1-0 draw?) + ) + ) + +;; definition for function dm-col-rend-outline-func +(defun dm-col-rend-outline-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 outline?) (not (-> v1-0 outline?))) + ) + (-> v1-0 outline?) + ) + ) + +;; definition for function dm-col-rend-back-face-func +(defun dm-col-rend-back-face-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-back-faces?) (not (-> v1-0 show-back-faces?))) + ) + (-> v1-0 show-back-faces?) + ) + ) + +;; definition for function dm-col-rend-normals-func +(defun dm-col-rend-normals-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-normals?) (not (-> v1-0 show-normals?))) + ) + (-> v1-0 show-normals?) + ) + ) + +;; definition for function dm-col-rend-ghost-hidden-func +(defun dm-col-rend-ghost-hidden-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 ghost-hidden?) (not (-> v1-0 ghost-hidden?))) + ) + (-> v1-0 ghost-hidden?) + ) + ) + +;; definition for function dm-col-rend-track-func +(defun dm-col-rend-track-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 track) (the-as uint (/ arg0 8))) + ) + (= (/ arg0 8) (-> v1-0 track)) + ) + ) + +;; definition for function dm-col-rend-show-only-toggle-func +(defun dm-col-rend-show-only-toggle-func ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 show-only) arg0) + (logand! (-> v1-0 show-only) -57) + ) + (logtest? (-> v1-0 show-only) arg0) + ) + ) + +;; definition for function dm-col-rend-show-only-set-func +(defun dm-col-rend-show-only-set-func ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-only) arg0) + ) + (= (-> v1-0 show-only) arg0) + ) + ) + +;; definition for function dm-col-rend-cspec-toggle +(defun dm-col-rend-cspec-toggle ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 cspec) (the-as uint arg0)) + ) + (logtest? (-> v1-0 cspec) arg0) + ) + ) + +;; definition for function dm-col-rend-size +(defun dm-col-rend-size ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 bbox-radius) (* 2048.0 arg2)) + ) + (* 0.00024414062 (* 2.0 (-> v1-0 bbox-radius))) + ) + ) + +;; definition for function dm-col-rend-cam-dist +(defun dm-col-rend-cam-dist ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) + ) + (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + ) + ) + +;; definition for function dm-ocean-height-func +(defun dm-ocean-height-func ((arg0 ocean-height-hack) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! *ocean-height-hack* (the-as ocean-height-hack (/ (the-as int arg0) 8))) + (let* ((v1-3 (/ (the-as int arg0) 8)) + (f0-0 (cond + ((= v1-3 2) + -16384000.0 + ) + ((= v1-3 3) + -216498.17 + ) + ((= v1-3 4) + -265650.2 + ) + ((= v1-3 5) + -314802.2 + ) + ((= v1-3 6) + -368050.2 + ) + (else + 0.0 + ) + ) + ) + ) + (set-height! *ocean-map-sewer* f0-0) + ) + ) + (= (/ (the-as int arg0) 8) *ocean-height-hack*) + ) + +;; definition for function dm-ocean-subdiv-draw-func +(defun dm-ocean-subdiv-draw-func ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-ocean-draw-mode* (the-as subdivide-setting (/ (the-as int arg0) 8))) + ) + (= (/ (the-as int arg0) 8) *subdivide-ocean-draw-mode*) + ) + +;; definition for function dm-time-of-day-func +(defun dm-time-of-day-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((zero? (/ arg0 8)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 7) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 1) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 10) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 2) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 12) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 3) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 14) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 4) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 18) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 5) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 19) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 6) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 7) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 4) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ arg0 8))) + ) + ((= (/ arg0 8) 8) + (send-event + (ppointer->process *time-of-day*) + 'dest-clock-ratio-set + (if *time-of-day-fast* + #x42700000 + #x3f800000 + ) + (seconds 2) + ) + ) + (else + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + (set! (-> *time-of-day-context* mode) + (logand (logxor (-> *time-of-day-context* mode) (the-as uint (/ arg0 8))) + (time-of-day-palette-id palette-0 palette-1 palette-2 palette-3 palette-4 palette-5 palette-6 palette-7) + ) + ) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'minutes 0) + (send-event (ppointer->process *time-of-day*) 'change 'seconds 0) + (send-event (ppointer->process *time-of-day*) 'change 'frames 0) + (set! *teleport-count* 1) + ) + (cond + ((< (/ arg0 8) 9) + (= (/ arg0 8) (-> *time-of-day-context* mode)) + ) + ((< (/ arg0 8) 8) + #f + ) + (else + (logtest? (-> *time-of-day-context* mode) (/ arg0 8)) + ) + ) + ) + +;; definition for function dm-time-of-day-func2 +(defun dm-time-of-day-func2 ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> arg0 value) (not (-> arg0 value))) + (if (nonzero? (send-event (ppointer->process *time-of-day*) 'ratio)) + (send-event + (ppointer->process *time-of-day*) + 'dest-clock-ratio-set + (if *time-of-day-fast* + #x42700000 + #x3f800000 + ) + (seconds 2) + ) + ) + ) + (-> arg0 value) + ) + +;; definition for function dm-time-of-day-palette-func +(defun dm-time-of-day-palette-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-palette) (the-as time-of-day-palette-id (/ arg0 8))) + (cond + ((zero? (/ arg0 8)) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-0)) + ) + ((= (/ arg0 8) 1) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-1)) + ) + ((= (/ arg0 8) 2) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-2)) + ) + ((= (/ arg0 8) 3) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-3)) + ) + ((= (/ arg0 8) 4) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-4)) + ) + ((= (/ arg0 8) 5) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-5)) + ) + ((= (/ arg0 8) 6) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-6)) + ) + ((= (/ arg0 8) 7) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-7)) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0) + ) + (cond + ((zero? (/ arg0 8)) + (= (-> *time-of-day-context* mode) 16) + ) + ((= (/ arg0 8) 1) + (= (-> *time-of-day-context* mode) 32) + ) + ((= (/ arg0 8) 2) + (= (-> *time-of-day-context* mode) 64) + ) + ((= (/ arg0 8) 3) + (= (-> *time-of-day-context* mode) 128) + ) + ((= (/ arg0 8) 4) + (= (-> *time-of-day-context* mode) 256) + ) + ((= (/ arg0 8) 5) + (= (-> *time-of-day-context* mode) 512) + ) + ((= (/ arg0 8) 6) + (= (-> *time-of-day-context* mode) 1024) + ) + ((= (/ arg0 8) 7) + (= (-> *time-of-day-context* mode) 2048) + ) + ) + ) + +;; definition for function dm-boolean-toggle-pick-func +(defun dm-boolean-toggle-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> arg0 value) (not (-> arg0 value))) + ) + (-> arg0 value) + ) + +;; definition for function dm-time-of-day-pick-func +(defun dm-time-of-day-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (time-of-day-setup (= arg1 (debug-menu-msg press))) + ) + +;; definition for function dm-stats-memory-func +(defun dm-stats-memory-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 (/ arg0 8))) + (if (= arg1 (debug-menu-msg press)) + (set! *stats-memory-level-index* v1-0) + ) + (= *stats-memory-level-index* v1-0) + ) + ) + +;; definition for function dm-actor-marks-pick-func +(defun dm-actor-marks-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-actor-marks* arg0) + ) + (= *display-actor-marks* arg0) + ) + +;; definition for function dm-debug-actor-lod-dist +;; INFO: Used lq/sq +;; WARN: Return type mismatch number vs object. +(defun dm-debug-actor-lod-dist ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (local-vars (sv-16 res-tag)) + (when (= arg1 (debug-menu-msg press)) + (when (and *debug-actor* (>= (-> (the-as process-drawable *debug-actor*) draw lod-set max-lod) (/ arg0 8))) + (let ((a0-4 (&+ (-> (the-as process-drawable *debug-actor*) draw jgeo extra data-base) (* (/ arg0 8) 4)))) + (mem-set32! a0-4 1 (the-as int (* 4096.0 arg2))) + ) + (reset-actors 'debug) + ) + ) + (cond + (*debug-actor* + (let ((f30-0 0.00024414062)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-21 (res-lump-data + (-> (the-as process-drawable *debug-actor*) draw jgeo extra) + 'lod-dist + (pointer float) + :tag-ptr (& sv-16) + ) + ) + ) + (* f30-0 (if (and v1-21 (< (/ arg0 8) (the-as int (-> sv-16 elt-count)))) + (-> v1-21 (/ arg0 8)) + 0.0 + ) + ) + ) + ) + ) + (else + 0 + ) + ) + ) + +;; definition for function dm-select-race-pick-func +(defun dm-select-race-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *select-race* (the-as race-selection (/ arg0 8))) + ) + (= (/ arg0 8) *select-race*) + ) + +;; definition for function dm-compact-actor-pick-func +(defun dm-compact-actor-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *compact-actors* arg0) + ) + (= *compact-actors* arg0) + ) + +;; definition for function dm-actor-vis-pick-func +(defun dm-actor-vis-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-actor-vis* arg0) + ) + (= *display-actor-vis* arg0) + ) + +;; definition for function dm-game-mode-pick-func +(defun dm-game-mode-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *game-info* mode) arg0) + ) + (= (-> *game-info* mode) arg0) + ) + +;; definition for function dm-game-feature-toggle-pick-func +(defun dm-game-feature-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ arg0 8)))) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* features) (the-as uint v1-1)) + (set! (-> *game-info* debug-features) + (logior (logclear (-> *game-info* debug-features) v1-1) (logand (-> *game-info* features) v1-1)) + ) + (if (logtest? (game-feature + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + ) + (-> *game-info* features) + ) + (logior! (-> *game-info* features) (game-feature gun)) + (logclear! (-> *game-info* features) (game-feature gun)) + ) + (if (logtest? (game-feature + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + ) + (-> *game-info* debug-features) + ) + (logior! (-> *game-info* debug-features) (game-feature gun)) + (logclear! (-> *game-info* debug-features) (game-feature gun)) + ) + ) + (logtest? (-> *game-info* features) v1-1) + ) + ) + +;; definition for function dm-game-vehicle-toggle-pick-func +(defun dm-game-vehicle-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ arg0 8)))) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* vehicles) (the-as uint v1-1)) + (set! (-> *game-info* debug-vehicles) + (logior (logclear (-> *game-info* debug-vehicles) v1-1) (logand (-> *game-info* vehicles) v1-1)) + ) + ) + (logtest? (-> *game-info* vehicles) v1-1) + ) + ) + +;; definition for function dm-game-secret-toggle-pick-func +(defun dm-game-secret-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* secrets) (the-as uint (ash 1 (/ arg0 8)))) + (update-task-masks 'event) + ) + (logtest? (-> *game-info* secrets) (ash 1 (/ arg0 8))) + ) + +;; definition for function display-scene-control-toggle-pick-func +(defun display-scene-control-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-scene-control* (logxor *display-scene-control* (the-as uint arg0))) + ) + (logtest? *display-scene-control* arg0) + ) + +;; definition for function display-scene-control-set-pick-func +(defun display-scene-control-set-pick-func ((arg0 scene-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-scene-control* arg0) + ) + (= *display-scene-control* arg0) + ) + +;; definition for function display-bot-marks-toggle-pick-func +(defun display-bot-marks-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-bot-marks* (logxor *display-bot-marks* (the-as uint arg0))) + ) + (logtest? *display-bot-marks* arg0) + ) + +;; definition for function display-bot-marks-set-pick-func +(defun display-bot-marks-set-pick-func ((arg0 bot-marks-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-bot-marks* arg0) + ) + (= *display-bot-marks* arg0) + ) + +;; definition for function display-race-marks-toggle-pick-func +(defun display-race-marks-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-race-marks* (logxor *display-race-marks* (the-as uint arg0))) + ) + (logtest? *display-race-marks* arg0) + ) + +;; definition for function display-race-marks-set-pick-func +(defun display-race-marks-set-pick-func ((arg0 race-marks-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-race-marks* arg0) + ) + (= *display-race-marks* arg0) + ) + +;; definition for function dm-vu1-user-toggle-pick-func +(defun dm-vu1-user-toggle-pick-func ((arg0 vu1-renderer-mask) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ (the-as int arg0) 8)))) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *display* vu1-enable-user-menu) (the-as uint v1-1)) + ) + (logtest? (-> *display* vu1-enable-user-menu) v1-1) + ) + ) + +;; definition for function dm-vu1-user-all-pick-func +(defun dm-vu1-user-all-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (let ((v1-1 (the-as uint #x17fffffff8))) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-1)) + ) + (= (-> *display* vu1-enable-user-menu) v1-1) + ) + ) + +;; definition for function dm-vu1-user-none-pick-func +(defun dm-vu1-user-none-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (let ((v1-0 0)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-0)) + ) + (= (-> *display* vu1-enable-user-menu) v1-0) + ) + ) + +;; definition for function dm-texture-user-toggle-pick-func +(defun dm-texture-user-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *texture-pool* texture-enable-user-menu) (the-as uint arg0)) + ) + (logtest? (-> *texture-pool* texture-enable-user-menu) arg0) + ) + +;; definition for function dm-texture-user-set-pick-func +(defun dm-texture-user-set-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *texture-pool* texture-enable-user-menu) (the-as texture-enable-mask arg0)) + ) + (= (-> *texture-pool* texture-enable-user-menu) arg0) + ) + +;; definition for function dm-strip-lines-toggle-pick-func +(defun dm-strip-lines-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-strip-lines* (logxor *display-strip-lines* (the-as uint (/ arg0 8)))) + ) + (logtest? *display-strip-lines* (/ arg0 8)) + ) + +;; definition for function dm-strip-lines-set-pick-func +(defun dm-strip-lines-set-pick-func ((arg0 strip-lines-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-strip-lines* (the-as strip-lines-controls (/ (the-as int arg0) 8))) + ) + (= *display-strip-lines* (/ (the-as int arg0) 8)) + ) + +;; definition for function dm-edit-instance-toggle-pick-func +(defun dm-edit-instance-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (dotimes (s4-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s4-0))) + (when (= (-> a1-1 status) 'active) + (let ((v1-4 (find-instance-by-name-level *edit-instance* a1-1))) + (when v1-4 + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-4 flags) (the-as uint arg0)) + ) + (logtest? (-> v1-4 flags) arg0) + ) + ) + ) + ) + ) + #f + ) + +;; definition for function all-texture-tweak-adjust +;; WARN: Return type mismatch int vs none. +(defun all-texture-tweak-adjust ((arg0 texture-page-dir) (arg1 float)) + (dotimes (s4-0 (-> arg0 length)) + (let ((s3-0 (-> arg0 entries s4-0 page))) + (dotimes (s2-0 (min (-> s3-0 length) (-> arg0 entries s4-0 length))) + (when (-> arg0 entries s4-0 link) + (let ((v1-12 (+ (the-as uint (-> arg0 entries s4-0 link)) (* s2-0 4))) + (s1-0 (-> arg0 entries s4-0 page data s2-0)) + ) + (+! (-> s1-0 uv-dist) arg1) + (+ v1-12 0) + (let ((s0-0 (the-as object (* (-> (dynamic-array-field-access v1-12 next PLACEHOLDER) shader) 16)))) + (while (nonzero? (the-as uint s0-0)) + (adgif-shader-update! (the-as adgif-shader s0-0) s1-0) + (&-> (the-as adgif-shader s0-0) reg-2) + (set! s0-0 (* (-> (the-as adgif-shader s0-0) next shader) 16)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function dm-float-field-tie-rvanish-func +(defun dm-float-field-tie-rvanish-func ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (case (prototype-bucket-type s2-0) + ((instance-tie) + (let* ((f0-0 (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far)) + (f1-2 (- f0-0 (/ 128.0 (-> (the-as prototype-bucket-tie s2-0) tie-rvanish)))) + ) + (let ((f2-1 (-> (the-as prototype-bucket-tie s2-0) dists w))) + (when (= arg1 (debug-menu-msg press)) + (logior! (-> (the-as prototype-bucket-tie s2-0) flags) (prototype-flags vanish)) + (set! f1-2 (fmax (fmin (* 4096.0 arg2) f0-0) (+ 4096.0 f2-1))) + (let ((f0-1 (fmax f0-0 (+ 4096.0 f1-2)))) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-rvanish) (/ 128.0 (- f0-1 f1-2))) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far) f0-1) + ) + ) + ) + (set! f30-0 (* 0.00024414062 f1-2)) + ) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +;; definition for function dm-float-field-tie-vanish-far-func +(defun dm-float-field-tie-vanish-far-func ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (case (prototype-bucket-type s2-0) + ((instance-tie) + (let ((f0-0 (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far))) + (let ((f2-1 (- f0-0 (/ 128.0 (-> (the-as prototype-bucket-tie s2-0) tie-rvanish)))) + (f1-2 (-> (the-as prototype-bucket-tie s2-0) dists w)) + ) + (when (= arg1 (debug-menu-msg press)) + (logior! (-> s2-0 flags) (prototype-flags vanish)) + (set! f0-0 (fmax (* 4096.0 arg2) (+ 4096.0 f2-1))) + (let ((f1-4 (fmax (fmin f2-1 f0-0) (+ 4096.0 f1-2)))) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-rvanish) (/ 128.0 (- f0-0 f1-4))) + ) + (set! (-> (the-as prototype-bucket-tie s2-0) tie-vanish-far) f0-0) + ) + ) + (set! f30-0 (* 0.00024414062 f0-0)) + ) + ) + ) + ) + ) + ) + ) + ) + f30-0 + ) + ) + +;; definition for function dm-bug-report-output-pick-func +(defun dm-bug-report-output-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *bug-report-output-mode* arg0) + ) + (= *bug-report-output-mode* arg0) + ) + +;; definition for function dm-bug-report-report-pick-func +;; WARN: Return type mismatch int vs none. +(defun dm-bug-report-report-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (bug-report-display arg0) + ) + 0 + (none) + ) + +;; definition for function debug-menu-node arg0 name) (-> arg1 name)) + ) + +;; definition for function dm-shader-pick-func +(defun dm-shader-pick-func ((arg0 texture-id) (arg1 debug-menu-msg)) + (if (and (= arg1 (debug-menu-msg press)) + *texture-page-dir* + (-> *texture-page-dir* entries (-> arg0 page) page) + (-> *texture-page-dir* entries (-> arg0 page) link) + (nonzero? (-> *texture-page-dir* entries (-> arg0 page) link next (-> arg0 index))) + ) + (set! *edit-shader* arg0) + ) + (and (nonzero? *edit-shader*) (= arg0 *edit-shader*)) + ) + +;; definition for symbol *shader-pick-menu*, type debug-menu +(define *shader-pick-menu* (the-as debug-menu #f)) + +;; definition for function build-shader-list +;; WARN: Return type mismatch pair vs none. +(defun build-shader-list () + (debug-menu-remove-all-items *shader-pick-menu*) + (when *texture-page-dir* + (dotimes (gp-0 (-> *texture-page-dir* length)) + (let ((s5-0 (-> *texture-page-dir* entries gp-0 page)) + (s4-0 (-> *texture-page-dir* entries gp-0 link)) + ) + (when (and s5-0 s4-0) + (dotimes (s3-0 (-> s5-0 length)) + (when (and (-> s5-0 data s3-0) (nonzero? (-> s4-0 next s3-0))) + (let ((a1-1 (new + 'debug + 'debug-menu-item-flag + (-> s5-0 data s3-0 name) + (logior (shr (shl s3-0 52) 44) (shr (shl gp-0 52) 32)) + dm-shader-pick-func + ) + ) + ) + (debug-menu-append-item *shader-pick-menu* a1-1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> *shader-pick-menu* items) (sort (-> *shader-pick-menu* items) debug-menu-node *level* length)) + (let ((a1-1 (-> *level* level s5-0))) + (when (= (-> a1-1 status) 'active) + (if (find-instance-by-name-level arg0 a1-1) + (set! *edit-instance* arg0) + ) + ) + ) + ) + ) + (the-as basic (and *edit-instance* (string= arg0 *edit-instance*))) + ) + +;; definition for function dm-enable-instance-func +(defun dm-enable-instance-func ((arg0 string) (arg1 debug-menu-msg)) + (let ((s3-0 #f)) + (dotimes (s4-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s4-0))) + (when (= (-> a1-1 status) 'active) + (let ((v1-4 (find-instance-by-name-level arg0 a1-1))) + (when v1-4 + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-4 flags) (prototype-flags disable)) + ) + (set! s3-0 (not (logtest? (-> v1-4 flags) (prototype-flags disable)))) + ) + ) + ) + ) + ) + s3-0 + ) + ) + +;; definition for symbol *instance-shrub-menu*, type debug-menu +(define *instance-shrub-menu* (the-as debug-menu #f)) + +;; definition for symbol *instance-tie-menu*, type debug-menu +(define *instance-tie-menu* (the-as debug-menu #f)) + +;; definition for symbol *enable-instance-shrub-menu*, type debug-menu +(define *enable-instance-shrub-menu* (the-as debug-menu #f)) + +;; definition for symbol *enable-instance-tie-menu*, type debug-menu +(define *enable-instance-tie-menu* (the-as debug-menu #f)) + +;; definition for function build-instance-list +;; WARN: Return type mismatch int vs none. +(defun build-instance-list ((arg0 object)) + (debug-menu-remove-all-items *instance-shrub-menu*) + (debug-menu-remove-all-items *instance-tie-menu*) + (debug-menu-remove-all-items *enable-instance-shrub-menu*) + (debug-menu-remove-all-items *enable-instance-tie-menu*) + (set! *display-instance-info* #f) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-3 (-> *level* level gp-0))) + (when (= (-> v1-3 status) 'active) + (let ((s5-0 (-> v1-3 bsp drawable-trees))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((v1-7 (-> s5-0 trees s4-0))) + (case (-> v1-7 type) + ((drawable-tree-instance-shrub) + (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-4 + (new + 'global + 'debug-menu-item-flag + (-> s3-0 data s2-0 name) + (the-as int (-> s3-0 data s2-0 name)) + dm-instance-pick-func + ) + ) + ) + (debug-menu-append-item *instance-shrub-menu* a1-4) + ) + (let ((a1-6 + (new + 'debug + 'debug-menu-item-flag + (-> s3-0 data s2-0 name) + (the-as int (-> s3-0 data s2-0 name)) + dm-enable-instance-func + ) + ) + ) + (set! (-> a1-6 is-on) #t) + (debug-menu-append-item *enable-instance-shrub-menu* a1-6) + ) + ) + ) + ) + ((drawable-tree-instance-tie) + (let ((s3-1 (-> (the-as drawable-tree-instance-tie v1-7) prototypes prototype-array-tie))) + (dotimes (s2-1 (-> s3-1 length)) + (let ((a1-9 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (the-as int (-> s3-1 array-data s2-1 name)) + dm-instance-pick-func + ) + ) + ) + (debug-menu-append-item *instance-tie-menu* a1-9) + ) + (let ((a1-11 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (the-as int (-> s3-1 array-data s2-1 name)) + dm-enable-instance-func + ) + ) + ) + (set! (-> a1-11 is-on) #t) + (debug-menu-append-item *enable-instance-tie-menu* a1-11) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> *instance-shrub-menu* items) + (sort + (-> *instance-shrub-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *instance-tie-menu* items) + (sort + (-> *instance-tie-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *enable-instance-shrub-menu* items) + (sort + (-> *enable-instance-shrub-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *enable-instance-tie-menu* items) + (sort + (-> *enable-instance-tie-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + 0 + (none) + ) + +;; definition for function dm-scene-load-pick-func +(defun dm-scene-load-pick-func ((arg0 pair) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((s5-0 *display-profile*)) + (play-clean #f) + (set! *display-profile* s5-0) + ) + (set! *debug-menu-scene-play* #t) + (let ((s5-1 (car (cdr arg0)))) + (process-spawn scene-player :init scene-player-init s5-1 #t (car arg0) :name "scene-player") + ) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (set-master-mode 'game) + ) + #f + ) + +;; definition for function debug-create-cam-restore +;; WARN: Return type mismatch object vs none. +(defun debug-create-cam-restore () + (cond + (*math-camera* + (format #t "(defun-debug cam-restore ()~%") + (format #t " ;;this function is a hack, don't use it as an example~%") + (format #t " (let ((pos (new 'stack 'vector))~%") + (format #t " (rot (new 'stack 'matrix)))~%") + (format #t " (set! (-> pos x) ~12F)~%" (-> *math-camera* trans x)) + (format #t " (set! (-> pos y) ~12F)~%" (-> *math-camera* trans y)) + (format #t " (set! (-> pos z) ~12F)~%" (-> *math-camera* trans z)) + (format #t " (set! (-> pos w) 1.0)~%") + (format #t " (set! (-> rot data 0) ~12F)~%" (-> *math-camera* inv-camera-rot rvec x)) + (format #t " (set! (-> rot data 1) ~12F)~%" (-> *math-camera* inv-camera-rot rvec y)) + (format #t " (set! (-> rot data 2) ~12F)~%" (-> *math-camera* inv-camera-rot rvec z)) + (format #t " (set! (-> rot data 3) ~12F)~%" (-> *math-camera* inv-camera-rot rvec w)) + (format #t " (set! (-> rot data 4) ~12F)~%" (-> *math-camera* inv-camera-rot uvec x)) + (format #t " (set! (-> rot data 5) ~12F)~%" (-> *math-camera* inv-camera-rot uvec y)) + (format #t " (set! (-> rot data 6) ~12F)~%" (-> *math-camera* inv-camera-rot uvec z)) + (format #t " (set! (-> rot data 7) ~12F)~%" (-> *math-camera* inv-camera-rot uvec w)) + (format #t " (set! (-> rot data 8) ~12F)~%" (-> *math-camera* inv-camera-rot fvec x)) + (format #t " (set! (-> rot data 9) ~12F)~%" (-> *math-camera* inv-camera-rot fvec y)) + (format #t " (set! (-> rot data 10) ~12F)~%" (-> *math-camera* inv-camera-rot fvec z)) + (format #t " (set! (-> rot data 11) ~12F)~%" (-> *math-camera* inv-camera-rot fvec w)) + (format #t " (set! (-> rot data 12) ~12F)~%" 0) + (format #t " (set! (-> rot data 13) ~12F)~%" 0) + (format #t " (set! (-> rot data 14) ~12F)~%" 0) + (format #t " (set! (-> rot data 15) ~12F)~%" #x3f800000) + (let ((gp-0 (new 'stack-no-clear 'euler-angles))) + (matrix->eul gp-0 (-> *math-camera* inv-camera-rot) 21) + (format #t " ;; euler angles (xyz order degrees) x ~R y ~R z ~R~%" (-> gp-0 x) (-> gp-0 y) (-> gp-0 z)) + (format + #t + " ;; MAYA euler angles (xyz order degrees) x ~R y ~R z ~R~%" + (-> gp-0 x) + (- 32768.0 (-> gp-0 y)) + (-> gp-0 z) + ) + ) + (format #t " (debug-set-camera-pos-rot! pos rot)~%") + (format #t " (send-event *camera* 'set-fov (deg ~f))~%" (* 0.005493164 (-> *math-camera* fov))) + (format #t " (clear *camera-old-level*)~%") + (format #t " (format *camera-old-level* \"~A\")~%" (-> *level* level0 name)) + (let ((t9-31 format) + (a0-31 #t) + (a1-31 " (set! *camera-old-cpu* ~D)~%") + (a2-25 (-> *display* frames (-> *display* last-screen) profile-array data 0)) + ) + (t9-31 a0-31 a1-31 (- (-> a2-25 data 0 end-time) (-> a2-25 data 0 start-time))) + ) + (let ((t9-32 format) + (a0-32 #t) + (a1-32 " (set! *camera-old-vu* ~D)~%") + (a2-29 (-> *display* frames (-> *display* on-screen) profile-array data 1)) + ) + (t9-32 a0-32 a1-32 (- (-> a2-29 data 0 end-time) (-> a2-29 data 0 start-time))) + ) + (compute-memory-usage! (the-as level (-> *level* level)) #f) + (format #t " (set! *camera-old-tfrag-bytes* ~D)~%" (+ (-> *level* level0 mem-usage-block data 1 total) + (-> *level* level0 mem-usage-block data 2 total) + (-> *level* level0 mem-usage-block data 3 total) + (-> *level* level0 mem-usage-block data 4 total) + (-> *level* level0 mem-usage-block data 5 total) + (-> *level* level0 mem-usage-block data 6 total) + (-> *level* level0 mem-usage-block data 7 total) + (-> *level* level0 mem-usage-block data 8 total) + ) + ) + (format #t " (clear *camera-old-stat-string-tfrag*)~%") + (format #t " (clear *camera-old-stat-string-tfrag-near*)~%") + (format #t " (clear *camera-old-stat-string-total*)~%") + (when *stats-poly* + (format #t " (format *camera-old-stat-string-tfrag* \"~S\")~%" *stat-string-tfrag*) + (format #t " (format *camera-old-stat-string-tfrag-near* \"~S\")~%" *stat-string-tfrag-scissor*) + (format #t " (format *camera-old-stat-string-total* \"~S\")~%" *stat-string-total*) + ) + (format #t " (set! *display-camera-old-stats* #t)~%") + (format #t " )~%") + (format #t " )~%") + ) + (else + (format #t "camera save failed~%") + ) + ) + (none) + ) + +;; definition for function debug-menu-make-camera-mode-menu +(defun debug-menu-make-camera-mode-menu ((arg0 debug-menu) (arg1 debug-menu)) + (new 'debug 'debug-menu-item-submenu "Camera" arg0) + (let ((a1-3 (new 'debug 'debug-menu-item-submenu "Mode" arg1))) + (debug-menu-append-item arg0 a1-3) + ) + (let ((a1-5 (new 'debug 'debug-menu-item-flag "Default" (the-as int #f) dm-cam-mode-default))) + (debug-menu-append-item arg1 a1-5) + ) + (let ((a1-7 (new 'debug 'debug-menu-item-flag "Free-floating" (the-as int cam-free-floating) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-7) + ) + (let ((a1-9 (new 'debug 'debug-menu-item-flag "Fixed" (the-as int cam-fixed) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-9) + ) + (let ((a1-11 (new 'debug 'debug-menu-item-flag "No Trans" (the-as int cam-no-trans) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-11) + ) + (let ((a1-13 (new 'debug 'debug-menu-item-flag "Pov" (the-as int cam-pov) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-13) + ) + (let ((a1-15 (new 'debug 'debug-menu-item-flag "Pov180" (the-as int cam-pov180) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-15) + ) + (let ((a1-17 (new 'debug 'debug-menu-item-flag "Pov-track" (the-as int cam-pov-track) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-17) + ) + (let ((a1-19 (new 'debug 'debug-menu-item-flag "Decel" (the-as int cam-decel) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-19) + ) + (let ((a1-21 (new 'debug 'debug-menu-item-flag "Endless fall" (the-as int cam-endlessfall) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-21) + ) + (let ((a1-23 (new 'debug 'debug-menu-item-flag "Eye" (the-as int cam-eye) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-23) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "Stick" (the-as int cam-stick) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-25) + ) + (let ((a1-27 (new 'debug 'debug-menu-item-flag "String" (the-as int cam-string) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-27) + ) + (let ((a1-29 (new 'debug 'debug-menu-item-flag "Standoff" (the-as int cam-standoff) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-29) + ) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Circular" (the-as int cam-circular) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-31) + ) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Look At" (the-as int cam-lookat) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-33) + ) + (let ((a1-35 (new 'debug 'debug-menu-item-flag "Center of world" (the-as int cam-point-watch) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-35) + ) + (let ((a1-37 (new 'debug 'debug-menu-item-flag "Spline" (the-as int cam-spline) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-37) + ) + (let ((a1-39 (new 'debug 'debug-menu-item-flag "Tube Sled" (the-as int cam-tube-sled) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-39) + ) + (let ((a1-41 (new 'debug 'debug-menu-item-flag "Bike" (the-as int cam-bike) dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-41) + ) + ) + +;; definition for function debug-menu-make-camera-menu +(defun debug-menu-make-camera-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Camera menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Camera" gp-0)) + ) + (let ((a1-3 (new 'debug 'debug-menu arg0 "Camera mode menu"))) + (debug-menu-make-camera-mode-menu gp-0 a1-3) + ) + (let ((s3-0 (new 'debug 'debug-menu arg0 "Camera externalize menu"))) + (let ((a1-6 (new 'debug 'debug-menu-item-submenu "External" s3-0))) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((a1-8 (new 'debug 'debug-menu-item-flag "CPad 0" (the-as int 'pad-0) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-8) + ) + (let ((a1-10 (new 'debug 'debug-menu-item-flag "CPad 1" (the-as int 'pad-1) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-10) + ) + (let ((a1-12 (new 'debug 'debug-menu-item-flag "Lock" (the-as int 'locked) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-12) + ) + (let ((a1-14 (new 'debug 'debug-menu-item-flag "Reset" (the-as int 'reset) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-14) + ) + (let ((a1-16 (new 'debug 'debug-menu-item-flag "Allow z rot" (the-as int 'allow-z) dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-16) + ) + (let ((s2-0 (new 'debug 'debug-menu-item-var "Fov" 0 80))) + (debug-menu-item-var-make-float s2-0 dm-cam-render-float 1.0 #t 15.0 180.0 1) + (debug-menu-append-item s3-0 s2-0) + ) + (let ((a1-21 + (new 'debug 'debug-menu-item-flag "turbo free" (the-as int '*camera-turbo-free*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s3-0 a1-21) + ) + ) + (let ((s3-1 (new 'debug 'debug-menu arg0 "Camera collision menu"))) + (let ((a1-24 (new 'debug 'debug-menu-item-submenu "Collision" s3-1))) + (debug-menu-append-item gp-0 a1-24) + ) + (let ((a1-26 (new + 'debug + 'debug-menu-item-flag + "Record" + (the-as int '*record-cam-collide-history*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s3-1 a1-26) + ) + (let ((a1-28 (new + 'debug + 'debug-menu-item-flag + "Display" + (the-as int '*display-cam-collide-history*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s3-1 a1-28) + ) + ) + (let ((s4-1 (new 'debug 'debug-menu arg0 "Camera settings menu"))) + (let ((a1-31 (new 'debug 'debug-menu-item-submenu "Settings" s4-1))) + (debug-menu-append-item gp-0 a1-31) + ) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Default" (the-as int #f) dm-cam-settings-default))) + (debug-menu-append-item s4-1 a1-33) + ) + (let ((a1-35 + (new 'debug 'debug-menu-item-flag "turbo free" (the-as int '*camera-turbo-free*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-35) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "Fov" (the-as int 'fov) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-cam-setting-float) + 1.0 + #t + 15.0 + 180.0 + 1 + ) + (debug-menu-append-item s4-1 s3-2) + ) + (let ((a1-40 (new 'debug 'debug-menu-item-flag "Butt cam" 0 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-40) + ) + (let ((a1-42 (new 'debug 'debug-menu-item-flag "Same side" 1 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-42) + ) + (let ((a1-44 (new 'debug 'debug-menu-item-flag "Move spherical" 2 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-44) + ) + (let ((a1-46 (new 'debug 'debug-menu-item-flag "Drag" 3 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-46) + ) + (let ((a1-48 (new 'debug 'debug-menu-item-flag "Allow Z rot" 4 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-48) + ) + (let ((a1-50 (new 'debug 'debug-menu-item-flag "Pitch for jump" 6 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-50) + ) + (let ((a1-52 (new 'debug 'debug-menu-item-flag "Find hidden target" 7 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-52) + ) + (let ((a1-54 (new 'debug 'debug-menu-item-flag "Collide" 8 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-54) + ) + (let ((a1-56 (new 'debug 'debug-menu-item-flag "Line of Sight" 9 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-56) + ) + (let ((a1-58 (new 'debug 'debug-menu-item-flag "No Rotate" 10 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-58) + ) + (let ((a1-60 (new 'debug 'debug-menu-item-flag "Sticky Angle" 11 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-60) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "Interp Frms" 40 80))) + (debug-menu-item-var-make-int s3-3 dm-cam-settings-func-int 1 #f 0 0 #f) + (debug-menu-append-item s4-1 s3-3) + ) + (let ((a1-65 (new + 'debug + 'debug-menu-item-flag + "no mip/lod correction" + (the-as int '*camera-no-mip-correction*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-65) + ) + (let ((a1-67 (new + 'debug + 'debug-menu-item-flag + "last attacker" + (the-as int '*display-camera-last-attacker*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-67) + ) + (let ((a1-69 (new + 'debug + 'debug-menu-item-flag + "old stats" + (the-as int '*display-camera-old-stats*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-69) + ) + (let ((a1-71 (new 'debug 'debug-menu-item-flag "Amy cam" (the-as int '*amy-cam*) dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-71) + ) + (let ((a1-73 + (new 'debug 'debug-menu-item-flag "xyz axes" (the-as int '*display-xyz-axes*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-73) + ) + (let ((a1-75 (new + 'debug + 'debug-menu-item-flag + "Master Marks" + (the-as int '*display-cam-master-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-75) + ) + (let ((a1-77 + (new 'debug 'debug-menu-item-flag "Other Marks" (the-as int '*display-cam-other*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-77) + ) + (let ((a1-79 (new + 'debug + 'debug-menu-item-flag + "los debug" + (the-as int '*display-cam-los-debug*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-79) + ) + (let ((a1-81 + (new 'debug 'debug-menu-item-flag "los info" (the-as int '*display-cam-los-info*) dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-81) + ) + (let ((a1-83 (new + 'debug + 'debug-menu-item-flag + "los Marks" + (the-as int '*display-cam-los-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-83) + ) + (let ((a1-85 (new + 'debug + 'debug-menu-item-flag + "coll Marks" + (the-as int '*display-cam-coll-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-85) + ) + (let ((a1-87 (new + 'debug + 'debug-menu-item-flag + "Camera Marks" + (the-as int '*display-camera-marks*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-87) + ) + ) + (let ((a1-89 (new + 'debug + 'debug-menu-item-flag + "Edit" + (the-as int '*cam-layout*) + (lambda ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if (-> arg0 value) + (cam-layout-stop) + (cam-layout-start) + ) + ) + (-> arg0 value) + ) + ) + ) + ) + (debug-menu-append-item gp-0 a1-89) + ) + (let ((a1-91 (new + 'debug + 'debug-menu-item-function + "Save Pos" + (the-as int #f) + (the-as (function object object) debug-create-cam-restore) + ) + ) + ) + (debug-menu-append-item gp-0 a1-91) + ) + s5-0 + ) + ) + +;; definition for function debug-menu-make-shader-menu +(defun debug-menu-make-shader-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Shader menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Shader" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Shader pick menu"))) + (set! *shader-pick-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shader" a3-3))) + (debug-menu-append-item gp-0 a1-4) + ) + ) + (let ((a1-6 (new + 'debug + 'debug-menu-item-function + "Refresh" + (the-as int #f) + (the-as (function object object) build-shader-list) + ) + ) + ) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((s4-1 (new 'debug 'debug-menu-item-var "tweak" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-float + s4-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((s4-0 (the-as texture-id (-> arg0 value))) + (gp-0 (lookup-texture-by-id s4-0)) + (v1-3 (-> *texture-page-dir* entries (-> s4-0 page) link)) + ) + (cond + ((and gp-0 v1-3) + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 uv-dist) arg2) + (let ((s5-1 (the-as object (* (-> v1-3 next (-> s4-0 index) shader) 16)))) + (while (nonzero? (the-as uint s5-1)) + (adgif-shader-update! (the-as adgif-shader s5-1) gp-0) + (set! s5-1 (* (-> (the-as adgif-shader s5-1) next shader) 16)) + ) + ) + ) + (-> gp-0 uv-dist) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + 0.1 + #t + 0.1 + 30.0 + 1 + ) + (debug-menu-append-item gp-0 s4-1) + ) + (let ((a1-11 (new + 'debug + 'debug-menu-item-function + "all tweak+" + (the-as int #f) + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* 0.1))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((a1-13 (new + 'debug + 'debug-menu-item-function + "all tweak-" + (the-as int #f) + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* -0.1))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-13) + ) + (let ((s4-2 (new 'debug 'debug-menu-item-var "l" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-2 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 l) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 l) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #f + ) + (debug-menu-append-item gp-0 s4-2) + ) + (let ((s4-3 (new 'debug 'debug-menu-item-var "k" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-3 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 k) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (sar (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex1))) 20) 52) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + -2048 + 2047 + #f + ) + (debug-menu-append-item gp-0 s4-3) + ) + (let ((s4-4 (new 'debug 'debug-menu-item-var "mmin" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-4 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmin) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmin) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 5 + #t + ) + (debug-menu-append-item gp-0 s4-4) + ) + (let ((s4-5 (new 'debug 'debug-menu-item-var "mmag" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-5 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmag) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmag) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-5) + ) + (let ((s4-6 (new 'debug 'debug-menu-item-var "lcm" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-6 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 lcm) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 lcm) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-6) + ) + (let ((s4-7 (new 'debug 'debug-menu-item-var "tfx" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-7 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tfx) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 27) 62) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-7) + ) + (let ((s4-8 (new 'debug 'debug-menu-item-var "tbp" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-8 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbp0) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbp0) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + #x4000 + #t + ) + (debug-menu-append-item gp-0 s4-8) + ) + (let ((s4-9 (new 'debug 'debug-menu-item-var "tbw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-9 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 15 + #t + ) + (debug-menu-append-item gp-0 s4-9) + ) + (let ((s4-10 (new 'debug 'debug-menu-item-var "tw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-10 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-10) + ) + (let ((s4-11 (new 'debug 'debug-menu-item-var "th" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-11 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 th) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 30) 60) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-11) + ) + (let ((s4-12 (new 'debug 'debug-menu-item-var "mxl" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-12 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mxl) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mxl) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 6 + #t + ) + (debug-menu-append-item gp-0 s4-12) + ) + (let ((s4-13 (new 'debug 'debug-menu-item-var "wms" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-13 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wms) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wms) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-13) + ) + (let ((s4-14 (new 'debug 'debug-menu-item-var "wmt" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-14 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wmt) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wmt) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-14) + ) + (let ((s4-15 (new 'debug 'debug-menu-item-var "minu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-15 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp minu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-15) + ) + (let ((s4-16 (new 'debug 'debug-menu-item-var "maxu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-16 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp maxu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-16) + ) + (let ((s4-17 (new 'debug 'debug-menu-item-var "minv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-17 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minv) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 30) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-17) + ) + (let ((s4-18 (new 'debug 'debug-menu-item-var "maxv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-18 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxv) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 20) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-18) + ) + s5-0 + ) + ) + +;; definition for function debug-menu-make-instance-menu +(defun debug-menu-make-instance-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Instance menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Instance" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Instance shrub menu"))) + (set! *instance-shrub-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shrub" a3-3))) + (debug-menu-append-item gp-0 a1-4) + ) + ) + (let ((a3-5 (new 'debug 'debug-menu arg0 "Instance tie menu"))) + (set! *instance-tie-menu* a3-5) + (let ((a1-7 (new 'debug 'debug-menu-item-submenu "Pick Tie" a3-5))) + (debug-menu-append-item gp-0 a1-7) + ) + ) + (let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" (the-as int #f) build-instance-list))) + (debug-menu-append-item gp-0 a1-9) + ) + (let ((a1-11 (new + 'debug + 'debug-menu-item-function + "Print Info" + (the-as int #f) + (the-as (function object object) print-prototype-list) + ) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-0 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> s2-0 dists x) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields s2-0) + ) + (set! f30-0 (* 0.00024414062 (-> s2-0 dists x))) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-0) + ) + (let ((s3-1 (new 'debug 'debug-menu-item-var "far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((f30-0 arg3)) + (dotimes (s3-0 (-> *level* length)) + (let ((a1-1 (-> *level* level s3-0))) + (when (= (-> a1-1 status) 'active) + (let ((s2-0 (find-instance-by-name-level (the-as string (-> arg0 value)) a1-1))) + (when s2-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> s2-0 dists w) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields s2-0) + ) + (set! f30-0 (* 0.00024414062 (-> s2-0 dists w))) + ) + ) + ) + ) + ) + f30-0 + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-1) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "tie vanish near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-rvanish-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-2) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "tie vanish far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-3 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-vanish-far-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-3) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "invisible" 1 dm-edit-instance-toggle-pick-func))) + (debug-menu-append-item gp-0 a1-25) + ) + (let ((a3-18 (new 'debug 'debug-menu arg0 "Enable Instance Shrub Menu"))) + (set! *enable-instance-shrub-menu* a3-18) + (let ((a1-28 (new 'debug 'debug-menu-item-submenu "Enable Shrub" a3-18))) + (debug-menu-append-item gp-0 a1-28) + ) + ) + (let ((a3-20 (new 'debug 'debug-menu arg0 "Enable Instance Tie Menu"))) + (set! *enable-instance-tie-menu* a3-20) + (let ((a1-31 (new 'debug 'debug-menu-item-submenu "Enable Tie" a3-20))) + (debug-menu-append-item gp-0 a1-31) + ) + ) + (let ((a1-33 (new + 'debug + 'debug-menu-item-flag + "Instance Info" + (the-as int '*display-instance-info*) + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item gp-0 a1-33) + ) + s5-0 + ) + ) + +;; definition for function dm-task-menu-pick-func +(defun dm-task-menu-pick-func ((arg0 game-task) (arg1 debug-menu-msg)) + (let ((gp-0 (/ (the-as int arg0) 8))) + (when (= arg1 (debug-menu-msg press)) + (cond + ((cpad-hold? 0 l1) + (task-node-open! (the-as game-task-node gp-0) 'menu) + ) + (else + (let ((t9-1 task-node-close!) + (a0-2 gp-0) + ) + 'menu + (t9-1 (the-as game-task-node a0-2)) + ) + ) + ) + ) + (if (and (not (task-node-closed? (the-as game-task-node gp-0))) + (not (task-node-open? (the-as game-task-node gp-0))) + ) + (return 'invalid) + ) + (task-node-closed? (the-as game-task-node gp-0)) + ) + ) + +;; definition for function debug-menu-make-continue-sub-menu +;; INFO: Used lq/sq +(defun debug-menu-make-continue-sub-menu ((arg0 game-info) (arg1 symbol)) + (local-vars + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 string) + (sv-208 symbol) + (sv-224 type) + ) + (let ((s4-0 *level-load-list*) + (s5-0 '()) + ) + (while (not (null? s4-0)) + (let ((v1-1 (-> (the-as symbol (car s4-0)) value))) + (when (or (= arg1 'test) (= (-> (the-as level-load-info v1-1) taskname) arg1)) + (let ((s3-0 (-> (the-as level-load-info v1-1) continues))) + (while (not (null? s3-0)) + (let ((v1-2 (car s3-0)) + (a0-5 arg1) + ) + (when (if (= a0-5 'test) + (logtest? (continue-flags continue-flag-16) (-> (the-as continue-point v1-2) flags)) + #t + ) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> (the-as continue-point v1-2) name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (-> (the-as continue-point v1-2) name)) + (let* ((a3-1 (cons 'dm-current-continue '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! s5-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) s5-0)) + ) + ) + ) + ) + (set! s3-0 (cdr s3-0)) + ) + ) + ) + ) + (set! s4-0 (cdr s4-0)) + ) + (let ((s4-1 s5-0) + (s5-1 '()) + ) + (let ((a2-6 (car s4-1))) + (while (not (null? s4-1)) + (set! s5-1 (cons a2-6 s5-1)) + (set! s4-1 (cdr s4-1)) + (set! a2-6 (car s4-1)) + ) + ) + (let ((s4-2 (method-of-type pair new)) + (s3-1 'global) + (s2-1 pair) + (s1-1 'menu) + (s0-1 (method-of-type pair new)) + ) + (set! sv-208 'global) + (set! sv-224 pair) + (let ((a2-7 (symbol->string-debug arg1)) + (a3-6 s5-1) + ) + (s4-2 s3-1 s2-1 s1-1 (s0-1 sv-208 sv-224 a2-7 a3-6)) + ) + ) + ) + ) + ) + +;; definition for function debug-menu-make-task-sub-menu +;; INFO: Used lq/sq +(defun debug-menu-make-task-sub-menu ((arg0 symbol)) + (local-vars + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 int) + (sv-208 symbol) + (sv-224 type) + ) + (let ((gp-0 '())) + (let ((s4-0 (-> *game-info* sub-task-list))) + (countdown (s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((v1-4 (-> s4-0 s3-0))) + (when (= (-> v1-4 level) arg0) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> v1-4 name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (* s3-0 8)) + (let* ((a3-1 (cons 'dm-task-menu-pick-func '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! gp-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) gp-0)) + ) + ) + ) + ) + ) + ) + ) + (let ((s4-1 (method-of-type pair new)) + (s3-1 'global) + (s2-1 pair) + (s1-1 'menu) + (s0-1 (method-of-type pair new)) + ) + (set! sv-208 'global) + (set! sv-224 pair) + (let ((a2-5 (symbol->string-debug arg0)) + (a3-5 gp-0) + ) + (s4-1 s3-1 s2-1 s1-1 (s0-1 sv-208 sv-224 a2-5 a3-5)) + ) + ) + ) + ) + +;; definition for function debug-menu-make-task-menu +;; INFO: Used lq/sq +(defun debug-menu-make-task-menu ((arg0 debug-menu-context)) + (local-vars (sv-16 debug-menu-context)) + (let* ((s5-0 (new 'debug 'debug-menu arg0 "Task menu")) + (s4-0 (new 'debug 'debug-menu-item-submenu "Task" s5-0)) + ) + (let* ((s3-0 '(city + comb + desert + factory + forest + mine + nest + palace + sewer + wascity + arena + temple + tower + volcano + precursor + default + test + ) + ) + (a0-3 (car s3-0)) + ) + (while (not (null? s3-0)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s5-0) + (s0-0 debug-menu-make-from-template) + ) + (set! sv-16 arg0) + (let ((a1-2 (debug-menu-make-task-sub-menu (the-as symbol a0-3)))) + (s2-0 s1-0 (s0-0 sv-16 a1-2)) + ) + ) + (set! s3-0 (cdr s3-0)) + (set! a0-3 (car s3-0)) + ) + ) + s4-0 + ) + ) + +;; definition for function dm-play-task-with-continue +;; WARN: Return type mismatch int vs object. +(defun dm-play-task-with-continue ((arg0 game-task) (arg1 string)) + (let* ((t9-0 play-task) + (a1-1 'debug) + (a2-0 (cond + ((cpad-hold? 0 l1) + 'pre-play + ) + ((cpad-hold? 0 r1) + 'kiosk + ) + ) + ) + (a1-2 (t9-0 arg0 a1-1 a2-0)) + ) + (if arg1 + (set! a1-2 arg1) + ) + (start 'play (get-continue-by-name *game-info* a1-2)) + ) + (set-master-mode 'game) + 0 + ) + +;; definition for function dm-play-task +(defun dm-play-task ((arg0 game-task)) + (dm-play-task-with-continue (the-as game-task (/ (the-as int arg0) 8)) (the-as string #f)) + ) + +;; definition for function dm-play-race +(defun dm-play-race ((arg0 race-selection) (arg1 symbol)) + (let ((s5-0 (the-as string #f)) + (gp-0 0) + ) + (case arg0 + (((race-selection desertb-race-record)) + (set! gp-0 15) + (set! s5-0 "desertb-race-record") + ) + (((race-selection rs1)) + (set! gp-0 131) + (set! s5-0 "desertb-race-record") + ) + (((race-selection desrally-record)) + (set! gp-0 132) + (set! s5-0 "desrally-record") + ) + ) + (if (not arg1) + (set! s5-0 (the-as string #f)) + ) + (format #t "dm-play-race starting task ~d continue ~s~%" gp-0 s5-0) + (if (nonzero? gp-0) + (dm-play-task-with-continue (the-as game-task gp-0) s5-0) + ) + ) + ) + +;; definition for function debug-menu-make-play-menu +;; INFO: Used lq/sq +(defun debug-menu-make-play-menu ((arg0 debug-menu-context)) + (local-vars + (sv-16 type) + (sv-32 (function symbol type object object pair)) + (sv-48 symbol) + (sv-64 type) + (sv-80 symbol) + (sv-96 (function symbol type object object pair)) + (sv-112 symbol) + (sv-128 type) + (sv-144 string) + (sv-160 (function symbol type object object pair)) + (sv-176 symbol) + (sv-192 type) + (sv-208 symbol) + (sv-224 type) + (sv-240 (function symbol type object object pair)) + (sv-256 symbol) + (sv-272 type) + (sv-288 symbol) + (sv-304 (function symbol type object object pair)) + (sv-320 symbol) + (sv-336 type) + (sv-352 (function symbol type object object pair)) + (sv-368 symbol) + (sv-384 type) + (sv-400 int) + (sv-416 type) + (sv-432 symbol) + (sv-448 (function symbol type object object pair)) + (sv-464 symbol) + (sv-480 type) + (sv-496 string) + (sv-512 (function symbol type object object pair)) + (sv-528 symbol) + (sv-544 type) + (sv-560 symbol) + ) + (let ((s5-0 '())) + (let ((s2-0 #x200000)) + (countdown (s4-0 (-> *game-info* play-list length)) + (let ((s3-0 (-> *game-info* play-list s4-0))) + (when (-> s3-0 play-continue) + (let ((s1-0 + (logand (game-task-node-flag act1 act2 act3 bbush) (-> *game-info* sub-task-list (-> s3-0 play-node) flags)) + ) + ) + (when (!= s1-0 s2-0) + (let ((s2-1 (method-of-type pair new)) + (s0-0 'global) + ) + (set! sv-16 pair) + (set! sv-32 (method-of-type pair new)) + (set! sv-48 'global) + (set! sv-64 pair) + (set! sv-80 'function) + (set! sv-96 (method-of-type pair new)) + (set! sv-112 'global) + (set! sv-128 pair) + (cond + ((logtest? (game-task-node-flag act3) s1-0) + (set! sv-144 "=== Burning Bush ===") + ) + ((logtest? (game-task-node-flag act2) s1-0) + (set! sv-144 "====== ACT 3 ======") + ) + ((logtest? (game-task-node-flag act1) s1-0) + (set! sv-144 "====== ACT 2 ======") + ) + (else + (set! sv-144 "======= END =======") + ) + ) + (set! sv-160 (method-of-type pair new)) + (set! sv-176 'global) + (set! sv-192 pair) + (set! sv-208 (the-as symbol #f)) + (let* ((a3-1 (cons 'nothing '())) + (a3-2 (sv-160 sv-176 sv-192 sv-208 a3-1)) + (a3-3 (sv-96 sv-112 sv-128 sv-144 a3-2)) + (a2-4 (sv-32 sv-48 sv-64 sv-80 a3-3)) + ) + (set! s5-0 (s2-1 s0-0 sv-16 a2-4 s5-0)) + ) + ) + (set! s2-0 (the-as int s1-0)) + ) + ) + (let ((s1-1 (method-of-type pair new)) + (s0-1 'global) + ) + (set! sv-224 pair) + (set! sv-240 (method-of-type pair new)) + (set! sv-256 'global) + (set! sv-272 pair) + (set! sv-288 'function) + (set! sv-304 (method-of-type pair new)) + (set! sv-320 'global) + (set! sv-336 pair) + (let ((s3-1 (-> s3-0 name))) + (set! sv-352 (method-of-type pair new)) + (set! sv-368 'global) + (set! sv-384 pair) + (set! sv-400 (* s4-0 8)) + (let* ((a3-6 (cons 'dm-play-task '())) + (a3-7 (sv-352 sv-368 sv-384 sv-400 a3-6)) + (a3-8 (sv-304 sv-320 sv-336 s3-1 a3-7)) + (a2-9 (sv-240 sv-256 sv-272 sv-288 a3-8)) + (a3-9 s5-0) + ) + (set! s5-0 (s1-1 s0-1 sv-224 a2-9 a3-9)) + ) + ) + ) + ) + ) + ) + ) + (let ((s4-1 (method-of-type pair new)) + (s3-2 'global) + (s2-2 pair) + (s1-2 (method-of-type pair new)) + (s0-2 'global) + ) + (set! sv-416 pair) + (set! sv-432 'function) + (set! sv-448 (method-of-type pair new)) + (set! sv-464 'global) + (set! sv-480 pair) + (set! sv-496 "====== ACT 1 ======") + (set! sv-512 (method-of-type pair new)) + (set! sv-528 'global) + (set! sv-544 pair) + (set! sv-560 (the-as symbol #f)) + (let* ((a3-11 (cons 'nothing '())) + (a3-12 (sv-512 sv-528 sv-544 sv-560 a3-11)) + (a3-13 (sv-448 sv-464 sv-480 sv-496 a3-12)) + (a3-15 (s4-1 s3-2 s2-2 (s1-2 s0-2 sv-416 sv-432 a3-13) s5-0)) + ) + (debug-menu-make-from-template arg0 (cons 'menu (cons "Play" a3-15))) + ) + ) + ) + ) + +;; definition for function dm-anim-tester-flag-func +(defun dm-anim-tester-flag-func ((arg0 int) (arg1 debug-menu-msg)) + (when *anim-tester* + (case arg0 + (('at-apply-align) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5)) + ) + (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt5))) + ) + (('at-show-joint-info) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4)) + ) + (return (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt4))) + ) + ) + ) + #f + ) + +;; definition for function dm-anim-tester-func +(defun dm-anim-tester-func ((arg0 int) (arg1 debug-menu-msg)) + (local-vars (v0-1 symbol)) + (if (not *anim-tester*) + (anim-tester-start) + ) + (when *anim-tester* + (cond + ((= arg0 'at-pick-object) + (send-event (ppointer->process *anim-tester*) 'pick-object) + (set! v0-1 #t) + (set! (-> *debug-menu-context* is-hidden) v0-1) + v0-1 + ) + ((= arg0 'at-pick-joint-anim) + (send-event (ppointer->process *anim-tester*) 'pick-joint-anim) + (set! v0-1 #t) + (set! (-> *debug-menu-context* is-hidden) v0-1) + v0-1 + ) + ) + ) + ) + +;; definition for function dm-pilot-mode +(defun dm-pilot-mode ((arg0 object)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'pilot #f arg0 #t) + ) + +;; definition for function stop-watch-display +(defun stop-watch-display ((arg0 object) (arg1 object)) + (let ((v1-3 (- (-> *display* base-clock frame-counter) (-> *game-info* stop-watch-start)))) + (format arg1 "Stop watch ~D:~D:~D~%" (/ v1-3 #x4650) (/ (mod v1-3 #x4650) 300) (/ (* 100 (mod v1-3 300)) 300)) + ) + #f + ) + +;; definition for function debug-menu-context-make-default-menus +;; INFO: Used lq/sq +(defun debug-menu-context-make-default-menus ((arg0 debug-menu-context)) + (local-vars (sv-16 debug-menu-context)) + (let ((s5-0 (new 'debug 'debug-menu arg0 "Main menu"))) + (debug-menu-context-set-root-menu arg0 s5-0) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Artist" + (flag "Poly Stats" *stats-poly* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + (flag "Level 6" 6 dm-stats-memory-func) + (flag "Level 7" 7 dm-stats-memory-func) + (flag "Level 8" 8 dm-stats-memory-func) + (flag "Level 9" 9 dm-stats-memory-func) + ) + (flag "All Visible" *artist-all-visible* dm-boolean-toggle-pick-func) + (flag "Flip Visible" *artist-flip-visible* dm-boolean-toggle-pick-func) + (flag "Fix Visible" *artist-fix-visible* dm-boolean-toggle-pick-func) + (flag "Fix Frustum" *artist-fix-frustum* dm-boolean-toggle-pick-func) + (flag "Manual Sample Point" *manual-sample-point* dm-boolean-toggle-pick-func) + (flag "Error Spheres" *artist-error-spheres* dm-boolean-toggle-pick-func) + (flag "Use menu subdiv" *artist-use-menu-subdiv* dm-boolean-toggle-pick-func) + (float-var "Subdiv Close" close dm-subdiv-float 10 1 #t 1 1000 1) + (float-var "Subdiv Far" far dm-subdiv-float 10 1 #t 1 1000 1) + (function + "Target Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + (function "Target Stop" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (stop 'debug))) + (menu + "Anim Tester" + (int-var "Speed" anim-speed dm-subdiv-int 10 10 #t -300 1000) + (flag "Apply Align" at-apply-align dm-anim-tester-flag-func) + (flag "Show Joint Inf" at-show-joint-info dm-anim-tester-flag-func) + (function "Pick Object" at-pick-object dm-anim-tester-func) + (function "Pick Joint Anim" at-pick-joint-anim dm-anim-tester-func) + (function "Pick Sequence" at-pick-sequence dm-anim-tester-func) + (function "Save Sequences" at-save-sequences dm-anim-tester-func) + ) + (flag "Show Entity Errors" *display-entity-errors* dm-boolean-toggle-pick-func) + (flag "Capture Mode" *display-capture-mode* dm-boolean-toggle-pick-func) + (flag "Sprite Info" *display-sprite-info* dm-boolean-toggle-pick-func) + (flag "Sprite Marks" *display-sprite-marks* dm-boolean-toggle-pick-func) + (flag "Sprite Spheres" *display-sprite-spheres* dm-boolean-toggle-pick-func) + (flag "Time of Day" #f dm-time-of-day-pick-func) + (flag "Preload Anims" *preload-spool-anims* dm-boolean-toggle-pick-func) + (function + "Mike F" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (debug-actor "drill-crane-14") + (send-event *debug-actor* 'die) + ) + ) + (function + "Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :name "editable-player" :to *entity-pool*) + (set-master-mode 'game) + ) + ) + (flag + "Screen shot highres enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* highres-enable) (not (-> *screen-shot-work* highres-enable))) + ) + (-> *screen-shot-work* highres-enable) + ) + ) + (flag + "Screen shot hud enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* hud-enable) (not (-> *screen-shot-work* hud-enable))) + ) + (-> *screen-shot-work* hud-enable) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Game" + (function + "New Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + (function + "New Life" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (initialize! *game-info* 'dead (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + (function + "Kill Target" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* mode) 'play) + (send-event + *target* + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'death)) + ) + ) + ) + ) + (function + "Hit Target" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* mode) 'play) + (send-event + *target* + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0)) + ) + ) + ) + ) + (function + "Reset Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f) (the-as resetter-spec #f)) + ) + ) + (function "Reset Actors" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (reset-actors 'debug))) + (function + "Save Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (auto-save-command 'save 0 0 *default-pool* #f)) + ) + (function + "Load Game" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (auto-save-command 'restore 0 0 *default-pool* #f)) + ) + (function + "Manager Complete" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (script-eval '(send-event *task-manager* 'complete))) + ) + (flag "Target" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + *target* + ) + ) + (flag "Game Mode" play dm-game-mode-pick-func) + (flag "Debug Mode" debug dm-game-mode-pick-func) + (function + "Stop Watch Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (remove-by-param0 *debug-engine* stop-watch-display) + (add-connection *debug-engine* *dproc* stop-watch-display *dproc* *stdcon0* #f) + (set! (-> *game-info* stop-watch-start) (-> *display* base-clock frame-counter)) + (set! (-> *game-info* stop-watch-stop) 0) + (format #t "Stop watch started!~%") + ) + ) + (function + "Stop Watch Stop" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (remove-by-param0 *debug-engine* stop-watch-display) + (set! (-> *game-info* stop-watch-stop) (-> *display* base-clock frame-counter)) + (let ((v1-7 (- (-> *game-info* stop-watch-stop) (-> *game-info* stop-watch-start)))) + (format + #t + "Stop watch elasped time was ~D:~D:~D~%" + (/ v1-7 #x4650) + (/ (mod v1-7 #x4650) 300) + (/ (* 100 (mod v1-7 300)) 300) + ) + ) + ) + ) + (function + "Continue Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (start 'play (-> *game-info* current-continue))) + ) + (function + "Kiosk Reset" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (auto-save-command 'restore 0 0 *default-pool* #f)) + ) + (menu + "Secrets" + (flag "hero-mode" 0 dm-game-secret-toggle-pick-func) + (flag "toggle-beard" 14 dm-game-secret-toggle-pick-func) + (flag "hflip-screen" 15 dm-game-secret-toggle-pick-func) + (flag "endless-ammo" 16 dm-game-secret-toggle-pick-func) + (flag "invulnerable" 17 dm-game-secret-toggle-pick-func) + (flag "endless-dark" 18 dm-game-secret-toggle-pick-func) + (flag "endless-light" 19 dm-game-secret-toggle-pick-func) + (flag "scene-player-1" 1 dm-game-secret-toggle-pick-func) + (flag "scene-player-2" 2 dm-game-secret-toggle-pick-func) + (flag "scene-player-3" 3 dm-game-secret-toggle-pick-func) + (flag "level-select-1" 5 dm-game-secret-toggle-pick-func) + (flag "level-select-2" 6 dm-game-secret-toggle-pick-func) + (flag "level-select-3" 7 dm-game-secret-toggle-pick-func) + (flag "scrap-book-1" 8 dm-game-secret-toggle-pick-func) + (flag "scrap-book-2" 9 dm-game-secret-toggle-pick-func) + (flag "scrap-book-3" 10 dm-game-secret-toggle-pick-func) + (flag "gungame-blue" 20 dm-game-secret-toggle-pick-func) + (flag "gungame-dark" 21 dm-game-secret-toggle-pick-func) + (flag "gungame-ratchet" 22 dm-game-secret-toggle-pick-func) + (flag "big-head" 23 dm-game-secret-toggle-pick-func) + (flag "little-head" 24 dm-game-secret-toggle-pick-func) + (flag "fast-movie" 25 dm-game-secret-toggle-pick-func) + (flag "slow-movie" 26 dm-game-secret-toggle-pick-func) + (flag "unlimited-turbos" 27 dm-game-secret-toggle-pick-func) + (flag "vehicle-hit-points" 28 dm-game-secret-toggle-pick-func) + (flag "board-fast" 29 dm-game-secret-toggle-pick-func) + (flag "vehicle-fox" 30 dm-game-secret-toggle-pick-func) + (flag "vehicle-mirage" 31 dm-game-secret-toggle-pick-func) + (flag "vehicle-x-ride" 32 dm-game-secret-toggle-pick-func) + (flag "model-viewer-1" 11 dm-game-secret-toggle-pick-func) + (flag "model-viewer-2" 12 dm-game-secret-toggle-pick-func) + (flag "model-viewer-3" 13 dm-game-secret-toggle-pick-func) + (flag "kleever-diaper" 33 dm-game-secret-toggle-pick-func) + (flag "bad-weather" 34 dm-game-secret-toggle-pick-func) + (flag "fast-weather" 35 dm-game-secret-toggle-pick-func) + (flag "daxter-pants" 36 dm-game-secret-toggle-pick-func) + (flag "darkjak-tracking" 37 dm-game-secret-toggle-pick-func) + (flag "commentary" 4 dm-game-secret-toggle-pick-func) + (flag "jak-is-jak2" 38 dm-game-secret-toggle-pick-func) + (flag "button-invis" 40 dm-game-secret-toggle-pick-func) + (flag "statistics" 39 dm-game-secret-toggle-pick-func) + (flag "gun-dark-4" 41 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-red-1" 42 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-red-2" 43 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-red-3" 44 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-yellow-1" 45 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-yellow-2" 46 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-yellow-3" 47 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-blue-1" 48 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-blue-2" 49 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-blue-3" 50 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-dark-1" 51 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-dark-2" 52 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-dark-3" 53 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-red" 54 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-yellow" 55 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-blue" 56 dm-game-secret-toggle-pick-func) + (flag "gun-upgrade-ammo-dark" 57 dm-game-secret-toggle-pick-func) + ) + (function "Print Load State" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (dotimes (gp-0 11) + (let ((s5-0 (-> *level* level gp-0))) + (if (!= (-> s5-0 status) 'inactive) + (format + #t + "~Tlevel ~2D ~16S ~16S bits #b~18,'0B ~A~%" + gp-0 + (-> s5-0 name) + (if (nonzero? (-> s5-0 info)) + (level-memory-mode->string (-> s5-0 info memory-mode)) + ) + (-> s5-0 memory-mask) + (-> s5-0 status) + ) + ) + ) + ) + #t + ) + ) + (menu "Continue") + (menu + "Settings" + (float-var + "sfx-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default sfx-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default sfx-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "ambient-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default ambient-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default ambient-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "music-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default music-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default music-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "dialog-volume" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default dialog-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default dialog-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "contrast" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default contrast) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default contrast) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + (new 'static 'bfloat :data 0.25) + (new 'static 'bfloat :data 1.0) + 0 + ) + (float-var + "brightness" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default brightness) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0 + ) + (else + (-> *setting-control* user-default brightness) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + (new 'static 'bfloat :data 0.25) + (new 'static 'bfloat :data 1.0) + 0 + ) + (function + "reset contrast and brightness" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *setting-control* user-default contrast) 0.5) + (set! (-> *setting-control* user-default brightness) 0.5) + ) + ) + (menu + "Language" + (flag "english" 0 dm-setting-language) + (flag "french" 1 dm-setting-language) + (flag "german" 2 dm-setting-language) + (flag "spanish" 3 dm-setting-language) + (flag "italian" 4 dm-setting-language) + (flag "korean" 7 dm-setting-language) + (flag "russian" 8 dm-setting-language) + (flag "portuguese" 9 dm-setting-language) + (flag "uk-english" 11 dm-setting-language) + ) + (menu + "Audio Language" + (flag "english" 0 dm-setting-audio-language) + (flag "french" 1 dm-setting-audio-language) + (flag "german" 2 dm-setting-audio-language) + (flag "spanish" 3 dm-setting-audio-language) + (flag "italian" 4 dm-setting-audio-language) + (flag "commentary" 5 dm-setting-audio-language) + ) + (menu + "Subtitle Language" + (flag "english" 0 dm-setting-subtitle-language) + (flag "french" 1 dm-setting-subtitle-language) + (flag "german" 2 dm-setting-subtitle-language) + (flag "spanish" 3 dm-setting-subtitle-language) + (flag "italian" 4 dm-setting-subtitle-language) + (flag "korean" 7 dm-setting-subtitle-language) + (flag "russian" 8 dm-setting-subtitle-language) + (flag "portuguese" 9 dm-setting-subtitle-language) + (flag "uk-english" 11 dm-setting-subtitle-language) + ) + (flag + "play-hints " + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default play-hints) (not (-> *setting-control* user-default play-hints))) + ) + (-> *setting-control* user-default play-hints) + ) + ) + (flag + "subtitle " + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) + ) + (-> *setting-control* user-default subtitle) + ) + ) + (flag + "vibration" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default vibration) (not (-> *setting-control* user-default vibration))) + ) + (-> *setting-control* user-default vibration) + ) + ) + (menu + "Stereo Mode" + (flag "mono" 0 dm-setting-stereo-mode) + (flag "stereo" 1 dm-setting-stereo-mode) + (flag "surround" 2 dm-setting-stereo-mode) + ) + (flag + "camera-stick-dir" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default camera-stick-dir) + (not (-> *setting-control* user-default camera-stick-dir)) + ) + ) + (-> *setting-control* user-default camera-stick-dir) + ) + ) + (flag + "progressive-scan" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default set-video-mode) + (not (-> *setting-control* user-default set-video-mode)) + ) + ) + (-> *setting-control* user-default set-video-mode) + ) + ) + (flag + "border-mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default border-mode) (not (-> *setting-control* user-default border-mode))) + (set! (-> *level* play?) (-> *setting-control* user-default border-mode)) + ) + (-> *setting-control* user-default border-mode) + ) + ) + ) + (menu + "Features" + (flag "armor0" 52 dm-game-feature-toggle-pick-func) + (flag "armor1" 53 dm-game-feature-toggle-pick-func) + (flag "armor2" 54 dm-game-feature-toggle-pick-func) + (flag "armor3" 55 dm-game-feature-toggle-pick-func) + (flag "artifact-invis" 51 dm-game-feature-toggle-pick-func) + (flag "board" 18 dm-game-feature-toggle-pick-func) + (flag "board-training" 36 dm-game-feature-toggle-pick-func) + (flag "board-launch" 37 dm-game-feature-toggle-pick-func) + (flag "board-zap" 39 dm-game-feature-toggle-pick-func) + (flag "board-trail" 38 dm-game-feature-toggle-pick-func) + (flag "carry" 19 dm-game-feature-toggle-pick-func) + (flag "sidekick" 20 dm-game-feature-toggle-pick-func) + (flag "darkeco" 58 dm-game-feature-toggle-pick-func) + (flag "darkjak" 40 dm-game-feature-toggle-pick-func) + (flag "darkjak-smack" 41 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb0" 42 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb1" 43 dm-game-feature-toggle-pick-func) + (flag "darkjak-tracking" 44 dm-game-feature-toggle-pick-func) + (flag "darkjak-invinc" 45 dm-game-feature-toggle-pick-func) + (flag "lighteco" 57 dm-game-feature-toggle-pick-func) + (flag "lightjak" 46 dm-game-feature-toggle-pick-func) + (flag "lightjak-regen" 47 dm-game-feature-toggle-pick-func) + (flag "lightjak-swoop" 48 dm-game-feature-toggle-pick-func) + (flag "lightjak-freeze" 49 dm-game-feature-toggle-pick-func) + (flag "lightjak-shield" 50 dm-game-feature-toggle-pick-func) + (flag "gun-yellow-1" 9 dm-game-feature-toggle-pick-func) + (flag "gun-yellow-2" 10 dm-game-feature-toggle-pick-func) + (flag "gun-yellow-3" 11 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-yellow-ammo-1" 23 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-yellow-ammo-2" 24 dm-game-feature-toggle-pick-func) + (flag "gun-red-1" 6 dm-game-feature-toggle-pick-func) + (flag "gun-red-2" 7 dm-game-feature-toggle-pick-func) + (flag "gun-red-3" 8 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-red-ammo-1" 25 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-red-ammo-2" 26 dm-game-feature-toggle-pick-func) + (flag "gun-blue-1" 12 dm-game-feature-toggle-pick-func) + (flag "gun-blue-2" 13 dm-game-feature-toggle-pick-func) + (flag "gun-blue-3" 14 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-blue-ammo-1" 27 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-blue-ammo-2" 28 dm-game-feature-toggle-pick-func) + (flag "gun-dark-1" 15 dm-game-feature-toggle-pick-func) + (flag "gun-dark-2" 16 dm-game-feature-toggle-pick-func) + (flag "gun-dark-3" 17 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-dark-ammo-1" 29 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-dark-ammo-2" 30 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-speed" 21 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-damage" 22 dm-game-feature-toggle-pick-func) + (flag "pass-port-mh" 31 dm-game-feature-toggle-pick-func) + (flag "pass-port-inda" 32 dm-game-feature-toggle-pick-func) + (flag "pass-inda-indb" 33 dm-game-feature-toggle-pick-func) + (flag "pass-indb-sluma" 34 dm-game-feature-toggle-pick-func) + (flag "pass-slumb-genb" 35 dm-game-feature-toggle-pick-func) + (flag "turtle" 0 dm-game-vehicle-toggle-pick-func) + (flag "snake" 1 dm-game-vehicle-toggle-pick-func) + (flag "scorpion" 2 dm-game-vehicle-toggle-pick-func) + (flag "toad" 3 dm-game-vehicle-toggle-pick-func) + (flag "fox" 4 dm-game-vehicle-toggle-pick-func) + (flag "rhino" 5 dm-game-vehicle-toggle-pick-func) + (flag "mirage" 6 dm-game-vehicle-toggle-pick-func) + (flag "x-ride" 7 dm-game-vehicle-toggle-pick-func) + ) + ) + ) + ) + (let* ((s4-2 (debug-menu-find-from-template arg0 '("Game" "Continue"))) + (s3-2 + '(city + comb + desert + factory + forest + mine + nest + palace + sewer + wascity + arena + temple + tower + volcano + precursor + default + test + ) + ) + (a1-7 (car s3-2)) + ) + (while (not (null? s3-2)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s4-2) + (s0-0 debug-menu-make-from-template) + ) + (set! sv-16 arg0) + (let ((a1-8 (debug-menu-make-continue-sub-menu *game-info* (the-as symbol a1-7)))) + (s2-0 s1-0 (s0-0 sv-16 a1-8)) + ) + ) + (set! s3-2 (cdr s3-2)) + (set! a1-7 (car s3-2)) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Stats" + (flag "Poly" *stats-poly* dm-boolean-toggle-pick-func) + (flag "Collide" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Bsp" *stats-bsp* dm-boolean-toggle-pick-func) + (flag "Buffer" *stats-buffer* dm-boolean-toggle-pick-func) + (flag "Target" *stats-target* dm-boolean-toggle-pick-func) + (flag "Blerc" *stats-blerc* dm-boolean-toggle-pick-func) + (flag "Profile bars" *stats-profile-bars* dm-boolean-toggle-pick-func) + (flag "Perf" *stats-perf* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + (flag "Level 6" 6 dm-stats-memory-func) + (flag "Level 7" 7 dm-stats-memory-func) + (flag "Level 8" 8 dm-stats-memory-func) + (flag "Level 9" 9 dm-stats-memory-func) + ) + (function + "Print Entity Memory" + #f + ,(lambda () + (format #t "~%~%========================= Entity Memory =========================~%~%") + (let ((gp-0 (-> *level* level))) + (inspect (-> gp-0 0 art-group)) + (dotimes (s5-0 (-> gp-0 0 art-group art-group-array length)) + (inspect (-> gp-0 0 art-group art-group-array s5-0)) + ) + ) + #f + ) + ) + (function + "Print Texture Info" + #f + ,(lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (inspect *texture-page-dir*) + ) + ) + (function + "Print Texture Verbose" + #f + ,(lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (texture-page-dir-inspect *texture-page-dir* #t) + ) + ) + (function + "Print Merc Stats" + #f + ,(lambda () + (format #t "~%~%========================== Merc Stats ==========================~%~%") + (merc-stats) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Render" + (menu + "Background" + (flag "Textured" 0 dm-subdiv-draw-func) + (flag "Outline" 1 dm-subdiv-draw-func) + (flag "Gouraud" 2 dm-subdiv-draw-func) + (flag "Hack" 3 dm-subdiv-draw-func) + ) + (menu + "Background Scissor" + (flag "Textured" 0 dm-scissor-subdiv-draw-func) + (flag "Outline" 1 dm-scissor-subdiv-draw-func) + (flag "Gouraud" 2 dm-scissor-subdiv-draw-func) + (flag "Hack" 3 dm-scissor-subdiv-draw-func) + ) + (menu + "Foreground" + (flag "Textured" 0 dm-foreground-subdiv-draw-func) + (flag "Outline" 1 dm-foreground-subdiv-draw-func) + (flag "Gouraud" 2 dm-foreground-subdiv-draw-func) + (flag "Hack" 3 dm-foreground-subdiv-draw-func) + ) + (menu + "Ocean" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + (flag "Hack" 3 dm-ocean-subdiv-draw-func) + ) + (flag "SKY TEXTURES" 32 dm-texture-user-toggle-pick-func) + (flag "sky" 3 dm-vu1-user-toggle-pick-func) + (flag "ocean" 4 dm-vu1-user-toggle-pick-func) + (flag "ocean-wave" 5 dm-vu1-user-toggle-pick-func) + (flag "HFRAG TIE TEXTURES" 64 dm-texture-user-toggle-pick-func) + (flag "hfrag" 6 dm-vu1-user-toggle-pick-func) + (flag "hfrag-scissor" 7 dm-vu1-user-toggle-pick-func) + (flag "TFRAG TIE TEXTURES" #x1 dm-texture-user-toggle-pick-func) + (flag "tfrag" 8 dm-vu1-user-toggle-pick-func) + (flag "tie" 10 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap" 11 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor" 9 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor" 12 dm-vu1-user-toggle-pick-func) + (flag "tie-vanish" 13 dm-vu1-user-toggle-pick-func) + (flag "SHRUB TEXTURES" #x4 dm-texture-user-toggle-pick-func) + (flag "shrub-near" 18 dm-vu1-user-toggle-pick-func) + (flag "shrubbery" 17 dm-vu1-user-toggle-pick-func) + (flag "shrubbery-vanish" 20 dm-vu1-user-toggle-pick-func) + (flag "billboard" 19 dm-vu1-user-toggle-pick-func) + (flag "ALPHA TEXTURES" 1 dm-texture-user-toggle-pick-func) + (flag "tfrag-trans" 21 dm-vu1-user-toggle-pick-func) + (flag "tie-trans" 23 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-trans" 24 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-trans" 22 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-trans" 25 dm-vu1-user-toggle-pick-func) + (flag "PRIS TEXTURES" #x2 dm-texture-user-toggle-pick-func) + (flag "merc" 15 dm-vu1-user-toggle-pick-func) + (flag "emerc" 16 dm-vu1-user-toggle-pick-func) + (flag "generic" 14 dm-vu1-user-toggle-pick-func) + (flag "WATER TEXTURES" 2 dm-texture-user-toggle-pick-func) + (flag "tfrag-water" 26 dm-vu1-user-toggle-pick-func) + (flag "tie-water" 28 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-water" 29 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-water" 27 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-water" 30 dm-vu1-user-toggle-pick-func) + (flag "SPRITE TEXTURES" 8 dm-texture-user-toggle-pick-func) + (flag "sprite" 31 dm-vu1-user-toggle-pick-func) + (flag "shadow" 32 dm-vu1-user-toggle-pick-func) + (flag "shadow-debug" *shadow-debug* dm-boolean-toggle-pick-func) + (flag "depth-cue" 36 dm-vu1-user-toggle-pick-func) + (flag "WARP TEXTURES" 4 dm-texture-user-toggle-pick-func) + (flag "HUD TEXTURES" 16 dm-texture-user-toggle-pick-func) + (flag "all on" #f dm-vu1-user-all-pick-func) + (flag "all off" #f dm-vu1-user-none-pick-func) + (flag "all textures on" #x3ff dm-texture-user-set-pick-func) + (flag "all textures off" 0 dm-texture-user-set-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Collision" + (menu + "Collision Renderer" + (flag "On" 0 dm-col-rend-on-func) + (flag "Track Player" 0 dm-col-rend-track-func) + (flag "Track Camera" 1 dm-col-rend-track-func) + (float-var " Dist" #f dm-col-rend-cam-dist 10 1 #t 0 80 1) + (flag "Fixed Pos" 2 dm-col-rend-track-func) + (float-var "Size" #f dm-col-rend-size 10 1 #t 1 20 1) + (flag "Outline" 0 dm-col-rend-outline-func) + (flag "Show Back-faces" 0 dm-col-rend-back-face-func) + (flag "Show Normals" 0 dm-col-rend-normals-func) + (flag "Ghost Hidden" 0 dm-col-rend-ghost-hidden-func) + (menu + "Show Only" + (flag "(board)" 1 dm-col-rend-show-only-set-func) + (flag "(grind)" 2 dm-col-rend-show-only-set-func) + (flag "(grindonly)" 4 dm-col-rend-show-only-set-func) + (flag "melt" 16384 dm-col-rend-show-only-toggle-func) + (flag "noboard" 8 dm-col-rend-show-only-toggle-func) + (flag "nocamera" 16 dm-col-rend-show-only-toggle-func) + (flag "noedge" 32 dm-col-rend-show-only-toggle-func) + (flag "noendlessfall" 64 dm-col-rend-show-only-toggle-func) + (flag "noentity" 128 dm-col-rend-show-only-toggle-func) + (flag "nogrind" 256 dm-col-rend-show-only-toggle-func) + (flag "nojak" 512 dm-col-rend-show-only-toggle-func) + (flag "nolineofsight" 1024 dm-col-rend-show-only-toggle-func) + (flag "nomech" 2048 dm-col-rend-show-only-toggle-func) + (flag "nopilot" 4096 dm-col-rend-show-only-toggle-func) + (flag "noproj" 8192 dm-col-rend-show-only-toggle-func) + (flag "probe" 32768 dm-col-rend-show-only-toggle-func) + (flag "Select All" 49144 dm-col-rend-show-only-set-func) + (flag "Unselect All" 0 dm-col-rend-show-only-set-func) + ) + (menu + "Find" + (flag "background" 1 dm-col-rend-cspec-toggle) + (flag "obstacles" 2 dm-col-rend-cspec-toggle) + (flag "pushers" 4 dm-col-rend-cspec-toggle) + (flag "Jak" 8 dm-col-rend-cspec-toggle) + (flag "other" 16 dm-col-rend-cspec-toggle) + ) + ) + (flag "Collision Cache" *display-collide-cache* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (flag "Ground Stats" *display-ground-stats* dm-boolean-toggle-pick-func) + (flag "Hipri Collision Marks" *display-hipri-collision-marks* dm-boolean-toggle-pick-func) + (flag "Edge Collision Marks" *display-edge-collision-marks* dm-boolean-toggle-pick-func) + (flag "Collide Stats" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Render Collision" *display-render-collision* dm-boolean-toggle-pick-func) + (flag "Collide List Boxes" *collide-list-boxes* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Display" + (flag "Profile" *display-profile* dm-boolean-toggle-pick-func) + (flag "Ticks" *profile-ticks* dm-boolean-toggle-pick-func) + (flag "File Info" *display-file-info* dm-boolean-toggle-pick-func) + (flag "Level Spheres" *display-level-spheres* dm-boolean-toggle-pick-func) + (flag "Camera Marks" *display-camera-marks* dm-boolean-toggle-pick-func) + (flag "Camera Info" *display-camera-info* dm-boolean-toggle-pick-func) + (flag "Geometry Marks" *display-geo-marks* dm-boolean-toggle-pick-func) + (flag "Art Control" *display-art-control* dm-boolean-toggle-pick-func) + (flag "Gui Control" *display-gui-control* dm-boolean-toggle-pick-func) + (flag "Instance Info" *display-instance-info* dm-boolean-toggle-pick-func) + (menu + "strip lines" + (flag "strippable" 1 dm-strip-lines-toggle-pick-func) + (flag "convertible" 2 dm-strip-lines-toggle-pick-func) + (flag "edgeable" 4 dm-strip-lines-toggle-pick-func) + (flag "ordinary" 8 dm-strip-lines-toggle-pick-func) + (flag "color mismatch" 16 dm-strip-lines-toggle-pick-func) + (flag "shader mismatch" 32 dm-strip-lines-toggle-pick-func) + (flag "uv mismatch" 64 dm-strip-lines-toggle-pick-func) + (flag "too big" 128 dm-strip-lines-toggle-pick-func) + (flag "good" 3 dm-strip-lines-set-pick-func) + (flag "bad" 240 dm-strip-lines-set-pick-func) + (flag "all edges" 255 dm-strip-lines-set-pick-func) + (flag "strips" 256 dm-strip-lines-set-pick-func) + (flag "frags" 512 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (menu + "collision mesh" + (flag "wall" 1024 dm-strip-lines-toggle-pick-func) + (flag "ground" 2048 dm-strip-lines-toggle-pick-func) + (flag "all" 3072 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (flag "Texture Distances" *display-texture-distances* dm-boolean-toggle-pick-func) + (flag "Texture Download" *display-texture-download* dm-boolean-toggle-pick-func) + (flag "Level Border" *display-level-border* dm-boolean-toggle-pick-func) + (flag "Split Boxes" *display-split-boxes* dm-boolean-toggle-pick-func) + (flag "Split Box Info" *display-split-box-info* dm-boolean-toggle-pick-func) + (flag "Memcard Info" *display-memcard-info* dm-boolean-toggle-pick-func) + (flag "Trail Graph" *display-trail-graph* dm-boolean-toggle-pick-func) + (flag "Color Bars" *display-color-bars* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Actor" + (flag "Spawn Actors" *spawn-actors* dm-boolean-toggle-pick-func) + (function "Reset Actors" #f ,(lambda () (reset-actors 'debug))) + (function "Traffic Start" #f ,(lambda () (let ((gp-0 traffic-start)) + (if (valid? gp-0 function "" #t 0) + (gp-0) + ) + ) + ) + ) + (function "Traffic Kill" #f ,(lambda () (let ((gp-0 traffic-kill)) + (if (valid? gp-0 function "" #t 0) + (gp-0) + ) + ) + ) + ) + (menu + "Bot" + (function + "Bot Next" + #f + ,(lambda () + (send-event (process-by-name "sig-atoll-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-sewer-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-escort-1" *active-pool*) 'skip) + (send-event (process-by-name "squid-2" *active-pool*) 'skip) + (send-event (process-by-name "metalkor-1" *active-pool*) 'skip) + (send-event (process-by-name "sig-under-1" *active-pool*) 'skip) + (send-event (process-by-name "scorpion-gun-manager-1" *active-pool*) 'skip) + (send-event (process-by-name "terraformer-1" *active-pool*) 'skip) + ) + ) + (menu + "Bot Marks" + (flag "course spots" 1 display-bot-marks-toggle-pick-func) + (flag "task spots" 2 display-bot-marks-toggle-pick-func) + (flag "all on" 3 display-bot-marks-set-pick-func) + (flag "all off" 0 display-bot-marks-set-pick-func) + ) + ) + (menu + "Actor Compaction" + (flag "off" #f dm-compact-actor-pick-func) + (flag "on" #t dm-compact-actor-pick-func) + (flag "debug" debug dm-compact-actor-pick-func) + ) + (flag "Traffic height map" *display-traffic-height-map* dm-boolean-toggle-pick-func) + (flag "View Anims" *debug-view-anims* dm-boolean-toggle-pick-func) + (flag "Unkillable" *debug-unkillable* dm-boolean-toggle-pick-func) + (flag "Jak Vehicle Unkillable" *debug-player-vehicle-unkillable* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Actor Vis" *vis-actors* dm-boolean-toggle-pick-func) + (float-var + "Entity clock" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *display* (nonzero? *display*)) + (update-rates! (-> *display* entity-clock) arg2) + ) + ) + ((or (not *display*) (zero? *display*)) + 0 + ) + (else + (-> *display* entity-clock clock-ratio) + ) + ) + ) + 4 + (new 'static 'bfloat :data 0.01) + #t + (new 'static 'bfloat) + (new 'static 'bfloat :data 1.0) + (new 'static 'bfloat :data 0.0001) + ) + (flag "Battle Marks" *display-battle-marks* dm-boolean-toggle-pick-func) + (menu + "Hover Marks" + (flag "Nav Network" *display-nav-network* dm-boolean-toggle-pick-func) + (flag "Debug Hover" *debug-hover* dm-boolean-toggle-pick-func) + ) + (flag "Path Marks" *display-path-marks* dm-boolean-toggle-pick-func) + (flag "Nav Marks" *display-nav-marks* dm-boolean-toggle-pick-func) + (flag "Vol Marks" *display-vol-marks* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (menu + "Debug Actor" + (float-var "lod0-dist" 0 dm-debug-actor-lod-dist 10 (new 'static 'bfloat :data 1.0) #f 0 0 1) + (float-var "lod1-dist" 1 dm-debug-actor-lod-dist 10 (new 'static 'bfloat :data 1.0) #f 0 0 1) + (float-var "lod2-dist" 2 dm-debug-actor-lod-dist 10 (new 'static 'bfloat :data 1.0) #f 0 0 1) + (flag "Joint Axes" *display-joint-axes* dm-boolean-toggle-pick-func) + ) + (menu + "Actor Vis" + (flag "off" #f dm-actor-vis-pick-func) + (flag "box" box dm-actor-vis-pick-func) + (flag "sphere" sphere dm-actor-vis-pick-func) + (flag "all" #t dm-actor-vis-pick-func) + ) + (menu + "Actor Marks" + (flag "off" #f dm-actor-marks-pick-func) + (flag "alive entities" #t dm-actor-marks-pick-func) + (flag "all entities" full dm-actor-marks-pick-func) + (flag "processes" process dm-actor-marks-pick-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Target" + (menu + "Mode" + (function + "normal" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (send-event *target* 'change-mode 'normal)) + ) + (function "racer" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'racer #f) + ) + ) + (function "flut" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'flut #f) + ) + ) + (function "board" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature gun)) + (logior! (-> *game-info* debug-features) (game-feature gun)) + (send-event *target* 'change-mode 'gun #f (pickup-type none)) + ) + ) + (function + "darkjak" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + ) + (function + "lightjak" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 5) + ) + ) + (function "indax" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f #f) + ) + ) + (function + "invisible" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'invisible #f) + ) + ) + ) + (menu + "Pilot Mode" + (function "h-bike-a" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 0))) + (function "h-bike-b" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 1))) + (function "h-bike-c" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 2))) + (function "h-bike-d" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 6))) + (function "h-car-a" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 3))) + (function "h-car-b" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 4))) + (function "h-car-c" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 5))) + (function "h-hellcat" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 7))) + (function "h-warf" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 8))) + (function "h-glider" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 9))) + (function "h-sled" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 10))) + (function "v-turtle" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 12))) + (function "v-snake" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 13))) + (function "v-scorpion" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 14))) + (function "v-toad" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 15))) + (function "v-fox" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 16))) + (function "v-rhino" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 17))) + (function "v-mirage" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 18))) + (function "v-x-ride" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 19))) + (function "v-marauder" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 20))) + (function "v-faccar" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 21))) + (function "v-catapult" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 22))) + (function "v-marauder-b" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 23))) + (function "evantestbike" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 29))) + (function "test-car" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 25))) + (function "wbike-test" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (dm-pilot-mode 26))) + ) + (flag "Target" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Darkjak" + (function + "get all" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* debug-features) + ) + ) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + ) + ) + (function + "debug" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as + game-feature + (logior (game-feature darkjak darkjak-smack darkjak-bomb0 darkjak-bomb1 feature44 feature45) + (-> *game-info* debug-features) + ) + ) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage active bomb0 no-anim disable-force-on)) + ) + ) + (function + "manual" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + ) + (function + "rapid" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage bomb0)) + ) + ) + (function "smack" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1)) + ) + ) + (function + "bomb0" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1 invinc)) + ) + ) + (function + "bomb1" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1 invinc giant)) + ) + ) + (function + "tracking" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 bomb1 invinc giant no-anim)) + ) + ) + (function + "invinc" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event + *target* + 'change-mode + 'darkjak + #f + (darkjak-stage force-on bomb0 invinc giant no-anim disable-force-on) + ) + ) + ) + ) + (menu + "Lightjak" + (function + "get all" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature lightjak lightjak-regen lightjak-swoop lightjak-freeze lightjak-shield) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + ) + ) + (function + "debug" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature lightjak lightjak-regen lightjak-swoop lightjak-freeze lightjak-shield) + (-> *game-info* features) + ) + ) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + (send-event *target* 'change-mode 'lightjak #f 6) + ) + ) + (function + "manual" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 5) + ) + ) + (function + "normal" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 4) + ) + ) + ) + (flag "Target Marks" *display-target-marks* dm-boolean-toggle-pick-func) + (flag "Gun Marks" *gun-marks* dm-boolean-toggle-pick-func) + (flag "Target Stats" *stats-target* dm-boolean-toggle-pick-func) + (flag "Sidekick Stats" *display-sidekick-stats* dm-boolean-toggle-pick-func) + (flag "Invulnerable" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (logxor! (-> *target* target-flags) (target-flags tf2)) + ) + ) + (and *target* (logtest? (-> *target* target-flags) (target-flags tf2))) + ) + ) + (flag + "Endless Ammo" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (set! (-> *target* target-flags) (logxor (target-flags tf16) (the-as int (-> *target* target-flags)))) + ) + ) + (and *target* (logtest? (target-flags tf16) (-> *target* target-flags))) + ) + ) + (function + "Full Stuff" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (send-event *target* 'get-pickup (pickup-type health) 1000.0) + (send-event *target* 'get-pickup (pickup-type shield) 1000.0) + (send-event *target* 'get-pickup (pickup-type skill) 100.0) + (send-event *target* 'get-pickup (pickup-type gem) 100.0) + (send-event *target* 'get-pickup (pickup-type ammo-yellow) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-red) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-blue) 1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-dark) 1000.0) + (send-event *target* 'get-pickup (pickup-type eco-pill-dark) 100.0) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + (set! (-> *game-info* features) + (the-as + game-feature + (logior (game-feature + gun + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + board + darkjak + ) + (-> *game-info* features) + ) + ) + ) + (let ((v0-10 + (logior (game-feature gun gun-red-1 gun-yellow-1 gun-blue-1 gun-dark-1 board darkjak) + (-> *game-info* debug-features) + ) + ) + ) + (set! (-> *game-info* debug-features) (the-as game-feature v0-10)) + v0-10 + ) + ) + ) + (function + "Dump Stuff" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (send-event *target* 'get-pickup (pickup-type shield) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-yellow) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-red) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-blue) -1000.0) + (send-event *target* 'get-pickup (pickup-type ammo-dark) -1000.0) + ) + ) + (function + "Trick Mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (send-event *target* 'get-pickup (pickup-type trick-judge) 18000.0) + ) + ) + (function + "Reset Trans" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when *target* + (position-in-front-of-camera! (target-pos 0) 40960.0 4096.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control quat-for-control)) + (quaternion-identity! (-> *target* control dir-targ)) + ) + ) + ) + (function + "Zero Trans" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when *target* + (set-vector! (-> *target* control trans) 0.0 163840.0 0.0 1.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control quat-for-control)) + (quaternion-identity! (-> *target* control dir-targ)) + ) + ) + ) + (flag "Slow Frame Rate" *slow-frame-rate* dm-boolean-toggle-pick-func) + (function "Print Pos" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 (target-pos 0))) + (format #t "~6,,2m ~6,,2m ~6,,2m~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) + ) + 0 + ) + ) + (flag "Goggles" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((not *target*) + ) + ((= (-> *target* goggles-interp-targ) 0.0) + (set! (-> *target* goggles-interp-targ) 1.0) + ) + (else + (set! (-> *target* goggles-interp-targ) 0.0) + ) + ) + ) + (if *target* + (!= (-> *target* goggles-interp-targ) 0.0) + #f + ) + ) + ) + (flag "Scarf" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((not *target*) + ) + ((= (-> *target* scarf-interp-targ) 0.0) + (set! (-> *target* scarf-interp-targ) 1.0) + ) + (else + (set! (-> *target* scarf-interp-targ) 0.0) + ) + ) + ) + (if *target* + (!= (-> *target* scarf-interp-targ) 0.0) + #f + ) + ) + ) + (function + "Save Continue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (if *target* + (trsq->continue-point (-> *target* control)) + ) + ) + ) + (flag "RC Board Controls" *target-rc-board-controls* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-camera-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Racing" + (flag "Desertb" 0 dm-select-race-pick-func) + (flag "Desert Rally" 2 dm-select-race-pick-func) + (int-var "Select Path" 0 dm-select-race-path 10 1 #t 0 7) + (menu + "Race Marks" + (flag "Path 0 (Red)" 1 display-race-marks-toggle-pick-func) + (flag "Path 1 (Green)" 2 display-race-marks-toggle-pick-func) + (flag "Path 2 (Blue)" 4 display-race-marks-toggle-pick-func) + (flag "Path 3 (Yellow)" 8 display-race-marks-toggle-pick-func) + (flag "Path 4 (Cyan)" 16 display-race-marks-toggle-pick-func) + (flag "Path 5 (Violet)" 32 display-race-marks-toggle-pick-func) + (flag "Path 6 (Orange)" 64 display-race-marks-toggle-pick-func) + (flag "Path 7 (Black)" 128 display-race-marks-toggle-pick-func) + (flag "All Paths On" 255 display-race-marks-set-pick-func) + (flag "All Off" 0 display-race-marks-set-pick-func) + ) + (flag "Race Mesh" *display-race-mesh* dm-boolean-toggle-pick-func) + (function + "Record Selected Path" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! *race-record-path* #t) + (dm-play-race *select-race* #t) + ) + ) + (function + "Play Race" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (set! *race-record-path* #f) + (dm-play-race *select-race* #f) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Nav Graph" + (function + "Start Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (when (not (get-nav-graph-editor)) + (let ((t9-1 run-nav-graph-editor) + (a0-1 'test) + ) + (t9-1 a0-1) + ) + ) + ) + ) + (function + "Exit Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (if (get-nav-graph-editor) + (exit-nav-graph-editor) + ) + ) + ) + (function + "Toggle Plane Mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (if a0-1 + ((method-of-object a0-1 nav-graph-editor-method-64)) + ) + ) + ) + ) + (function + "Toggle Hover Mode" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (if a0-1 + ((method-of-object a0-1 nav-graph-editor-method-65)) + ) + ) + ) + ) + (menu + "Load" + (function + "Hover Foresta" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'foresta + (t9-1) + ) + ) + ) + ) + ) + (function + "Hover Sewc" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'sewc + (t9-1) + ) + ) + ) + ) + ) + (function + "Hover Sewg" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'sewg + (t9-1) + ) + ) + ) + ) + ) + (function + "Hover Sewl" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'hover + 'sewl + (t9-1) + ) + ) + ) + ) + ) + (function + "Traffic" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'traffic + (t9-1) + ) + ) + ) + ) + ) + (function + "Minimap" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'minimap + (t9-1) + ) + ) + ) + ) + ) + (function + "flyingsaw_2" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'flyingsaw_2 + (t9-1) + ) + ) + ) + ) + ) + (function + "flyingsaw_3" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'flyingsaw_3 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-1" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-1 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-2" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-2 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-3" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-3 + (t9-1) + ) + ) + ) + ) + ) + (function + "forest-plant-4" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'forest-plant-4 + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Beast" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'beast + (t9-1) + ) + ) + ) + ) + ) + (function + "Was Minimap" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'wasminimap + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Rescue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'desrescue + (t9-1) + ) + ) + ) + ) + ) + (function + "Assault" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'assault + (t9-1) + ) + ) + ) + ) + ) + (function + "Timer Chase 1" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'timer-chase-1 + (t9-1) + ) + ) + ) + ) + ) + (function + "ProtectHQ" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'protect-hq + (t9-1) + ) + ) + ) + ) + ) + (function + "Blow Tower" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'blow-tower + (t9-1) + ) + ) + ) + ) + ) + (function + "desert-lizard" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'desert-lizard + (t9-1) + ) + ) + ) + ) + ) + (function + "terraformer-walk" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'terraformer-walk + (t9-1) + ) + ) + ) + ) + ) + (function + "terraformer-fly" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'terraformer-fly + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Beast Battle" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'beast-battle + (t9-1) + ) + ) + ) + ) + ) + (function + "Desert Chase Marauder" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (when a0-1 + (let ((t9-1 (method-of-object a0-1 nav-graph-editor-method-66))) + 'desert-chase-marauder + (t9-1) + ) + ) + ) + ) + ) + ) + (function + "Save" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (let ((a0-1 (get-nav-graph-editor))) + (if a0-1 + ((method-of-object a0-1 nav-graph-editor-method-67)) + ) + ) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Nav Mesh" + (function + "Start Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (not *nav-mesh-editor*) + (kill-by-type nav-mesh-editor *active-pool*) + (let ((gp-0 (get-process *default-dead-pool* nav-mesh-editor #x4000 1))) + (when gp-0 + (let ((t9-2 (method-of-type nav-mesh-editor activate))) + (t9-2 (the-as nav-mesh-editor gp-0) *entity-pool* "nav-mesh-editor" (the-as pointer #x70004000)) + ) + (let ((t9-3 run-function-in-process) + (a0-4 gp-0) + (a1-4 nav-mesh-editor-init) + ) + ((the-as (function object object none) t9-3) a0-4 a1-4) + ) + (-> gp-0 ppointer) + ) + ) + ) + ) + ) + (function + "Exit Editor" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) (kill-by-type nav-mesh-editor *active-pool*)) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Ocean" + (menu + "Ocean Height" + (flag "zero" 1 dm-ocean-height-func) + (flag "far-below" 2 dm-ocean-height-func) + (flag "sewer-start" 3 dm-ocean-height-func) + (flag "sewer-hi" 4 dm-ocean-height-func) + (flag "sewer-med" 5 dm-ocean-height-func) + (flag "sewer-lo" 6 dm-ocean-height-func) + ) + (menu + "Ocean Subdiv" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Time of day" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "palette 0" 16 dm-time-of-day-func) + (flag "palette 1" 32 dm-time-of-day-func) + (flag "palette 2" 64 dm-time-of-day-func) + (flag "palette 3" 128 dm-time-of-day-func) + (flag "palette 4" 256 dm-time-of-day-func) + (flag "palette 5" 512 dm-time-of-day-func) + (flag "palette 6" 1024 dm-time-of-day-func) + (flag "palette 7" 2048 dm-time-of-day-func) + (flag "on" #f dm-time-of-day-pick-func) + (flag "Fast" *time-of-day-fast* dm-time-of-day-func2) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Mood" + (flag + "Overide Enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-enable) (not (-> *time-of-day-context* overide-enable))) + ) + (-> *time-of-day-context* overide-enable) + ) + ) + (menu + "Weather" + (flag + "Overide Weather Enable" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* overide-weather-flag) (not (-> *mood-control* overide-weather-flag))) + ) + (-> *mood-control* overide-weather-flag) + ) + ) + (flag + "Display Values" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* display-flag) (not (-> *mood-control* display-flag))) + ) + (-> *mood-control* display-flag) + ) + ) + (float-var + "Clouds" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide cloud) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0 + ) + (else + (-> *mood-control* overide cloud) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + (float-var + "Fog" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide fog) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0 + ) + (else + (-> *mood-control* overide fog) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + ) + (menu + "Colors" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Ambient Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + 2 + 0 + ) + (float-var + "Light Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + 2 + 0 + ) + (function + "reset selected time" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as + pointer + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + (the-as + pointer + (-> *debug-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + 32 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + 1.0 + ) + ) + ) + (function + "reset all times" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! (the-as pointer *overide-mood-color-table*) (the-as pointer *debug-mood-color-table*) 256) + (dotimes (v1-0 8) + (set! (-> *overide-mood-color-table* data v1-0 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-0 amb-color w) 1.0) + ) + #f + ) + ) + ) + (menu + "Fog" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Start" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + -1000 + 10000 + 0 + ) + (float-var + "End" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 10000 + 0 + ) + (float-var + "Max" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (float-var + "Min" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (function + "reset selected time" + #f + ,(lambda () + (mem-copy! + (the-as + pointer + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + (the-as + pointer + (-> *debug-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + 48 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + ) + (function + "reset all times" + #f + ,(lambda () + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer *debug-mood-fog-table*) 384) + (dotimes (v1-0 8) + (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + ) + ) + #f + ) + ) + ) + (menu + "Palette" + (flag "palette 0" 0 dm-time-of-day-palette-func) + (flag "palette 1" 1 dm-time-of-day-palette-func) + (flag "palette 2" 2 dm-time-of-day-palette-func) + (flag "palette 3" 3 dm-time-of-day-palette-func) + (flag "palette 4" 4 dm-time-of-day-palette-func) + (flag "palette 5" 5 dm-time-of-day-palette-func) + (flag "palette 6" 6 dm-time-of-day-palette-func) + (flag "palette 7" 7 dm-time-of-day-palette-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (function + "reset selected time" + #f + ,(lambda () (let ((v0-0 (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette)))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + (function "reset all times" #f ,(lambda () + (dotimes (v1-0 8) + (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) + ) + #f + ) + ) + ) + (menu + "Filter" + (float-var + "Red" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* filter-color w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.007781982) + #t + 0 + 2 + 0 + ) + (function "reset filter" #f ,(lambda () (let ((v0-0 (-> *time-of-day-context* filter-color))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + ) + (menu + "Sky" + (float-var + "Cloud Min" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-min) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-min) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Cloud Max" + #f + ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-max) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-max) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (function + "reset sky" + #f + ,(lambda () + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) + ) + ) + ) + (function "Print mood tables" #f ,(lambda () (print-mood-tables))) + (function + "reset everything" + #f + ,(lambda () + (mem-copy! (the-as pointer *overide-mood-color-table*) (the-as pointer *debug-mood-color-table*) 256) + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer *debug-mood-fog-table*) 384) + (dotimes (v1-0 8) + (set! (-> *overide-mood-color-table* data v1-0 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-0 amb-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-0 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-0 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-0 fog-dists y)) + ) + (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) + ) + (set-vector! (-> *time-of-day-context* filter-color) 1.0 1.0 1.0 1.0) + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Sound" + (flag "Effect Debug" *debug-effect-control* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) + (function "Reload Banks" #f sound-bank-reload) + (function "List Sounds" #f ,(lambda () (list-sounds))) + (function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)))) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-shader-menu arg0)) + (debug-menu-append-item s5-0 (debug-menu-make-instance-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Bug Report" + (flag "display" *display-bug-report* dm-boolean-toggle-pick-func) + (function "Start" #f ,(lambda () (bug-report-start))) + (function "Stop" #f ,(lambda () (bug-report-stop))) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Scene" + (menu + "Scene Info" + (flag "channel" 1 display-scene-control-toggle-pick-func) + (flag "anim name" 2 display-scene-control-toggle-pick-func) + (flag "dma size" 4 display-scene-control-toggle-pick-func) + (flag "bounds spheres" 8 display-scene-control-toggle-pick-func) + (flag "actors" 16 display-scene-control-toggle-pick-func) + (flag "actor-marks" 32 display-scene-control-toggle-pick-func) + (flag "special fma spheres" 64 display-scene-control-toggle-pick-func) + (flag "all on" 95 display-scene-control-set-pick-func) + (flag "all off" 0 display-scene-control-set-pick-func) + ) + (menu + "arena" + (function + "arena-training-1-intro" + ("waspala-intro-training" "arena-training-1-intro") + dm-scene-load-pick-func + ) + (function "arena-fight-1-intro" ("wasstada-pre-fight-1" "arena-fight-1-intro") dm-scene-load-pick-func) + (function "arena-fight-1-res" ("wasstada-fight" "arena-fight-1-res") dm-scene-load-pick-func) + (function "wascity-chase-intro" ("wasstada-wascity-chase" "wascity-chase-intro") dm-scene-load-pick-func) + (function "arena-fight-2-res" ("wasstada-fight" "arena-fight-2-res") dm-scene-load-pick-func) + (function "arena-fight-3-intro" ("wasstada-fight" "arena-fight-3-intro") dm-scene-load-pick-func) + (function "arena-fight-3-res" ("wasstada-fight" "arena-fight-3-res") dm-scene-load-pick-func) + ) + (menu + "city" + (function "sewer-hum-kg-entrance" ("ctyslumb-sewer" "sewer-hum-kg-entrance") dm-scene-load-pick-func) + (function "sewer-kg-entrance" ("ctyinda-sewer" "sewer-kg-entrance") dm-scene-load-pick-func) + (function "sewer-genb-entrance" ("ctygenb-sewer" "sewer-genb-entrance") dm-scene-load-pick-func) + (function "city-gun-course-intro" ("gungame-start" "city-gun-course-intro") dm-scene-load-pick-func) + (function "city-gun-course-1-res" ("gungame-start" "city-gun-course-1-res") dm-scene-load-pick-func) + (function "city-gun-course-2-intro" ("gungame-start" "city-gun-course-2-intro") dm-scene-load-pick-func) + (function "city-gun-course-2-res" ("gungame-start" "city-gun-course-2-res") dm-scene-load-pick-func) + (function "city-port-attack-intro-b" ("ctyport-hiphog" "ctyport-attack-get-on-nuke") dm-scene-load-pick-func) + (function "city-port-attack-res" ("ctyport-attack-res" "city-port-attack-res") dm-scene-load-pick-func) + (function "city-hijack-vehicle-res" ("ctyhijack-res" "city-hijack-vehicle-res") dm-scene-load-pick-func) + (function "city-get-dark-punch" ("mhcitya-fma" "city-get-dark-punch") dm-scene-load-pick-func) + (function "sewer-met-hum-intro" ("ctygenb-samos" "sewer-met-hum-intro") dm-scene-load-pick-func) + (function "city-destroy-grid-res" ("ctyinda-grid-res-a" "city-destroy-grid-res") dm-scene-load-pick-func) + (function "tower-destroy-intro" ("mhcityb-tower-fma" "tower-destroy-intro") dm-scene-load-pick-func) + ) + (menu + "desert" + (function "nest-destroy-barrier" ("desertg-egg-wall-scene" "nest-destroy-barrier") dm-scene-load-pick-func) + (function "nest-hunt-intro" ("desertg-egg-wall-scene" "nest-hunt-intro") dm-scene-load-pick-func) + (function "nest-hunt-res" ("desertg-hunt-res-start" "nest-hunt-res") dm-scene-load-pick-func) + (function + "desert-oasis-defense-res" + ("desert-ashelin-movie" "desert-oasis-defense-res") + dm-scene-load-pick-func + ) + (function "desert-rescue-res-a" ("desert-rescue-movie" "desert-rescue-res-a") dm-scene-load-pick-func) + (function "desert-hover-res" ("desert-hover-movie" "desert-hover-res") dm-scene-load-pick-func) + (function "desert-lizard-catch" ("desert-lizard-corral" "desert-lizard-catch") dm-scene-load-pick-func) + (function "desert-lizard-catch-2" ("desert-lizard-corral" "desert-lizard-catch-2") dm-scene-load-pick-func) + (function "desert-lizard-catch-3" ("desert-lizard-corral" "desert-lizard-resolution") dm-scene-load-pick-func) + (function + "desert-oasis-defense-res-b" + ("desert-ashelin-movie" "desert-oasis-defense-res-b") + dm-scene-load-pick-func + ) + (function "desert-glide-res" ("volcanox-vola-start" "desert-glide-res") dm-scene-load-pick-func) + (function "desert-courserace-win" ("desertg-hunt-res-start" "desert-courserace-win") dm-scene-load-pick-func) + (function + "desert-final-boss-res" + ("desert-final-boss-res-movie-a" "desert-final-boss-res") + dm-scene-load-pick-func + ) + (function + "desert-final-boss-res-b" + ("desert-final-boss-res-movie" "desert-final-boss-res-b") + dm-scene-load-pick-func + ) + (function + "desert-final-boss-intro" + ("wasall-final-boss-intro-movie" "desert-final-boss-intro") + dm-scene-load-pick-func + ) + (function + "full desert-jak-gets-on-terraformer" + ("desert-boss-res-a" ("desert-jak-gets-on-t-a" "desert-jak-gets-on-t-b" "desert-jak-gets-on-t-c")) + dm-scene-load-pick-func + ) + (function "desert-jak-gets-on-t-a" ("desert-boss-res-a" "desert-jak-gets-on-t-a") dm-scene-load-pick-func) + (function "desert-jak-gets-on-t-b" ("desert-boss-res-b" "desert-jak-gets-on-t-b") dm-scene-load-pick-func) + (function "desert-jak-gets-on-t-c" ("desert-boss-res-b" "desert-jak-gets-on-t-c") dm-scene-load-pick-func) + (function + "full outro" + ("desert-final-boss-res-movie-a" ("desert-final-boss-res" "desert-final-boss-res-b" "arena-outro")) + dm-scene-load-pick-func + ) + ) + (menu + "comb" + (function "comb-exit" ("combn-start" "comb-exit") dm-scene-load-pick-func) + (function "comb-entrance-temple" ("temple-comb-entrance" "comb-entrance-temple") dm-scene-load-pick-func) + (function "catacombs-wild-ride-res" ("railx-start" "catacombs-wild-ride-res") dm-scene-load-pick-func) + (function "catacomb-get-shield" ("combn-start" "catacomb-get-shield") dm-scene-load-pick-func) + ) + (menu + "factory" + (function "factory-sky-battle-res" ("factorya-movie" "factory-sky-battle-res") dm-scene-load-pick-func) + (function + "factory-sky-battle-intro-b" + ("factorya-intro-b" "factory-sky-battle-intro-b") + dm-scene-load-pick-func + ) + (function "factory-indax-1-intro" ("factoryc-start" "factory-indax-1-intro") dm-scene-load-pick-func) + (function "factory-indax-2-intro" ("factoryc-start" "factory-indax-2-intro") dm-scene-load-pick-func) + (function "factory-indax-3-intro" ("factoryc-start" "factory-indax-3-intro") dm-scene-load-pick-func) + (function "factory-indax-4-intro" ("factoryc-start" "factory-indax-4-intro") dm-scene-load-pick-func) + (function "factory-boss-intro" ("factoryd-start" "factory-boss-intro") dm-scene-load-pick-func) + (function "factory-boss-res" ("factoryd-res-fma" "factory-boss-res") dm-scene-load-pick-func) + ) + (menu + "forest" + (function "forest-tower" ("foresta-start" "forest-tower") dm-scene-load-pick-func) + (function + "forest-turn-on-machine-res" + ("forest-pillar-start" "forest-turn-on-machine-res") + dm-scene-load-pick-func + ) + (function "precursor-tour-res" ("precura-foresta" "precursor-tour-res") dm-scene-load-pick-func) + (function "forest-ring-chase-res" ("foresta-start" "forest-ring-chase-res") dm-scene-load-pick-func) + (function "forest-res-b" ("foresta-start" "forest-res-b") dm-scene-load-pick-func) + ) + (menu + "freehq" + (function "factory-sky-battle-intro" ("freehq-movie" "factory-sky-battle-intro") dm-scene-load-pick-func) + (function "city-protect-hq-intro" ("freehq-movie" "city-protect-hq-intro") dm-scene-load-pick-func) + (function "city-protect-hq-res" ("freehq-movie" "city-protect-hq-res") dm-scene-load-pick-func) + (function "city-blow-tower-intro" ("freehq-movie" "city-blow-tower-intro") dm-scene-load-pick-func) + (function "temple-defend-intro" ("freehq-movie" "temple-defend-intro") dm-scene-load-pick-func) + ) + (menu + "hiphog" + (function "sewer-kg-met-intro" ("hiphog-movie" "sewer-kg-met-intro") dm-scene-load-pick-func) + (function "port-assault-intro" ("hiphog-movie" "port-assault-intro") dm-scene-load-pick-func) + (function "city-blow-barricade-intro" ("hiphog-movie" "city-blow-barricade-intro") dm-scene-load-pick-func) + (function "city-blow-barricade-res" ("hiphog-movie" "city-blow-barricade-res") dm-scene-load-pick-func) + (function "city-port-fight-intro" ("hiphog-movie" "city-port-fight-intro") dm-scene-load-pick-func) + (function "city-sniper-fight-intro" ("hiphog-movie" "city-sniper-fight-intro") dm-scene-load-pick-func) + (function "city-port-attack-intro" ("hiphog-movie" "city-port-attack-intro") dm-scene-load-pick-func) + ) + (menu + "intro" + (function + "full intro" + ("wasintro-start" ("intro-drop" "intro-lost" "intro-ffhq" "intro-tired" "intro-palace" "intro-rescue")) + dm-scene-load-pick-func + ) + (function "intro-drop" ("wasintro-start" "intro-drop") dm-scene-load-pick-func) + (function "intro-lost" ("wasintro-start" "intro-lost") dm-scene-load-pick-func) + (function "intro-ffhq" ("freehq-intro" "intro-ffhq") dm-scene-load-pick-func) + (function "intro-tired" ("wasintro-tired" "intro-tired") dm-scene-load-pick-func) + (function "intro-palace" ("wasintro-palace" "intro-palace") dm-scene-load-pick-func) + (function "intro-rescue" ("wasintro-rescue" "intro-rescue") dm-scene-load-pick-func) + ) + (menu + "mine" + (function "catacombs-travel-res" ("minec-start" "catacombs-travel-res") dm-scene-load-pick-func) + (function "mine-train-intro" ("mineb-elevator-room" "mine-train-intro") dm-scene-load-pick-func) + (function "mine-train-res" ("minec-train" "mine-train-res") dm-scene-load-pick-func) + (function "mine-boss-intro" ("prebot-intro" "mine-boss-intro") dm-scene-load-pick-func) + (function "prebot-hit-a" ("prebot-fight" "prebot-hit-a") dm-scene-load-pick-func) + (function "prebot-hit-b" ("prebot-fight" "prebot-hit-b") dm-scene-load-pick-func) + (function "mine-boss-res" ("prebot-fight" "mine-boss-res") dm-scene-load-pick-func) + (function "minee-genb-exit" ("minee-exit" "minee-genb-exit") dm-scene-load-pick-func) + (function "mine-explore-res" ("mineb-elevator-room" "mine-explore-res") dm-scene-load-pick-func) + ) + (menu + "onintent" + (function + "city-find-catacomb-ent-intro" + ("onintent-start" "city-find-catacomb-ent-intro") + dm-scene-load-pick-func + ) + ) + (menu "outro" (function "arena-outro" ("wasstada-outro" "arena-outro") dm-scene-load-pick-func)) + (menu + "precursor" + (function "precursor-destroy-ship-res" ("precurd-start" "precursor-destroy-ship-res") dm-scene-load-pick-func) + (function "desert-final-boss-intro-a" ("precurd-escape" "desert-final-boss-intro-a") dm-scene-load-pick-func) + (function + "precursor-destroy-ship-exp-res" + ("precurd-escape" "precursor-destroy-ship-exp-res") + dm-scene-load-pick-func + ) + (function + "precursor-destroy-ship-lose" + ("precura-start" "precursor-destroy-ship-lose") + dm-scene-load-pick-func + ) + (function + "full final-boss-intro" + ("precurd-escape" ("desert-final-boss-intro-a" "precursor-destroy-ship-exp-res" "desert-final-boss-intro")) + dm-scene-load-pick-func + ) + ) + (menu + "rubble" + (function "palace-ruins-attack-intro" ("rubblea-start" "palace-ruins-attack-intro") dm-scene-load-pick-func) + (function + "full palace-ruins-attack-res" + ("rubblec-fma" ("palace-ruins-attack-res-a" "palace-ruins-attack-res")) + dm-scene-load-pick-func + ) + (function "palace-ruins-attack-res" ("rubblec-fma" "palace-ruins-attack-res") dm-scene-load-pick-func) + (function "palace-ruins-attack-res-a" ("rubblec-fma" "palace-ruins-attack-res-a") dm-scene-load-pick-func) + (function "palace-ruins-patrol-intro" ("stadium-tunnel" "palace-ruins-patrol-intro") dm-scene-load-pick-func) + ) + (menu + "sewer" + (function "sewer-kg-exit" ("sewf-start" "sewer-kg-exit") dm-scene-load-pick-func) + (function "sewer-mh-exit" ("sewj-exit" "sewer-mh-exit") dm-scene-load-pick-func) + (function "sewer-port-exit" ("sewo-exit" "sewer-port-exit") dm-scene-load-pick-func) + (function "sewer-waterslide" ("sewd-start" "sewer-waterslide") dm-scene-load-pick-func) + (function "sewer-hum-kg-res" ("sewe-switch" "sewer-hum-kg-res") dm-scene-load-pick-func) + (function "sewer-met-hum-intro" ("ctygenb-samos" "sewer-met-hum-intro") dm-scene-load-pick-func) + ) + (menu + "temple" + (function "temple-climb-intro" ("templex-start" "temple-climb-intro") dm-scene-load-pick-func) + (function "temple-climb-res" ("templex-pre-hang" "temple-climb-res") dm-scene-load-pick-func) + (function "temple-oracle-intro" ("templeb-oracle-movie" "temple-oracle-intro") dm-scene-load-pick-func) + (function "temple-oracle-res" ("templeb-start" "temple-oracle-res") dm-scene-load-pick-func) + (function + "temple-jak-gets-light-glide" + ("templeb-glide" "temple-jak-gets-light-glide") + dm-scene-load-pick-func + ) + (function "temple-tests-res-a" ("templeb-flash-freeze" "temple-tests-res-a") dm-scene-load-pick-func) + (function "temple-tests-res-b" ("comba-elevator" "temple-tests-res-b") dm-scene-load-pick-func) + (function "temple-tests-intro" ("templea-mardoor" "temple-tests-intro") dm-scene-load-pick-func) + (function "temple-defend-res" ("templed-start" "temple-defend-res") dm-scene-load-pick-func) + ) + (menu + "throne" + (function + "full training intro" + ("waspala-intro-training" ("intro-training" "arena-training-1-intro")) + dm-scene-load-pick-func + ) + (function "intro-training" ("waspala-intro-training" "intro-training") dm-scene-load-pick-func) + (function "arena-fight-2-intro" ("waspala-start" "arena-fight-2-intro") dm-scene-load-pick-func) + (function "nest-eggs-intro" ("waspala-start" "nest-eggs-intro") dm-scene-load-pick-func) + (function "desert-rescue-intro" ("waspala-start" "desert-rescue-intro") dm-scene-load-pick-func) + (function "desert-jump-mission-intro" ("waspala-start" "desert-jump-mission-intro") dm-scene-load-pick-func) + ) + (menu + "tower" + (function "tower-destroy-res" ("towerb-top" "tower-destroy-res") dm-scene-load-pick-func) + (function "tower-destroy-res-b" ("ltowerb-fma" "tower-destroy-res-b") dm-scene-load-pick-func) + ) + (menu + "vinroom" + (function "city-power-game-intro" ("vinroom-movie" "city-power-game-intro") dm-scene-load-pick-func) + (function "city-power-game-res" ("vinroom-movie" "city-power-game-res") dm-scene-load-pick-func) + ) + (menu + "volcano" + (function "volcano-darkeco-res" ("volcano-movie" "volcano-darkeco-res") dm-scene-load-pick-func) + (function "volcano-indax-1-intro" ("volcano-movie" "volcano-indax-1-intro") dm-scene-load-pick-func) + (function "volcano-indax-1-res" ("volcano-movie" "volcano-indax-1-res") dm-scene-load-pick-func) + (function "volcano-indax-2-intro" ("volcano-movie" "volcano-indax-2-intro") dm-scene-load-pick-func) + (function "volcano-indax-2-res" ("volcano-movie" "volcano-indax-2-res") dm-scene-load-pick-func) + ) + (menu + "warp" + (function "desert-air-train-in" ("desert-warp" "desert-air-train-in") dm-scene-load-pick-func) + (function "desert-air-train-out" ("desert-warp" "desert-air-train-out") dm-scene-load-pick-func) + (function "city-air-train-out" ("ctyport-air-train" "city-air-train-out") dm-scene-load-pick-func) + (function "city-air-train-in-desert" ("ctyport-air-train" "city-air-train-in-desert") dm-scene-load-pick-func) + ) + (menu + "wasdoors" + (function "desert-course-race-intro" ("wasdoors-desert" "desert-course-race-intro") dm-scene-load-pick-func) + (function + "desert-artifact-race-1-intro" + ("wasdoors-desert" "desert-artifact-race-1-intro") + dm-scene-load-pick-func + ) + (function + "desert-artifact-race-1-res" + ("wasdoors-desert" "desert-artifact-race-1-res") + dm-scene-load-pick-func + ) + (function + "desert-artifact-race-2-intro" + ("wasdoors-desert" "desert-artifact-race-2-intro") + dm-scene-load-pick-func + ) + (function "desert-hover-intro" ("wasdoors-desert" "desert-hover-intro") dm-scene-load-pick-func) + (function "desert-beast-battle-intro" ("wasdoors-desert" "desert-beast-battle-intro") dm-scene-load-pick-func) + (function + "desert-catch-lizards-intro" + ("wasdoors-desert" "desert-catch-lizards-intro") + dm-scene-load-pick-func + ) + ) + (menu + "wasteland" + (function "wascity-pre-game-intro" ("wascityb-seem" "wascity-pre-game-intro") dm-scene-load-pick-func) + (function "wascity-pre-game-res" ("wascityb-seem" "wascity-pre-game-res") dm-scene-load-pick-func) + (function "wascity-leaper-race-intro" ("wascitya-seem" "wascity-leaper-race-intro") dm-scene-load-pick-func) + (function "wascity-leaper-race-res" ("wascityb-flut" "wascity-leaper-race-res") dm-scene-load-pick-func) + (function "wascity-gun-intro" ("wascityb-gungame" "wascity-gun-intro") dm-scene-load-pick-func) + (function "wascity-gun-res" ("wascityb-gungame" "wascity-gun-res") dm-scene-load-pick-func) + (function "nest-eggs-intro" ("waspala-nest" "nest-eggs-intro") dm-scene-load-pick-func) + (function "wascity-defend-res" ("wascityb-gungame" "wascity-defend-res") dm-scene-load-pick-func) + ) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-task-menu arg0)) + (debug-menu-append-item s5-0 (debug-menu-make-play-menu arg0)) + ) + arg0 + ) + +;; definition for symbol *popup-menu-context*, type debug-menu-context +(define *popup-menu-context* (new 'debug 'debug-menu-context)) + +;; definition for function popup-menu-context-make-default-menus +(defun popup-menu-context-make-default-menus ((arg0 debug-menu-context)) + (debug-menu-make-from-template + arg0 + '(main-menu + "Popup" + (flag "Cam 1" pad-1 dm-cam-externalize) + (flag "Turbo Cam" *camera-turbo-free* dm-boolean-toggle-pick-func) + (flag "Target" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-forced *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Mode" + (function "normal" #f ,(lambda () (send-event *target* 'change-mode 'normal))) + (function "racer" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'racer #f) + ) + ) + (function "flut" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'flut #f) + ) + ) + (function "board" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature gun)) + (logior! (-> *game-info* debug-features) (game-feature gun)) + (send-event *target* 'change-mode 'gun #f (pickup-type none)) + ) + ) + (function + "darkjak" + #f + ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature darkjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + ) + (function + "lightjak" + #f + ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature lightjak) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'lightjak #f 5) + ) + ) + (function "indax" #f ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f) + ) + ) + (function + "invisible" + #f + ,(lambda () + (if (not *target*) + (start 'debug (get-current-continue-forced *game-info*)) + ) + (set! (-> *game-info* features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* features))) + ) + (set! (-> *game-info* debug-features) + (the-as game-feature (logior (game-feature artifact-invis) (-> *game-info* debug-features))) + ) + (send-event *target* 'change-mode 'invisible #f) + ) + ) + ) + (flag "Game" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((v1-3 (-> *game-info* mode))) + (set! (-> *game-info* mode) (cond + ((= v1-3 'play) + 'debug + ) + ((= v1-3 'debug) + 'play + ) + (else + (-> *game-info* mode) + ) + ) + ) + ) + ) + (= (-> *game-info* mode) 'play) + ) + ) + (function "Clean" #f ,(lambda () + (if (time-of-day-setup #f) + (time-of-day-setup #t) + ) + (play-clean #f) + ) + ) + (flag "Stats" *stats-target* dm-boolean-toggle-pick-func) + (function "Reset" #f ,(lambda () (reset-actors 'debug))) + (function "Start" #f ,(lambda () (start 'play (-> *game-info* current-continue)))) + (function + "Editor" + #f + ,(lambda () + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :name "editable-player" :to *entity-pool*) + (set-master-mode 'game) + ) + ) + ) + ) + arg0 + ) + +;; failed to figure out what this is: +(debug-menu-context-make-default-menus *debug-menu-context*) + +;; failed to figure out what this is: +(popup-menu-context-make-default-menus *popup-menu-context*) + +;; definition for function menu-respond-to-pause +(defun menu-respond-to-pause () + (case *master-mode* + (('menu) + (cond + ((and (cpad-hold? 0 l3) (cpad-hold? 0 select)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ((and (cpad-hold? 1 start) *editable*) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ((and (cpad-hold? 0 l3) (cpad-hold? 0 start)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ) + ) + (else + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ) + #f + ) + +;; definition for function *menu-hook* +(defun *menu-hook* () + (debug-menus-handler *debug-menu-context*) + (debug-menus-handler *popup-menu-context*) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc b/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc new file mode 100644 index 0000000000..49f0cbe2d6 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/editable-h_REF.gc @@ -0,0 +1,1359 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition for symbol *editable-temp-id*, type int +(define *editable-temp-id* 0) + +;; definition for symbol *editable-default-name*, type string +(define *editable-default-name* (new 'debug 'string 32 "undefined")) + +;; definition for function editable-command->string +(defun editable-command->string ((arg0 editable-command)) + (case arg0 + (((editable-command select-current-face)) + "select-current-face" + ) + (((editable-command camera-move)) + "camera-move" + ) + (((editable-command select-current-region)) + "select-current-region" + ) + (((editable-command insert-sample)) + "insert-sample" + ) + (((editable-command print-region-info)) + "print-region-info" + ) + (((editable-command camera-rotate)) + "camera-rotate" + ) + (((editable-command select-user1)) + "select-user1" + ) + (((editable-command select-add)) + "select-add" + ) + (((editable-command camera-xz)) + "camera-xz" + ) + (((editable-command pick-loc)) + "pick-loc" + ) + (((editable-command insert-box)) + "insert-box" + ) + (((editable-command insert-entity)) + "insert-entity" + ) + (((editable-command translate-y-level)) + "translate-y-level" + ) + (((editable-command select-user11)) + "select-user11" + ) + (((editable-command select-user10)) + "select-user10" + ) + (((editable-command select-all)) + "select-all" + ) + (((editable-command copy-region)) + "copy-region" + ) + (((editable-command select-none)) + "select-none" + ) + (((editable-command camera-zoom)) + "camera-zoom" + ) + (((editable-command delete-region)) + "delete-region" + ) + (((editable-command select-toggle)) + "select-toggle" + ) + (((editable-command copy)) + "copy" + ) + (((editable-command pick-yes-no)) + "pick-yes-no" + ) + (((editable-command insert-light)) + "insert-light" + ) + (((editable-command none)) + "none" + ) + (((editable-command select-user4)) + "select-user4" + ) + (((editable-command resize)) + "resize" + ) + (((editable-command flip-side)) + "flip-side" + ) + (((editable-command refresh-filter)) + "refresh-filter" + ) + (((editable-command cancel)) + "cancel" + ) + (((editable-command save)) + "save" + ) + (((editable-command select-user6)) + "select-user6" + ) + (((editable-command region-new)) + "region-new" + ) + (((editable-command snap-to-ground)) + "snap-to-ground" + ) + (((editable-command pick-target)) + "pick-target" + ) + (((editable-command snap-y)) + "snap-y" + ) + (((editable-command select-user8)) + "select-user8" + ) + (((editable-command select-face)) + "select-face" + ) + (((editable-command exit)) + "exit" + ) + (((editable-command drag-move)) + "drag-move" + ) + (((editable-command edit-plane-set)) + "edit-plane-set" + ) + (((editable-command select-region)) + "select-region" + ) + (((editable-command delete)) + "delete" + ) + (((editable-command select-user0)) + "select-user0" + ) + (((editable-command camera-xy)) + "camera-xy" + ) + (((editable-command select-current-owner)) + "select-current-owner" + ) + (((editable-command region-add)) + "region-add" + ) + (((editable-command insert-sphere)) + "insert-sphere" + ) + (((editable-command insert-plane)) + "insert-plane" + ) + (((editable-command drag-rotate)) + "drag-rotate" + ) + (((editable-command select-one)) + "select-one" + ) + (((editable-command update-game)) + "update-game" + ) + (((editable-command select-user2)) + "select-user2" + ) + (((editable-command select-user3)) + "select-user3" + ) + (((editable-command snap-rotate)) + "snap-rotate" + ) + (((editable-command rotate-level)) + "rotate-level" + ) + (((editable-command select-prim)) + "select-prim" + ) + (((editable-command drag-none)) + "drag-none" + ) + (((editable-command select-current-prim)) + "select-current-prim" + ) + (((editable-command select-user5)) + "select-user5" + ) + (((editable-command insert-wall)) + "insert-wall" + ) + (((editable-command insert-simple-camera)) + "insert-sample-camera" + ) + (((editable-command insert-face)) + "insert-face" + ) + (((editable-command region-set)) + "region-set" + ) + (((editable-command select-user7)) + "select-user7" + ) + (((editable-command insert-point)) + "insert-point" + ) + (((editable-command drag-resize)) + "drag-resize" + ) + (((editable-command kill)) + "kill" + ) + (((editable-command snap-xz)) + "snap-xz" + ) + (((editable-command select-user12)) + "select-user12" + ) + (((editable-command camera-tumble)) + "camera-tumble" + ) + (((editable-command select-user9)) + "select-user9" + ) + (((editable-command edit-plane-clear)) + "edit-plane-clear" + ) + (((editable-command drag-scale)) + "drag-scale" + ) + (((editable-command load)) + "load" + ) + (((editable-command select-remove)) + "select-remove" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition for function editable-filter->string +;; WARN: Return type mismatch basic vs string. +(defun editable-filter->string ((arg0 editable-filter) (arg1 basic)) + (if (= (logand arg0 (editable-filter target)) (editable-filter target)) + (format arg1 "target ") + ) + (if (= (logand arg0 (editable-filter city_vis)) (editable-filter city_vis)) + (format arg1 "city_vis ") + ) + (if (= (logand arg0 (editable-filter water-command)) (editable-filter water-command)) + (format arg1 "water-command ") + ) + (if (= (logand arg0 (editable-filter user-setting)) (editable-filter user-setting)) + (format arg1 "user-setting ") + ) + (if (= (logand arg0 (editable-filter sample)) (editable-filter sample)) + (format arg1 "sample ") + ) + (if (= (logand arg0 (editable-filter light)) (editable-filter light)) + (format arg1 "light ") + ) + (if (= (logand arg0 (editable-filter part)) (editable-filter part)) + (format arg1 "part ") + ) + (if (= (logand arg0 (editable-filter unknown)) (editable-filter unknown)) + (format arg1 "unknown ") + ) + (if (= (logand arg0 (editable-filter entity)) (editable-filter entity)) + (format arg1 "entity ") + ) + (if (= (logand arg0 (editable-filter data)) (editable-filter data)) + (format arg1 "data ") + ) + (if (= (logand arg0 (editable-filter water)) (editable-filter water)) + (format arg1 "water ") + ) + (if (= (logand arg0 (editable-filter cam-setting)) (editable-filter cam-setting)) + (format arg1 "cam-setting ") + ) + (if (= (logand (editable-filter selected) arg0) (editable-filter selected)) + (format arg1 "selected ") + ) + (if (= (logand arg0 (editable-filter none)) (editable-filter none)) + (format arg1 "none ") + ) + (if (= (logand arg0 (editable-filter camera)) (editable-filter camera)) + (format arg1 "camera ") + ) + (if (= (logand arg0 (editable-filter load)) (editable-filter load)) + (format arg1 "load ") + ) + (if (= (logand arg0 (editable-filter sound)) (editable-filter sound)) + (format arg1 "sound ") + ) + (the-as string arg1) + ) + +;; definition of type editable-region +(deftype editable-region (basic) + ((changed symbol) + (locked symbol) + (id uint64) + (filter editable-filter) + (tree symbol) + (level string) + (on-enter string) + (on-inside string) + (on-exit string) + ) + (:methods + (new (symbol type) _type_) + (editable-region-method-9 () none) + (editable-region-method-10 () none) + (editable-region-method-11 () none) + (editable-region-method-12 () none) + ) + ) + +;; definition for method 3 of type editable-region +(defmethod inspect ((this editable-region)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchanged: ~A~%" (-> this changed)) + (format #t "~1Tlocked: ~A~%" (-> this locked)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tfilter: ~D~%" (-> this filter)) + (format #t "~1Ttree: ~A~%" (-> this tree)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Ton-enter: ~A~%" (-> this on-enter)) + (format #t "~1Ton-inside: ~A~%" (-> this on-inside)) + (format #t "~1Ton-exit: ~A~%" (-> this on-exit)) + (label cfg-4) + this + ) + +;; definition of type editable +(deftype editable (basic) + ((flags editable-flag) + (name string) + (id uint32) + (region editable-region) + (owner pair) + (prefix basic) + ) + (:methods + (editable-method-9 () none) + (editable-method-10 () none) + (editable-method-11 () none) + (editable-method-12 () none) + (editable-method-13 () none) + (editable-method-14 () none) + (editable-method-15 () none) + (editable-method-16 () none) + (editable-method-17 () none) + (editable-method-18 () none) + (editable-method-19 () none) + (editable-method-20 () none) + (editable-method-21 () none) + (editable-method-22 () none) + (editable-method-23 () none) + (editable-method-24 () none) + (editable-method-25 () none) + (editable-method-26 () none) + (editable-method-27 () none) + (editable-method-28 () none) + (editable-method-29 () none) + (editable-method-30 () none) + (editable-method-31 () none) + (editable-method-32 () none) + (editable-method-33 () none) + (editable-method-34 () none) + (editable-method-35 () none) + ) + ) + +;; definition for method 3 of type editable +(defmethod inspect ((this editable)) + (when (not this) + (set! this this) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (label cfg-28) + this + ) + +;; definition of type editable-array +(deftype editable-array (basic) + ((allocated-length int32) + (length int32) + (region editable-region) + (backup-region editable-region) + (region-lock? symbol) + (move-lock? symbol) + (move-speed float) + (selection (array editable)) + (filter editable-filter 2) + (target editable) + (target-mode editable-command) + (target-command editable-command) + (target-message string) + (edit-plane editable-plane) + (edit-plane-center vector :inline) + (edit-plane-normal vector :inline) + (level-offset vector :inline) + (level-info-id uint32) + (level uint32) + (edit-param0 float) + (data editable :dynamic) + ) + (:methods + (new (symbol type int) _type_) + (editable-array-method-9 () none) + (editable-array-method-10 () none) + (editable-array-method-11 () none) + (editable-array-method-12 () none) + (editable-array-method-13 () none) + (editable-array-method-14 () none) + (editable-array-method-15 () none) + (editable-array-method-16 () none) + (editable-array-method-17 () none) + (editable-array-method-18 () none) + (editable-array-method-19 () none) + ) + ) + +;; definition for method 3 of type editable-array +(defmethod inspect ((this editable-array)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Tbackup-region: ~A~%" (-> this backup-region)) + (format #t "~1Tregion-lock?: ~A~%" (-> this region-lock?)) + (format #t "~1Tmove-lock?: ~A~%" (-> this move-lock?)) + (format #t "~1Tmove-speed: ~f~%" (-> this move-speed)) + (format #t "~1Tselection: ~`basic`P~%" (-> this selection)) + (format #t "~1Tfilter[2] @ #x~X~%" (-> this filter)) + (format #t "~1Ttarget: ~A~%" (-> this target)) + (format #t "~1Ttarget-mode: ~D~%" (-> this target-mode)) + (format #t "~1Ttarget-command: ~D~%" (-> this target-command)) + (format #t "~1Ttarget-message: ~A~%" (-> this target-message)) + (format #t "~1Tedit-plane: ~A~%" (-> this edit-plane)) + (format #t "~1Tedit-plane-center: ~`vector`P~%" (-> this edit-plane-center)) + (format #t "~1Tedit-plane-normal: ~`vector`P~%" (-> this edit-plane-normal)) + (format #t "~1Tlevel-offset: ~`vector`P~%" (-> this level-offset)) + (format #t "~1Tlevel-info-id: ~D~%" (-> this level-info-id)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tedit-param0: ~f~%" (-> this edit-param0)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data s5-0)) + ) + (label cfg-7) + this + ) + +;; definition for method 0 of type editable-array +(defmethod new editable-array ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* arg0 4)))))) + (set! (-> s5-0 allocated-length) arg0) + (set! (-> s5-0 length) 0) + (set! (-> s5-0 region) #f) + (set! (-> s5-0 backup-region) #f) + (set! (-> s5-0 region-lock?) #f) + (set! (-> s5-0 move-lock?) #f) + (set! (-> s5-0 target) #f) + (set! (-> s5-0 target-command) (editable-command none)) + (set! (-> s5-0 target-message) #f) + (set! (-> s5-0 selection) + (the-as (array editable) ((method-of-type array new) allocation array editable arg0)) + ) + (set! (-> s5-0 edit-plane) #f) + (set! (-> s5-0 filter 0) (editable-filter + none + unknown + sound + part + user-setting + cam-setting + load + water-command + city_vis + sample + light + entity + ) + ) + (set! (-> s5-0 filter 1) (editable-filter camera target water data city_vis sample light entity selected)) + (dotimes (v1-5 arg0) + (set! (-> s5-0 data v1-5) #f) + (set! (-> s5-0 selection v1-5) #f) + ) + s5-0 + ) + ) + +;; definition of type editable-point +(deftype editable-point (editable) + ((radius meters) + (trans vector :inline) + ) + (:methods + (new (symbol type vector editable-region) _type_) + ) + ) + +;; definition for method 3 of type editable-point +(defmethod inspect ((this editable-point)) + (when (not this) + (set! this this) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (label cfg-28) + this + ) + +;; definition for method 0 of type editable-point +;; INFO: Used lq/sq +(defmethod new editable-point ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (set! (-> gp-0 name) "undefined") + (set! (-> gp-0 prefix) "undefined") + (let* ((s3-0 gp-0) + (s2-0 (method-of-object s3-0 editable-method-23)) + ) + (set! arg1 (cond + (arg1 + (empty) + arg1 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s2-0) + ) + (set! (-> gp-0 trans quad) (-> arg0 quad)) + (set! (-> gp-0 radius) 2048.0) + (set! (-> gp-0 owner) '()) + gp-0 + ) + ) + +;; definition of type editable-sphere +(deftype editable-sphere (editable-point) + () + (:methods + (new (symbol type vector float editable-region) _type_) + ) + ) + +;; definition for method 3 of type editable-sphere +(defmethod inspect ((this editable-sphere)) + (when (not this) + (set! this this) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (label cfg-28) + this + ) + +;; definition for method 0 of type editable-sphere +;; INFO: Used lq/sq +(defmethod new editable-sphere ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 float) (arg2 editable-region)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 region) #f) + (set! (-> s5-0 name) "undefined") + (set! (-> s5-0 prefix) "undefined") + (let* ((s2-0 s5-0) + (s1-0 (method-of-object s2-0 editable-method-23)) + ) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s1-0) + ) + (set! (-> s5-0 trans quad) (-> arg0 quad)) + (set! (-> s5-0 radius) arg1) + (set! (-> s5-0 owner) '()) + s5-0 + ) + ) + +;; definition of type editable-sample +(deftype editable-sample (editable-point) + () + ) + +;; definition for method 3 of type editable-sample +(defmethod inspect ((this editable-sample)) + (when (not this) + (set! this this) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (label cfg-28) + this + ) + +;; definition of type editable-light +(deftype editable-light (editable-sphere) + ((direction vector :inline) + (color vector :inline) + (decay-start float) + (ambient-point-ratio float) + (brightness float) + (shadow uint32 :overlay-at (-> direction data 0)) + (shadows float 5) + (shadow-ambi float :overlay-at (-> shadows 0)) + (shadow-dir0 float :overlay-at (-> shadows 1)) + (shadow-dir1 float :overlay-at (-> shadows 2)) + (shadow-dir2 float :overlay-at (-> shadows 3)) + (shadow-dir3 float :overlay-at (-> shadows 4)) + ) + (:methods + (new (symbol type vector float editable-region) _type_) + ) + ) + +;; definition for method 3 of type editable-light +(defmethod inspect ((this editable-light)) + (when (not this) + (set! this this) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tdirection: ~`vector`P~%" (-> this direction)) + (format #t "~1Tcolor: ~`vector`P~%" (-> this color)) + (format #t "~1Tdecay-start: ~f~%" (-> this decay-start)) + (format #t "~1Tambient-point-ratio: ~f~%" (-> this ambient-point-ratio)) + (format #t "~1Tbrightness: ~f~%" (-> this brightness)) + (format #t "~1Tshadow: ~D~%" (-> this direction x)) + (format #t "~1Tshadows[5] @ #x~X~%" (-> this shadows)) + (format #t "~1Tshadow-ambi: ~f~%" (-> this shadow-ambi)) + (format #t "~1Tshadow-dir0: ~f~%" (-> this shadow-dir0)) + (format #t "~1Tshadow-dir1: ~f~%" (-> this shadow-dir1)) + (format #t "~1Tshadow-dir2: ~f~%" (-> this shadow-dir2)) + (format #t "~1Tshadow-dir3: ~f~%" (-> this shadow-dir3)) + (label cfg-28) + this + ) + +;; definition for method 0 of type editable-light +;; INFO: Used lq/sq +(defmethod new editable-light ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 float) (arg2 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (let* ((s2-0 gp-0) + (s1-0 (method-of-object s2-0 editable-method-23)) + ) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s1-0) + ) + (set! (-> gp-0 trans quad) (-> arg0 quad)) + (set! (-> gp-0 radius) arg1) + (set! (-> gp-0 owner) '()) + (set! (-> gp-0 prefix) (new 'debug 'string 32 *editable-default-name*)) + (let ((s5-1 (new 'debug 'string 32 (the-as string #f)))) + (format s5-1 "~s-~d" (-> gp-0 prefix) *editable-temp-id*) + (set! (-> gp-0 name) s5-1) + ) + (set! *editable-temp-id* (+ *editable-temp-id* 1)) + (set! (-> gp-0 decay-start) 0.5) + (set! (-> gp-0 ambient-point-ratio) 1.0) + (set! (-> gp-0 brightness) 1.0) + (set-vector! (-> gp-0 color) 1.0 1.0 1.0 -1.0) + (set-vector! (-> gp-0 direction) 0.0 0.0 0.0 0.0) + (set! (-> gp-0 shadow-ambi) 1.0) + (set! (-> gp-0 shadow-dir0) 1.0) + (set! (-> gp-0 shadow-dir1) 1.0) + (set! (-> gp-0 shadow-dir2) 1.0) + (set! (-> gp-0 shadow-dir3) 1.0) + gp-0 + ) + ) + +;; definition of type editable-entity +(deftype editable-entity (editable-point) + ((angles euler-angles :inline) + (idx int32) + ) + (:methods + (new (symbol type vector float editable-region) _type_) + (editable-entity-method-36 () none) + ) + ) + +;; definition for method 3 of type editable-entity +(defmethod inspect ((this editable-entity)) + (when (not this) + (set! this this) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tangles: #~%" (-> this angles)) + (format #t "~1Tidx: ~D~%" (-> this idx)) + (label cfg-28) + this + ) + +;; definition for method 0 of type editable-entity +;; INFO: Used lq/sq +(defmethod new editable-entity ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 float) (arg2 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (let* ((s2-0 gp-0) + (s1-0 (method-of-object s2-0 editable-method-23)) + ) + (set! arg2 (cond + (arg2 + (empty) + arg2 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s1-0) + ) + (set! (-> gp-0 trans quad) (-> arg0 quad)) + (set! (-> gp-0 radius) arg1) + (set! (-> gp-0 owner) '()) + (set! (-> gp-0 prefix) (new 'debug 'string 32 "entity")) + (set! (-> gp-0 name) (new 'debug 'string 32 "entity")) + gp-0 + ) + ) + +;; definition of type editable-face +(deftype editable-face (editable) + ((length int32) + (normal vector :inline) + (center vector :inline) + (vertex editable-point 6) + ) + (:methods + (new (symbol type editable-region) _type_) + (editable-face-method-36 () none) + (editable-face-method-37 () none) + ) + ) + +;; definition for method 3 of type editable-face +(defmethod inspect ((this editable-face)) + (when (not this) + (set! this this) + (goto cfg-31) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tcenter: ~`vector`P~%" (-> this center)) + (format #t "~1Tvertex[6] @ #x~X~%" (-> this vertex)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D]~1Tvertex: ~A~%" s5-1 (-> this vertex s5-1)) + ) + (label cfg-31) + this + ) + +;; definition for method 0 of type editable-face +(defmethod new editable-face ((allocation symbol) (type-to-make type) (arg0 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (set! (-> gp-0 name) "undefined") + (set! (-> gp-0 prefix) "undefined") + (let* ((s4-0 gp-0) + (s3-0 (method-of-object s4-0 editable-method-23)) + ) + (set! arg0 (cond + (arg0 + (empty) + arg0 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s3-0) + ) + (set! (-> gp-0 owner) '()) + gp-0 + ) + ) + +;; definition of type editable-plane +(deftype editable-plane (editable) + ((length int32) + (radius meters) + (vertex editable-point 2) + ) + (:methods + (new (symbol type editable-region) _type_) + (editable-plane-method-36 () none) + (editable-plane-method-37 () none) + ) + ) + +;; definition for method 3 of type editable-plane +(defmethod inspect ((this editable-plane)) + (when (not this) + (set! this this) + (goto cfg-31) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) + (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) + (format #t "no-save ") + ) + (if (= (logand s5-0 (editable-flag top-set)) (editable-flag top-set)) + (format #t "top-set ") + ) + (if (= (logand s5-0 (editable-flag orient)) (editable-flag orient)) + (format #t "orient ") + ) + (if (= (logand s5-0 (editable-flag z)) (editable-flag z)) + (format #t "z ") + ) + (if (= (logand s5-0 (editable-flag y)) (editable-flag y)) + (format #t "y ") + ) + (if (= (logand s5-0 (editable-flag x)) (editable-flag x)) + (format #t "x ") + ) + (if (= (logand s5-0 (editable-flag changed)) (editable-flag changed)) + (format #t "changed ") + ) + (if (= (logand s5-0 (editable-flag no-plane-snap)) (editable-flag no-plane-snap)) + (format #t "no-plane-snap ") + ) + (if (= (logand s5-0 (editable-flag mark)) (editable-flag mark)) + (format #t "mark ") + ) + (if (= (logand s5-0 (editable-flag bot-set)) (editable-flag bot-set)) + (format #t "bot-set ") + ) + (if (= (logand s5-0 (editable-flag selected)) (editable-flag selected)) + (format #t "selected ") + ) + (if (= (logand s5-0 (editable-flag no-update)) (editable-flag no-update)) + (format #t "no-update ") + ) + ) + (format #t ")~%") + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Tvertex[2] @ #x~X~%" (-> this vertex)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D]~1Tvertex: ~A~%" s5-1 (-> this vertex s5-1)) + ) + (label cfg-31) + this + ) + +;; definition for method 0 of type editable-plane +(defmethod new editable-plane ((allocation symbol) (type-to-make type) (arg0 editable-region)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 region) #f) + (set! (-> gp-0 name) "undefined") + (set! (-> gp-0 prefix) "undefined") + (let* ((s4-0 gp-0) + (s3-0 (method-of-object s4-0 editable-method-23)) + ) + (set! arg0 (cond + (arg0 + (empty) + arg0 + ) + (else + (new 'debug 'editable-region) + ) + ) + ) + (s3-0) + ) + (set! (-> gp-0 owner) '()) + (set! (-> gp-0 radius) 20480.0) + gp-0 + ) + ) + +;; definition of type editable-player +(deftype editable-player (process-drawable) + ((current editable-array) + (current-command uint32) + (select-command function) + (drag-command uint32) + (extra-command function) + (left-handed basic) + (light-names basic) + (external-cam-mode symbol) + (command editable-command 6) + (close-menu-time time-frame) + (mouse-pos vector :inline) + (mouse-end vector :inline) + (manipulator manipulator :inline) + (mouse-box vector 2 :inline) + (mouse-hit vector :inline) + (mouse-normal vector :inline) + (float-variable float) + (float-step float) + (float-max float) + (float-min float) + (float-id uint32) + ) + (:methods + (editable-player-method-20 () none) + (editable-player-method-21 () none) + (editable-player-method-22 () none) + (editable-player-method-23 () none) + ) + ) + +;; definition for method 3 of type editable-player +(defmethod inspect ((this editable-player)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcurrent: ~A~%" (-> this current)) + (format #t "~2Tcurrent-command: ~D~%" (-> this current-command)) + (format #t "~2Tselect-command: ~D~%" (-> this select-command)) + (format #t "~2Tdrag-command: ~D~%" (-> this drag-command)) + (format #t "~2Textra-command: ~D~%" (-> this extra-command)) + (format #t "~2Tleft-handed: ~A~%" (-> this left-handed)) + (format #t "~2Tlight-names: ~A~%" (-> this light-names)) + (format #t "~2Texternal-cam-mode: ~A~%" (-> this external-cam-mode)) + (format #t "~2Tcommand[6] @ #x~X~%" (-> this command)) + (format #t "~2Tclose-menu-time: ~D~%" (-> this close-menu-time)) + (format #t "~2Tmouse-pos: #~%" (-> this mouse-pos)) + (format #t "~2Tmouse-end: #~%" (-> this mouse-end)) + (format #t "~2Tmanipulator: #~%" (-> this manipulator)) + (format #t "~2Tmouse-box[2] @ #x~X~%" (-> this mouse-box)) + (format #t "~2Tmouse-hit: #~%" (-> this mouse-hit)) + (format #t "~2Tmouse-normal: #~%" (-> this mouse-normal)) + (format #t "~2Tfloat-variable: ~f~%" (-> this float-variable)) + (format #t "~2Tfloat-step: ~f~%" (-> this float-step)) + (format #t "~2Tfloat-max: ~f~%" (-> this float-max)) + (format #t "~2Tfloat-min: ~f~%" (-> this float-min)) + (format #t "~2Tfloat-id: ~D~%" (-> this float-id)) + (label cfg-4) + this + ) + +;; definition of type editable-work +(deftype editable-work (basic) + ((num-found int16) + (last-found int16) + (last-x float) + (last-y float) + (hide symbol) + (found editable 256) + (dists uint32 256) + ) + ) + +;; definition for method 3 of type editable-work +(defmethod inspect ((this editable-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-found: ~D~%" (-> this num-found)) + (format #t "~1Tlast-found: ~D~%" (-> this last-found)) + (format #t "~1Tlast-x: ~f~%" (-> this last-x)) + (format #t "~1Tlast-y: ~f~%" (-> this last-y)) + (format #t "~1Thide: ~A~%" (-> this hide)) + (format #t "~1Tfound[256] @ #x~X~%" (-> this found)) + (format #t "~1Tdists[256] @ #x~X~%" (-> this dists)) + (label cfg-4) + this + ) + +;; definition for symbol *editable-work*, type editable-work +(define *editable-work* (new 'global 'editable-work)) + +;; definition for symbol *editable*, type (pointer editable-player) +(define *editable* (the-as (pointer editable-player) #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc b/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc new file mode 100644 index 0000000000..0e52a25d51 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/debug/manipulator_REF.gc @@ -0,0 +1,689 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition of type manipulator +(deftype manipulator (structure) + ((action manipulator-action) + (mode manipulator-mode) + (dragging? symbol) + (position vector :inline) + (speed vector :inline) + (drag-ref-position vector :inline) + (mouse-ref-position vector :inline) + (mat matrix :inline) + (rotate-ref int32) + (angles euler-angles :inline) + ) + (:methods + (set-mode (_type_ manipulator-mode) none) + (manipulator-method-10 (_type_) none) + (manipulator-method-11 (_type_) none) + (manipulator-method-12 (_type_ vector) none) + (manipulator-method-13 (_type_ vector vector) none) + (manipulator-method-14 (_type_) none) + ) + ) + +;; definition for method 3 of type manipulator +(defmethod inspect ((this manipulator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'manipulator) + (format #t "~1Taction: ~D~%" (-> this action)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tdragging?: ~A~%" (-> this dragging?)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tspeed: #~%" (-> this speed)) + (format #t "~1Tdrag-ref-position: #~%" (-> this drag-ref-position)) + (format #t "~1Tmouse-ref-position: #~%" (-> this mouse-ref-position)) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Trotate-ref: ~D~%" (-> this rotate-ref)) + (format #t "~1Tangles: #~%" (-> this angles)) + (label cfg-4) + this + ) + +;; definition for function draw-axis +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defun draw-axis ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 rgba)) + (local-vars + (sv-160 int) + (sv-176 (function symbol bucket-id vector vector vector rgba symbol)) + (sv-192 symbol) + (sv-208 int) + (sv-224 vector) + (sv-240 vector) + (sv-256 vector) + (sv-272 vector) + (sv-288 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (cond + ((< (fabs (vector-dot arg1 *x-vector*)) 0.5) + (vector-cross! s1-0 *x-vector* arg1) + ) + ((< (fabs (vector-dot arg1 *y-vector*)) 0.5) + (vector-cross! s1-0 *y-vector* arg1) + ) + (else + (vector-cross! s1-0 *z-vector* arg1) + ) + ) + (vector-cross! s1-0 s1-0 arg1) + (vector-normalize! s1-0 1.0) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (let ((v1-10 arg0)) + (let ((a0-8 arg1)) + (let ((a1-10 arg2)) + (.mov vf7 a1-10) + ) + (.lvf vf5 (&-> a0-8 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s0-0 quad) vf6) + (set! sv-160 0) + (while (< sv-160 8) + (set! sv-176 add-debug-flat-triangle) + (set! sv-192 #t) + (set! sv-208 584) + (set! sv-224 (new 'stack-no-clear 'vector)) + (let ((v1-16 s0-0)) + (let ((a0-9 arg1)) + (let ((a1-11 arg3)) + (.mov vf7 a1-11) + ) + (.lvf vf5 (&-> a0-9 quad)) + ) + (.lvf vf4 (&-> v1-16 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-224 quad) vf6) + (set! sv-256 (new 'stack-no-clear 'vector)) + (set! sv-240 s0-0) + (let* ((a2-3 + (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) arg1 (* 182.04445 (the float (* 45 sv-160)))) + ) + (v1-22 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-3)) + ) + (let ((a0-13 (* 0.25 arg3))) + (.mov vf7 a0-13) + ) + (.lvf vf5 (&-> v1-22 quad)) + ) + (.lvf vf4 (&-> sv-240 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-256 quad) vf6) + (set! sv-288 (new 'stack-no-clear 'vector)) + (set! sv-272 s0-0) + (let* ((a2-7 (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + arg1 + (* 182.04445 (the float (* 45 (+ sv-160 1)))) + ) + ) + (v1-29 (vector-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 a2-7)) + ) + (let ((a0-17 (* 0.25 arg3))) + (.mov vf7 a0-17) + ) + (.lvf vf5 (&-> v1-29 quad)) + ) + (.lvf vf4 (&-> sv-272 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> sv-288 quad) vf6) + (let ((t1-0 arg4)) + (sv-176 sv-192 (the-as bucket-id sv-208) sv-224 sv-256 sv-288 t1-0) + ) + (set! sv-160 (+ sv-160 1)) + ) + ) + ) + (add-debug-vector #t (bucket-id debug-no-zbuf2) arg0 arg1 arg2 arg4) + (none) + ) + ) + +;; definition for method 9 of type manipulator +;; WARN: Return type mismatch int vs none. +(defmethod set-mode ((this manipulator) (arg0 manipulator-mode)) + (set! (-> this mode) arg0) + 0 + (none) + ) + +;; definition for method 10 of type manipulator +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 11 of type manipulator +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manipulator-method-11 ((this manipulator)) + (local-vars (sv-240 rgba) (sv-256 vector) (sv-272 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (format *stdcon* "~M ~M ~M~%" (-> this position x) (-> this position y) (-> this position z)) + (let ((s5-0 (-> this position))) + 0.0 + (let* ((v0-1 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> *math-camera* trans) (-> this position)) 1.0) + ) + (s4-0 (< (fabs (vector-dot v0-1 (the-as vector (-> this mat)))) 0.9)) + (s3-0 (< (fabs (vector-dot v0-1 (-> this mat uvec))) 0.9)) + (s2-0 (< (fabs (vector-dot v0-1 (-> this mat fvec))) 0.9)) + (f30-1 (* 0.15 (vector-vector-distance (-> *math-camera* trans) s5-0))) + ) + (if s4-0 + (draw-axis + s5-0 + (the-as vector (-> this mat)) + f30-1 + (* 0.25 f30-1) + (if (= (-> this action) (manipulator-action ma1)) + *color-yellow* + *color-red* + ) + ) + ) + (if s3-0 + (draw-axis s5-0 (-> this mat uvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma2)) + *color-yellow* + *color-green* + ) + ) + ) + (if s2-0 + (draw-axis s5-0 (-> this mat fvec) f30-1 (* 0.25 f30-1) (if (= (-> this action) (manipulator-action ma3)) + *color-yellow* + *color-blue* + ) + ) + ) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + ) + (let ((f28-0 0.1)) + (if (= (-> this action) (manipulator-action ma7)) + (set! sv-240 *color-yellow*) + (set! sv-240 *color-light-blue*) + ) + (let ((a1-7 s1-0)) + (let ((v1-26 s5-0)) + (let ((a0-13 (vector+! + (new 'stack-no-clear 'vector) + (the-as vector (-> *math-camera* inv-camera-rot)) + (-> *math-camera* inv-camera-rot uvec) + ) + ) + ) + (let ((a2-6 (* f30-1 f28-0))) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-13 quad)) + ) + (.lvf vf4 (&-> v1-26 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-7 quad) vf6) + ) + (let ((a0-14 s0-0)) + (let ((v1-27 s1-0)) + (let ((a1-9 (-> *math-camera* inv-camera-rot uvec))) + (let ((a2-8 (* -2.0 f30-1 f28-0))) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-9 quad)) + ) + (.lvf vf4 (&-> v1-27 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-14 quad) vf6) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (let ((a0-18 s0-0)) + (let ((v1-29 s0-0)) + (let ((a1-12 (-> *math-camera* inv-camera-rot))) + (let ((a2-11 (* -2.0 f30-1 f28-0))) + (.mov vf7 a2-11) + ) + (.lvf vf5 (&-> a1-12 rvec quad)) + ) + (.lvf vf4 (&-> v1-29 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-18 quad) vf6) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (let ((a0-22 s0-0)) + (let ((v1-31 s0-0)) + (let ((a1-15 (-> *math-camera* inv-camera-rot uvec))) + (let ((a2-14 (* 2.0 f30-1 f28-0))) + (.mov vf7 a2-14) + ) + (.lvf vf5 (&-> a1-15 quad)) + ) + (.lvf vf4 (&-> v1-31 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-22 quad) vf6) + ) + (add-debug-line #t (bucket-id debug-no-zbuf1) s1-0 s0-0 sv-240 #f (the-as rgba -1)) + (set! (-> s1-0 quad) (-> s0-0 quad)) + (let ((a0-26 s0-0)) + (let ((v1-33 s0-0)) + (let ((a1-18 (-> *math-camera* inv-camera-rot))) + (let ((a2-17 (* 2.0 f30-1 f28-0))) + (.mov vf7 a2-17) + ) + (.lvf vf5 (&-> a1-18 rvec quad)) + ) + (.lvf vf4 (&-> v1-33 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-26 quad) vf6) + ) + ) + (let ((t9-9 add-debug-line) + (a0-27 #t) + (a1-19 577) + (t1-3 #f) + (t2-3 -1) + ) + (t9-9 a0-27 (the-as bucket-id a1-19) s1-0 s0-0 sv-240 t1-3 (the-as rgba t2-3)) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (when (and s3-0 s2-0) + (let ((a1-20 s1-1)) + (let ((v1-36 s5-0)) + (let ((a0-29 (vector+! (new 'stack-no-clear 'vector) (-> this mat fvec) (-> this mat uvec)))) + (let ((a2-20 f30-1)) + (.mov vf7 a2-20) + ) + (.lvf vf5 (&-> a0-29 quad)) + ) + (.lvf vf4 (&-> v1-36 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-20 quad) vf6) + ) + (let ((s0-1 draw-axis)) + (set! sv-256 s1-1) + (let ((a1-22 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec))) + (a2-21 (* 0.15 f30-1)) + (a3-11 (* 0.15 f30-1)) + (t0-11 (if (= (-> this action) (manipulator-action ma6)) + *color-yellow* + *color-green* + ) + ) + ) + (s0-1 sv-256 a1-22 a2-21 a3-11 t0-11) + ) + ) + (let ((s0-2 draw-axis)) + (set! sv-272 s1-1) + (let ((a1-24 (vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec))) + (a2-22 (* 0.15 f30-1)) + (a3-12 (* 0.15 f30-1)) + (t0-12 (if (= (-> this action) (manipulator-action ma6)) + *color-yellow* + *color-blue* + ) + ) + ) + (s0-2 sv-272 a1-24 a2-22 a3-12 t0-12) + ) + ) + ) + (set! s2-0 (and s4-0 s2-0)) + (when s2-0 + (let ((a1-25 s1-1)) + (let ((v1-44 s5-0)) + (let ((a0-37 (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> this mat)) (-> this mat fvec)))) + (let ((a2-24 f30-1)) + (.mov vf7 a2-24) + ) + (.lvf vf5 (&-> a0-37 quad)) + ) + (.lvf vf4 (&-> v1-44 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-25 quad) vf6) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (the-as vector (-> this mat))) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma5)) + *color-yellow* + *color-red* + ) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (-> this mat fvec)) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma5)) + *color-yellow* + *color-blue* + ) + ) + ) + (set! s3-0 (and s4-0 s3-0)) + (when s3-0 + (let ((a0-44 s1-1)) + (let ((v1-52 (vector+! (new 'stack-no-clear 'vector) (the-as vector (-> this mat)) (-> this mat uvec)))) + (let ((a1-31 f30-1)) + (.mov vf7 a1-31) + ) + (.lvf vf5 (&-> v1-52 quad)) + ) + (.lvf vf4 (&-> s5-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-44 quad) vf6) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (the-as vector (-> this mat))) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma4)) + *color-yellow* + *color-red* + ) + ) + (draw-axis + s1-1 + (vector-negate! (new 'stack-no-clear 'vector) (-> this mat uvec)) + (* 0.15 f30-1) + (* 0.15 f30-1) + (if (= (-> this action) (manipulator-action ma4)) + *color-yellow* + *color-green* + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 12 of type manipulator +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manipulator-method-12 ((this manipulator) (arg0 vector)) + (set! (-> this rotate-ref) (the int (-> *mouse* posx))) + (set! (-> this mouse-ref-position quad) (-> arg0 quad)) + (set! (-> this drag-ref-position quad) (-> this position quad)) + (set! (-> this dragging?) #t) + (set! (-> this speed quad) (the-as uint128 0)) + 0 + (none) + ) + +;; definition for method 13 of type manipulator +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manipulator-method-13 ((this manipulator) (arg0 vector) (arg1 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (cond + ((= (-> this mode) (manipulator-mode mm0)) + (set! (-> this speed quad) (-> this position quad)) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this mouse-ref-position) arg0)) + ) + 0.0 + 0.0 + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (cond + ((or (= (-> this action) (manipulator-action ma1)) + (= (-> this action) (manipulator-action ma2)) + (= (-> this action) (manipulator-action ma3)) + ) + (cond + ((= (-> this action) (manipulator-action ma1)) + (cond + ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (-> this mat fvec)))) + (set! (-> s2-0 quad) (-> this mat fvec quad)) + (set! (-> s1-0 quad) (-> this mat uvec quad)) + ) + (else + (set! (-> s2-0 quad) (-> this mat uvec quad)) + (set! (-> s1-0 quad) (-> this mat fvec quad)) + ) + ) + ) + ((= (-> this action) (manipulator-action ma2)) + (cond + ((< (fabs (vector-dot s5-1 (the-as vector (-> this mat)))) (fabs (vector-dot s5-1 (-> this mat fvec)))) + (set! (-> s2-0 quad) (-> this mat fvec quad)) + (set! (-> s1-0 quad) (-> this mat rvec quad)) + ) + (else + (set! (-> s2-0 quad) (-> this mat rvec quad)) + (set! (-> s1-0 quad) (-> this mat fvec quad)) + ) + ) + ) + ((= (-> this action) (manipulator-action ma3)) + (cond + ((< (fabs (vector-dot s5-1 (-> this mat uvec))) (fabs (vector-dot s5-1 (the-as vector (-> this mat))))) + (set! (-> s2-0 quad) (-> this mat rvec quad)) + (set! (-> s1-0 quad) (-> this mat uvec quad)) + ) + (else + (set! (-> s2-0 quad) (-> this mat uvec quad)) + (set! (-> s1-0 quad) (-> this mat rvec quad)) + ) + ) + ) + ) + (let ((f30-0 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0)) + (f0-11 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0)) + ) + (let ((a1-3 s5-1)) + (let ((v1-41 arg0)) + (let ((a0-43 s5-1)) + (let ((a2-3 f30-0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-43 quad)) + ) + (.lvf vf4 (&-> v1-41 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-3 quad) vf6) + ) + (let ((a0-44 s4-1)) + (let ((v1-42 s4-1)) + (let ((a1-4 f0-11)) + (.mov vf7 a1-4) + ) + (.lvf vf5 (&-> v1-42 quad)) + ) + (.lvf vf4 (&-> arg0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-44 quad) vf6) + ) + ) + (vector-flatten! s5-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this position)) s1-0) + (vector-flatten! s4-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this position)) s1-0) + (let ((v1-46 (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1))) + (vector+! (-> this position) (-> this drag-ref-position) v1-46) + (format *stdcon* "delta ~M ~M ~M~%" (-> v1-46 x) (-> v1-46 y) (-> v1-46 z)) + ) + ) + ((or (= (-> this action) (manipulator-action ma4)) + (= (-> this action) (manipulator-action ma5)) + (= (-> this action) (manipulator-action ma6)) + (= (-> this action) (manipulator-action ma7)) + ) + (cond + ((= (-> this action) (manipulator-action ma4)) + (set! (-> s2-0 quad) (-> *z-vector* quad)) + ) + ((= (-> this action) (manipulator-action ma5)) + (set! (-> s2-0 quad) (-> *y-vector* quad)) + ) + ((= (-> this action) (manipulator-action ma6)) + (set! (-> s2-0 quad) (-> *x-vector* quad)) + ) + ((= (-> this action) (manipulator-action ma7)) + (set! (-> s2-0 quad) (-> *math-camera* inv-camera-rot fvec quad)) + ) + ) + (vector-normalize! s2-0 1.0) + (let ((f30-1 (intersect-ray-plane arg0 s5-1 (-> this position) s2-0)) + (f0-15 (intersect-ray-plane arg0 s4-1 (-> this position) s2-0)) + ) + (let ((a1-14 s5-1)) + (let ((v1-69 arg0)) + (let ((a0-69 s5-1)) + (let ((a2-13 f30-1)) + (.mov vf7 a2-13) + ) + (.lvf vf5 (&-> a0-69 quad)) + ) + (.lvf vf4 (&-> v1-69 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-14 quad) vf6) + ) + (let ((v1-70 s4-1)) + (let ((a0-70 arg0)) + (let ((a1-15 s4-1)) + (let ((a2-14 f0-15)) + (.mov vf7 a2-14) + ) + (.lvf vf5 (&-> a1-15 quad)) + ) + (.lvf vf4 (&-> a0-70 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-70 quad) vf6) + ) + ) + (vector+! (-> this position) (-> this drag-ref-position) (vector-! (new 'stack-no-clear 'vector) s5-1 s4-1)) + ) + ) + ) + ) + (vector-! (-> this speed) (-> this position) (-> this speed)) + ) + ((= (-> this mode) (manipulator-mode mm1)) + (let ((s4-2 (- (-> this rotate-ref) (the int (-> *mouse* posx)))) + (s5-2 (new 'stack-no-clear 'matrix)) + ) + (new 'stack 'euler-angles) + (matrix-identity! s5-2) + (cond + ((= (-> this action) (manipulator-action ma1)) + (matrix-axis-angle! s5-2 (the-as vector (-> this mat)) (* 182.04445 (the float s4-2))) + ) + ((= (-> this action) (manipulator-action ma2)) + (matrix-axis-angle! s5-2 (-> this mat uvec) (* 182.04445 (the float s4-2))) + ) + ((= (-> this action) (manipulator-action ma3)) + (matrix-axis-angle! s5-2 (-> this mat fvec) (* 182.04445 (the float s4-2))) + ) + ) + (matrix*! (-> this mat) (-> this mat) s5-2) + ) + (vector-normalize! (the-as vector (-> this mat)) 1.0) + (vector-normalize! (-> this mat uvec) 1.0) + (vector-normalize! (-> this mat fvec) 1.0) + (matrix->eul (-> this angles) (-> this mat) 21) + (format *stdcon* "X = ~R~%Y = ~R~%Z = ~R~%" (-> this angles x) (-> this angles y) (-> this angles z)) + (set! (-> this rotate-ref) (the int (-> *mouse* posx))) + ) + (else + ) + ) + 0 + (none) + ) + ) + +;; definition for method 14 of type manipulator +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod manipulator-method-14 ((this manipulator)) + (set! (-> this speed quad) (the-as uint128 0)) + (set! (-> this dragging?) #f) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/debug/menu_REF.gc b/test/decompiler/reference/jak3/engine/debug/menu_REF.gc index 0c1bf12429..b01a8a1e6a 100644 --- a/test/decompiler/reference/jak3/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak3/engine/debug/menu_REF.gc @@ -899,7 +899,7 @@ ) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (draw-string-adv (-> arg0 name) s3-0 s5-0) (draw-string-adv "..." s3-0 s5-0) @@ -936,7 +936,7 @@ ) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (set-context! *font-work* s5-0) (draw-string (-> arg0 name) s3-0 s5-0) @@ -973,7 +973,7 @@ ) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (set-context! *font-work* s5-0) (draw-string (-> arg0 name) s3-0 s5-0) @@ -1007,7 +1007,7 @@ ) ) (with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (draw-string-adv (-> arg0 name) s1-0 s5-0) (draw-string-adv ":" s1-0 s5-0) @@ -1091,7 +1091,7 @@ ) ) (with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (bucket-id bucket585) + (bucket-id debug-menu) ) (draw-sprite2d-xy s0-0 @@ -1136,7 +1136,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id bucket585) + (bucket-id debug-menu) sv-32 (the-as (pointer dma-tag) a3-3) ) @@ -1671,7 +1671,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc index e52fa79674..2ae12e1084 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable-tree-h_REF.gc @@ -13,12 +13,9 @@ Generally, the object passed to a large renderer is a drawable-tree." ;; definition of type drawable-tree-array (deftype drawable-tree-array (drawable-group) "Collection of drawable trees. This might have a tfrag tree, tie tree, etc." - () + ((trees drawable-tree :dynamic :offset 32) + ) ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable-tree_REF.gc index 0ae495dfaf..9f5533a3b2 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable-tree_REF.gc @@ -11,7 +11,7 @@ ) (else (dotimes (s5-0 (-> this length)) - (draw (-> this data s5-0)) + (draw (-> this trees s5-0)) ) ) ) @@ -26,7 +26,7 @@ This is only called when viewing stats. The vis-bits and culling registers are loaded during this time." (dotimes (s5-0 (-> this length)) - (collect-stats (-> this data s5-0)) + (collect-stats (-> this trees s5-0)) ) 0 (none) @@ -37,7 +37,7 @@ (defmethod debug-draw ((this drawable-tree-array)) "Debug-draw a drawable and its children. Typically uses the debug-draw functions." (dotimes (s5-0 (-> this length)) - (debug-draw (-> this data s5-0)) + (debug-draw (-> this trees s5-0)) ) 0 (none) @@ -95,7 +95,3 @@ ) arg1 ) - - - - diff --git a/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc index c407c89a99..21ed27d8a3 100644 --- a/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/draw/drawable_REF.gc @@ -177,7 +177,7 @@ (when (sphere-cull (-> arg0 bsphere)) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> arg0 bsphere) (-> arg0 bsphere w) (new 'static 'rgba :r #x80 :a #x80) @@ -282,7 +282,7 @@ Yes it says instance. No it does not return an instance." (let ((s5-0 (-> arg1 bsp drawable-trees))) (dotimes (s4-0 (-> s5-0 length)) - (let ((v1-3 (-> s5-0 data s4-0))) + (let ((v1-3 (-> s5-0 trees s4-0))) (case (-> v1-3 type) ((drawable-tree-instance-shrub) (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-3) info prototype-inline-array-shrub))) @@ -357,7 +357,7 @@ (when (or (not arg2) (= a3-4 arg2)) (let ((a3-5 (-> a3-4 drawable-trees))) (dotimes (t0-5 (-> a3-5 length)) - (let ((t1-3 (-> a3-5 data t0-5))) + (let ((t1-3 (-> a3-5 trees t0-5))) (case (-> t1-3 type) ((drawable-tree-instance-shrub) (when (= arg0 (-> t1-3 type)) @@ -425,7 +425,7 @@ (format #t "-------- level ~S~%" (-> s5-0 name)) (let ((s5-1 (-> s5-0 bsp drawable-trees))) (dotimes (s4-0 (-> s5-1 length)) - (let ((v1-8 (-> s5-1 data s4-0))) + (let ((v1-8 (-> s5-1 trees s4-0))) (case (-> v1-8 type) ((drawable-tree-instance-shrub) (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-8) info prototype-inline-array-shrub))) @@ -542,7 +542,7 @@ (when (= (-> v1-5 status) 'active) (let ((s3-0 (-> v1-5 bsp drawable-trees))) (dotimes (s2-0 (-> s3-0 length)) - (let ((v1-9 (-> s3-0 data s2-0))) + (let ((v1-9 (-> s3-0 trees s2-0))) (case (-> v1-9 type) ((drawable-tree-instance-shrub) ) @@ -2603,7 +2603,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/entity/entity_REF.gc b/test/decompiler/reference/jak3/engine/entity/entity_REF.gc index d7b979ab56..3411c99aca 100644 --- a/test/decompiler/reference/jak3/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak3/engine/entity/entity_REF.gc @@ -1282,7 +1282,7 @@ (if (and (nonzero? (-> (the-as process-drawable arg0) draw)) *display-actor-vis*) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> (the-as process-drawable arg0) draw origin) (-> (the-as process-drawable arg0) draw bounds w) (new 'static 'rgba :r #x80 :a #x80) @@ -1518,7 +1518,7 @@ ) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> (the-as process-drawable s0-2) draw origin) (-> (the-as process-drawable s0-2) draw bounds w) (new 'static 'rgba :r #x80 :a #x80) @@ -2763,7 +2763,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/entity/relocate_REF.gc b/test/decompiler/reference/jak3/engine/entity/relocate_REF.gc new file mode 100644 index 0000000000..51f27b86df --- /dev/null +++ b/test/decompiler/reference/jak3/engine/entity/relocate_REF.gc @@ -0,0 +1,446 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 7 of type process +(defmethod relocate ((this process) (offset int)) + (let ((v1-0 *kernel-context*)) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) + (set! (-> v1-0 relocating-max) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) + ) + (set! (-> v1-0 relocating-offset) offset) + ) + (&+! (-> this ppointer 0) offset) + (let ((v1-5 (-> this entity))) + (if (and v1-5 (= (-> v1-5 extra process) this)) + (&+! (-> v1-5 extra process) offset) + ) + ) + (let ((v1-7 (-> this connection-list next1))) + (while (the-as connection v1-7) + (let ((a0-14 (-> v1-7 prev1))) + (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) + (< (the-as int a0-14) (-> *kernel-context* relocating-max)) + ) + (&+! (-> v1-7 prev1) offset) + ) + ) + (let ((a0-19 (-> (the-as connection v1-7) param1))) + (if (and (>= (the-as int a0-19) (-> *kernel-context* relocating-min)) + (< (the-as int a0-19) (-> *kernel-context* relocating-max)) + ) + (&+! (-> (the-as connection v1-7) param1) offset) + ) + ) + (let ((a0-24 (-> (the-as connection v1-7) param2))) + (if (and (>= a0-24 (-> *kernel-context* relocating-min)) (< a0-24 (-> *kernel-context* relocating-max))) + (+! (-> (the-as connection v1-7) param2) offset) + ) + ) + (let ((a0-29 (-> (the-as connection v1-7) param3))) + (if (and (>= a0-29 (-> *kernel-context* relocating-min)) (< a0-29 (-> *kernel-context* relocating-max))) + (+! (-> (the-as connection v1-7) param3) offset) + ) + ) + (set! v1-7 (-> (the-as connection v1-7) next1)) + ) + ) + (let ((v1-10 (-> this self))) + (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) + (< (the-as int v1-10) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this self) offset) + ) + ) + (let ((v1-15 (-> this ppointer))) + (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) + (< (the-as int v1-15) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this ppointer) offset) + ) + ) + (let ((s4-0 (&+ (-> this heap-base) 4))) + (while (< (the-as int s4-0) (the-as int (-> this heap-cur))) + (relocate s4-0 offset) + (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) + ) + ) + (&+! (-> this main-thread) offset) + (&+! (-> this top-thread) offset) + (if (-> this state-stack) + (&+! (-> this state-stack) offset) + ) + (&+! (-> this heap-base) offset) + (&+! (-> this heap-cur) offset) + (&+! (-> this heap-top) offset) + (let ((a2-4 (asize-of this)) + (a1-22 (&-> this type)) + ) + (cond + ((>= offset 0) + (qmem-copy->! (&+ a1-22 offset) a1-22 a2-4) + ) + ((< a2-4 2560) + (qmem-copy<-! (&+ a1-22 offset) a1-22 a2-4) + ) + (else + (ultimate-memcpy (&+ a1-22 offset) a1-22 (the-as uint a2-4)) + ) + ) + ) + (set! (-> *kernel-context* relocating-process) #f) + (&+ this offset) + ) + +;; definition for method 7 of type cpu-thread +(defmethod relocate ((this cpu-thread) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type process-drawable +;; WARN: Return type mismatch process vs process-drawable. +(defmethod relocate ((this process-drawable) (offset int)) + (let ((v1-0 *kernel-context*)) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) + (set! (-> v1-0 relocating-max) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) + ) + (set! (-> v1-0 relocating-offset) offset) + ) + (let ((a0-6 (-> this nav))) + (if (and (nonzero? a0-6) a0-6) + (relocate a0-6 offset) + ) + ) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this node-list)) + (&+! (-> this node-list) offset) + ) + (if (nonzero? (-> this draw)) + (&+! (-> this draw) offset) + ) + (if (nonzero? (-> this skel)) + (&+! (-> this skel) offset) + ) + (if (nonzero? (-> this align)) + (&+! (-> this align) offset) + ) + (if (nonzero? (-> this path)) + (&+! (-> this path) offset) + ) + (if (nonzero? (-> this vol)) + (&+! (-> this vol) offset) + ) + (if (nonzero? (-> this fact)) + (&+! (-> this fact) offset) + ) + (if (nonzero? (-> this link)) + (&+! (-> this link) offset) + ) + (if (nonzero? (-> this part)) + (&+! (-> this part) offset) + ) + (if (nonzero? (-> this water)) + (&+! (-> this water) offset) + ) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) offset) + ) + (if (nonzero? (-> this carry)) + (&+! (-> this carry) offset) + ) + (if (nonzero? (-> this rbody)) + (&+! (-> this rbody) offset) + ) + (the-as process-drawable ((method-of-type process relocate) this offset)) + ) + +;; definition for method 7 of type collide-shape +(defmethod relocate ((this collide-shape) (offset int)) + (&+! (-> this process) offset) + (&+! (-> this root-prim) offset) + this + ) + +;; definition for method 7 of type collide-shape-moving +;; WARN: Return type mismatch collide-shape vs collide-shape-moving. +(defmethod relocate ((this collide-shape-moving) (offset int)) + (if (-> this dynam) + (&+! (-> this dynam) offset) + ) + (the-as collide-shape-moving ((method-of-type collide-shape relocate) this offset)) + ) + +;; definition for method 7 of type collide-shape-prim +(defmethod relocate ((this collide-shape-prim) (offset int)) + (&+! (-> this cshape) offset) + this + ) + +;; definition for method 7 of type collide-shape-prim-group +(defmethod relocate ((this collide-shape-prim-group) (offset int)) + (&+! (-> this cshape) offset) + (&+! (-> this child) offset) + this + ) + +;; definition for method 7 of type fact-info +(defmethod relocate ((this fact-info) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type draw-control +(defmethod relocate ((this draw-control) (offset int)) + (&+! (-> this skeleton) offset) + (&+! (-> this process) offset) + (when (-> this ripple) + (if (-> this ripple query) + (&+! (-> this ripple query) offset) + ) + (&+! (-> this ripple) offset) + ) + (let ((v1-14 (-> this shadow-ctrl))) + (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) + (< (the-as int v1-14) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this shadow-ctrl) offset) + ) + ) + (when (-> this cloth-instances) + (dotimes (v1-21 (-> this cloth-instances length)) + (&+! (-> this cloth-instances v1-21) offset) + ) + (&+! (-> this cloth-instances) offset) + ) + this + ) + +;; definition for method 7 of type joint-control +(defmethod relocate ((this joint-control) (offset int)) + (if (-> this effect) + (&+! (-> this effect) offset) + ) + (if (-> this top-anim) + (&+! (-> this top-anim) offset) + ) + (&+! (-> this root-channel) offset) + (countdown (v1-10 (-> this allocated-length)) + (&+! (-> this channel v1-10 parent) offset) + ) + this + ) + +;; definition for method 7 of type cspace-array +(defmethod relocate ((this cspace-array) (offset int)) + (countdown (v1-0 (-> this length)) + (let ((a2-2 (-> this data v1-0))) + (if (-> a2-2 parent) + (&+! (-> a2-2 parent) offset) + ) + (&+! (-> a2-2 bone) offset) + (let ((a3-6 (-> a2-2 param1))) + (if (and (>= (the-as int a3-6) (-> *kernel-context* relocating-min)) + (< (the-as int a3-6) (-> *kernel-context* relocating-max)) + ) + (&+! (-> a2-2 param1) offset) + ) + ) + (let ((a3-11 (-> a2-2 param2))) + (if (and (>= (the-as int a3-11) (-> *kernel-context* relocating-min)) + (< (the-as int a3-11) (-> *kernel-context* relocating-max)) + ) + (&+! (-> a2-2 param2) offset) + ) + ) + ) + ) + this + ) + +;; definition for method 7 of type path-control +(defmethod relocate ((this path-control) (offset int)) + (&+! (-> this process) offset) + (let ((v1-2 (-> this curve cverts))) + (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) + (< (the-as int v1-2) (-> *kernel-context* relocating-max)) + ) + (&+! (-> this curve cverts) offset) + ) + ) + this + ) + +;; definition for method 7 of type vol-control +(defmethod relocate ((this vol-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type water-control +(defmethod relocate ((this water-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type actor-link-info +(defmethod relocate ((this actor-link-info) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type align-control +(defmethod relocate ((this align-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type joint-mod +(defmethod relocate ((this joint-mod) (offset int)) + (&+! (-> this process) offset) + (&+! (-> this joint) offset) + this + ) + +;; definition for method 7 of type joint-mod-ik +(defmethod relocate ((this joint-mod-ik) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type effect-control +(defmethod relocate ((this effect-control) (offset int)) + (&+! (-> this process) offset) + this + ) + +;; definition for method 7 of type sparticle-launch-control +(defmethod relocate ((this sparticle-launch-control) (offset int)) + (&+! (-> this proc) offset) + (countdown (v1-2 (-> this length)) + (let* ((a0-4 (-> this data v1-2)) + (a2-0 (-> a0-4 center)) + ) + (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) + (< (the-as int a2-0) (-> *kernel-context* relocating-max)) + ) + (&+! (-> a0-4 center) offset) + ) + ) + ) + (forall-particles-with-key + this + (lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (let ((v1-1 (-> *kernel-context* relocating-offset))) + (set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))) + (if (-> arg1 binding) + (set! (-> arg1 binding) (the-as sparticle-launch-state (+ (the-as int (-> arg1 binding)) v1-1))) + ) + ) + 0 + (none) + ) + #t + #t + ) + this + ) + +;; definition for method 7 of type camera-master +;; WARN: Return type mismatch process vs camera-master. +(defmethod relocate ((this camera-master) (offset int)) + (if (nonzero? (-> this water-drip)) + (&+! (-> this water-drip) offset) + ) + (the-as camera-master ((method-of-type process relocate) this offset)) + ) + +;; definition for method 7 of type time-of-day-proc +;; WARN: Return type mismatch process vs time-of-day-proc. +(defmethod relocate ((this time-of-day-proc) (offset int)) + (if (nonzero? (-> this sun)) + (&+! (-> this sun) offset) + ) + (if (nonzero? (-> this green-sun)) + (&+! (-> this green-sun) offset) + ) + (if (nonzero? (-> this moon)) + (&+! (-> this moon) offset) + ) + (if (nonzero? (-> this day-star)) + (&+! (-> this day-star) offset) + ) + (the-as time-of-day-proc ((method-of-type process relocate) this offset)) + ) + +;; definition for method 7 of type part-tracker +;; WARN: Return type mismatch process vs part-tracker. +(defmethod relocate ((this part-tracker) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this part)) + (&+! (-> this part) offset) + ) + (the-as part-tracker ((method-of-type process relocate) this offset)) + ) + +;; definition for method 7 of type part-spawner +;; WARN: Return type mismatch process vs part-spawner. +(defmethod relocate ((this part-spawner) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this part)) + (&+! (-> this part) offset) + ) + (if (nonzero? (-> this path)) + (&+! (-> this path) offset) + ) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) offset) + ) + (if (nonzero? (-> this sound-extra)) + (&+! (-> this sound-extra) offset) + ) + (the-as part-spawner ((method-of-type process relocate) this offset)) + ) + +;; definition for method 7 of type lightning-tracker +;; WARN: Return type mismatch process vs lightning-tracker. +(defmethod relocate ((this lightning-tracker) (offset int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) offset) + ) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) offset) + ) + (the-as lightning-tracker ((method-of-type process relocate) this offset)) + ) + +;; definition for method 7 of type manipy +;; WARN: Return type mismatch process-drawable vs manipy. +(defmethod relocate ((this manipy) (offset int)) + (if (nonzero? (-> this joint 0)) + (&+! (-> this joint 0) offset) + ) + (if (nonzero? (-> this joint 1)) + (&+! (-> this joint 1) offset) + ) + (if (nonzero? (-> this joint 2)) + (&+! (-> this joint 2) offset) + ) + (if (nonzero? (-> this joint 3)) + (&+! (-> this joint 3) offset) + ) + (the-as manipy ((method-of-type process-drawable relocate) this offset)) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc index 4b630ceeae..696f52c75a 100644 --- a/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/effect-control_REF.gc @@ -1,8 +1,8 @@ ;;-*-Lisp-*- (in-package goal) -;; definition for symbol *footstep-surface*, type object -(define *footstep-surface* (the-as object 7168)) +;; definition for symbol *footstep-surface*, type pat-surface +(define *footstep-surface* (new 'static 'pat-surface :material (pat-material grass))) ;; definition for symbol *debug-effect-control*, type symbol (define *debug-effect-control* #f) @@ -101,7 +101,7 @@ ) ((25) (logior! (-> arg0 mask) (sound-mask reg0)) - (set! (-> arg0 reg 0) (the-as uint (shr (shl (the-as int *footstep-surface*) 48) 58))) + (set! (-> arg0 reg 0) (the-as uint (-> *footstep-surface* material))) (let* ((s2-3 arg3) (v1-33 (if (type? s2-3 process-focusable) s2-3 @@ -376,7 +376,7 @@ ) ) ) - (do-effect-for-surface this (the-as symbol s3-0) arg1 arg2 (-> this res) (the-as pat-surface t1-2)) + (do-effect-for-surface this (the-as symbol s3-0) arg1 arg2 (-> this res) t1-2) ) ) ((and (= (-> s3-0 data 0) 103) diff --git a/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc index 2a97a23959..868251d3b4 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info-h_REF.gc @@ -376,7 +376,7 @@ (dust-storm handle) (flut-count int32) (death-resetter resetter-spec :inline) - (current-vehicle uint8) + (current-vehicle game-vehicle-u8) (vehicle-turbo-ready float) (percent-complete float) ) diff --git a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc index 9f36de3ca2..695a20c406 100644 --- a/test/decompiler/reference/jak3/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-info_REF.gc @@ -481,7 +481,7 @@ (set! (-> this old-vehicles) (game-vehicles)) (set! (-> this secrets) (game-secrets)) (set! (-> this purchase-secrets) (game-secrets)) - (set! (-> this current-vehicle) (the-as uint 27)) + (set! (-> this current-vehicle) (game-vehicle-u8 v-turtle v-snake v-toad v-fox)) (set-continue! this (cond @@ -689,13 +689,17 @@ (get-current-continue-forced this) ) ) + (t1-3 arg2) + (t2-0 reset-spec) ) - ((the-as (function symbol symbol continue-point game-save resetter-spec none :behavior process) s0-2) - (the-as symbol sv-128) - (the-as symbol sv-144) - (the-as continue-point sv-160) - (the-as game-save mode) - (the-as resetter-spec t0-4) + ((the-as (function cpu-thread function symbol symbol continue-point game-save resetter-spec none) s0-2) + sv-128 + sv-144 + sv-160 + mode + (the-as continue-point t0-4) + t1-3 + t2-0 ) ) ) @@ -2188,8 +2192,8 @@ lightjak-shield artifact-invis feature56 - feature57 - feature58 + lighteco + darkeco ) ) (set! (-> gp-0 vehicles) (game-vehicles v-turtle v-snake v-scorpion v-toad v-fox v-rhino v-mirage v-x-ride)) @@ -2214,7 +2218,7 @@ (set! (-> gp-0 distance) 0.0) (set! (-> gp-0 health-bar-vehicle) 0.0) (set! (-> gp-0 dust-storm) (the-as handle #f)) - (set! (-> gp-0 current-vehicle) (the-as uint 27)) + (set! (-> gp-0 current-vehicle) (game-vehicle-u8 v-turtle v-snake v-toad v-fox)) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak3/engine/game/game-save_REF.gc b/test/decompiler/reference/jak3/engine/game/game-save_REF.gc index ac3b25267b..96ddba8b1c 100644 --- a/test/decompiler/reference/jak3/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-save_REF.gc @@ -1859,7 +1859,7 @@ (set! (-> this vehicles) (the-as game-vehicles (-> (the-as game-save-tag s4-0) user-uint64))) ) (((game-save-elt vehicle)) - (set! (-> this current-vehicle) (-> (the-as game-save-tag s4-0) user-uint8 0)) + (set! (-> this current-vehicle) (the-as game-vehicle-u8 (-> (the-as game-save-tag s4-0) user-uint8 0))) ) (((game-save-elt items)) (set! (-> this items) (the-as game-items (-> (the-as game-save-tag s4-0) user-uint64))) diff --git a/test/decompiler/reference/jak3/engine/game/main-h_REF.gc b/test/decompiler/reference/jak3/engine/game/main-h_REF.gc index b95230a75d..81dacfc5fe 100644 --- a/test/decompiler/reference/jak3/engine/game/main-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/main-h_REF.gc @@ -277,8 +277,8 @@ ;; definition for symbol *debug-player-vehicle-unkillable*, type symbol (define *debug-player-vehicle-unkillable* #f) -;; definition for symbol *debug-actor*, type object -(define *debug-actor* (the-as object #f)) +;; definition for symbol *debug-actor*, type process +(define *debug-actor* (the-as process #f)) ;; definition for symbol *gun-marks*, type symbol (define *gun-marks* #f) diff --git a/test/decompiler/reference/jak3/engine/game/main_REF.gc b/test/decompiler/reference/jak3/engine/game/main_REF.gc index f15415a3aa..491a7f6b52 100644 --- a/test/decompiler/reference/jak3/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/main_REF.gc @@ -1309,7 +1309,7 @@ (-> *display* frames (-> *display* on-screen) global-buf) ) ) - (bucket-id bucket583) + (bucket-id debug) ) (show-iop-memory s5-1) ) @@ -2015,7 +2015,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc index 1abc5933a2..51c601ce6a 100644 --- a/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings-h_REF.gc @@ -706,7 +706,7 @@ (remove-setting (_type_ process symbol) none) (kill-persister (_type_ engine-pers object) none) (setting-control-method-14 (_type_ object) connectable) - (setting-control-method-15 (_type_ object) connectable) + (get-setting (_type_ object) connectable) (remove-setting-by-arg0 (_type_ object) none) (set-setting-by-param (_type_ symbol object object object) connection) (apply-settings (_type_) user-setting-data) @@ -753,7 +753,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/game/settings_REF.gc b/test/decompiler/reference/jak3/engine/game/settings_REF.gc index ddf1d15fc3..fdc9fd3c52 100644 --- a/test/decompiler/reference/jak3/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/settings_REF.gc @@ -1261,7 +1261,7 @@ ) ;; definition for method 15 of type setting-control -(defmethod setting-control-method-15 ((this setting-control) (arg0 object)) +(defmethod get-setting ((this setting-control) (arg0 object)) (let ((v1-1 (-> this engine-hi alive-list next0))) (-> this engine-hi) (let ((a2-2 (-> (the-as connection v1-1) next0))) diff --git a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc index 7fdb7ba0c7..3cc1b892fa 100644 --- a/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/task/task-control-h_REF.gc @@ -1536,7 +1536,7 @@ (:methods (game-task-node-info-method-9 () none) (open! (_type_ symbol) int) - (game-task-node-info-method-11 () none) + (game-task-node-info-method-11 (_type_ symbol) none) (game-task-node-info-method-12 (_type_) symbol) (game-task-node-info-method-13 () none) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc similarity index 99% rename from test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc rename to test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc index b6dbea68cb..c081bbc029 100644 --- a/test/decompiler/reference/jak3/engine/gfx/hfrag/hfrag-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/hfrag/hfrag-h_REF.gc @@ -682,8 +682,8 @@ (size uint32 :overlay-at (-> start-corner data 3)) ) (:methods - (hfragment-method-17 () none) - (hfragment-method-18 () none) + (hfragment-method-17 (_type_ collide-cache collide-query) none) + (hfragment-method-18 (_type_ collide-cache collide-query) none) (hfragment-method-19 () none) (hfragment-method-20 () none) (hfragment-method-21 () none) @@ -1065,7 +1065,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-h_REF.gc index 47a5cdc3ff..b2d72baa50 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/tfrag/tfrag-h_REF.gc @@ -85,6 +85,7 @@ (color-count uint8 :offset 57) (texture-masks-index uint16 :offset 58) (generic generic-tfragment :offset 60) + (generic-u32 uint32 :overlay-at generic) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/background/tie/tie-methods_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/tie/tie-methods_REF.gc index 4cadfecef8..89d06eb48c 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/tie/tie-methods_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/tie/tie-methods_REF.gc @@ -465,7 +465,7 @@ (-> (new 'static 'array bucket-id 10 (bucket-id etie-l0-alpha) (bucket-id etie-l1-alpha) - (bucket-id etie-l02alpha) + (bucket-id etie-l2-alpha) (bucket-id etie-l3-alpha) (bucket-id etie-l4-alpha) (bucket-id etie-l5-alpha) @@ -1636,7 +1636,7 @@ :tie-vanish-bucket (bucket-id tie-vanish-l2-tfrag) :tie-trans-bucket (bucket-id tie-l2-alpha) :tie-scissor-trans-bucket (bucket-id tie-scissor-l2-alpha) - :tie-envmap-trans-bucket (bucket-id etie-l02alpha) + :tie-envmap-trans-bucket (bucket-id etie-l2-alpha) :tie-envmap-scissor-trans-bucket (bucket-id etie-scissor-l2-alpha) :tie-water-bucket (bucket-id tie-l2-water) :tie-scissor-water-bucket (bucket-id tie-scissor-l2-water) diff --git a/test/decompiler/reference/jak3/engine/gfx/background/tie/tie_REF.gc b/test/decompiler/reference/jak3/engine/gfx/background/tie/tie_REF.gc index c928b4db94..e05fe8c6a1 100644 --- a/test/decompiler/reference/jak3/engine/gfx/background/tie/tie_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/background/tie/tie_REF.gc @@ -26,7 +26,7 @@ ) (when (= (-> s5-0 reg-4) 66) (set! (-> s5-0 reg-4) (the-as uint 127)) - (set! (-> s5-0 alpha) (new 'static 'gs-alpha)) + (set! (-> s5-0 alpha) (new 'static 'gs-miptbp)) 0 ) (&+! s5-0 80) @@ -722,7 +722,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc index 1d4d85b70c..67ef156272 100644 --- a/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/foreground/foreground-h_REF.gc @@ -235,6 +235,7 @@ that assigns stuff to buckets and prepares DMA for merc (or requests for generic "Scratch info computed per-merc-effect by the foreground code, then later read by merc DMA generation. This is only for the currently-processing merc model's effects." ((color-fade rgba) + (alpha uint8 :offset 3) (merc-path uint8) (ignore-alpha uint8) (disable-draw uint8) @@ -338,7 +339,3 @@ DMA generation. This is only for the currently-processing merc model's effects." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc new file mode 100644 index 0000000000..13e56e4649 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/generic/lightning/lightning-new-h_REF.gc @@ -0,0 +1,316 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type lightning-appearance +(deftype lightning-appearance (structure) + ((base-alpha float) + (width-range-start float) + (width-range-end float) + (tex-id uint32) + (blend-mode uint64) + (fade-time time-frame) + (regenerate-time-start time-frame) + (regenerate-time-end time-frame) + (alpha-1-curve curve2d-fast) + (alpha-1-mode uint64) + (alpha-1-repeat-dist float) + (alpha-2-curve curve2d-fast) + (alpha-2-mode uint64) + (alpha-2-repeat-dist float) + (width-curve curve2d-fast) + (width-mode uint64) + (width-repeat-dist float) + (uv-repeat-dist float) + (uv-shift? symbol) + (uv-shift-speed time-frame) + (use-sprite-bucket? symbol :offset 128) + (use-accurate-interp? symbol) + ) + ) + +;; definition for method 3 of type lightning-appearance +(defmethod inspect ((this lightning-appearance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lightning-appearance) + (format #t "~1Tbase-alpha: ~f~%" (-> this base-alpha)) + (format #t "~1Twidth-range-start: ~f~%" (-> this width-range-start)) + (format #t "~1Twidth-range-end: ~f~%" (-> this width-range-end)) + (format #t "~1Ttex-id: ~D~%" (-> this tex-id)) + (format #t "~1Tblend-mode: ~D~%" (-> this blend-mode)) + (format #t "~1Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~1Tregenerate-time-start: ~D~%" (-> this regenerate-time-start)) + (format #t "~1Tregenerate-time-end: ~D~%" (-> this regenerate-time-end)) + (format #t "~1Talpha-1-curve: ~A~%" (-> this alpha-1-curve)) + (format #t "~1Talpha-1-mode: ~D~%" (-> this alpha-1-mode)) + (format #t "~1Talpha-1-repeat-dist: ~f~%" (-> this alpha-1-repeat-dist)) + (format #t "~1Talpha-2-curve: ~A~%" (-> this alpha-2-curve)) + (format #t "~1Talpha-2-mode: ~D~%" (-> this alpha-2-mode)) + (format #t "~1Talpha-2-repeat-dist: ~f~%" (-> this alpha-2-repeat-dist)) + (format #t "~1Twidth-curve: ~A~%" (-> this width-curve)) + (format #t "~1Twidth-mode: ~D~%" (-> this width-mode)) + (format #t "~1Twidth-repeat-dist: ~f~%" (-> this width-repeat-dist)) + (format #t "~1Tuv-repeat-dist: ~f~%" (-> this uv-repeat-dist)) + (format #t "~1Tuv-shift?: ~A~%" (-> this uv-shift?)) + (format #t "~1Tuv-shift-speed: ~D~%" (-> this uv-shift-speed)) + (format #t "~1Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~1Tuse-sprite-bucket?: ~A~%" (-> this use-sprite-bucket?)) + (format #t "~1Tuse-accurate-interp?: ~A~%" (-> this use-accurate-interp?)) + (label cfg-4) + this + ) + +;; definition of type lightning-span-internal +(deftype lightning-span-internal (structure) + ((index int16) + (span-flags uint8) + (num-inner-points int8) + ) + :pack-me + ) + +;; definition for method 3 of type lightning-span-internal +(defmethod inspect ((this lightning-span-internal)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lightning-span-internal) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tspan-flags: ~D~%" (-> this span-flags)) + (format #t "~1Tnum-inner-points: ~D~%" (-> this num-inner-points)) + (label cfg-4) + this + ) + +;; definition of type lightning-span +(deftype lightning-span (structure) + ((random-offset-size-start float) + (inner-random-offset-size float) + ) + :pack-me + ) + +;; definition for method 3 of type lightning-span +(defmethod inspect ((this lightning-span)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lightning-span) + (format #t "~1Trandom-offset-size-start: ~f~%" (-> this random-offset-size-start)) + (format #t "~1Tinner-random-offset-size: ~f~%" (-> this inner-random-offset-size)) + (label cfg-4) + this + ) + +;; definition of type lightning-spans-array +(deftype lightning-spans-array (inline-array-class) + ((data lightning-span :inline :dynamic) + ) + ) + +;; definition for method 3 of type lightning-spans-array +(defmethod inspect ((this lightning-spans-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> lightning-spans-array heap-base) (the-as uint 8)) + +;; definition of type lightning-spans-internal-array +(deftype lightning-spans-internal-array (inline-array-class) + ((data lightning-span-internal :inline :dynamic) + ) + ) + +;; definition for method 3 of type lightning-spans-internal-array +(defmethod inspect ((this lightning-spans-internal-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> lightning-spans-internal-array heap-base) (the-as uint 4)) + +;; definition of type tex-u-holder +(deftype tex-u-holder (structure) + ((uu float) + (last-dist float) + ) + ) + +;; definition for method 3 of type tex-u-holder +(defmethod inspect ((this tex-u-holder)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tex-u-holder) + (format #t "~1Tuu: ~f~%" (-> this uu)) + (format #t "~1Tlast-dist: ~f~%" (-> this last-dist)) + (label cfg-4) + this + ) + +;; definition of type lightning-bolt +(deftype lightning-bolt (basic) + ((current-points vector-array) + (desired-points vector-array) + (span-pts-start vector-array) + (spans lightning-spans-array) + (spans-internal lightning-spans-internal-array) + (strip1 prim-strip) + (strip2 prim-strip) + (inner-point-travel-time time-frame) + (start-fade-time time-frame) + (new-inner-point-generate-time time-frame) + (last-generate-time time-frame) + (base-width float) + (current-uv-shift float) + (current-fade-scalar float) + (fractal-reduction float) + (appearance lightning-appearance) + (fade-mode uint64) + (generate-mode uint64) + (snap-inner-points? symbol) + (span-data int8 2) + (num-active-spans int8 :overlay-at (-> span-data 0)) + (num-spans int8 :overlay-at (-> span-data 1)) + (base-color rgba) + ) + (:methods + (lightning-bolt-method-9 (_type_ int int lightning-appearance) none) + (lightning-bolt-method-10 () none) + (lightning-bolt-method-11 (_type_) none) + (lightning-bolt-method-12 (_type_) none) + (lightning-bolt-method-13 (_type_ int) none) + (lightning-bolt-method-14 (_type_) int) + (lightning-bolt-method-15 () none) + (lightning-bolt-method-16 () none) + (lightning-bolt-method-17 () none) + (lightning-bolt-method-18 () none) + (lightning-bolt-method-19 () none) + (lightning-bolt-method-20 () none) + (lightning-bolt-method-21 () none) + (lightning-bolt-method-22 () none) + ) + ) + +;; definition for method 3 of type lightning-bolt +(defmethod inspect ((this lightning-bolt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcurrent-points: ~A~%" (-> this current-points)) + (format #t "~1Tdesired-points: ~A~%" (-> this desired-points)) + (format #t "~1Tspan-pts-start: ~A~%" (-> this span-pts-start)) + (format #t "~1Tspans: ~A~%" (-> this spans)) + (format #t "~1Tspans-internal: ~A~%" (-> this spans-internal)) + (format #t "~1Tstrip1: ~A~%" (-> this strip1)) + (format #t "~1Tstrip2: ~A~%" (-> this strip2)) + (format #t "~1Tinner-point-travel-time: ~D~%" (-> this inner-point-travel-time)) + (format #t "~1Tstart-fade-time: ~D~%" (-> this start-fade-time)) + (format #t "~1Tnew-inner-point-generate-time: ~D~%" (-> this new-inner-point-generate-time)) + (format #t "~1Tlast-generate-time: ~D~%" (-> this last-generate-time)) + (format #t "~1Tbase-width: ~f~%" (-> this base-width)) + (format #t "~1Tcurrent-uv-shift: ~f~%" (-> this current-uv-shift)) + (format #t "~1Tcurrent-fade-scalar: ~f~%" (-> this current-fade-scalar)) + (format #t "~1Tfractal-reduction: ~f~%" (-> this fractal-reduction)) + (format #t "~1Tappearance: #~%" (-> this appearance)) + (format #t "~1Tfade-mode: ~D~%" (-> this fade-mode)) + (format #t "~1Tgenerate-mode: ~D~%" (-> this generate-mode)) + (format #t "~1Tsnap-inner-points?: ~A~%" (-> this snap-inner-points?)) + (format #t "~1Tspan-data[2] @ #x~X~%" (-> this span-data)) + (format #t "~1Tnum-active-spans: ~D~%" (-> this num-active-spans)) + (format #t "~1Tnum-spans: ~D~%" (-> this num-spans)) + (format #t "~1Tbase-color: ~D~%" (-> this base-color)) + (label cfg-4) + this + ) + +;; definition of type lightning-new-tracker +(deftype lightning-new-tracker (process) + ((bolt lightning-bolt) + (lifetime time-frame) + (state-time time-frame) + ) + (:methods + (lightning-new-tracker-method-14 () none) + (lightning-new-tracker-method-15 () none) + ) + ) + +;; definition for method 3 of type lightning-new-tracker +(defmethod inspect ((this lightning-new-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tbolt: ~A~%" (-> this bolt)) + (format #t "~2Tlifetime: ~D~%" (-> this lifetime)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (label cfg-4) + this + ) + +;; definition of type lightning-tracker-init-params +(deftype lightning-tracker-init-params (structure) + ((appearance lightning-appearance) + (start-pt vector :inline) + (end-pt vector :inline) + (lifetime time-frame) + (num-inner-points int8) + (inner-random-offset-size float) + (random-offset-size-start float) + ) + ) + +;; definition for method 3 of type lightning-tracker-init-params +(defmethod inspect ((this lightning-tracker-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lightning-tracker-init-params) + (format #t "~1Tappearance: #~%" (-> this appearance)) + (format #t "~1Tstart-pt: #~%" (-> this start-pt)) + (format #t "~1Tend-pt: #~%" (-> this end-pt)) + (format #t "~1Tlifetime: ~D~%" (-> this lifetime)) + (format #t "~1Tnum-inner-points: ~D~%" (-> this num-inner-points)) + (format #t "~1Tinner-random-offset-size: ~f~%" (-> this inner-random-offset-size)) + (format #t "~1Trandom-offset-size-start: ~f~%" (-> this random-offset-size-start)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/sky/sky-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sky/sky-h_REF.gc index d58db2b4eb..c566c87a36 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sky/sky-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sky/sky-h_REF.gc @@ -409,7 +409,7 @@ (sky-work-method-9 () none) (sky-work-method-10 () none) (sky-work-method-11 () none) - (sky-work-method-12 () none) + (update-time-and-speed (_type_ float float) none) (sky-work-method-13 () none) (draw (_type_) none) (sky-work-method-15 () none) diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-h_REF.gc index 638eec1d70..2fbf543184 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-h_REF.gc @@ -23,6 +23,7 @@ (friction float) (timer int32) (flags sp-cpuinfo-flag) + (flags-s32 int32 :overlay-at flags) (user-int32 int32) (user-uint32 uint32 :overlay-at user-int32) (user-float float :overlay-at user-int32) @@ -148,6 +149,9 @@ There are separate systems for different modes of sprite rendering: 2D/billboard (vecdata-table pointer) (adgifdata-table (inline-array adgif-shader)) ) + (:methods + (new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_) + ) ) ;; definition for method 3 of type sparticle-system diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index f0f8490a29..f96e1a3697 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -260,13 +260,13 @@ particle system itself. This type just holds the launching-related state." (data sparticle-launch-state :inline :dynamic) ) (:methods - (sparticle-launch-control-method-14 () none) - (sparticle-launch-control-method-15 () none) + (initialize (_type_ sparticle-launch-group process-drawable) none) + (is-visible? (_type_ vector) symbol) (spawn (_type_ vector) object) - (sparticle-launch-control-method-17 (_type_ matrix) none) - (sparticle-launch-control-method-18 (_type_ cspace) none) + (spawn-from-mat (_type_ matrix) none) + (spawn-from-cspace (_type_ cspace) none) (kill-particles (_type_) none) - (sparticle-launch-control-method-20 (_type_ float) none) + (set-local-space-info (_type_ particle-local-space-info) none) ) ) @@ -282,11 +282,11 @@ particle system itself. This type just holds the launching-related state." (format #t "~1Tgroup: ~A~%" (-> this group)) (format #t "~1Tproc: ~A~%" (-> this proc)) (format #t "~1Tlocal-clock: ~D~%" (-> this local-clock)) - (format #t "~1Tfade: ~f~%" (-> this fade)) + (format #t "~1Tfade: ~f~%" (the-as float (-> this local-space-binding))) (format #t "~1Tmatrix: ~D~%" (-> this matrix)) (format #t "~1Tstate-mode[3] @ #x~X~%" (-> this state-mode)) (format #t "~1Tstate-counter: ~D~%" (-> this state-counter)) - (format #t "~1Tlocal-space-binding: #~%" (-> this fade)) + (format #t "~1Tlocal-space-binding: #~%" (-> this local-space-binding)) (format #t "~1Tlast-spawn-frame: ~D~%" (-> this last-spawn-frame)) (format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) (format #t "~1Torigin: #~%" (-> this origin)) @@ -309,8 +309,8 @@ particle system itself. This type just holds the launching-related state." ) (:methods (new (symbol type sparticle-system sparticle-launcher float) _type_) - (sparticle-subsampler-method-9 () none) - (sparticle-subsampler-method-10 (_type_ matrix) none) + (init-with-vec! (_type_ vector) vector) + (init-with-mat! (_type_ matrix) matrix) ) ) @@ -366,3 +366,7 @@ particle system itself. This type just holds the launching-related state." ;; failed to figure out what this is: 0 + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc new file mode 100644 index 0000000000..84c1287e24 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -0,0 +1,3221 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 3 of type sparticle-launcher +;; WARN: Return type mismatch int vs sparticle-launcher. +(defmethod inspect ((this sparticle-launcher)) + (format #t "~X: sparticle-launcher~%" this) + (let ((s5-0 0)) + (while (!= (-> this init-specs s5-0 field) (sp-field-id spt-end)) + (let* ((v1-1 (-> this init-specs s5-0)) + (t9-1 format) + (a0-3 #t) + (a1-1 "~T~S : ~F / #x~X / ~D~%") + (a2-1 (-> v1-1 field)) + ) + (t9-1 + a0-3 + a1-1 + (cond + ((= a2-1 (sp-field-id spt-rotate-x)) + "spt-rotate-x" + ) + ((= a2-1 (sp-field-id sprite-fields-end)) + "sprite-fields-end" + ) + ((= a2-1 (sp-field-id spt-quat-z)) + "spt-quat-z" + ) + ((= a2-1 (sp-field-id spt-next-launcher)) + "spt-next-launcher" + ) + ((= a2-1 (sp-field-id cpu-fields-start)) + "cpu-fields-start" + ) + ((= a2-1 (sp-field-id spt-rotvel-z)) + "spt-rotvel-z" + ) + ((= a2-1 (sp-field-id launch-fields-end)) + "launch-fields-end" + ) + ((= a2-1 (sp-field-id spt-conerot-w)) + "spt-conerot-w" + ) + ((= a2-1 (sp-field-id spt-fade-a)) + "spt-fade-a" + ) + ((= a2-1 (sp-field-id spt-a)) + "spt-a" + ) + ((= a2-1 (sp-field-id spt-friction)) + "spt-friction" + ) + ((= a2-1 (sp-field-id spt-b)) + "spt-b" + ) + ((= a2-1 (sp-field-id spt-launchrot-x)) + "spt-launchrot-x" + ) + ((= a2-1 (sp-field-id spt-rotate-z)) + "spt-rotate-z" + ) + ((= a2-1 (sp-field-id spt-anim)) + "spt-anim" + ) + ((= a2-1 (sp-field-id spt-fade-g)) + "spt-fade-g" + ) + ((= a2-1 (sp-field-id spt-g)) + "spt-g" + ) + ((= a2-1 (sp-field-id spt-mat-scale-z)) + "spt-mat-scale-z" + ) + ((= a2-1 (sp-field-id spt-scale)) + "spt-scale" + ) + ((= a2-1 (sp-field-id spt-vel-z)) + "spt-vel-z" + ) + ((= a2-1 (sp-field-id spt-dummy)) + "spt-dummy" + ) + ((= a2-1 (sp-field-id spt-accel-z)) + "spt-accel-z" + ) + ((= a2-1 (sp-field-id spt-fade-r)) + "spt-fade-r" + ) + ((= a2-1 (sp-field-id spt-quat-x)) + "spt-quat-x" + ) + ((= a2-1 (sp-field-id spt-rot-y)) + "spt-rot-y" + ) + ((= a2-1 (sp-field-id cpu-fields-end)) + "cpu-fields-end" + ) + ((= a2-1 (sp-field-id spt-accel-y)) + "spt-accel-y" + ) + ((= a2-1 (sp-field-id spt-vel-x)) + "spt-vel-x" + ) + ((= a2-1 (sp-field-id spt-x)) + "spt-x" + ) + ((= a2-1 (sp-field-id spt-omega)) + "spt-omega" + ) + ((= a2-1 (sp-field-id spt-accel-x)) + "spt-accel-x" + ) + ((= a2-1 (sp-field-id spt-y)) + "spt-y" + ) + ((= a2-1 (sp-field-id spt-sound)) + "spt-sound" + ) + ((= a2-1 (sp-field-id spt-z)) + "spt-z" + ) + ((= a2-1 (sp-field-id spt-r)) + "spt-r" + ) + ((= a2-1 (sp-field-id misc-fields-end)) + "misc-fields-end" + ) + ((= a2-1 (sp-field-id spt-birth-func)) + "spt-birth-func" + ) + ((= a2-1 (sp-field-id spt-rotvel-y)) + "spt-rotvel-y" + ) + ((= a2-1 (sp-field-id spt-userdata)) + "spt-userdata" + ) + ((= a2-1 (sp-field-id spt-launchrot-w)) + "spt-launchrot-w" + ) + ((= a2-1 (sp-field-id spt-quad-w)) + "spt-quad-w" + ) + ((= a2-1 (sp-field-id spt-fade-b)) + "spt-fade-b" + ) + ((= a2-1 (sp-field-id spt-anim-speed)) + "spt-anim-speed" + ) + ((= a2-1 (sp-field-id spt-timer)) + "spt-timer" + ) + ((= a2-1 (sp-field-id spt-mat-scale-y)) + "spt-mat-scale-y" + ) + ((= a2-1 (sp-field-id spt-rotate-y)) + "spt-rotate-y" + ) + ((= a2-1 (sp-field-id spt-joint/refpoint)) + "spt-joint/refpoint" + ) + ((= a2-1 (sp-field-id spt-next-time)) + "spt-next-time" + ) + ((= a2-1 (sp-field-id spt-launchrot-z)) + "spt-launchrot-z" + ) + ((= a2-1 (sp-field-id spt-conerot-z)) + "spt-conerot-z" + ) + ((= a2-1 (sp-field-id spt-scale-y)) + "spt-scale-y" + ) + ((= a2-1 (sp-field-id spt-flags)) + "spt-flags" + ) + ((= a2-1 (sp-field-id spt-scale-x)) + "spt-scale-x" + ) + ((= a2-1 (sp-field-id spt-quat-y)) + "spt-quat-y" + ) + ((= a2-1 (sp-field-id spt-scalevel-y)) + "spt-scalevel-y" + ) + ((= a2-1 (sp-field-id spt-mat-scale-x)) + "spt-mat-scale-x" + ) + ((= a2-1 (sp-field-id spt-conerot-y)) + "spt-conerot-y" + ) + ((= a2-1 (sp-field-id launch-fields-start)) + "launch-fields-start" + ) + ((= a2-1 (sp-field-id sprite-fields-start)) + "sprite-fields-start" + ) + ((= a2-1 (sp-field-id spt-vel-y)) + "spt-vel-y" + ) + ((= a2-1 (sp-field-id spt-rot-z)) + "spt-rot-z" + ) + ((= a2-1 (sp-field-id misc-fields-start)) + "misc-fields-start" + ) + ((= a2-1 (sp-field-id spt-rot-x)) + "spt-rot-x" + ) + ((= a2-1 (sp-field-id spt-scalevel)) + "spt-scalevel" + ) + ((= a2-1 (sp-field-id spt-conerot-x)) + "spt-conerot-x" + ) + ((= a2-1 (sp-field-id spt-num)) + "spt-num" + ) + ((= a2-1 (sp-field-id spt-launchrot-y)) + "spt-launchrot-y" + ) + ((= a2-1 (sp-field-id spt-end)) + "spt-end" + ) + ((= a2-1 (sp-field-id spt-texture)) + "spt-texture" + ) + ((= a2-1 (sp-field-id spt-rotvel-x)) + "spt-rotvel-x" + ) + ((= a2-1 (sp-field-id spt-scalevel-x)) + "spt-scalevel-x" + ) + ((= a2-1 (sp-field-id spt-conerot-radius)) + "spt-conerot-radius" + ) + ((= a2-1 (sp-field-id spt-func)) + "spt-func" + ) + (else + "*unknown*" + ) + ) + (-> v1-1 initial-valuef) + (-> v1-1 initial-valuef) + (-> v1-1 initial-valuef) + ) + ) + (+! s5-0 1) + ) + ) + (the-as sparticle-launcher 0) + ) + +;; failed to figure out what this is: +(kmemopen global "part-tables") + +;; definition for symbol *part-id-table*, type (array sparticle-launcher) +(define *part-id-table* (new 'global 'boxed-array sparticle-launcher 5500)) + +;; definition for symbol *part-group-id-table*, type (array sparticle-launch-group) +(define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1700)) + +;; definition for symbol *sp-temp*, type float +(define *sp-temp* 0.0) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function lookup-part-group-by-name +(defun lookup-part-group-by-name ((arg0 string)) + (let* ((s5-0 *part-group-id-table*) + (s4-0 (-> s5-0 length)) + ) + (dotimes (s3-0 s4-0) + (let ((s2-0 (-> s5-0 s3-0))) + (if (and (nonzero? s2-0) (string= arg0 (-> s2-0 name))) + (return s2-0) + ) + ) + ) + ) + (the-as sparticle-launch-group #f) + ) + +;; definition for function lookup-part-group-pointer-by-name +;; WARN: Return type mismatch (pointer sparticle-launch-group) vs (pointer object). +(defun lookup-part-group-pointer-by-name ((arg0 string)) + (let* ((s4-0 *part-group-id-table*) + (s3-0 (-> s4-0 length)) + ) + (dotimes (gp-0 s3-0) + (let ((v1-2 (-> s4-0 gp-0))) + (if (and (nonzero? v1-2) (string= arg0 (-> v1-2 name))) + (return (the-as (pointer object) (&+ (-> s4-0 data) (* gp-0 4)))) + ) + ) + ) + ) + (the-as (pointer sparticle-launch-group) #f) + ) + +;; definition for function part-group-pointer? +(defun part-group-pointer? ((arg0 pointer)) + (let ((v1-0 *part-group-id-table*)) + (and (>= (the-as int arg0) (the-as int (-> v1-0 data))) (< (the-as int arg0) (the-as int (&-> v1-0 1700)))) + ) + ) + +;; definition for function unlink-part-group-by-heap +(defun unlink-part-group-by-heap ((arg0 kheap)) + (let* ((v1-0 *part-group-id-table*) + (a2-0 (-> v1-0 length)) + (a1-0 (-> arg0 base)) + (a0-1 (-> arg0 top-base)) + ) + (while (nonzero? a2-0) + (+! a2-0 -1) + (let ((a3-2 (-> v1-0 a2-0))) + (when (and (>= (the-as int a3-2) (the-as int a1-0)) (< (the-as int a3-2) (the-as int a0-1))) + (set! (-> v1-0 a2-0) (the-as sparticle-launch-group 0)) + 0 + ) + ) + ) + ) + 0 + ) + +;; definition for function sp-init-fields! +;; INFO: function output is handled by mips2c +(def-mips2c sp-init-fields! (function (pointer float) (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol (inline-array sp-field-init-spec))) + +;; definition of type sp-queued-launch-particles +(deftype sp-queued-launch-particles (structure) + ((sp-system sparticle-system) + (sp-launcher sparticle-launcher) + (pos vector :inline) + ) + ) + +;; definition for method 3 of type sp-queued-launch-particles +(defmethod inspect ((this sp-queued-launch-particles)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sp-queued-launch-particles) + (format #t "~1Tsp-system: ~A~%" (-> this sp-system)) + (format #t "~1Tsp-launcher: ~A~%" (-> this sp-launcher)) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition of type sp-launch-queue +(deftype sp-launch-queue (basic) + ((in-use int32) + (queue sp-queued-launch-particles 256 :inline) + ) + ) + +;; definition for method 3 of type sp-launch-queue +(defmethod inspect ((this sp-launch-queue)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tin-use: ~D~%" (-> this in-use)) + (format #t "~1Tqueue[256] @ #x~X~%" (-> this queue)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(kmemopen global "launcher-queue") + +;; definition for symbol *sp-launcher-lock*, type symbol +(define *sp-launcher-lock* #f) + +;; definition for symbol *sp-launch-queue*, type sp-launch-queue +(define *sp-launch-queue* (new 'global 'sp-launch-queue)) + +;; definition for symbol *sp-launcher-enable*, type symbol +(define *sp-launcher-enable* #t) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function particle-setup-adgif +;; WARN: Return type mismatch int vs none. +(defun particle-setup-adgif ((arg0 adgif-shader) (arg1 int)) + (let ((a1-1 (lookup-texture-by-id-fast (the-as texture-id arg1))) + (s5-0 #f) + ) + (when (not a1-1) + (set! a1-1 (get-texture common-white common)) + (set! s5-0 #t) + ) + (set! (-> arg0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> arg0 tex0 tfx) 0) + (adgif-shader<-texture! arg0 a1-1) + (set! (-> arg0 prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 prims 3) (the-as gs-reg64 (logior arg1 20))) + (set! (-> arg0 prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 clamp-reg) (gs-reg64 zbuf-1)) + (set! (-> arg0 prims 9) (gs-reg64 alpha-1)) + (if s5-0 + (logior! (-> arg0 link-test) (link-test-flags backup-sprite-tex)) + ) + ) + (set! (-> arg0 alpha) (new 'static 'gs-miptbp :tbp1 #x44)) + (set! (-> arg0 clamp) (new 'static 'gs-clamp :minu #x13 :minv #x101)) + 0 + (none) + ) + +;; definition of type particle-adgif-cache +(deftype particle-adgif-cache (basic) + ((used int32) + (last uint16) + (lastgif adgif-shader) + (tidhash uint16 80) + (spadgif adgif-shader 80 :inline) + ) + ) + +;; definition for method 3 of type particle-adgif-cache +(defmethod inspect ((this particle-adgif-cache)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tused: ~D~%" (-> this used)) + (format #t "~1Tlast: ~D~%" (-> this last)) + (format #t "~1Tlastgif: #~%" (-> this lastgif)) + (format #t "~1Ttidhash[80] @ #x~X~%" (-> this tidhash)) + (format #t "~1Tspadgif[80] @ #x~X~%" (-> this spadgif)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(kmemopen global "part-adgif-cache") + +;; definition for symbol *particle-adgif-cache*, type particle-adgif-cache +(define *particle-adgif-cache* (new 'global 'particle-adgif-cache)) + +;; failed to figure out what this is: +(set! (-> *particle-adgif-cache* used) 0) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function particle-adgif-cache-flush +;; WARN: Return type mismatch int vs none. +(defun particle-adgif-cache-flush () + (set! (-> *particle-adgif-cache* used) 0) + (set! (-> *particle-adgif-cache* last) (the-as uint 0)) + 0 + (none) + ) + +;; definition for function particle-adgif +;; INFO: function output is handled by mips2c +(def-mips2c particle-adgif (function adgif-shader texture-id none)) + +;; definition for function particle-adgif-callback +;; WARN: Return type mismatch int vs none. +;; ERROR: Bad vector register dependency: vf16 +;; ERROR: Bad vector register dependency: vf17 +;; ERROR: Bad vector register dependency: vf18 +;; ERROR: Bad vector register dependency: vf19 +;; ERROR: Bad vector register dependency: vf20 +(defun particle-adgif-callback ((arg0 adgif-shader) (arg1 texture-id)) + (local-vars (v1-0 float)) + (rlet ((vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf20 :class vf) + ) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) + (let ((s4-0 (-> arg0 alpha)) + (s3-0 (-> arg0 clamp)) + ) + (.svf (&-> s5-0 0 quad) vf16) + (.svf (&-> s5-0 1 quad) vf17) + (.svf (&-> s5-0 2 quad) vf18) + (.svf (&-> s5-0 3 quad) vf19) + (.svf (&-> s5-0 4 quad) vf20) + (particle-adgif arg0 arg1) + (set! (-> arg0 alpha) s4-0) + (set! (-> arg0 clamp) s3-0) + ) + (.lvf vf16 (&-> s5-0 0 quad)) + (.lvf vf17 (&-> s5-0 1 quad)) + (.lvf vf18 (&-> s5-0 2 quad)) + (.lvf vf19 (&-> s5-0 3 quad)) + (.lvf vf20 (&-> s5-0 4 quad)) + ) + (.mov v1-0 vf20) + 0 + (none) + ) + ) + +;; definition for function sp-queue-launch +;; INFO: Used lq/sq +(defun sp-queue-launch ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 matrix)) + (let ((v1-0 *sp-launch-queue*)) + (when (= (-> v1-0 in-use) 256) + (format 0 "ERROR: sp-launch-particles called during processing, and queue is full~%") + (return 0) + ) + (let ((a3-5 (-> v1-0 queue (-> v1-0 in-use)))) + (set! (-> a3-5 sp-system) arg0) + (set! (-> a3-5 sp-launcher) arg1) + (set! (-> a3-5 pos quad) (-> arg2 trans quad)) + ) + (let ((v0-1 (+ (-> v1-0 in-use) 1))) + (set! (-> v1-0 in-use) v0-1) + v0-1 + ) + ) + ) + +;; definition for function sp-adjust-launch +;; WARN: Return type mismatch int vs none. +(defun sp-adjust-launch ((arg0 sparticle-launchinfo) + (arg1 sparticle-cpuinfo) + (arg2 (inline-array sp-field-init-spec)) + (arg3 matrix) + (arg4 symbol) + ) + (let ((s2-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (let ((s0-0 (new 'stack-no-clear 'vector))) + (sp-init-fields! + (the-as (pointer float) (-> s2-0 rvec)) + arg2 + (sp-field-id launch-fields-start) + (sp-field-id launch-fields-end) + #t + ) + (matrix-rotate-xyz! s5-0 (-> s2-0 rvec)) + (vector3s-matrix*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (matrix-rotate-xyz! s5-0 (-> s2-0 uvec)) + (vector3s-matrix*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (matrix*! s5-0 s5-0 arg3) + (set-vector! s0-0 0.0 (-> s2-0 fvec w) 0.0 1.0) + (vector-matrix*! s0-0 s0-0 s5-0) + (+! (-> arg0 launchrot x) (-> s0-0 x)) + (+! (-> arg0 launchrot y) (-> s0-0 y)) + (+! (-> arg0 launchrot z) (-> s0-0 z)) + ) + (when (logtest? (sp-cpuinfo-flag set-conerot) (-> arg1 flags)) + (let ((f0-10 (vector-length (-> arg3 rvec))) + (f1-3 (vector-length (-> arg3 uvec))) + (f2-0 (vector-length (-> arg3 fvec))) + ) + (set! (-> arg0 launchrot w) (* (-> arg0 launchrot w) f0-10)) + (set! (-> arg0 conerot w) (* (-> arg0 conerot w) f1-3)) + (set! (-> arg1 vel-sxvel w) (* (-> arg1 vel-sxvel w) f0-10)) + (set! (-> arg1 rot-syvel w) (* (-> arg1 rot-syvel w) f1-3)) + (set! (-> arg1 vel-sxvel x) (* (-> arg1 vel-sxvel x) f0-10)) + (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) f1-3)) + (set! (-> arg1 vel-sxvel z) (* (-> arg1 vel-sxvel z) f2-0)) + ) + ) + (matrix-rotate-xyz! s5-0 (-> s2-0 fvec)) + (matrix*! s5-0 s5-0 arg3) + (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) + (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (if (not (logtest? (sp-cpuinfo-flag launch-along-z) (-> arg1 flags))) + (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) + ) + (if (logtest? (sp-cpuinfo-flag right-multiply-quat) (-> arg1 flags)) + (set! (-> arg0 conerot y) (+ 16384.0 (vector-y-angle (-> s5-0 fvec)))) + ) + (when arg4 + (let ((s4-1 (new 'stack-no-clear 'euler-angles))) + (matrix->eul s4-1 s5-0 13) + (set! (-> arg0 conerot x) (- (-> arg0 conerot x) (-> s4-1 y))) + (set! (-> arg0 conerot y) (- (-> arg0 conerot y) (-> s4-1 z))) + (set! (-> arg0 conerot z) (- (-> arg0 conerot z) (-> s4-1 x))) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sp-euler-convert +;; WARN: Return type mismatch int vs none. +(defun sp-euler-convert ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo)) + (local-vars (v1-1 float) (v1-2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'quaternion)) + ) + (set-vector! a1-1 (-> arg0 conerot x) (-> arg0 conerot y) (-> arg0 conerot z) 1.0) + (quaternion-zxy! s5-0 a1-1) + (cond + ((< (-> s5-0 w) 0.0) + (.lvf vf1 (&-> arg0 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg0 conerot quad) vf1) + (.mov v1-1 vf1) + ) + (else + (.lvf vf1 (&-> arg0 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg0 conerot quad) vf1) + (.mov v1-2 vf1) + ) + ) + ) + (cond + (*sp-60-hz* + (set! (-> arg1 rot-syvel x) (* 5.0 (-> arg1 rot-syvel x))) + (set! (-> arg1 rot-syvel y) (* 5.0 (-> arg1 rot-syvel y))) + (set! (-> arg1 rot-syvel z) (* 5.0 (-> arg1 rot-syvel z))) + ) + (else + (set! (-> arg1 rot-syvel x) (* 6.0 (-> arg1 rot-syvel x))) + (set! (-> arg1 rot-syvel y) (* 6.0 (-> arg1 rot-syvel y))) + (set! (-> arg1 rot-syvel z) (* 6.0 (-> arg1 rot-syvel z))) + ) + ) + (quaternion-zxy! (-> arg1 rotvel3d) (-> arg1 rot-syvel)) + 0 + (none) + ) + ) + +;; definition for function sp-rotate-system +;; WARN: Return type mismatch int vs none. +(defun sp-rotate-system ((arg0 sparticle-launchinfo) (arg1 sparticle-cpuinfo) (arg2 transformq)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((a1-1 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 a1-1) + (a0-1 arg2) + (f0-0 (-> a0-1 quat x)) + (f1-0 (-> a0-1 quat y)) + (f2-0 (-> a0-1 quat z)) + ) + (set! (-> v1-0 x) f0-0) + (set! (-> v1-0 y) f1-0) + (set! (-> v1-0 z) f2-0) + (set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion->matrix s5-0 a1-1) + ) + (vector3s-rotate*! (the-as vector3s (-> arg0 launchrot)) (the-as vector3s (-> arg0 launchrot)) s5-0) + (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (if (not (logtest? (sp-cpuinfo-flag launch-along-z) (-> arg1 flags))) + (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) + ) + ) + 0 + (none) + ) + +;; definition of type sp-launch-stack +(deftype sp-launch-stack (structure) + ((ra basic) + (dummy0 basic) + (dummy1 basic) + (b-spfic basic) + (r16 uint128) + (r17 uint128) + (r18 uint128) + (pos uint128) + (matrix matrix :inline) + (l-spfic basic) + (birth-info sparticle-birthinfo :inline) + (sprite sprite-vec-data-2d :inline) + (r19 uint128) + (r20 uint128) + (r21 uint128) + (r22 uint128) + ) + ) + +;; definition for method 3 of type sp-launch-stack +;; INFO: Used lq/sq +(defmethod inspect ((this sp-launch-stack)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'sp-launch-stack) + (format #t "~1Tra: ~A~%" (-> this ra)) + (format #t "~1Tdummy0: ~A~%" (-> this dummy0)) + (format #t "~1Tdummy1: ~A~%" (-> this dummy1)) + (format #t "~1Tb-spfic: ~A~%" (-> this b-spfic)) + (format #t "~1Tr16: ~D~%" (-> this r16)) + (format #t "~1Tr17: ~D~%" (-> this r17)) + (format #t "~1Tr18: ~D~%" (-> this r18)) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tl-spfic: ~A~%" (-> this l-spfic)) + (format #t "~1Tbirth-info: #~%" (-> this birth-info)) + (format #t "~1Tsprite: #~%" (-> this sprite)) + (format #t "~1Tr19: ~D~%" (-> this r19)) + (format #t "~1Tr20: ~D~%" (-> this r20)) + (format #t "~1Tr21: ~D~%" (-> this r21)) + (format #t "~1Tr22: ~D~%" (-> this r22)) + (label cfg-4) + this + ) + +;; definition for function sp-launch-particles-var +;; INFO: function output is handled by mips2c +(def-mips2c sp-launch-particles-var (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)) + +;; definition for symbol *death-adgif*, type adgif-shader +(define *death-adgif* (the-as adgif-shader #f)) + +;; definition for function sp-launch-particles-death +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function sp-launch-particles-death has a return type of none, but the expression builder found a return statement. +(defun sp-launch-particles-death ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 vector)) + (local-vars (v1-26 float) (v1-28 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf30 :class vf) + (vf31 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf30 (&-> arg2 quad)) + (let ((v1-0 #x437f0000)) + (.mov vf31 v1-0) + ) + (let ((s5-0 (new 'stack-no-clear 'matrix)) + (gp-0 (sp-get-particle arg0 0 (the-as sparticle-launch-state #f))) + ) + (if (not gp-0) + (return 0) + ) + (let* ((a1-2 (-> arg1 init-specs 0)) + (a1-3 (sp-init-fields! + (the-as (pointer float) (-> s5-0 rvec)) + (the-as (inline-array sp-field-init-spec) a1-2) + (sp-field-id sprite-fields-start) + (sp-field-id sprite-fields-end) + #t + ) + ) + ) + (sp-init-fields! (&-> gp-0 omega) a1-3 (sp-field-id cpu-fields-start) (sp-field-id cpu-fields-end) #t) + ) + (set! (-> s5-0 uvec y) 0.0) + (set! (-> s5-0 uvec z) (the float (sar (shl (the int (-> s5-0 uvec z)) 48) 48))) + (.lvf vf4 (&-> s5-0 fvec quad)) + (.lvf vf5 (&-> s5-0 rvec quad)) + (.min.x.vf vf4 vf4 vf31 :mask #b111) + (.add.vf vf5 vf5 vf30 :mask #b111) + (.svf (&-> s5-0 fvec quad) vf4) + (.svf (&-> s5-0 rvec quad) vf5) + (when (not *death-adgif*) + (set! *death-adgif* (new 'static 'adgif-shader)) + (particle-adgif *death-adgif* (new 'static 'texture-id :index #x18 :page #x4)) + (set! (-> *death-adgif* alpha) (new 'static 'gs-miptbp :tbp1 #x48)) + ) + (let ((v1-14 (-> *death-adgif* quad 0 quad))) + (set! (-> gp-0 adgif quad 0 quad) v1-14) + ) + (let ((v1-16 (-> *death-adgif* quad 1 quad))) + (set! (-> gp-0 adgif quad 1 quad) v1-16) + ) + (let ((v1-18 (-> *death-adgif* quad 2 quad))) + (set! (-> gp-0 adgif quad 2 quad) v1-18) + ) + (let ((v1-20 (-> *death-adgif* quad 3 quad))) + (set! (-> gp-0 adgif quad 3 quad) v1-20) + ) + (let ((v1-22 (-> *death-adgif* quad 4 quad))) + (set! (-> gp-0 adgif quad 4 quad) v1-22) + ) + (set! (-> gp-0 clock-index) (the-as uint 8)) + (.lvf vf4 (&-> (-> *time-of-day-context* current-prt-color) quad)) + (.lvf vf5 (&-> s5-0 fvec quad)) + (.lvf vf6 (&-> gp-0 fade quad)) + (.mul.vf vf5 vf5 vf4 :mask #b111) + (.mul.vf vf6 vf6 vf4 :mask #b111) + (.svf (&-> s5-0 fvec quad) vf5) + (.svf (&-> gp-0 fade quad) vf6) + (.mov v1-26 vf6) + (set! (-> gp-0 key) (the-as sparticle-launch-control 0)) + (set! (-> gp-0 binding) #f) + (let ((v1-27 (-> gp-0 sprite))) + (.lvf vf1 (&-> s5-0 rvec quad)) + (.lvf vf2 (&-> s5-0 uvec quad)) + (.lvf vf3 (&-> s5-0 fvec quad)) + (.svf (&-> v1-27 x-y-z-sx quad) vf1) + (.svf (&-> v1-27 flag-rot-sy quad) vf2) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.svf (&-> v1-27 r-g-b-a quad) vf3) + ) + (.mov v1-28 vf3) + (logior! (-> gp-0 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-5)) + (set! (-> gp-0 cache-alpha) (-> s5-0 fvec w)) + ) + 0 + (none) + ) + ) + +;; definition for function sp-clear-queue +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sp-clear-queue () + (let ((gp-0 *sp-launch-queue*) + (s5-0 *launch-matrix*) + ) + (when (> (-> gp-0 in-use) 0) + (dotimes (s4-0 (-> gp-0 in-use)) + (let ((v1-4 (-> gp-0 queue s4-0))) + (set! (-> s5-0 trans quad) (-> v1-4 pos quad)) + (launch-particles :system (-> v1-4 sp-system) (-> v1-4 sp-launcher) s5-0 :origin-is-matrix #t) + ) + ) + (set! (-> gp-0 in-use) 0) + 0 + ) + ) + 0 + (none) + ) + +;; definition for function sp-relaunch-setup-fields +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sp-relaunch-setup-fields ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-3d)) + (local-vars + (sv-80 (inline-array sp-field-init-spec)) + (sv-88 sp-cpuinfo-flag) + (sv-96 matrix) + (sv-100 symbol) + (sv-104 symbol) + ) + (set! sv-80 (the-as (inline-array sp-field-init-spec) (-> arg1 init-specs 0))) + (set! sv-88 (logand (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1 sp-cpuinfo-flag-12))) + (set! sv-96 (new 'stack-no-clear 'matrix)) + (set! sv-100 (the-as symbol #f)) + (set! sv-104 (the-as symbol #f)) + (set! (-> arg2 next-launcher) (the-as basic 0)) + (when (nonzero? (-> arg2 key)) + (let ((s3-0 #t)) + (cond + ((logtest? (sp-cpuinfo-flag left-multiply-quat) (-> arg2 flags)) + (quaternion->matrix sv-96 (-> arg2 key proc root quat)) + ) + ((logtest? (-> arg2 key group flags) (sp-group-flag sp12)) + (let* ((v1-17 sv-96) + (a3-1 (-> arg2 key local-space-binding mat-new)) + (a0-5 (-> a3-1 rvec quad)) + (a1-2 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-17 rvec quad) a0-5) + (set! (-> v1-17 uvec quad) a1-2) + (set! (-> v1-17 fvec quad) a2-1) + (set! (-> v1-17 trans quad) a3-2) + ) + ) + (else + (set! s3-0 #f) + ) + ) + (when s3-0 + (matrix-transpose! sv-96 sv-96) + (when (or (get-field-spec-by-id arg1 (sp-field-id spt-accel-x)) + (get-field-spec-by-id arg1 (sp-field-id spt-accel-y)) + (get-field-spec-by-id arg1 (sp-field-id spt-accel-z)) + ) + (set! sv-100 #t) + (vector3s-rotate*! (the-as vector3s (-> arg2 acc)) (the-as vector3s (-> arg2 acc)) sv-96) + ) + (when (or (get-field-spec-by-id arg1 (sp-field-id spt-vel-x)) + (get-field-spec-by-id arg1 (sp-field-id spt-vel-y)) + (get-field-spec-by-id arg1 (sp-field-id spt-vel-z)) + ) + (set! sv-104 #t) + (vector3s-rotate*! (the-as vector3s (-> arg2 vel-sxvel)) (the-as vector3s (-> arg2 vel-sxvel)) sv-96) + ) + (matrix-transpose! sv-96 sv-96) + ) + ) + ) + (cond + ((and (logtest? (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-13)) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort))) + (not (logtest? (-> arg2 flags) (sp-cpuinfo-flag glow))) + ) + (let ((f20-0 (-> arg3 r-g-b-a x)) + (f22-0 (-> arg3 r-g-b-a y)) + (f24-0 (-> arg3 r-g-b-a z)) + (f26-0 (-> arg2 fade x)) + (f28-0 (-> arg2 fade y)) + (f30-0 (-> arg2 fade z)) + ) + (set! (-> arg3 r-g-b-a x) 99999.0) + (set! (-> arg3 r-g-b-a y) 99999.0) + (set! (-> arg3 r-g-b-a z) 99999.0) + (set! (-> arg2 fade x) 99999.0) + (set! (-> arg2 fade y) 99999.0) + (set! (-> arg2 fade z) 99999.0) + (set! sv-80 + (sp-init-fields! + (the-as (pointer float) (-> arg3 x-y-z-sx)) + sv-80 + (sp-field-id sprite-fields-start) + (sp-field-id sprite-fields-end) + #f + ) + ) + (set! sv-80 + (sp-init-fields! (&-> arg2 omega) sv-80 (sp-field-id cpu-fields-start) (sp-field-id cpu-fields-end) #f) + ) + (logior! (-> arg2 flags) sv-88) + (let ((v1-54 (-> *time-of-day-context* current-prt-color))) + (if (= (-> arg3 r-g-b-a x) 99999.0) + (set! (-> arg3 r-g-b-a x) f20-0) + (set! (-> arg3 r-g-b-a x) (* (-> arg3 r-g-b-a x) (-> v1-54 x))) + ) + (if (= (-> arg3 r-g-b-a y) 99999.0) + (set! (-> arg3 r-g-b-a y) f22-0) + (set! (-> arg3 r-g-b-a y) (* (-> arg3 r-g-b-a y) (-> v1-54 y))) + ) + (if (= (-> arg3 r-g-b-a z) 99999.0) + (set! (-> arg3 r-g-b-a z) f24-0) + (set! (-> arg3 r-g-b-a z) (* (-> arg3 r-g-b-a z) (-> v1-54 z))) + ) + (if (= (-> arg2 fade x) 99999.0) + (set! (-> arg2 fade x) f26-0) + (set! (-> arg2 fade x) (* (-> arg2 fade x) (-> v1-54 x))) + ) + (if (= (-> arg2 fade y) 99999.0) + (set! (-> arg2 fade y) f28-0) + (set! (-> arg2 fade y) (* (-> arg2 fade y) (-> v1-54 y))) + ) + (if (= (-> arg2 fade z) 99999.0) + (set! (-> arg2 fade z) f30-0) + (set! (-> arg2 fade z) (* (-> arg2 fade z) (-> v1-54 z))) + ) + ) + ) + ) + (else + (set! sv-80 + (sp-init-fields! + (the-as (pointer float) (-> arg3 x-y-z-sx)) + sv-80 + (sp-field-id sprite-fields-start) + (sp-field-id sprite-fields-end) + #f + ) + ) + (set! sv-80 + (sp-init-fields! (&-> arg2 omega) sv-80 (sp-field-id cpu-fields-start) (sp-field-id cpu-fields-end) #f) + ) + ) + ) + (if sv-100 + (vector3s-rotate*! (the-as vector3s (-> arg2 acc)) (the-as vector3s (-> arg2 acc)) sv-96) + ) + (if sv-104 + (vector3s-rotate*! (the-as vector3s (-> arg2 vel-sxvel)) (the-as vector3s (-> arg2 vel-sxvel)) sv-96) + ) + 0 + 0 + (none) + ) + +;; definition for function sp-relaunch-particle-2d +;; WARN: Return type mismatch int vs none. +(defun sp-relaunch-particle-2d ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d)) + (sp-relaunch-setup-fields arg0 arg1 arg2 (the-as sprite-vec-data-3d arg3)) + (when (logtest? (-> arg2 flags) (sp-cpuinfo-flag distort)) + (set! (-> arg3 r-g-b-a w) 0.0) + (set! (-> arg2 fade w) 0.0) + (logclear! (-> arg2 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-2)) + ) + (when (logtest? (-> arg2 flags) (sp-cpuinfo-flag glow)) + ) + 0 + (none) + ) + +;; definition for function sp-relaunch-particle-3d +;; WARN: Return type mismatch int vs none. +(defun sp-relaunch-particle-3d ((arg0 object) (arg1 sparticle-launcher) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-3d)) + (local-vars (v1-9 float) (v1-10 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 s4-0) + (a2-1 arg3) + (f0-0 (-> a2-1 qx-qy-qz-sy x)) + (f1-0 (-> a2-1 qx-qy-qz-sy y)) + (f2-0 (-> a2-1 qx-qy-qz-sy z)) + ) + (set! (-> v1-0 x) f0-0) + (set! (-> v1-0 y) f1-0) + (set! (-> v1-0 z) f2-0) + (set! (-> v1-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (set! (-> arg3 qx-qy-qz-sy x) 0.0) + (set! (-> arg3 qx-qy-qz-sy y) 0.0) + (set! (-> arg3 qx-qy-qz-sy z) 0.0) + (sp-relaunch-setup-fields arg0 arg1 arg2 arg3) + (let* ((a1-1 (-> arg2 flags-s32)) + (v1-1 -2) + (a0-1 (-> arg3 r-g-b-a x)) + (a1-2 (logand a1-1 #x4000)) + ) + 1 + (let ((a1-3 (sar a1-2 14))) + (set! (-> arg3 r-g-b-a x) (the-as float (logior (logand a0-1 (the-as uint v1-1)) a1-3))) + ) + ) + (let ((a1-4 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (set-vector! a1-4 (-> arg3 qx-qy-qz-sy x) (-> arg3 qx-qy-qz-sy y) (-> arg3 qx-qy-qz-sy z) 1.0) + (quaternion-zxy! s3-0 a1-4) + (if (logtest? (sp-cpuinfo-flag left-multiply-quat) (-> arg2 flags)) + (quaternion*! s3-0 s4-0 s3-0) + ) + (cond + ((< (-> s3-0 w) 0.0) + (.lvf vf1 (&-> arg3 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s3-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg3 qx-qy-qz-sy quad) vf1) + (.mov v1-9 vf1) + ) + (else + (.lvf vf1 (&-> arg3 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s3-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg3 qx-qy-qz-sy quad) vf1) + (.mov v1-10 vf1) + ) + ) + ) + ) + (cond + (*sp-60-hz* + (set! (-> arg2 rot-syvel x) (* 5.0 (-> arg2 rot-syvel x))) + (set! (-> arg2 rot-syvel y) (* 5.0 (-> arg2 rot-syvel y))) + (set! (-> arg2 rot-syvel z) (* 5.0 (-> arg2 rot-syvel z))) + ) + (else + (set! (-> arg2 rot-syvel x) (* 6.0 (-> arg2 rot-syvel x))) + (set! (-> arg2 rot-syvel y) (* 6.0 (-> arg2 rot-syvel y))) + (set! (-> arg2 rot-syvel z) (* 6.0 (-> arg2 rot-syvel z))) + ) + ) + (quaternion-zxy! (-> arg2 rotvel3d) (-> arg2 rot-syvel)) + 0 + (none) + ) + ) + +;; definition for method 14 of type sparticle-launch-control +;; WARN: Return type mismatch int vs none. +(defmethod initialize ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process-drawable)) + (let ((s5-0 0)) + (set! (-> this group) arg0) + (set! (-> this proc) arg1) + (set! (-> this local-clock) 0) + (set! (-> this local-space-binding) (the-as particle-local-space-info 1.0)) + (set! (-> this matrix) 0) + (set! (-> this last-spawn-frame) + (the-as int (+ (-> *display* real-frame-clock integral-frame-counter) (seconds -0.007))) + ) + (set! (-> this last-spawn-time) 0) + (if (logtest? (-> this group flags) (sp-group-flag sp4)) + (quaternion->matrix (-> this origin) (-> arg1 root quat)) + (matrix-identity! (-> this origin)) + ) + (when (logtest? (-> arg0 flags) (sp-group-flag sp6)) + (let ((f0-1 (-> arg0 rotate-x)) + (f1-0 (-> arg0 rotate-y)) + (f2-0 (-> arg0 rotate-z)) + (t9-2 matrix-rotate-xyz!) + (a0-3 (new 'stack-no-clear 'matrix)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) f0-1) + (set! (-> a1-2 y) f1-0) + (set! (-> a1-2 z) f2-0) + (set! (-> a1-2 w) 1.0) + (let ((a1-3 (t9-2 a0-3 a1-2))) + (matrix*! (-> this origin) a1-3 (-> this origin)) + ) + ) + ) + (when (logtest? (-> arg0 flags) (sp-group-flag sp7)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 x) (-> arg0 scale-x)) + (set! (-> a1-4 y) (-> arg0 scale-y)) + (set! (-> a1-4 z) (-> arg0 scale-z)) + (set! (-> a1-4 w) 1.0) + (set! (-> a1-4 w) 1.0) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) + ) + ) + (dotimes (s3-0 (-> arg0 length)) + (let* ((a0-7 (-> arg0 launcher s3-0)) + (a1-6 (-> *part-id-table* (-> a0-7 launcher))) + (v1-29 (-> this data s5-0)) + ) + (when (nonzero? a1-6) + (set! (-> v1-29 group-item) a0-7) + (cond + ((= (-> a1-6 type) sparticle-launcher) + (set! (-> v1-29 accum) 0.0) + (set! (-> v1-29 spawn-time) (the-as uint (+ (current-time) (seconds -100)))) + (set! (-> v1-29 offset) (the-as uint (-> a0-7 offset))) + (set! (-> v1-29 randomize) (the-as uint 0)) + (cond + ((logtest? (-> a0-7 flags) (sp-group-item-flag sp2)) + (logclear! (-> v1-29 flags) (sp-launch-state-flags sp0)) + (set! (-> v1-29 center) #f) + (set! (-> v1-29 sprite3d) #f) + (set! (-> v1-29 sprite) #f) + ) + (else + (logior! (-> v1-29 flags) (sp-launch-state-flags sp0)) + (set! (-> v1-29 center) (-> this origin trans)) + (set! (-> v1-29 sprite3d) #f) + (set! (-> v1-29 sprite) #f) + ) + ) + (+! s5-0 1) + ) + (else + (format 0 "initialize called with non-particle-launcher~%") + ) + ) + ) + ) + ) + (set! (-> this length) s5-0) + ) + 0 + (none) + ) + +;; definition for method 9 of type sparticle-launch-group +;; WARN: Return type mismatch object vs sparticle-launch-control. +(defmethod create-launch-control ((this sparticle-launch-group) (arg0 process)) + (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) + (when (zero? (the-as sparticle-launch-control gp-0)) + (go process-drawable-art-error "memory") + (set! gp-0 0) + (goto cfg-4) + ) + (initialize (the-as sparticle-launch-control gp-0) this (the-as process-drawable arg0)) + (label cfg-4) + (the-as sparticle-launch-control gp-0) + ) + ) + +;; definition for method 19 of type sparticle-launch-control +;; WARN: Return type mismatch int vs none. +(defmethod kill-particles ((this sparticle-launch-control)) + (countdown (v1-0 (-> this length)) + (let ((a0-4 (-> this data v1-0))) + (logclear! (-> a0-4 flags) (sp-launch-state-flags sp1)) + ) + ) + (set! (-> this local-clock) 0) + (set! (-> this local-space-binding) (the-as particle-local-space-info 1.0)) + (kill-all-particles-with-key this) + (if (> (-> this matrix) 0) + (sprite-release-user-hvdf (-> this matrix)) + ) + 0 + (none) + ) + +;; definition for method 12 of type sparticle-launch-control +;; WARN: Return type mismatch int vs none. +(defmethod clear-2 ((this sparticle-launch-control)) + "Set length to 0" + (kill-all-particles-with-key this) + 0 + (none) + ) + +;; definition for method 15 of type sparticle-launch-control +(defmethod is-visible? ((this sparticle-launch-control) (arg0 vector)) + (let* ((v1-0 (-> this group)) + (f0-0 (-> v1-0 bounds r)) + ) + (cond + ((= f0-0 0.0) + #t + ) + ((nonzero? (-> this matrix)) + #t + ) + (else + (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) + (set! (-> s5-1 w) f0-0) + (when (or *display-sprite-marks* + *display-sprite-spheres* + (and *display-actor-vis* (= (-> this proc) *debug-actor*)) + ) + (add-debug-sphere + *display-sprite-spheres* + (bucket-id debug) + s5-1 + (-> s5-1 w) + (new 'static 'rgba :g #xff :a #x80) + ) + (add-debug-matrix *display-sprite-marks* (bucket-id debug) (-> this origin) (meters 2)) + ) + (sphere-in-view-frustum? (the-as sphere s5-1)) + ) + ) + ) + ) + ) + +;; definition for method 20 of type sparticle-launch-control +;; WARN: Return type mismatch particle-local-space-info vs none. +(defmethod set-local-space-info ((this sparticle-launch-control) (arg0 particle-local-space-info)) + (set! (-> this local-space-binding) arg0) + (none) + ) + +;; definition for function execute-particle-local-space-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun execute-particle-local-space-engine ((arg0 int)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (let* ((gp-0 *part-local-space-engine*) + (v1-2 (-> gp-0 alive-list next0)) + (s5-0 (-> (the-as connection v1-2) next0)) + ) + (while (!= v1-2 (-> gp-0 alive-list-end)) + ((the-as (function object) (-> (the-as connection v1-2) param0))) + (set! v1-2 s5-0) + (set! s5-0 (-> (the-as connection s5-0) next0)) + ) + ) + ) + ((= v1-0 1) + (let* ((v1-7 *part-local-space-engine*) + (a1-0 (-> v1-7 alive-list next0)) + (a0-13 (-> (the-as particle-local-space-info a1-0) next0)) + ) + (while (!= a1-0 (-> v1-7 alive-list-end)) + (let* ((a2-0 (-> (the-as particle-local-space-info a1-0) mat-prev)) + (t1-0 (-> (the-as particle-local-space-info a1-0) mat-new)) + (a1-1 (-> t1-0 rvec quad)) + (a3-0 (-> t1-0 uvec quad)) + (t0-0 (-> t1-0 fvec quad)) + (t1-1 (-> t1-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) a1-1) + (set! (-> a2-0 uvec quad) a3-0) + (set! (-> a2-0 fvec quad) t0-0) + (set! (-> a2-0 trans quad) t1-1) + ) + (set! a1-0 a0-13) + (set! a0-13 (-> a0-13 next0)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function local-space-camera +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun local-space-camera ((arg0 particle-local-space-info)) + (let ((s5-0 (math-camera-matrix)) + (gp-0 (-> arg0 mat-new)) + ) + (logior! (-> arg0 flags) (part-local-space-flags pls2)) + (cond + ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) + (matrix-identity! gp-0) + (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + ) + ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) + (let ((a2-0 gp-0) + (v1-7 (-> s5-0 rvec quad)) + (a0-4 (-> s5-0 uvec quad)) + (a1-0 (-> s5-0 fvec quad)) + (a3-0 (-> s5-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-7) + (set! (-> a2-0 uvec quad) a0-4) + (set! (-> a2-0 fvec quad) a1-0) + (set! (-> a2-0 trans quad) a3-0) + ) + (set! (-> gp-0 rvec y) 0.0) + (set! (-> gp-0 fvec y) 0.0) + (vector-normalize! (-> gp-0 rvec) 1.0) + (vector-normalize! (-> gp-0 fvec) 1.0) + (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) + ) + (else + (let* ((a2-1 s5-0) + (v1-10 (-> a2-1 rvec quad)) + (a0-8 (-> a2-1 uvec quad)) + (a1-4 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-10) + (set! (-> gp-0 uvec quad) a0-8) + (set! (-> gp-0 fvec quad) a1-4) + (set! (-> gp-0 trans quad) a2-2) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function local-space-proc-joint +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun local-space-proc-joint ((arg0 particle-local-space-info)) + (let ((a2-0 (handle->process (-> arg0 hand)))) + (when a2-0 + (let ((s5-0 (-> (the-as process-drawable a2-0) node-list data (the-as int (-> arg0 param1)) bone transform)) + (gp-0 (-> arg0 mat-new)) + ) + (logior! (-> arg0 flags) (part-local-space-flags pls2)) + (cond + ((logtest? (-> arg0 flags) (part-local-space-flags pls0)) + (matrix-identity! gp-0) + (set! (-> gp-0 trans quad) (-> s5-0 trans quad)) + ) + ((logtest? (-> arg0 flags) (part-local-space-flags pls1)) + (let ((a2-2 gp-0) + (v1-14 (-> s5-0 rvec quad)) + (a0-4 (-> s5-0 uvec quad)) + (a1-5 (-> s5-0 fvec quad)) + (a3-0 (-> s5-0 trans quad)) + ) + (set! (-> a2-2 rvec quad) v1-14) + (set! (-> a2-2 uvec quad) a0-4) + (set! (-> a2-2 fvec quad) a1-5) + (set! (-> a2-2 trans quad) a3-0) + ) + (set! (-> gp-0 rvec y) 0.0) + (set! (-> gp-0 fvec y) 0.0) + (vector-normalize! (-> gp-0 rvec) 1.0) + (vector-normalize! (-> gp-0 fvec) 1.0) + (vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec)) + ) + (else + (let* ((a2-3 s5-0) + (v1-17 (-> a2-3 rvec quad)) + (a0-8 (-> a2-3 uvec quad)) + (a1-9 (-> a2-3 fvec quad)) + (a2-4 (-> a2-3 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-17) + (set! (-> gp-0 uvec quad) a0-8) + (set! (-> gp-0 fvec quad) a1-9) + (set! (-> gp-0 trans quad) a2-4) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 17 of type sparticle-launch-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod spawn-from-mat ((this sparticle-launch-control) (arg0 matrix)) + (let* ((a2-0 (-> this origin)) + (a3-0 arg0) + (v1-0 (-> a3-0 rvec quad)) + (a0-1 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-0) + (set! (-> a2-0 uvec quad) a0-1) + (set! (-> a2-0 fvec quad) a1-1) + (set! (-> a2-0 trans quad) a3-1) + ) + (let ((s4-0 (-> this group))) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp6)) + (let ((f0-0 (-> s4-0 rotate-x)) + (f1-0 (-> s4-0 rotate-y)) + (f2-0 (-> s4-0 rotate-z)) + (t9-0 matrix-rotate-xyz!) + (a0-2 (new 'stack-no-clear 'matrix)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) f0-0) + (set! (-> a1-2 y) f1-0) + (set! (-> a1-2 z) f2-0) + (set! (-> a1-2 w) 1.0) + (let ((a1-3 (t9-0 a0-2 a1-2))) + (matrix*! (-> this origin) a1-3 (-> this origin)) + ) + ) + ) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp7)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 x) (-> s4-0 scale-x)) + (set! (-> a1-4 y) (-> s4-0 scale-y)) + (set! (-> a1-4 z) (-> s4-0 scale-z)) + (set! (-> a1-4 w) 1.0) + (set! (-> a1-4 w) 1.0) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) + ) + ) + ) + (spawn this (-> arg0 trans)) + (none) + ) + +;; definition for method 18 of type sparticle-launch-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod spawn-from-cspace ((this sparticle-launch-control) (arg0 cspace)) + (let* ((v1-0 (-> this origin)) + (a3-0 (-> arg0 bone transform)) + (a0-2 (-> a3-0 rvec quad)) + (a1-1 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-0 rvec quad) a0-2) + (set! (-> v1-0 uvec quad) a1-1) + (set! (-> v1-0 fvec quad) a2-0) + (set! (-> v1-0 trans quad) a3-1) + ) + (let ((s4-0 (-> this group))) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp6)) + (let ((f0-0 (-> s4-0 rotate-x)) + (f1-0 (-> s4-0 rotate-y)) + (f2-0 (-> s4-0 rotate-z)) + (t9-0 matrix-rotate-xyz!) + (a0-3 (new 'stack-no-clear 'matrix)) + (a1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-2 x) f0-0) + (set! (-> a1-2 y) f1-0) + (set! (-> a1-2 z) f2-0) + (set! (-> a1-2 w) 1.0) + (let ((a1-3 (t9-0 a0-3 a1-2))) + (matrix*! (-> this origin) a1-3 (-> this origin)) + ) + ) + ) + (when (logtest? (-> s4-0 flags) (sp-group-flag sp7)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 x) (-> s4-0 scale-x)) + (set! (-> a1-4 y) (-> s4-0 scale-y)) + (set! (-> a1-4 z) (-> s4-0 scale-z)) + (set! (-> a1-4 w) 1.0) + (set! (-> a1-4 w) 1.0) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) + ) + ) + ) + (spawn this (vector<-cspace! (-> this origin trans) arg0)) + (none) + ) + +;; definition for method 16 of type sparticle-launch-control +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defmethod spawn ((this sparticle-launch-control) (arg0 vector)) + (with-pp + (set! (-> this origin trans quad) (-> arg0 quad)) + (if (not (or (is-visible? this arg0) + (logtest? (-> this group flags) (sp-group-flag sp1 sp2)) + (and (logtest? (-> this group flags) (sp-group-flag sp2 sp11)) + (not (-> *setting-control* user-current part-bounds-check)) + ) + ) + ) + (return (the-as object 0)) + ) + (when (logtest? (-> this group flags) (sp-group-flag sp12)) + (let* ((v1-18 (-> this origin)) + (a3-0 (-> this local-space-binding mat-prev)) + (a0-5 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-18 rvec quad) a0-5) + (set! (-> v1-18 uvec quad) a1-2) + (set! (-> v1-18 fvec quad) a2-0) + (set! (-> v1-18 trans quad) a3-1) + ) + ) + (let ((s4-0 (the-as int (current-time))) + (s5-0 (-> this last-spawn-time)) + ) + (let ((v1-22 (-> *display* real-frame-clock integral-frame-counter))) + (if (!= v1-22 (+ (-> this last-spawn-frame) 1)) + (set! s5-0 (the-as int (- (the-as time-frame s4-0) (logand (the-as int (-> pp clock sparticle-data x)) 255)))) + ) + ) + (set! (-> this last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) + (set! (-> this last-spawn-time) s4-0) + (when (logtest? (-> this group flags) (sp-group-flag sp0)) + (set! s5-0 (-> this local-clock)) + (+! (-> this local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) + (set! s4-0 (-> this local-clock)) + ) + (let* ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) + (v1-38 1) + (a0-12 *time-of-day*) + (s3-1 (ash v1-38 (if a0-12 + (-> a0-12 0 hours) + 0 + ) + ) + ) + ) + (if (nonzero? (-> this matrix)) + (set! f30-0 0.0) + ) + (let ((s2-1 (-> this length))) + (b! #t cfg-102 :delay (nop!)) + (label cfg-26) + (+! s2-1 -1) + (let* ((a3-2 (-> this data s2-1)) + (v1-45 (-> a3-2 group-item)) + (a1-5 (-> *part-id-table* (-> v1-45 launcher))) + ) + (when (and a1-5 (nonzero? a1-5) (logtest? (-> a3-2 flags) (sp-launch-state-flags sp0))) + (let* ((f1-3 (if (!= (-> v1-45 falloff-to) 0.0) + (- 1.0 (/ f30-0 (-> v1-45 falloff-to))) + 1.0 + ) + ) + (f0-5 f1-3) + ) + (let ((a0-24 sparticle-launcher)) + (b! (!= (-> a1-5 type) a0-24) cfg-101 :delay (nop!)) + ) + (b! (not (logtest? (-> v1-45 flags) (sp-group-item-flag sp3))) cfg-49 :delay (nop!)) + (when (not (logtest? (-> a3-2 flags) (sp-launch-state-flags sp1))) + (set! (-> a3-2 spawn-time) (the-as uint s4-0)) + (logior! (-> a3-2 flags) (sp-launch-state-flags sp1)) + (when (< 0.0 f0-5) + (cond + ((logtest? (-> v1-45 flags) (sp-group-item-flag sp7)) + (launch-particles + :system (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + a1-5 + (-> this origin) + :launch-state a3-2 + :launch-control this + :rate f0-5 + :origin-is-matrix #t + ) + ) + (else + (let ((t9-4 sp-launch-particles-var) + (a0-37 (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> a3-2 center quad)) + (t9-4 a0-37 a1-5 a2-5 a3-2 this f0-5) + ) + ) + ) + ) + ) + (b! #t cfg-100 :delay (nop!)) + (label cfg-49) + (when (or (logtest? s3-1 (-> v1-45 hour-mask)) + (not (or (= (-> v1-45 fade-after) 0.0) (< f30-0 (-> v1-45 fade-after)))) + ) + 0 + (goto cfg-100) + ) + (b! (nonzero? (-> v1-45 period)) cfg-66 :delay (empty-form)) + (if (not (logtest? (-> v1-45 flags) (sp-group-item-flag sp6))) + (set! f0-5 (* 0.2 (the float (- s4-0 s5-0)) f0-5)) + ) + (b! #t cfg-88 :delay (nop!)) + (label cfg-66) + 0 + 0 + (let* ((a2-6 (-> v1-45 length)) + (a0-56 (-> v1-45 period)) + (t0-10 (mod (+ (- s5-0 (the-as int (-> this data s2-1 offset))) a0-56) (the-as int a0-56))) + (a0-57 (mod (the-as uint (+ (- s4-0 (the-as int (-> this data s2-1 offset))) a0-56)) a0-56)) + ) + (set! f0-5 (cond + ((and (< t0-10 (the-as int a2-6)) (< (the-as int a0-57) (the-as int a2-6))) + (* 0.2 (the float (- s4-0 s5-0)) f0-5) + ) + ((and (< t0-10 (the-as int a2-6)) (>= (the-as int a0-57) (the-as int a2-6))) + (* 0.2 (the float (- a2-6 (the-as uint t0-10))) f0-5) + ) + ((and (>= t0-10 (the-as int a2-6)) (< (the-as int a0-57) (the-as int a2-6))) + (* 0.2 (the float a0-57) f0-5) + ) + (else + (when (not (logtest? (-> v1-45 flags) (sp-group-item-flag sp1))) + 0 + (goto cfg-100) + ) + (when (< (the-as uint (- s4-0 (the-as int (-> this data s2-1 spawn-time)))) (-> v1-45 period)) + 0 + (goto cfg-100) + ) + (set! (-> this data s2-1 offset) (- (-> v1-45 period) a0-57)) + (* 0.2 (the float (- s4-0 s5-0)) f0-5) + ) + ) + ) + ) + (label cfg-88) + (set! (-> a3-2 spawn-time) (the-as uint s4-0)) + (logior! (-> a3-2 flags) (sp-launch-state-flags sp1)) + (when (< 0.0 f0-5) + (if (logtest? (-> v1-45 flags) (sp-group-item-flag sp6)) + (set! f0-5 f1-3) + ) + (cond + ((logtest? (-> v1-45 flags) (sp-group-item-flag sp7)) + (launch-particles + :system (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + a1-5 + (-> this origin) + :launch-state a3-2 + :launch-control this + :rate f0-5 + :origin-is-matrix #t + ) + ) + (else + (let ((t9-6 sp-launch-particles-var) + (a0-82 (if (logtest? (-> v1-45 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + (a2-23 *launch-matrix*) + ) + (set! (-> a2-23 trans quad) (-> a3-2 center quad)) + (t9-6 a0-82 a1-5 a2-23 a3-2 this f0-5) + ) + ) + ) + ) + ) + (label cfg-100) + (b! #t cfg-102 :delay (nop!)) + (label cfg-101) + (format 0 "spawn called for non-sparticle-launcher~%") + ) + ) + (label cfg-102) + (b! (nonzero? s2-1) cfg-26 :delay (nop!)) + ) + ) + ) + 0 + ) + ) + +;; definition for function execute-part-engine +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun execute-part-engine () + (local-vars (sv-96 sparticle-launcher) (sv-104 int)) + (let ((gp-0 *sp-particle-system-2d*)) + (let* ((s5-0 *part-engine*) + (s4-0 *part-id-table*) + (s3-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'vector)) + (v1-1 (-> s5-0 alive-list next0)) + (s1-0 (-> v1-1 next0)) + ) + (while (!= v1-1 (-> s5-0 alive-list-end)) + (let* ((a0-2 (the-as process-drawable (-> (the-as connection v1-1) param1))) + (a1-0 (-> a0-2 draw)) + (s0-0 (the-as object (-> (the-as connection v1-1) param3))) + ) + (when (and (logtest? (-> a1-0 status) (draw-control-status on-screen)) + (< (-> a1-0 distance) (-> (the-as vector s0-0) w)) + ) + (set! sv-96 (-> s4-0 (-> (the-as connection v1-1) param2))) + (set! sv-104 (the-as int (-> (the-as connection v1-1) param0))) + (when (nonzero? sv-96) + (let ((a1-8 (-> a0-2 node-list data sv-104))) + (let* ((v1-7 s3-0) + (t0-0 (-> a1-8 bone transform)) + (a0-5 (-> t0-0 rvec quad)) + (a2-2 (-> t0-0 uvec quad)) + (a3-0 (-> t0-0 fvec quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-7 rvec quad) a0-5) + (set! (-> v1-7 uvec quad) a2-2) + (set! (-> v1-7 fvec quad) a3-0) + (set! (-> v1-7 trans quad) t0-1) + ) + (vector<-cspace! (-> s3-0 trans) a1-8) + ) + (set! (-> s2-0 quad) (-> (the-as vector s0-0) quad)) + (set! (-> s2-0 w) 1.0) + (vector-matrix*! (-> s3-0 trans) s2-0 s3-0) + (launch-particles :system gp-0 sv-96 s3-0 :origin-is-matrix #t) + ) + ) + ) + (set! v1-1 s1-0) + (set! s1-0 (-> s1-0 next0)) + ) + ) + (let* ((s5-1 (camera-pos)) + (v1-12 1) + (a0-14 *time-of-day*) + (s4-1 (ash v1-12 (if a0-14 + (-> a0-14 0 hours) + 0 + ) + ) + ) + ) + (dotimes (s3-1 (-> *level* length)) + (let ((v1-16 (-> *level* level s3-1))) + (when (= (-> v1-16 status) 'active) + (let ((s2-1 (-> v1-16 part-engine))) + (when s2-1 + (countdown (s1-1 (-> s2-1 length)) + (let ((s0-1 (-> s2-1 data s1-1))) + (when (and (or (zero? (-> s0-1 param3)) + (< (vector-vector-distance s5-1 (the-as vector (&-> s0-1 param0))) (the-as float (gpr->fpr (-> s0-1 param3)))) + ) + (not (logtest? s4-1 (the-as int (-> s0-1 prev1)))) + ) + (let ((a1-14 (-> s0-1 next1)) + (t9-5 sp-launch-particles-var) + (a0-25 gp-0) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> (the-as vector (&-> s0-1 param0)) quad)) + (t9-5 + a0-25 + (the-as sparticle-launcher a1-14) + a2-5 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sparticle-track-root +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-root ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-3 (-> arg1 key proc root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + 0 + (none) + ) + +;; definition for function sparticle-track-root-prim +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-root-prim ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-4 (-> (the-as collide-shape (-> arg1 key proc root)) root-prim prim-core))) + (set! (-> arg2 x) (-> v1-4 world-sphere x)) + (set! (-> arg2 y) (-> v1-4 world-sphere y)) + (set! (-> arg2 z) (-> v1-4 world-sphere z)) + ) + 0 + (none) + ) + +;; definition for function sparticle-track-joint +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-1 (-> arg1 key proc)) + (a1-1 (the int (-> arg1 user-float))) + (v1-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1))) + ) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + 0 + (none) + ) + +;; definition for function sparticle-turn-to-vel +;; WARN: Return type mismatch int vs none. +(defun sparticle-turn-to-vel ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-1 float) (v1-2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (quaternion-axis-angle! gp-0 0.0 1.0 0.0 (+ 32768.0 (vector-y-angle (-> arg1 vel-sxvel)))) + (cond + ((< (-> gp-0 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-1 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-2 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function sparticle-rotate-to-vel-3d +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sparticle-rotate-to-vel-3d ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) (arg3 vector)) + (local-vars (v1-9 float) (v1-10 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (let ((s4-0 (-> arg1 key proc))) + (vector-normalize! s5-0 1.0) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (v1-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-4 x) (-> arg2 x-y-z-sx x)) + (set! (-> v1-4 y) (-> arg2 x-y-z-sx y)) + (set! (-> v1-4 z) (-> arg2 x-y-z-sx z)) + (set! (-> v1-4 w) 1.0) + (let ((s3-1 (vector-! s3-0 v1-4 (-> s4-0 root trans))) + (s2-0 (new 'stack-no-clear 'matrix)) + ) + (cond + (#t + (set! (-> s3-1 y) 0.0) + (vector-rotate-around-y! s3-1 s3-1 16384.0) + (vector-normalize! s3-1 1.0) + (matrix-r-f-compose s2-0 s5-0 s3-1 arg3) + ) + (else + (matrix-r-f-compose s2-0 s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 root quat)) arg3) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (matrix->quaternion s5-1 s2-0) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-9 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-10 vf1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function birth-func-clean +;; WARN: Return type mismatch int vs none. +(defun birth-func-clean ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when *display-capture-mode* + (set! (-> arg1 timer) 0) + 0 + ) + 0 + (none) + ) + +;; definition for function birth-func-process-clock +;; WARN: Return type mismatch int vs none. +(defun birth-func-process-clock ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg1 clock-index) (the-as uint (-> *kernel-context* current-process clock index))) + 0 + (none) + ) + +;; definition for function birth-func-copy-rot-color +;; WARN: Return type mismatch int vs none. +(defun birth-func-copy-rot-color ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-5 float) (v1-6 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion-rotate-y! s4-0 s4-0 (-> s5-0 sprite flag-rot-sy z)) + (let ((v1-4 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-4 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-4 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + (else + (.lvf vf1 (&-> v1-4 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-4 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a x) (-> s5-0 sprite r-g-b-a x)) + (set! (-> arg2 r-g-b-a y) (-> s5-0 sprite r-g-b-a y)) + (set! (-> arg2 r-g-b-a z) (-> s5-0 sprite r-g-b-a z)) + ) + 0 + (none) + ) + ) + +;; definition for symbol *global-toggle*, type int +(define *global-toggle* 0) + +;; definition for function birth-func-copy2-rot-color +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-copy2-rot-color ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-18 float) (v1-19 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> arg4 sprite))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (let* ((v1-0 arg2) + (f0-0 (-> v1-0 qx-qy-qz-sy x)) + (f1-0 (-> v1-0 qx-qy-qz-sy y)) + (f2-0 (-> v1-0 qx-qy-qz-sy z)) + ) + (set! (-> s4-0 x) f0-0) + (set! (-> s4-0 y) f1-0) + (set! (-> s4-0 z) f2-0) + (set! (-> s4-0 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (let ((a1-1 (new-stack-vector0))) + (set! (-> a1-1 y) (-> s5-0 sprite flag-rot-sy z)) + (set! (-> a1-1 z) (if (logtest? *global-toggle* 1) + (the float (sar (shl (the int (- 16384.0 (-> s5-0 sprite x-y-z-sx w))) 48) 48)) + (the float (sar (shl (the int (+ 16384.0 (-> s5-0 sprite x-y-z-sx w))) 48) 48)) + ) + ) + (quaternion-zxy! s4-0 a1-1) + ) + (let ((v1-17 arg2)) + (cond + ((< (-> s4-0 w) 0.0) + (.lvf vf1 (&-> v1-17 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-17 qx-qy-qz-sy quad) vf1) + (.mov v1-18 vf1) + ) + (else + (.lvf vf1 (&-> v1-17 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s4-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> v1-17 qx-qy-qz-sy quad) vf1) + (.mov v1-19 vf1) + ) + ) + ) + ) + (set! (-> arg2 r-g-b-a x) (-> s5-0 sprite r-g-b-a x)) + (set! (-> arg2 r-g-b-a y) (-> s5-0 sprite r-g-b-a y)) + (set! (-> arg2 r-g-b-a z) (-> s5-0 sprite r-g-b-a z)) + ) + (set! *global-toggle* (+ *global-toggle* 1)) + 0 + (none) + ) + ) + +;; definition for function birth-func-copy-omega-to-z +;; WARN: Return type mismatch int vs none. +(defun birth-func-copy-omega-to-z ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg2 qx-qy-qz-sy z) (+ -16384.0 (-> arg1 omega))) + (set! (-> arg1 next-time) (-> arg4 sprite next-time)) + (set! (-> arg2 x-y-z-sx w) (* 163.85638 (the float (-> arg4 sprite next-time)))) + 0 + (none) + ) + +;; definition for function birth-func-random-next-time +;; WARN: Return type mismatch int vs none. +(defun birth-func-random-next-time ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg1 next-time) (the-as uint (the int (rand-vu-float-range 0.0 (-> arg1 user-float))))) + 0 + (none) + ) + +;; definition for function sparticle-respawn-heights +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sparticle-respawn-heights ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((gp-0 (the-as (array int32) (-> arg1 user-float)))) + (when (and (nonzero? gp-0) + (or (and (< (-> arg1 vel-sxvel y) 0.0) (< (-> arg2 y) (the-as float (gpr->fpr (-> gp-0 1))))) + (and (< 0.0 (-> arg1 vel-sxvel y)) (< (the-as float (gpr->fpr (-> gp-0 2))) (-> arg2 y))) + ) + ) + (sp-kill-particle arg0 arg1) + (let ((s3-0 (+ (-> gp-0 length) -1))) + (when (< 2 s3-0) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (if (zero? (-> gp-0 0)) + *sp-particle-system-2d* + *sp-particle-system-3d* + ) + ) + ) + (set-vector! s2-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (let ((s5-1 3)) + (while (>= s3-0 s5-1) + (let ((t9-1 sp-launch-particles-var) + (a0-2 s1-0) + (a1-3 (-> *part-id-table* (-> gp-0 s5-1))) + (a2-1 *launch-matrix*) + ) + (set! (-> a2-1 trans quad) (-> s2-0 quad)) + (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (+! s5-1 1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sparticle-respawn-timer +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sparticle-respawn-timer ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (<= (-> arg1 timer) 0) + (let ((gp-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? gp-0) + (sp-kill-particle arg0 arg1) + (let ((s5-0 (+ (-> gp-0 length) -1))) + (when (< 2 s5-0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (if (zero? (-> gp-0 0)) + *sp-particle-system-2d* + *sp-particle-system-3d* + ) + ) + ) + (set-vector! s4-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (let ((s2-1 3)) + (while (>= s5-0 s2-1) + (let ((t9-1 sp-launch-particles-var) + (a0-2 s3-0) + (a1-3 (-> *part-id-table* (-> gp-0 s2-1))) + (a2-1 *launch-matrix*) + ) + (set! (-> a2-1 trans quad) (-> s4-0 quad)) + (t9-1 a0-2 a1-3 a2-1 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (+! s2-1 1) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sparticle-texture-animate +;; WARN: Return type mismatch symbol vs none. +(defun sparticle-texture-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? v1-0) + (if (zero? (-> v1-0 2)) + (set! (-> v1-0 2) (-> arg1 timer)) + ) + (let* ((a0-6 (+ (-> v1-0 length) -3)) + (a2-1 (-> v1-0 0)) + (a3-0 (-> v1-0 2)) + (t0-1 (if (< (-> arg1 timer) 0) + (the-as int (-> *display* base-clock frame-counter)) + (- a3-0 (-> arg1 timer)) + ) + ) + ) + (cond + ((zero? (-> v1-0 1)) + (let ((v1-2 + (the-as + (array int32) + (-> (the-as + (array int32) + (+ (* (+ (max 0 (min (+ (/ t0-1 a2-1) (-> arg1 user1-int16)) (+ a0-6 -1))) 3) 4) (the-as int v1-0)) + ) + 0 + ) + ) + ) + ) + (if (nonzero? v1-2) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id v1-2)) + ) + ) + ) + (else + (let ((v1-4 (-> v1-0 (+ (mod (max 0 (+ (/ t0-1 a2-1) (-> arg1 user1-int16))) a0-6) 3)))) + (if (nonzero? v1-4) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id v1-4)) + ) + ) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function sparticle-texture-day-night +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +;; ERROR: Bad vector register dependency: vf1 +;; ERROR: Bad vector register dependency: vf2 +(defun sparticle-texture-day-night ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (local-vars + (v1-9 uint128) + (v1-10 uint128) + (v1-13 uint128) + (v1-14 uint128) + (v1-23 uint128) + (v1-24 uint128) + (v1-27 uint128) + (v1-28 uint128) + (v1-33 float) + (a0-5 float) + (a0-11 float) + (t7-0 float) + (t7-3 float) + (s3-0 float) + (s4-0 float) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((s2-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? s2-0) + (let* ((v1-1 *time-of-day*) + (s1-0 (if v1-1 + (-> v1-1 0 hours) + 0 + ) + ) + (f0-0 (rand-vu)) + ) + (.mov s4-0 vf1) + (.mov s3-0 vf2) + (cond + ((or (< s1-0 6) (< 18 s1-0)) + (let ((a1-1 (-> s2-0 7))) + (when (nonzero? a1-1) + (let ((v1-6 f0-0)) + (.mov vf2 v1-6) + ) + (let ((v1-8 (the-as uint128 (make-u128 0 (-> s2-0 9))))) + (.pextlb v1-9 0 v1-8) + ) + (.pextlb v1-10 0 v1-9) + (.mov vf1 v1-10) + (.itof.vf vf1 vf1) + (.mul.x.vf vf1 vf1 vf2) + (let ((v1-12 (the-as uint128 (make-u128 0 (-> s2-0 8))))) + (.pextlb v1-13 0 v1-12) + ) + (.pextlb v1-14 0 v1-13) + (.mov vf2 v1-14) + (.itof.vf vf2 vf2) + (.add.vf vf1 vf1 vf2) + (let ((v1-15 (-> arg1 flags-s32))) + (when (nonzero? (-> s2-0 10)) + (.lvf vf2 (&-> *time-of-day-context* current-prt-color quad)) + (.mul.vf vf1 vf1 vf2) + (.mov a0-5 vf1) + ) + (let ((v1-16 (logand v1-15 #x4000))) + (.mov t7-0 vf1) + (let ((v1-17 (sar v1-16 14))) + (set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand t7-0 (the-as uint -2)) v1-17))) + ) + ) + ) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1)) + ) + ) + ) + (else + (let ((a1-2 (-> s2-0 3))) + (when (nonzero? a1-2) + (let ((v1-20 f0-0)) + (.mov vf2 v1-20) + ) + (let ((v1-22 (the-as uint128 (make-u128 0 (-> s2-0 5))))) + (.pextlb v1-23 0 v1-22) + ) + (.pextlb v1-24 0 v1-23) + (.mov vf1 v1-24) + (.itof.vf vf1 vf1) + (.mul.x.vf vf1 vf1 vf2) + (let ((v1-26 (the-as uint128 (make-u128 0 (-> s2-0 4))))) + (.pextlb v1-27 0 v1-26) + ) + (.pextlb v1-28 0 v1-27) + (.mov vf2 v1-28) + (.itof.vf vf2 vf2) + (.add.vf vf1 vf1 vf2) + (let ((v1-29 (-> arg1 flags-s32))) + (when (nonzero? (-> s2-0 6)) + (.lvf vf2 (&-> *time-of-day-context* current-prt-color quad)) + (.mul.vf vf1 vf1 vf2) + (.mov a0-11 vf1) + ) + (let ((v1-30 (logand v1-29 #x4000))) + (.mov t7-3 vf1) + (let ((v1-31 (sar v1-30 14))) + (set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand t7-3 (the-as uint -2)) v1-31))) + ) + ) + ) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-2)) + ) + ) + ) + ) + ) + (.mov vf1 s4-0) + (.mov vf2 s3-0) + (.mov v1-33 vf2) + ) + ) + (none) + ) + ) + +;; definition for function sparticle-mode-animate +;; WARN: Return type mismatch int vs none. +(defun sparticle-mode-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((a0-1 (-> arg1 key)) + (v1-0 (the-as object (-> arg1 user-float))) + ) + (when (nonzero? (the-as float v1-0)) + (let ((a1-2 (the-as (array uint32) (-> (the-as (array symbol) v1-0) 0 value)))) + (when (nonzero? a1-2) + (let* ((a1-4 (the-as object (-> a1-2 (min (the-as int (+ (-> a0-1 state-mode 0) 1)) (+ (-> a1-2 length) -1))))) + (a0-8 (the-as + object + (-> (the-as (array int32) a1-4) + (+ (mod + (the-as int (/ (-> a0-1 state-counter) (the-as uint (/ (-> (the-as vector4w a1-4) w) 8)))) + (+ (-> (the-as (pointer int32) a1-4) 0) -1) + ) + 1 + ) + ) + ) + ) + (a1-6 (/ (-> (the-as (array int32) v1-0) 1) 8)) + (a2-14 (-> (the-as (pointer int64) a0-8) (/ a1-6 64))) + (a0-11 (logtest? a2-14 (ash 1 (logand a1-6 63)))) + (s4-0 (if a0-11 + (-> (the-as (pointer int32) v1-0) 6) + (-> (the-as (pointer int32) v1-0) 5) + ) + ) + ) + (if a0-11 + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 64.0 192.0)) + (set! (-> arg2 r-g-b-a x) (rand-vu-float-range 32.0 48.0)) + ) + (set! (-> arg2 r-g-b-a y) (-> arg2 r-g-b-a x)) + (set! (-> arg2 r-g-b-a z) (-> arg2 r-g-b-a x)) + (if (nonzero? s4-0) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id s4-0)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sparticle-motion-blur +;; INFO: function output is handled by mips2c +(def-mips2c sparticle-motion-blur (function sparticle-system sparticle-cpuinfo vector none)) + +;; definition (debug) for function sparticle-motion-blur-old +;; WARN: Return type mismatch int vs object. +(defun-debug sparticle-motion-blur-old ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector4w)) + (s3-0 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> s2-0 x) (-> arg2 x-y-z-sx x)) + (set! (-> s2-0 y) (-> arg2 x-y-z-sx y)) + (set! (-> s2-0 z) (-> arg2 x-y-z-sx z)) + (set! (-> s2-0 w) 1.0) + (when (and (or (!= (-> arg1 vel-sxvel x) 0.0) (!= (-> arg1 vel-sxvel y) 0.0) (!= (-> arg1 vel-sxvel z) 0.0)) + (transform-point-qword! s5-0 s2-0) + ) + (+! (-> s2-0 x) (* 32.0 (-> arg1 vel-sxvel x))) + (+! (-> s2-0 y) (* 32.0 (-> arg1 vel-sxvel y))) + (+! (-> s2-0 z) (* 32.0 (-> arg1 vel-sxvel z))) + (when (transform-point-qword! s3-0 s2-0) + (let* ((f0-14 (the float (+ (-> s5-0 x) -28672))) + (f1-10 (the float (+ (-> s5-0 y) -29440))) + (f2-4 (the float (+ (-> s3-0 x) -28672))) + (f3-1 (the float (+ (-> s3-0 y) -29440))) + (f30-0 (- f2-4 f0-14)) + (f28-0 (- f3-1 f1-10)) + ) + (set! (-> arg2 qx-qy-qz-sy z) (+ -16384.0 (atan f30-0 f28-0))) + (let ((f0-17 (-> arg1 omega))) + (if (!= f0-17 0.0) + (set! (-> arg2 x-y-z-sx w) (* (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0))) + f0-17 + (lerp-scale 3.0 0.25 (/ 1.0 (the float (-> s5-0 z))) 0.000001 0.00000014285715) + ) + ) + ) + ) + ) + (return (the-as object #f)) + ) + ) + ) + (if (!= (-> arg1 omega) 0.0) + (set! (-> arg2 x-y-z-sx w) 0.0) + ) + 0 + ) + +;; definition for function sparticle-set-conerot +;; WARN: Return type mismatch int vs none. +(defun sparticle-set-conerot ((arg0 sparticle-launcher) (arg1 vector)) + (let ((s5-0 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-x))) + (s4-0 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-y))) + (v1-3 (get-field-spec-by-id arg0 (sp-field-id spt-conerot-z))) + ) + (set! (-> s5-0 initial-valuef) (-> arg1 x)) + (set! (-> s4-0 initial-valuef) (-> arg1 y)) + (set! (-> v1-3 initial-valuef) (-> arg1 z)) + ) + 0 + (none) + ) + +;; definition for function sparticle-next-on-mode-1 +(defun sparticle-next-on-mode-1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (zero? (-> arg1 key state-mode 0)) + (set! (-> arg1 next-time) + (the-as uint (* (max 1 (the-as int (-> *display* clock (-> arg1 clock-index) sparticle-data x))) 2)) + ) + ) + 0.0 + ) + +;; definition for function check-ground-bounce +(defun check-ground-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((f0-1 (+ (-> arg1 key origin trans y) (-> arg1 user-float)))) + (when (and (< (-> arg2 launchrot y) f0-1) (< (-> arg1 vel-sxvel y) 0.0)) + (set! (-> arg2 launchrot y) f0-1) + (set! (-> arg1 vel-sxvel y) (* (-> arg1 vel-sxvel y) (- (rand-vu-float-range 0.6 0.8)))) + ) + ) + ) + +;; definition for function check-drop-group-center +;; WARN: Return type mismatch symbol vs none. +(defun check-drop-group-center ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((f0-0 (-> arg1 key origin trans y))) + (if (< (-> arg2 launchrot y) f0-0) + (sp-kill-particle arg0 arg1) + ) + ) + (none) + ) + +;; definition for function check-bubble-height +;; WARN: Return type mismatch symbol vs none. +(defun check-bubble-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (< (-> arg1 key origin trans y) (-> arg2 launchrot y)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; definition for function check-raise-group-center +;; WARN: Return type mismatch symbol vs none. +(defun check-raise-group-center ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (if (< (-> arg1 key origin trans y) (-> arg2 launchrot y)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; definition for function birth-func-y->userdata +;; WARN: Return type mismatch int vs none. +(defun birth-func-y->userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (+! (-> arg1 user-float) (-> arg2 rvec y)) + 0 + (none) + ) + +;; definition for function birth-func-ocean-height +;; WARN: Return type mismatch int vs none. +(defun birth-func-ocean-height ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (set! (-> arg2 rvec y) (+ (get-height *ocean* (-> arg2 rvec) #t) (-> arg1 user-float))) + 0 + (none) + ) + +;; definition for function birth-func-camera-orient +;; WARN: Return type mismatch int vs none. +(defun birth-func-camera-orient ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-0 float) (v1-1 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-1 + (forward-up-nopitch->quaternion (new 'stack-no-clear 'quaternion) (-> (math-camera-matrix) fvec) *up-vector*) + ) + ) + (quaternion-rotate-x! s5-1 s5-1 16384.0) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-0 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-1 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function birth-func-set-parent-pntr +;; WARN: Return type mismatch int vs none. +(defun birth-func-set-parent-pntr ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (set! (-> arg1 user-float) (the-as float (-> arg4 sprite sprite))) + 0 + (none) + ) + +;; definition for function birth-func-get-parent-quat +;; WARN: Return type mismatch int vs none. +(defun birth-func-get-parent-quat ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((a0-1 (-> arg4 sprite sprite)) + (a1-1 (new 'stack-no-clear 'quaternion)) + ) + (when a0-1 + (let ((v1-2 a1-1) + (f0-0 (-> a0-1 flag-rot-sy x)) + (f1-0 (-> a0-1 flag-rot-sy y)) + (f2-0 (-> a0-1 flag-rot-sy z)) + ) + (set! (-> v1-2 x) f0-0) + (set! (-> v1-2 y) f1-0) + (set! (-> v1-2 z) f2-0) + (set! (-> v1-2 w) (sqrtf (- (- (- 1.0 (* f2-0 f2-0)) (* f1-0 f1-0)) (* f0-0 f0-0)))) + ) + (quaternion->matrix (-> arg4 control origin) a1-1) + ) + ) + 0 + (none) + ) + +;; definition for function spt-func-camera-facing-orbiter +(defun spt-func-camera-facing-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + 0.0 + (quaternion<-rotate-y-vector s5-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> arg1 rotvel3d))) + (let ((f0-2 (- (camera-angle) (quaternion-xz-angle s5-0)))) + (quaternion-rotate-y! (-> arg1 rotvel3d) (-> arg1 rotvel3d) f0-2) + ) + ) + ) + +;; definition for symbol *particle-quat*, type quaternion +(define *particle-quat* (new 'static 'quaternion :w 1.0)) + +;; definition for function birth-func-set-quat +;; WARN: Return type mismatch int vs none. +(defun birth-func-set-quat ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (a0-2 float) (a0-3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((a0-1 arg2) + (v1-0 *particle-quat*) + ) + (cond + ((< (-> v1-0 w) 0.0) + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-2 vf1) + ) + (else + (.lvf vf1 (&-> a0-1 conerot quad)) + (.lvf vf2 (&-> v1-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> a0-1 conerot quad) vf1) + (.mov a0-3 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for symbol *particle-vel*, type vector +(define *particle-vel* (new 'static 'vector :w 1.0)) + +;; definition for function birth-func-set-vel +;; WARN: Return type mismatch int vs none. +(defun birth-func-set-vel ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 *particle-vel*)) + (set! (-> arg1 vel-sxvel x) (-> v1-0 x)) + (set! (-> arg1 vel-sxvel y) (-> v1-0 y)) + (set! (-> arg1 vel-sxvel z) (-> v1-0 z)) + ) + 0 + (none) + ) + +;; definition for function birth-func-texture-group +;; WARN: Return type mismatch int vs none. +(defun birth-func-texture-group ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((s5-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? s5-0) + (let* ((s4-0 (+ (-> s5-0 length) -3)) + (v1-3 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) s4-0) 3)) + (a1-1 (-> s5-0 v1-3)) + ) + (set! (-> arg1 user1-int16) (the-as uint (+ v1-3 -3))) + (if (nonzero? a1-1) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 9 of type sparticle-launcher +;; WARN: new jak 2 until loop case, check carefully +(defmethod get-field-spec-by-id ((this sparticle-launcher) (arg0 sp-field-id)) + "Look up a field's init spec by ID number." + (let ((v1-0 0)) + (until #f + (let ((a2-2 (-> this init-specs v1-0 field))) + (cond + ((= a2-2 arg0) + (return (-> this init-specs v1-0)) + ) + ((or (< (the-as uint arg0) (the-as uint a2-2)) (= a2-2 (sp-field-id spt-end))) + (return (the-as sp-field-init-spec #f)) + ) + (else + (+! v1-0 1) + ) + ) + ) + ) + ) + (the-as sp-field-init-spec #f) + ) + +;; definition for method 10 of type sparticle-launcher +;; WARN: Return type mismatch int vs none. +(defmethod setup-special-textures ((this sparticle-launcher) (arg0 string)) + "Set the particle's texture to the texture with the given name, and convert userdata strings to textures." + (let ((s5-0 (get-field-spec-by-id this (sp-field-id spt-texture))) + (v1-1 (lookup-texture-id-by-name arg0 (the-as string #f))) + ) + (if s5-0 + (set! (-> s5-0 initial-valuef) (the-as float v1-1)) + ) + ) + (let ((v1-3 (get-field-spec-by-id this (sp-field-id spt-userdata)))) + (when (and v1-3 (= (-> v1-3 flags) (sp-flag object))) + (let ((gp-1 (the-as (array int32) (-> v1-3 initial-valuef)))) + (when (and (= (logand (the-as int gp-1) 7) 4) (type? gp-1 array) (logtest? (-> gp-1 1) 128)) + (set! (-> gp-1 0) (/ (-> gp-1 0) 8)) + (set! (-> gp-1 1) (/ (logand (-> gp-1 1) 8) 8)) + (set! (-> gp-1 2) (/ (-> gp-1 2) 8)) + (set! (-> gp-1 content-type) int32) + (dotimes (s5-1 (+ (-> gp-1 length) -3)) + (set! (-> gp-1 (+ s5-1 3)) + (the-as int (lookup-texture-id-by-name (the-as string (-> gp-1 (+ s5-1 3))) (the-as string #f))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function rot-to-particle +;; WARN: Return type mismatch degrees vs none. +(defun rot-to-particle ((arg0 degrees) (arg1 sprite-vec-data-2d) (arg2 matrix)) + (logand! (-> arg1 flag) -49) + (let ((v1-4 (the int (* 0.000061035156 (+ 32768.0 arg0))))) + (if (or (zero? v1-4) (= v1-4 3)) + (logior! (-> arg1 flag) 32) + ) + ) + (set! (-> arg1 flag-rot-sy z) arg0) + (none) + ) + +;; definition for function birth-func-flip-based-on-scale +;; WARN: Return type mismatch int vs none. +(defun birth-func-flip-based-on-scale ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (when (< (-> arg2 x-y-z-sx w) 0.0) + (set! (-> arg2 qx-qy-qz-sy x) (the-as float (logior (the-as int (-> arg2 qx-qy-qz-sy x)) 16))) + (set! (-> arg2 x-y-z-sx w) (* -1.0 (-> arg2 x-y-z-sx w))) + ) + (when (< (-> arg2 qx-qy-qz-sy w) 0.0) + (set! (-> arg2 qx-qy-qz-sy x) (the-as float (logior (the-as int (-> arg2 qx-qy-qz-sy x)) 32))) + (set! (-> arg2 qx-qy-qz-sy w) (* -1.0 (-> arg2 qx-qy-qz-sy w))) + ) + 0 + (none) + ) + +;; definition for function sparticle-2d-spline-align +;; WARN: Return type mismatch int vs none. +(defun sparticle-2d-spline-align ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s3-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s3-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s3-0 w) 1.0) + (let ((f30-0 (-> arg2 flag-rot-sy z))) + (vector-normalize! s3-0 1.0) + (let ((s5-0 deg-seek) + (s4-0 f30-0) + ) + 0.0 + (let ((a0-2 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-7 (vector-dot a0-2 s3-0))) + (vector-float*! v1-1 a0-2 f0-7) + ) + (vector-! s3-0 s3-0 v1-1) + ) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s3-0 s3-0 a2-2) + ) + (let* ((a1-11 (the float (sar (shl (the int (atan (-> s3-0 y) (* -1.0 (-> s3-0 x)))) 48) 48))) + (a2-3 (* 65536.0 (seconds-per-frame))) + (f0-17 (s5-0 s4-0 a1-11 a2-3)) + ) + (rot-to-particle f0-17 arg2 (the-as matrix a2-3)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sparticle-2d-spline-align-instant +;; WARN: Return type mismatch int vs none. +(defun sparticle-2d-spline-align-instant ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s5-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s5-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s5-0 w) 1.0) + (-> arg2 flag-rot-sy z) + (vector-normalize! s5-0 1.0) + 0.0 + (let ((a0-2 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-8 (vector-dot a0-2 s5-0))) + (vector-float*! v1-1 a0-2 f0-8) + ) + (vector-! s5-0 s5-0 v1-1) + ) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-0 s5-0 a2-2) + (let ((f0-16 (the float (sar (shl (the int (atan (-> s5-0 y) (* -1.0 (-> s5-0 x)))) 48) 48)))) + (rot-to-particle f0-16 arg2 a2-2) + ) + ) + ) + 0 + (none) + ) + +;; definition for function birth-func-inherit-size +;; WARN: Return type mismatch int vs none. +(defun birth-func-inherit-size ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((v1-1 (-> arg4 sprite sprite))) + (set! (-> arg2 x-y-z-sx w) (* (-> v1-1 x-y-z-sx w) (-> arg2 x-y-z-sx w))) + (set! (-> arg2 qx-qy-qz-sy w) (* (-> v1-1 flag-rot-sy w) (-> arg2 qx-qy-qz-sy w))) + ) + 0 + (none) + ) + +;; definition for function birth-func-texture-group-2d +;; WARN: Return type mismatch int vs none. +(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (birth-func-texture-group (the-as int arg0) arg1 arg2) + 0 + (none) + ) + +;; definition for function birth-func-set-vel-2d +;; WARN: Return type mismatch int vs none. +(defun birth-func-set-vel-2d ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 *particle-vel*)) + (set! (-> arg1 vel-sxvel x) (-> v1-0 x)) + (set! (-> arg1 vel-sxvel y) (-> v1-0 y)) + (set! (-> arg1 vel-sxvel z) (-> v1-0 z)) + ) + 0 + (none) + ) + +;; definition for function sparticle-3d-rotate-xz-to-camera +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sparticle-3d-rotate-xz-to-camera ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-4 float) (v1-5 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (-> arg1 key proc) + (let ((a0-1 (math-camera-matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> a0-1 rvec quad)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (let ((a1-3 (matrix-fr-compose (new 'stack-no-clear 'matrix) s5-0 *up-vector*)) + (s5-1 (new 'stack-no-clear 'quaternion)) + ) + (matrix->quaternion s5-1 a1-3) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-4 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 9 of type sparticle-subsampler +;; INFO: Used lq/sq +(defmethod init-with-vec! ((this sparticle-subsampler) (arg0 vector)) + (let ((f30-0 (-> this spt-num))) + (when (not (-> this inited?)) + (set! (-> this spawn-mat trans quad) (-> arg0 quad)) + (set! (-> this inited?) #t) + (set! f30-0 0.000000000000000000000000000000000000000000001) + ) + (set! (-> this sp-launcher birthaccum) 0.0) + (let ((f28-0 (/ 1.0 f30-0))) + 0.0 + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 s4-0) + (a3-0 (-> this spawn-mat)) + (v1-8 (-> a3-0 rvec quad)) + (a0-3 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-8) + (set! (-> a2-0 uvec quad) a0-3) + (set! (-> a2-0 fvec quad) a1-1) + (set! (-> a2-0 trans quad) a3-1) + ) + (dotimes (s3-0 (the int f30-0)) + (let ((f0-5 (* f28-0 (the float s3-0)))) + (vector-lerp! (-> s4-0 trans) arg0 (-> this spawn-mat trans) f0-5) + ) + (launch-particles :system (-> this sp-system) (-> this sp-launcher) s4-0 :origin-is-matrix #t) + ) + ) + ) + ) + (let ((v0-2 (-> this spawn-mat trans))) + (set! (-> v0-2 quad) (-> arg0 quad)) + v0-2 + ) + ) + +;; definition for method 10 of type sparticle-subsampler +;; INFO: Used lq/sq +(defmethod init-with-mat! ((this sparticle-subsampler) (arg0 matrix)) + (when (not (-> this inited?)) + (let* ((a2-0 (-> this spawn-mat)) + (a3-0 arg0) + (v1-2 (-> a3-0 rvec quad)) + (a0-1 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-0 rvec quad) v1-2) + (set! (-> a2-0 uvec quad) a0-1) + (set! (-> a2-0 fvec quad) a1-1) + (set! (-> a2-0 trans quad) a3-1) + ) + (set! (-> this inited?) #t) + ) + (set! (-> this sp-launcher birthaccum) 0.0) + (let ((f30-0 (/ 1.0 (-> this spt-num)))) + 0.0 + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-1 s4-0) + (a3-2 arg0) + (v1-6 (-> a3-2 rvec quad)) + (a0-2 (-> a3-2 uvec quad)) + (a1-2 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> a2-1 rvec quad) v1-6) + (set! (-> a2-1 uvec quad) a0-2) + (set! (-> a2-1 fvec quad) a1-2) + (set! (-> a2-1 trans quad) a3-3) + ) + (dotimes (s3-0 (the int (-> this spt-num))) + (let ((f0-5 (* f30-0 (the float s3-0)))) + (vector-lerp! (-> s4-0 trans) (-> arg0 trans) (-> this spawn-mat trans) f0-5) + ) + (launch-particles :system (-> this sp-system) (-> this sp-launcher) s4-0 :origin-is-matrix #t) + ) + ) + ) + (let ((v0-2 (-> this spawn-mat))) + (let ((v1-10 (-> arg0 rvec quad)) + (a0-5 (-> arg0 uvec quad)) + (a1-5 (-> arg0 fvec quad)) + (a2-4 (-> arg0 trans quad)) + ) + (set! (-> v0-2 rvec quad) v1-10) + (set! (-> v0-2 uvec quad) a0-5) + (set! (-> v0-2 fvec quad) a1-5) + (set! (-> v0-2 trans quad) a2-4) + ) + v0-2 + ) + ) + +;; definition for function spt-func-relative-pos +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun spt-func-relative-pos ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars + (sv-256 vector) + (sv-260 vector) + (sv-264 vector) + (sv-268 matrix) + (sv-272 matrix) + (sv-276 matrix) + (sv-280 matrix) + (sv-284 matrix) + ) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) (-> arg2 x-y-z-sx x)) + (set! (-> v1-0 y) (-> arg2 x-y-z-sx y)) + (set! (-> v1-0 z) (-> arg2 x-y-z-sx z)) + (set! (-> v1-0 w) 1.0) + (set! sv-256 v1-0) + ) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (set! (-> v1-1 x) (-> arg1 vel-sxvel x)) + (set! (-> v1-1 y) (-> arg1 vel-sxvel y)) + (set! (-> v1-1 z) (-> arg1 vel-sxvel z)) + (set! (-> v1-1 w) 1.0) + (set! sv-260 v1-1) + ) + (let ((v1-2 (new 'stack-no-clear 'vector))) + (set! (-> v1-2 x) (-> arg1 acc x)) + (set! (-> v1-2 y) (-> arg1 acc y)) + (set! (-> v1-2 z) (-> arg1 acc z)) + (set! (-> v1-2 w) 1.0) + (set! sv-264 v1-2) + ) + (set! sv-268 (-> arg1 key local-space-binding mat-prev)) + (set! sv-272 (-> arg1 key local-space-binding mat-new)) + (set! sv-276 (new 'stack-no-clear 'matrix)) + (set! sv-280 (new 'stack-no-clear 'matrix)) + (set! sv-284 (new 'stack-no-clear 'matrix)) + (let* ((a2-1 sv-280) + (a3-0 sv-268) + (v1-12 (-> a3-0 rvec quad)) + (a0-4 (-> a3-0 uvec quad)) + (a1-1 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> a2-1 rvec quad) v1-12) + (set! (-> a2-1 uvec quad) a0-4) + (set! (-> a2-1 fvec quad) a1-1) + (set! (-> a2-1 trans quad) a3-1) + ) + (let* ((a2-2 sv-284) + (a3-2 sv-272) + (v1-13 (-> a3-2 rvec quad)) + (a0-5 (-> a3-2 uvec quad)) + (a1-2 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> a2-2 rvec quad) v1-13) + (set! (-> a2-2 uvec quad) a0-5) + (set! (-> a2-2 fvec quad) a1-2) + (set! (-> a2-2 trans quad) a3-3) + ) + (dotimes (s4-0 3) + (vector-normalize! (the-as vector (&-> sv-280 quad s4-0)) 1.0) + (vector-normalize! (the-as vector (&-> sv-284 quad s4-0)) 1.0) + ) + (set! (-> sv-256 w) 1.0) + (set! (-> sv-260 w) 0.0) + (set! (-> sv-264 w) 0.0) + (let ((a1-6 (matrix-inverse-of-rot-trans! (new 'stack-no-clear 'matrix) sv-280))) + (matrix*! sv-276 a1-6 sv-284) + ) + (vector-matrix*! sv-256 sv-256 sv-276) + (set! (-> arg2 x-y-z-sx x) (-> sv-256 x)) + (set! (-> arg2 x-y-z-sx y) (-> sv-256 y)) + (set! (-> arg2 x-y-z-sx z) (-> sv-256 z)) + (-> arg2 x-y-z-sx) + (vector-matrix*! sv-260 sv-260 sv-276) + (set! (-> arg1 vel-sxvel x) (-> sv-260 x)) + (set! (-> arg1 vel-sxvel y) (-> sv-260 y)) + (set! (-> arg1 vel-sxvel z) (-> sv-260 z)) + (-> arg1 vel-sxvel) + (vector-matrix*! sv-264 sv-264 sv-276) + (set! (-> arg1 acc x) (-> sv-264 x)) + (set! (-> arg1 acc y) (-> sv-264 y)) + (set! (-> arg1 acc z) (-> sv-264 z)) + (-> arg1 acc) + 0 + (none) + ) + +;; definition for function spt-func-turn-to-vel-radial +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun spt-func-turn-to-vel-radial ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + (local-vars (v1-5 float) (v1-6 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 vel-sxvel quad)) + (let ((s3-0 (-> arg1 key proc))) + (vector-normalize! s5-0 1.0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (v1-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-4 x) (-> arg2 x-y-z-sx x)) + (set! (-> v1-4 y) (-> arg2 x-y-z-sx y)) + (set! (-> v1-4 z) (-> arg2 x-y-z-sx z)) + (set! (-> v1-4 w) 1.0) + (let ((s4-1 (vector-! s4-0 v1-4 (-> s3-0 root trans))) + (s3-1 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-1 y) 0.0) + (vector-rotate-around-y! s4-1 s4-1 16384.0) + (vector-normalize! s4-1 1.0) + (matrix-f-r-compose s3-1 s5-0 s4-1) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (matrix->quaternion s5-1 s3-1) + (cond + ((< (-> s5-1 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-5 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> s5-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc new file mode 100644 index 0000000000..b1ec32fb49 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/particles/sparticle_REF.gc @@ -0,0 +1,739 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 2 of type sparticle-cpuinfo +;; WARN: Return type mismatch object vs sparticle-cpuinfo. +(defmethod print ((this sparticle-cpuinfo)) + (format #t "~%") + (dotimes (s5-0 16) + (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) + ) + (format #t "TIMER:~D~%" (-> this timer)) + (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) + ) + +;; definition for function sp-particle-copy! +;; INFO: Used lq/sq +;; WARN: Return type mismatch (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) vs none. +(defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) + (let ((v1-1 (-> arg1 sprite x-y-z-sx quad))) + (set! (-> arg0 sprite x-y-z-sx quad) v1-1) + ) + (let ((v1-3 (-> arg1 sprite flag-rot-sy quad))) + (set! (-> arg0 sprite flag-rot-sy quad) v1-3) + ) + (let ((v1-5 (-> arg1 sprite r-g-b-a quad))) + (set! (-> arg0 sprite r-g-b-a quad) v1-5) + ) + (dotimes (v1-6 10) + (set! (-> arg0 adgif prims v1-6) (-> arg1 adgif prims v1-6)) + ) + (set! (-> arg0 vel-sxvel quad) (-> arg1 vel-sxvel quad)) + (set! (-> arg0 rot-syvel quad) (-> arg1 rot-syvel quad)) + (set! (-> arg0 fade quad) (-> arg1 fade quad)) + (set! (-> arg0 acc quad) (-> arg1 acc quad)) + (set! (-> arg0 friction) (-> arg1 friction)) + (set! (-> arg0 timer) (-> arg1 timer)) + (set! (-> arg0 flags) (-> arg1 flags)) + (set! (-> arg0 user-float) (-> arg1 user-float)) + (set! (-> arg0 sp-func) (-> arg1 sp-func)) + (none) + ) + +;; definition for method 0 of type sparticle-system +(defmethod new sparticle-system ((allocation symbol) + (type-to-make type) + (arg0 int) + (arg1 int) + (arg2 symbol) + (arg3 pointer) + (arg4 (inline-array adgif-shader)) + ) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let* ((v1-3 (/ (+ arg0 63) 64)) + (a0-2 (/ (+ arg1 63) 64)) + (a1-2 (* v1-3 64)) + (a2-2 (* a0-2 64)) + (s2-1 (+ v1-3 a0-2)) + (s5-1 (+ a1-2 a2-2)) + ) + (set! (-> gp-0 blocks 0) v1-3) + (set! (-> gp-0 length 0) a1-2) + (set! (-> gp-0 num-alloc 0) 0) + (set! (-> gp-0 blocks 1) a0-2) + (set! (-> gp-0 length 1) a2-2) + (set! (-> gp-0 num-alloc 1) 0) + (set! (-> gp-0 is-3d) (the-as basic arg2)) + (set! (-> gp-0 alloc-table) (the-as (pointer uint64) (malloc 'global (* s2-1 8)))) + (set! (-> gp-0 cpuinfo-table) (the-as (inline-array sparticle-cpuinfo) (malloc 'global (* 144 s5-1)))) + (set! (-> gp-0 vecdata-table) arg3) + (set! (-> gp-0 adgifdata-table) arg4) + (dotimes (v1-5 s2-1) + (set! (-> gp-0 alloc-table v1-5) (the-as uint -1)) + ) + (dotimes (s4-1 s5-1) + (set! (-> gp-0 cpuinfo-table s4-1 valid) (the-as uint 0)) + (set! (-> gp-0 cpuinfo-table s4-1 sprite) + (the-as sprite-vec-data-2d (&+ (-> gp-0 vecdata-table) (* 48 s4-1))) + ) + (set! (-> gp-0 cpuinfo-table s4-1 adgif) (-> gp-0 adgifdata-table s4-1)) + (adgif-shader<-texture-simple! (-> gp-0 adgifdata-table s4-1) (the-as texture #f)) + (set! (-> gp-0 adgifdata-table s4-1 alpha) (new 'static 'gs-miptbp :tbp1 #x48)) + ) + ) + gp-0 + ) + ) + +;; failed to figure out what this is: +(kmemopen global "part-systems") + +;; definition for symbol *sp-particle-system-2d*, type sparticle-system +(define *sp-particle-system-2d* + (new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data)) + ) + +;; definition for symbol *sp-particle-system-3d*, type sparticle-system +(define *sp-particle-system-3d* + (new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data)) + ) + +;; failed to figure out what this is: +(kmemclose) + +;; definition for function sp-get-block-size +(defun sp-get-block-size ((arg0 sparticle-system) (arg1 int)) + (let ((v0-0 0)) + (let ((v1-0 0) + (a2-0 (-> arg0 blocks 0)) + ) + (when (= arg1 1) + (set! v1-0 a2-0) + (set! a2-0 (-> arg0 blocks 1)) + ) + (dotimes (a1-3 a2-0) + (if (!= (-> arg0 alloc-table (+ v1-0 a1-3)) -1) + (set! v0-0 (+ a1-3 1)) + ) + ) + ) + v0-0 + ) + ) + +;; definition for function sp-get-approx-alloc-size +(defun sp-get-approx-alloc-size ((arg0 sparticle-system) (arg1 int)) + (let ((a3-0 arg1) + (v1-0 0) + ) + (let ((a1-1 0) + (a2-0 (-> arg0 blocks 0)) + ) + (when (= a3-0 1) + (set! a1-1 a2-0) + (set! a2-0 (-> arg0 blocks 1)) + ) + (dotimes (a3-3 a2-0) + (if (!= (-> arg0 alloc-table (+ a1-1 a3-3)) -1) + (set! v1-0 (+ a3-3 1)) + ) + ) + ) + (* v1-0 64) + ) + ) + +;; definition for function sp-free-particle +;; WARN: Return type mismatch int vs none. +(defun sp-free-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d)) + (if (and (-> arg2 binding) (nonzero? (-> arg2 binding))) + (logclear! (-> arg2 binding flags) (sp-launch-state-flags sp0 sp1)) + ) + (let ((v1-6 (/ arg1 64)) + (t0-4 (logand arg1 63)) + ) + (logior! (-> arg0 alloc-table v1-6) (ash 1 t0-4)) + ) + (if (< arg1 (-> arg0 length 0)) + (+! (-> arg0 num-alloc 0) -1) + (+! (-> arg0 num-alloc 1) -1) + ) + (set! (-> arg2 valid) (the-as uint 0)) + (set! (-> arg3 r-g-b-a w) 0.0) + 0 + (none) + ) + +;; definition for function sp-get-particle +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2] +;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t2, t1] +(defun sp-get-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-launch-state)) + (local-vars + (a2-3 int) + (a2-4 int) + (a2-5 int) + (a2-6 int) + (a2-7 int) + (a2-8 int) + (t1-16 int) + (t1-17 int) + (t1-18 int) + (t1-19 int) + (t1-20 int) + (t3-5 int) + ) + (let ((v1-0 0) + (t0-0 (-> arg0 blocks 0)) + (a3-0 0) + ) + (when (= arg1 1) + (set! v1-0 t0-0) + (set! t0-0 (-> arg0 blocks 1)) + ) + (when arg2 + (set! a3-0 (the-as int (-> arg2 randomize))) + (+! (-> arg2 randomize) 1) + (when (= (-> arg2 randomize) t0-0) + (set! (-> arg2 randomize) (the-as uint 0)) + 0 + ) + ) + (dotimes (a2-1 t0-0) + (when (nonzero? (-> arg0 alloc-table (+ v1-0 a3-0))) + (let ((a2-2 0) + (t1-15 (-> arg0 alloc-table (+ v1-0 a3-0))) + (t0-4 (* (+ v1-0 a3-0) 64)) + ) + 0 + 0 + (let ((t2-4 (shl t1-15 32)) + (t3-0 (+ a2-2 32)) + ) + (move-if-not-zero t1-16 t2-4 t2-4 t1-15) + (.movz a2-3 t3-0 t2-4 a2-2) + ) + (let ((t2-5 (shl t1-16 16)) + (t3-1 (+ a2-3 16)) + ) + (move-if-not-zero t1-17 t2-5 t2-5 t1-16) + (.movz a2-4 t3-1 t2-5 a2-3) + ) + (let ((t2-6 (* t1-17 256)) + (t3-2 (+ a2-4 8)) + ) + (move-if-not-zero t1-18 t2-6 t2-6 t1-17) + (.movz a2-5 t3-2 t2-6 a2-4) + ) + (let ((t2-7 (* t1-18 16)) + (t3-3 (+ a2-5 4)) + ) + (move-if-not-zero t1-19 t2-7 t2-7 t1-18) + (.movz a2-6 t3-3 t2-7 a2-5) + ) + (let ((t2-8 (* t1-19 4)) + (t3-4 (+ a2-6 2)) + ) + (move-if-not-zero t1-20 t2-8 t2-8 t1-19) + (.movz a2-7 t3-4 t2-8 a2-6) + (let ((t1-21 (* t1-20 2)) + (t2-9 (+ a2-7 1)) + ) + (move-if-not-zero t3-5 t1-21 t1-21 t3-4) + (.movz a2-8 t2-9 t1-21 a2-7) + ) + ) + (let ((t0-5 (+ t0-4 a2-8))) + (logxor! (-> arg0 alloc-table (+ v1-0 a3-0)) (the-as uint (ash 1 a2-8))) + (+! (-> arg0 num-alloc arg1) 1) + (let ((v1-9 (-> arg0 cpuinfo-table t0-5))) + (set! (-> v1-9 valid) (the-as uint 1)) + (return v1-9) + ) + ) + ) + ) + (+! a3-0 1) + (if (= a3-0 t0-0) + (set! a3-0 0) + ) + ) + ) + (the-as sparticle-cpuinfo #f) + ) + +;; definition for function sp-kill-particle +(defun sp-kill-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (cond + ((>= (the-as int arg1) #x70000000) + (set! (-> arg1 timer) 0) + 0 + ) + (else + (let ((a2-1 (/ (the-as int (- (the-as uint arg1) (the-as uint (the-as uint (-> arg0 cpuinfo-table 0))))) 144))) + (when (or (< a2-1 0) (>= a2-1 (+ (-> arg0 length 0) (-> arg0 length 1)))) + (format 0 "Tried to release particle ~D~%" a2-1) + (return #f) + ) + (sp-free-particle arg0 a2-1 arg1 (-> arg1 sprite)) + ) + ) + ) + #t + ) + +;; definition for function sp-orbiter +;; WARN: Return type mismatch int vs none. +(defun sp-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((f2-0 (-> arg1 omega)) + (f0-0 (-> arg1 radius)) + (f3-0 (-> arg1 vel-sxvel x)) + (f30-0 (-> arg1 vel-sxvel y)) + (f1-0 (-> arg1 vel-sxvel z)) + (f4-0 (-> *display* clock (-> arg1 clock-index) sparticle-data y)) + (f26-0 (+ f2-0 (* f3-0 f4-0))) + ) + (set! (-> arg1 omega) f26-0) + (let ((f28-0 (+ f0-0 (* f1-0 f4-0)))) + (set! (-> arg1 radius) f28-0) + (let ((f24-0 (sin f26-0)) + (f26-1 (cos f26-0)) + (f22-0 (sin (* 0.5 f30-0))) + (f0-5 (cos (* 0.5 f30-0))) + (a2-1 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'matrix))) + (set-vector! a2-1 (* f22-0 f26-1) 0.0 (* f22-0 f24-0) f0-5) + (quaternion*! (-> arg1 rotvel3d) (-> arg1 rotvel3d) a2-1) + (quaternion-normalize! (-> arg1 rotvel3d)) + (set-vector! s4-0 (* f24-0 f28-0) 0.0 (* f26-1 f28-0) 1.0) + (quaternion->matrix s3-0 (-> arg1 rotvel3d)) + (vector-matrix*! s4-0 s4-0 s3-0) + ) + (let ((v1-8 (the-as sprite-vec-data-2d (-> arg1 user-float)))) + (set! (-> arg2 x) (+ (-> s4-0 x) (-> v1-8 x-y-z-sx x))) + (set! (-> arg2 y) (+ (-> s4-0 y) (-> v1-8 x-y-z-sx y))) + (set! (-> arg2 z) (+ (-> s4-0 z) (-> v1-8 x-y-z-sx z))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sp-process-block-2d +;; INFO: function output is handled by mips2c +(def-mips2c sp-process-block-2d (function sparticle-system int int int int symbol none)) + +;; definition for function sp-process-block-3d +;; INFO: function output is handled by mips2c +(def-mips2c sp-process-block-3d (function sparticle-system int int int int symbol none)) + +;; definition for function sp-copy-to-spr +;; WARN: Return type mismatch int vs none. +(defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int)) + (let ((a2-1 (/ (+ arg2 15) 16))) + (dma-send-to-spr-no-flush (the-as uint arg0) (the-as uint arg1) (the-as uint a2-1) #t) + ) + 0 + (none) + ) + +;; definition for function sp-copy-from-spr +;; WARN: Return type mismatch int vs none. +(defun sp-copy-from-spr ((arg0 int) (arg1 pointer) (arg2 int)) + (let ((a2-1 (/ (+ arg2 15) 16))) + (dma-send-from-spr-no-flush (the-as uint arg1) (the-as uint arg0) (the-as uint a2-1) #t) + ) + 0 + (none) + ) + +;; definition for function memcpy +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function sp-process-block +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sp-process-block ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d) (arg3 int)) + (local-vars (sv-16 int) (sv-32 int) (sv-48 int) (sv-64 int)) + (let ((s3-0 352) + (s2-0 (* 144 arg3)) + (s5-0 (* 48 arg3)) + ) + (set! sv-32 (* 80 arg3)) + (let ((s1-0 (+ s3-0 s2-0))) + (set! sv-16 (+ s1-0 s5-0)) + (sp-copy-to-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0) + (sp-copy-to-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0) + (let ((t9-2 sp-copy-to-spr) + (a1-7 (-> arg0 adgifdata-table arg1)) + ) + (t9-2 sv-16 (the-as pointer a1-7) sv-32) + ) + (set! sv-48 (+ #x70000000 s3-0)) + (set! sv-64 (+ #x70000000 s1-0)) + (let ((t1-0 (paused?))) + (cond + ((-> arg0 is-3d) + (let ((t9-4 sp-process-block-3d) + (a0-6 arg0) + (a3-1 arg1) + ) + (t9-4 a0-6 sv-48 sv-64 a3-1 arg3 t1-0) + ) + ) + (else + (sp-process-block-2d arg0 sv-48 sv-64 arg1 arg3 t1-0) + ) + ) + ) + (sp-copy-from-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0) + (sp-copy-from-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0) + ) + ) + 0 + (none) + ) + +;; definition for function sp-process-particle-system +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d)) + (countdown (v1-0 22) + (let ((a0-4 (-> *display* clock v1-0 sparticle-data quad))) + (set! (-> (the-as vector (+ #x70000000 (* v1-0 16))) quad) a0-4) + ) + ) + (let* ((v1-3 352) + (s1-0 (/ (- #x4000 v1-3) 272)) + (s2-0 0) + (s3-0 (sp-get-approx-alloc-size arg0 arg1)) + ) + (if (= arg1 1) + (set! s2-0 (* (-> arg0 blocks 0) 64)) + ) + (set! (-> arg2 num-valid arg1) s3-0) + (flush-cache 0) + (while (>= s3-0 s1-0) + (sp-process-block arg0 s2-0 arg2 s1-0) + (set! s3-0 (- s3-0 s1-0)) + (+! s2-0 s1-0) + ) + (if (> s3-0 0) + (sp-process-block arg0 s2-0 arg2 s3-0) + ) + ) + 0 + (none) + ) + +;; definition (perm) for symbol *particles-flag*, type symbol +(define-perm *particles-flag* symbol #t) + +;; definition for function forall-particles-with-key-runner +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control) + (arg1 (function sparticle-system sparticle-cpuinfo none)) + (arg2 sparticle-system) + ) + (local-vars (sv-16 int)) + (let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0))) + (s2-0 (&+ (-> arg2 vecdata-table) 0)) + (s1-0 (+ (-> arg2 blocks 0) (-> arg2 blocks 1))) + ) + (dotimes (s0-0 s1-0) + (cond + ((!= (-> arg2 alloc-table s0-0) -1) + (set! sv-16 0) + (while (< sv-16 64) + (if (and (nonzero? (-> (the-as sparticle-cpuinfo s3-0) valid)) (= (-> (the-as sparticle-cpuinfo s3-0) key) arg0)) + (arg1 arg2 (the-as sparticle-cpuinfo s3-0)) + ) + (set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1)) + (&+! s2-0 48) + (set! sv-16 (+ sv-16 1)) + ) + ) + (else + (set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 64)) + (&+! s2-0 3072) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function forall-particles-with-key +;; WARN: Return type mismatch int vs none. +(defun forall-particles-with-key ((arg0 sparticle-launch-control) + (arg1 (function sparticle-system sparticle-cpuinfo none)) + (arg2 symbol) + (arg3 symbol) + ) + (if arg2 + (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*) + ) + (if arg3 + (forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*) + ) + 0 + (none) + ) + +;; definition for function sparticle-kill-it +;; WARN: Return type mismatch int vs none. +(defun sparticle-kill-it ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) + (set! (-> arg1 timer) 0) + (set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0)) + (when (and (-> arg1 binding) (nonzero? (-> arg1 binding))) + (logclear! (-> arg1 binding flags) (sp-launch-state-flags sp0 sp1)) + (set! (-> arg1 binding) #f) + ) + 0 + (none) + ) + +;; definition for symbol *sparticle-kill-it-level*, type int +(define *sparticle-kill-it-level* 0) + +;; definition for function sparticle-kill-it-level +;; WARN: Return type mismatch int vs none. +(defun sparticle-kill-it-level ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (if (= (logand (shr (the-as int (-> arg1 flags)) 9) 15) *sparticle-kill-it-level*) + (sparticle-kill-it arg0 arg1) + ) + 0 + (none) + ) + +;; definition for function sparticle-60-to-50 +;; WARN: Return type mismatch int vs none. +(defun sparticle-60-to-50 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (let ((gp-0 (-> arg1 rotvel3d)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-angle<-quaternion! s5-0 gp-0) + (set! (-> s5-0 w) (* 12516.455 (-> s5-0 w))) + (quaternion-vector-angle! gp-0 s5-0 (-> s5-0 w)) + ) + 0 + (none) + ) + +;; definition for function sparticle-50-to-60 +;; WARN: Return type mismatch int vs none. +(defun sparticle-50-to-60 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (let ((gp-0 (-> arg1 rotvel3d)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-angle<-quaternion! s5-0 gp-0) + (set! (-> s5-0 w) (* 8691.982 (-> s5-0 w))) + (quaternion-vector-angle! gp-0 s5-0 (-> s5-0 w)) + ) + 0 + (none) + ) + +;; definition for function kill-all-particles-with-key +;; WARN: Return type mismatch int vs none. +(defun kill-all-particles-with-key ((arg0 sparticle-launch-control)) + (forall-particles-with-key arg0 sparticle-kill-it #t #t) + 0 + (none) + ) + +;; definition for function forall-particles-runner +;; WARN: Return type mismatch int vs none. +(defun forall-particles-runner ((arg0 (function sparticle-system sparticle-cpuinfo pointer none)) (arg1 sparticle-system)) + (let ((s4-0 (the-as object (-> arg1 cpuinfo-table 0))) + (s3-0 (&+ (-> arg1 vecdata-table) 0)) + (s2-0 (+ (-> arg1 blocks 0) (-> arg1 blocks 1))) + ) + (dotimes (s1-0 s2-0) + (cond + ((!= (-> arg1 alloc-table s1-0) -1) + (dotimes (s0-0 64) + (if (nonzero? (-> (the-as sparticle-cpuinfo s4-0) valid)) + (arg0 arg1 (the-as sparticle-cpuinfo s4-0) s3-0) + ) + (set! s4-0 (+ (the-as uint s4-0) 144)) + (&+! s3-0 48) + ) + ) + (else + (set! s4-0 (&+ (the-as pointer s4-0) 9216)) + (&+! s3-0 3072) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function forall-particles +;; WARN: Return type mismatch int vs none. +(defun forall-particles ((arg0 function) (arg1 symbol) (arg2 symbol)) + (if arg1 + (forall-particles-runner + (the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0) + *sp-particle-system-2d* + ) + ) + (if arg2 + (forall-particles-runner + (the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0) + *sp-particle-system-3d* + ) + ) + 0 + (none) + ) + +;; definition for function kill-all-particles-in-level +(defun kill-all-particles-in-level ((arg0 level)) + (set! *sparticle-kill-it-level* (-> arg0 index)) + (forall-particles sparticle-kill-it-level #t #t) + 0 + ) + +;; definition for function all-particles-50-to-60 +(defun all-particles-50-to-60 () + (forall-particles-runner sparticle-50-to-60 *sp-particle-system-3d*) + (none) + ) + +;; definition for function all-particles-60-to-50 +(defun all-particles-60-to-50 () + (forall-particles-runner sparticle-60-to-50 *sp-particle-system-3d*) + (none) + ) + +;; definition for function remap-particle +;; WARN: Return type mismatch gs-miptbp vs none. +(defun remap-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer)) + (let* ((gp-0 (-> arg1 adgif)) + (a0-1 (-> gp-0 texture-id)) + (v1-0 (lookup-texture-by-id-fast a0-1)) + ) + (when v1-0 + (set! (-> gp-0 tex0 tbp0) (-> v1-0 dest 0)) + (set! (-> gp-0 tex0 cbp) (-> v1-0 clutdest)) + (set! (-> gp-0 miptbp1 tbp1) (-> v1-0 dest 1)) + (set! (-> gp-0 miptbp1 tbp2) (-> v1-0 dest 2)) + (set! (-> gp-0 miptbp1 tbp3) (-> v1-0 dest 3)) + ) + ) + (none) + ) + +;; definition for function remap-all-particles +(defun remap-all-particles () + (forall-particles remap-particle #t #t) + (none) + ) + +;; definition for function process-particles +;; WARN: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 gp, Count] +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defun process-particles () + (local-vars (v1-53 int) (gp-0 int)) + (with-pp + (when *particles-flag* + 0 + 0 + (.mfc0 gp-0 Count) + (set! *sp-launcher-lock* #t) + (when *debug-segment* + (let ((s5-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-12 'particle) + (s4-0 *profile-particle-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s3-0 (-> s5-0 data (-> s5-0 count)))) + (let ((s2-0 (-> s5-0 base-time))) + (set! (-> s3-0 name) v1-12) + (set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0)))) + ) + (set! (-> s3-0 depth) (the-as uint (-> s5-0 depth))) + (set! (-> s3-0 color) s4-0) + (set! (-> s5-0 segment (-> s5-0 depth)) s3-0) + ) + (set! (-> s5-0 count) (min 1023 (+ (-> s5-0 count) 1))) + (+! (-> s5-0 depth) 1) + (set! (-> s5-0 max-depth) (max (-> s5-0 max-depth) (-> s5-0 depth))) + ) + ) + 0 + ) + (logand (the-as int (-> pp clock sparticle-data x)) 255) + (cond + (*sp-60-hz* + (when (= (-> *setting-control* user-current video-mode) 'pal) + (set! *sp-60-hz* #f) + (all-particles-60-to-50) + ) + ) + (else + (when (= (-> *setting-control* user-current video-mode) 'ntsc) + (set! *sp-60-hz* #t) + (all-particles-50-to-60) + ) + ) + ) + (clear-sprite-aux-list) + (sp-process-particle-system *sp-particle-system-2d* 0 *sprite-array-2d*) + (sp-process-particle-system *sp-particle-system-2d* 1 *sprite-array-2d*) + (sp-process-particle-system *sp-particle-system-3d* 0 (the-as sprite-array-2d *sprite-array-3d*)) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-47 (+ (-> s5-1 depth) -1)) + (s4-1 (-> s5-1 segment v1-47)) + (s3-1 (-> s5-1 base-time)) + ) + (when (>= v1-47 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1)))) + (+! (-> s5-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (set! *sp-launcher-lock* #f) + (sp-clear-queue) + (.mfc0 v1-53 Count) + (- v1-53 gp-0) + (when *display-sprite-info* + (if (movie?) + (format *stdcon* "~%~%~%") + ) + (format + *stdcon* + "2d: ~4d~100h3d: ~4d~200hwarp/glow: ~3D~350hhud:~3D~%" + (-> *sp-particle-system-2d* num-alloc 0) + (-> *sp-particle-system-3d* num-alloc 0) + (-> *sprite-aux-list* entry) + (-> *sp-particle-system-2d* num-alloc 1) + ) + ) + ) + 0 + (none) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc index a51bc9daf3..31d3174de6 100644 --- a/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/sprite/sprite_REF.gc @@ -397,7 +397,7 @@ The glow and distort renderers will pull sprites from here." ) ) (set! (-> arg0 screen-shader prims 9) (gs-reg64 alpha-1)) - (set! (-> arg0 screen-shader alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> arg0 screen-shader alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> arg0 sincos-01 z) 0.999998) (set! (-> arg0 sincos-23 z) -0.16666014) (set! (-> arg0 sincos-45 z) 0.008326521) @@ -919,7 +919,3 @@ The glow and distort renderers will pull sprites from here." ;; failed to figure out what this is: (kmemclose) - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc index a8d8de66fd..88f34e929a 100644 --- a/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc @@ -333,7 +333,7 @@ (alpha-near float) (alpha-far float) (alpha-delta float) - (color uint32) + (color rgba) ) ) @@ -622,7 +622,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/gfx/texture/texture-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/texture/texture-h_REF.gc index eb061b4383..84fdb08df8 100644 --- a/test/decompiler/reference/jak3/engine/gfx/texture/texture-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/texture/texture-h_REF.gc @@ -441,22 +441,24 @@ to have a smaller impact on frame times when loading." These are used by many different renderers and partially managed by the texture system. For example, the texture system will automatically update tbp to point to the location of the texture." - ((quad qword 5 :inline) - (prims gs-reg64 10 :overlay-at quad) - (reg-0 uint8 :overlay-at (-> quad 0 data 2)) - (reg-1 uint8 :overlay-at (-> prims 3)) - (reg-2 uint8 :overlay-at (-> prims 5)) - (reg-3 uint8 :overlay-at (-> prims 7)) - (reg-4 uint8 :overlay-at (-> prims 9)) - (tex0 gs-tex0 :overlay-at (-> quad 0 data 0)) - (tex1 gs-tex1 :overlay-at (-> prims 2)) - (miptbp1 gs-miptbp :overlay-at (-> prims 4)) - (clamp gs-clamp :overlay-at (-> prims 6)) - (clamp-reg gs-reg64 :overlay-at reg-3) - (alpha gs-alpha :overlay-at (-> prims 8)) - (link-test link-test-flags :overlay-at (-> quad 0 data 2)) - (texture-id texture-id :overlay-at reg-1) - (next shader-ptr :overlay-at reg-2) + ((quad qword 5 :inline) + (prims gs-reg64 10 :overlay-at quad) + (reg-0 uint8 :overlay-at (-> quad 0 data 2)) + (reg-1 uint8 :overlay-at (-> prims 3)) + (reg-2 uint8 :overlay-at (-> prims 5)) + (reg-3 uint8 :overlay-at (-> prims 7)) + (reg-4 uint8 :overlay-at (-> prims 9)) + (tex0 gs-tex0 :overlay-at (-> quad 0 data 0)) + (tex1 gs-tex1 :overlay-at (-> prims 2)) + (miptbp1 gs-miptbp :overlay-at (-> prims 4)) + (clamp gs-clamp :overlay-at (-> prims 6)) + (clamp-reg gs-reg64 :overlay-at reg-3) + (alpha gs-miptbp :overlay-at (-> prims 8)) + (link-test link-test-flags :overlay-at (-> quad 0 data 2)) + (texture-id texture-id :overlay-at reg-1) + (next shader-ptr :overlay-at reg-2) + (alpha-as-miptb2 gs-miptbp :overlay-at alpha) + (reg-4-u32 gs-reg32 :overlay-at reg-4) ) ) diff --git a/test/decompiler/reference/jak3/engine/gfx/texture/texture_REF.gc b/test/decompiler/reference/jak3/engine/gfx/texture/texture_REF.gc index 82d8d52f9b..a81aed4eec 100644 --- a/test/decompiler/reference/jak3/engine/gfx/texture/texture_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/texture/texture_REF.gc @@ -2322,7 +2322,7 @@ (adgif-shader<-texture! shader tex) ) (set! (-> shader clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) - (set! (-> shader alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> shader alpha) (new 'static 'gs-miptbp :tbp1 #x44)) (set! (-> shader prims 1) (gs-reg64 tex0-1)) (set! (-> shader prims 3) (gs-reg64 tex1-1)) (set! (-> shader prims 5) (gs-reg64 miptbp1-1)) diff --git a/test/decompiler/reference/jak3/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak3/engine/level/bsp-h_REF.gc index 83bbdd4e87..b57f201dbb 100644 --- a/test/decompiler/reference/jak3/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/bsp-h_REF.gc @@ -68,6 +68,7 @@ This probably started as a very simple structure, but now it is extremely compli (nav-meshes (array entity-nav-mesh)) (actor-groups (array actor-group)) (region-trees (array drawable-tree-region-prim) :offset 188) + (region-array region-array) (collide-hash collide-hash :offset 196) (wind-array uint32 :offset 200) (wind-array-length int32 :offset 204) diff --git a/test/decompiler/reference/jak3/engine/level/bsp_REF.gc b/test/decompiler/reference/jak3/engine/level/bsp_REF.gc index 856712631e..4c4fde05f6 100644 --- a/test/decompiler/reference/jak3/engine/level/bsp_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/bsp_REF.gc @@ -597,7 +597,7 @@ ) (when (zero? (&+ (+ (&+ s2-0 s3-0) (the-as int s4-0)) gp-0)) (dotimes (a0-5 (-> v1-0 length)) - (let ((a1-2 (-> v1-0 data a0-5))) + (let ((a1-2 (-> v1-0 trees a0-5))) (cond ((= (-> a1-2 type) drawable-tree-tfrag) (let* ((a2-5 (-> (the-as drawable-tree-tfrag a1-2) arrays (+ (-> (the-as drawable-tree-tfrag a1-2) length) -1))) diff --git a/test/decompiler/reference/jak3/engine/level/level_REF.gc b/test/decompiler/reference/jak3/engine/level/level_REF.gc index 28b0903c26..12e09fdfc3 100644 --- a/test/decompiler/reference/jak3/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak3/engine/level/level_REF.gc @@ -1757,7 +1757,7 @@ (let ((s0-0 (the-as int (-> arg1 pos)))) (when (= (-> arg1 state) -1) (when (< s0-0 (-> s2-0 length)) - (let ((s1-0 (-> s2-0 data (the-as uint s0-0)))) + (let ((s1-0 (-> s2-0 trees (the-as uint s0-0)))) (cond ((= (-> (the-as drawable-tree-tfrag s1-0) type) drawable-tree-tfrag) (dotimes (s0-1 (-> (the-as drawable-tree-tfrag s1-0) length)) @@ -1906,7 +1906,7 @@ ) (set! (-> sv-96 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) (set! (-> sv-96 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) - (set! (-> sv-96 alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + (set! (-> sv-96 alpha) (new 'static 'gs-miptbp :tbp1 #x58)) (set! (-> sv-96 reg-0) (the-as uint 6)) (set! (-> sv-96 reg-1) (the-as uint 20)) (set! (-> sv-96 reg-2) (the-as uint 52)) @@ -3825,7 +3825,3 @@ ) (kmemclose) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/level/region_REF.gc b/test/decompiler/reference/jak3/engine/level/region_REF.gc new file mode 100644 index 0000000000..425cf8bba5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/level/region_REF.gc @@ -0,0 +1,672 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 8 of type drawable-region-prim +;; WARN: Return type mismatch int vs drawable-region-prim. +(defmethod mem-usage ((this drawable-region-prim) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 51 (-> usage length))) + (set! (-> usage data 50 name) "region") + (+! (-> usage data 50 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 50 used) v1-6) + (+! (-> usage data 50 total) (logand -16 (+ v1-6 15))) + ) + (mem-usage (-> this region) usage (logior flags 128)) + (the-as drawable-region-prim 0) + ) + +;; definition for method 8 of type drawable-inline-array-region-prim +;; WARN: Return type mismatch int vs drawable-inline-array-region-prim. +(defmethod mem-usage ((this drawable-inline-array-region-prim) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 1 (-> usage length))) + (set! (-> usage data 0 name) "drawable-group") + (+! (-> usage data 0 count) 1) + (let ((v1-5 32)) + (+! (-> usage data 0 used) v1-5) + (+! (-> usage data 0 total) (logand -16 (+ v1-5 15))) + ) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) usage flags) + ) + (the-as drawable-inline-array-region-prim 0) + ) + +;; definition for method 10 of type drawable-tree-region-prim +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this drawable-tree-region-prim)) + "Draw the drawable, and typically its children. + This usually means adding stuff to a list to be drawn later, rather than expensive drawing here." + 0 + (none) + ) + +;; definition for method 15 of type drawable-tree-region-prim +(defmethod unpack-vis ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) + arg1 + ) + +;; definition for method 16 of type drawable-region-prim +;; WARN: Return type mismatch int vs none. +(defmethod collect-regions ((this drawable-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Fill the region-prim-list with regions that intersect the sphere." + (dotimes (s2-0 arg1) + (when (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) + (set! (-> arg2 items (-> arg2 num-items)) this) + (+! (-> arg2 num-items) 1) + ) + (&+! this 32) + ) + 0 + (none) + ) + +;; definition for method 16 of type drawable-inline-array-region-prim +;; WARN: Return type mismatch int vs none. +(defmethod collect-regions ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Fill the region-prim-list with regions that intersect the sphere." + (collect-regions (the-as drawable-region-prim (-> this data)) arg0 (-> this length) arg2) + 0 + (none) + ) + +;; definition for method 16 of type drawable-tree-region-prim +;; WARN: Return type mismatch int vs none. +(defmethod collect-regions ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Fill the region-prim-list with regions that intersect the sphere." + (collect-regions (-> this data2 0) arg0 (-> this length) arg2) + 0 + (none) + ) + +;; definition for method 17 of type drawable-region-prim +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-region ((this drawable-region-prim) (arg0 int)) + (local-vars (sv-32 vector2h) (sv-36 vector)) + (set! sv-32 (new 'stack 'vector2h)) + (set! sv-36 (-> this bsphere)) + (add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (new 'static 'rgba :r #xff :g #xff :a #x80)) + (when (nonzero? (-> this region)) + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 577) + ) + (format (clear *temp-string*) "region-~D~%" (-> this region id)) + (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + (let ((s5-1 (-> this region on-enter))) + (when s5-1 + (let ((s4-1 add-debug-text-3d) + (s3-1 #t) + (s2-1 577) + ) + (format (clear *temp-string*) "(on-enter ~S)" s5-1) + (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + ) + ) + (let ((s5-2 (-> this region on-inside))) + (when s5-2 + (let ((s4-2 add-debug-text-3d) + (s3-2 #t) + (s2-2 577) + ) + (format (clear *temp-string*) "(on-inside ~S)" s5-2) + (s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + ) + ) + (let ((gp-1 (-> this region on-exit))) + (when gp-1 + (let ((s5-3 add-debug-text-3d) + (s4-3 #t) + (s3-3 577) + ) + (format (clear *temp-string*) "(on-exit ~S)" gp-1) + (s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color white) sv-32) + ) + (+! (-> sv-32 y) 8) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 18 of type drawable-region-prim +(defmethod track-region ((this drawable-region-prim) (arg0 region-prim-area)) + #f + ) + +;; definition for method 19 of type drawable-region-prim +(defmethod within-area? ((this drawable-region-prim) (arg0 region-prim-area)) + "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" + #f + ) + +;; definition for method 9 of type region-prim-area +(defmethod track-entered-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-enter-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-enter-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-enter-list v1-0) a2-0) + ) + (set! (-> this region-enter-prim-list v1-0) arg0) + (set! (-> this region-enter-count) (+ v1-0 1)) + ) + 0 + ) + +;; definition for method 10 of type region-prim-area +(defmethod track-exited-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-exit-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-exit-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-exit-list v1-0) a2-0) + ) + (set! (-> this region-exit-prim-list v1-0) arg0) + (set! (-> this region-exit-count) (+ v1-0 1)) + ) + 0 + ) + +;; definition for method 11 of type region-prim-area +(defmethod track-inside-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-inside-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-inside-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-inside-list v1-0) a2-0) + ) + (set! (-> this region-inside-prim-list v1-0) arg0) + (set! (-> this region-inside-count) (+ v1-0 1)) + ) + 0 + ) + +;; definition for method 12 of type region-prim-area +(defmethod track-start-region! ((this region-prim-area) (arg0 drawable-region-sphere)) + (let ((v1-0 (-> this region-start-count))) + (let ((a2-0 (-> arg0 region))) + (countdown (a3-0 v1-0) + (if (= (-> this region-start-list a3-0) a2-0) + (return (the-as int #f)) + ) + ) + (set! (-> this region-start-list v1-0) a2-0) + ) + (set! (-> this region-start-prim-list v1-0) arg0) + (set! (-> this region-start-count) (+ v1-0 1)) + ) + 0 + ) + +;; definition for method 17 of type drawable-region-sphere +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-region ((this drawable-region-sphere) (arg0 int)) + (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) + (t9-0 this arg0) + ) + (let ((a2-0 (-> this bsphere))) + (add-debug-sphere #t (bucket-id debug) a2-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x80)) + ) + 0 + (none) + ) + +;; definition for method 18 of type drawable-region-sphere +(defmethod track-region ((this drawable-region-sphere) (arg0 region-prim-area)) + (-> this region) + (let ((s4-0 (-> this bsphere))) + (if (< 0.0 (ray-sphere-intersect (-> arg0 pos) (-> arg0 ray) s4-0 (-> s4-0 w))) + (track-entered-region! arg0 this) + ) + (if (< 0.0 (ray-sphere-intersect (-> arg0 exit-pos) (-> arg0 exit-ray) s4-0 (-> s4-0 w))) + (track-exited-region! arg0 this) + ) + (if (spheres-overlap? (the-as sphere (-> arg0 pos)) (the-as sphere s4-0)) + (track-start-region! arg0 this) + ) + (when (spheres-overlap? (the-as sphere (-> arg0 exit-pos)) (the-as sphere s4-0)) + (track-inside-region! arg0 this) + #t + ) + ) + ) + +;; definition for method 19 of type drawable-region-sphere +(defmethod within-area? ((this drawable-region-sphere) (arg0 region-prim-area)) + "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" + (spheres-overlap? (the-as sphere (-> arg0 pos)) (the-as sphere (-> this bsphere))) + ) + +;; definition for method 17 of type drawable-region-face +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-region ((this drawable-region-face) (arg0 int)) + (when (zero? arg0) + (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) + (t9-0 this arg0) + ) + ) + (let ((s5-0 (-> this bsphere))) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + s5-0 + (-> this data normal) + (meters 2) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + (add-debug-sphere #t (bucket-id debug) s5-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x30)) + ) + (add-debug-bound + (bucket-id debug) + (-> this data points) + (the-as int (-> this data num-points)) + (new 'static 'rgba :r #x80 :g #x80 :a #x40) + (new 'static 'rgba :r #x80 :a #x40) + 0 + ) + 0 + (none) + ) + +;; definition for method 18 of type drawable-region-face +(defmethod track-region ((this drawable-region-face) (arg0 region-prim-area)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 (inline-array vector))) + (-> this region) + (let* ((s4-0 (-> this data)) + (v1-1 (-> s4-0 normal)) + (a0-3 (>= 0.0 (- (vector-dot (-> arg0 pos) v1-1) (-> v1-1 w)))) + (s3-0 (>= 0.0 (- (vector-dot (-> arg0 exit-pos) v1-1) (-> v1-1 w)))) + ) + (when (!= a0-3 s3-0) + (when (nonzero? (-> s4-0 num-points)) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (-> s4-0 points)) + (ray-plane-intersect sv-48 sv-52 (-> arg0 pos) (-> arg0 ray) (-> sv-56 0) (-> sv-56 1) (-> sv-56 2)) + (let ((s4-1 (-> s4-0 num-points)) + (s2-0 0) + (s1-0 (vector-negate! (new 'stack-no-clear 'vector) sv-52)) + ) + (while (< (+ s2-0 2) (the-as int s4-1)) + (if (or (point-in-triangle-cross + sv-48 + sv-52 + (-> (the-as (inline-array vector) sv-56) 0) + (-> (the-as (inline-array vector) sv-56) 1) + (-> (the-as (inline-array vector) sv-56) 2) + ) + (point-in-triangle-cross + sv-48 + s1-0 + (-> (the-as (inline-array vector) sv-56) 0) + (-> (the-as (inline-array vector) sv-56) 1) + (-> (the-as (inline-array vector) sv-56) 2) + ) + ) + (goto cfg-17) + ) + (+! s2-0 1) + (set! sv-56 (the-as (inline-array vector) (-> (the-as (inline-array vector) sv-56) 1))) + ) + ) + (set! s3-0 s3-0) + (goto cfg-20) + ) + (label cfg-17) + (if s3-0 + (track-entered-region! arg0 (the-as drawable-region-sphere this)) + (track-exited-region! arg0 (the-as drawable-region-sphere this)) + ) + ) + (label cfg-20) + s3-0 + ) + ) + +;; definition for method 17 of type drawable-region-volume +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw-region ((this drawable-region-volume) (arg0 int)) + (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) + (t9-0 this arg0) + ) + (let* ((s5-0 (-> this faces length)) + (s4-0 0) + (a0-3 (-> this faces data s4-0)) + ) + (while (< s4-0 s5-0) + (debug-draw-region a0-3 1) + (+! s4-0 1) + (set! a0-3 (-> this faces data s4-0)) + ) + ) + 0 + (none) + ) + +;; definition for method 18 of type drawable-region-volume +(defmethod track-region ((this drawable-region-volume) (arg0 region-prim-area)) + (if (within-area? this arg0) + (track-start-region! arg0 (the-as drawable-region-sphere this)) + ) + (let* ((s4-0 (-> this faces length)) + (s3-0 0) + (a0-4 (-> this faces data s3-0)) + ) + (while (< s3-0 s4-0) + (if (not (track-region a0-4 arg0)) + (return #f) + ) + (+! s3-0 1) + (set! a0-4 (-> this faces data s3-0)) + ) + ) + (track-inside-region! arg0 (the-as drawable-region-sphere this)) + #t + ) + +;; definition for method 19 of type drawable-region-volume +(defmethod within-area? ((this drawable-region-volume) (arg0 region-prim-area)) + "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" + (let* ((v1-1 (-> this faces length)) + (a2-0 0) + (a3-2 (-> this faces data a2-0)) + ) + (while (< a2-0 v1-1) + (let ((a3-4 (-> a3-2 data normal))) + (if (< 0.0 (- (vector-dot (-> arg0 pos) a3-4) (-> a3-4 w))) + (return #f) + ) + ) + (+! a2-0 1) + (set! a3-2 (-> this faces data a2-0)) + ) + ) + #t + ) + +;; definition for method 17 of type drawable-tree-region-prim +(defmethod drawable-tree-region-prim-method-17 ((this drawable-tree-region-prim) (arg0 vector)) + (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) + (let* ((s5-0 (-> this data2 (+ (-> this length) -1) length)) + (s4-0 0) + (a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) + ) + (while (< s4-0 s5-0) + (if (within-area? (the-as drawable-region-prim a0-8) (the-as region-prim-area (+ #x70000000 0))) + (return #t) + ) + (+! s4-0 1) + (set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) + ) + ) + #f + ) + +;; definition for method 9 of type region +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs symbol. +(defmethod point-in-region-debug! ((this region) (arg0 vector)) + "Debug check to see if point is in region. This is not efficient, since it has to find the parent geometry of this region." + (local-vars (sv-16 int) (sv-32 int)) + (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) + (dotimes (s5-0 (-> *level* length)) + (let ((s4-0 (-> *level* level s5-0))) + (when (= (-> s4-0 status) 'active) + (when (nonzero? (-> s4-0 bsp region-trees)) + (let* ((s3-0 (-> s4-0 bsp region-trees length)) + (s2-0 0) + (s1-0 (-> s4-0 bsp region-trees s2-0)) + ) + (while (< s2-0 s3-0) + (let ((s0-0 (-> s1-0 data2 (+ (-> s1-0 length) -1) length))) + (set! sv-16 0) + (set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1))))) + (while (< sv-16 s0-0) + (if (and (= (-> (the-as drawable-region-prim sv-32) region) this) + (within-area? + (the-as drawable-region-prim sv-32) + (the-as region-prim-area (-> (the-as region-prim-area #x70000000) region-prim-list)) + ) + ) + (return (the-as symbol sv-32)) + ) + (set! sv-16 (+ sv-16 1)) + (set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1))))) + ) + ) + (+! s2-0 1) + (set! s1-0 (-> s4-0 bsp region-trees s2-0)) + ) + ) + ) + ) + ) + ) + (the-as symbol #f) + ) + +;; definition for method 18 of type drawable-tree-region-prim +;; WARN: Return type mismatch int vs none. +(defmethod debug-print ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) + (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) + (let* ((s4-0 (-> this data2 (+ (-> this length) -1) length)) + (s3-0 0) + (s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) + ) + (while (< s3-0 s4-0) + (if (within-area? (the-as drawable-region-prim s2-0) (the-as region-prim-area (+ #x70000000 0))) + (format + arg1 + " splitbox-~D ~A~%" + (-> (the-as drawable-region-prim s2-0) id) + (the-as drawable-region-prim s2-0) + ) + ) + (+! s3-0 1) + (set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) + ) + ) + 0 + (none) + ) + +;; definition for function region-tree-execute +;; WARN: Return type mismatch int vs none. +(defun region-tree-execute ((arg0 symbol) (arg1 vector) (arg2 vector)) + (local-vars (sv-32 vector)) + (set! sv-32 (vector-average! (new 'stack-no-clear 'vector) arg1 arg2)) + (set! (-> sv-32 w) (* 0.5 (vector-vector-distance arg1 arg2))) + (set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0) + (set! (-> (the-as region-prim-area #x70000000) region-enter-count) 0) + (set! (-> (the-as region-prim-area #x70000000) region-exit-count) 0) + (set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0) + (set! (-> (the-as region-prim-area #x70000000) region-start-count) 0) + (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg1 0.0) + (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) exit-pos)) arg2 0.0) + (vector-! (-> (the-as region-prim-area #x70000000) ray) arg2 arg1) + (vector-! (-> (the-as region-prim-area #x70000000) exit-ray) arg1 arg2) + (dotimes (s5-1 (-> *level* length)) + (let ((v1-17 (-> *level* level s5-1))) + (when (= (-> v1-17 status) 'active) + (let ((s4-1 (-> v1-17 bsp region-trees))) + (when (nonzero? s4-1) + (let* ((s3-0 (-> s4-1 length)) + (s2-0 0) + (a0-14 (-> s4-1 s2-0)) + ) + (while (< s2-0 s3-0) + (if (= (-> a0-14 name) arg0) + (collect-regions a0-14 (the-as sphere sv-32) 0 (the-as region-prim-list (+ #x70000000 0))) + ) + (+! s2-0 1) + (set! a0-14 (-> s4-1 s2-0)) + ) + ) + ) + ) + ) + ) + ) + (countdown (gp-1 (-> (the-as region-prim-area #x70000000) region-prim-list num-items)) + (track-region + (-> (the-as region-prim-area (+ (* gp-1 4) #x70000000)) region-prim-list items 0) + (the-as region-prim-area (-> (the-as region-prim-area #x70000000) region-prim-list)) + ) + ) + (let ((gp-2 (-> (the-as region-prim-area #x70000000) region-enter-count))) + (while (begin (label cfg-22) (nonzero? gp-2)) + (+! gp-2 -1) + (let* ((a2-5 (-> (the-as region-prim-area (+ (* gp-2 4) #x70000000)) region-enter-list 0)) + (s5-2 (-> a2-5 on-enter)) + ) + (when s5-2 + (countdown (v1-47 (-> (the-as region-prim-area #x70000000) region-start-count)) + (if (= a2-5 (-> (the-as region-prim-area #x70000000) region-start-list v1-47)) + (goto cfg-22) + ) + ) + (script-eval + s5-2 + :key a2-5 + :vector (-> (the-as region-prim-area (+ (* gp-2 4) #x70000000)) region-enter-prim-list 0 bsphere) + ) + ) + ) + ) + ) + (let ((gp-3 (-> (the-as region-prim-area #x70000000) region-exit-count))) + (while (begin (label cfg-31) (nonzero? gp-3)) + (+! gp-3 -1) + (let* ((a2-6 (-> (the-as region-prim-area (+ (* gp-3 4) #x70000000)) region-exit-list 0)) + (s5-3 (-> a2-6 on-exit)) + ) + (when s5-3 + (countdown (v1-64 (-> (the-as region-prim-area #x70000000) region-inside-count)) + (if (= a2-6 (-> (the-as region-prim-area (+ (* v1-64 4) #x70000000)) region-inside-list 0)) + (goto cfg-31) + ) + ) + (script-eval + s5-3 + :key a2-6 + :vector (-> (the-as region-prim-area (+ (* gp-3 4) #x70000000)) region-exit-prim-list 0 bsphere) + ) + ) + ) + ) + ) + (countdown (gp-4 (-> (the-as region-prim-area #x70000000) region-inside-count)) + (let* ((a2-7 (-> (the-as region-prim-area (+ (* gp-4 4) #x70000000)) region-inside-list 0)) + (s5-4 (-> a2-7 on-inside)) + ) + (if s5-4 + (script-eval + s5-4 + :key a2-7 + :vector (-> (the-as region-prim-area (+ (* gp-4 4) #x70000000)) region-inside-prim-list 0 bsphere) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function region-execute +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun region-execute () + (set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad)) + (set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad)) + (set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad)) + (set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad)) + (when (and *execute-regions* (-> *setting-control* user-current region-mode) (not (paused?))) + (region-tree-execute 'camera (-> *level* camera-pos 1) (the-as vector (-> *level* camera-pos))) + (region-tree-execute 'target (-> *level* target-pos 1) (the-as vector (-> *level* target-pos))) + ) + 0 + (none) + ) + +;; definition for function region-prim-lookup-by-id +;; WARN: Return type mismatch int vs drawable-region-prim. +(defun region-prim-lookup-by-id ((arg0 int) (arg1 symbol) (arg2 int)) + (let ((v1-0 -1)) + (dotimes (a3-0 (-> *level* length)) + (let ((t0-3 (-> *level* level a3-0))) + (when (= (-> t0-3 status) 'active) + (when (nonzero? (-> t0-3 bsp region-trees)) + (let* ((t1-8 (-> t0-3 bsp region-trees length)) + (t2-1 0) + (t3-2 (-> t0-3 bsp region-trees t2-1)) + ) + (while (< t2-1 t1-8) + (when (or (not arg1) (= (-> t3-2 name) arg1)) + (let* ((t4-10 (-> t3-2 data2 (+ (-> t3-2 length) -1) length)) + (t5-0 0) + (t6-2 (the-as object (+ (+ (* t5-0 32) 32) (the-as int (-> t3-2 data2 (+ (-> t3-2 length) -1)))))) + ) + (while (< t5-0 t4-10) + (when (= (-> (the-as drawable-region-prim t6-2) region id) arg0) + (+! v1-0 1) + (if (= v1-0 arg2) + (return (the-as drawable-region-prim t6-2)) + ) + ) + (+! t5-0 1) + (set! t6-2 (+ (+ (* t5-0 32) 32) (the-as int (-> t3-2 data2 (+ (-> t3-2 length) -1))))) + ) + ) + ) + (+! t2-1 1) + (set! t3-2 (-> t0-3 bsp region-trees t2-1)) + ) + ) + ) + ) + ) + ) + ) + (the-as drawable-region-prim #f) + ) + +;; definition for function region-lookup-by-id +(defun region-lookup-by-id ((arg0 int)) + (dotimes (v1-0 (-> *level* length)) + (let ((a1-3 (-> *level* level v1-0))) + (when (= (-> a1-3 status) 'active) + (when (nonzero? (-> a1-3 bsp region-array)) + (let* ((a2-8 (-> a1-3 bsp region-array length)) + (a3-1 0) + (t0-2 (-> a1-3 bsp region-array data a3-1)) + ) + (while (< a3-1 a2-8) + (if (= (-> t0-2 id) arg0) + (return t0-2) + ) + (+! a3-1 1) + (set! t0-2 (-> a1-3 bsp region-array data a3-1)) + ) + ) + ) + ) + ) + ) + (the-as region #f) + ) diff --git a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc index 9adad7d0ce..f2dfc0622b 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc @@ -21,7 +21,7 @@ ;; definition for function matrix-fr-compose ;; INFO: Used lq/sq -(defun matrix-fr-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) +(defun matrix-fr-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) (set! (-> arg0 fvec quad) (-> arg1 quad)) (set! (-> arg0 rvec quad) (-> arg2 quad)) (vector-cross! (-> arg0 uvec) arg1 arg2) @@ -49,7 +49,7 @@ ;; definition for function matrix-f-r-compose ;; INFO: Used lq/sq -(defun matrix-f-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 vector)) +(defun matrix-f-r-compose ((arg0 matrix) (arg1 vector) (arg2 vector)) (set! (-> arg0 fvec quad) (-> arg1 quad)) (vector-cross! (-> arg0 uvec) arg1 arg2) (vector-normalize! (-> arg0 uvec) 1.0) diff --git a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc index 7cfe8dcd30..d8634fd375 100644 --- a/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/rigid-body_REF.gc @@ -439,7 +439,7 @@ (countdown (s0-0 (-> s4-0 num-prims)) (when (logtest? (-> s3-0 prim-core collide-with) (-> s1-0 prim-core collide-as)) (if (>= (-> s1-0 prim-core prim-type) 0) - ((method-of-object s3-0 collide-shape-prim-method-15)) + (collide-with-collide-cache-prim-mesh s3-0 arg1 s1-0) (collide-with-collide-cache-prim-sphere s3-0 arg1 s1-0) ) ) @@ -569,7 +569,7 @@ (set! (-> s5-0 step-count) 0) (until (not (and (< 0.05 (-> s5-0 time-step-scale)) (< (-> s5-0 step-count) (the-as int (-> this max-iteration-count)))) ) - (set! (-> s5-0 best-dist) -100000000.0) + (set! (-> s5-0 cquery best-dist) -100000000.0) (set! (-> s5-0 cquery best-my-prim) #f) (set! (-> s5-0 cquery best-other-prim) #f) (set! (-> s5-0 orig-position quad) (-> arg0 position quad)) @@ -581,7 +581,7 @@ (rigid-body-control-method-26 arg0) (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (collide-with-all-collide-cache-prims this (-> s5-0 mat) (-> s5-0 cquery)) - (let ((f30-0 (-> s5-0 best-dist))) + (let ((f30-0 (-> s5-0 cquery best-dist))) (b! (>= f30-0 0.0) cfg-3 :delay #f) (rigid-body-control-method-14 arg0 (* (-> s5-0 time-step-scale) (-> s5-0 time-step))) (init-velocities! arg0) @@ -589,8 +589,7 @@ (set! (-> s5-0 time-step-scale) 0.0) (b! #t cfg-55 :delay (nop!)) (label cfg-3) - *touching-list* - ((method-of-type touching-list touching-list-method-11)) + (update-from-step-size *touching-list* f30-0) (rigid-body-control-method-14 arg0 (* (-> s5-0 time-step-scale) (-> s5-0 time-step) f30-0)) ) (init-velocities! arg0) @@ -757,7 +756,7 @@ ) (rigid-body-control-method-12 arg0 1.0) (init-velocities! arg0) - (let ((f30-3 (-> s5-0 best-dist))) + (let ((f30-3 (-> s5-0 cquery best-dist))) (when (< f30-3 0.0001) (vector+float*! (-> arg0 position) (-> arg0 position) (-> s5-0 impact-info normal) 40.96) (rigid-body-control-method-26 arg0) @@ -1081,7 +1080,7 @@ (set! (-> s5-0 total-prims) (the-as uint 1)) (set! (-> s5-0 root-prim) s4-0) ) - ((method-of-object s5-0 collide-shape-method-54)) + (pusher-init s5-0) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (let ((v1-16 (-> s5-0 root-prim))) (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) diff --git a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc index d4a2ba08c2..647afa2f6e 100644 --- a/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak3/engine/process-drawable/process-drawable_REF.gc @@ -407,16 +407,11 @@ ) (dotimes (s3-1 1) (let* ((v1-11 (-> arg0 data s3-1)) - (t9-2 (-> v1-11 param0)) + (t9-2 (the-as function (-> v1-11 param0))) ) - (when t9-2 - (let ((a0-6 v1-11) - (a1-3 (-> v1-11 param1)) - ) - (-> v1-11 param2) - (t9-2 a0-6 (the-as transformq a1-3)) + (if (the-as (function cspace transformq none) t9-2) + ((the-as (function object object object none) t9-2) v1-11 (-> v1-11 param1) (-> v1-11 param2)) ) - ) ) ) (dotimes (s3-2 2) @@ -2377,3 +2372,7 @@ ) (none) ) + + + + diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc new file mode 100644 index 0000000000..604c79b2c9 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/spatial-hash/actor-hash_REF.gc @@ -0,0 +1,1368 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(kmemopen global "actor-hash") + +;; definition for symbol *actor-hash*, type spatial-hash +(define *actor-hash* (new 'global 'spatial-hash 4096 256)) + +;; failed to figure out what this is: +(kmemclose) + +;; definition of type actor-cshape-ptr +(deftype actor-cshape-ptr (structure) + ((cshape collide-shape) + ) + ) + +;; definition for method 3 of type actor-cshape-ptr +(defmethod inspect ((this actor-cshape-ptr)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'actor-cshape-ptr) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) + (label cfg-4) + this + ) + +;; definition of type actor-hash-bucket +(deftype actor-hash-bucket (structure) + ((length int16) + (max-length int16) + (data (inline-array actor-cshape-ptr)) + ) + :allow-misaligned + (:methods + (add-actor-cshape (_type_ collide-shape) none) + ) + ) + +;; definition for method 3 of type actor-hash-bucket +(defmethod inspect ((this actor-hash-bucket)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'actor-hash-bucket) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tmax-length: ~D~%" (-> this max-length)) + (format #t "~1Tdata: #x~X~%" (-> this data)) + (label cfg-4) + this + ) + +;; definition for method 9 of type actor-hash-bucket +;; WARN: Return type mismatch int vs none. +(defmethod add-actor-cshape ((this actor-hash-bucket) (arg0 collide-shape)) + (let ((v1-0 (-> this length))) + (when (< v1-0 (-> this max-length)) + (set! (-> this data v1-0 cshape) arg0) + (set! (-> this length) (+ v1-0 1)) + ) + ) + 0 + (none) + ) + +;; definition of type actor-hash-buckets +(deftype actor-hash-buckets (structure) + ((hash spatial-hash) + (list engine) + (data actor-hash-bucket 4 :inline) + (tpos vector :inline) + ) + (:methods + (hash-actors (_type_) none) + ) + ) + +;; definition for method 3 of type actor-hash-buckets +(defmethod inspect ((this actor-hash-buckets)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'actor-hash-buckets) + (format #t "~1Thash: ~A~%" (-> this hash)) + (format #t "~1Tlist: ~A~%" (-> this list)) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Ttpos: #~%" (-> this tpos)) + (label cfg-4) + this + ) + +;; definition for method 9 of type actor-hash-buckets +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod hash-actors ((this actor-hash-buckets)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (set! (-> this hash) *actor-hash*) + (set! (-> this list) *collide-hit-by-others-list*) + (clear-objects! (-> this hash)) + (cond + ((>= 256 (-> this list length)) + (let ((a0-4 (-> this list alive-list next0))) + (-> this list) + (let ((v1-8 (-> a0-4 next0))) + (while (!= a0-4 (-> this list alive-list-end)) + (let* ((a0-5 (-> (the-as connection a0-4) param1)) + (a1-0 (-> this hash)) + (t0-0 (-> (the-as collide-shape a0-5) root-prim prim-core)) + (a3-0 a0-5) + (a2-1 (-> a1-0 object-count)) + ) + (set! a2-1 (cond + ((< a2-1 (-> a1-0 max-object-count)) + (let ((t1-2 (-> a1-0 sphere-array a2-1)) + (t2-2 (-> a1-0 object-array a2-1)) + ) + (let ((t3-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((t5-0 (-> t3-1 0))) + (let ((t4-0 t0-0)) + (let ((t6-0 (- (-> t0-0 world-sphere w)))) + (.mov vf6 t6-0) + ) + (.lvf vf4 (&-> t4-0 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t5-0 quad) vf5) + ) + (let ((t5-1 (-> t3-1 1))) + (let ((t4-1 t0-0)) + (let ((t6-1 (-> t0-0 world-sphere w))) + (.mov vf6 t6-1) + ) + (.lvf vf4 (&-> t4-1 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t5-1 quad) vf5) + ) + (dotimes (t4-2 3) + (set! (-> a1-0 box-min t4-2) (fmin (-> a1-0 box-min t4-2) (-> (&-> t3-1 0 data t4-2) 0))) + (set! (-> a1-0 box-max t4-2) (fmax (-> a1-0 box-max t4-2) (-> (&-> t3-1 0 data t4-2) 4))) + ) + ) + (set! (-> t1-2 quad) (-> t0-0 world-sphere quad)) + (set! (-> t2-2 object) a3-0) + ) + (+! (-> a1-0 object-count) 1) + a2-1 + ) + (else + -1 + ) + ) + ) + (set! (-> (the-as collide-shape a0-5) actor-hash-index) a2-1) + ) + (set! a0-4 v1-8) + (-> this list) + (set! v1-8 (-> v1-8 next0)) + ) + ) + ) + ) + (else + (set! (-> this tpos quad) (-> (target-pos 0) quad)) + (dotimes (v1-13 4) + (set! (-> this data v1-13 length) 0) + ) + (let ((v1-17 (-> this list alive-list next0))) + (-> this list) + (let ((s5-1 (-> v1-17 next0))) + (while (!= v1-17 (-> this list alive-list-end)) + (let* ((s4-0 (-> (the-as connection v1-17) param1)) + (f0-7 (vector-vector-distance-squared (-> this tpos) (-> (the-as collide-shape s4-0) trans))) + (f1-2 102400.0) + ) + (cond + ((< f0-7 (* f1-2 f1-2)) + ((method-of-type actor-hash-bucket add-actor-cshape) + (the-as actor-hash-bucket (-> this data)) + (the-as collide-shape s4-0) + ) + ) + ((let ((f1-5 204800.0)) + (< f0-7 (* f1-5 f1-5)) + ) + (add-actor-cshape (-> this data 1) (the-as collide-shape s4-0)) + ) + ((let ((f1-8 307200.0)) + (< f0-7 (* f1-8 f1-8)) + ) + (add-actor-cshape (-> this data 2) (the-as collide-shape s4-0)) + ) + (else + (add-actor-cshape (-> this data 3) (the-as collide-shape s4-0)) + ) + ) + ) + (set! v1-17 s5-1) + (-> this list) + (set! s5-1 (-> s5-1 next0)) + ) + ) + ) + (dotimes (v1-34 4) + (let ((a0-22 (-> this data v1-34))) + (countdown (a1-10 (-> a0-22 length)) + (let* ((a2-4 (-> a0-22 data a1-10 cshape)) + (a3-4 (-> this hash)) + (t2-3 (-> a2-4 root-prim prim-core)) + (t1-3 a2-4) + (t0-3 (-> a3-4 object-count)) + ) + (set! t0-3 + (cond + ((< t0-3 (-> a3-4 max-object-count)) + (let ((t3-6 (-> a3-4 sphere-array t0-3)) + (t4-5 (-> a3-4 object-array t0-3)) + ) + (let ((t5-15 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((t7-0 (-> t5-15 0))) + (let ((t6-2 t2-3)) + (let ((t8-0 (- (-> t2-3 world-sphere w)))) + (.mov vf6 t8-0) + ) + (.lvf vf4 (&-> t6-2 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t7-0 quad) vf5) + ) + (let ((t7-1 (-> t5-15 1))) + (let ((t6-3 t2-3)) + (let ((t8-1 (-> t2-3 world-sphere w))) + (.mov vf6 t8-1) + ) + (.lvf vf4 (&-> t6-3 world-sphere quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t7-1 quad) vf5) + ) + (dotimes (t6-4 3) + (set! (-> a3-4 box-min t6-4) (fmin (-> a3-4 box-min t6-4) (-> (&-> t5-15 0 data t6-4) 0))) + (set! (-> a3-4 box-max t6-4) (fmax (-> a3-4 box-max t6-4) (-> (&-> t5-15 0 data t6-4) 4))) + ) + ) + (set! (-> t3-6 quad) (-> t2-3 world-sphere quad)) + (set! (-> t4-5 object) t1-3) + ) + (+! (-> a3-4 object-count) 1) + t0-3 + ) + (else + -1 + ) + ) + ) + (set! (-> a2-4 actor-hash-index) t0-3) + ) + ) + ) + ) + ) + ) + (update-from-spheres (-> this hash)) + 0 + (none) + ) + ) + +;; definition for symbol *actor-hash-buckets*, type actor-hash-buckets +(define *actor-hash-buckets* + (new 'static 'actor-hash-buckets + :data (new 'static 'inline-array actor-hash-bucket 4 + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + (new 'static 'actor-hash-bucket :max-length #x100 :data (new 'static 'inline-array actor-cshape-ptr 256 + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + (new 'static 'actor-cshape-ptr) + ) + ) + ) + ) + ) + +;; definition for function update-actor-hash +;; WARN: Return type mismatch int vs none. +(defun update-actor-hash () + (local-vars (a0-3 int) (a0-5 int)) + (let* ((v1-1 (-> *perf-stats* data 6)) + (a0-0 (-> v1-1 ctrl)) + ) + (+! (-> v1-1 count) 1) + (b! (zero? a0-0) cfg-2 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (hash-actors *actor-hash-buckets*) + (let ((v1-6 (-> *perf-stats* data 6))) + (b! (zero? (-> v1-6 ctrl)) cfg-4 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-3 pcr0) + (+! (-> v1-6 accum0) a0-3) + (.mfpc a0-5 pcr1) + (+! (-> v1-6 accum1) a0-5) + ) + (label cfg-4) + 0 + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/collide/collide-hash-h_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/collide-hash-h_REF.gc similarity index 99% rename from test/decompiler/reference/jak3/engine/collide/collide-hash-h_REF.gc rename to test/decompiler/reference/jak3/engine/spatial-hash/collide-hash-h_REF.gc index b8dbb3224d..b37739c549 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-hash-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/collide-hash-h_REF.gc @@ -71,6 +71,7 @@ and a pointer to the actual collide-hash-fragment, or possibly a TIE." ((id uint32) (collidable basic) ) + :pack-me ) ;; definition for method 3 of type collide-hash-item @@ -252,7 +253,7 @@ needs more than 1 collide-hash-fragment worth of triangles." (format #t "~1Taxis-scale: #~%" (-> this bbox max)) (format #t "~1Tavg-extents: #~%" (-> this bbox4w)) (format #t "~1Tbucket-array: #x~X~%" (-> this bbox min w)) - (format #t "~1Titem-array: #x~X~%" (-> this bbox max w)) + (format #t "~1Titem-array: #x~X~%" (-> this item-array)) (format #t "~1Tdimension-array[3] @ #x~X~%" (&-> this bbox4w min w)) (format #t "~1Tnum-items: ~D~%" (-> this num-items)) (label cfg-4) @@ -261,7 +262,3 @@ needs more than 1 collide-hash-fragment worth of triangles." ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/collide-hash_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/collide-hash_REF.gc new file mode 100644 index 0000000000..addf297d8e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/spatial-hash/collide-hash_REF.gc @@ -0,0 +1,704 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function add-collide-debug-box +;; WARN: Return type mismatch symbol vs none. +(defun add-collide-debug-box ((arg0 vector) (arg1 rgba)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((a3-0 (new 'stack-no-clear 'bounding-box))) + (nop!) + (.lvf vf1 (&-> arg0 quad)) + (.sub.w.vf vf2 vf1 vf1) + (nop!) + (.add.w.vf vf3 vf1 vf1) + (nop!) + (nop!) + (.svf (&-> a3-0 min quad) vf2) + (nop!) + (.svf (&-> a3-0 max quad) vf3) + (add-debug-box #t (bucket-id debug) (-> a3-0 min) (-> a3-0 max) arg1) + ) + (none) + ) + ) + +;; definition (debug) for function print-collide-cache-tri-count +;; WARN: Return type mismatch object vs none. +(defun-debug print-collide-cache-tri-count () + (let ((gp-0 0) + (s4-0 0) + (s5-0 0) + (s3-0 0) + ) + (let ((v1-0 *collide-cache*)) + (dotimes (a0-0 (-> v1-0 num-tris)) + (case (-> v1-0 tris a0-0 pat mode) + (((pat-mode ground)) + (+! gp-0 1) + ) + (((pat-mode wall)) + (+! s5-0 1) + ) + (((pat-mode obstacle)) + (+! s4-0 1) + ) + (else + (+! s3-0 1) + ) + ) + ) + (format *stdcon* "tris ~d (~4,,1f%) " (-> v1-0 num-tris) (* 0.2173913 (the float (-> v1-0 num-tris)))) + ) + (format *stdcon* "(ground ~d, wall ~d, obstacle ~d, other ~d)~%" gp-0 s5-0 s4-0 s3-0) + ) + (none) + ) + +;; definition (debug) for function print-exceeded-max-cache-tris +;; WARN: Return type mismatch int vs none. +(defun-debug print-exceeded-max-cache-tris () + (with-pp + (when (not (or *already-printed-exeeded-max-cache-tris* *display-capture-mode*)) + (set! *already-printed-exeeded-max-cache-tris* #t) + (if pp + (format *stdcon* "Exceeded collide cache max # of tris (~s)!~%" (-> pp name)) + (format *stdcon* "Exceeded collide cache max # of tris!~%") + ) + (print-collide-cache-tri-count) + ) + 0 + (none) + ) + ) + +;; definition for method 11 of type collide-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 11 collide-hash)" 11 collide-hash) + +;; definition for method 12 of type collide-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 12 collide-hash)" 12 collide-hash) + +;; definition for function fill-bg-using-box-new +;; INFO: function output is handled by mips2c +(def-mips2c fill-bg-using-box-new (function collide-cache object collide-query none)) + +;; definition for function fill-bg-using-line-sphere-new +;; INFO: function output is handled by mips2c +(def-mips2c fill-bg-using-line-sphere-new (function collide-cache object collide-query none)) + +;; definition for function collide-list-fill-bg-using-box +;; INFO: Used lq/sq +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Return type mismatch int vs none. +(defun collide-list-fill-bg-using-box ((arg0 collide-cache) (arg1 collide-list) (arg2 collide-query)) + (local-vars + (v1-12 uint128) + (v1-14 uint128) + (v1-15 uint128) + (a0-10 uint128) + (a0-11 uint128) + (a1-3 uint128) + (a2-3 uint128) + (a2-4 uint128) + (sv-16 int) + (sv-20 collide-list) + (sv-640 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (set! sv-16 (-> arg1 num-items)) + (set! sv-20 arg1) + (dotimes (s4-0 sv-16) + (let ((s3-0 (-> sv-20 items s4-0 mesh))) + (cond + ((= (-> s3-0 type) instance-tie) + (let* ((v1-4 s3-0) + (s1-0 (-> v1-4 bucket-ptr)) + ) + (when (not (or (logtest? (-> s1-0 flags) (prototype-flags no-collide)) + (logtest? (-> v1-4 flags) (instance-flags no-collide)) + ) + ) + (if *collide-list-boxes* + (add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :a #x80)) + ) + (let ((s0-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'collide-query)) + ) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg2) 540) + (nop!) + (nop!) + (let ((v1-11 (the-as uint128 (-> s3-0 origin long 3)))) + (nop!) + (let ((a2-2 (the-as uint128 (-> s3-0 origin long 0)))) + (.pextlh v1-12 v1-11 0) + (let ((a0-9 (the-as uint128 (-> s3-0 origin long 1)))) + (.pw.sra a1-3 v1-12 10) + (let ((v1-13 (the-as uint128 (-> s3-0 origin long 2)))) + (.pextlh a2-3 a2-2 0) + (nop!) + (.pw.sra a2-4 a2-3 16) + (nop!) + (.pextlh a0-10 a0-9 0) + (.mov vf4 a1-3) + (.pw.sra a0-11 a0-10 16) + (.mov vf1 a2-4) + (.pextlh v1-14 v1-13 0) + ) + ) + ) + ) + (.mov vf2 a0-11) + (.pw.sra v1-15 v1-14 16) + (.lvf vf5 (&-> s3-0 bsphere quad)) + (nop!) + (.mov vf3 v1-15) + (.itof.vf vf4 vf4) + (nop!) + (vitof12.xyzw vf1 vf1) + (nop!) + (vitof12.xyzw vf2 vf2) + (nop!) + (vitof12.xyzw vf3 vf3) + (nop!) + (.add.vf vf4 vf4 vf5 :mask #b111) + (nop!) + (nop!) + (.svf (&-> s2-0 instance-mat rvec quad) vf1) + (nop!) + (.svf (&-> s2-0 instance-mat uvec quad) vf2) + (nop!) + (.svf (&-> s2-0 instance-mat fvec quad) vf3) + (nop!) + (.svf (&-> s2-0 instance-mat trans quad) vf4) + (matrix-4x4-inverse! s0-0 (-> s2-0 instance-mat)) + (nop!) + (nop!) + (.lvf vf7 (&-> arg2 bbox min quad)) + (nop!) + (.lvf vf14 (&-> arg2 bbox max quad)) + (nop!) + (.lvf vf1 (&-> s0-0 rvec quad)) + (nop!) + (.lvf vf2 (&-> s0-0 uvec quad)) + (nop!) + (.lvf vf3 (&-> s0-0 fvec quad)) + (nop!) + (.lvf vf4 (&-> s0-0 trans quad)) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf8 vf3 vf14 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf9 vf3 vf7 acc) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf10 vf3 vf14 acc) + (nop!) + (.min.vf vf5 vf8 vf9) + (nop!) + (.max.vf vf6 vf8 vf9) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf11 vf3 vf7 acc) + (nop!) + (.min.vf vf5 vf5 vf10) + (nop!) + (.max.vf vf6 vf6 vf10) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf12 vf3 vf14 acc) + (nop!) + (.min.vf vf5 vf5 vf11) + (nop!) + (.max.vf vf6 vf6 vf11) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf13 vf3 vf7 acc) + (nop!) + (.min.vf vf5 vf5 vf12) + (nop!) + (.max.vf vf6 vf6 vf12) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf14 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf14 acc) + (nop!) + (.add.mul.z.vf vf14 vf3 vf14 acc) + (nop!) + (.min.vf vf5 vf5 vf13) + (nop!) + (.max.vf vf6 vf6 vf13) + (nop!) + (.mul.w.vf acc vf4 vf0) + (nop!) + (.add.mul.x.vf acc vf1 vf7 acc) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf vf7 vf3 vf7 acc) + (nop!) + (.min.vf vf5 vf5 vf14) + (nop!) + (.max.vf vf6 vf6 vf14) + (nop!) + (.min.vf vf5 vf5 vf7) + (nop!) + (.max.vf vf6 vf6 vf7) + (nop!) + (.ftoi.vf vf16 vf5) + (nop!) + (.ftoi.vf vf17 vf6) + (nop!) + (nop!) + (.svf (&-> s2-0 bbox min quad) vf5) + (nop!) + (.svf (&-> s2-0 bbox max quad) vf6) + (nop!) + (.svf (&-> s2-0 bbox4w min quad) vf16) + (nop!) + (.svf (&-> s2-0 bbox4w max quad) vf17) + (let ((s1-1 (-> s1-0 collide-hash-fragment-array))) + (set! sv-640 (-> s1-1 length)) + (set! (-> s2-0 instance-ptr) s3-0) + (dotimes (s3-1 sv-640) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0)) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0)) + (set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0)) + (fill-bg-using-box-new arg0 (-> s1-1 fragments s3-1) s2-0) + (+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris)) + ) + ) + ) + ) + ) + ) + (else + (if *collide-list-boxes* + (add-collide-debug-box (-> s3-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0)) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0)) + (set! (-> arg2 instance-ptr) #f) + (set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0)) + (fill-bg-using-box-new arg0 s3-0 arg2) + (+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function collide-list-fill-bg-using-line-sphere +;; INFO: Used lq/sq +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [sll v1, v1, 16] +(defun collide-list-fill-bg-using-line-sphere ((arg0 collide-cache) (arg1 collide-list) (arg2 collide-query)) + (local-vars + (v1-12 uint128) + (v1-14 uint128) + (v1-15 uint128) + (v1-17 number) + (v1-26 float) + (a0-10 uint128) + (a0-11 uint128) + (a1-3 uint128) + (a2-3 uint128) + (a2-4 uint128) + (sv-16 int) + (sv-640 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (set! sv-16 (-> arg1 num-items)) + (dotimes (s3-0 sv-16) + (let ((s2-0 (-> arg1 items s3-0 mesh))) + (cond + ((= (-> s2-0 type) instance-tie) + (let ((v1-4 s2-0)) + (when (not (or (logtest? (-> v1-4 bucket-ptr flags) (prototype-flags no-collide)) + (logtest? (-> v1-4 flags) (instance-flags no-collide)) + ) + ) + (if *collide-list-boxes* + (add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :a #x80)) + ) + (let ((s0-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'collide-query)) + ) + (mem-copy! (the-as pointer s1-0) (the-as pointer arg2) 540) + (nop!) + (let ((v1-11 (the-as uint128 (-> s2-0 origin long 3)))) + (nop!) + (let ((a2-2 (the-as uint128 (-> s2-0 origin long 0)))) + (.pextlh v1-12 v1-11 0) + (let ((a0-9 (the-as uint128 (-> s2-0 origin long 1)))) + (.pw.sra a1-3 v1-12 10) + (let ((v1-13 (the-as uint128 (-> s2-0 origin long 2)))) + (.pextlh a2-3 a2-2 0) + (nop!) + (.pw.sra a2-4 a2-3 16) + (nop!) + (.pextlh a0-10 a0-9 0) + (.mov vf4 a1-3) + (.pw.sra a0-11 a0-10 16) + (.mov vf1 a2-4) + (.pextlh v1-14 v1-13 0) + ) + ) + ) + ) + (.mov vf2 a0-11) + (.pw.sra v1-15 v1-14 16) + (.lvf vf5 (&-> s2-0 bsphere quad)) + (nop!) + (.mov vf3 v1-15) + (.itof.vf vf4 vf4) + (nop!) + (vitof12.xyzw vf1 vf1) + (nop!) + (vitof12.xyzw vf2 vf2) + (nop!) + (vitof12.xyzw vf3 vf3) + (nop!) + (.add.vf vf4 vf4 vf5 :mask #b111) + (nop!) + (nop!) + (.svf (&-> s1-0 instance-mat rvec quad) vf1) + (nop!) + (.svf (&-> s1-0 instance-mat uvec quad) vf2) + (nop!) + (.svf (&-> s1-0 instance-mat fvec quad) vf3) + (nop!) + (.svf (&-> s1-0 instance-mat trans quad) vf4) + (matrix-4x4-inverse! s0-0 (-> s1-0 instance-mat)) + (nop!) + (nop!) + (.lvf vf7 (&-> arg2 start-pos quad)) + (nop!) + (.lvf vf8 (&-> arg2 move-dist quad)) + (nop!) + (.lvf vf1 (&-> s0-0 rvec quad)) + (nop!) + (.lvf vf2 (&-> s0-0 uvec quad)) + (nop!) + (.lvf vf3 (&-> s0-0 fvec quad)) + (nop!) + (.lvf vf4 (&-> s0-0 trans quad)) + (.add.vf vf8 vf7 vf8) + (let ((v1-16 (-> s2-0 rmin-scale))) + (.mul.x.vf acc vf1 vf7) + (let ((f2-0 (-> arg2 radius))) + (.add.mul.y.vf acc vf2 vf7 acc) + (.sll v1-17 v1-16 16) + (.add.mul.z.vf acc vf3 vf7 acc) + (let ((f1-0 (the-as float v1-17))) + (.add.mul.w.vf vf7 vf4 vf0 acc) + (nop!) + (.mul.x.vf acc vf1 vf8) + (let ((f2-1 (* f2-0 f1-0))) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf8 vf4 vf0 acc) + (nop!) + (nop!) + (.svf (&-> s1-0 start-pos quad) vf7) + (.min.vf vf5 vf7 vf8) + (set! (-> s1-0 radius) f2-1) + ) + ) + ) + ) + (.max.vf vf6 vf7 vf8) + (nop!) + (nop!) + (.lvf vf9 (&-> s1-0 exit-planes 0 quad)) + (.sub.vf vf8 vf8 vf7) + (nop!) + (.sub.w.vf vf5 vf5 vf9) + (nop!) + (.add.w.vf vf6 vf6 vf9) + (nop!) + (nop!) + (.svf (&-> s1-0 move-dist quad) vf8) + (.ftoi.vf vf10 vf5) + (nop!) + (.ftoi.vf vf11 vf6) + (nop!) + (nop!) + (.svf (&-> s1-0 bbox min quad) vf5) + (nop!) + (.svf (&-> s1-0 bbox max quad) vf6) + (nop!) + (.svf (&-> s1-0 bbox4w min quad) vf10) + (nop!) + (.svf (&-> s1-0 bbox4w max quad) vf11) + (set! (-> s1-0 rlength x) (if (= (-> s1-0 move-dist x) 0.0) + 0.0 + (/ 1.0 (-> s1-0 move-dist x)) + ) + ) + (set! (-> s1-0 rlength y) (if (= (-> s1-0 move-dist y) 0.0) + 0.0 + (/ 1.0 (-> s1-0 move-dist y)) + ) + ) + (set! (-> s1-0 rlength z) (if (= (-> s1-0 move-dist z) 0.0) + 0.0 + (/ 1.0 (-> s1-0 move-dist z)) + ) + ) + (let ((f0-12 1.0)) + (.lvf vf1 (&-> (-> s1-0 move-dist) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-26 vf1) + (set! (-> s1-0 rlength w) (/ f0-12 v1-26)) + ) + (set! (-> s1-0 exit-planes 0 x) (if (< 0.0 (-> s1-0 move-dist x)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 0 y) (if (< 0.0 (-> s1-0 move-dist y)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 0 z) (if (< 0.0 (-> s1-0 move-dist z)) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 1 x) (if (< (-> s1-0 move-dist x) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 1 y) (if (< (-> s1-0 move-dist y) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (set! (-> s1-0 exit-planes 1 z) (if (< (-> s1-0 move-dist z) 0.0) + 0.0 + 100000000000000000000000000000000000000.0 + ) + ) + (let ((s0-1 (-> s2-0 bucket-ptr collide-hash-fragment-array))) + (set! sv-640 (-> s0-1 length)) + (set! (-> s1-0 instance-ptr) s2-0) + (dotimes (s2-1 sv-640) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0)) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0)) + (set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0)) + (fill-bg-using-line-sphere-new arg0 (-> s0-1 fragments s2-1) s1-0) + (+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris)) + ) + ) + ) + ) + ) + ) + (else + (if *collide-list-boxes* + (add-collide-debug-box (-> s2-0 bsphere) (new 'static 'rgba :r #xff :g #xff :a #x80)) + ) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 0) (the-as uint128 0)) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits 1) (the-as uint128 0)) + (set! (-> arg2 instance-ptr) #f) + (set! (-> (the-as collide-hash-scratch #x70000000) tris) (the-as uint 0)) + (fill-bg-using-line-sphere-new arg0 s2-0 arg2) + (+! (-> *collide-stats* tris) (-> (the-as collide-hash-scratch #x70000000) tris)) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 8 of type collide-hash +;; INFO: Used lq/sq +(defmethod mem-usage ((this collide-hash) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 52 (-> usage length))) + (set! (-> usage data 51 name) "collision") + (+! (-> usage data 51 count) 1) + (let ((v1-8 (+ (* (-> this num-items) 8) 96 (* (-> this num-buckets) 4)))) + (+! (-> usage data 51 used) v1-8) + (+! (-> usage data 51 total) (logand -16 (+ v1-8 15))) + ) + (dotimes (v1-12 (the-as int (-> this qwc-id-bits))) + (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits v1-12) (the-as uint128 0)) + ) + (dotimes (s3-0 (the-as int (-> this num-items))) + (let* ((a0-11 (-> this item-array s3-0 id)) + (v1-17 (shr a0-11 5)) + ) + (when (not (logtest? (-> (the-as collide-hash-scratch #x70000000) id-bits v1-17) (ash 1 (the-as int (logand a0-11 31)))) + ) + (logior! (-> (the-as collide-hash-scratch #x70000000) id-bits v1-17) (ash 1 (the-as int (logand a0-11 31)))) + (if (= (-> this item-array s3-0 collidable type) collide-hash-fragment) + (mem-usage (-> this item-array s3-0 collidable) usage flags) + ) + ) + ) + ) + this + ) + +;; definition for method 8 of type collide-hash-fragment +(defmethod mem-usage ((this collide-hash-fragment) (usage memory-usage-block) (flags int)) + (cond + ((logtest? flags 1) + (set! (-> usage length) (max 59 (-> usage length))) + (set! (-> usage data 56 name) "prototype-fragment") + (+! (-> usage data 56 count) 1) + (set! (-> usage data 57 name) "prototype-poly") + (+! (-> usage data 57 count) (-> this stats num-polys)) + (set! (-> usage data 58 name) "prototype-vertex") + (+! (-> usage data 58 count) (-> this stats num-verts)) + (let ((a3-0 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-6 (* (-> this stats num-polys) 4)) + (v1-16 (* (the-as uint 6) (-> this stats num-verts))) + ) + (+! (-> usage data 56 used) a3-0) + (+! (-> usage data 56 total) (- (logand -16 (+ v1-16 15 a2-6 a3-0)) (the-as int (+ a2-6 v1-16)))) + (+! (-> usage data 57 used) a2-6) + (+! (-> usage data 57 total) a2-6) + (+! (-> usage data 58 used) v1-16) + (+! (-> usage data 58 total) v1-16) + ) + ) + (else + (set! (-> usage length) (max 55 (-> usage length))) + (set! (-> usage data 52 name) "collision-fragment") + (+! (-> usage data 52 count) 1) + (set! (-> usage data 53 name) "collision-poly") + (+! (-> usage data 53 count) (-> this stats num-polys)) + (set! (-> usage data 54 name) "collision-vertex") + (+! (-> usage data 54 count) (-> this stats num-verts)) + (let ((a3-8 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-16 (* (-> this stats num-polys) 4)) + (v1-33 (* (the-as uint 6) (-> this stats num-verts))) + ) + (+! (-> usage data 52 used) a3-8) + (+! (-> usage data 52 total) (- (logand -16 (+ v1-33 15 a2-16 a3-8)) (the-as int (+ a2-16 v1-33)))) + (+! (-> usage data 53 used) a2-16) + (+! (-> usage data 53 total) a2-16) + (+! (-> usage data 54 used) v1-33) + (+! (-> usage data 54 total) v1-33) + ) + ) + ) + this + ) + +;; definition for method 8 of type collide-hash-fragment-array +(defmethod mem-usage ((this collide-hash-fragment-array) (usage memory-usage-block) (flags int)) + (set! (-> usage length) (max 56 (-> usage length))) + (set! (-> usage data 55 name) "prototype-collision") + (+! (-> usage data 55 count) 1) + (let ((v1-6 (asize-of this))) + (+! (-> usage data 55 used) v1-6) + (+! (-> usage data 55 total) (logand -16 (+ v1-6 15))) + ) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this fragments s3-0) usage flags) + ) + this + ) diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc index 5d5fb65560..73245226eb 100644 --- a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash-h_REF.gc @@ -210,10 +210,10 @@ O(n^2) 'check everybody against everybody' collision loop." ) (:methods (new (symbol type int int) _type_) - (spatial-hash-method-33 () none) - (add-an-object (_type_ vector hash-object-info) int) + (spatial-hash-method-33 (_type_ vector hash-object-info) none) + (add-an-object (_type_ bounding-box (pointer collide-shape) int) int) (fill-actor-list-for-box (_type_ bounding-box (pointer collide-shape) int) int) - (fill-actor-list-for-sphere (_type_ sphere (pointer collide-shape) int) int) + (fill-actor-list-for-sphere (_type_ vector vector float (pointer collide-shape) int int) int) (fill-actor-list-for-line-sphere (_type_ vector vector float (pointer collide-shape) int int) int) (fill-actor-list-for-vec+r (_type_ vector (pointer collide-shape) int) int) (spatial-hash-method-39 (_type_ object hash-object-info) int) @@ -258,3 +258,7 @@ O(n^2) 'check everybody against everybody' collision loop." ;; failed to figure out what this is: 0 + + + + diff --git a/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc new file mode 100644 index 0000000000..44e937d769 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/spatial-hash/spatial-hash_REF.gc @@ -0,0 +1,997 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type grid-hash-work +(deftype grid-hash-work (basic) + ((result-words uint8 32 :offset 16) + (result-bits uint8 32 :overlay-at (-> result-words 0)) + (object-id int32) + (temp-box-min vector :inline) + (temp-box-max vector :inline) + (visit-count int32) + (temp-time uint32) + (queue-object-time uint32) + (make-hash-time uint32) + (search-time uint32) + (add-object-time uint32) + ) + ) + +;; definition for method 3 of type grid-hash-work +(defmethod inspect ((this grid-hash-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tresult-words[32] @ #x~X~%" (-> this result-words)) + (format #t "~1Tresult-bits[32] @ #x~X~%" (-> this result-words)) + (format #t "~1Tobject-id: ~D~%" (-> this object-id)) + (format #t "~1Ttemp-box-min: #~%" (-> this temp-box-min)) + (format #t "~1Ttemp-box-max: #~%" (-> this temp-box-max)) + (format #t "~1Tvisit-count: ~D~%" (-> this visit-count)) + (format #t "~1Ttemp-time: ~D~%" (-> this temp-time)) + (format #t "~1Tqueue-object-time: ~D~%" (-> this queue-object-time)) + (format #t "~1Tmake-hash-time: ~D~%" (-> this make-hash-time)) + (format #t "~1Tsearch-time: ~D~%" (-> this search-time)) + (format #t "~1Tadd-object-time: ~D~%" (-> this add-object-time)) + (label cfg-4) + this + ) + +;; definition for symbol *grid-hash-work*, type grid-hash-work +(define *grid-hash-work* (new 'static 'grid-hash-work)) + +;; definition for method 0 of type grid-hash +;; WARN: Return type mismatch object vs grid-hash. +(defmethod new grid-hash ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as grid-hash gp-0)) + (set! gp-0 0) + (goto cfg-4) + ) + (set! (-> (the-as grid-hash gp-0) work) *grid-hash-work*) + (set! (-> (the-as grid-hash gp-0) object-count) 0) + (set! (-> (the-as grid-hash gp-0) bucket-memory-size) arg0) + (set! (-> (the-as grid-hash gp-0) vertical-cell-count) 1) + (set! (-> (the-as grid-hash gp-0) min-cell-size) 16384.0) + (set! (-> (the-as grid-hash gp-0) mem-bucket-array) + (the-as (pointer grid-hash-word) (malloc allocation arg0)) + ) + (set! (-> (the-as grid-hash gp-0) spr-bucket-array) (the-as (pointer grid-hash-word) #x70000000)) + (set! (-> (the-as grid-hash gp-0) bucket-array) (-> (the-as grid-hash gp-0) mem-bucket-array)) + (set! (-> (the-as grid-hash gp-0) debug-draw) #f) + (set! (-> (the-as grid-hash gp-0) use-scratch-ram) #f) + (label cfg-4) + (the-as grid-hash gp-0) + ) + ) + +;; definition for method 16 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod verify-bits-in-bucket ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) + (let ((s5-0 0)) + 0 + (let ((v1-1 8) + (a0-1 (-> this object-count)) + (a1-2 (* (-> this bucket-size) 8)) + ) + (while (< a0-1 a1-2) + (let ((a3-0 (- a0-1 (* (/ a0-1 v1-1) v1-1)))) + (set! s5-0 (logior s5-0 (ash 1 a3-0))) + ) + (+! a0-1 1) + ) + ) + (dotimes (s4-0 (-> this bucket-count)) + (let ((a3-2 (-> this bucket-array (+ (-> this bucket-size) -1 (* s4-0 (-> this bucket-size)))))) + (when (logtest? a3-2 s5-0) + (format 0 "bad bits in bucket ~d bucket-word ~8x test-word ~8x~%" s4-0 a3-2 s5-0) + (break!) + 0 + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 17 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod box-of-everything ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) + (dotimes (v1-0 3) + (set! (-> arg1 min v1-0) (-> this dimension-array v1-0)) + (set! (-> arg1 max v1-0) -1) + ) + (let* ((v1-3 (-> this bucket-size)) + (a3-4 (* (-> this dimension-array 0) v1-3)) + (t0-3 (* (-> this dimension-array 2) a3-4)) + (t1-0 (-> this dimension-array 0)) + (t2-0 (-> this dimension-array 2)) + (t3-0 (-> this dimension-array 1)) + (a0-2 (&-> (-> this bucket-array) (/ (the-as int arg0) 8))) + (a1-2 (ash 1 (logand (the-as int arg0) 7))) + ) + (dotimes (t4-3 t3-0) + (let ((t5-0 a0-2)) + (dotimes (t6-0 t2-0) + (let ((t7-0 t5-0)) + (dotimes (t8-0 t1-0) + (when (logtest? (-> t7-0 0) a1-2) + (set! (-> arg1 min 0) (min (-> arg1 min 0) t8-0)) + (set! (-> arg1 min 1) (min (-> arg1 min 1) t4-3)) + (set! (-> arg1 min 2) (min (-> arg1 min 2) t6-0)) + (set! (-> arg1 max 0) (max (-> arg1 max 0) t8-0)) + (set! (-> arg1 max 1) (max (-> arg1 max 1) t4-3)) + (set! (-> arg1 max 2) (max (-> arg1 max 2) t6-0)) + ) + (&+! t7-0 v1-3) + ) + ) + (&+! t5-0 a3-4) + ) + ) + (&+! a0-2 t0-3) + ) + ) + 0 + (none) + ) + +;; definition (debug) for function validate-bucket-bits +;; WARN: Return type mismatch int vs symbol. +(defun-debug validate-bucket-bits ((arg0 grid-hash) (arg1 (pointer grid-hash-word))) + (let ((s3-0 (-> arg0 object-count)) + (s2-0 (* (-> arg0 bucket-size) 8)) + (gp-0 0) + (s5-0 0) + ) + (while (< s3-0 s2-0) + (let* ((s1-0 (/ s3-0 8)) + (a0-1 (- s3-0 (* s1-0 8))) + ) + (when (logtest? (-> arg1 s1-0) (ash 1 a0-1)) + (format 0 "bit ~d, " s3-0) + (+! gp-0 1) + (set! s5-0 (the-as int (-> arg1 s1-0))) + ) + ) + (+! s3-0 1) + ) + (when (> gp-0 0) + (format 0 "~%~d bad bits found~%" gp-0) + (format 0 "bad-word ~x~%" s5-0) + (break!) + 0 + ) + ) + (the-as symbol 0) + ) + +;; definition for method 18 of type grid-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 18 grid-hash)" 18 grid-hash) + +;; definition for method 19 of type grid-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 19 grid-hash)" 19 grid-hash) + +;; definition for method 20 of type grid-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 20 grid-hash)" 20 grid-hash) + +;; definition for method 21 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod set-up-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) + (dotimes (v1-0 3) + (set! (-> arg0 min v1-0) + (the int + (fmax + 0.0 + (fmin + (* (- (-> arg1 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) + ) + ) + ) + ) + (set! (-> arg0 max v1-0) + (the int (fmax 0.0 (fmin + (* (- (-> arg2 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 22 of type grid-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 22 grid-hash)" 22 grid-hash) + +;; definition for method 23 of type grid-hash +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod line-sphere-to-grid-box ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) + (s5-0 (new 'stack-no-clear 'grid-hash-box)) + ) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> arg1 quad)) + (vector+! s2-0 arg1 arg2) + (set! (-> v1-0 w) arg3) + (set! (-> s2-0 w) arg3) + (sphere-to-grid-box this s4-0 (the-as sphere v1-0)) + (sphere-to-grid-box this s5-0 (the-as sphere s2-0)) + ) + (set! (-> arg0 min 0) (min (-> s4-0 min 0) (-> s5-0 min 0))) + (set! (-> arg0 min 1) (min (-> s4-0 min 1) (-> s5-0 min 1))) + (set! (-> arg0 min 2) (min (-> s4-0 min 2) (-> s5-0 min 2))) + (set! (-> arg0 max 0) (max (-> s4-0 max 0) (-> s5-0 max 0))) + (set! (-> arg0 max 1) (max (-> s4-0 max 1) (-> s5-0 max 1))) + (set! (-> arg0 max 2) (max (-> s4-0 max 2) (-> s5-0 max 2))) + ) + 0 + (none) + ) + +;; definition for method 10 of type grid-hash +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod clear-bucket-array ((this grid-hash)) + (let ((v1-5 (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) + (-> this bucket-size) + ) + 15 + ) + 16 + ) + ) + (a0-1 (the-as (pointer uinteger) (-> this bucket-array))) + ) + (while (nonzero? v1-5) + (+! v1-5 -1) + (set! (-> (the-as (pointer uint128) a0-1) 0) (the-as uint128 0)) + (set! a0-1 (&-> (the-as (pointer grid-hash-word) a0-1) 16)) + ) + ) + 0 + (none) + ) + +;; definition for method 24 of type grid-hash +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-grid ((this grid-hash)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (dotimes (a0-1 3) + (set! (-> v1-0 data a0-1) (fmax (-> this min-cell-size) (- (-> this box-max a0-1) (-> this box-min a0-1)))) + ) + (b! + (and (> (-> this object-count) 0) (< 0.0 (-> v1-0 x)) (< 0.0 (-> v1-0 y)) (< 0.0 (-> v1-0 z))) + cfg-23 + :delay (empty-form) + ) + (set! (-> this bucket-count) 1) + (set! (-> this bucket-size) 1) + (dotimes (v1-3 3) + (set! (-> this box-min v1-3) 0.0) + (set! (-> this box-max v1-3) 0.0) + (set! (-> this axis-scale v1-3) 0.0) + (set! (-> this dimension-array v1-3) 1) + ) + (let ((v1-11 + (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) + (-> this bucket-size) + ) + 15 + ) + 16 + ) + ) + (a0-19 (the-as (pointer uinteger) (-> this bucket-array))) + ) + (while (nonzero? v1-11) + (+! v1-11 -1) + (set! (-> (the-as (pointer uint128) a0-19) 0) (the-as uint128 0)) + (set! a0-19 (&-> (the-as (pointer grid-hash-word) a0-19) 16)) + ) + ) + 0 + (b! #t cfg-46 :delay (nop!)) + (label cfg-23) + (let ((a0-20 8)) + (set! (-> this bucket-size) (/ (+ a0-20 -1 (-> this object-count)) a0-20)) + ) + (set! (-> this bucket-count) + (min (* (-> this object-count) 16) (/ (-> this bucket-memory-size) (-> this bucket-size))) + ) + (let ((f0-11 + (sqrtf + (/ (the float (-> this bucket-count)) (* (-> v1-0 x) (-> v1-0 z) (the float (-> this vertical-cell-count)))) + ) + ) + ) + (let ((a0-29 (min 126 (+ (-> this bucket-count) -1)))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-11 (-> v1-0 x))) a0-29))) + (set! (-> this dimension-array 1) (-> this vertical-cell-count)) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-11 (-> v1-0 z))) a0-29))) + ) + (let* ((f1-15 (* f0-11 (-> v1-0 z))) + (f1-17 (- f1-15 (the float (the int f1-15)))) + (f0-12 (* f0-11 (-> v1-0 x))) + ) + (cond + ((< f1-17 (- f0-12 (the float (the int f0-12)))) + (if (>= (-> this bucket-count) + (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2)) + ) + (+! (-> this dimension-array 0) 1) + ) + ) + (else + (if (>= (-> this bucket-count) + (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1)) + ) + (+! (-> this dimension-array 2) 1) + ) + ) + ) + ) + ) + (dotimes (a0-42 2) + (let* ((a1-26 (* a0-42 2)) + (a2-12 (max 1 (the int (/ (-> v1-0 data a1-26) (-> this min-cell-size))))) + ) + (set! (-> (the-as (pointer uint8) (+ a1-26 (the-as int this))) 24) + (the-as uint (min (-> (the-as (pointer int8) (+ a1-26 (the-as int this))) 24) a2-12)) + ) + ) + ) + (dotimes (a0-45 3) + (set! (-> this axis-scale a0-45) (/ (the float (-> this dimension-array a0-45)) (-> v1-0 data a0-45))) + ) + ) + (let ((a2-13 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)))) + (b! (< (-> this bucket-count) a2-13) cfg-40) + (let* ((v1-20 this) + (a0-53 + (/ (+ (* (* (* (-> v1-20 dimension-array 0) (-> v1-20 dimension-array 1)) (-> v1-20 dimension-array 2)) + (-> v1-20 bucket-size) + ) + 15 + ) + 16 + ) + ) + (v1-21 (the-as (pointer uinteger) (-> v1-20 bucket-array))) + ) + (while (nonzero? a0-53) + (+! a0-53 -1) + (set! (-> (the-as (pointer uint128) v1-21) 0) (the-as uint128 0)) + (set! v1-21 (&-> (the-as (pointer grid-hash-word) v1-21) 16)) + ) + ) + 0 + (b! #t cfg-46 :delay (nop!)) + (label cfg-40) + (when *debug-segment* + (format + *stdcon* + "grid-hash::update-grid: bucket overflow! ~d dim ~d ~d ~d~%" + a2-13 + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) + ) + (break!) + 0 + ) + ) + (set! (-> this bucket-count) 1) + (set! (-> this bucket-size) 1) + (dotimes (v1-30 3) + (set! (-> this axis-scale v1-30) 0.0) + (set! (-> this dimension-array v1-30) 1) + ) + (label cfg-46) + 0 + (none) + ) + +;; definition for method 9 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod update-grid-for-objects-in-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) + (set! (-> this object-count) arg0) + (dotimes (v1-0 3) + (set! (-> this box-min v1-0) (-> arg1 data v1-0)) + (set! (-> this box-max v1-0) (-> arg2 data v1-0)) + ) + (update-grid this) + 0 + (none) + ) + +;; definition for method 11 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod setup-search-box ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (t1-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (t2-0 3) + (set! (-> v1-0 data t2-0) (fmin (fmin (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) + (set! (-> t1-0 data t2-0) (fmax (fmax (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) + ) + (let ((a2-3 this) + (a3-1 (-> this search-box)) + ) + (dotimes (t0-1 3) + (set! (-> a3-1 min t0-1) + (the int + (fmax + 0.0 + (fmin + (* (- (-> v1-0 data t0-1) (-> a2-3 box-min t0-1)) (-> a2-3 axis-scale t0-1)) + (the float (+ (-> a2-3 dimension-array t0-1) -1)) + ) + ) + ) + ) + (set! (-> a3-1 max t0-1) + (the int (fmax 0.0 (fmin + (* (- (-> t1-0 data t0-1) (-> a2-3 box-min t0-1)) (-> a2-3 axis-scale t0-1)) + (the float (+ (-> a2-3 dimension-array t0-1) -1)) + ) + ) + ) + ) + ) + ) + ) + 0 + (set! (-> this work object-id) arg0) + (let* ((t1-1 this) + (t2-21 (-> this search-box)) + (a3-2 arg0) + (v1-5 (-> t1-1 bucket-size)) + (a0-2 (* (-> t1-1 dimension-array 0) v1-5)) + (a1-2 (* (-> t1-1 dimension-array 2) a0-2)) + (a2-6 (+ (- 1 (-> t2-21 min 0)) (-> t2-21 max 0))) + (t0-6 (+ (- 1 (-> t2-21 min 2)) (-> t2-21 max 2))) + (t3-22 (+ (- 1 (-> t2-21 min 1)) (-> t2-21 max 1))) + (t1-3 (the-as + object + (+ (+ (* (-> t2-21 min 0) v1-5) (* (-> t2-21 min 1) a1-2) (* (-> t2-21 min 2) a0-2) (/ a3-2 8) 0) + (the-as int (the-as pointer (-> t1-1 bucket-array))) + ) + ) + ) + (a3-4 (ash 1 (logand a3-2 7))) + (t2-28 t3-22) + ) + (label cfg-10) + (let ((t3-23 t0-6) + (t4-6 t1-3) + ) + (label cfg-11) + (let ((t5-2 a2-6) + (t6-0 t4-6) + ) + (label cfg-12) + (nop!) + (let ((t7-0 (-> (the-as (pointer uint8) t6-0)))) + (nop!) + (let ((t7-1 (logior t7-0 a3-4))) + (+! t5-2 -1) + (set! (-> (the-as (pointer uint8) t6-0)) t7-1) + ) + ) + (b! (nonzero? t5-2) cfg-12 :delay (set! t6-0 (+ (the-as pointer t6-0) v1-5))) + ) + (+! t3-23 -1) + (nop!) + (b! (nonzero? t3-23) cfg-11 :delay (set! t4-6 (+ (the-as pointer t4-6) a0-2))) + ) + (+! t2-28 -1) + (nop!) + (b! (nonzero? t2-28) cfg-10 :delay (set! t1-3 (+ (the-as pointer t1-3) a1-2))) + ) + 0 + 0 + (none) + ) + +;; definition for method 12 of type grid-hash +(defmethod search-for-point ((this grid-hash) (arg0 vector)) + (let ((v1-0 this) + (a0-1 (-> this search-box)) + (a2-0 arg0) + ) + (dotimes (a3-0 3) + (set! (-> a0-1 min a3-0) + (the int + (fmax + 0.0 + (fmin + (* (- (-> a2-0 data a3-0) (-> v1-0 box-min a3-0)) (-> v1-0 axis-scale a3-0)) + (the float (+ (-> v1-0 dimension-array a3-0) -1)) + ) + ) + ) + ) + (set! (-> a0-1 max a3-0) + (the int (fmax 0.0 (fmin + (* (- (-> arg0 data a3-0) (-> v1-0 box-min a3-0)) (-> v1-0 axis-scale a3-0)) + (the float (+ (-> v1-0 dimension-array a3-0) -1)) + ) + ) + ) + ) + ) + ) + 0 + (do-search! this (-> this search-box) (-> this work result-words)) + (-> this work result-words) + ) + +;; definition for method 13 of type grid-hash +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +;; INFO: Used lq/sq +(defmethod search-for-sphere ((this grid-hash) (arg0 vector) (arg1 float)) + (let ((v1-0 (new 'stack-no-clear 'sphere))) + (set! (-> v1-0 quad) (-> arg0 quad)) + (set! (-> v1-0 r) arg1) + (sphere-to-grid-box this (-> this search-box) v1-0) + ) + (let ((s5-0 (-> this work result-words)) + (s4-0 0) + ) + (label cfg-1) + (do-search! this (-> this search-box) s5-0) + (dotimes (v1-5 (-> this bucket-size)) + (set! s4-0 (logior s4-0 (-> s5-0 v1-5))) + ) + (when (zero? s4-0) + (when (or (> (-> this search-box min 0) 0) + (> (-> this search-box min 2) 0) + (< (-> this search-box max 0) (+ (-> this dimension-array 0) -1)) + (< (-> this search-box max 2) (+ (-> this dimension-array 2) -1)) + ) + (set! (-> this search-box min 0) (max 0 (+ (-> this search-box min 0) -1))) + (set! (-> this search-box min 2) (max 0 (+ (-> this search-box min 2) -1))) + (set! (-> this search-box max 0) (min (+ (-> this dimension-array 0) -1) (+ (-> this search-box max 0) 1))) + (set! (-> this search-box max 2) (min (+ (-> this dimension-array 2) -1) (+ (-> this search-box max 2) 1))) + (goto cfg-1) + ) + ) + ) + (-> this work result-words) + ) + +;; definition (debug) for function draw-grid +;; WARN: Return type mismatch int vs none. +(defun-debug draw-grid ((arg0 vector) (arg1 vector) (arg2 (pointer int8)) (arg3 rgba)) + (local-vars (sv-64 vector) (sv-68 vector) (sv-72 vector)) + (set! sv-64 (new 'stack-no-clear 'vector)) + (set! sv-68 (new 'stack-no-clear 'vector)) + (set! sv-72 (new 'stack-no-clear 'vector)) + (dotimes (v1-3 3) + (set! (-> sv-64 data v1-3) (/ (- (-> arg1 data v1-3) (-> arg0 data v1-3)) (the float (-> arg2 v1-3)))) + ) + (set! (-> sv-68 x) (-> arg0 x)) + (set! (-> sv-72 x) (-> arg1 x)) + (dotimes (s2-0 (+ (-> arg2 1) 1)) + (set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-0) (-> sv-64 y)))) + (set! (-> sv-72 y) (-> sv-68 y)) + (dotimes (s1-0 (+ (-> arg2 2) 1)) + (set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s1-0) (-> sv-64 z)))) + (set! (-> sv-72 z) (-> sv-68 z)) + (add-debug-line #t (bucket-id debug) sv-68 sv-72 arg3 #f (the-as rgba -1)) + ) + ) + (set! (-> sv-68 z) (-> arg0 z)) + (set! (-> sv-72 z) (-> arg1 z)) + (dotimes (s2-1 (+ (-> arg2 1) 1)) + (set! (-> sv-68 y) (+ (-> arg0 y) (* (the float s2-1) (-> sv-64 y)))) + (set! (-> sv-72 y) (-> sv-68 y)) + (dotimes (s1-1 (+ (-> arg2 0) 1)) + (set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s1-1) (-> sv-64 x)))) + (set! (-> sv-72 x) (-> sv-68 x)) + (add-debug-line #t (bucket-id debug) sv-68 sv-72 arg3 #f (the-as rgba -1)) + ) + ) + (set! (-> sv-68 y) (-> arg0 y)) + (set! (-> sv-72 y) (-> arg1 y)) + (dotimes (s3-1 (+ (-> arg2 0) 1)) + (set! (-> sv-68 x) (+ (-> arg0 x) (* (the float s3-1) (-> sv-64 x)))) + (set! (-> sv-72 x) (-> sv-68 x)) + (dotimes (s2-2 (+ (-> arg2 2) 1)) + (set! (-> sv-68 z) (+ (-> arg0 z) (* (the float s2-2) (-> sv-64 z)))) + (set! (-> sv-72 z) (-> sv-68 z)) + (add-debug-line #t (bucket-id debug) sv-68 sv-72 arg3 #f (the-as rgba -1)) + ) + ) + 0 + (none) + ) + +;; definition for method 14 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this grid-hash) (arg0 rgba)) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (t0-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (a2-0 3) + (set! (-> v1-0 data a2-0) (-> this box-min a2-0)) + (set! (-> t0-0 data a2-0) (-> this box-max a2-0)) + ) + (draw-grid v1-0 t0-0 (-> this dimension-array) arg0) + ) + 0 + (none) + ) + +;; definition for method 15 of type grid-hash +;; WARN: Return type mismatch int vs none. +(defmethod dump-grid-info ((this grid-hash)) + (if (-> this debug-draw) + (draw this *color-light-blue*) + ) + (format + *stdcon* + "bucket memory ~d, bucket-size ~d, word-size ~d bits~%" + (-> this bucket-memory-size) + (-> this bucket-size) + 8 + ) + (format + *stdcon* + "bucket dimensions ~d ~d ~d~%" + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) + ) + (format *stdcon* "object-count ~d, bucket-count ~d~%" (-> this object-count) (-> this bucket-count)) + 0 + (none) + ) + +;; definition (debug) for function draw-sphere-box +;; WARN: Return type mismatch int vs none. +(defun-debug draw-sphere-box ((arg0 sphere) (arg1 rgba)) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (a3-0 (new 'stack-no-clear 'vector)) + ) + (dotimes (v1-0 3) + (set! (-> a2-0 data v1-0) (- (-> arg0 data v1-0) (-> arg0 r))) + (set! (-> a3-0 data v1-0) (+ (-> arg0 data v1-0) (-> arg0 r))) + ) + (add-debug-box #t (bucket-id debug-no-zbuf1) a2-0 a3-0 arg1) + ) + 0 + (none) + ) + +;; definition (debug) for function draw-line-sphere +;; WARN: Return type mismatch int vs none. +(defun-debug draw-line-sphere ((arg0 vector) (arg1 vector) (arg2 float) (arg3 rgba)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector+! gp-0 arg0 arg1) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) arg0 arg2 arg3) + (add-debug-sphere #t (bucket-id debug-no-zbuf1) gp-0 arg2 arg3) + ) + 0 + (none) + ) + +;; definition for method 0 of type sphere-hash +;; WARN: Return type mismatch object vs sphere-hash. +(defmethod new sphere-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) + (let ((s5-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as sphere-hash s5-0)) + (set! s5-0 0) + (goto cfg-4) + ) + (set! (-> (the-as sphere-hash s5-0) work) *grid-hash-work*) + (set! (-> (the-as sphere-hash s5-0) object-count) 0) + (set! (-> (the-as sphere-hash s5-0) bucket-memory-size) arg0) + (set! (-> (the-as sphere-hash s5-0) vertical-cell-count) 1) + (set! (-> (the-as sphere-hash s5-0) min-cell-size) 16384.0) + (set! (-> (the-as sphere-hash s5-0) mem-bucket-array) + (the-as (pointer grid-hash-word) (malloc allocation arg0)) + ) + (set! (-> (the-as sphere-hash s5-0) spr-bucket-array) (the-as (pointer grid-hash-word) #x70000000)) + (set! (-> (the-as sphere-hash s5-0) bucket-array) (-> (the-as sphere-hash s5-0) mem-bucket-array)) + (set! (-> (the-as sphere-hash s5-0) debug-draw) #f) + (set! (-> (the-as sphere-hash s5-0) use-scratch-ram) #f) + (set! (-> (the-as sphere-hash s5-0) max-object-count) arg1) + (set! (-> (the-as sphere-hash s5-0) mem-sphere-array) (the-as uint (malloc allocation (* arg1 16)))) + (set! (-> (the-as sphere-hash s5-0) spr-sphere-array) (the-as uint (+ #x70000000 arg0))) + (set! (-> (the-as sphere-hash s5-0) sphere-array) + (the-as (inline-array sphere) (-> (the-as sphere-hash s5-0) mem-sphere-array)) + ) + (label cfg-4) + (the-as sphere-hash s5-0) + ) + ) + +;; definition for method 25 of type sphere-hash +;; WARN: Return type mismatch int vs none. +(defmethod clear-objects! ((this sphere-hash)) + (set! (-> this object-count) 0) + (dotimes (v1-0 3) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) + ) + (cond + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this bucket-array) (-> this spr-bucket-array)) + ) + (else + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this bucket-array) (-> this mem-bucket-array)) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type sphere-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) + +;; definition for method 26 of type sphere-hash +(defmethod add-a-sphere ((this sphere-hash) (arg0 vector)) + (let ((gp-0 (-> this object-count))) + (cond + ((< gp-0 (-> this max-object-count)) + (let ((a0-2 (-> this sphere-array gp-0))) + (mem-copy! (the-as pointer a0-2) (the-as pointer arg0) 16) + ) + (dotimes (v1-2 3) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + ) + (+! (-> this object-count) 1) + gp-0 + ) + (else + -1 + ) + ) + ) + ) + +;; definition for method 27 of type sphere-hash +(defmethod add-a-sphere-with-flag ((this sphere-hash) (arg0 vector) (arg1 int)) + (let ((gp-0 (-> this object-count))) + (cond + ((< gp-0 (-> this max-object-count)) + (let ((s2-0 (the-as object (-> this sphere-array gp-0)))) + (mem-copy! (the-as pointer s2-0) (the-as pointer arg0) 16) + (dotimes (v1-2 3) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + ) + (set! (-> (the-as (pointer int8) s2-0) 12) arg1) + ) + (+! (-> this object-count) 1) + gp-0 + ) + (else + -1 + ) + ) + ) + ) + +;; definition for method 32 of type sphere-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 32 sphere-hash)" 32 sphere-hash) + +;; definition for method 29 of type sphere-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 29 sphere-hash)" 29 sphere-hash) + +;; definition for method 30 of type sphere-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 30 sphere-hash)" 30 sphere-hash) + +;; definition for method 31 of type sphere-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 31 sphere-hash)" 31 sphere-hash) + +;; definition for method 15 of type sphere-hash +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod dump-grid-info ((this sphere-hash)) + (call-parent-method this) + (new 'stack-no-clear 'vector) + (let ((f30-0 6144.0)) + (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) + (+! (-> this work temp-box-min y) f30-0) + ) + (set! (-> this work temp-box-max quad) (-> this work temp-box-min quad)) + (set! (-> this work visit-count) 0) + (set! (-> this debug-draw) #t) + (set! (-> this work add-object-time) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 0 of type spatial-hash +;; WARN: Return type mismatch object vs spatial-hash. +(defmethod new spatial-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) + (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) + (when (zero? (the-as spatial-hash gp-0)) + (set! gp-0 0) + (goto cfg-4) + ) + (set! (-> (the-as spatial-hash gp-0) work) *grid-hash-work*) + (set! (-> (the-as spatial-hash gp-0) object-count) 0) + (set! (-> (the-as spatial-hash gp-0) bucket-memory-size) arg0) + (set! (-> (the-as spatial-hash gp-0) vertical-cell-count) 1) + (set! (-> (the-as spatial-hash gp-0) min-cell-size) 16384.0) + (set! (-> (the-as spatial-hash gp-0) mem-bucket-array) + (the-as (pointer grid-hash-word) (malloc allocation arg0)) + ) + (set! (-> (the-as spatial-hash gp-0) spr-bucket-array) (the-as (pointer grid-hash-word) #x70000000)) + (set! (-> (the-as spatial-hash gp-0) bucket-array) (-> (the-as spatial-hash gp-0) mem-bucket-array)) + (set! (-> (the-as spatial-hash gp-0) debug-draw) #f) + (set! (-> (the-as spatial-hash gp-0) use-scratch-ram) #f) + (set! (-> (the-as spatial-hash gp-0) max-object-count) arg1) + (set! (-> (the-as spatial-hash gp-0) mem-sphere-array) (the-as uint (malloc allocation (* arg1 16)))) + (set! (-> (the-as spatial-hash gp-0) mem-object-array) + (the-as (inline-array hash-object-info) (malloc allocation (* arg1 16))) + ) + (set! (-> (the-as spatial-hash gp-0) spr-sphere-array) (the-as uint (+ #x70000000 arg0))) + (set! (-> (the-as spatial-hash gp-0) spr-object-array) + (the-as (inline-array hash-object-info) (+ #x70000000 (* arg1 16) arg0)) + ) + (set! (-> (the-as spatial-hash gp-0) sphere-array) + (the-as (inline-array sphere) (-> (the-as spatial-hash gp-0) mem-sphere-array)) + ) + (set! (-> (the-as spatial-hash gp-0) object-array) (-> (the-as spatial-hash gp-0) mem-object-array)) + (label cfg-4) + (the-as spatial-hash gp-0) + ) + ) + +;; definition for method 25 of type spatial-hash +;; WARN: Return type mismatch int vs none. +(defmethod clear-objects! ((this spatial-hash)) + (set! (-> this object-count) 0) + (dotimes (v1-0 3) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) + ) + (cond + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this object-array) (-> this spr-object-array)) + (set! (-> this bucket-array) (-> this spr-bucket-array)) + ) + (else + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this object-array) (-> this mem-object-array)) + (set! (-> this bucket-array) (-> this mem-bucket-array)) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type spatial-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 32 spatial-hash)" 32 spatial-hash) + +;; definition for method 33 of type spatial-hash +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod spatial-hash-method-33 ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 (-> this object-count))) + (cond + ((< v0-0 (-> this max-object-count)) + (let ((v1-2 (-> this sphere-array v0-0)) + (a3-2 (-> this object-array v0-0)) + ) + (let ((t0-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (let ((t2-0 (-> t0-1 0))) + (let ((t1-0 arg0)) + (let ((t3-0 (- (-> arg0 w)))) + (.mov vf6 t3-0) + ) + (.lvf vf4 (&-> t1-0 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t2-0 quad) vf5) + ) + (let ((t2-1 (-> t0-1 1))) + (let ((t1-1 arg0)) + (let ((t3-1 (-> arg0 w))) + (.mov vf6 t3-1) + ) + (.lvf vf4 (&-> t1-1 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> t2-1 quad) vf5) + ) + (dotimes (t1-2 3) + (set! (-> this box-min t1-2) (fmin (-> this box-min t1-2) (-> (&-> t0-1 0 data t1-2) 0))) + (set! (-> this box-max t1-2) (fmax (-> this box-max t1-2) (-> (&-> t0-1 0 data t1-2) 4))) + ) + ) + (set! (-> v1-2 quad) (-> arg0 quad)) + (set! (-> a3-2 object) (the-as basic arg1)) + ) + (+! (-> this object-count) 1) + ) + (else + -1 + ) + ) + ) + (none) + ) + ) + +;; definition for method 38 of type spatial-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 38 spatial-hash)" 38 spatial-hash) + +;; definition for method 35 of type spatial-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 35 spatial-hash)" 35 spatial-hash) + +;; definition for method 36 of type spatial-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 36 spatial-hash)" 36 spatial-hash) + +;; definition for method 34 of type spatial-hash +;; INFO: function output is handled by mips2c +(defmethod-mips2c "(method 34 spatial-hash)" 34 spatial-hash) + +;; definition for method 37 of type spatial-hash +;; INFO: Used lq/sq +(defmethod fill-actor-list-for-line-sphere ((this spatial-hash) + (arg0 vector) + (arg1 vector) + (arg2 float) + (arg3 (pointer collide-shape)) + (arg4 int) + (arg5 int) + ) + (let ((v1-0 (new 'stack-no-clear 'bounding-box))) + (set! (-> v1-0 min quad) (-> arg0 quad)) + (set! (-> v1-0 min w) 0.0) + (fill-actor-list-for-box this v1-0 (the-as (pointer collide-shape) arg1) (the-as int arg2)) + ) + ) + +;; definition for method 39 of type spatial-hash +(defmethod spatial-hash-method-39 ((this spatial-hash) (arg0 object) (arg1 hash-object-info)) + (dotimes (s5-0 (-> this object-count)) + (let ((a0-2 (-> this object-array s5-0 object))) + (when (not (valid? a0-2 basic "" #t 0)) + (break!) + 0 + ) + ) + ) + 0 + ) diff --git a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc index 4c991fbfe2..3a09cc9047 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-h_REF.gc @@ -480,7 +480,7 @@ (+! (-> s5-0 2 y) 16384.0) (set! (-> s5-0 2 r) 2867.2) (let ((v1-60 gp-0)) - (set! (-> v1-60 spheres) s5-0) + (set! (-> v1-60 best-dist) (the-as float s5-0)) (set! (-> v1-60 best-other-prim) (the-as collide-shape-prim 3)) (set! (-> v1-60 collide-with) (logclear diff --git a/test/decompiler/reference/jak3/engine/target/board/board-part_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-part_REF.gc new file mode 100644 index 0000000000..d384192eb8 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/board/board-part_REF.gc @@ -0,0 +1,446 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-board-land-straight + :id 189 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-quick-jump + :id 190 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-launch + :id 191 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 666 :flags (sp3)) (sp-item 667 :flags (sp3)) (sp-item 668 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 668 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 18011.25)) + (:scalevel-x (meters -0.125)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.375) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409600.0) + ) + ) + +;; failed to figure out what this is: +(defpart 667 + :init-specs ((:texture (middot level-default-sprite)) + (:num 100.0) + (:scale-x (meters 0.05) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:vel-y (meters 0.33333334) (meters 0.006666667)) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.9 0.04) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 666 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 30.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93 0.02) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 60) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-target-board-duck-charge + :id 186 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 669 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 669 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:y (meters 0.5)) + (:scale-x (meters 10) (meters 5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.85333335) + (:fade-g 0.85333335) + (:fade-a 0.85333335 0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'board-charge-track) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 670 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -0.85 -1.7) + (:fade-b -8.0) + (:fade-a -0.16 -0.16) + (:accel-y (meters -0.0016666667) (meters -0.00066666666)) + (:friction 0.95) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 45) (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-target-board + :id 185 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 671) (sp-item 672 :flags (is-3d)) (sp-item 673)) + ) + +;; failed to figure out what this is: +(defpart 671 + :init-specs ((:num 3.0) + (:y (meters 0.25)) + (:rot-x 7) + (:r 2048.0) + (:g 1638.4) + (:b 1843.2) + (:fade-b -0.08533333) + (:timer (seconds 0.135)) + (:flags (distort)) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 672 + :init-specs ((:texture (hotdot level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 4) (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b 255.0) + (:a 8.0 8.0) + (:scalevel-x (meters -0.02) (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.1) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + ) + ) + +;; failed to figure out what this is: +(defpart 673 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.05)) + (:r 128.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.05625)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-r -3.0) + (:fade-g -3.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 80) (degrees 10)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 674 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.0) + (:y (meters 0)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 32.0) + (:a 8.0 56.0) + (:vel-y (meters 0.13333334) (meters 0.16666667)) + (:scalevel-x (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.4222223) + (:fade-a -0.35555556) + (:accel-y (meters 0.00008333333)) + (:friction 0.7) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-spin-attack + :id 184 + :duration (seconds 1) + :flags (sp0 sp6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 90) (degrees 180) (degrees 90)) + :parts ((sp-item 675 :flags (is-3d sp3 sp6 sp7)) + (sp-item 676 :flags (is-3d sp3 sp6 sp7)) + (sp-item 677 :flags (sp3 sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 677 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4) (meters 0.5)) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.4) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 676 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 12)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 9)) + (:r 0.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.086666666)) + (:scalevel-y (meters -0.09)) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 675 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1.4)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.9)) + (:r 0.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-a -3.1875) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-zap-attack + :id 188 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 678 :flags (is-3d) :period (seconds 20) :length (seconds 0.335))) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-green-eco-zap-attack + :id 187 + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 679 :flags (is-3d) :period (seconds 20) :length (seconds 0.335))) + ) + +;; definition for function board-charge-track +;; WARN: Return type mismatch int vs none. +(defun board-charge-track ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-0 *target*) + (a1-1 37) + ) + (when *target* + (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data a1-1)))) + (set! (-> arg2 x) (-> v1-2 x)) + (set! (-> arg2 y) (-> v1-2 y)) + (set! (-> arg2 z) (-> v1-2 z)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function board-zap-track +;; WARN: Return type mismatch int vs none. +(defun board-zap-track ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-2 (ppointer->process (-> arg1 key proc parent))) + (a1-1 (the int (-> arg1 user-float))) + (v1-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable v1-2) node-list data a1-1))) + ) + (set! (-> arg2 x) (-> v1-5 x)) + (set! (-> arg2 y) (-> v1-5 y)) + (set! (-> arg2 z) (-> v1-5 z)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 678 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:num 0.25) + (:y (meters 0.5)) + (:scale-x (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 80.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.16666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 37.0) + (:func 'board-zap-track) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 680 + :init-specs ((:func 'none)) + ) + +;; failed to figure out what this is: +(defpart 679 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:num 0.25) + (:y (meters 0.5)) + (:scale-x (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 255.0) + (:b 80.0) + (:a 255.0) + (:scalevel-x (meters 0.26666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-b -1.6) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 37.0) + (:func 'board-zap-track) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc index 1a5d50870b..9ed085daf2 100644 --- a/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/board-states_REF.gc @@ -2625,16 +2625,16 @@ (set! (-> self board ride-rot-old) (-> self board ride-rot)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) - (let* ((s5-0 (new 'stack-no-clear 'collide-query)) - (a0-16 (-> self control)) - (t9-2 (method-of-object a0-16 find-ground)) - (a1-0 s5-0) - (a2-3 (logclear (-> self control root-prim prim-core collide-with) (collide-spec water))) - (a3-0 8192.0) - (t0-0 81920.0) - (t1-0 1024.0) - ) - (if (t9-2 a0-16 a1-0 a2-3 a3-0 t0-0 t1-0) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (if (find-ground + (-> self control) + s5-0 + (logclear (-> self control root-prim prim-core collide-with) (collide-spec water)) + 8192.0 + 81920.0 + 1024.0 + (the-as process #f) + ) (set! (-> self control gspot-pat-surfce) (-> s5-0 best-other-tri pat)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc index d63fe4303d..6b22ca8010 100644 --- a/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/collide-reaction-target_REF.gc @@ -222,7 +222,7 @@ (set! (-> sv-88 rvec quad) (-> arg3 quad)) (set! (-> sv-88 uvec quad) (-> arg3 quad)) (let ((a1-3 (new 'stack-no-clear 'vector))) - (vector-float*! a1-3 (-> arg1 move-dist) (the-as float (-> arg1 spheres))) + (vector-float*! a1-3 (-> arg1 move-dist) (-> arg1 best-dist)) (move-by-vector! arg0 a1-3) ) (set! sv-104 (logior sv-104 (react-to-pat! arg0 (-> arg1 best-other-tri pat)))) @@ -249,7 +249,7 @@ (let ((v1-35 (-> sv-80 quad))) (set! (-> sv-84 quad) v1-35) ) - (if (= (the-as float (-> arg1 spheres)) 0.0) + (if (= (-> arg1 best-dist) 0.0) (move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0)) ) (set! (-> arg0 poly-normal quad) (-> arg1 best-other-tri normal quad)) diff --git a/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc b/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc index 3cccdba018..008c3ce2a5 100644 --- a/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/darkjak-h_REF.gc @@ -18,11 +18,11 @@ (clock-on symbol) (hud handle 1) (tone sound-id) - (bomb uint32) + (bomb (pointer process)) (mode-sound-bank connection) ) (:methods - (darkjak-info-method-9 () none) + (update-clock! (_type_ int) none) ) ) @@ -56,7 +56,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc new file mode 100644 index 0000000000..980fba9f7a --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-blue-shot_REF.gc @@ -0,0 +1,3196 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function sparticle-fade-alpha-dist +;; WARN: Return type mismatch int vs none. +(defun sparticle-fade-alpha-dist ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (let ((a0-1 (math-camera-pos)) + (v1-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (set! (-> v1-0 x) (- (-> arg2 rvec x) (-> a0-1 x))) + (set! (-> v1-0 y) (- (-> arg2 rvec y) (-> a0-1 y))) + (set! (-> v1-0 z) (- (-> arg2 rvec z) (-> a0-1 z))) + (let ((f1-3 (vector-length v1-0))) + (set! (-> arg2 fvec w) (* 128.0 (- 1.0 (* 0.0000024414062 f1-3)))) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 12) (new 'static 'lightning-spec + :name "lightning-blue-shot-attack-explode" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 45.0 + :duration-rand 60.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 13) (new 'static 'lightning-spec + :name "lightning-blue-shot-terminal" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 75.0 + :sound #f + ) + ) + +;; definition for function gun-fire-blue-1 +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs object. +(defbehavior gun-fire-blue-1 target () + (let ((gp-0 (-> self gun)) + (s4-0 (-> self gun laser-dir)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (let ((s3-0 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s3-0 s4-0 (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (vector-rotate-y! s5-0 s4-0 (* 182.04445 (rand-vu-float-range 0.0 1.1))) + (vector-orient-by-quat! s5-0 s5-0 s3-0) + ) + (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-1 ent) (-> self entity)) + (set! (-> s4-1 charge) 1.0) + (set! (-> s4-1 options) (projectile-options po17)) + (logclear! (-> s4-1 options) (projectile-options po14 po15 po16)) + (set! (-> s4-1 pos quad) (-> gp-0 fire-point quad)) + (set! (-> s4-1 vel quad) (-> s5-0 quad)) + (set! (-> s4-1 notify-handle) (the-as handle #f)) + (set! (-> s4-1 owner-handle) (the-as handle #f)) + (set! (-> s4-1 target-handle) (the-as handle #f)) + (set! (-> s4-1 target-pos quad) (the-as uint128 0)) + (set! (-> s4-1 ignore-handle) (process->handle (send-event self 'get-vehicle))) + (let* ((v1-16 *game-info*) + (a0-16 (+ (-> v1-16 attack-id) 1)) + ) + (set! (-> v1-16 attack-id) a0-16) + (set! (-> s4-1 attack-id) a0-16) + ) + (set! (-> s4-1 timeout) (seconds 4)) + (spawn-projectile gun-blue-shot s4-1 (ppointer->process (-> gp-0 gun)) *default-dead-pool*) + ) + ) + ) + +;; definition for function fmod-2 +(defun fmod-2 ((arg0 float) (arg1 float)) + (- arg0 (* (the float (the int (/ arg0 arg1))) arg1)) + ) + +;; definition of type gun-blue-shot-3 +(deftype gun-blue-shot-3 (projectile) + ((hit-actor? symbol) + (start-pos vector :inline) + (track-mode uint64) + (random-travel-distance float) + ) + ) + +;; definition for method 3 of type gun-blue-shot-3 +(defmethod inspect ((this gun-blue-shot-3)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Ttrack-mode: ~D~%" (-> this track-mode)) + (format #t "~2Trandom-travel-distance: ~f~%" (-> this random-travel-distance)) + (label cfg-4) + this + ) + +;; definition of type dist-dot-val +(deftype dist-dot-val (structure) + ((dot float) + (dist float) + (current-dir-vec vector :inline) + (vec-to-target vector :inline) + ) + ) + +;; definition for method 3 of type dist-dot-val +(defmethod inspect ((this dist-dot-val)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'dist-dot-val) + (format #t "~1Tdot: ~f~%" (-> this dot)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tcurrent-dir-vec: #~%" (-> this current-dir-vec)) + (format #t "~1Tvec-to-target: #~%" (-> this vec-to-target)) + (label cfg-4) + this + ) + +;; definition for function get-dist-and-dot +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs object. +(defun get-dist-and-dot ((arg0 gun-blue-shot) (arg1 dist-dot-val)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg0 desired-target-pos quad)) + (let ((s5-0 (vector-normalize-copy! (-> arg1 current-dir-vec) (-> arg0 root transv) 1.0))) + (let ((a0-2 (-> arg1 vec-to-target))) + (vector-! a0-2 s4-0 (-> arg0 root trans)) + (set! (-> arg1 dist) (vector-normalize-ret-len! a0-2 1.0)) + ) + (set! (-> arg1 dot) (vector-dot s5-0 (-> arg1 vec-to-target))) + ) + ) + ) + +;; definition for function gun-blue-shot-3-move +;; INFO: Used lq/sq +(defun gun-blue-shot-3-move ((arg0 gun-blue-shot-3)) + (with-pp + (let ((v1-0 (-> arg0 track-mode))) + (cond + ((or (= v1-0 1) (zero? v1-0)) + (let ((s5-0 #f) + (a0-4 (the-as process #f)) + ) + (when (handle->process (-> arg0 desired-target)) + (let ((s4-0 (handle->process (-> arg0 desired-target)))) + (set! a0-4 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if a0-4 + (set! s5-0 #t) + ) + ) + (cond + (s5-0 + (let ((a0-9 (get-trans (the-as process-focusable a0-4) 3))) + (set! (-> arg0 desired-target-pos quad) (-> a0-9 quad)) + ) + ) + ((= (-> arg0 track-mode) 1) + (set! (-> arg0 track-mode) (the-as uint 2)) + ) + ) + ) + ) + ((= v1-0 2) + (if (< (vector-vector-distance-squared (-> arg0 root trans) (-> arg0 desired-target-pos)) 1073741800.0) + (set! (-> arg0 track-mode) (the-as uint 3)) + ) + ) + ) + ) + (when (zero? (-> arg0 track-mode)) + (let ((f0-1 (vector-vector-distance (-> arg0 start-pos) (-> arg0 root trans)))) + (cond + ((< (-> arg0 random-travel-distance) f0-1) + (set! (-> arg0 track-mode) (the-as uint 1)) + (set-time! (-> arg0 state-time)) + ) + (else + (when (< (vector-vector-distance (-> arg0 root trans) (-> arg0 desired-target-pos)) 40960.0) + (set! (-> arg0 track-mode) (the-as uint 1)) + (set-time! (-> arg0 state-time)) + ) + ) + ) + ) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + (let ((v1-40 (-> arg0 track-mode))) + (cond + ((zero? v1-40) + (let ((s5-1 (new 'stack-no-clear 'dist-dot-val))) + (get-dist-and-dot (the-as gun-blue-shot arg0) s5-1) + (let* ((f0-4 (* 0.5 (+ 1.0 (-> s5-1 dot)))) + (f0-5 (* f0-4 f0-4)) + ) + (vector-normalize! (-> arg0 root transv) (lerp 122880.0 409600.0 f0-5)) + ) + ) + (let ((s5-3 (-> arg0 child))) + (while s5-3 + (send-event (ppointer->process s5-3) 'notice 'add-crumb) + (set! s5-3 (-> s5-3 0 brother)) + ) + ) + ) + ((or (= v1-40 1) (= v1-40 2)) + (let ((s5-4 (new 'stack-no-clear 'vector))) + (set! (-> s5-4 quad) (-> arg0 root trans quad)) + (let ((f30-0 2.0) + (f24-0 65536.0) + ) + 327680.0 + 0.0 + (let* ((f28-0 (/ (the float (- (current-time) (-> pp clock old-frame-counter))) f30-0)) + (f26-0 f28-0) + ) + (dotimes (s4-2 (the int f30-0)) + (let ((s3-0 (new 'stack-no-clear 'dist-dot-val))) + (get-dist-and-dot (the-as gun-blue-shot arg0) s3-0) + (when (< (-> s3-0 dist) 49152.0) + (let ((f0-12 (* 0.000020345053 (-> s3-0 dist))) + (f24-1 (* 0.5 (+ 1.0 (-> s3-0 dot)))) + ) + (set! f24-0 (* (lerp 65536.0 131072.0 f0-12) (- 2.0 f24-1))) + ) + (when (and (= (-> arg0 track-mode) 1) (time-elapsed? (-> arg0 state-time) (seconds 1))) + (let ((f0-15 (* 1.3333334 (+ -0.75 (* 0.0033333334 (the float (- (current-time) (-> arg0 state-time)))))))) + (set! f24-0 (* f24-0 (lerp 1.0 2.0 f0-15))) + ) + ) + ) + (cond + ((< 0.99 (-> s3-0 dot)) + (set! (-> s3-0 current-dir-vec quad) (-> s3-0 vec-to-target quad)) + ) + (else + (let* ((s2-0 (new 'stack-no-clear 'vector)) + (f22-0 0.0) + (f0-19 (acos (-> s3-0 dot))) + (f22-1 (deg-seek f22-0 f0-19 (/ (* f24-0 (seconds-per-frame)) f30-0))) + ) + (vector-cross! s2-0 (-> s3-0 vec-to-target) (-> s3-0 current-dir-vec)) + (vector-normalize! s2-0 1.0) + (vector-rotate-around-axis! + (-> s3-0 current-dir-vec) + (the-as quaternion (-> s3-0 current-dir-vec)) + (* -1.0 f22-1) + s2-0 + ) + ) + ) + ) + (set! (-> arg0 root transv quad) (-> s3-0 current-dir-vec quad)) + (let* ((f0-26 (* 0.5 (+ 1.0 (-> s3-0 dot)))) + (f0-27 (* f0-26 f0-26)) + (f0-28 (lerp 122880.0 409600.0 f0-27)) + ) + (vector-normalize! (-> arg0 root transv) f0-28) + ) + ) + (let ((a1-27 (vector-float*! (new 'stack-no-clear 'vector) (-> arg0 root transv) (/ 1.0 f30-0)))) + (vector-v++! (-> arg0 root trans) a1-27) + ) + (let ((s3-1 (-> arg0 child))) + (while s3-1 + (send-event (ppointer->process s3-1) 'notice 'add-crumb-elapsed f26-0) + (set! s3-1 (-> s3-1 0 brother)) + ) + ) + (when (< (vector-vector-distance (-> arg0 root trans) (-> arg0 desired-target-pos)) 8192.0) + 0 + (goto cfg-70) + ) + (+! f26-0 f28-0) + ) + ) + ) + (label cfg-70) + (vector-! (-> arg0 root transv) (-> arg0 root trans) s5-4) + (set! (-> arg0 root trans quad) (-> s5-4 quad)) + ) + (vector-float*! (-> arg0 root transv) (-> arg0 root transv) (/ 1.0 (seconds-per-frame))) + ) + ) + ) + (projectile-move-fill-line-sphere arg0) + (none) + ) + ) + +;; definition of type light-trail-tracker-blue-3 +(deftype light-trail-tracker-blue-3 (light-trail-tracker-projectile) + () + ) + +;; definition for method 3 of type light-trail-tracker-blue-3 +(defmethod inspect ((this light-trail-tracker-blue-3)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type light-trail-tracker-projectile inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 17 of type light-trail-tracker-blue-3 +(defmethod light-trail-tracker-method-17 ((this light-trail-tracker-blue-3) (arg0 process-focusable)) + #f + ) + +;; failed to figure out what this is: +(if (or (zero? *blue-shot-trail*) (!= loading-level global)) + (set! *blue-shot-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* color-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* alpha-2-mode) (the-as uint 6)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* alpha-repeat-dist) 94208.0) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* base-width) 2048.0) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* width-repeat-dist) 12288.0) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* uv-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* uv-repeat-dist) 163840.0) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* max-age) (seconds 0.5)) + +;; failed to figure out what this is: +(if #f + (set! (-> *blue-shot-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *blue-shot-trail* tex-id) (the-as uint #x500f00)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-white*)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* alpha-curve-2) #f) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *blue-shot-trail* frame-stagger) (the-as uint 1)) + +;; definition for method 31 of type gun-blue-shot-3 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this gun-blue-shot-3)) + (+! (-> *game-info* shots-fired 2) 1.0) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) 327680.0) + (set! (-> this move) gun-blue-shot-3-move) + (set! (-> this timeout) (seconds 3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) 1.0) + (set! (-> this vehicle-damage-factor) 2.0) + (set! (-> this vehicle-impulse-factor) 2.0) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this track-mode) (the-as uint 0)) + (set! (-> this start-pos quad) (-> this root trans quad)) + (let* ((f30-0 12288.0) + (f28-0 28672.0) + (v1-16 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-17 (the-as number (logior #x3f800000 v1-16))) + ) + (set! (-> this random-travel-distance) (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-17))))) + ) + (let ((s5-0 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> s5-0 tracked-obj) (process->handle this)) + (set! (-> s5-0 appearance) *blue-shot-trail*) + (set! (-> s5-0 max-num-crumbs) (the int (* 0.2 (the float (-> s5-0 appearance max-age))))) + (set! (-> s5-0 track-immediately?) #t) + (let* ((v1-30 (estimate-light-trail-mem-usage + (the-as uint (-> s5-0 max-num-crumbs)) + (the-as uint (= (-> s5-0 appearance lie-mode) 3)) + ) + ) + (s4-0 (get-process *default-dead-pool* light-trail-tracker-blue-3 (+ v1-30 8192) 1)) + ) + (when s4-0 + (let ((t9-4 (method-of-type process activate))) + (t9-4 s4-0 this "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 light-trail-tracker-init-by-other s5-0) + (-> s4-0 ppointer) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type gun-blue-shot-3 +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-32 ((this gun-blue-shot-3)) + (if (not (do-fire-backcheck (-> this root trans) (-> this root transv))) + (go (method-of-object this impact)) + (call-parent-method this) + ) + 0 + (none) + ) + +;; definition for method 28 of type gun-blue-shot-3 +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this gun-blue-shot-3) (arg0 projectile-options)) + (case arg0 + (((projectile-options po0)) + (sound-play "blue-gun3-ricco" :position (-> this root trans)) + ) + ) + (none) + ) + +;; definition for method 25 of type gun-blue-shot-3 +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this gun-blue-shot-3)) + 0 + (none) + ) + +;; definition of type target-quality-info +(deftype target-quality-info (structure) + ((targ handle) + (value float) + ) + ) + +;; definition for method 3 of type target-quality-info +(defmethod inspect ((this target-quality-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'target-quality-info) + (format #t "~1Ttarg: ~D~%" (-> this targ)) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (label cfg-4) + this + ) + +;; definition for function gun-fire-blue-3 +;; INFO: Used lq/sq +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Stack slot offset 1300 signed mismatch +;; WARN: Return type mismatch (pointer process) vs object. +(defbehavior gun-fire-blue-3 target () + (local-vars + (sv-144 gun-info) + (sv-148 projectile-init-by-other-params) + (sv-1280 vector) + (sv-1284 (inline-array target-quality-info)) + (sv-1288 int) + (sv-1296 float) + (sv-1300 object) + ) + (set! sv-144 (-> self gun)) + (set! sv-148 (new 'stack-no-clear 'projectile-init-by-other-params)) + (draw-beam (-> *part-id-table* 364) (-> sv-144 fire-point) (-> sv-144 fire-dir-out) #f) + (set! sv-1280 (new 'stack-no-clear 'vector)) + (set! sv-1284 (new 'stack-no-clear 'inline-array 'target-quality-info 384)) + (set! sv-1288 0) + (set! sv-1296 (the-as float 0.0)) + (set! sv-1300 (send-event *target* 'get-vehicle)) + (set! (-> sv-1280 quad) (-> sv-144 fire-point quad)) + (set! (-> sv-1280 w) 163840.0) + (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s5-0 (fill-actor-list-for-box *actor-hash* (the-as bounding-box sv-1280) gp-0 384)) + (let* ((s4-0 (-> gp-0 s5-0)) + (v1-16 (if (type? s4-0 collide-shape) + s4-0 + ) + ) + ) + (when v1-16 + (let* ((s3-0 (-> v1-16 process)) + (s4-1 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s4-1 + (when (and (!= *target* s4-1) + (!= sv-1300 s4-1) + (not (focus-test? (the-as process-focusable s4-1) disable dead inactive gun-no-target)) + (or (logtest? (process-mask crate enemy vehicle civilian) (-> s4-1 mask)) + (and (logtest? (process-mask guard) (-> s4-1 mask)) (-> *setting-control* user-current gun-target-guards?)) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s3-1 start-pos) (-> sv-144 fire-point) (-> sv-144 fire-dir-out) 40960.0) + (+! (-> s3-1 start-pos y) 24576.0) + (vector-! (-> s3-1 move-dist) (get-trans (the-as process-focusable s4-1) 3) (-> sv-144 fire-point)) + (let ((v1-32 s3-1)) + (set! (-> v1-32 radius) 40.96) + (set! (-> v1-32 collide-with) (collide-spec backgnd)) + (set! (-> v1-32 ignore-process0) #f) + (set! (-> v1-32 ignore-process1) #f) + (set! (-> v1-32 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-32 action-mask) (collide-action solid)) + ) + (when (< (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) + (let ((s3-3 + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s4-1) 3) (-> self control trans)) + ) + ) + (vector-normalize! s3-3 1.0) + (when (< (-> s3-3 y) 0.5) + (set! (-> sv-1284 sv-1288 targ) (process->handle s4-1)) + (let ((f30-0 1.0)) + (if (and (nonzero? (-> s4-1 draw)) (logtest? (-> s4-1 draw status) (draw-control-status on-screen))) + (set! f30-0 (+ 2.0 f30-0)) + ) + (if (< (vector-vector-xz-distance-squared (-> sv-144 fire-point) (get-trans (the-as process-focusable s4-1) 3)) + 2415919000.0 + ) + (set! f30-0 (+ 4.0 f30-0)) + ) + (if (logtest? (process-mask enemy guard) (-> s4-1 mask)) + (set! f30-0 (+ 28.0 f30-0)) + ) + (if (logtest? (process-mask vehicle civilian) (-> s4-1 mask)) + (set! f30-0 (* 0.25 f30-0)) + ) + (set! (-> sv-1284 sv-1288 value) f30-0) + (set! sv-1296 (+ sv-1296 f30-0)) + ) + (set! sv-1288 (+ sv-1288 1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s5-1 *target*) + (gp-1 (if (type? s5-1 process-focusable) + s5-1 + ) + ) + ) + (when (and gp-1 (< (vector-vector-distance (get-trans gp-1 0) sv-1280) (-> sv-1280 w))) + (when (and (!= *target* gp-1) + (!= sv-1300 gp-1) + (not (focus-test? gp-1 disable dead inactive gun-no-target)) + (or (logtest? (process-mask crate enemy vehicle civilian) (-> gp-1 mask)) + (and (logtest? (process-mask guard) (-> gp-1 mask)) (-> *setting-control* user-current gun-target-guards?)) + ) + ) + (let ((s5-3 (new 'stack-no-clear 'collide-query))) + (vector+float*! (-> s5-3 start-pos) (-> sv-144 fire-point) (-> sv-144 fire-dir-out) 40960.0) + (+! (-> s5-3 start-pos y) 24576.0) + (vector-! (-> s5-3 move-dist) (get-trans gp-1 3) (-> sv-144 fire-point)) + (let ((v1-91 s5-3)) + (set! (-> v1-91 radius) 40.96) + (set! (-> v1-91 collide-with) (collide-spec backgnd)) + (set! (-> v1-91 ignore-process0) #f) + (set! (-> v1-91 ignore-process1) #f) + (set! (-> v1-91 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-91 action-mask) (collide-action solid)) + ) + (when (< (fill-and-probe-using-line-sphere *collide-cache* s5-3) 0.0) + (let ((s5-5 (vector-! (new 'stack-no-clear 'vector) (get-trans gp-1 3) (-> self control trans)))) + (vector-normalize! s5-5 1.0) + (when (< (-> s5-5 y) 0.5) + (set! (-> sv-1284 sv-1288 targ) (process->handle gp-1)) + (let ((f30-1 1.0)) + (if (and (nonzero? (-> gp-1 draw)) (logtest? (-> gp-1 draw status) (draw-control-status on-screen))) + (set! f30-1 (+ 2.0 f30-1)) + ) + (if (< (vector-vector-xz-distance-squared (-> sv-144 fire-point) (get-trans gp-1 3)) 2415919000.0) + (set! f30-1 (+ 4.0 f30-1)) + ) + (if (logtest? (process-mask enemy guard) (-> gp-1 mask)) + (set! f30-1 (+ 28.0 f30-1)) + ) + (if (logtest? (process-mask vehicle civilian) (-> gp-1 mask)) + (set! f30-1 (* 0.25 f30-1)) + ) + (set! (-> sv-1284 sv-1288 value) f30-1) + (set! sv-1296 (+ sv-1296 f30-1)) + ) + (set! sv-1288 (+ sv-1288 1)) + ) + ) + ) + ) + ) + ) + ) + (let* ((v1-132 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-133 (the-as number (logior #x3f800000 v1-132))) + (f0-32 (* (+ -1.0 (the-as float v1-133)) sv-1296)) + (s5-7 (the-as process #f)) + ) + (let ((f1-11 0.0) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (dotimes (v1-136 sv-1288) + (+! f1-11 (-> sv-1284 v1-136 value)) + (when (< f0-32 f1-11) + (set! s5-7 (handle->process (-> sv-1284 v1-136 targ))) + 0 + (goto cfg-91) + ) + ) + (label cfg-91) + (let ((s4-5 (new 'stack-no-clear 'vector))) + (let ((s3-5 s4-5)) + (let* ((f30-2 -1.0) + (f28-0 2.0) + (v1-148 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-149 (the-as number (logior #x3f800000 v1-148))) + ) + (set! (-> s3-5 x) (+ f30-2 (* f28-0 (+ -1.0 (the-as float v1-149))))) + ) + (let* ((f30-3 -0.2) + (f28-1 0.7) + (v1-154 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-155 (the-as number (logior #x3f800000 v1-154))) + ) + (set! (-> s3-5 y) (+ f30-3 (* f28-1 (+ -1.0 (the-as float v1-155))))) + ) + (let* ((f30-4 -1.0) + (f28-2 2.0) + (v1-160 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-161 (the-as number (logior #x3f800000 v1-160))) + ) + (set! (-> s3-5 z) (+ f30-4 (* f28-2 (+ -1.0 (the-as float v1-161))))) + ) + (set! (-> s3-5 w) 1.0) + ) + (vector-normalize! s4-5 163840.0) + (vector+! gp-2 (-> sv-144 fire-point) s4-5) + ) + (let ((s4-6 (new 'stack-no-clear 'vector))) + (set! (-> s4-6 quad) (-> gp-2 quad)) + (when s5-7 + (let ((s3-6 s4-6) + (s2-3 s5-7) + ) + (set! (-> s3-6 quad) (-> (get-trans + (the-as process-focusable (if (type? s2-3 process-focusable) + (the-as process-focusable s2-3) + ) + ) + 3 + ) + quad + ) + ) + ) + ) + (let ((s3-7 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> sv-144 fire-dir-out) 2730.6667)) + (v1-174 (vector-rotate-y! (new 'stack-no-clear 'vector) (-> sv-144 fire-dir-out) -2730.6667)) + (a0-114 (vector-! (new 'stack-no-clear 'vector) s4-6 (-> sv-144 fire-point))) + (s4-7 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-dot s3-7 a0-114) (vector-dot v1-174 a0-114)) + (set! (-> s4-7 quad) (-> s3-7 quad)) + (set! (-> s4-7 quad) (-> v1-174 quad)) + ) + (vector-normalize! a0-114 1.0) + (let* ((s3-8 vector-rotate-y!) + (s2-4 s4-7) + (s1-0 s4-7) + (f30-5 -2730.6667) + (f28-3 5461.3335) + (v1-180 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-181 (the-as number (logior #x3f800000 v1-180))) + ) + (s3-8 s2-4 s1-0 (+ f30-5 (* f28-3 (+ -1.0 (the-as float v1-181))))) + ) + (let* ((f30-6 -0.1) + (f28-4 0.5) + (v1-186 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-187 (the-as number (logior #x3f800000 v1-186))) + ) + (set! (-> s4-7 y) (+ f30-6 (* f28-4 (+ -1.0 (the-as float v1-187))) (-> s4-7 y))) + ) + (vector-normalize! s4-7 1.0) + (set! (-> sv-148 ent) (-> self entity)) + (set! (-> sv-148 charge) 1.0) + (set! (-> sv-148 options) (projectile-options)) + (logclear! (-> sv-148 options) (projectile-options po14 po15 po16)) + (set! (-> sv-148 pos quad) (-> sv-144 fire-point quad)) + (set! (-> sv-148 notify-handle) (the-as handle #f)) + (set! (-> sv-148 owner-handle) (the-as handle #f)) + (set! (-> sv-148 target-handle) (process->handle s5-7)) + (set! (-> sv-148 target-pos quad) (-> gp-2 quad)) + (set! (-> sv-148 ignore-handle) (process->handle (send-event self 'get-vehicle))) + (let* ((v1-209 *game-info*) + (a0-143 (+ (-> v1-209 attack-id) 1)) + ) + (set! (-> v1-209 attack-id) a0-143) + (set! (-> sv-148 attack-id) a0-143) + ) + (set! (-> sv-148 timeout) (seconds 4)) + (vector-float*! (-> sv-148 vel) s4-7 327680.0) + ) + ) + ) + ) + (spawn-projectile gun-blue-shot-3 sv-148 (ppointer->process (-> sv-144 gun)) *default-dead-pool*) + ) + +;; definition for function draw-beam-segment +;; WARN: Return type mismatch symbol vs none. +(defun draw-beam-segment () + (none) + ) + +;; definition for symbol *found-objects*, type (pointer handle) +(define *found-objects* (the-as (pointer handle) (malloc 'global 112))) + +;; definition for symbol *gun-blue-2-last-attack-id*, type uint +(define *gun-blue-2-last-attack-id* (the-as uint 0)) + +;; definition of type timeframe-wrapper +(deftype timeframe-wrapper (structure) + ((time time-frame) + ) + ) + +;; definition for method 3 of type timeframe-wrapper +(defmethod inspect ((this timeframe-wrapper)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'timeframe-wrapper) + (format #t "~1Ttime: ~D~%" (-> this time)) + (label cfg-4) + this + ) + +;; definition for symbol *gun-blue-2-last-attack-id-time*, type timeframe-wrapper +(define *gun-blue-2-last-attack-id-time* (new 'static 'timeframe-wrapper)) + +;; definition for function fire-projectile-if-necessary +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer gun-blue-shot-2). +(defun fire-projectile-if-necessary ((arg0 vector) (arg1 vector) (arg2 handle)) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (s3-0 #f) + ) + (vector-! (-> s5-0 move-dist) arg1 arg0) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-float*! (-> s5-0 move-dist) (-> s5-0 move-dist) 2.0) + (let ((v1-5 s5-0)) + (set! (-> v1-5 radius) 12288.0) + (set! (-> v1-5 collide-with) (collide-spec crate civilian enemy obstacle vehicle-sphere hit-by-others-list)) + (set! (-> v1-5 ignore-process0) (handle->process arg2)) + (set! (-> v1-5 ignore-process1) #f) + (set! (-> v1-5 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-5 action-mask) (collide-action solid)) + ) + (let ((f0-2 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (if (and (< f0-2 1.0) (!= f0-2 -100000000.0)) + (set! s3-0 #t) + ) + ) + (the-as + (pointer gun-blue-shot-2) + (when s3-0 + (when (>= (- (-> *display* game-clock frame-counter) (-> *gun-blue-2-last-attack-id-time* time)) (seconds 0.4)) + (let* ((v1-19 *game-info*) + (a0-16 (+ (-> v1-19 attack-id) 1)) + ) + (set! (-> v1-19 attack-id) a0-16) + (set! *gun-blue-2-last-attack-id* a0-16) + ) + (set! (-> *gun-blue-2-last-attack-id-time* time) (-> *display* game-clock frame-counter)) + ) + (let ((a1-8 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> a1-8 ent) (-> *target* entity)) + (set! (-> a1-8 charge) 1.0) + (set! (-> a1-8 options) (projectile-options)) + (logclear! (-> a1-8 options) (projectile-options po14 po15 po16)) + (set! (-> a1-8 pos quad) (-> arg0 quad)) + (set! (-> a1-8 vel quad) + (-> (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) (/ 2.0 (seconds-per-frame))) quad) + ) + (set! (-> a1-8 notify-handle) (the-as handle #f)) + (set! (-> a1-8 owner-handle) (process->handle *target*)) + (set! (-> a1-8 target-handle) (the-as handle #f)) + (set! (-> a1-8 target-pos quad) (the-as uint128 0)) + (set! (-> a1-8 ignore-handle) (ppointer->handle (-> arg2 process))) + (set! (-> a1-8 attack-id) *gun-blue-2-last-attack-id*) + (set! (-> a1-8 timeout) (seconds 4)) + (spawn-projectile gun-blue-shot-2 a1-8 (ppointer->process (-> *target* gun gun)) *default-dead-pool*) + ) + ) + ) + ) + ) + +;; definition of type gun-blue-2-lightning-info +(deftype gun-blue-2-lightning-info (structure) + ((pts vector 32 :inline) + (num-pts int8) + (should-draw-terminal-sparks? symbol) + (terminal-spark-pos vector :inline) + (should-draw-extension? symbol) + (extension-end-point vector :inline) + ) + ) + +;; definition for method 3 of type gun-blue-2-lightning-info +(defmethod inspect ((this gun-blue-2-lightning-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gun-blue-2-lightning-info) + (format #t "~1Tpts[32] @ #x~X~%" (-> this pts)) + (format #t "~1Tnum-pts: ~D~%" (-> this num-pts)) + (format #t "~1Tshould-draw-terminal-sparks?: ~A~%" (-> this should-draw-terminal-sparks?)) + (format #t "~1Tterminal-spark-pos: #~%" (-> this terminal-spark-pos)) + (format #t "~1Tshould-draw-extension?: ~A~%" (-> this should-draw-extension?)) + (format #t "~1Textension-end-point: #~%" (-> this extension-end-point)) + (label cfg-4) + this + ) + +;; definition of type gun-blue-lightning-command +(deftype gun-blue-lightning-command (structure) + ((msg gun-blue-lightning-cmd-msg) + (lightning-info gun-blue-2-lightning-info :inline) + ) + ) + +;; definition for method 3 of type gun-blue-lightning-command +(defmethod inspect ((this gun-blue-lightning-command)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gun-blue-lightning-command) + (format #t "~1Tmsg: ~D~%" (-> this msg)) + (format #t "~1Tlightning-info: #~%" (-> this lightning-info)) + (label cfg-4) + this + ) + +;; definition of type gun-blue-2-lightning-tracker +(deftype gun-blue-2-lightning-tracker (process-drawable) + ((lt-array (array lightning-bolt)) + (should-draw-this-frame? symbol) + (last-spark-time time-frame :offset 216) + (spark-time-interval time-frame) + (last-deduct-ammo-time time-frame) + (snd-lightning sound-id) + (active-enter-time time-frame) + (revolve-angle float) + (sway-angle float) + (snd-spin sound-id) + (spin-intensity float) + (prev-targ-pos vector :inline) + (last-probe-index int16) + ) + (:state-methods + active + inactive + die + test + ) + (:methods + (setup-draw! (_type_ gun-blue-2-lightning-info) none) + (gun-blue-2-lightning-tracker-method-25 (_type_) object) + (gun-blue-2-lightning-tracker-method-26 (_type_ vector vector gun-blue-lightning-command) symbol) + ) + ) + +;; definition for method 3 of type gun-blue-2-lightning-tracker +(defmethod inspect ((this gun-blue-2-lightning-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tlt-array: ~A~%" (-> this lt-array)) + (format #t "~2Tshould-draw-this-frame?: ~A~%" (-> this should-draw-this-frame?)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tlast-spark-time: ~D~%" (-> this last-spark-time)) + (format #t "~2Tspark-time-interval: ~D~%" (-> this spark-time-interval)) + (format #t "~2Tlast-deduct-ammo-time: ~D~%" (-> this last-deduct-ammo-time)) + (format #t "~2Tsnd-lightning: ~D~%" (-> this snd-lightning)) + (format #t "~2Tactive-enter-time: ~D~%" (-> this active-enter-time)) + (format #t "~2Trevolve-angle: ~f~%" (-> this revolve-angle)) + (format #t "~2Tsway-angle: ~f~%" (-> this sway-angle)) + (format #t "~2Tsnd-spin: ~D~%" (-> this snd-spin)) + (format #t "~2Tspin-intensity: ~f~%" (-> this spin-intensity)) + (format #t "~2Tprev-targ-pos: #~%" (-> this prev-targ-pos)) + (format #t "~2Tlast-probe-index: ~D~%" (-> this last-probe-index)) + (label cfg-4) + this + ) + +;; definition for method 10 of type gun-blue-2-lightning-tracker +(defmethod deactivate ((this gun-blue-2-lightning-tracker)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this snd-spin)) + (sound-stop (-> this snd-lightning)) + (call-parent-method this) + (none) + ) + +;; definition of type gun-blue-2-target-info +(deftype gun-blue-2-target-info (structure) + ((target handle) + (start-time time-frame) + ) + ) + +;; definition for method 3 of type gun-blue-2-target-info +(defmethod inspect ((this gun-blue-2-target-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gun-blue-2-target-info) + (format #t "~1Ttarget: ~D~%" (-> this target)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(if (zero? *gun-blue-2-targets*) + (set! *gun-blue-2-targets* (the-as (inline-array gun-blue-2-target-info) (malloc 'global 192))) + ) + +;; definition of type constraint-knot +(deftype constraint-knot (structure) + ((pt vector :inline) + (dir vector :inline) + (length float) + ) + ) + +;; definition for method 3 of type constraint-knot +(defmethod inspect ((this constraint-knot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'constraint-knot) + (format #t "~1Tpt: #~%" (-> this pt)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tlength: ~f~%" (-> this length)) + (label cfg-4) + this + ) + +;; definition of type rope-constraint +(deftype rope-constraint (structure) + ((constraints constraint-knot 12 :inline) + (num-knots uint8) + ) + (:methods + (rope-constraint-method-9 (_type_ int) symbol) + ) + ) + +;; definition for method 3 of type rope-constraint +(defmethod inspect ((this rope-constraint)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'rope-constraint) + (format #t "~1Tconstraints[12] @ #x~X~%" (-> this constraints)) + (format #t "~1Tnum-knots: ~D~%" (-> this num-knots)) + (label cfg-4) + this + ) + +;; definition for method 9 of type rope-constraint +;; INFO: Used lq/sq +(defmethod rope-constraint-method-9 ((this rope-constraint) (arg0 int)) + (local-vars (sv-64 vector) (sv-80 vector) (sv-96 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 arg0) + (s3-0 (+ (-> this num-knots) -2)) + ) + (while (>= (the-as int s3-0) s4-0) + (dotimes (s2-0 1) + (set! sv-64 (the-as vector (+ (the-as uint (-> this constraints 0 dir)) (* 48 s4-0)))) + (let ((s1-0 (-> this constraints s4-0)) + (s0-0 (-> this constraints (+ s4-0 1))) + ) + (set! sv-96 (new 'stack-no-clear 'vector)) + (let ((v1-6 s0-0) + (a0-7 s1-0) + ) + (.lvf vf4 (&-> v1-6 pt quad)) + (.lvf vf5 (&-> a0-7 pt quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-96 quad) vf6) + 0.0 + (let ((f30-0 (vector-normalize-ret-len! sv-96 1.0))) + (vector-normalize! sv-64 1.0) + (let ((f0-2 (vector-dot sv-96 sv-64))) + (when (< f0-2 0.9999) + (set! sv-80 (new 'stack-no-clear 'vector)) + 0.0 + (let* ((f28-0 (acos f0-2)) + (f0-4 (* 0.000030517578 f28-0)) + ) + 0.0 + 0.0 + (- 32768.0 f28-0) + (let* ((f0-6 (fmax 0.0 (fmin 1.0 f0-4))) + (f0-7 (* f0-6 f0-6)) + (f28-1 + (fmin (fmin f28-0 (* (lerp 5461.3335 2184533.2 f0-7) (seconds-per-frame))) (* 131072.0 (seconds-per-frame))) + ) + ) + (let ((v1-20 sv-80)) + (.lvf vf1 (&-> sv-96 quad)) + (.lvf vf2 (&-> sv-64 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> v1-20 quad) vf3) + ) + (vector-normalize! sv-80 1.0) + (vector-rotate-around-axis! sv-96 (the-as quaternion sv-96) f28-1 sv-80) + ) + ) + (vector-normalize! sv-96 1.0) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> this constraints 0 dir)) (* 48 (+ s4-0 1))))) + (-> sv-96 quad) + ) + (vector+float*! (the-as vector s0-0) (the-as vector s1-0) sv-96 f30-0) + ) + ) + ) + ) + ) + (+! s4-0 1) + ) + ) + (let ((s4-1 (+ (-> this num-knots) -2))) + (while (>= (the-as int s4-1) arg0) + (+ (the-as uint (-> this constraints 0 dir)) (* 48 arg0)) + (let* ((s3-1 (-> this constraints arg0)) + (s2-1 (-> this constraints (+ arg0 1))) + (s1-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector s2-1) (the-as vector s3-1))) + ) + 0.0 + (vector-normalize-ret-len! s1-2 1.0) + (vector+float*! (the-as vector s2-1) (the-as vector s3-1) s1-2 (-> this constraints arg0 length)) + ) + (+! arg0 1) + ) + ) + #f + ) + ) + +;; definition for symbol *blue-2-lightning-shape*, type rope-constraint +(define *blue-2-lightning-shape* (new 'static 'rope-constraint)) + +;; failed to figure out what this is: +(defstate die (gun-blue-2-lightning-tracker) + :virtual #t + :code (behavior () + '() + ) + ) + +;; failed to figure out what this is: +(defstate inactive (gun-blue-2-lightning-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun-blue-lightning) + (when (= (-> (the-as gun-blue-lightning-command (-> block param 0)) msg) (gun-blue-lightning-cmd-msg active)) + (if (= (-> *target* gun using-gun-type) (pickup-type gun-blue-2)) + (go-virtual active) + ) + ) + ) + (('notice) + (case (-> block param 0) + (('die) + (go-virtual die) + ) + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (if (not (and (-> self next-state) (= (-> self next-state name) 'active))) + (sound-stop (-> self snd-spin)) + ) + ) + :trans (behavior () + (if (not (time-elapsed? (-> self state-time) (seconds 0.2))) + (sound-play-by-name + (static-sound-name "blue-gun2-loop") + (-> self snd-lightning) + 768 + (the int (* 1524.0 (lerp 0.0 -0.5 (* 0.016666668 (the float (- (current-time) (-> self state-time))))))) + 0 + (sound-group) + #t + ) + (sound-stop (-> self snd-lightning)) + ) + (let ((f0-6 (lerp-scale-clamp 0.0 1.0 (-> *target* gun fire-spinv) 0.0 218453.33))) + 0.0 + (seek! (-> self spin-intensity) f0-6 (* 2.0 (seconds-per-frame))) + ) + (if (< 0.001 (-> self spin-intensity)) + (sound-play-by-name + (static-sound-name "blue-gun2-spin") + (-> self snd-spin) + (the int (* 1024.0 (lerp 0.3 1.0 (-> self spin-intensity)))) + (the int (* 1524.0 (lerp -0.5 0.0 (-> self spin-intensity)))) + 0 + (sound-group) + #t + ) + (sound-stop (-> self snd-spin)) + ) + (if (!= (lightning-bolt-method-14 (-> self lt-array 0)) 3) + (gun-blue-2-lightning-tracker-method-25 self) + ) + (dotimes (gp-3 (-> self lt-array length)) + (let ((s5-2 (-> self lt-array gp-3))) + (lightning-bolt-method-11 s5-2) + (lightning-bolt-method-12 s5-2) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 8)) + (go-virtual die) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(when (or (zero? *uv-loop-curve*) (!= loading-level global)) + (set! *uv-loop-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *uv-loop-curve* 2 'loading-level (the-as int #t)) + ) + +;; failed to figure out what this is: +(set! (-> *uv-loop-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *uv-loop-curve* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *uv-loop-curve* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *uv-loop-curve* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(if (or (zero? *blue-light-test*) (!= loading-level global)) + (set! *blue-light-test* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* tex-id) (the-as uint #x408f00)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* alpha-1-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* alpha-1-repeat-dist) 262144.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* width-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* width-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* regenerate-time-start) (seconds 0.167)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* regenerate-time-end) (seconds 0.25)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* width-range-start) 1228.8) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* width-range-end) 2048.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* fade-time) (seconds 0.3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* uv-shift?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* uv-shift-speed) (seconds -0.5)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test* use-accurate-interp?) #t) + +;; failed to figure out what this is: +(if (or (zero? *blue-light-test-end*) (!= loading-level global)) + (set! *blue-light-test-end* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* tex-id) (the-as uint #x408f00)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* alpha-1-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* alpha-1-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* alpha-1-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* width-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* width-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* regenerate-time-start) (seconds 0.085)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* regenerate-time-end) (seconds 0.117)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* width-range-start) 5324.8) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* width-range-end) 6144.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* fade-time) (seconds 0.3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* uv-shift?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* uv-shift-speed) (seconds -0.5)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-end* use-accurate-interp?) #t) + +;; failed to figure out what this is: +(if (or (zero? *blue-light-test-big*) (!= loading-level global)) + (set! *blue-light-test-big* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* tex-id) (the-as uint #x403f00)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* alpha-1-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* alpha-1-repeat-dist) 262144.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* width-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* width-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* regenerate-time-start) (seconds 0.035)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* regenerate-time-end) (seconds 0.067)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* width-range-start) 8192.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* width-range-end) 8192.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* fade-time) (seconds 0.3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* uv-shift?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* uv-shift-speed) (seconds -0.5)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big* use-accurate-interp?) #t) + +;; failed to figure out what this is: +(if (or (zero? *blue-light-test-big-intense*) (!= loading-level global)) + (set! *blue-light-test-big-intense* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* base-alpha) 0.7) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* tex-id) (the-as uint #x403f00)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* alpha-1-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* alpha-1-repeat-dist) 409600.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* width-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* width-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* regenerate-time-start) (seconds 0.035)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* regenerate-time-end) (seconds 0.067)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* width-range-start) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* width-range-end) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* fade-time) (seconds 0.3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* uv-shift?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* uv-shift-speed) (seconds -0.5)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-big-intense* use-accurate-interp?) #t) + +;; failed to figure out what this is: +(if (or (zero? *blue-light-test-small-fade*) (!= loading-level global)) + (set! *blue-light-test-small-fade* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* tex-id) (the-as uint #x408f00)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* alpha-1-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* alpha-1-repeat-dist) 409600.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* width-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* width-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* regenerate-time-start) (seconds 0.167)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* regenerate-time-end) (seconds 0.25)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* width-range-start) 32768.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* width-range-end) 32768.0) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* fade-time) (seconds 0.3)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* uv-shift?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* uv-shift-speed) (seconds -0.5)) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *blue-light-test-small-fade* use-accurate-interp?) #t) + +;; definition for method 24 of type gun-blue-2-lightning-tracker +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod setup-draw! ((this gun-blue-2-lightning-tracker) (arg0 gun-blue-2-lightning-info)) + (cond + ((-> arg0 should-draw-extension?) + (set! (-> *blue-light-test-big* alpha-1-repeat-dist) 262144.0) + (set! (-> *blue-light-test* alpha-1-repeat-dist) 262144.0) + ) + ((> (-> arg0 num-pts) 0) + (let* ((f0-2 (vector-vector-distance (the-as vector (-> arg0 pts)) (-> arg0 pts (+ (-> arg0 num-pts) -1)))) + (f0-3 (+ 16384.0 f0-2)) + ) + (set! (-> *blue-light-test-big* alpha-1-repeat-dist) (fmin 262144.0 f0-3)) + (set! (-> *blue-light-test* alpha-1-repeat-dist) (fmin 262144.0 f0-3)) + ) + ) + ) + (dotimes (s4-0 4) + (let ((s3-0 (-> this lt-array s4-0))) + (set! (-> s3-0 inner-point-travel-time) (seconds 0.5)) + (set! (-> s3-0 snap-inner-points?) #t) + (set! (-> s3-0 appearance) *blue-light-test*) + (set! (-> s3-0 fractal-reduction) (/ (* 0.4 (logf 9.0)) (logf 12.0))) + (set! (-> s3-0 generate-mode) (the-as uint 1)) + (when (< 1 (-> arg0 num-pts)) + ) + (set! (-> s3-0 num-active-spans) (+ (-> arg0 num-pts) -1)) + (dotimes (v1-31 (-> s3-0 num-active-spans)) + (let ((a0-8 (-> s3-0 spans data v1-31))) + (let ((a1-5 (-> s3-0 spans-internal data v1-31))) + (set! (-> s3-0 span-pts-start data v1-31 quad) (-> arg0 pts v1-31 quad)) + (set! (-> a0-8 random-offset-size-start) 0.0) + (if (> v1-31 0) + (set! (-> a0-8 random-offset-size-start) 8192.0) + ) + (set! (-> a1-5 num-inner-points) 4) + ) + (set! (-> a0-8 inner-random-offset-size) 8192.0) + ) + ) + (let ((v1-37 (-> s3-0 spans data (-> s3-0 num-active-spans)))) + (set! (-> s3-0 span-pts-start data (-> s3-0 num-active-spans) quad) + (-> arg0 pts (-> s3-0 num-active-spans) quad) + ) + (set! (-> v1-37 random-offset-size-start) 0.0) + ) + (lightning-bolt-method-11 s3-0) + (lightning-bolt-method-12 s3-0) + ) + ) + (dotimes (s4-1 2) + (let ((s3-1 (-> this lt-array (+ s4-1 4)))) + (set! (-> s3-1 inner-point-travel-time) (seconds 0.085)) + (set! (-> s3-1 snap-inner-points?) #t) + (set! (-> s3-1 appearance) *blue-light-test-big*) + (set! (-> s3-1 fractal-reduction) (/ (* 0.4 (logf 9.0)) (logf 12.0))) + (set! (-> s3-1 generate-mode) (the-as uint 1)) + (when (< 1 (-> arg0 num-pts)) + ) + (set! (-> s3-1 num-active-spans) (+ (-> arg0 num-pts) -1)) + (dotimes (v1-58 (-> s3-1 num-active-spans)) + (let ((a0-24 (-> s3-1 spans data v1-58))) + (let ((a1-16 (-> s3-1 spans-internal data v1-58))) + (set! (-> s3-1 span-pts-start data v1-58 quad) (-> arg0 pts v1-58 quad)) + (set! (-> a0-24 random-offset-size-start) 0.0) + (if (> v1-58 0) + (set! (-> a0-24 random-offset-size-start) 4096.0) + ) + (set! (-> a1-16 num-inner-points) 3) + ) + (set! (-> a0-24 inner-random-offset-size) 4096.0) + ) + ) + (let ((v1-64 (-> s3-1 spans data (-> s3-1 num-active-spans)))) + (set! (-> s3-1 span-pts-start data (-> s3-1 num-active-spans) quad) + (-> arg0 pts (-> s3-1 num-active-spans) quad) + ) + (set! (-> v1-64 random-offset-size-start) 0.0) + ) + (lightning-bolt-method-11 s3-1) + (lightning-bolt-method-12 s3-1) + ) + ) + (set! (-> this root trans quad) (-> arg0 pts (+ (-> arg0 num-pts) -1) quad)) + (when (-> arg0 should-draw-terminal-sparks?) + (when (time-elapsed? (-> this last-spark-time) (-> this spark-time-interval)) + (set-time! (-> this last-spark-time)) + (set! (-> this spark-time-interval) + (the-as + time-frame + (the int (* 5.0000005 (the float (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 3)))) + ) + ) + (let ((s4-2 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 3) 3))) + (let ((v1-90 (-> this lt-array 5))) + (-> v1-90 spans data (-> v1-90 num-active-spans)) + (set! (-> arg0 terminal-spark-pos quad) (-> v1-90 span-pts-start data (-> v1-90 num-active-spans) quad)) + ) + (set! (-> this root trans quad) (-> arg0 terminal-spark-pos quad)) + (dotimes (s5-1 s4-2) + (process-drawable-shock-effect-replace + this + (-> *lightning-spec-id-table* 13) + lightning-probe-callback + 256 + 0 + 40960.0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (gun-blue-2-lightning-tracker) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notice) + (case (-> block param 0) + (('die) + (go-virtual die) + ) + ) + ) + (('gun-blue-lightning) + (case (-> (the-as gun-blue-lightning-command (-> block param 0)) msg) + (((gun-blue-lightning-cmd-msg inactive)) + (go-virtual inactive) + ) + ) + #t + ) + ) + ) + :enter (behavior () + (set! (-> self prev-targ-pos quad) (-> (target-pos 0) quad)) + (set-time! (-> self state-time)) + (set-time! (-> self active-enter-time)) + (set-time! (-> self last-deduct-ammo-time)) + (dotimes (gp-1 (-> self lt-array length)) + (lightning-bolt-method-13 (-> self lt-array gp-1) 0) + ) + (set! (-> *blue-2-lightning-shape* num-knots) (the-as uint 12)) + (let ((v1-17 (new 'stack-no-clear 'vector))) + (set! (-> v1-17 quad) (-> *target* gun fire-point quad)) + (let ((a0-9 (vector-float*! (new 'stack-no-clear 'vector) (-> *target* gun laser-dir) 24576.0))) + (dotimes (a1-4 (the-as int (-> *blue-2-lightning-shape* num-knots))) + (set! (-> *blue-2-lightning-shape* constraints a1-4 pt quad) (-> v1-17 quad)) + (set! (-> (the-as (pointer uint128) (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 a1-4)))) + (-> *target* gun laser-dir quad) + ) + (vector+! v1-17 v1-17 a0-9) + (set! (-> *blue-2-lightning-shape* constraints a1-4 length) 24576.0) + ) + ) + ) + (adjust-player-ammo -1.0 (pickup-type ammo-blue)) + (dotimes (v1-20 12) + (set! (-> *gun-blue-2-targets* v1-20 target) (the-as handle #f)) + (set! (-> *gun-blue-2-targets* v1-20 start-time) 0) + ) + (when (or (>= (- (-> *display* game-clock frame-counter) (-> *gun-blue-2-last-attack-id-time* time)) (seconds 0.4)) + (< (-> *display* game-clock frame-counter) (-> *gun-blue-2-last-attack-id-time* time)) + ) + (let* ((v1-31 *game-info*) + (a0-21 (+ (-> v1-31 attack-id) 1)) + ) + (set! (-> v1-31 attack-id) a0-21) + (set! *gun-blue-2-last-attack-id* a0-21) + ) + (set! (-> *gun-blue-2-last-attack-id-time* time) (-> *display* game-clock frame-counter)) + ) + ) + :exit (behavior () + (kill-particles (-> self part)) + (dotimes (gp-0 (-> self lt-array length)) + (let ((s5-0 (-> self lt-array gp-0))) + (when (zero? (lightning-bolt-method-14 s5-0)) + (lightning-bolt-method-13 s5-0 2) + (lightning-bolt-method-11 s5-0) + (lightning-bolt-method-12 s5-0) + ) + ) + ) + ) + :trans (behavior () + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 76 (seconds 0.5)) + (if (not (time-elapsed? (-> self active-enter-time) (seconds 0.2))) + (sound-play-by-name + (static-sound-name "blue-gun2-loop") + (-> self snd-lightning) + 768 + (the int (* 1524.0 (lerp -0.5 0.0 (* 0.016666668 (the float (- (current-time) (-> self state-time))))))) + 0 + (sound-group) + #t + ) + (sound-play "blue-gun2-loop" :id (-> self snd-lightning) :vol 75) + ) + (let ((f0-6 (lerp-scale-clamp 0.0 1.0 (-> *target* gun fire-spinv) 0.0 109226.664))) + 0.0 + (let ((f0-9 (- 1.0 (* (- 1.0 f0-6) (- 1.0 f0-6))))) + (seek! (-> self spin-intensity) f0-9 (* 2.0 (seconds-per-frame))) + ) + ) + (if (< 0.1 (-> self spin-intensity)) + (sound-play-by-name + (static-sound-name "blue-gun2-spin") + (-> self snd-spin) + (the int (* 1024.0 (lerp 0.75 1.0 (-> self spin-intensity)))) + (the int (* 1524.0 (lerp -0.5 0.0 (-> self spin-intensity)))) + 0 + (sound-group) + (-> self root trans) + ) + ) + (+! (-> self revolve-angle) (* 65536.0 (seconds-per-frame))) + (+! (-> self sway-angle) (* 65536.0 (seconds-per-frame))) + (gun-blue-2-lightning-tracker-method-25 self) + (when (time-elapsed? (-> self last-deduct-ammo-time) (seconds 0.1)) + (adjust-player-ammo-over-time + (the-as int (- (current-time) (-> self last-deduct-ammo-time))) + 7.5 + (pickup-type ammo-blue) + 10000.0 + ) + (set-time! (-> self last-deduct-ammo-time)) + ) + (spawn (-> self part) (-> *target* gun fire-point)) + (if (or (not (cpad-hold? 0 r1)) + (or (>= 0.0 (get-remaining-player-ammo (pickup-type ammo-blue))) + (!= (-> *target* gun using-gun-type) 33) + (not (-> *target* gun active?)) + (and (-> *target* next-state) (= (-> *target* next-state name) 'target-attack-air)) + ) + ) + (go-virtual inactive) + ) + ) + :code sleep-code + :post (behavior () + '() + ) + ) + +;; definition for method 7 of type gun-blue-2-lightning-tracker +(defmethod relocate ((this gun-blue-2-lightning-tracker) (offset int)) + (dotimes (v1-0 (-> this lt-array length)) + (if (nonzero? (-> this lt-array v1-0)) + (&+! (-> this lt-array v1-0) offset) + ) + ) + (if (nonzero? (-> this lt-array)) + (&+! (-> this lt-array) offset) + ) + (call-parent-method this offset) + ) + +;; definition of type gun-blue-2-lightning-init-params +(deftype gun-blue-2-lightning-init-params (structure) + ((num-beams int8) + ) + ) + +;; definition for method 3 of type gun-blue-2-lightning-init-params +(defmethod inspect ((this gun-blue-2-lightning-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gun-blue-2-lightning-init-params) + (format #t "~1Tnum-beams: ~D~%" (-> this num-beams)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-gun-blue-2-tracker scenecamera scenecamera-lod0-jg -1 + ((scenecamera-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :texture-level 10 + ) + +;; failed to figure out what this is: +(defstate test (gun-blue-2-lightning-tracker) + :virtual #t + :code sleep-code + ) + +;; definition for function gun-blue-2-lightning-init-by-other +(defbehavior gun-blue-2-lightning-init-by-other gun-blue-2-lightning-tracker ((arg0 gun-blue-2-lightning-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-blue-2-tracker" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self lt-array) (new 'process 'boxed-array lightning-bolt (-> arg0 num-beams))) + (dotimes (v1-5 6) + (set! (-> self lt-array v1-5) (the-as lightning-bolt 0)) + ) + (dotimes (gp-1 4) + (set! (-> self lt-array gp-1) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> self lt-array gp-1) 12 6 *blue-light-test*) + ) + (set! (-> self lt-array 4) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> self lt-array 4) 12 5 *blue-light-test-big*) + (set! (-> self lt-array 5) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> self lt-array 5) 12 5 *blue-light-test-big*) + (set! (-> self revolve-angle) 0.0) + (set! (-> self sway-angle) 0.0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 107) self)) + (set! (-> self last-spark-time) 0) + (set! (-> self spark-time-interval) 0) + (set! (-> self snd-lightning) (new-sound-id)) + (set! (-> self snd-spin) (new-sound-id)) + (set! (-> self should-draw-this-frame?) #f) + (go-virtual active) + ) + +;; definition for function create-lightning-tracker-if-necessary +;; WARN: Return type mismatch int vs handle. +(defbehavior create-lightning-tracker-if-necessary target () + (the-as + handle + (when (or (not (handle->process (-> self gun gun 0 extra))) + (!= (-> (handle->process (-> self gun gun 0 extra)) type) gun-blue-2-lightning-tracker) + ) + (let ((gp-0 (new 'stack-no-clear 'gun-blue-2-lightning-init-params))) + (set! (-> gp-0 num-beams) 6) + (let ((v0-0 (ppointer->handle (process-spawn + gun-blue-2-lightning-tracker + :init gun-blue-2-lightning-init-by-other + gp-0 + :name "gun-blue-2-lightning-tracker" + :to self + :stack-size #x29400 + ) + ) + ) + ) + (set! (-> self gun gun 0 extra) (the-as handle v0-0)) + v0-0 + ) + ) + ) + ) + ) + +;; definition for function is-valid-blue-2-target +(defun is-valid-blue-2-target ((arg0 process-focusable) (arg1 int)) + (local-vars (v0-1 symbol)) + (with-pp + (when (and (!= *target* arg0) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'get-vehicle) + (and (!= (send-event-function *target* a1-1) arg0) + (not (focus-test? arg0 disable dead inactive gun-no-target)) + (or (logtest? (process-mask enemy vehicle civilian) (-> arg0 mask)) + (and (logtest? (process-mask guard) (-> arg0 mask)) (-> *setting-control* user-current gun-target-guards?)) + ) + ) + ) + ) + (let ((v1-16 (process->handle arg0))) + (dotimes (a0-11 arg1) + (if (= (-> *found-objects* a0-11) v1-16) + (return #f) + ) + ) + ) + (return #t) + ) + (return #f) + v0-1 + ) + ) + +;; definition for function find-gun-blue-2-target +;; INFO: Used lq/sq +(defun find-gun-blue-2-target ((arg0 vector) (arg1 int)) + (local-vars (sv-32 process-drawable) (sv-36 number) (sv-40 vector)) + (set! sv-32 (the-as process-drawable #f)) + (set! sv-36 4096000.0) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (set! (-> v1-1 quad) (-> arg0 quad)) + (set! sv-40 v1-1) + ) + (set! (-> sv-40 w) 0.0) + (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* (the-as bounding-box arg0) s4-0 384)) + (let* ((s2-0 (-> s4-0 s3-0)) + (a0-5 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when a0-5 + (let* ((s1-0 (-> a0-5 process)) + (s2-1 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-1 + (when (is-valid-blue-2-target (the-as process-focusable s2-1) arg1) + (let* ((s1-2 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s2-1) 3) sv-40)) + (f0-2 (vector-normalize-ret-len! s1-2 1.0)) + ) + (when (< f0-2 (the-as float sv-36)) + (set! sv-32 s2-1) + (set! sv-36 f0-2) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s3-1 *target*) + (s4-1 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) arg0) (-> arg0 w))) + (when (is-valid-blue-2-target s4-1 arg1) + (let* ((gp-2 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-1 3) sv-40)) + (f0-4 (vector-normalize-ret-len! gp-2 1.0)) + ) + (when (< f0-4 (the-as float sv-36)) + (set! sv-32 s4-1) + (set! sv-36 f0-4) + ) + ) + ) + ) + ) + sv-32 + ) + +;; definition for function find-gun-blue-2-target-old +;; INFO: Used lq/sq +(defun find-gun-blue-2-target-old ((arg0 vector) (arg1 int) (arg2 vector)) + (local-vars (sv-32 process-drawable) (sv-36 number) (sv-40 vector)) + (set! sv-32 (the-as process-drawable #f)) + (set! sv-36 16384.0) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (set! (-> v1-1 quad) (-> arg0 quad)) + (set! sv-40 v1-1) + ) + (set! (-> arg0 w) 16384.0) + (set! (-> sv-40 w) 1.0) + (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s2-0 (fill-actor-list-for-box *actor-hash* (the-as bounding-box arg0) s3-0 384)) + (let* ((s1-0 (-> s3-0 s2-0)) + (a0-5 (if (type? s1-0 collide-shape) + s1-0 + ) + ) + ) + (when a0-5 + (let* ((s0-0 (-> a0-5 process)) + (s1-1 (if (type? s0-0 process-focusable) + s0-0 + ) + ) + ) + (when s1-1 + (when (is-valid-blue-2-target (the-as process-focusable s1-1) arg1) + (let* ((s0-2 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s1-1) 3) sv-40)) + (f0-3 (vector-normalize-ret-len! s0-2 1.0)) + (f1-1 (vector-dot s0-2 arg2)) + ) + (when (< f0-3 (the-as float sv-36)) + (when (< 0.6 f1-1) + (set! sv-32 s1-1) + (set! sv-36 f0-3) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (let* ((s2-1 *target*) + (s3-1 (if (type? s2-1 process-focusable) + s2-1 + ) + ) + ) + (when (and s3-1 (< (vector-vector-distance (get-trans s3-1 0) arg0) (-> arg0 w))) + (when (is-valid-blue-2-target s3-1 arg1) + (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) (get-trans s3-1 3) sv-40)) + (f0-5 (vector-normalize-ret-len! s5-2 1.0)) + (f1-4 (vector-dot s5-2 arg2)) + ) + (when (< f0-5 (the-as float sv-36)) + (when (< 0.6 f1-4) + (set! sv-32 s3-1) + (set! sv-36 f0-5) + ) + ) + ) + ) + ) + ) + sv-32 + ) + +;; definition for symbol *lightning-pts-cache*, type (inline-array vector) +(define *lightning-pts-cache* (new 'static 'inline-array vector 20 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) + ) + +;; definition for method 26 of type gun-blue-2-lightning-tracker +;; INFO: Used lq/sq +(defmethod gun-blue-2-lightning-tracker-method-26 ((this gun-blue-2-lightning-tracker) (arg0 vector) (arg1 vector) (arg2 gun-blue-lightning-command)) + (let ((s3-0 (new 'stack-no-clear 'collide-query)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector+float*! + (-> s3-0 start-pos) + arg1 + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + -7372.8 + ) + (vector-! (-> s3-0 move-dist) arg1 (-> s3-0 start-pos)) + (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) 1.2) + (let ((s2-1 s3-0)) + (set! (-> s2-1 radius) 409.6) + (set! (-> s2-1 collide-with) + (collide-spec backgnd obstacle vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> s2-1 ignore-process0) (the-as process-tree (send-event *target* 'get-vehicle))) + (set! (-> s2-1 ignore-process1) #f) + (set! (-> s2-1 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> s2-1 action-mask) (collide-action solid)) + ) + (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) + (when (>= f0-3 0.0) + (vector-float*! (-> s3-0 move-dist) (-> s3-0 move-dist) f0-3) + (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) + (set! (-> arg2 lightning-info terminal-spark-pos quad) (-> s4-0 quad)) + (set! (-> arg2 lightning-info num-pts) 1) + (set! (-> arg2 lightning-info pts 0 quad) (-> s4-0 quad)) + (set! (-> arg2 lightning-info should-draw-terminal-sparks?) #t) + (set! (-> arg2 lightning-info should-draw-extension?) #f) + (setup-draw! this (-> arg2 lightning-info)) + (return #f) + ) + ) + (let ((s5-1 fire-projectile-if-necessary) + (s3-1 (-> s3-0 start-pos)) + ) + (s5-1 s3-1 s4-0 (process->handle (send-event this 'get-vehicle))) + ) + ) + #t + ) + +;; definition for method 25 of type gun-blue-2-lightning-tracker +;; INFO: Used lq/sq +(defmethod gun-blue-2-lightning-tracker-method-25 ((this gun-blue-2-lightning-tracker)) + (local-vars + (sv-624 gun-info) + (sv-628 vector) + (sv-632 gun-blue-lightning-command) + (sv-640 int) + (sv-648 int) + (sv-656 (pointer int32)) + (sv-1440 symbol) + (sv-1456 collide-query) + (sv-1472 collide-query) + ) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this prev-targ-pos)))) + (set! (-> s5-1 y) 0.0) + (dotimes (v1-1 12) + (vector+! + (the-as vector (-> *blue-2-lightning-shape* constraints v1-1)) + (the-as vector (-> *blue-2-lightning-shape* constraints v1-1)) + s5-1 + ) + ) + ) + (set! (-> this prev-targ-pos quad) (-> (target-pos 0) quad)) + (set! sv-624 (-> *target* gun)) + (set! sv-628 (-> *target* gun laser-dir)) + (set! sv-632 (new 'stack-no-clear 'gun-blue-lightning-command)) + (set! sv-640 0) + (set! sv-648 -1) + (set! sv-656 (new 'static 'array int32 12 0 0 0 0 0 0 0 0 0 0 0 0)) + (vector-normalize! sv-628 1.0) + (set! (-> *blue-2-lightning-shape* constraints 0 pt quad) (-> sv-624 fire-point quad)) + (set! (-> *blue-2-lightning-shape* constraints 0 dir quad) (-> sv-628 quad)) + (rope-constraint-method-9 *blue-2-lightning-shape* 0) + (if (zero? (-> this last-probe-index)) + (+! (-> this last-probe-index) 1) + ) + (dotimes (v1-22 12) + (set! (-> *lightning-pts-cache* v1-22 quad) (-> *blue-2-lightning-shape* constraints v1-22 pt quad)) + ) + (if (not (gun-blue-2-lightning-tracker-method-26 this sv-628 (-> sv-624 fire-point) sv-632)) + (return 0) + ) + (set! (-> sv-632 msg) (gun-blue-lightning-cmd-msg active)) + (set! (-> sv-632 lightning-info num-pts) 1) + (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #f) + (set! (-> sv-632 lightning-info should-draw-extension?) #f) + (let ((s5-3 1) + (s4-0 (+ (-> *blue-2-lightning-shape* num-knots) -1)) + ) + (while (>= (the-as int s4-0) s5-3) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> *lightning-pts-cache* s5-3 quad)) + (let ((s2-0 (the-as process-drawable #f))) + (let ((a0-19 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (set! (-> a0-19 quad) (-> s3-0 quad)) + (set! (-> a0-19 w) 12288.0) + (if (not (the-as symbol s2-0)) + (set! s2-0 (find-gun-blue-2-target-old + a0-19 + sv-640 + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) + ) + ) + ) + ) + (cond + (s2-0 + (set! (-> *found-objects* sv-640) (process->handle s2-0)) + (set! (-> *gun-blue-2-targets* s5-3 target) (process->handle s2-0)) + (set! (-> sv-656 s5-3) 1) + (set! sv-640 (+ sv-640 1)) + (set! sv-648 s5-3) + (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable s2-0) 3) quad)) + (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (vector-! + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) + (-> *lightning-pts-cache* s5-3) + (the-as vector (-> *blue-2-lightning-shape* constraints (+ s5-3 -1))) + ) + (vector-normalize! + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-3))) + 1.0 + ) + (dotimes (v1-65 1) + ) + ) + (else + (set! (-> sv-656 s5-3) 0) + 0 + ) + ) + (let ((s0-0 s3-0) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s1-1 quad) (-> *lightning-pts-cache* (+ s5-3 -1) quad)) + (set! sv-1440 (the-as symbol #f)) + (set! sv-1456 (new 'stack-no-clear 'collide-query)) + (set! (-> sv-1456 start-pos quad) (-> s1-1 quad)) + (vector-! (-> sv-1456 move-dist) s0-0 s1-1) + (set! sv-1472 sv-1456) + (set! (-> sv-1472 radius) 860.16) + (set! (-> sv-1472 collide-with) + (collide-spec backgnd obstacle vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> sv-1472 ignore-process0) (the-as process-tree (send-event *target* 'get-vehicle))) + (set! (-> sv-1472 ignore-process1) #f) + (set! (-> sv-1472 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> sv-1472 action-mask) (collide-action solid)) + (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* sv-1456))) + (when (>= f0-3 0.0) + (vector-float*! (-> sv-1456 move-dist) (-> sv-1456 move-dist) f0-3) + (vector+! s0-0 s1-1 (-> sv-1456 move-dist)) + (set! sv-1440 #t) + (set! (-> this last-probe-index) s5-3) + (cond + ((> s5-3 0) + (let ((v0-11 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> sv-1456 move-dist) 1.0))) + (vector+float*! (-> sv-632 lightning-info terminal-spark-pos) s0-0 v0-11 -6144.0) + ) + ) + (else + (set! (-> sv-632 lightning-info terminal-spark-pos quad) (-> s0-0 quad)) + ) + ) + ) + ) + (when (not s2-0) + ) + (set! (-> *lightning-pts-cache* s5-3 quad) (-> s3-0 quad)) + (+! (-> sv-632 lightning-info num-pts) 1) + (let ((s3-1 fire-projectile-if-necessary) + (a2-13 (if (< 1 sv-640) + (the-as int (-> *found-objects* (+ sv-640 -2))) + (process->handle (send-event this 'get-vehicle)) + ) + ) + ) + (s3-1 s1-1 s0-0 (the-as handle a2-13)) + ) + ) + ) + ) + (when sv-1440 + (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #t) + (set! (-> sv-632 lightning-info should-draw-extension?) #f) + 0 + (goto cfg-54) + ) + (+! s5-3 1) + ) + ) + (label cfg-54) + (if (and (= sv-648 (+ (-> sv-632 lightning-info num-pts) -2)) + (not (-> sv-632 lightning-info should-draw-extension?)) + ) + (set! (-> sv-632 lightning-info should-draw-terminal-sparks?) #f) + ) + (dotimes (s5-4 (-> sv-632 lightning-info num-pts)) + (set! (-> sv-632 lightning-info pts s5-4 quad) (-> *lightning-pts-cache* s5-4 quad)) + (when (and (> s5-4 0) (zero? (-> sv-656 s5-4))) + (let ((s4-1 + (matrix-f-u-compose + (new 'stack-no-clear 'matrix) + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-4))) + *up-vector* + ) + ) + (f0-9 (the float (sar (shl (the int (+ (-> this revolve-angle) (* 6144.0 (the float s5-4)))) 48) 48))) + (s3-2 (-> sv-632 lightning-info pts s5-4)) + ) + (the float (sar (shl (the int (+ (-> this sway-angle) (* 5461.3335 (the float s5-4)))) 48) 48)) + (vector-rotate-around-axis! + (-> s4-1 uvec) + (the-as quaternion (-> s4-1 uvec)) + f0-9 + (the-as vector (+ (the-as uint (-> *blue-2-lightning-shape* constraints 0 dir)) (* 48 s5-4))) + ) + (vector-normalize! (-> s4-1 uvec) 1.0) + (vector+float*! s3-2 s3-2 (-> s4-1 uvec) 2048.0) + ) + ) + ) + (setup-draw! this (-> sv-632 lightning-info)) + ) + +;; definition for function gun-fire-blue-2 +;; WARN: Return type mismatch int vs object. +(defbehavior gun-fire-blue-2 target () + (if (and (-> *target* next-state) (= (-> *target* next-state name) 'target-attack-air)) + (return (the-as object 0)) + ) + (create-lightning-tracker-if-necessary) + (let ((v1-8 (new 'stack-no-clear 'gun-blue-lightning-command))) + (set! (-> v1-8 msg) (gun-blue-lightning-cmd-msg active)) + (send-event (handle->process (-> self gun gun 0 extra)) 'gun-blue-lightning v1-8) + ) + 0 + ) + +;; definition for function gun-fire-blue-2-old +;; INFO: Used lq/sq +(defbehavior gun-fire-blue-2-old target () + (local-vars + (sv-608 gun-info) + (sv-612 vector) + (sv-616 gun-blue-lightning-command) + (sv-768 vector) + (sv-772 vector) + (sv-776 vector) + (sv-784 int) + (sv-792 int) + (sv-800 vector) + (sv-848 vector) + (sv-852 vector) + ) + (create-lightning-tracker-if-necessary) + (set! sv-608 (-> self gun)) + (set! sv-612 (-> self gun fire-dir-out)) + (set! sv-616 (new 'stack-no-clear 'gun-blue-lightning-command)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 (seconds 0.1)) + (set! (-> sv-616 msg) (gun-blue-lightning-cmd-msg active)) + (set! (-> sv-616 lightning-info num-pts) 0) + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #f) + (set! (-> sv-616 lightning-info should-draw-extension?) #t) + (vector-normalize! sv-612 1.0) + (when (not (do-fire-backcheck (-> sv-608 fire-point) sv-612)) + (let ((a0-5 (handle->process (-> sv-608 gun 0 extra)))) + (send-event a0-5 'gun-blue-lightning sv-616) + ) + (return 0) + ) + (let ((v1-23 (new 'stack-no-clear 'vector))) + (set! (-> v1-23 quad) (-> sv-608 fire-point quad)) + (set! sv-768 v1-23) + ) + (set! sv-772 (vector+float*! (new 'stack-no-clear 'vector) (-> sv-608 fire-point) sv-612 409600.0)) + (let ((v1-26 (new 'stack-no-clear 'vector))) + (set! (-> v1-26 quad) (-> sv-612 quad)) + (set! sv-776 v1-26) + ) + (set! sv-784 0) + (set! sv-792 -1) + (set! sv-800 (new 'stack-no-clear 'vector)) + (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> sv-768 quad)) + (+! (-> sv-616 lightning-info num-pts) 1) + (vector-! sv-800 sv-772 sv-768) + (dotimes (gp-0 8) + (let ((f30-0 32768.0)) + (set! sv-848 (new 'stack-no-clear 'vector)) + (set! sv-852 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-612 f30-0)) + (set! (-> sv-848 quad) (-> sv-852 quad)) + (set! (-> sv-848 w) 20480.0) + (let ((s5-0 (the-as process #f))) + (let ((s4-0 #f)) + (when (< gp-0 7) + (when (and (handle->process (-> *gun-blue-2-targets* gp-0 target)) + (not (time-elapsed? (-> *gun-blue-2-targets* gp-0 start-time) (seconds 0.5))) + ) + (let* ((s2-0 (handle->process (-> *gun-blue-2-targets* gp-0 target))) + (s3-0 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when (is-valid-blue-2-target (the-as process-focusable s3-0) sv-784) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable s3-0) 3) sv-852))) + (vector-normalize-ret-len! s2-2 1.0) + (let ((f0-5 (vector-dot s2-2 sv-776))) + (when (< 0.87 f0-5) + (set! s4-0 #t) + (set! s5-0 s3-0) + ) + ) + ) + ) + ) + ) + (when (not s4-0) + (set! (-> *gun-blue-2-targets* gp-0 target) (the-as handle #f)) + (set-time! (-> *gun-blue-2-targets* gp-0 start-time)) + ) + (if (not s5-0) + (set! s5-0 (find-gun-blue-2-target-old sv-848 sv-784 sv-776)) + ) + ) + ) + (cond + (s5-0 + (set! (-> *found-objects* sv-784) (process->handle s5-0)) + (set! (-> *gun-blue-2-targets* gp-0 target) (process->handle s5-0)) + (set! sv-784 (+ sv-784 1)) + (set! sv-792 gp-0) + (vector-! sv-800 (get-trans (the-as process-focusable s5-0) 3) sv-768) + (vector-normalize! sv-800 1.0) + ) + (else + (vector-normalize! sv-800 1.0) + (let ((f0-7 (vector-dot sv-800 sv-776))) + (when (< f0-7 0.866) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (f28-0 0.0) + ) + (acos f0-7) + 5461.3335 + (vector-cross! s5-1 sv-800 sv-776) + (vector-normalize! s5-1 1.0) + (vector-rotate-around-axis! sv-800 (the-as quaternion sv-776) f28-0 s5-1) + ) + ) + ) + (vector-normalize! sv-800 1.0) + ) + ) + ) + (set! (-> sv-776 quad) (-> sv-800 quad)) + (let ((s5-3 (vector+float*! (new 'stack-no-clear 'vector) sv-768 sv-800 f30-0))) + (let ((s4-3 #f)) + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> sv-768 quad)) + (vector-! (-> s3-1 move-dist) s5-3 sv-768) + (let ((v1-99 s3-1)) + (set! (-> v1-99 radius) 40.96) + (set! (-> v1-99 collide-with) + (collide-spec backgnd vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> v1-99 ignore-process0) #f) + (set! (-> v1-99 ignore-process1) #f) + (set! (-> v1-99 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-99 action-mask) (collide-action solid)) + ) + (let ((f0-11 (fill-and-probe-using-line-sphere *collide-cache* s3-1))) + (when (>= f0-11 0.0) + (vector-float*! (-> s3-1 move-dist) (-> s3-1 move-dist) f0-11) + (vector+! s5-3 sv-768 (-> s3-1 move-dist)) + (set! s4-3 #t) + (cond + ((> gp-0 0) + (let ((a0-80 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-1 move-dist) 1.0))) + (vector+float*! (-> sv-616 lightning-info terminal-spark-pos) s5-3 a0-80 -12288.0) + ) + ) + (else + (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + ) + ) + ) + ) + ) + (set! (-> sv-616 lightning-info pts (-> sv-616 lightning-info num-pts) quad) (-> s5-3 quad)) + (+! (-> sv-616 lightning-info num-pts) 1) + (let ((s3-2 fire-projectile-if-necessary) + (s2-3 sv-768) + (s1-0 s5-3) + (a2-7 (if (< 1 sv-784) + (the-as int (-> *found-objects* (+ sv-784 -2))) + (process->handle (send-event self 'get-vehicle)) + ) + ) + ) + (s3-2 s2-3 s1-0 (the-as handle a2-7)) + ) + (set! (-> sv-768 quad) (-> s5-3 quad)) + (when s4-3 + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) + (set! (-> sv-616 lightning-info should-draw-extension?) #f) + 0 + (goto cfg-70) + ) + ) + (set! (-> sv-616 lightning-info terminal-spark-pos quad) (-> s5-3 quad)) + ) + ) + ) + (label cfg-70) + (if (and (= sv-792 (+ (-> sv-616 lightning-info num-pts) -2)) + (not (-> sv-616 lightning-info should-draw-extension?)) + ) + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #f) + ) + (let ((s5-4 (-> sv-616 lightning-info pts (+ (-> sv-616 lightning-info num-pts) -1)))) + (when (-> sv-616 lightning-info should-draw-extension?) + (let ((gp-2 (vector+float*! (new 'stack-no-clear 'vector) s5-4 sv-800 409600.0)) + (s4-4 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> s4-4 start-pos quad) (-> s5-4 quad)) + (vector-! (-> s4-4 move-dist) gp-2 s5-4) + (let ((v1-154 s4-4)) + (set! (-> v1-154 radius) 40.96) + (set! (-> v1-154 collide-with) + (collide-spec backgnd vehicle-sphere hit-by-others-list pusher impenetrable-obj) + ) + (set! (-> v1-154 ignore-process0) #f) + (set! (-> v1-154 ignore-process1) #f) + (set! (-> v1-154 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-154 action-mask) (collide-action solid)) + ) + (let ((f0-15 (fill-and-probe-using-line-sphere *collide-cache* s4-4))) + (when (>= f0-15 0.0) + (vector-float*! (-> s4-4 move-dist) (-> s4-4 move-dist) f0-15) + (vector+! gp-2 s5-4 (-> s4-4 move-dist)) + ) + ) + (set! (-> sv-616 lightning-info extension-end-point quad) (-> gp-2 quad)) + (set! (-> sv-616 lightning-info should-draw-terminal-sparks?) #t) + (let ((a0-122 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-4 move-dist) 1.0))) + (vector+float*! (-> sv-616 lightning-info terminal-spark-pos) gp-2 a0-122 -12288.0) + ) + ) + ) + ) + (let ((a0-124 (handle->process (-> sv-608 gun 0 extra)))) + (send-event a0-124 'gun-blue-lightning sv-616) + ) + ) + +;; definition for function target-gun-can-fire-blue? +(defbehavior target-gun-can-fire-blue? target ((arg0 pickup-type)) + #t + ) + +;; definition for symbol *last-fire-blue-time*, type time-frame +(define *last-fire-blue-time* (the-as time-frame 0)) + +;; definition for function target-gun-fire-blue +;; WARN: Return type mismatch object vs (pointer process). +(defbehavior target-gun-fire-blue target ((arg0 pickup-type)) + (the-as (pointer process) (case arg0 + (((pickup-type gun-blue-1)) + (gun-fire-blue-1) + ) + (((pickup-type gun-blue-2)) + (gun-fire-blue-2) + ) + (((pickup-type gun-blue-3)) + (let ((f0-0 -2.0)) + (if (logtest? (game-secrets gun-upgrade-blue-3) (-> *game-info* secrets)) + (set! f0-0 -1.5) + ) + (adjust-player-ammo f0-0 (pickup-type ammo-blue)) + ) + (when (time-elapsed? *last-fire-blue-time* (seconds 0.1)) + (sound-play "blue-gun3-shot") + (set! *last-fire-blue-time* (current-time)) + ) + (sound-play "blue-gun3-trace") + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.1)) + (dotimes (s5-2 3) + (gun-fire-blue-3) + ) + #f + ) + ) + ) + ) + +;; definition of type gun-blue-shot +(deftype gun-blue-shot (projectile) + ((init-pos vector :inline) + (init-dir vector :inline) + (collide-normal vector :inline) + ) + ) + +;; definition for method 3 of type gun-blue-shot +(defmethod inspect ((this gun-blue-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Tinit-pos: #~%" (-> this init-pos)) + (format #t "~2Tinit-dir: #~%" (-> this init-dir)) + (format #t "~2Tcollide-normal: #~%" (-> this collide-normal)) + (label cfg-4) + this + ) + +;; definition of type gun-blue-shot-2 +(deftype gun-blue-shot-2 (gun-blue-shot) + () + ) + +;; definition for method 3 of type gun-blue-shot-2 +(defmethod inspect ((this gun-blue-shot-2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type gun-blue-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 14) (new 'static 'lightning-spec + :name "lightning-blue-2-impact-shot-attack-thick" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 1.0 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 60.0 + :sound (static-sound-spec "stretched-zap" :group 1) + ) + ) + +;; definition for method 37 of type gun-blue-shot-2 +(defmethod deal-damage! ((this gun-blue-shot-2) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (set! (-> this damage) 0.0) + ) + (when (logtest? (game-secrets gun-upgrade-blue-2) (-> *game-info* secrets)) + (if (logtest? (process-mask kg-robot) (-> arg0 mask)) + (set! (-> this damage) (* 2.0 (-> this damage))) + ) + ) + (if (< (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 2) + (process-drawable-shock-effect + (the-as process-drawable arg0) + (-> *lightning-spec-id-table* 12) + lightning-probe-callback + (-> *part-id-table* 664) + 0 + 0 + 40960.0 + ) + ) + (call-parent-method this arg0 arg1) + ) + +;; definition for method 24 of type gun-blue-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this gun-blue-shot)) + (with-pp + (let* ((s4-0 (-> *part-id-table* 236)) + (s3-0 (get-field-spec-by-id s4-0 (sp-field-id spt-omega))) + (a1-1 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'eject-point) + (set! (-> a1-1 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (let ((s5-0 (the-as vector (send-event-function (ppointer->process (-> this parent)) a1-1)))) + (when s5-0 + (when s3-0 + (let ((s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 1.0)) + (s2-0 (new 'stack-no-clear 'collide-query)) + ) + (vector-rotate-y! s1-0 s1-0 16384.0) + (vector+float*! s1-0 s5-0 s1-0 -8806.4) + (set! (-> s2-0 start-pos quad) (-> s1-0 quad)) + (vector-float*! (-> s2-0 move-dist) (-> this root dynam gravity-normal) -81920.0) + (let ((v1-15 s2-0)) + (set! (-> v1-15 radius) 1228.8) + (set! (-> v1-15 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) + (set! (-> v1-15 ignore-process0) this) + (set! (-> v1-15 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> v1-15 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-15 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) + (set! (-> s3-0 initial-valuef) + (fmin (+ 1638.4 (-> s2-0 best-other-tri intersect y)) (+ -1228.8 (-> this starting-pos y))) + ) + (set! (-> s3-0 initial-valuef) (+ -81920.0 (-> this starting-pos y))) + ) + ) + ) + (let ((s4-1 (get-field-spec-by-id s4-0 (sp-field-id spt-rotate-y)))) + (if s4-1 + (set! (-> s4-1 initial-valuef) (y-angle (-> this root))) + ) + ) + (launch-particles (-> *part-id-table* 236) s5-0) + (let ((s4-2 (get-field-spec-by-id (-> *part-id-table* 235) (sp-field-id spt-rotate-y)))) + (if s4-2 + (set! (-> s4-2 initial-valuef) (y-angle (-> this root))) + ) + ) + (launch-particles (-> *part-id-table* 235) s5-0) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type gun-blue-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this gun-blue-shot)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this init-pos)))) + (draw-beam (-> *part-id-table* 231) (-> this init-pos) s3-1 #t) + (draw-beam (-> *part-id-table* 234) (-> this init-pos) (-> this starting-dir) #f) + (let ((s5-0 (-> *part-id-table* 246)) + (s4-0 (-> *part-id-table* 245)) + ) + (new 'stack-no-clear 'vector) + (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> this collide-normal)))) + (vector-normalize! s2-0 1.0) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-x)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-y)) + (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-z)) + (let ((a1-7 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (vector-cross! (-> a1-7 rvec) *y-vector* s2-0) + (vector-cross! (-> a1-7 uvec) s2-0 (-> a1-7 rvec)) + (set! (-> a1-7 fvec quad) (-> s2-0 quad)) + (matrix->eul (the-as euler-angles s1-0) a1-7 21) + (vector-negate! s3-2 s1-0) + (let ((a0-14 s3-2)) + (let ((v1-16 s3-2)) + (let ((a1-10 -3640.889)) + (.mov vf6 a1-10) + ) + (.lvf vf4 (&-> v1-16 quad)) + ) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> a0-14 quad) vf5) + ) + (sparticle-set-conerot s5-0 s3-2) + (sparticle-set-conerot s4-0 s3-2) + ) + ) + ) + ) + (let ((v1-24 (cond + ((logtest? (-> *part-group-id-table* 90 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 90)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 90)) + ) + ) + ) + ) + (send-event (ppointer->process v1-24) 'clock this) + ) + 0 + (none) + ) + ) + +;; definition for method 37 of type gun-blue-shot +(defmethod deal-damage! ((this gun-blue-shot) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (set! (-> this damage) 0.0) + ) + (+! (-> *game-info* shots-hit 2) 1.0) + (call-parent-method this arg0 arg1) + ) + +;; definition for method 27 of type gun-blue-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-27 ((this gun-blue-shot)) + (draw-beam (-> *part-id-table* 231) (-> this init-pos) (-> this init-dir) #f) + (draw-beam (-> *part-id-table* 234) (-> this init-pos) (-> this starting-dir) #f) + 0 + (none) + ) + +;; definition for method 28 of type gun-blue-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this gun-blue-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "blue-shot-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "blue-shot-hit") + ) + ) + ) + (none) + ) + +;; definition for method 38 of type gun-blue-shot +(defmethod made-impact? ((this gun-blue-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a1-0 t1-0)) + (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -12288.0 12697.6 -2048.0 t1-0) + ) + ) + +;; definition for function gun-blue-shot-move +;; WARN: Return type mismatch int vs none. +(defun gun-blue-shot-move ((arg0 gun-blue-shot)) + (projectile-move-fill-line-sphere arg0) + (when (logtest? (-> arg0 root status) (collide-status touch-actor)) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-surface)) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +;; definition for function cshape-reaction-blue-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs collide-status. +(defun cshape-reaction-blue-shot ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (vector-reset! arg2) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg1 move-dist) (-> arg1 best-dist)) + (move-by-vector! arg0 a1-1) + ) + (set! (-> (the-as gun-blue-shot (-> arg0 process)) collide-normal quad) (-> arg1 best-other-tri normal quad)) + (let ((v0-1 4)) + (logior! (-> arg0 status) v0-1) + (the-as collide-status v0-1) + ) + ) + +;; definition for method 30 of type gun-blue-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this gun-blue-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-blue-shot) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-blue-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 1228.8) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd obstacle pusher shield)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type gun-blue-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this gun-blue-shot)) + (with-pp + (+! (-> *game-info* shots-fired 2) 1.0) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) gun-blue-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) 2.0) + (if (logtest? (game-secrets gun-upgrade-blue-1) (-> *game-info* secrets)) + (set! (-> this damage) 2.5) + ) + (logior! (-> this options) (projectile-options po13)) + 0 + (none) + ) + ) + +;; definition for method 31 of type gun-blue-shot-2 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this gun-blue-shot-2)) + (with-pp + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) gun-blue-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) 2.5) + (set! (-> this vehicle-damage-factor) 2.0) + (set! (-> this vehicle-impulse-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this sound-id) (new-sound-id)) + 0 + (none) + ) + ) + +;; definition for method 24 of type gun-blue-shot-2 +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this gun-blue-shot-2)) + 0 + (none) + ) + +;; definition for method 27 of type gun-blue-shot-2 +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-27 ((this gun-blue-shot-2)) + 0 + (none) + ) + +;; definition for method 25 of type gun-blue-shot-2 +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this gun-blue-shot-2)) + 0 + (none) + ) + +;; definition for method 26 of type gun-blue-shot-3 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this gun-blue-shot-3)) + (let ((s5-0 sphere-in-view-frustum?) + (a0-2 (new 'stack 'sphere)) + ) + (set! (-> a0-2 quad) (-> this root trans quad)) + (set! (-> a0-2 r) 4096.0) + (when (s5-0 a0-2) + (let ((v1-11 + (cond + ((logtest? (-> *part-group-id-table* 108 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 108)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 108)) + ) + ) + ) + ) + (send-event (ppointer->process v1-11) 'clock this) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate dissipate (gun-blue-shot-3) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(defstate impact (gun-blue-shot-3) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (go-virtual die) + ) + ) + +;; definition for method 37 of type gun-blue-shot-3 +(defmethod deal-damage! ((this gun-blue-shot-3) (arg0 process) (arg1 event-message-block)) + (+! (-> *game-info* shots-hit 2) 1.0) + (if (and (logtest? (process-mask guard) (-> arg0 mask)) + (not (-> *setting-control* user-current gun-target-guards?)) + ) + (set! (-> this damage) 0.0) + ) + (call-parent-method this arg0 arg1) + ) + +;; definition for method 26 of type gun-blue-shot-2 +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this gun-blue-shot-2)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc index 7920e2172a..905e536d86 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc @@ -102,7 +102,7 @@ ;; definition for function sparticle-lightning-2d-spline-align-plus-rotz ;; WARN: Return type mismatch float vs none. (defun sparticle-lightning-2d-spline-align-plus-rotz ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object)) - (sparticle-2d-spline-align-instant arg0 arg1 arg2 arg3) + (sparticle-2d-spline-align-instant arg0 arg1 arg2) (+! (-> arg2 flag-rot-sy z) (-> *part-id-table* 664 init-specs 4 initial-valuef)) (none) ) @@ -460,13 +460,14 @@ ;; definition for method 25 of type gun-dark-3-nuke ;; INFO: Used lq/sq +;; WARN: Return type mismatch matrix vs none. (defmethod projectile-method-25 ((this gun-dark-3-nuke)) (when (not (logtest? (-> this draw status) (draw-control-status no-draw))) (let ((s5-0 (new 'stack-no-clear 'matrix))) (matrix-f-u-compose s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) *up-vector*) (set! (-> s5-0 trans quad) (-> this root trans quad)) - (sparticle-launch-control-method-17 (-> this part) s5-0) - (sparticle-subsampler-method-10 (-> this smoke-trail) s5-0) + (spawn-from-mat (-> this part) s5-0) + (init-with-mat! (-> this smoke-trail) s5-0) ) ) (none) @@ -3867,7 +3868,7 @@ ) (set! (-> a1-7 trans quad) (-> s4-2 start-pos quad)) (set! (-> a1-7 trans y) f30-2) - (sparticle-launch-control-method-17 (-> self part) a1-7) + (spawn-from-mat (-> self part) a1-7) ) ) ) @@ -4097,7 +4098,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc new file mode 100644 index 0000000000..f41b11f453 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-part_REF.gc @@ -0,0 +1,5154 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +gun + +;; failed to figure out what this is: +(defpart 207 + :init-specs ((:texture (lasersmoke-00 level-default-sprite)) + (:birth-func 'birth-func-laser-pointer) + (:num 1.0) + (:scale-x (meters 0.075) (meters 0.05)) + (:scale-y (meters 40)) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 16.0 8.0) + (:fade-a -1.6) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x401a00 + #x401b00 + #x401c00 + #x401d00 + #x401e00 + #x401f00 + #x402000 + #x402100 + #x402200 + #x402300 + #x402400 + #x402500 + #x402600 + #x402700 + #x402800 + #x402900 + #x402a00 + #x402b00 + #x402c00 + #x402d00 + #x402e00 + #x402f00 + #x403000 + #x403100 + #x403200 + #x403300 + #x403400 + #x403500 + #x403600 + #x403700 + #x403800 + #x403900 + ) + ) + (:func 'sparticle-texture-animate) + ) + ) + +;; definition for function sparticle-track-gun-joint +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-gun-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (-> arg1 key) + (let ((v1-1 *target*) + (a1-1 36) + ) + (when v1-1 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1)) + (set! (-> arg2 x) (-> *target* gun fire-point x)) + (set! (-> arg2 y) (-> *target* gun fire-point y)) + (set! (-> arg2 z) (-> *target* gun fire-point z)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-laser-glow + :id 83 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 208 :flags (sp6)) (sp-item 209 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 209 + :init-specs ((:texture (glow level-default-sprite)) + (:birth-func 'birth-func-set-alpha-from-userdata) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b :copy g) + (:a 48.0 16.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 208 + :init-specs ((:texture (glow level-default-sprite)) + (:birth-func 'birth-func-set-alpha-from-userdata) + (:num 1.0) + (:scale-x (meters 0.25) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b :copy g) + (:a 64.0 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 210 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2) (meters 0.05)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b :copy g) + (:a 100.0 28.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 211 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 0.0 32.0) + (:b :copy g) + (:a 32.0 32.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 212 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 0.0) + (:b :copy g) + (:a 96.0 32.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 213 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 8)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-red-shot-fired + :id 84 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 214) (sp-item 215)) + ) + +;; failed to figure out what this is: +(defpart 214 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.5)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -12.75) + (:fade-a -2.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +;; failed to figure out what this is: +(defpart 215 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.5)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 96.0) + (:scalevel-x (meters 0.21333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -12.8) + (:fade-b -3.2) + (:fade-a -4.8) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-red-shot-reload + :id 85 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 216)) + ) + +;; failed to figure out what this is: +(defpart 216 + :init-specs ((:texture (common-white common)) + (:num 2.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.08)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.053333335) (meters 0.10666667)) + (:rotvel-z (degrees -1440) (degrees 2880)) + (:fade-a -0.42666668) + (:accel-y (meters -0.005) (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees -60) (degrees 120)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; definition for symbol *red-shot-colors*, type (pointer rgba) +(define *red-shot-colors* (new 'static 'array rgba 36 + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe :a #x80) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe :g #x80 :a #x40) + (new 'static 'rgba :r #xfe :a #x4) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe :g #x80 :a #x20) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe :a #x4) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #x40 :a #x10) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe :a #x4) + (new 'static 'rgba :r #xfe :a #x8) + (new 'static 'rgba :r #xfe :g #xfe :b #xfe) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe) + (new 'static 'rgba :r #xfe :a #x4) + ) + ) + +;; failed to figure out what this is: +(defpart 217 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 8)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-red3-shot-fired + :id 86 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 214) (sp-item 215)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-red3-shot-glow + :id 87 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 218)) + ) + +;; failed to figure out what this is: +(defpart 218 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-red3-shot-explode + :id 88 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 219 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 220 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 221 :period (seconds 30) :length (seconds 0.035)) + (sp-item 222 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 223 :period (seconds 30) :length (seconds 0.167)) + (sp-item 224 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 219 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 220 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 225 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 221 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-gun-red3-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-gun-red3-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 221 init-specs 14 initial-valuef) + (the-as float *part-gun-red3-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* color-start) *range-explo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* alpha-start) *range-explo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-x-start) *range-explo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-y-start) *range-explo-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* a-scalar) *curve-explo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-x-scalar) *curve-explo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-dust-in-curve-settings* scale-y-scalar) *curve-explo-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 223 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 224 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-gun-red3-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-gun-red3-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 224 init-specs 16 initial-valuef) + (the-as float *part-gun-red3-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* color-start) *range-explo-color*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* alpha-start) *range-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-x-start) *range-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-y-start) *range-explo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* a-scalar) *curve-explo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-x-scalar) *curve-explo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-gun-red3-explosion-texture-curve-settings* scale-y-scalar) *curve-explo-scale-y*) + +;; failed to figure out what this is: +(defpart 222 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-red-3-scorched-earth + :id 89 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 226 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 226 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:scale-y (meters 5) (meters 5)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 0.85333335 0.85333335) + (:timer (seconds 3)) + (:flags (left-multiply-quat)) + (:next-time (seconds 0.25)) + (:next-launcher 227) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 227 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.75)) (:next-launcher 228)) + ) + +;; failed to figure out what this is: +(defpart 228 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 229 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 230 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 1.3333334)) + (:scalevel-y :copy scalevel-x) + (:fade-b -2.56) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(when (or (zero? *curve-linear-up-red*) (!= loading-level global)) + (set! *curve-linear-up-red* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-linear-up-red* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-red* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-red* pts data 0 second) 0.3) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-red* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-linear-up-red* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(if (or (zero? *red-shot-3-trail*) (!= loading-level global)) + (set! *red-shot-3-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* color-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* alpha-2-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* base-alpha) 0.5) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* alpha-repeat-dist) 6144.0) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* base-width) 2048.0) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* width-repeat-dist) 20480.0) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* uv-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* uv-repeat-dist) 16384000.0) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* max-age) (seconds 0.5)) + +;; failed to figure out what this is: +(if #f + (set! (-> *red-shot-3-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *red-shot-3-trail* tex-id) (the-as uint #x100300)) + ) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-red*)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* alpha-curve-2) *curve-linear-up-red*) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *red-shot-3-trail* frame-stagger) (the-as uint 1)) + +;; failed to figure out what this is: +(when (or (zero? *curve-yellow2-shot-alpha*) (!= loading-level global)) + (set! *curve-yellow2-shot-alpha* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *curve-yellow2-shot-alpha* 21 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 1 first) 0.1) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 2 first) 0.4) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 2 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 3 first) 0.401) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 3 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 4 first) 0.45) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 4 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 5 first) 0.451) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 5 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 6 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 6 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 7 first) 0.501) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 7 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 8 first) 0.55) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 8 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 9 first) 0.551) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 9 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 10 first) 0.6) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 10 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 11 first) 0.601) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 11 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 12 first) 0.65) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 12 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 13 first) 0.651) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 13 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 14 first) 0.7) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 14 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 15 first) 0.701) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 15 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 16 first) 0.75) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 16 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 17 first) 0.751) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 17 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 18 first) 0.8) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 18 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 19 first) 0.801) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 19 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 20 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *curve-yellow2-shot-alpha* pts data 20 second) 0.0) + +;; failed to figure out what this is: +(if #t + (set! *curve-yellow2-shot-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.2 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 128.0) + (new 'static 'vector :x 1.0 :y 0.8 :z 0.8 :w 128.0) + (new 'static 'vector :x 1.0 :y 0.5 :z 0.5 :w 128.0) + (new 'static 'vector :x 1.0 :y 0.5 :z 0.5 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y 1.25 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-linear-down-long* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.9 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if (or (zero? *yellow-shot-2-trail*) (!= loading-level global)) + (set! *yellow-shot-2-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* color-repeat-dist) 286720.0) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* alpha-2-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* alpha-repeat-dist) 286720.0) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* base-width) 2867.2) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* width-repeat-dist) 163840.0) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* uv-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* uv-repeat-dist) 20480.0) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* max-age) (seconds 0.5)) + +;; failed to figure out what this is: +(if #f + (set! (-> *yellow-shot-2-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *yellow-shot-2-trail* tex-id) (the-as uint #x501e00)) + ) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* color-curve) (the-as curve-color-piecewise *curve-yellow2-shot-color*)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down-long*)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* alpha-curve-2) *curve-yellow2-shot-alpha*) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *yellow-shot-2-trail* frame-stagger) (the-as uint 1)) + +;; failed to figure out what this is: +(defpart 231 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-setup-beam) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.1)) + (:scale-y (meters 100) (meters 20)) + (:r 0.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:fade-a 3.2) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x401000 #x401200)) + (:func 'sparticle-texture-animate) + (:next-time (seconds 0.05)) + (:next-launcher 232) + ) + ) + +;; failed to figure out what this is: +(defpart 232 + :init-specs ((:r 64.0) + (:g 128.0) + (:b 255.0) + (:a 48.0) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y (meters -0.016666668)) + (:fade-r 1.2) + (:fade-g 0.8) + (:fade-a -0.10666667 -0.2) + (:accel-y (meters 0.000033333334)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.5)) + (:next-launcher 233) + ) + ) + +;; failed to figure out what this is: +(defpart 233 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 234 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1) (meters 1.5)) + (:scale-y (meters 10) (meters 0.6)) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r 3.2) + (:fade-g 3.2) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 235 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 32.0 16.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters 0.01) (meters 0.006666667)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.4 -0.4) + (:friction 0.85 0.04) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -45) (degrees 10)) + (:conerot-y (degrees 85) (degrees 10)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.4)) + ) + ) + +;; failed to figure out what this is: +(defpart 236 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:y (meters 0.25)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 260) (degrees 20)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:rotvel-z (degrees -4.8) (degrees 2.4)) + (:accel-y (meters -0.008333334) (meters -0.0016666667)) + (:friction 0.9 0.02) + (:timer (seconds 1.2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408700 #x408700 #x408800)) + (:func 'check-shell-level1) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 237) + (:conerot-x (degrees -40) (degrees 20)) + (:conerot-y (degrees 80) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 237 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 238) + ) + ) + +;; failed to figure out what this is: +(defpart 238 + :init-specs ((:r 128.0) (:g 128.0) (:b 255.0) (:a 128.0)) + ) + +;; failed to figure out what this is: +(defpart 239 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-shell" :group 1)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-y (meters 0.026666667) (meters 0.016666668)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0026666666) (meters -0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408700 #x408800 #x408900)) + (:func 'check-shell-level2) + (:next-time (seconds 0.017) (seconds 0.53)) + (:next-launcher 237) + (:conerot-x (degrees 0) (degrees 45)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 240 + :init-specs ((:texture (shell-casing-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-shell" :group 1)) + (:scale-x (meters 0.35)) + (:rot-z (degrees 30) (degrees 120)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:vel-x (meters 0) (meters 0.0033333334)) + (:vel-y (meters 0.016666668)) + (:vel-z (meters 0) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 40)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 30 0 0 #x408800 #x408800 #x408900)) + (:next-time (seconds 0.25)) + (:next-launcher 241) + (:conerot-x (degrees 30) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 241 + :init-specs ((:sound (static-sound-spec "blue-gun-shell" :group 1)) + (:vel-x (meters 0)) + (:vel-y (meters 0)) + (:vel-z (meters 0)) + (:rotvel-z (degrees 0)) + (:accel-y (meters 0)) + (:next-time (seconds 2) (seconds 0.997)) + (:next-launcher 242) + ) + ) + +;; failed to figure out what this is: +(defpart 242 + :init-specs ((:sound (static-sound-spec "blue-gun-shell" :group 1)) (:fade-a -0.512)) + ) + +;; definition for function check-shell-level1 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun check-shell-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (set! (-> *part-id-table* 239 init-specs 11 initial-valuef) (-> gp-0 y)) + (launch-particles (-> *part-id-table* 239) gp-0) + (launch-particles (-> *part-id-table* 243) gp-0) + ) + ) + 0 + (none) + ) + +;; definition for function check-shell-level2 +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun check-shell-level2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (launch-particles (-> *part-id-table* 240) gp-0) + (launch-particles (-> *part-id-table* 243) gp-0) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 243 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 0.0 1 2.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.03) (meters 0.005)) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 128.0) + (:a 128.0) + (:omega (degrees 0.01125) (degrees 0.0045)) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-g -2.55 -2.55) + (:fade-b -8.0) + (:fade-a -0.64 -0.64) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.8 0.02) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 60) (degrees 20)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-blue-shot-hit + :id 90 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 244 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 245 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.017)) + (sp-item 246 :fade-after (meters 120) :falloff-to (meters 140) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 246 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 1)) + (:rot-x 4) + (:scale-y (meters 0.02) (meters 0.02)) + (:r 0.0) + (:g 64.0 128.0) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.06666667) (meters 0.2)) + (:fade-r -0.42666668) + (:fade-g -0.42666668) + (:accel-y (meters -0.0013333333) (meters -0.001)) + (:friction 0.875) + (:timer (seconds 0.167) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017) (seconds 0.98)) + (:next-launcher 247) + (:conerot-x (degrees 80) (degrees 20)) + (:conerot-y (degrees 80) (degrees 20)) + (:conerot-z (degrees 80) (degrees 20)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +;; failed to figure out what this is: +(defpart 247 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 245 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 32.0 32.0) + (:vel-z (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0013333333) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-b 0.21333334) + (:fade-a -0.32) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90) (degrees 20)) + (:conerot-y (degrees 90) (degrees 20)) + (:conerot-z (degrees 90) (degrees 20)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +;; failed to figure out what this is: +(defpart 244 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:sound (static-sound-spec "blue-gun-rico" :group 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 2) (meters 2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:rotvel-z (degrees 0.3)) + (:fade-r -5.1) + (:fade-g -3.92) + (:fade-b 0.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.035)) + (:next-launcher 248) + ) + ) + +;; failed to figure out what this is: +(defpart 248 + :init-specs ((:scale-x (meters 1)) (:scale-y :copy scale-x) (:scalevel-x (meters 0.06)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-blue-shot-die + :id 91 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpart 250 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 6)) + (:scale-y (meters 8)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 128.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark-shot-fired + :id 92 + :duration (seconds 0.017) + :linger-duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 251 :flags (sp3 sp6)) (sp-item 252)) + ) + +;; failed to figure out what this is: +(defpart 251 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3.5) (meters 0.5)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -6.4) + (:fade-g -6.375) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 252 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 32.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.04) (meters 0.03)) + (:r 0.0) + (:g 0.0 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.01125) (degrees 0.01125)) + (:vel-y (meters 0.1) (meters 0.3)) + (:fade-g -2.55 -2.55) + (:fade-a -0.256 -0.256) + (:accel-y (meters -0.0033333334)) + (:friction 0.8 0.02) + (:timer (seconds 0.335) (seconds 0.497)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-jak-peacemaker-shot-hit + :id 93 + :duration (seconds 0.067) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 253 :flags (sp3 sp6)) + (sp-item 254 :flags (sp3 sp6)) + (sp-item 255 :fade-after (meters 160) :falloff-to (meters 160)) + (sp-item 256) + ) + ) + +;; failed to figure out what this is: +(defpart 255 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.08) (meters 0.04)) + (:r 0.0) + (:g 0.0 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0.005625) (degrees 0.005625)) + (:vel-y (meters 0.3) (meters 0.3)) + (:fade-g -0.85 -0.85) + (:fade-a -0.48 -0.10666667) + (:accel-y (meters -0.0033333334)) + (:friction 0.8 0.02) + (:timer (seconds 1) (seconds 0.997)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 256 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 16.0) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +;; failed to figure out what this is: +(defpart 257 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 32.0 32.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +;; failed to figure out what this is: +(defpart 254 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 32)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -1.6)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +;; failed to figure out what this is: +(defpart 253 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:scalevel-x (meters 0.21333334) (meters 0.21333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -12.75) + (:fade-g -3.1875) + (:fade-a -0.4) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + ) + ) + +;; definition for function sparticle-dark-shot-lightning +(defun sparticle-dark-shot-lightning ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((v1-3 (-> arg1 key proc root trans))) + (set! (-> arg2 x) (-> v1-3 x)) + (set! (-> arg2 y) (-> v1-3 y)) + (set! (-> arg2 z) (-> v1-3 z)) + ) + (sparticle-texture-animate arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark-shot-trail + :id 94 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 258) (sp-item 259 :flags (sp6)) (sp-item 260 :flags (sp6)) (sp-item 261 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 260 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.25) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 261 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpart 259 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b 128.0 128.0) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 258 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.9)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-y (meters 0.04)) + (:fade-r 6.4) + (:fade-g 6.4) + (:fade-a 6.4) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-dark-shot-lightning) + (:next-time (seconds 0.05) (seconds 0.015)) + (:next-launcher 262) + ) + ) + +;; failed to figure out what this is: +(defpart 262 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-r -8.533334) + (:fade-g -8.533334) + (:fade-a -8.533334) + (:next-time (seconds 0.05) (seconds 0.015)) + (:next-launcher 263) + ) + ) + +;; failed to figure out what this is: +(defpart 263 + :init-specs ((:scalevel-x (meters -0.00093750004) (meters -0.00093750004)) + (:scalevel-y (meters -0.00078125) (meters -0.00078125)) + (:fade-r -0.8) + (:fade-g -0.8) + (:fade-a -0.8) + ) + ) + +;; failed to figure out what this is: +(defpart 264 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:scalevel-x (meters -0.005)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 265 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.2)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 6.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 266 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.5 0.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 128.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.55 -1.28) + (:fade-b -1.28) + (:fade-a -0.64) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 267 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 0.25) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.0020833334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.6) + (:fade-g -1.6) + (:fade-b -3.2 -6.4) + (:accel-y (meters -0.000033333334) (meters -0.00033333333)) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function sparticle-track-gun-joint-3d +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-gun-joint-3d ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (-> arg1 key) + (let ((v1-1 *target*) + (a1-1 36) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1)) + ) + (set! (-> arg2 x) (-> *target* gun fire-point x)) + (set! (-> arg2 y) (-> *target* gun fire-point y)) + (set! (-> arg2 z) (-> *target* gun fire-point z)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 268 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 269 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.5)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:scalevel-x (meters -0.005)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 270 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.01)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 6.0) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 271 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 0.55) (meters 0.1)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-z (meters -0.016666668) (meters -0.083333336)) + (:scalevel-x (meters -0.0020833334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.6) + (:fade-g -1.6) + (:fade-b -3.2 -6.4) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 272 + :init-specs ((:texture (hitspark level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.067) (seconds 0.015)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 273 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 2.0) + (:scale-x (meters 0.01) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 30.0) + (:a 40.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.0) + (:fade-b -0.2) + (:fade-a -0.26666668) + (:timer (seconds 0.25) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 274 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 275 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.15)) + (:scale-y (meters 0.8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.025)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 276 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.2)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:scalevel-x (meters -0.005)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 277 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 30.2)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 278 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 0.55) (meters 0.1)) + (:scale-y (meters 0.1) (meters 0.1)) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:vel-z (meters -0.016666668) (meters -0.083333336)) + (:scalevel-x (meters -0.0020833334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.6) + (:fade-g -1.6) + (:fade-b -3.2 -6.4) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-saucer-lights + :id 95 + :linger-duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 279 :flags (sp6)) (sp-item 280 :flags (is-3d sp6 sp7)) (sp-item 281 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-saucer-lights-dark + :id 96 + :duration (seconds 2) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 282 :flags (sp3)) (sp-item 283 :flags (is-3d sp3 sp7)) (sp-item 284 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-saucer-fizz + :id 97 + :duration (seconds 30) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 285 :period (seconds 2) :length (seconds 0.017)) + (sp-item 286 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 287 :flags (sp3 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 287 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 15.0) + (:scale-x (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.05) (meters 0.016666668)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111) + (:accel-y (meters 0.00033333333)) + (:friction 0.9 0.02) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:next-time (seconds 0.167)) + (:next-launcher 288) + (:conerot-x (degrees 10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 288 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpart 279 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.1)) + (:scale-y (meters 0.8)) + (:r 40.0) + (:g 40.0) + (:b 40.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 280 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 40.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +;; failed to figure out what this is: +(defpart 281 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 40.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +;; failed to figure out what this is: +(defpart 282 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.1)) + (:scale-y (meters 0.8)) + (:r 10.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 1.5)) + (:next-launcher 289) + ) + ) + +;; failed to figure out what this is: +(defpart 283 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 1.5)) + (:next-launcher 289) + ) + ) + +;; failed to figure out what this is: +(defpart 284 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters 0.16)) + (:scale-x (meters 0.95)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 1.5)) + (:next-launcher 289) + ) + ) + +;; failed to figure out what this is: +(defpart 289 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-shot-hit-3 + :id 98 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 290 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 291 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 290 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 1.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 1.2)) + (:r 255.0) + (:g 200.0 55.0) + (:b 128.0) + (:a 32.0 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y (meters 0.033333335) (meters 0.033333335)) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 291 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0013333333) (meters 0.0033333334)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees -90) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-shot-hit-object-3 + :id 99 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 292 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 293 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 2) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 292 + :init-specs ((:texture (laser-hit2-add level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.4) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 55.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 293 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0 6.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.013333334)) + (:fade-g -0.21333334 -0.21333334) + (:fade-a -0.42666668) + (:accel-y (meters -0.001)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow3-muzzle-smoke + :id 100 + :duration (seconds 0.067) + :linger-duration (seconds 1.667) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 294 :period (seconds 2) :length (seconds 0.017)) (sp-item 295 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 294 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0 55.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 295 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 30.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 28.0) + (:g :copy r) + (:b :copy r) + (:a 16.0 64.0) + (:vel-z (meters 0.16666667) (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.016666668)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:friction 0.95 0.04) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-13)) + (:next-time (seconds 0.667)) + (:next-launcher 296) + (:conerot-x (degrees 10) (degrees 10)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 296 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.26666668) (:friction 0.99)) + ) + +;; failed to figure out what this is: +(defpart 297 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 4)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-a -3.6571429) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-shot-hit + :id 101 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 299 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 300 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 301 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 1)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.667)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.5)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.417)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.335)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.25)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.185)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.15)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.117)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.085)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.05)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.035)) + (sp-item 302 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.017)) + (sp-item 303 :fade-after (meters 40) :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 304 :fade-after (meters 130) :falloff-to (meters 130) :period (seconds 2) :length (seconds 0.017) :binding 298) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-shot-hit-object + :id 102 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 305 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 306 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 301 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 303 :fade-after (meters 40) :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + (sp-item 304 :fade-after (meters 130) :falloff-to (meters 130) :period (seconds 2) :length (seconds 0.017) :binding 298) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + (sp-item 298 :fade-after (meters 90) :falloff-to (meters 90) :flags (sp1 sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 298 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 0.15) (meters 0.1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 64.0) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:fade-g -3.4 -3.4) + (:fade-a -0.21333334 -1.28) + (:accel-y (meters -0.00033333333) (meters -0.00083333335)) + (:friction 0.95 0.02) + (:timer (seconds 0.667) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 304 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 4.0 12.0) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.225) (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 64.0 32.0) + (:omega (degrees 0.016875) (degrees 0.03375)) + (:vel-y (meters 0.2)) + (:fade-g -1.7 -1.7) + (:accel-y (meters -0.0033333334) (meters -0.0016666667)) + (:friction 0.95 0.02) + (:timer (seconds 0.667) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.335) (seconds 0.33)) + (:next-launcher 307) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 308 + :init-specs ((:fade-a -0.96 -0.96)) + ) + +;; failed to figure out what this is: +(defpart 301 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 0.0 32.0) + (:a 24.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.6857143) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 303 + :init-specs ((:num 1.0) + (:rot-x 12) + (:r 4096.0) + (:g 2867.2) + (:b 1638.4) + (:fade-b 5.12) + (:timer (seconds 0.8)) + (:flags (distort)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 302 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 32.0 8.0) + (:a 96.0) + (:vel-y (meters 0.026666667) (meters 0.053333335)) + (:scalevel-x (meters -0.0005) (meters -0.0005)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.7) + (:fade-b -0.53333336) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 309) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 309 + :init-specs ((:fade-r -1.28) (:fade-a -0.96)) + ) + +;; failed to figure out what this is: +(defpart 300 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0 8.0) + (:a 24.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.117)) + (:next-launcher 310) + ) + ) + +;; failed to figure out what this is: +(defpart 310 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.010958904)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.38356164) + (:fade-b 0.0) + (:fade-a -0.13150685) + ) + ) + +;; failed to figure out what this is: +(defpart 306 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0 8.0) + (:a 24.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.117)) + (:next-launcher 311) + ) + ) + +;; failed to figure out what this is: +(defpart 311 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.75) + (:fade-b 0.0) + (:fade-a -0.6) + ) + ) + +;; failed to figure out what this is: +(defpart 299 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 0.5625)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.05)) + (:next-launcher 312) + ) + ) + +;; failed to figure out what this is: +(defpart 312 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-b -5.1) + (:next-time (seconds 0.167)) + (:next-launcher 313) + ) + ) + +;; failed to figure out what this is: +(defpart 313 + :init-specs ((:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.0018691589)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.14222223) + (:fade-b 0.0) + (:next-time (seconds 1.5)) + (:next-launcher 314) + ) + ) + +;; failed to figure out what this is: +(defpart 314 + :init-specs ((:fade-g -2.2588236) (:fade-a -0.7529412)) + ) + +;; failed to figure out what this is: +(defpart 305 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-x (degrees 0.5625)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.05)) + (:next-launcher 315) + ) + ) + +;; failed to figure out what this is: +(defpart 315 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.04)) + (:scalevel-y :copy scalevel-x) + (:fade-b -5.1) + (:next-time (seconds 0.167)) + (:next-launcher 316) + ) + ) + +;; failed to figure out what this is: +(defpart 316 + :init-specs ((:fade-g -4.8) (:fade-a -1.6)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-yellow-shot-die + :id 103 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark-shot-hit + :id 104 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 317 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 318 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 319 :period (seconds 3) :length (seconds 0.05)) + (sp-item 320 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 321 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 322 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 323 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 323 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -6.2) + (:fade-b -0.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 324) + (:conerot-x '*sp-temp*) + ) + ) + +;; failed to figure out what this is: +(defpart 322 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -6.2) + (:fade-b -0.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 324) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 324 + :init-specs ((:fade-r -2.1666667) + (:fade-g -5.0) + (:fade-b -1.3333334) + (:fade-a -0.062068965 -0.72) + (:next-time (seconds 0.05) (seconds 0.047)) + (:next-launcher 325) + ) + ) + +;; failed to figure out what this is: +(defpart 325 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.7) + (:fade-g 0.0) + (:fade-b -0.8) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 326) + ) + ) + +;; failed to figure out what this is: +(defpart 326 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.5833333) + (:fade-g 0.0) + (:fade-b -0.9444444) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 327) + ) + ) + +;; failed to figure out what this is: +(defpart 327 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 318 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.13333334)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b 0.0) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 328) + ) + ) + +;; failed to figure out what this is: +(defpart 328 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 317 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b 0.0) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 329) + ) + ) + +;; failed to figure out what this is: +(defpart 329 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.8285714) + (:fade-g -3.6571429) + (:fade-b -3.6571429) + (:fade-a -1.3714286) + ) + ) + +;; failed to figure out what this is: +(defpart 321 + :init-specs ((:texture (specs level-default-sprite)) + (:num 6.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.1) + (:fade-b -0.1) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 330) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 330 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14444445) + (:fade-g -0.33333334) + (:fade-b -0.08888889) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 331) + ) + ) + +;; failed to figure out what this is: +(defpart 331 + :init-specs ((:fade-r 0.0) (:fade-g -0.08695652) (:fade-a -0.18478261)) + ) + +;; failed to figure out what this is: +(defpart 319 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 1.2) + (:fade-b 3.2) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 332) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +;; failed to figure out what this is: +(defpart 332 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.0833334) + (:fade-g -2.1666667) + (:fade-b -0.6666667) + (:fade-a -0.46666667) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 333) + ) + ) + +;; failed to figure out what this is: +(defpart 333 + :init-specs ((:fade-r -1.7) (:fade-g 0.0) (:fade-b -0.8) (:fade-a -1.0) (:next-time (seconds 0.167)) (:next-launcher 334)) + ) + +;; failed to figure out what this is: +(defpart 334 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.17) + (:fade-g 0.0) + (:fade-b -0.3) + (:fade-a -0.1) + ) + ) + +;; failed to figure out what this is: +(defpart 320 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 192.0 64.0) + (:g 128.0) + (:b 192.0 64.0) + (:a 32.0 96.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-r -1.4222223) + (:fade-g -1.4222223) + (:fade-b -1.4222223) + (:fade-a -1.4222223) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-green-shot-hit + :id 105 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 335 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 336 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 337 :period (seconds 3) :length (seconds 0.05)) + (sp-item 338 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 339 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 340 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 341 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 341 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -6.2) + (:fade-g 0.0) + (:fade-b -10.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 342) + (:conerot-x '*sp-temp*) + ) + ) + +;; failed to figure out what this is: +(defpart 340 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 0.8) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r -6.2) + (:fade-g 0.0) + (:fade-b -10.2) + (:fade-a -0.1254902) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 342) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 342 + :init-specs ((:fade-r -5.0) + (:fade-g -2.1666667) + (:fade-a -0.062068965 -0.72) + (:next-time (seconds 0.05) (seconds 0.047)) + (:next-launcher 343) + ) + ) + +;; failed to figure out what this is: +(defpart 343 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.7) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 344) + ) + ) + +;; failed to figure out what this is: +(defpart 344 + :init-specs ((:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.5833333) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 345) + ) + ) + +;; failed to figure out what this is: +(defpart 345 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 336 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.13333334)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667) + (:fade-g 0.0) + (:fade-b -8.5) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 346) + ) + ) + +;; failed to figure out what this is: +(defpart 346 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.7066667) + (:fade-g -0.85333335) + (:fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 335 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r -4.266667) + (:fade-g 0.0) + (:fade-b -8.5) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 347) + ) + ) + +;; failed to figure out what this is: +(defpart 347 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.6571429) + (:fade-g -1.8285714) + (:fade-a -1.3714286) + ) + ) + +;; failed to figure out what this is: +(defpart 339 + :init-specs ((:texture (specs level-default-sprite)) + (:num 6.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.1) + (:fade-g 0.0) + (:fade-b -5.1) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 348) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 348 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.33333334) + (:fade-g -0.14444445) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 349) + ) + ) + +;; failed to figure out what this is: +(defpart 349 + :init-specs ((:fade-r -0.08695652) (:fade-g 0.0) (:fade-a -0.18478261)) + ) + +;; failed to figure out what this is: +(defpart 337 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 2.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 1.2) + (:fade-g 3.3) + (:fade-b 0.4) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 350) + (:conerot-x (degrees -1440) (degrees 2880)) + ) + ) + +;; failed to figure out what this is: +(defpart 350 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.1666667) + (:fade-g -1.0833334) + (:fade-b -2.1666667) + (:fade-a -0.46666667) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 351 + :init-specs ((:fade-r 0.0) (:fade-g -1.7) (:fade-b -0.8) (:fade-a -1.0) (:next-time (seconds 0.167)) (:next-launcher 352)) + ) + +;; failed to figure out what this is: +(defpart 352 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.17) + (:fade-b -0.3) + (:fade-a -0.1) + ) + ) + +;; failed to figure out what this is: +(defpart 338 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 64.0) + (:g 192.0 64.0) + (:b 64.0) + (:a 32.0 96.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-r -1.4222223) + (:fade-g -1.4222223) + (:fade-b -1.4222223) + (:fade-a -1.4222223) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpart 353 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 20.0) + (:b 128.0) + (:a 0.0) + (:omega (degrees 0)) + (:vel-z (meters 0.13333334)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a 3.4) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-red-2-glow-trail-halt) + (:next-time (seconds 0.25)) + (:next-launcher 354) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 354 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:next-time (seconds 0.017) (seconds 0.247)) + (:next-launcher 355) + ) + ) + +;; failed to figure out what this is: +(defpart 355 + :init-specs ((:scalevel-x (meters -0.0033333334) (meters -0.006666667)) (:scalevel-y :copy scalevel-x) (:fade-a -1.7)) + ) + +;; failed to figure out what this is: +(defpart 356 + :init-specs ((:texture (blue-beam-dest level-default-water)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1.5)) + (:scale-y (meters 1)) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 357 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-fade-alpha-dist) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup gun-blue-muzzle-flare + :id 106 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 358) (sp-item 359)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-blue-2-muzzle-flare + :id 107 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 360) (sp-item 361) (sp-item 362)) + ) + +;; failed to figure out what this is: +(defpart 360 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 20.0 10.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 361 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 20.0) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.035)) + (:next-launcher 363) + ) + ) + +;; failed to figure out what this is: +(defpart 362 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 5.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:next-time (seconds 0.035)) + (:next-launcher 363) + ) + ) + +;; failed to figure out what this is: +(defpart 363 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -2.0) (:fade-g -0.8) (:fade-a -4.0)) + ) + +;; failed to figure out what this is: +(defpart 364 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:scale-y (meters 3) (meters 0.6)) + (:r 40.0) + (:g 200.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 0.08)) + (:fade-r -4.0) + (:fade-g -3.2) + (:fade-a -6.4) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-blue3-shot-impact + :id 108 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 285 :fade-after (meters 120) :falloff-to (meters 140) :period (seconds 2) :length (seconds 0.017)) + (sp-item 286 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 285 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 2) (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.05) (meters 0.05)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 128.0) + (:omega (degrees 0.0225)) + (:vel-y (meters 0.016666668) (meters 0.1)) + (:fade-r -10.2 -10.2) + (:fade-g -5.1 -5.1) + (:friction 0.85) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 286 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 200.0 30.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -10.2) + (:fade-g -6.375) + (:fade-a -8.5 -8.5) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 358 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 40.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:fade-a -5.1) + (:timer (seconds 0.05) (seconds 0.097)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + (:func 'sparticle-track-gun-joint) + ) + ) + +;; failed to figure out what this is: +(defpart 359 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.3) + (:scale-x (meters 0.2) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0) (meters -0.006666667)) + (:rotvel-z (degrees -0.26666668) (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-track-gun-joint) + ) + ) + +;; failed to figure out what this is: +(defpart 365 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 128.0 64.0) + (:b 128.0 64.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 366 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 4.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 2)) + (:r 50.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0) (meters 0.006666667)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.065)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 367 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.1 0.3) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.64) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 368 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.3) + (:scale-x (meters 0.2) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0) (meters -0.006666667)) + (:rotvel-z (degrees -0.26666668) (degrees 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.017) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-track-gun-joint) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-2-charge + :id 109 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 369 :flags (sp7)) + (sp-item 370 :flags (sp7)) + (sp-item 371 :flags (sp7)) + (sp-item 372 :flags (sp6)) + (sp-item 373 :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 369 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-converge) + (:num 0.5 0.5) + (:x (meters 1)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.035555556) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-red-2-converge) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 370 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-converge) + (:num 0.5 0.5) + (:x (meters 1)) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.035555556) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (left-multiply-quat)) + (:func 'sparticle-red-2-converge) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 371 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 20.0) + (:b 32.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334) (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-track-gun-joint-player-y) + (:next-time (seconds 0.335)) + (:next-launcher 374) + ) + ) + +;; failed to figure out what this is: +(defpart 374 + :init-specs ((:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 372 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 128.0) + (:a 20.0 40.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.167)) + (:flags (glow)) + (:userdata 409.6) + (:func 'sparticle-track-gun-joint) + ) + ) + +;; failed to figure out what this is: +(defpart 373 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 10.0 5.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:func 'sparticle-track-gun-joint) + ) + ) + +;; definition for function sparticle-track-gun-joint-player-y +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-gun-joint-player-y ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (-> arg1 key) + (let ((v1-1 *target*) + (a1-1 36) + ) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-1 node-list data a1-1)) + ) + (set! (-> arg2 x) (-> *target* gun fire-point x)) + (set! (-> arg2 y) (+ 4096.0 (-> *target* control trans y))) + (set! (-> arg2 z) (-> *target* gun fire-point z)) + 0 + (none) + ) + +;; definition for symbol *last-player-pos*, type vector +(define *last-player-pos* (new 'static 'vector)) + +;; definition for function birth-func-converge +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-converge ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (local-vars (v1-2 uint128) (v1-3 uint128)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack 'vector4w)) + ) + (set! (-> s3-0 quad) (-> *target* gun fire-point quad)) + (set! (-> s5-0 x) (- (-> arg2 x) (-> s3-0 x))) + (set! (-> s5-0 y) (- (-> arg2 y) (-> s3-0 y))) + (set! (-> s5-0 z) (- (-> arg2 z) (-> s3-0 z))) + (vector-normalize! s5-0 1.0) + (.lvf vf1 (&-> s5-0 quad)) + (vftoi12.xyzw vf2 vf1) + (.mov v1-2 vf2) + (.ppach v1-3 (the-as uint128 0) v1-2) + (set! (-> s4-0 quad) v1-3) + (vitof15.xyzw vf1 vf2) + (.svf (&-> s5-0 quad) vf1) + (set! (-> arg1 user-float) (the-as float (-> s4-0 x))) + (set! (-> arg1 omega) (the-as float (-> s4-0 y))) + ) + (none) + ) + ) + +;; definition for function sparticle-red-2-converge +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defun sparticle-red-2-converge ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (local-vars (v1-4 uint128) (v1-5 uint128) (v1-6 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (-> arg1 key) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 (new 'stack 'vector4w))) + (set! (-> v1-2 x) (the-as int (-> arg1 user-float))) + (set! (-> v1-2 y) (the-as int (-> arg1 omega))) + (let ((v1-3 (-> v1-2 quad))) + (.pextlh v1-4 v1-3 0) + ) + ) + (.pw.sra v1-5 v1-4 16) + (.mov vf2 v1-5) + (vitof12.xyzw vf1 vf2) + (.svf (&-> s4-0 quad) vf1) + (.mov v1-6 vf1) + (-> arg1 timer) + 0.0 + 0.0 + (let* ((f0-3 (* 0.0022222223 (the float (-> arg1 timer)))) + (f0-4 (* f0-3 f0-3)) + (f0-5 (- 1.0 f0-4)) + ) + (vector-normalize! s4-0 (lerp 10240.0 0.0 f0-5)) + ) + (set! (-> s5-0 quad) (-> *target* gun fire-point quad)) + (set! (-> arg2 x) (+ (-> s4-0 x) (-> s5-0 x))) + (set! (-> arg2 y) (+ (-> s4-0 y) (-> s5-0 y))) + (set! (-> arg2 z) (+ (-> s4-0 z) (-> s5-0 z))) + ) + (none) + ) + ) + +;; definition for function sparticle-red-2-glow-trail-halt +;; WARN: Return type mismatch float vs none. +(defun sparticle-red-2-glow-trail-halt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((f30-0 (-> arg1 omega)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s5-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s5-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s5-0 w) 1.0) + (let* ((f0-4 (vector-normalize-ret-len! s5-0 1.0)) + (f0-6 (- (* 300.0 f0-4) (* f30-0 (seconds-per-frame)))) + (f0-7 (fmax 0.0 f0-6)) + (f0-8 (* 0.0033333334 f0-7)) + ) + (vector-normalize! s5-0 f0-8) + ) + (set! (-> arg1 vel-sxvel x) (-> s5-0 x)) + (set! (-> arg1 vel-sxvel y) (-> s5-0 y)) + (set! (-> arg1 vel-sxvel z) (-> s5-0 z)) + ) + (none) + ) + +;; definition for symbol *gun-dark-3-nuke-fade-time*, type time-frame +(define *gun-dark-3-nuke-fade-time* (seconds 2)) + +;; failed to figure out what this is: +(when (or (zero? *gun-dark-3-nuke-fade-curve*) (!= loading-level global)) + (set! *gun-dark-3-nuke-fade-curve* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *gun-dark-3-nuke-fade-curve* 5 'loading-level (the-as uint #f)) + ) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 0 second w) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 first) 0.05) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 1 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 first) 0.2) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 2 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 3 second w) 0.78125) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second y) 0.78125) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second z) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve* pts data 4 second w) 0.0) + +;; definition for symbol *gun-dark-3-nuke-blur-segs*, type uint +(define *gun-dark-3-nuke-blur-segs* (the-as uint 10)) + +;; definition for symbol *gun-dark-3-nuke-blur-time*, type time-frame +(define *gun-dark-3-nuke-blur-time* (seconds 5)) + +;; failed to figure out what this is: +(when (or (zero? *gun-dark-3-nuke-blur-curve*) (!= loading-level global)) + (set! *gun-dark-3-nuke-blur-curve* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-blur-curve* 4 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 1 first) 0.1) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 2 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 2 second) 0.8) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 3 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve* pts data 3 second) 0.0) + +;; definition for symbol *gun-dark-3-mushroom-speed*, type float +(define *gun-dark-3-mushroom-speed* 8192.0) + +;; definition for symbol *gun-dark-3-mushroom-size-time*, type time-frame +(define *gun-dark-3-mushroom-size-time* (seconds 5)) + +;; failed to figure out what this is: +(when (or (zero? *gun-dark-3-nuke-mushroom-size-curve-x*) (!= loading-level global)) + (set! *gun-dark-3-nuke-mushroom-size-curve-x* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-mushroom-size-curve-x* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 0 second) 32768.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-x* pts data 1 second) 49152.0) + +;; failed to figure out what this is: +(when (or (zero? *gun-dark-3-nuke-mushroom-size-curve-y*) (!= loading-level global)) + (set! *gun-dark-3-nuke-mushroom-size-curve-y* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-mushroom-size-curve-y* 2 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 0 second) 16384.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 1 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-mushroom-size-curve-y* pts data 1 second) 20480.0) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark3-stalk + :id 110 + :duration (seconds 0.085) + :linger-duration (seconds 8) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 375 :flags (sp3)) (sp-item 376) (sp-item 377) (sp-item 378 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 377 + :init-specs ((:texture (edge-cloud level-default-sprite)) + (:num 10.0) + (:x (meters 0.5) (meters 1)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-x 4) + (:rot-z (degrees -90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 120.0 40.0) + (:b 40.0 10.0) + (:a 128.0) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:scalevel-y (meters 0.00066666666) (meters 0.00066666666)) + (:fade-r -0.042666666) + (:fade-g -0.042666666) + (:fade-b -0.042666666) + (:fade-a -0.042666666) + (:accel-y (meters 0.00033333333) (meters 0.0016666667)) + (:friction 0.82) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 5)) + (:next-launcher 379) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 379 + :init-specs ((:fade-a -0.08533333)) + ) + +;; failed to figure out what this is: +(defpart 376 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 10.0) + (:x (meters 0.5) (meters 1)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-x 4) + (:rot-z (degrees -90)) + (:scale-y (meters 1)) + (:r 255.0) + (:g 160.0 40.0) + (:b 90.0 30.0) + (:a 255.0) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:scalevel-y (meters 0.00066666666) (meters 0.00066666666)) + (:fade-a -0.1275 -0.1275) + (:accel-y (meters 0.00033333333) (meters 0.0016666667)) + (:friction 0.82) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 378 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 5.5)) + (:scale-x (meters 17)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 90)) + (:scale-y (meters 7.2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:vel-y (meters 0.0056666667)) + (:fade-a -0.10333333) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 375 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 5)) + (:scale-x (meters 30)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 50)) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:fade-a -0.102) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark3-ring + :id 111 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 380 :flags (is-3d sp3)) + (sp-item 381 :flags (is-3d sp3)) + (sp-item 382 :flags (is-3d sp3)) + (sp-item 383 :period (seconds 10) :length (seconds 3)) + (sp-item 384 :flags (sp7) :period (seconds 10) :length (seconds 6)) + ) + ) + +;; failed to figure out what this is: +(defpart 380 + :init-specs ((:texture (ring level-default-sprite)) + (:num 5.0) + (:y (meters 7) (meters 0.3)) + (:scale-x (meters 6)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 50.0) + (:b 0.0) + (:a 1.0) + (:fade-a 0.000100000005) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 3.335)) + (:next-launcher 385) + ) + ) + +;; failed to figure out what this is: +(defpart 385 + :init-specs ((:scalevel-x (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:next-time (seconds 2)) + (:next-launcher 386) + ) + ) + +;; failed to figure out what this is: +(defpart 386 + :init-specs ((:fade-a -0.425)) + ) + +;; failed to figure out what this is: +(defpart 381 + :init-specs ((:texture (ring level-default-sprite)) + (:num 3.0) + (:y (meters 8) (meters 0.3)) + (:scale-x (meters 10)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 50.0) + (:b 0.0) + (:a 1.0) + (:fade-a 0.000100000005) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 3.835)) + (:next-launcher 385) + ) + ) + +;; failed to figure out what this is: +(defpart 382 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters 9) (meters 0.3)) + (:scale-x (meters 14)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 50.0) + (:b 0.0) + (:a 1.0) + (:fade-a 0.000100000005) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 4.335)) + (:next-launcher 385) + ) + ) + +;; failed to figure out what this is: +(defpart 383 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 30.0) + (:a 64.0 64.0) + (:vel-z (meters 0.026666667) (meters 0.026666667)) + (:scalevel-x (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 384 + :init-specs ((:texture (water-drops level-default-sprite)) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:y (meters -2)) + (:scale-x (meters 6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 30.0) + (:a 64.0) + (:vel-y (meters -0.006666667) (meters -0.01)) + (:scalevel-x (meters -0.006666667) (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 160) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for symbol *gun-dark-3-nuke-fade-time-small*, type time-frame +(define *gun-dark-3-nuke-fade-time-small* (seconds 6)) + +;; failed to figure out what this is: +(when (or (zero? *gun-dark-3-nuke-fade-curve-small*) (!= loading-level global)) + (set! *gun-dark-3-nuke-fade-curve-small* (new 'loading-level 'curve-color-piecewise)) + (curve-color-piecewise-method-10 *gun-dark-3-nuke-fade-curve-small* 5 'loading-level (the-as uint #f)) + ) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 0 second w) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 first) 0.05) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 1 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 first) 0.2) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 2 second w) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second y) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second z) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 3 second w) 0.78125) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second x) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second y) 0.78125) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second z) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-fade-curve-small* pts data 4 second w) 0.0) + +;; definition for symbol *gun-dark-3-nuke-blur-segs-small*, type uint +(define *gun-dark-3-nuke-blur-segs-small* (the-as uint 10)) + +;; definition for symbol *gun-dark-3-nuke-blur-time-small*, type time-frame +(define *gun-dark-3-nuke-blur-time-small* (seconds 6)) + +;; failed to figure out what this is: +(when (or (zero? *gun-dark-3-nuke-blur-curve-small*) (!= loading-level global)) + (set! *gun-dark-3-nuke-blur-curve-small* (new 'loading-level 'curve2d-piecewise)) + (curve2d-piecewise-method-10 *gun-dark-3-nuke-blur-curve-small* 4 'loading-level (the-as int #f)) + ) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 0 first) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 0 second) 0.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 1 first) 0.1) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 1 second) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 2 first) 0.5) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 2 second) 0.8) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 3 first) 1.0) + +;; failed to figure out what this is: +(set! (-> *gun-dark-3-nuke-blur-curve-small* pts data 3 second) 0.0) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark3-missile-trail + :id 112 + :duration (seconds 3) + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 387)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark3-missile-trail-smoke + :id 113 + :duration (seconds 3) + :linger-duration (seconds 3) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 388 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 387 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.7) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 100.0) + (:b 30.0) + (:a 128.0 55.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 388 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 24.0 32.0) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark3-small + :id 114 + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 389 :period (seconds 15) :length (seconds 6)) + (sp-item 390 :period (seconds 15) :length (seconds 3)) + (sp-item 391 :period (seconds 15) :length (seconds 0.035)) + (sp-item 392 :flags (sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 389 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 8.0) + (:x (meters -10) (meters 20)) + (:y (meters -10) (meters 20)) + (:z (meters -10) (meters 20)) + (:scale-x (meters 0.04) (meters 0.04)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 20.0 40.0) + (:b 0.0) + (:a 128.0 128.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0) (meters 0.01)) + (:fade-a -0.2125 -0.2125) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017)) + (:next-launcher 393) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 393 + :init-specs ((:accel-x (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-y (meters -0.0033333334) 1 (meters 0.006666667)) + (:accel-z (meters -0.0033333334) 1 (meters 0.006666667)) + (:next-time (seconds 0.067) (seconds 0.03)) + (:next-launcher 393) + ) + ) + +;; failed to figure out what this is: +(defpart 390 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 60.0 20.0) + (:b 30.0) + (:a 64.0) + (:vel-z (meters 0.026666667) (meters 0.026666667)) + (:scalevel-x (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.07111111 -0.07111111) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees -8) (degrees 16)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 391 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 3)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 255.0) + (:vel-y (meters 0.00033333333) (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.032) + (:fade-b -0.012) + (:fade-a -0.102 -0.102) + (:friction 0.999) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 392 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 50)) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 255.0) + (:omega (degrees 6761.25)) + (:fade-a -0.17) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun3-dark-scorched-earth + :id 115 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 394 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 394 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 3.0) + (:scale-x (meters 4) (meters 6)) + (:scale-y (meters 5) (meters 7)) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 10)) + (:flags (left-multiply-quat)) + (:next-time (seconds 6)) + (:next-launcher 395) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 395 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark2-black-hole + :id 116 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 396 :flags (sp6)) (sp-item 397 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark2-black-hole-glow + :id 117 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 396 :flags (sp6)) (sp-item 397 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 396 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags ()) + ) + ) + +;; failed to figure out what this is: +(defpart 397 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 100.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gravity-gun-rise + :id 118 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 398 :flags (sp7)) (sp-item 399 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpartgroup group-gravity-gun-rise-no-flare + :id 119 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 398 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 398 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:y (meters -0.3)) + (:scale-x (meters 0.05) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 200.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.1125)) + (:scalevel-y (meters -0.00006666667)) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 399 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.06) + (:scale-x (meters 0)) + (:rot-x (degrees 45)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 100.0 50.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 8192.0) + (:next-time (seconds 0.5) (seconds 0.497)) + (:next-launcher 400) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 400 + :init-specs ((:scalevel-x (meters -0.0033333334) (meters -0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-gravity-gun-muzzle + :id 120 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 401 :period (seconds 5) :length (seconds 0.017)) + (sp-item 402 :period (seconds 5) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 401 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y (meters 0.4)) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 402 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y (meters 15)) + (:r 32.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters 0.1)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-dark-1-upgrade-shot + :id 121 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 403 :flags (sp7)) (sp-item 404 :flags (sp7)) (sp-item 405 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 403 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 3) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 404 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 2.0) + (:scale-x (meters 5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 1)) + (:r 16.0) + (:g 32.0 32.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.016666668)) + (:scalevel-x (meters -0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters -0.0016666667)) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-track-root) + (:next-time (seconds 0.017)) + (:next-launcher 406) + (:conerot-x (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 406 + :init-specs ((:a 255.0) (:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpart 405 + :init-specs ((:num 1.0) + (:rot-x 8) + (:r 16384.0) + (:g 1024.0) + (:b 4096.0) + (:timer (seconds 1.335)) + (:flags (distort)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function spt-func-part-gun-dark-1-upgrade-shot-edges +(defun spt-func-part-gun-dark-1-upgrade-shot-edges ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-track-root arg0 arg1 arg2) + (sparticle-2d-spline-align-instant arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc index c4ce41c03e..6e0b884dd1 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-red-shot_REF.gc @@ -2816,7 +2816,7 @@ ) (add-debug-vector #t - (bucket-id bucket583) + (bucket-id debug) (-> self start-pos) (-> self start-dir) (meters 6) @@ -2929,7 +2929,3 @@ (go-virtual idle) ) ) - - - - diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-states_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-states_REF.gc new file mode 100644 index 0000000000..0d20fed3c5 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-states_REF.gc @@ -0,0 +1,482 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate target-gun-stance (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('gun) + (let ((gp-0 (-> block param 0)) + (v0-0 (target-standard-event-handler proc argc message block)) + ) + (when v0-0 + (cond + ((= gp-0 26) + (if (logtest? (game-secrets gun-upgrade-red-1) (-> *game-info* secrets)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-fast-ja)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-ja)) + ) + ) + ((= gp-0 28) + (if (logtest? (game-secrets gun-upgrade-red-3) (-> *game-info* secrets)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-fast-ja)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-ja)) + ) + ) + ((= gp-0 27) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-red-fire-2-ja)) + ) + ((or (= gp-0 35) (= gp-0 27) (= gp-0 36) (= gp-0 37)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-dark-fire-ja)) + ) + ((or (= gp-0 29) (= gp-0 30)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-yellow-fire-low-ja)) + ) + ((= gp-0 31) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-yellow-fire-3-ja)) + ) + ((or (= gp-0 32) (= gp-0 34)) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-blue-fire-single-ja)) + ) + ((= gp-0 33) + (set! (-> self control unknown-word04) (the-as uint jakb-gun-blue-fire-2-ja)) + ) + ) + ) + v0-0 + ) + ) + (('wade) + #f + ) + (else + (target-standard-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control mod-surface) *gun-walk-mods*) + (set! (-> self control unknown-word04) (the-as uint #f)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self control bend-target) 0.0) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (target-state-hook-exit) + (target-gun-exit) + ) + :trans (behavior () + ((-> self state-hook)) + (when (= (-> self control ground-pat material) (pat-material ice)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-ice-stance) + ) + (when (or (move-legs?) (< 8192.0 (fabs (-> self gun gun-roty-rel)))) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-gun-walk) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self control bend-target) 0.0) + (remove-exit) + (go target-duck-stance #f) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (when (and (and (focus-test? self light) (nonzero? (-> self lightjak))) + (and (cpad-pressed? (-> self control cpad number) triangle) + (logtest? (game-feature lightjak-regen) (-> self game features)) + (and (< (-> self fact health) (-> self fact health-max)) (zero? (-> self lightjak latch-out-time))) + ) + ) + (set! (-> self lightjak lightjak-before-powerjak) #t) + (go target-lightjak-regen 0) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code (behavior () + (local-vars (v1-344 object)) + (let ((gp-0 (-> self skel top-anim frame-targ))) + (cond + ((or (= gp-0 jakb-gun-red-takeout-ja) + (= gp-0 jakb-gun-yellow-takeout-ja) + (= gp-0 jakb-gun-blue-takeout-ja) + (= gp-0 jakb-gun-dark-takeout-ja) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((or (= gp-0 jakb-gun-red-fire-2-ja) (= gp-0 jakb-gun-dark-fire-ja) (= gp-0 jakb-gun-blue-fire-2-ja)) + (set! (-> self control unknown-word04) (the-as uint gp-0)) + ) + ) + ) + (let ((s5-0 (-> self game gun-type))) + (b! #t cfg-143 :delay (nop!)) + (label cfg-19) + (let* ((v1-47 (gun->eco (-> self gun gun-type))) + (gp-1 (cond + ((= v1-47 (pickup-type eco-blue)) + jakb-gun-stance-blue-ja + ) + ((= v1-47 (pickup-type eco-yellow)) + jakb-gun-stance-yellow-ja + ) + ((= v1-47 (pickup-type eco-dark)) + jakb-gun-stance-dark-ja + ) + (else + jakb-gun-stance-ja + ) + ) + ) + ) + (cond + ((and (ja-group? gp-1) (= s5-0 (-> self gun gun-type))) + ) + ((let ((v1-67 (ja-group))) + (and (and v1-67 (or (= v1-67 jakb-gun-stance-ja) (= v1-67 jakb-gun-stance-dark-ja))) + (or (= gp-1 jakb-gun-stance-ja) (= gp-1 jakb-gun-stance-dark-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-transformation-twirl-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((let ((v1-106 (ja-group))) + (and (and v1-106 (or (= v1-106 jakb-gun-stance-ja) (= v1-106 jakb-gun-stance-dark-ja))) + (or (= gp-1 jakb-gun-stance-yellow-ja) (= gp-1 jakb-gun-stance-blue-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-front-to-side-hop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((let ((v1-146 (ja-group))) + (and (and v1-146 (or (= v1-146 jakb-gun-stance-yellow-ja) (= v1-146 jakb-gun-stance-blue-ja))) + (or (= gp-1 jakb-gun-stance-ja) (= gp-1 jakb-gun-stance-dark-ja)) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-side-to-front-hop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((let ((v1-186 (ja-group))) + (and (and v1-186 (or (= v1-186 jakb-gun-stance-yellow-ja) (= v1-186 jakb-gun-stance-blue-ja))) + (or (= gp-1 jakb-gun-stance-blue-ja) (= gp-1 jakb-gun-stance-yellow-ja)) + (!= (gun->eco s5-0) (gun->eco (-> self gun gun-type))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-gun-blue-to-yellow-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ((and (!= s5-0 (-> self gun gun-type)) (= (gun->eco s5-0) (gun->eco (-> self gun gun-type)))) + (ja-channel-push! 1 (seconds 0.1)) + (cond + ((= (-> self skel top-anim frame-targ) jakb-gun-side-to-side-hop-1-ja) + (ja-no-eval :group! jakb-gun-side-to-side-hop-1-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (-> self skel top-anim frame-targ) jakb-gun-side-to-side-hop-2-ja) + (ja-no-eval :group! jakb-gun-side-to-side-hop-2-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ((= (gun->eco s5-0) (pickup-type eco-yellow)) + ) + (else + (ja-no-eval :group! jakb-gun-transformation-twirl-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) + ) + ) + ) + (set! s5-0 (-> self gun gun-type)) + (suspend) + (ja :num! (loop!)) + (when (can-play-stance-amibent?) + (set-time! (-> self ambient-time)) + (target-gun-end-mode #t) + ) + (cond + ((not (-> self control unknown-spool-anim00)) + ) + (else + (b! + (not (or (= (-> self control unknown-spool-anim00) jakb-gun-dark-fire-ja) + (= (-> self control unknown-spool-anim00) jakb-gun-red-fire-2-ja) + (= (-> self control unknown-spool-anim00) jakb-gun-blue-fire-2-ja) + ) + ) + cfg-140 + :delay (nop!) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! (-> self control unknown-spool-anim00)) + (suspend) + (b! #t cfg-131 :delay (nop!)) + (label cfg-130) + (suspend) + (label cfg-131) + (let ((v1-343 (get-channel (-> self skel top-anim) 0))) + (b! (not v1-343) cfg-138 :likely-delay (set! v1-344 v1-343)) + (let ((a1-37 (= (-> v1-343 frame-group) (-> self control unknown-spool-anim00)))) + (b! (not a1-37) cfg-138 :likely-delay (set! v1-344 a1-37)) + ) + (let ((a0-110 (-> self skel root-channel 0))) + (set! (-> a0-110 num-func) num-func-identity) + (let ((f0-57 (-> v1-343 frame-num))) + (set! (-> a0-110 frame-num) f0-57) + (let ((v1-345 f0-57)) + (b! (not (the int v1-345)) cfg-138 :likely-delay (set! v1-344 v1-345)) + ) + ) + ) + ) + (set! v1-344 (= s5-0 (-> self game gun-type))) + (label cfg-138) + (b! v1-344 cfg-130 :delay (nop!)) + (set! (-> self control unknown-word04) (the-as uint #f)) + (b! #t cfg-143 :delay (nop!)) + (label cfg-140) + (ja-channel-push! 1 0) + (ja-no-eval :group! (-> self control unknown-spool-anim00) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self control unknown-word04) (the-as uint #f)) + ) + ) + ) + (label cfg-143) + (b! (using-gun? self) cfg-19 :delay (nop!)) + (let ((gp-2 (-> self skel top-anim frame-targ))) + (cond + ((or (= gp-2 jakb-gun-red-takeout-ja) (= gp-2 jakb-gun-yellow-takeout-ja) (= gp-2 jakb-gun-dark-takeout-ja)) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-2 :num! (seek! 0.0) :frame-num max) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ((= gp-2 jakb-gun-blue-takeout-ja) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! gp-2 :num! (seek! 0.0) :frame-num (ja-aframe -34.0 0)) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 0.0)) + ) + ) + ) + ) + (go target-stance) + ) + :post target-gun-post + ) + +;; failed to figure out what this is: +(defstate target-gun-walk (target) + :event target-standard-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *gun-walk-mods*) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow) (pickup-type eco-blue)) + (set! (-> self control unknown-word04) (the-as uint 0)) + 0 + ) + (else + (set! (-> self control unknown-word04) (the-as uint 1)) + ) + ) + ) + :exit (behavior () + (target-effect-exit) + (target-state-hook-exit) + (target-gun-exit) + ) + :trans (behavior () + (cond + ((zero? (-> self control unknown-spool-anim00)) + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-red) (pickup-type eco-dark)) + (remove-exit) + (go target-gun-walk) + ) + ) + ) + (else + (case (gun->eco (-> self gun gun-type)) + (((pickup-type eco-yellow) (pickup-type eco-blue)) + (remove-exit) + (go target-gun-walk) + ) + ) + ) + ) + ((-> self state-hook)) + (if (not (using-gun? self)) + (go target-walk) + ) + (if (logtest? (water-flag wading) (-> self water flags)) + (go target-wade-walk) + ) + (when (= (-> self control ground-pat material) (pat-material ice)) + (target-effect-exit) + (remove-exit) + (go target-ice-walk) + ) + (when (not (or (move-legs?) (< 182.04445 (fabs (-> self gun gun-roty-rel))))) + (target-effect-exit) + (remove-exit) + (go target-gun-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons l1) + ) + (and (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) (can-roll?)) + ) + (go target-roll) + ) + (when (and (cpad-hold? (-> self control cpad number) l1) (can-duck?)) + (target-effect-exit) + (remove-exit) + (go target-duck-walk #f) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) + (target-jump-go) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet? #t) + ) + (go target-attack) + ) + (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) + ) + (-> *cpad-list* cpads (-> self control cpad number) button0-rel 2) + ) + (pad-buttons square) + ) + (can-hands? #t) + ) + (go target-running-attack) + ) + (if (wall-hide?) + (go target-hide) + ) + (slide-down-test) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + ) + :code (behavior () + (target-walk-anim -300) + ) + :post target-gun-post + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc index 4c68072eb7..c35dd3fd6f 100644 --- a/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/logic-target_REF.gc @@ -2250,7 +2250,7 @@ (send-event self 'end-mode 'edge-grab) ) (if *display-edge-collision-marks* - ((method-of-type edge-grab-info edge-grab-info-method-10)) + (edge-grab-info-method-10 s5-0) ) (set! (-> self control ground-pat) (-> s5-0 edge-tri-pat)) (vector-normalize! @@ -2406,7 +2406,7 @@ (send-event self 'end-mode 'edge-grab) ) (if *display-edge-collision-marks* - ((method-of-type edge-grab-info edge-grab-info-method-10)) + (edge-grab-info-method-10 gp-0) ) (vector-normalize! (vector-! @@ -2471,7 +2471,7 @@ ) (add-debug-sphere #t - (bucket-id bucket583) + (bucket-id debug) (-> self control midpoint-of-hands) (meters 0.2) (the-as rgba (new 'static 'rgba :r #xff :a #x80)) @@ -2719,6 +2719,7 @@ ;; definition for function do-target-gspot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. +;; WARN: disable def twice: 76. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defbehavior do-target-gspot target () (cond ((and (logtest? (-> self control status) (collide-status on-surface)) @@ -2744,15 +2745,13 @@ (a3-0 8192.0) (t0-0 81920.0) (t1-0 1024.0) + (t2-1 (if (nonzero? (-> self pilot)) + (handle->process (-> self pilot vehicle)) + (the-as process #f) + ) + ) ) - (cond - ((nonzero? (-> self pilot)) - (handle->process (-> self pilot vehicle)) - ) - (else - ) - ) - (if (t9-0 a0-15 a1-0 (the-as collide-spec a2-1) a3-0 t0-0 t1-0) + (if (t9-0 a0-15 a1-0 (the-as collide-spec a2-1) a3-0 t0-0 t1-0 t2-1) (set! (-> self control gspot-pat-surfce) (-> gp-0 best-other-tri pat)) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc new file mode 100644 index 0000000000..cca43c6201 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc @@ -0,0 +1,2584 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type darkjak-ball +(deftype darkjak-ball (projectile) + ((impact? symbol) + (fire-point vector :inline) + (explode-sound uint32) + (bolts (array lightning-bolt)) + (ball-pos vector 2 :inline) + (trail sparticle-launch-control) + (ball1 sparticle-launch-control) + (last-ground-height float) + (fire-sound sound-id) + ) + (:methods + (setup-bolts! (_type_ vector vector) none) + ) + ) + +;; definition for method 3 of type darkjak-ball +(defmethod inspect ((this darkjak-ball)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Timpact?: ~A~%" (-> this impact?)) + (format #t "~2Tfire-point: #~%" (-> this fire-point)) + (format #t "~2Texplode-sound: ~D~%" (-> this explode-sound)) + (format #t "~2Tbolts: ~A~%" (-> this bolts)) + (format #t "~2Tball-pos[2] @ #x~X~%" (-> this ball-pos)) + (format #t "~2Ttrail: ~A~%" (-> this trail)) + (format #t "~2Tball1: ~A~%" (-> this ball1)) + (format #t "~2Tlast-ground-height: ~f~%" (-> this last-ground-height)) + (format #t "~2Tfire-sound: ~D~%" (-> this fire-sound)) + (label cfg-4) + this + ) + +;; definition for method 7 of type darkjak-ball +(defmethod relocate ((this darkjak-ball) (offset int)) + (dotimes (v1-0 (-> this bolts length)) + (if (nonzero? (-> this bolts v1-0)) + (&+! (-> this bolts v1-0) offset) + ) + ) + (if (nonzero? (-> this bolts)) + (&+! (-> this bolts) offset) + ) + (if (nonzero? (-> this trail)) + (&+! (-> this trail) offset) + ) + (if (nonzero? (-> this ball1)) + (&+! (-> this ball1) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type darkjak-ball +(defmethod deactivate ((this darkjak-ball)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this fire-sound)) + (if (nonzero? (-> this trail)) + (kill-particles (-> this trail)) + ) + (if (nonzero? (-> this ball1)) + (kill-particles (-> this ball1)) + ) + (call-parent-method this) + (none) + ) + +;; definition for function darkjak-ball-slide-reaction +(defun darkjak-ball-slide-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg3 1.0))) + 0.0 + (if (< (vector-dot a0-3 (-> arg0 surface-normal)) -0.3) + (set! (-> (the-as darkjak-ball (-> arg0 process)) impact?) #t) + ) + ) + (let ((f0-4 (vector-dot arg3 (-> arg0 surface-normal))) + (s3-0 (new 'stack-no-clear 'vector)) + (f30-0 (vector-length arg3)) + ) + (vector-float*! s3-0 (-> arg0 surface-normal) (* 1.2 f0-4)) + (vector-! s3-0 arg3 s3-0) + (vector-normalize! s3-0 1.0) + (set! (-> s3-0 y) (fmin 0.4 (-> s3-0 y))) + (set-vector! arg2 (-> arg3 x) (-> s3-0 y) (-> arg3 z) 1.0) + (vector-normalize! arg2 f30-0) + ) + (-> arg0 status) + ) + +;; definition for method 37 of type darkjak-ball +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs symbol. +(defmethod deal-damage! ((this darkjak-ball) (arg0 process) (arg1 event-message-block)) + (local-vars (sv-288 process) (sv-304 vector)) + (let ((s4-0 (new 'stack 'attack-info))) + (let ((v1-1 s4-0)) + (set! (-> v1-1 mode) (-> this attack-mode)) + (set! (-> v1-1 id) (-> this attack-id)) + (set! (-> v1-1 mask) (attack-mask mode id)) + (set! (-> v1-1 penetrate-using) (penetrate dark-smack)) + ) + (when (!= (-> this owner-handle) #f) + (set! (-> s4-0 attacker) (-> this owner-handle)) + (logior! (-> s4-0 mask) (attack-mask attacker)) + ) + (when (logtest? (-> this options) (projectile-options po13)) + (set! (-> s4-0 attacker-velocity quad) (-> this pre-move-transv quad)) + (logior! (-> s4-0 mask) (attack-mask attacker-velocity)) + ) + (set! (-> s4-0 damage) (-> this damage)) + (set! (-> s4-0 vehicle-damage-factor) (-> this vehicle-damage-factor)) + (set! (-> s4-0 vehicle-impulse-factor) (-> this vehicle-impulse-factor)) + (logior! (-> s4-0 mask) (attack-mask damage vehicle-damage-factor vehicle-impulse-factor)) + (when (logtest? (projectile-options po18) (-> this options)) + (set! (-> s4-0 invinc-time) (-> this invinc-time)) + (logior! (-> s4-0 mask) (attack-mask invinc-time)) + ) + (when arg1 + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s1-0 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry arg1) + (-> this root) + (the-as uint -1) + ) + ) + ) + (set! sv-288 arg0) + (let ((s0-0 (if (type? sv-288 process-focusable) + sv-288 + ) + ) + ) + (when s0-0 + (set! sv-304 s2-0) + (let ((v1-27 (-> (get-trans (the-as process-focusable s0-0) 3) quad))) + (set! (-> sv-304 quad) v1-27) + ) + (when (not (focus-test? (the-as process-focusable s0-0) hit)) + (if s1-0 + (get-intersect-point s2-0 s1-0 (-> this root) (the-as touching-shapes-entry arg1)) + ) + (cond + ((logtest? (-> *part-group-id-table* 77 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 77)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s2-0 quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 77)) + ) + ) + (sound-play "djak-strike-ko") + ) + ) + ) + ) + ) + (the-as symbol (send-event + arg0 + (if (logtest? (projectile-options po19) (-> this options)) + 'attack-invinc + 'attack + ) + arg1 + s4-0 + ) + ) + ) + ) + +;; definition for method 30 of type darkjak-ball +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this darkjak-ball)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) darkjak-ball-slide-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate dark-smack)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for function darkjak-ball-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun darkjak-ball-move ((arg0 darkjak-ball)) + (projectile-move-fill-line-sphere arg0) + (sound-play "hadouken-loop" :id (-> arg0 fire-sound) :position (-> arg0 root trans)) + (seek! (-> arg0 root transv y) 0.0 (* 81920.0 (seconds-per-frame))) + (seek! (-> arg0 root root-prim local-sphere w) 24576.0 (* 24576.0 (seconds-per-frame))) + (let ((v1-16 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 0)) + (a0-10 (-> (the-as collide-shape-prim-group (-> arg0 root root-prim)) child 1)) + ) + (set! (-> v1-16 local-sphere w) (* 0.1 (-> arg0 root root-prim local-sphere w))) + (set! (-> a0-10 local-sphere w) (-> arg0 root root-prim local-sphere w)) + ) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (v1-20 (new 'stack-no-clear 'vector)) + (f30-0 (* 0.5 (-> arg0 root root-prim local-sphere w))) + ) + (set! (-> v1-20 quad) (-> arg0 root trans quad)) + (vector+float*! (-> s5-0 start-pos) v1-20 *up-vector* 0.0) + (set! (-> s5-0 move-dist quad) (the-as uint128 0)) + (set! (-> s5-0 move-dist y) (- f30-0)) + (let ((v1-22 s5-0)) + (set! (-> v1-22 radius) f30-0) + (set! (-> v1-22 collide-with) (collide-spec backgnd)) + (set! (-> v1-22 ignore-process0) #f) + (set! (-> v1-22 ignore-process1) #f) + (set! (-> v1-22 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-22 action-mask) (collide-action solid)) + ) + (when (!= (fill-and-probe-using-line-sphere *collide-cache* s5-0) -100000000.0) + (set! (-> arg0 last-ground-height) (-> s5-0 best-other-tri intersect y)) + (let ((f0-18 (- (+ (-> s5-0 best-other-tri intersect y) f30-0) (-> arg0 root trans y)))) + (if (< 0.0 f0-18) + (seek! (-> arg0 root trans y) (+ (-> s5-0 best-other-tri intersect y) f30-0) (* 40960.0 (seconds-per-frame))) + ) + ) + ) + ) + (if (and (< (fabs (- (-> arg0 root trans y) (-> arg0 fire-point y))) 6144.0) + (< 16384.0 (vector-length (-> arg0 root transv))) + ) + (set! (-> arg0 impact?) #f) + ) + (if (-> arg0 impact?) + (go (method-of-object arg0 impact)) + ) + (sound-play "djak-bolt-throw" :id (-> arg0 sound-id) :position (-> arg0 root trans)) + 0 + (none) + ) + +;; definition for method 26 of type darkjak-ball +;; INFO: Used lq/sq +;; WARN: Return type mismatch smush-control vs none. +(defmethod projectile-method-26 ((this darkjak-ball)) + (sound-play "djak-strike-hit") + (cond + ((logtest? (-> *part-group-id-table* 76 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 76)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 76)) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (none) + ) + +;; failed to figure out what this is: +(defstate impact (darkjak-ball) + :virtual #t + :enter (behavior () + (sound-stop (-> self fire-sound)) + (dotimes (gp-0 (-> self bolts length)) + (lightning-bolt-method-13 (-> self bolts gp-0) 2) + ) + (when (nonzero? (-> self ball1)) + (kill-particles (-> self ball1)) + (set! (-> self ball1) (the-as sparticle-launch-control 0)) + 0 + ) + (when (nonzero? (-> self part)) + (kill-particles (-> self part)) + (set! (-> self part) (the-as sparticle-launch-control 0)) + 0 + ) + (let ((t9-5 (-> (find-parent-state) enter))) + (if t9-5 + (t9-5) + ) + ) + ) + :trans (behavior () + (dotimes (gp-0 (-> self bolts length)) + (lightning-bolt-method-11 (-> self bolts gp-0)) + (lightning-bolt-method-12 (-> self bolts gp-0)) + ) + ) + :code (behavior () + (set-time! (-> self state-time)) + (while (and (not (time-elapsed? (-> self state-time) (seconds 10))) (-> self child)) + (suspend) + ) + (go-virtual die) + ) + ) + +;; failed to figure out what this is: +(if (or (zero? *darkjak-ball-lightning*) (!= loading-level global)) + (set! *darkjak-ball-lightning* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* tex-id) (the-as uint #x403f00)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* alpha-1-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* alpha-1-repeat-dist) 262144.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* width-curve) *curve-linear-down*) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* width-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* regenerate-time-start) (seconds 0.017)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* regenerate-time-end) (seconds 0.05)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* width-range-start) 12288.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* width-range-end) 12288.0) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* fade-time) (seconds 0.3)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* uv-shift?) #t) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* uv-shift-speed) (seconds -0.5)) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *darkjak-ball-lightning* use-accurate-interp?) #t) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-hadouken + :id 172 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 624 :flags (sp7) :period (seconds 20) :length (seconds 4)) + (sp-item 625 :flags (sp7) :period (seconds 20) :length (seconds 4)) + (sp-item 626 :flags (sp7) :period (seconds 20) :length (seconds 4)) + (sp-item 627 :flags (sp3 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-hadouken-trail + :id 173 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 628 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 628 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-x (meters -0.0016666667) 2.0 (meters 0.0033333334)) + (:scalevel-y (meters -0.001) (meters -0.006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for method 31 of type darkjak-ball +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this darkjak-ball)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) + (set! (-> this attack-mode) 'dark-smack) + (set! (-> this max-speed) 163840.0) + (set! (-> this move) darkjak-ball-move) + (set! (-> this timeout) (seconds 4)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this explode-sound) (the-as uint (new-sound-id))) + (set! (-> this damage) 8.0) + (set! (-> this vehicle-damage-factor) 2.0) + (set! (-> this vehicle-impulse-factor) 3.0) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 172) this)) + (set! (-> this ball1) (create-launch-control (-> *part-group-id-table* 172) this)) + (set! (-> this trail) (create-launch-control (-> *part-group-id-table* 173) this)) + (set! (-> this impact?) #f) + (set! (-> this max-hits) 1000) + (set! (-> this fire-point quad) (-> this root trans quad)) + (set! (-> this bolts) (new 'process 'boxed-array lightning-bolt 3)) + (dotimes (s5-0 (-> this bolts length)) + (set! (-> this bolts s5-0) (new 'process 'lightning-bolt)) + (lightning-bolt-method-9 (-> this bolts s5-0) 2 16 *darkjak-ball-lightning*) + ) + (set! (-> this fire-sound) (new-sound-id)) + (let ((a0-13 (-> this root transv))) + (set! (-> a0-13 quad) (-> this root transv quad)) + (set! (-> a0-13 y) 0.0) + (vector-normalize! a0-13 1.0) + ) + (vector-float*! (-> this root transv) (-> this root transv) 245760.0) + 0 + (none) + ) + +;; definition for symbol *darkjak-ball-lightning-colors*, type (array rgba) +(define *darkjak-ball-lightning-colors* (new 'static 'boxed-array :type rgba + (new 'static 'rgba :r #xff :g #x20 :b #x80 :a #x80) + (new 'static 'rgba :r #x20 :g #x20 :b #xff :a #x80) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + ) + +;; definition for method 41 of type darkjak-ball +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod setup-bolts! ((this darkjak-ball) (arg0 vector) (arg1 vector)) + (dotimes (s3-0 (-> this bolts length)) + (let ((s2-0 (-> this bolts s3-0))) + (set! (-> s2-0 base-color) (-> *darkjak-ball-lightning-colors* s3-0)) + (set! (-> s2-0 inner-point-travel-time) (seconds 0.085)) + (set! (-> s2-0 snap-inner-points?) #t) + (set! (-> s2-0 fractal-reduction) 0.7) + (set! (-> s2-0 generate-mode) (the-as uint 1)) + (set! (-> s2-0 appearance) *darkjak-ball-lightning*) + (set! (-> s2-0 num-active-spans) 2) + (set! (-> s2-0 spans data 0 random-offset-size-start) 2048.0) + (set! (-> s2-0 spans data 1 random-offset-size-start) 2048.0) + (set! (-> s2-0 spans-internal data 0 num-inner-points) 14) + (set! (-> s2-0 spans data 0 inner-random-offset-size) 8192.0) + (set! (-> s2-0 spans data 1 inner-random-offset-size) 8192.0) + (if arg0 + (set! (-> s2-0 span-pts-start data 0 quad) (-> arg0 quad)) + ) + (if arg1 + (set! (-> s2-0 span-pts-start data 1 quad) (-> arg1 quad)) + ) + (set! (-> s2-0 spans-internal data 1 num-inner-points) 0) + (lightning-bolt-method-11 s2-0) + (lightning-bolt-method-12 s2-0) + ) + ) + (none) + ) + +;; definition for function sparticle-track-hadouken +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-hadouken ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let ((a3-0 (the-as darkjak-ball (-> arg1 key proc))) + (v1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-1 quad) + (-> (the-as (pointer uint128) (+ (+ (* (-> arg1 user-float) 16) 556) (the-as int a3-0)))) + ) + (set! (-> arg2 x) (-> v1-1 x)) + (set! (-> arg2 y) (-> v1-1 y)) + (set! (-> arg2 z) (-> v1-1 z)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 624 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 625 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.1) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -5.12) + (:fade-g -10.2) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 626 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 4.0) + (:scale-x (meters 4)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 2)) + (:r 0.0 16.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters -0.016666668)) + (:scalevel-x (meters -0.033333335) (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y (meters -0.0033333334)) + (:timer (seconds 0.167) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:next-time (seconds 0.017)) + (:next-launcher 629) + (:conerot-x (degrees -180) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 629 + :init-specs ((:a 255.0) (:fade-a -5.12)) + ) + +;; failed to figure out what this is: +(defpart 627 + :init-specs ((:num 1.0) + (:rot-x 8) + (:r 32768.0) + (:g 2048.0) + (:b 8192.0) + (:timer (seconds 4)) + (:flags (distort)) + (:userdata 0.0) + (:func 'sparticle-track-hadouken) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for method 25 of type darkjak-ball +;; INFO: Used lq/sq +(defmethod projectile-method-25 ((this darkjak-ball)) + (let* ((f0-0 0.75) + (f1-0 65536.0) + (f2-1 (* 0.0033333334 (the float (current-time)))) + (f0-2 (* f1-0 (/ (- f2-1 (* (the float (the int (/ f2-1 f0-0))) f0-0)) f0-0))) + (s3-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) *x-vector* f0-2)) + (s5-0 (-> this ball-pos)) + (s4-0 (-> this ball-pos 1)) + ) + (vector-float*! s3-0 s3-0 (* 0.75 (-> this root root-prim local-sphere w))) + (vector+! (the-as vector s5-0) (-> this root trans) s3-0) + (set! (-> *part-id-table* 625 init-specs 16 initial-valuef) 0.0) + (set! (-> *part-id-table* 626 init-specs 16 initial-valuef) 0.0) + (set! (-> *part-id-table* 627 init-specs 7 initial-valuef) 0.0) + (set! (-> *part-id-table* 624 init-specs 11 initial-valuef) 0.0) + (spawn (-> this part) (the-as vector s5-0)) + (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) + (set! (-> *part-id-table* 625 init-specs 16 initial-valuef) (the-as float #x1)) + (set! (-> *part-id-table* 626 init-specs 16 initial-valuef) (the-as float #x1)) + (set! (-> *part-id-table* 627 init-specs 7 initial-valuef) (the-as float #x1)) + (set! (-> *part-id-table* 624 init-specs 11 initial-valuef) (the-as float #x1)) + (spawn (-> this ball1) s4-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + (set! (-> s3-1 quad) (-> this root trans quad)) + (let ((s2-0 matrix-f-u-compose) + (s1-0 (new 'stack-no-clear 'matrix)) + (a0-21 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-21 quad) (-> this root transv quad)) + (set! (-> a0-21 y) 0.0) + (let ((a1-10 (s2-0 s1-0 (vector-normalize! a0-21 1.0) *up-vector*))) + (set! (-> s3-1 y) (-> this last-ground-height)) + (+! (-> s3-1 y) 1638.4) + (set! (-> a1-10 trans quad) (-> s3-1 quad)) + (spawn-from-mat (-> this trail) a1-10) + ) + ) + ) + (setup-bolts! this (the-as vector s5-0) s4-0) + ) + (none) + ) + +;; definition for function target-darkjak-setup +;; WARN: Return type mismatch int vs none. +(defbehavior target-darkjak-setup target ((arg0 symbol)) + (when (zero? (-> self darkjak)) + (set! (-> self darkjak) (new 'process 'darkjak-info)) + (set! (-> self darkjak process) (the-as (pointer target) (process->ppointer self))) + (let* ((v1-4 (-> self game)) + (a0-5 (+ (-> v1-4 attack-id) 1)) + ) + (set! (-> v1-4 attack-id) a0-5) + (set! (-> self darkjak attack-id) a0-5) + ) + (set! (-> self darkjak hud 0) (the-as handle #f)) + (set! (-> self darkjak charge-effect) (the-as handle #f)) + (set! (-> self darkjak tone) (new-sound-id)) + (set! (-> self darkjak-giant-interp) 1.0) + (set! (-> self darkjak mode-sound-bank) #f) + (set! (-> self darkjak latch-out-time) 0) + 0 + ) + 0 + (none) + ) + +;; definition for function want-to-darkjak? +(defbehavior want-to-darkjak? target () + (and (not *pause-lock*) + (-> *setting-control* user-current darkjak) + (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + (not (focus-test? + self + dead + hit + grabbed + in-head + under-water + edge-grab + pole + flut + tube + light + board + pilot + mech + carry + indax + teleporting + ) + ) + (not (and (logtest? (-> self water flags) (water-flag under-water)) + (not (logtest? (-> self water flags) (water-flag swim-ground))) + ) + ) + (and (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) + (and (time-elapsed? (-> self fact darkjak-start-time) (seconds 0.05)) (< 0.0 (-> self game eco-pill-dark))) + ) + (zero? (-> self darkjak latch-out-time)) + ) + ) + ) + +;; failed to figure out what this is: +(let ((v1-56 (copy *walk-mods* 'global))) + (set! (-> v1-56 name) 'darkjak) + (set! (-> v1-56 flags) (surface-flag gun-off)) + (set! *darkjak-trans-mods* v1-56) + ) + +;; definition for function target-darkjak-end-mode +;; WARN: Return type mismatch int vs none. +(defbehavior target-darkjak-end-mode target ((arg0 symbol)) + (when (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (cond + (arg0 + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self darkjak lightning-count) 0) + (logclear! (-> self focus-status) (focus-status dark)) + (send-event self 'reset-collide) + (logclear! (-> self target-flags) (target-flags tf4)) + (remove-setting! 'sound-flava) + (remove-setting! 'string-min-length) + (remove-setting! 'string-max-length) + (remove-setting! 'string-spline-max-move) + (remove-setting! 'string-spline-accel) + (remove-setting! 'string-spline-max-move-player) + (remove-setting! 'string-spline-accel-player) + (setting-control-method-14 *setting-control* (-> self darkjak mode-sound-bank)) + (set! (-> self darkjak mode-sound-bank) #f) + (sound-stop (-> self darkjak tone)) + (set! (-> self pending-ext-anim) (target-anim default)) + (if (< (-> self game eco-pill-dark) 1.0) + (send-event self 'get-pickup (pickup-type eco-pill-dark) -1.0) + ) + (target-invisible-stop) + (let ((v1-45 (ja-group))) + (when (not (and (and v1-45 + (or (= v1-45 jakb-darkjak-get-off-ja) + (= v1-45 jakb-darkjak-get-off-end-ja) + (= v1-45 jakb-darkjak-get-on-fast-ja) + (= v1-45 (-> self draw art-group data 461)) + ) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + (sound-play "djak-off") + (countdown (v1-57 (+ (-> self skel active-channels) (-> self skel float-channels))) + (let ((a0-36 (-> self skel channel v1-57))) + (cond + ((= (-> a0-36 frame-group) (-> self draw art-group data 442)) + (set! (-> a0-36 frame-group) (the-as art-joint-anim jakb-walk-ja)) + ) + ((= (-> a0-36 frame-group) (-> self draw art-group data 443)) + (set! (-> a0-36 frame-group) (the-as art-joint-anim jakb-run-ja)) + ) + ) + ) + ) + (joint-control-cleanup + (-> self skel) + (-> self ext-anim-control heap) + (the-as art-joint-anim jakb-stance-loop-ja) + ) + (send-event (ppointer->process (-> self sidekick)) 'cleanup) + ) + ) + (set! (-> self darkjak latch-out-time) 0) + 0 + ) + ((zero? (-> self darkjak latch-out-time)) + (if (!= (-> self darkjak-interp) 0.0) + (set-time! (-> self darkjak latch-out-time)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-darkjak-process +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior target-darkjak-process target () + (local-vars (a3-3 vector)) + (cond + ((nonzero? (-> self darkjak latch-out-time)) + (if (time-elapsed? (-> self darkjak latch-out-time) (seconds 0.4)) + (target-darkjak-end-mode #t) + ) + ) + ((and (focus-test? self dark) (nonzero? (-> self darkjak))) + (let ((a1-0 'eco-red)) + (target-danger-set! (-> self control danger-mode) a1-0) + ) + (update-transforms (-> self control)) + (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-1 options) (overlaps-others-options)) + (set! (-> a1-1 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-1 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-1) + ) + (target-danger-set! (-> self control danger-mode) #f) + (update-transforms (-> self control)) + (if (and (or (< (-> self game eco-pill-dark) 1.0) + (or (not (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + (not (-> *setting-control* user-current darkjak)) + ) + ) + (not (focus-test? self dead dangerous hit grabbed)) + (not (and (-> self next-state) (let ((v1-37 (-> self next-state name))) + (or (= v1-37 'target-darkjak-get-on) (= v1-37 'target-darkjak-get-off)) + ) + ) + ) + (or (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (not (-> *setting-control* user-current darkjak)) + (not (logtest? (the-as game-feature (logand (game-feature darkjak) (-> *setting-control* user-current features))) + (-> self game features) + ) + ) + ) + ) + (go target-darkjak-get-off) + ) + ) + (else + (seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame))) + (if (= (-> self darkjak-interp) 0.0) + (set! (-> self darkjak-giant-interp) 1.0) + ) + ) + ) + (seekl! (-> self darkjak lightning-count) 0 1) + (let ((f30-0 (-> self darkjak-interp))) + (let ((f28-0 (lerp-scale 1.0 (* 1.05 (-> self darkjak-giant-interp)) f30-0 0.0 1.0)) + (f26-0 (lerp-scale 1.0 (* 0.20000002 (+ 5.0 (-> self darkjak-giant-interp))) f30-0 0.0 1.0)) + ) + (set-vector! (-> self control scale) f28-0 f28-0 f28-0 1.0) + (let ((a3-2 (new 'stack-no-clear 'vector))) + (set! (-> a3-2 x) f26-0) + (set! (-> a3-2 y) 1.0) + (set! (-> a3-2 z) f26-0) + (set! (-> a3-2 w) 1.0) + (trs-set! (-> self upper-body) (the-as vector #f) (the-as quaternion #f) a3-2) + ) + (let ((f0-15 (* 1.1 f26-0))) + (cond + ((= (-> self ext-geo) (target-geo jakb)) + (set! a3-3 (new 'stack-no-clear 'vector)) + (set! (-> a3-3 x) (/ f28-0 (* f28-0 f0-15))) + (set! (-> a3-3 y) (/ f28-0 f28-0)) + (set! (-> a3-3 z) (/ f28-0 (* f28-0 f0-15))) + (set! (-> a3-3 w) 1.0) + ) + (else + (set! a3-3 (new 'stack-no-clear 'vector)) + (set! (-> a3-3 x) (* 0.95 (/ f28-0 (* f28-0 f0-15)))) + (set! (-> a3-3 y) (* 0.92 (/ f28-0 f28-0))) + (set! (-> a3-3 z) (* 0.95 (/ f28-0 (* f28-0 f0-15)))) + (set! (-> a3-3 w) 1.0) + ) + ) + ) + ) + (cond + ((logtest? (game-secrets little-head) (-> self game secrets)) + (dotimes (v1-73 3) + (set! (-> a3-3 data v1-73) (* 0.4 (-> a3-3 data v1-73))) + ) + ) + ((logtest? (game-secrets big-head) (-> self game secrets)) + (dotimes (v1-79 3) + (set! (-> a3-3 data v1-79) (* 2.0 (-> a3-3 data v1-79))) + ) + ) + ) + (trs-set! (-> self neck) (the-as vector #f) (the-as quaternion #f) a3-3) + (let* ((a0-42 (-> self horns)) + (t9-13 (method-of-object a0-42 trs-set!)) + (a1-14 #f) + (a2-6 #f) + (a3-4 (new 'stack-no-clear 'vector)) + ) + (set! (-> a3-4 x) f30-0) + (set! (-> a3-4 y) f30-0) + (set! (-> a3-4 z) f30-0) + (set! (-> a3-4 w) 1.0) + (t9-13 a0-42 (the-as vector a1-14) (the-as quaternion a2-6) a3-4) + ) + (when (and (>= f30-0 0.5) (and (not (focus-test? self in-head)) + (not (logtest? (-> self draw status) (draw-control-status no-draw no-draw-temp))) + (not (movie?)) + ) + ) + (if (= (-> self invisible-interp) 0.0) + (launch-particles + (-> *part-id-table* 173) + (process-drawable-random-point! self (new 'stack-no-clear 'vector)) + ) + ) + (cond + ((!= (-> self invisible-interp) 0.0) + ) + ((rand-vu-percent? 0.25) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.02)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (process-drawable-shock-wall-effect + self + (-> *lightning-spec-id-table* 9) + lightning-probe-callback + (-> *part-id-table* 187) + ) + ) + ) + ((rand-vu-percent? 0.1) + (when (>= (- (-> *display* game-clock frame-counter) (-> self shock-effect-time)) (seconds 0.02)) + (set! (-> self shock-effect-time) (-> *display* game-clock frame-counter)) + (process-drawable-shock-effect + self + (-> *lightning-spec-id-table* 7) + lightning-probe-callback + (-> *part-id-table* 187) + 0 + 0 + 40960.0 + ) + ) + ) + ) + ) + (set-darkjak-texture-morph! (if (logtest? (-> self target-effect) 64) + 1.0 + f30-0 + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-darkjak-get-on (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('darkjak) + (when (zero? (-> self darkjak want-stage)) + (set! (-> self darkjak want-stage) (the-as darkjak-stage (-> block param 0))) + #t + ) + ) + (('touched) + (if ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self control) + (the-as uint 1920) + ) + (target-send-attack + proc + (-> self control danger-mode) + (the-as touching-shapes-entry (-> block param 0)) + (the-as int (-> self control target-attack-id)) + (the-as int (-> self control attack-count)) + (-> self control penetrate-using) + ) + (target-generic-event-handler proc argc message block) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self darkjak-interp) 1.0) + (remove-setting! 'bg-r) + (remove-setting! 'bg-g) + (remove-setting! 'bg-b) + (remove-setting! 'bg-a) + (persist-with-delay *setting-control* 'bg-a-speed (seconds 3) 'bg-a-speed 'abs 0.5 0) + (target-danger-set! 'harmless #f) + (remove-setting! 'gun) + (persist-with-delay *setting-control* 'gun (seconds 0.5) 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-gun-end-mode #t) + ) + :code (behavior ((arg0 darkjak-stage)) + (send-event (handle->process (-> self notify)) 'notify 'attack 19) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (target-lightjak-end-mode #t) + (set! (-> self darkjak latch-out-time) 0) + (set! (-> self lightjak get-off-lock) #f) + (set! (-> self darkjak stage) (logior arg0 (darkjak-stage bomb0))) + (if (logtest? (game-feature darkjak-bomb0) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage invinc)) + ) + (if (logtest? (game-feature darkjak-bomb1) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage giant)) + ) + (if (logtest? (game-feature feature45) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage disable-force-on)) + ) + (if (logtest? (game-feature feature44) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage no-anim)) + ) + (if (logtest? (game-feature darkjak-smack) (-> self game features)) + (logior! (-> self darkjak stage) (darkjak-stage bomb1)) + ) + (set! (-> self darkjak want-stage) (-> self darkjak stage)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *darkjak-trans-mods*) + (set-time! (-> self darkjak start-time)) + (set! (-> self darkjak attack-count) (the-as uint 0)) + (set! (-> self darkjak-giant-interp) 1.0) + (logior! (-> self focus-status) (focus-status dark)) + (set! (-> self pending-ext-anim) (target-anim dark)) + (set-time! (-> self fact darkjak-start-time)) + (set! (-> self fact darkjak-effect-time) (seconds 20)) + (set! (-> self darkjak mode-sound-bank) (the-as connection (add-setting! 'mode-sound-bank 'modedark 0.0 0))) + (set! (-> self darkjak lightning-count) 0) + (cond + ((logtest? (-> self darkjak stage) (darkjak-stage ds8)) + (logclear! (-> self target-flags) (target-flags tf4)) + (logclear! (-> self darkjak stage) (darkjak-stage bomb1 invinc giant no-anim disable-force-on)) + (target-invisible-start (-> *TARGET-bank* invisible-duration)) + (set! (-> self fact darkjak-effect-time) (-> *TARGET-bank* invisible-duration)) + ) + ((logtest? (-> self darkjak stage) (darkjak-stage disable-force-on)) + (logior! (-> self target-flags) (target-flags tf4)) + ) + (else + (logclear! (-> self target-flags) (target-flags tf4)) + ) + ) + (if (logtest? arg0 (darkjak-stage ds9)) + (go target-stance) + ) + (target-start-attack) + (target-danger-set! 'get-on #f) + (set-setting! 'bg-r 'abs 0.1 0) + (set-setting! 'bg-b 'abs 0.1 0) + (set-forward-vel 0.0) + (let ((gp-1 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-1 (- (current-time) (-> self clock old-frame-counter))) + (if (>= gp-1 300) + (go target-falling #f) + ) + (suspend) + ) + ) + (sound-play "djak-transform") + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-darkjak-get-on-fast-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 0.0 1.0 (ja-aframe-num 0) 5.0 15.0)) + (set-setting! 'bg-a 'abs (* 0.45 (-> self darkjak-interp)) 0) + (suspend) + (ja :num! (seek!)) + ) + (while (!= (-> self ext-anim) (target-anim dark)) + (let ((v1-135 (ja-group))) + (when (not (and v1-135 (= v1-135 jakb-darkjak-get-on-fast-loop-ja))) + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! jakb-darkjak-get-on-fast-loop-ja :num! min) + ) + ) + (suspend) + (ja :num! (loop!)) + ) + (go target-stance) + ) + :post (-> target-grab post) + ) + +;; failed to figure out what this is: +(defstate target-darkjak-get-off (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'lightjak 'slide 'wade 'launch 'edge-grab) + #f + ) + (('change-mode) + (case (-> block param 0) + (('grab) + (when (not (focus-test? self dead)) + (if (not (-> block param 1)) + #t + (go target-grab 'stance) + ) + ) + ) + ) + ) + (('attack-invinc) + (target-attacked + message + (the-as attack-info (-> block param 1)) + proc + (the-as touching-shapes-entry (-> block param 0)) + target-hit + ) + ) + (else + (target-generic-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags lleg-still rleg-still)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *darkjak-trans-mods*) + (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) + ) + :exit (behavior () + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still)) + (target-darkjak-end-mode #t) + ) + :trans (-> target-darkjak-get-on trans) + :code (behavior () + (let ((v1-1 (-> self water flags))) + (cond + ((and (logtest? (water-flag touch-water) v1-1) + (logtest? (water-flag under-water swimming) v1-1) + (not (logtest? (focus-status mech) (-> self focus-status))) + ) + (go target-swim-stance) + ) + ((let ((v1-10 (ja-group))) + (not (and v1-10 (= v1-10 jakb-darkjak-get-on-fast-ja))) + ) + (let ((gp-0 0)) + (while (not (logtest? (-> self control status) (collide-status on-surface))) + (target-falling-anim-trans) + (+! gp-0 (- (current-time) (-> self clock old-frame-counter))) + (if (>= gp-0 300) + (go target-falling #f) + ) + (suspend) + ) + ) + ) + ) + ) + (cond + ((logtest? (-> self control status) (collide-status on-water)) + ) + (else + (let ((v1-30 (ja-group))) + (cond + ((and v1-30 (= v1-30 jakb-darkjak-get-on-fast-ja)) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (seek! (-> self darkjak-interp) 0.0 (* 2.0 (seconds-per-frame))) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.1)) + ) + ((let ((v1-43 (ja-group))) + (and v1-43 (or (= v1-43 (-> self draw art-group data 451)) + (= v1-43 (-> self draw art-group data 466)) + (= v1-43 (-> self draw art-group data 467)) + (= v1-43 (-> self draw art-group data 468)) + ) + ) + ) + (sound-play "djak-off") + (ja-no-eval :group! (-> self draw art-group data 461) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) + (suspend) + (ja :num! (seek!)) + ) + ) + ((let ((v1-74 (ja-group))) + (and v1-74 (= v1-74 (-> self draw art-group data 461))) + ) + (sound-play "djak-off") + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (set! (-> self darkjak-interp) (lerp-scale 1.0 0.0 (ja-aframe-num 0) 90.0 115.0)) + (suspend) + (ja-eval) + ) + ) + (else + (sound-play "djak-off") + (ja-channel-push! 1 (seconds 0.05)) + (ja-no-eval :group! jakb-darkjak-get-off-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (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)) + (goto cfg-79) + ) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! jakb-darkjak-get-off-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (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)) + (goto cfg-79) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + ) + ) + (label cfg-79) + (vector-reset! (-> self control transv)) + ((-> target-darkjak-get-off exit)) + (go target-stance) + ) + :post (-> target-grab post) + ) + +;; failed to figure out what this is: +(defstate target-darkjak-running-attack (target) + :event (-> target-running-attack event) + :enter (-> target-running-attack enter) + :exit (behavior () + (remove-setting! 'rapid-tracking) + ((-> target-running-attack exit)) + ) + :trans (-> target-running-attack trans) + :code (behavior () + (local-vars + (sv-16 float) + (sv-20 float) + (sv-24 int) + (sv-32 int) + (sv-40 int) + (sv-48 float) + (sv-56 handle) + (sv-64 int) + ) + (set-setting! 'rapid-tracking #f 0.0 0) + ((lambda :behavior target + () + (set! (-> self control bend-target) (* 0.5 (-> self control bend-target))) + (if (logtest? (water-flag touch-water) (-> self water flags)) + (sound-play "swim-stroke") + ) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (cond + ((zero? (-> self control unknown-word000)) + (set! (-> self control unknown-word000) 1) + (-> self draw art-group data 452) + ) + (else + (set! (-> self control unknown-word000) 0) + (-> self draw art-group data 459) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! gp-1 :num! (seek!)) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-punch-inc))) + ) + (let ((a0-11 (-> self control impact-ctrl)) + (t9-7 (method-of-type impact-control initialize)) + (a1-5 self) + (v1-44 (ja-group)) + ) + (t9-7 + a0-11 + a1-5 + (if (and v1-44 (= v1-44 (-> self draw art-group data 452))) + 28 + 19 + ) + 3276.8 + (-> self control root-prim prim-core collide-with) + ) + ) + ) + ) + (set! sv-16 (the-as float 0.0)) + (set! sv-20 (the-as float 1.0)) + (set! sv-24 0) + (set! sv-32 0) + (set! sv-40 0) + (set! sv-48 (the-as float 1.0)) + (set! sv-56 (the-as handle #f)) + (set! sv-64 0) + (until (ja-done? 0) + (if (and (cpad-pressed? (-> self control cpad number) square) + (not (logtest? (-> self target-flags) (target-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) (darkjak-stage bomb0)) + ) + (< sv-32 2) + ) + (set! sv-40 (the-as int (current-time))) + ) + (when (time-elapsed? (the-as time-frame sv-40) (seconds 0.5)) + (set! sv-40 0) + 0 + ) + (if (and (nonzero? sv-40) + (< (- (the float (+ (-> (ja-group) frames num-frames) -1)) (/ 2.0 (-> (ja-group) artist-step))) + (ja-frame-num 0) + ) + ) + ((lambda :behavior target + ((arg0 (pointer float)) (arg1 (pointer int64)) (arg2 (pointer int64))) + (let ((s3-0 (if (and (focus-test? self dark) + (nonzero? (-> self darkjak)) + (logtest? (-> self darkjak stage) (darkjak-stage no-anim)) + ) + (combo-tracker-method-13 + (-> self control unknown-combo-tracker00) + (-> self control send-attack-dest) + (-> self control trans) + 24576.0 + (-> self control c-R-w fvec) + 65536.0 + ) + ) + ) + ) + (when #t + (+! (-> arg1 0) 1) + (if s3-0 + (combo-tracker-method-12 + (-> self control unknown-combo-tracker00) + (-> self control trans) + (get-trans s3-0 3) + s3-0 + (current-time) + ) + ) + (target-start-attack) + (target-danger-set! 'punch #f) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-punch-inc))) + ) + (let ((v1-34 (ja-group))) + (cond + ((and v1-34 (or (= v1-34 (-> self draw art-group data 452)) (= v1-34 (-> self draw art-group data 459)))) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 454) :num! (seek!)) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 463) :num! (seek!)) + ) + ) + ) + (initialize (-> self control impact-ctrl) self 28 3276.8 (-> self control root-prim prim-core collide-with)) + (set! (-> arg0 0) (fmax 0.0 (-> arg0 0))) + ) + ) + (set! (-> arg2 0) 0) + 0 + ) + (& sv-16) + (the-as (pointer int64) (& sv-32)) + (the-as (pointer int64) (& sv-40)) + ) + ) + (compute-alignment! (-> self align)) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-frame-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((and (nonzero? sv-32) + (>= sv-16 -40960.0) + (let ((v1-83 (ja-group))) + (not (and (and v1-83 (= v1-83 jakb-darkjak-attack-combo3-ja)) (>= (ja-aframe-num 0) 77.0))) + ) + (send-event (handle->process (-> self control unknown-combo-tracker00 target)) 'combo) + ) + (let* ((s5-0 (handle->process (-> self control unknown-combo-tracker00 target))) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (let ((s5-1 (get-trans (the-as process-focusable gp-0) 3))) + (when (and (< 2048.0 (vector-vector-distance (-> self control trans) s5-1)) + (or (and (= gp-0 (handle->process sv-56)) (not (time-elapsed? (the-as time-frame sv-64) (seconds 0.1)))) + (time-elapsed? (the-as time-frame sv-64) (seconds 1)) + ) + ) + (forward-up-nopitch->quaternion + (-> self control dir-targ) + (vector-! (new 'stack-no-clear 'vector) s5-1 (-> self control trans)) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) + ) + (let ((v1-124 + (point-tracker-method-11 + (-> self control unknown-combo-tracker00) + (new 'stack-no-clear 'vector) + (-> self control trans) + s5-1 + (* 0.009107469 (the float (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)))) + ) + ) + ) + (set! sv-16 (fmin 163840.0 (sqrtf (+ (* (-> v1-124 x) (-> v1-124 x)) (* (-> v1-124 z) (-> v1-124 z)))))) + ) + (set-forward-vel sv-16) + ) + ) + (when (!= gp-0 (handle->process sv-56)) + (set! sv-56 (process->handle gp-0)) + (set! sv-64 (the-as int (current-time))) + ) + ) + ) + ((< sv-16 0.0) + (set! sv-16 (seek sv-16 -0.04096 (* 491520.0 (seconds-per-frame)))) + (set-forward-vel sv-16) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) + ) + (set-forward-vel 0.0) + ) + ((and (not (cpad-hold? (-> self control cpad number) square)) + (zero? sv-32) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.2)) + ) + (if (= (-> self control ground-pat material) (pat-material ice)) + (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) + (set-forward-vel (* 0.8 (-> self control ctrl-xz-vel))) + ) + ) + ((ja-done? 0) + (set-forward-vel sv-16) + ) + (else + (set! sv-16 + (* (target-align-vel-z-adjust (-> self align delta trans z)) (-> self clock frames-per-second) sv-20) + ) + (set-forward-vel sv-16) + ) + ) + ) + (let ((gp-1 (new-stack-vector0))) + (vector-matrix*! gp-1 (-> self control transv) (-> self control w-R-c)) + (set! (-> gp-1 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) gp-1 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! sv-16 (the-as float (-> self control unknown-word04))) + (set! (-> self control unknown-word04) (the-as uint 0.0)) + ) + (when (and (>= sv-16 0.0) + (let ((gp-2 (ja-group)) + (f30-2 (ja-aframe-num 0)) + ) + (if (or (and (= gp-2 (-> self draw art-group data 452)) + (>= f30-2 11.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 452)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= gp-2 (-> self draw art-group data 459)) + (>= f30-2 11.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 459)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= gp-2 (-> self draw art-group data 454)) + (>= f30-2 49.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 454)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (and (= gp-2 jakb-darkjak-attack-combo3-ja) + (or (and (>= f30-2 62.0) (>= 77.0 f30-2)) + (and (>= f30-2 82.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-darkjak-attack-combo3-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + ) + (and (= gp-2 (-> self draw art-group data 463)) + (>= f30-2 62.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 463)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + ) + #t + ) + ) + ) + (let ((gp-3 (new 'stack-no-clear 'collide-query))) + (when (and (>= (impact-control-method-11 + (-> self control impact-ctrl) + gp-3 + (the-as process #f) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + 0.0 + ) + (>= 0.0 (vector-dot (-> gp-3 best-other-tri normal) (-> self control impact-ctrl dir))) + ) + (when (= (-> gp-3 best-other-tri pat mode) (pat-mode wall)) + (cond + ((logtest? (-> *part-group-id-table* 12 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 12)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-3 best-other-tri intersect quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 12)) + ) + ) + (let ((name (static-sound-name "djak-punch-hit"))) + (play-effect-sound + (-> self skel effect) + (the-as symbol "punch") + -1.0 + (-> self control impact-ctrl joint) + (the-as basic #f) + (the-as sound-name name) + ) + ) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! sv-16 (the-as float -61440.0)) + ) + ) + ) + ) + (let ((gp-6 (ja-group)) + (f0-59 (ja-aframe-num 0)) + ) + (if (and (= gp-6 jakb-darkjak-attack-combo3-ja) + (>= f0-59 80.0) + (>= (the float (+ (-> (the-as art-joint-anim jakb-darkjak-attack-combo3-ja) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.6 1.0) + ) + ) + (suspend) + (ja :num! (seek! max (* (-> self control current-surface align-speed) sv-48))) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (if (< 2 sv-24) + (set! sv-20 (* sv-20 (fmin 1.0 (-> self control zx-vel-frac)))) + ) + (set! sv-24 (+ sv-24 1)) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (go target-stance) + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-darkjak-smack-charge (target) + :event target-standard-event-handler + :enter (-> (the-as (state target) target-duck-stance) enter) + :exit (behavior () + (remove-setting! 'bg-r) + (remove-setting! 'bg-g) + (remove-setting! 'bg-b) + (remove-setting! 'bg-a) + (update-rates! (-> *display* entity-clock) 1.0) + (persist-with-delay *setting-control* 'bg-a-speed (seconds 3) 'bg-a-speed 'abs 0.5 0) + (let ((gp-0 (handle->process (-> self darkjak charge-effect)))) + (when gp-0 + (let ((v1-18 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-18 command) (sound-command set-param)) + (set! (-> v1-18 id) (-> self control unknown-sound-id00)) + (set! (-> v1-18 params volume) -4) + (set! (-> v1-18 auto-time) 120) + (set! (-> v1-18 auto-from) 2) + (set! (-> v1-18 params mask) (the-as uint 17)) + (-> v1-18 id) + ) + (deactivate gp-0) + ) + ) + ((-> target-duck-stance exit)) + ) + :trans (behavior () + ((-> self state-hook)) + (if (and (not (cpad-hold? (-> self control cpad number) r1)) + (and (focus-test? self dark) (nonzero? (-> self darkjak))) + (= (-> self ext-anim) (target-anim dark)) + (zero? (-> self darkjak latch-out-time)) + (logtest? (the-as game-feature (logand (game-feature darkjak-smack) (-> *setting-control* user-current features))) + (-> self game features) + ) + (can-hands? #t) + ) + (go target-darkjak-smack) + ) + (if (or (or (not (cpad-hold? (-> self control cpad number) r1)) + (logtest? (-> self target-flags) (target-flags prevent-attack prevent-duck)) + ) + (!= (-> self ext-anim) 2) + ) + (go target-stance) + ) + (if (want-to-powerjak?) + (go target-powerjak-get-on) + ) + (fall-test target-falling (-> *TARGET-bank* fall-height)) + (slide-down-test) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and (and v1-2 (= v1-2 (-> self draw art-group data 478))) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) + ((and (and (focus-test? self dark) (nonzero? (-> self darkjak))) (= (-> self ext-anim) (target-anim dark))) + (ja-channel-push! 1 (seconds 0.2)) + ) + (else + (go target-stance) + ) + ) + ) + (until #f + (set-setting! 'bg-r 'abs 0.1 0) + (set-setting! 'bg-b 'abs 0.1 0) + (set-setting! 'bg-a 'abs 0.45 0) + (update-rates! (-> *display* entity-clock) 0.4) + (ja-no-eval :group! (-> self draw art-group data 478) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((v1-46 (and (= (-> self skel root-channel 0) (-> self skel channel)) + (not (handle->process (-> self darkjak charge-effect))) + ) + ) + ) + (when v1-46 + (set! (-> self control unknown-sound-id00) (sound-play "djak-bolt-charg")) + (set! (-> self darkjak charge-effect) + (ppointer->handle (if (logtest? (-> *part-group-id-table* 75 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 75) + :duration -1 + :target self + :mat-joint 59 + ) + (part-tracker-spawn + part-tracker + :to self + :group (-> *part-group-id-table* 75) + :duration -1 + :target self + :mat-joint 59 + ) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post target-post + ) + +;; failed to figure out what this is: +(defstate target-darkjak-smack (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + ((-> target-running-attack event) proc argc message block) + ) + :enter (behavior () + ((-> target-running-attack enter)) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + ) + :exit (behavior () + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* part-clock) 1.0) + (remove-setting! 'gun) + ((-> target-darkjak-running-attack exit)) + ) + :trans (-> target-running-attack trans) + :code (behavior () + (target-start-attack) + (target-danger-set! 'dark-smack #f) + (if (not (logtest? (-> self darkjak stage) (darkjak-stage force-on active))) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-smack-inc))) + ) + (set! (-> self control lightjak-sound-id) (sound-play "djak-pnch-swing")) + (set! (-> self control dynam gravity-max) 368640.0) + (set! (-> self control dynam gravity-length) 368640.0) + (let ((gp-1 (-> self draw art-group data 476))) + (ja-channel-push! 1 (seconds 0.02)) + (ja-no-eval :group! gp-1 :num! (seek!)) + ) + (initialize (-> self control impact-ctrl) self 28 3276.8 (-> self control root-prim prim-core collide-with)) + (let ((f28-0 (the-as number 0.0))) + 0.8 + (let ((gp-2 0) + (f30-0 1.0) + (s5-1 #f) + (f26-0 0.6) + ) + (until (ja-done? 0) + (when (not (ja-min? 0)) + (cond + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) + ) + ) + (go target-falling #f) + ) + ((< (the-as float f28-0) 0.0) + (set! f28-0 (seek (the-as float f28-0) -0.04096 (* 491520.0 (seconds-per-frame)))) + (set-forward-vel (the-as float f28-0)) + ) + ((and (nonzero? (-> self control unknown-time-frame18)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) + ) + ) + ((ja-done? 0) + (set-forward-vel (the-as float f28-0)) + ) + (else + (set-forward-vel (the-as float f28-0)) + ) + ) + ) + (set! f26-0 (seek f26-0 0.3 (* 2.0 (seconds-per-frame)))) + (update-rates! (-> *display* entity-clock) f26-0) + (update-rates! (-> *display* bg-clock) f26-0) + (update-rates! (-> *display* part-clock) f26-0) + (let ((s4-0 (new-stack-vector0))) + (vector-matrix*! s4-0 (-> self control transv) (-> self control w-R-c)) + (set! (-> s4-0 y) 0.0) + (vector-matrix*! (-> self control align-xz-vel) s4-0 (-> self control c-R-w)) + ) + (when (!= (the-as float (-> self control unknown-word04)) 0.0) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (set! f28-0 (-> self control unknown-word04)) + (set! (-> self control unknown-word04) (the-as uint (the-as float 0.0))) + ) + (let ((v1-96 + (and (not s5-1) + (let ((s4-1 (ja-group)) + (f0-19 (ja-aframe-num 0)) + ) + (if (and (= s4-1 (-> self draw art-group data 476)) + (>= f0-19 16.0) + (>= (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 476)) frames num-frames) -1)) + (ja-frame-num 0) + ) + ) + #t + ) + ) + ) + ) + ) + (when v1-96 + (set! s5-1 #t) + (let ((s4-2 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-2 ent) (-> self entity)) + (set! (-> s4-2 charge) 1.0) + (set! (-> s4-2 options) (projectile-options)) + (logclear! (-> s4-2 options) (projectile-options po14 po15 po16)) + (set! (-> s4-2 pos quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_rhand)) quad) + ) + (set! (-> s4-2 notify-handle) (the-as handle #f)) + (set! (-> s4-2 owner-handle) (the-as handle #f)) + (set! (-> s4-2 target-handle) (the-as handle #f)) + (set! (-> s4-2 target-pos quad) (the-as uint128 0)) + (set! (-> s4-2 ignore-handle) (process->handle self)) + (let* ((v1-125 *game-info*) + (a0-43 (+ (-> v1-125 attack-id) 1)) + ) + (set! (-> v1-125 attack-id) a0-43) + (set! (-> s4-2 attack-id) a0-43) + ) + (set! (-> s4-2 timeout) (seconds 4)) + (vector-float*! (-> s4-2 vel) (-> self control c-R-w fvec) 245760.0) + (let ((s3-1 (get-process *default-dead-pool* darkjak-ball #x8000 1))) + (when s3-1 + (let ((t9-28 (method-of-type process activate))) + (t9-28 s3-1 self "projectile" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-1 projectile-init-by-other s4-2) + (-> s3-1 ppointer) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) + (set! (-> *run-attack-mods* turnvv) 0.0) + ) + (+! gp-2 1) + ) + ) + ) + (if (and (not (logtest? (-> self control status) (collide-status on-surface))) + (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) + ) + (go target-falling #f) + ) + (go target-stance) + ) + :post target-post + ) + +;; definition for method 9 of type darkjak-info +;; WARN: Return type mismatch int vs none. +(defmethod update-clock! ((this darkjak-info) (arg0 int)) + (when (-> this clock-on) + (+! (-> this clock-pos) (* (-> this clock-vel) (seconds-per-frame))) + (+! (-> this clock-vel) (* 4.0 (seconds-per-frame))) + (cond + ((< 1.0 (-> this clock-pos)) + (set! (-> this clock-pos) 1.0) + (set! (-> this clock-vel) 0.0) + ) + ((< (-> this clock-pos) 0.05) + (set! (-> this clock-pos) 0.05) + (set! (-> this clock-vel) 1.0) + ) + ) + (update-rates! (-> *display* entity-clock) (-> this clock-pos)) + (update-rates! (-> *display* bg-clock) (-> this clock-pos)) + (if (= arg0 16) + (update-rates! (-> *display* target-clock) (-> this clock-pos)) + ) + (when *sound-player-enable* + (let ((v1-27 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-27 command) (sound-command set-param)) + (set! (-> v1-27 id) (-> this process 0 control unknown-sound-id00)) + (set! (-> v1-27 params pitch-mod) (the int (* 1524.0 (- (- 1.0 (-> this clock-pos)))))) + (set! (-> v1-27 params mask) (the-as uint 2)) + (-> v1-27 id) + ) + ) + ) + 0 + (none) + ) + +;; definition for function target-darkjak-bomb-collide +;; WARN: Return type mismatch int vs none. +(defbehavior target-darkjak-bomb-collide target ((arg0 (pointer float)) (arg1 float)) + (seek! (-> arg0 0) arg1 (* 4.0 (seconds-per-frame))) + (set! (-> self control bomb-scale) (-> arg0 0)) + (target-danger-set! 'bomb #f) + (update-transforms (-> self control)) + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options)) + (set! (-> a1-2 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> self control) a1-2) + ) + (set! (-> self control bomb-scale) 0.0) + (target-danger-set! 'bomb #f) + (update-transforms (-> self control)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate target-darkjak-bomb0 (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('pole-grab 'darkjak 'slide 'wade 'launch 'edge-grab 'jump 'shove 'attack 'attack-or-shove) + #f + ) + (('hit) + (let ((v1-1 (the-as object (-> block param 1)))) + (when (and (= (-> block param 0) 'bomb) + (logtest? (process-mask enemy) (-> (the-as process v1-1) mask)) + (let ((v1-7 (ja-group))) + (and v1-7 (= v1-7 (-> self draw art-group data 468))) + ) + (>= (ja-aframe-num 0) 35.0) + (not (-> self darkjak clock-on)) + ) + (set! (-> self darkjak clock-vel) -8.0) + (let ((v0-0 (the-as object #t))) + (set! (-> self darkjak clock-on) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + (('change-mode) + #f + ) + (('attack 'attack-or-shove 'swim) + #f + ) + (else + (target-dangerous-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (logior! (-> self target-flags) (target-flags tf4)) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + (set! (-> self darkjak clock-pos) 1.0) + (set! (-> self darkjak clock-vel) 0.0) + (set! (-> self darkjak clock-on) #f) + (set! (-> self control unknown-sound-id00) + (add-process *gui-control* self (gui-channel jak-effect-1) (gui-action queue) "darkbom0" -99.0 0) + ) + ) + :exit (behavior () + (set-action! + *gui-control* + (gui-action fade) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (logclear! (-> self target-flags) (target-flags tf6)) + (target-exit) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (remove-setting! 'gun) + (set! (-> self darkjak clock-pos) 1.0) + (set! (-> self darkjak clock-vel) 0.0) + (set! (-> self darkjak clock-on) #f) + (update-rates! (-> *display* entity-clock) 1.0) + (update-rates! (-> *display* bg-clock) 1.0) + (update-rates! (-> *display* target-clock) 1.0) + (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-get-off))) + ((-> target-darkjak-get-off exit)) + ) + ) + :trans (behavior () + (update-clock! (-> self darkjak) 16) + ) + :code (behavior () + (local-vars + (v1-100 symbol) + (sv-16 float) + (sv-20 float) + (sv-160 vector) + (sv-164 (function object :behavior target)) + ) + (set! (-> self darkjak stage) (-> self darkjak want-stage)) + (set! (-> self neck flex-blend) 0.0) + (set! (-> self control mod-surface) *roll-flip-mods*) + (set! (-> self alt-cam-pos quad) (-> self control trans quad)) + (set! sv-16 (the-as float 0.0)) + (set! sv-20 (the-as float 1.0)) + (ja-channel-push! 1 (seconds 0.15)) + (when (jump-hit-ground-stuck?) + (ja-no-eval :group! (-> self draw art-group data 451) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (set! (-> self alt-cam-pos x) (-> self control trans x)) + (set! (-> self alt-cam-pos z) (-> self control trans z)) + (set-forward-vel (* 0.85 (-> self control ctrl-xz-vel))) + (suspend) + (ja :num! (seek!)) + ) + ) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'sfx-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) + (ja-no-eval :group! (-> self draw art-group data 466) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (set! (-> self alt-cam-pos x) (-> self control trans x)) + (set! (-> self alt-cam-pos z) (-> self control trans z)) + (set-forward-vel (* 0.98 (-> self control ctrl-xz-vel))) + (suspend) + (ja :num! (seek!)) + ) + (ja-no-eval :group! (-> self draw art-group data 467) :num! (seek!) :frame-num 0.0) + (let ((f30-0 (the float (target-time-to-ground)))) + (until v1-100 + (set! (-> self alt-cam-pos x) (-> self control trans x)) + (set! (-> self alt-cam-pos z) (-> self control trans z)) + (set-forward-vel (* 0.98 (-> self control ctrl-xz-vel))) + (let ((v1-92 (new-stack-vector0)) + (f0-35 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! v1-92 (-> self control transv) (vector-float*! v1-92 (-> self control dynam gravity-normal) f0-35)) + (let* ((f1-5 (vector-length v1-92)) + (f2-0 f1-5) + (f0-36 (+ f0-35 (* -491520.0 (seconds-per-frame)))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-36) + (vector-float*! v1-92 v1-92 (/ f1-5 f2-0)) + ) + ) + ) + (suspend) + (ja :num! (seek! max (lerp-scale 1.5 0.3 f30-0 30.0 210.0))) + (set! v1-100 (or (ja-done? 0) (logtest? (-> self control status) (collide-status on-surface)))) + ) + ) + (logclear! (-> self target-flags) (target-flags tf6)) + (while (not (jump-hit-ground-stuck?)) + (let ((v1-105 (new-stack-vector0)) + (f0-42 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! + v1-105 + (-> self control transv) + (vector-float*! v1-105 (-> self control dynam gravity-normal) f0-42) + ) + (let* ((f1-8 (vector-length v1-105)) + (f2-1 f1-8) + (f0-43 (+ f0-42 (* -491520.0 (seconds-per-frame)))) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f0-43) + (vector-float*! v1-105 v1-105 (/ f1-8 f2-1)) + ) + ) + ) + (ja :num! (seek! (ja-aframe 33.0 0))) + (suspend) + ) + (set-forward-vel 0.0) + (ja-no-eval :group! (-> self draw art-group data 468) :num! (seek! (ja-aframe 35.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! (ja-aframe 35.0 0))) + ) + (set-action! + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (target-start-attack) + (target-danger-set! 'bomb #f) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-bomb0-inc))) + (set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg sk_lhand))) + (set! sv-164 (lambda :behavior target + () + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (cond + ((>= 10.0 (ja-aframe-num 0)) + (let ((v0-1 (the-as vector (-> self draw color-emissive)))) + (set! (-> (the-as rgbaf v0-1) x) 1.0) + (set! (-> (the-as rgbaf v0-1) y) 1.0) + (set! (-> (the-as rgbaf v0-1) z) 1.0) + (set! (-> (the-as rgbaf v0-1) w) 1.0) + v0-1 + ) + ) + ((>= 20.0 (ja-aframe-num 0)) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 10.0 20.0) + ) + ) + (else + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (new 'static 'vector :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 20.0 30.0) + ) + ) + ) + ) + ) + (set! (-> sv-160 y) (-> self control root-prim prim-core world-sphere y)) + (cond + ((logtest? (-> *part-group-id-table* 71 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 71)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> sv-160 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 71)) + ) + ) + (let ((gp-6 (process-spawn + manipy + :init manipy-init + sv-160 + (-> self entity) + (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when gp-6 + (send-event (ppointer->process gp-6) 'anim-mode 'play1) + (send-event (ppointer->process gp-6) 'anim "idle") + (set-vector! (-> (the-as process-drawable (-> gp-6 0)) root scale) sv-20 1.0 sv-20 1.0) + (send-event (ppointer->process gp-6) 'trans-hook sv-164) + ) + ) + (let ((gp-8 (process-spawn + manipy + :init manipy-init + sv-160 + (-> self entity) + (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when gp-8 + (send-event (ppointer->process gp-8) 'anim-mode 'play1) + (send-event (ppointer->process gp-8) 'anim "idle") + (set-vector! (-> (the-as manipy (-> gp-8 0)) root scale) sv-20 1.0 sv-20 1.0) + ) + ) + (ja-no-eval :num! (seek! (ja-aframe 38.0 0))) + (while (not (ja-done? 0)) + (target-darkjak-bomb-collide (& sv-16) sv-20) + (set-forward-vel 0.0) + (suspend) + (ja-eval) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (target-darkjak-bomb-collide (& sv-16) sv-20) + (set-forward-vel 0.0) + (suspend) + (ja-eval) + ) + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'ambient-volume) + (ja-no-eval :group! (-> self draw art-group data 461) :num! (seek! (ja-aframe 90.0 0)) :frame-num 0.0) + (until (ja-done? 0) + (target-darkjak-bomb-collide (& sv-16) sv-20) + (suspend) + (ja :num! (seek! (ja-aframe 90.0 0))) + ) + (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) + (send-event (handle->process (-> self notify)) 'notify 'attack 20) + (go target-darkjak-get-off) + ) + :post target-no-stick-post + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 11) (new 'static 'lightning-spec + :name "lightning-darkjak-bomb1" + :flags (lightning-spec-flags lsf0 lsf4) + :adjust-distance #xa + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 80 + :box-size 32768.0 + :merge-factor 0.2 + :merge-count 2 + :radius 2048.0 + :duration 300.0 + :duration-rand 90.0 + :sound (static-sound-spec "transform-zap" :group 1) + ) + ) + +;; definition for function target-bomb1-fire-shot +;; INFO: Used lq/sq +(defbehavior target-bomb1-fire-shot target ((arg0 (array handle)) (arg1 int) (arg2 int)) + (local-vars (sv-128 target) (sv-144 int) (sv-160 vector) (sv-176 vector) (sv-192 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (cond + ((and (>= arg1 0) (< arg1 (-> arg0 length))) + (let ((s5-0 (handle->process (-> arg0 arg1)))) + (when s5-0 + (get-trans (the-as process-focusable s5-0) 3) + (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 11) + 0 + lightning-probe-callback + s5-0 + 3 + 3 + :name "lightning-tracker" + :to self + :unk 0 + ) + (send-event + s5-0 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint arg2)) + (damage 15.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'ice) + (penetrate-using (penetrate touch dark-skin dark-bomb)) + ) + ) + ) + ) + ) + ) + (else + (let ((gp-1 (get-process *default-dead-pool* lightning-tracker #x4000 0))) + (when gp-1 + (let ((t9-6 (method-of-type lightning-tracker activate))) + (t9-6 (the-as lightning-tracker gp-1) self "lightning-tracker" (the-as pointer #x70004000)) + ) + (let ((s5-1 run-function-in-process) + (s4-1 gp-1) + (s3-0 lightning-tracker-init) + (s2-0 (-> *lightning-spec-id-table* 11)) + (s1-0 0) + (s0-0 lightning-probe-callback) + ) + (set! sv-128 self) + (set! sv-144 3) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! sv-160 (-> self control trans)) + (set! sv-176 (new 'stack-no-clear 'vector)) + (set! (-> sv-176 x) (rand-vu-float-range -40960.0 40960.0)) + (set! (-> sv-176 y) (rand-vu-float-range -8192.0 8192.0)) + (set! (-> sv-176 z) (rand-vu-float-range -40960.0 40960.0)) + (set! (-> sv-176 w) 1.0) + (.mov.vf vf6 vf0 :mask #b1000) + (.lvf vf4 (&-> sv-160 quad)) + (.lvf vf5 (&-> sv-176 quad)) + (.add.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-192 quad) vf6) + ((the-as (function object object object object object object object object none) s5-1) + s4-1 + s3-0 + s2-0 + s1-0 + s0-0 + sv-128 + sv-144 + sv-192 + ) + ) + (-> gp-1 ppointer) + ) + ) + #f + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-darkjak-bomb1 (target) + :event (-> target-darkjak-bomb0 event) + :enter (behavior ((arg0 float) (arg1 float)) + ((-> target-attack-uppercut-jump enter) arg0 arg1) + (set-setting! 'gun #f 0.0 0) + (apply-settings *setting-control*) + ) + :exit (-> target-darkjak-bomb0 exit) + :trans (behavior () + (if (logtest? (-> self control status) (collide-status on-surface)) + (go target-darkjak-get-off) + ) + (mod-var-jump #t #t (cpad-hold? (-> self control cpad number) x) (-> self control transv)) + (if (and (= (-> self control danger-mode) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) + (target-danger-set! 'harmless #f) + ) + (slide-down-test) + (update-clock! (-> self darkjak) 32) + ) + :code (behavior ((arg0 float) (arg1 float)) + (local-vars + (sv-112 (array collide-shape)) + (sv-120 int) + (sv-128 vector) + (sv-132 (array handle)) + (sv-136 int) + (sv-144 time-frame) + (sv-152 time-frame) + (sv-160 float) + (sv-164 float) + (sv-168 time-frame) + (sv-176 uint) + ) + (logior! (-> self target-flags) (target-flags tf4)) + (set! (-> self neck flex-blend) 0.0) + (set-setting! 'music-volume 'rel 0.0 0) + (set-setting! 'ambient-volume 'rel 0.0 0) + (compute-alignment! (-> self align)) + (set-action! + *gui-control* + (gui-action play) + (-> self control unknown-sound-id00) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (let ((f0-1 0.9)) + (ja-no-eval :num! (seek! max f0-1)) + ) + (while (not (ja-done? 0)) + (compute-alignment! (-> self align)) + (set! (-> self control turn-go-the-long-way) 1.0) + (set! (-> self darkjak clock-vel) -4.0) + (set! (-> self darkjak clock-on) #t) + (align! (-> self align) (align-opts adjust-y-vel) 1.0 1.0 1.0) + (suspend) + (ja-eval) + ) + (send-event self 'get-pickup (pickup-type eco-pill-dark) (- (-> *FACT-bank* darkjak-bomb1-inc))) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) + (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) + (let ((gp-0 (-> self post-hook))) + (set! (-> self post-hook) target-no-move-post) + (set! sv-112 (-> self focus-search)) + (set! sv-120 0) + (set! sv-128 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node jakb-lod0-jg main))) + (set! sv-132 (-> self handle-search)) + (set! (-> sv-132 length) 0) + (set! (-> sv-128 w) 327680.0) + (set! sv-120 (fill-actor-list-for-box + *actor-hash* + (the-as bounding-box sv-128) + (-> sv-112 data) + (-> sv-112 allocated-length) + ) + ) + (set! (-> sv-112 length) sv-120) + (countdown (s5-0 sv-120) + (let* ((s4-0 (-> sv-112 s5-0 process)) + (v1-56 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when (and v1-56 (logtest? (process-mask crate enemy guard vehicle) (-> v1-56 mask))) + (set! (-> sv-132 (-> sv-132 length)) (process->handle v1-56)) + (+! (-> sv-132 length) 1) + (if (< (-> sv-132 allocated-length) (-> sv-132 length)) + (set! (-> sv-132 length) (-> sv-132 allocated-length)) + ) + ) + ) + ) + (set! (-> self control mod-surface) (new 'static 'surface + :name 'uppercut + :turnv 524288.0 + :turnvf 15.0 + :tiltv 32768.0 + :tiltvf 150.0 + :tiltvv 262144.0 + :tiltvvf 15.0 + :transv-max 32768.0 + :target-speed 32768.0 + :fric 0.2 + :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 + :mode 'air + :flags (surface-flag air attack spin gun-off laser-hide) + ) + ) + (set! sv-136 0) + (set! sv-144 (current-time)) + (set! sv-152 (current-time)) + (set! sv-160 (the-as float 0.0)) + (set! sv-164 (the-as float 0.0)) + (set! sv-168 (current-time)) + (let* ((v1-77 (-> self game)) + (a0-34 (+ (-> v1-77 attack-id) 1)) + ) + (set! (-> v1-77 attack-id) a0-34) + (set! sv-176 a0-34) + ) + (ja-channel-push! 2 (seconds 0.05)) + (ja :group! (-> self draw art-group data 469)) + (ja :chan 1 :group! (-> self draw art-group data 470)) + (while (or (< sv-136 (-> sv-132 length)) (not (time-elapsed? sv-152 (seconds 1.5)))) + (let ((v1-84 (new-stack-vector0))) + (let ((f0-10 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) + 0.0 + (vector-! v1-84 (-> self control transv) (vector-float*! v1-84 (-> self control dynam gravity-normal) f0-10)) + ) + (let* ((f0-11 (vector-length v1-84)) + (f1-3 f0-11) + (f2-0 0.0) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-0) + (vector-float*! v1-84 v1-84 (/ f0-11 f1-3)) + ) + ) + ) + (set! (-> self darkjak clock-vel) -4.0) + (set! (-> self darkjak clock-on) #t) + (send-event *camera* 'joystick -0.25 1.0) + (when (time-elapsed? sv-144 (seconds 0.1)) + (set! sv-144 (current-time)) + (target-bomb1-fire-shot sv-132 sv-136 (the-as int sv-176)) + (set! sv-136 (+ sv-136 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) + (set! sv-164 (the-as float 1.0)) + ) + ) + (set! sv-160 (seek sv-160 sv-164 (* 6.0 (seconds-per-frame)))) + (ja :num! (loop!)) + (let ((a0-61 (-> self skel root-channel 1))) + (let ((f0-21 sv-160)) + (set! (-> a0-61 frame-interp 1) f0-21) + (set! (-> a0-61 frame-interp 0) f0-21) + ) + (set! (-> a0-61 param 0) 0.0) + (joint-control-channel-group-eval! a0-61 (the-as art-joint-anim #f) num-func-chan) + ) + (suspend) + ) + (set! (-> self post-hook) gp-0) + ) + (set! (-> self control mod-surface) *double-jump-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 471) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (ja-blend-eval) + (compute-alignment! (-> self align)) + (set! (-> self control turn-go-the-long-way) 1.0) + (set! (-> self darkjak clock-vel) 4.0) + (suspend) + (ja :num! (seek!)) + ) + (set-time! (-> self gun surpress-time)) + (send-event (handle->process (-> self notify)) 'notify 'attack 21) + (go target-darkjak-get-off) + ) + :post target-post + ) diff --git a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc index 7dcd5bb2ef..c9e27a36d8 100644 --- a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc @@ -2110,7 +2110,7 @@ (set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad)) (set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0)) (let ((v1-214 gp-3)) - (set! (-> v1-214 spheres) s5-2) + (set! (-> v1-214 best-dist) (the-as float s5-2)) (set! (-> v1-214 best-other-prim) (the-as collide-shape-prim 1)) (set! (-> v1-214 collide-with) (-> self control root-prim prim-core collide-with)) (set! (-> v1-214 ignore-process0) #f) diff --git a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc index 22c6f65189..ab77614826 100644 --- a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc @@ -134,7 +134,7 @@ (target-continue continue-point) (target-credits int) target-darkjak-bomb0 - target-darkjak-bomb1 + (target-darkjak-bomb1 float float) target-darkjak-get-off (target-darkjak-get-on darkjak-stage) target-darkjak-running-attack @@ -203,9 +203,15 @@ target-indax-walk (target-invisible-get-on handle time-frame) (target-jump float float surface) - (target-jump-forward float float) + (target-jump-forward float float symbol) target-ladder + target-ladder-jump-off + target-ladder-slide-down + target-ladder-stance (target-ladder-start handle) + target-ladder-switch + target-ladder-walk-down + target-ladder-walk-up (target-launch float symbol vector int) target-launch-dir target-lightjak-freeze @@ -258,7 +264,7 @@ (target-pole-flip-forward float float float) (target-pole-flip-forward-jump float float) (target-pole-flip-up float float float) - (target-pole-flip-up-jump float float) + (target-pole-flip-up-jump float float symbol) target-powerjak-get-on (target-racing-start handle) target-roll diff --git a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc index bb0b1c1d46..afbff93968 100644 --- a/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-invisible_REF.gc @@ -463,7 +463,7 @@ ) (set! (-> a1-2 trans quad) (-> s5-1 quad)) (if (and (nonzero? (-> self part)) (not gp-0)) - (sparticle-launch-control-method-17 (-> self part) a1-2) + (spawn-from-mat (-> self part) a1-2) ) ) (update-vol! (-> self humming-sound) (if gp-0 @@ -533,7 +533,7 @@ (a1-4 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) ) (set! (-> a1-4 trans quad) (-> gp-2 quad)) - (sparticle-launch-control-method-17 (-> self part) a1-4) + (spawn-from-mat (-> self part) a1-4) ) ) (ja-post) diff --git a/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc b/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc new file mode 100644 index 0000000000..e8bae2f23d --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-ladder_REF.gc @@ -0,0 +1,645 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ladder-info +(deftype ladder-info (basic) + ((ladder handle) + (flip degrees) + (interp float) + (start-mat matrix :inline) + ) + ) + +;; definition for method 3 of type ladder-info +(defmethod inspect ((this ladder-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tladder: ~D~%" (-> this ladder)) + (format #t "~1Tflip: (deg ~r)~%" (-> this flip)) + (format #t "~1Tinterp: ~f~%" (-> this interp)) + (format #t "~1Tstart-mat: #~%" (-> this start-mat)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(let ((v1-2 (copy *walk-mods* 'global))) + (set! (-> v1-2 name) 'ladder) + (set! (-> v1-2 flags) (surface-flag turn-when-centered turn-to-alt gun-hide)) + (set! (-> v1-2 bend-factor) 1.0) + (set! (-> v1-2 bend-speed) 1.0) + (set! (-> v1-2 tiltv) 262144.0) + (set! (-> v1-2 tiltvf) 30.0) + (set! (-> v1-2 tiltvv) 1048576.0) + (set! (-> v1-2 tiltvvf) 30.0) + (set! *ladder-mods* v1-2) + ) + +;; failed to figure out what this is: +(defstate target-ladder (target) + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (if (and (= message 'query) (= (-> block param 0) 'mode)) + 'target-ladder + (target-standard-event-handler proc argc message block) + ) + ) + :exit (behavior () + (when (not (and (-> self next-state) (begin (-> self next-state name) (state-type? (-> self next-state) 'target-ladder))) + ) + (target-collide-set! 'normal 0.0) + (logclear! (-> self focus-status) (focus-status pole)) + (set! (-> self ladder ladder) (the-as handle #f)) + (logclear! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + ) + ) + :trans (behavior () + (local-vars (gp-0 symbol)) + (b! (not (cpad-pressed? (-> self control cpad number) x)) cfg-2 :delay (empty-form)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons x)) + (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons x)) + (go target-ladder-jump-off) + (b! #t cfg-41 :delay (nop!)) + (label cfg-2) + (cond + ((and (cpad-hold? (-> self control cpad number) circle) + (not (and (-> self next-state) (let ((v1-26 (-> self next-state name))) + (or (= v1-26 'target-ladder-slide-down) (= v1-26 'target-ladder-switch)) + ) + ) + ) + (!= (send-event (handle->process (-> self ladder ladder)) 'move 0) 0.0) + ) + (go target-ladder-slide-down) + ) + ((and (cpad-pressed? (-> self control cpad number) square) + (not (and (-> self next-state) (let ((v1-49 (-> self next-state name))) + (or (= v1-49 'target-ladder-slide-down) (= v1-49 'target-ladder-switch)) + ) + ) + ) + (begin + (let ((gp-1 #t) + (a1-7 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-7 from) (process->ppointer self)) + (set! (-> a1-7 num-params) 0) + (set! (-> a1-7 message) 'options) + (let ((v1-57 + (the-as int (logand (the-as int (send-event-function (handle->process (-> self ladder ladder)) a1-7)) 3)) + ) + ) + (cmove-#f-nonzero gp-0 v1-57 gp-1) + ) + ) + gp-0 + ) + ) + (go target-ladder-switch) + ) + ) + (label cfg-41) + ) + :code nothing + :post (behavior () + (let ((gp-0 (handle->process (-> self ladder ladder)))) + (seek! (-> self ladder interp) 1.0 (* 10.0 (seconds-per-frame))) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'matrix) + (set! (-> a1-2 param 0) (the-as uint (new 'stack-no-clear 'matrix))) + (let ((gp-1 (the-as matrix (send-event-function gp-0 a1-2)))) + (if (= (-> self ladder flip) -1.0) + (set! (-> self ladder flip) + (if (< (vector-dot (-> gp-1 fvec) (vector-! (new 'stack-no-clear 'vector) (-> gp-1 trans) (-> self control trans))) + 0.0 + ) + 32768.0 + 0.0 + ) + ) + ) + (cond + (gp-1 + (set! (-> self control bend-amount) 1.0) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let ((a1-5 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (-> self ladder flip)))) + (matrix*! s4-0 a1-5 gp-1) + ) + (let ((s5-0 (new 'static 'vector :w 1.0)) + (gp-2 (matrix-lerp! (new 'stack-no-clear 'matrix) (-> self ladder start-mat) s4-0 (-> self ladder interp))) + ) + (set! (-> s5-0 z) (* -1597.44 (-> self ladder interp))) + (vector-matrix*! (-> self control trans) s5-0 gp-2) + (set! (-> self control turn-to-alt-heading quad) (-> gp-2 fvec quad)) + (set! (-> self control local-normal quad) (-> gp-2 uvec quad)) + (set! (-> self control bent-gravity-normal quad) (-> gp-2 uvec quad)) + (set! (-> self control gspot-normal quad) (-> gp-2 uvec quad)) + ) + ) + (update-transforms (-> self control)) + ) + (else + (go target-falling #f) + ) + ) + ) + ) + ) + (target-no-move-post) + ) + ) + +;; failed to figure out what this is: +(defstate target-ladder-start (target) + :parent target-ladder + :enter (behavior ((arg0 handle)) + (when (zero? (-> self ladder)) + (set! (-> self ladder) (new 'process 'ladder-info)) + (set! (-> self ladder ladder) (the-as handle #f)) + ) + (set! (-> self ladder ladder) arg0) + (set! (-> self ladder flip) -1.0) + (set! (-> self ladder interp) 0.0) + (let* ((v1-10 (-> self ladder start-mat)) + (a3-0 (-> self node-list data 0 bone transform)) + (a0-4 (-> a3-0 rvec quad)) + (a1-1 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-10 rvec quad) a0-4) + (set! (-> v1-10 uvec quad) a1-1) + (set! (-> v1-10 fvec quad) a2-0) + (set! (-> v1-10 trans quad) a3-1) + ) + (set! (-> self control bend-target) 1.0) + (set-time! (-> self state-time)) + (set! (-> self control mod-surface) *ladder-mods*) + (logior! (-> self target-flags) (target-flags lleg-still rleg-still lleg-no-ik rleg-no-ik)) + (target-collide-set! 'pole 0.0) + (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) + (set! (-> self control transv quad) (the-as uint128 0)) + ) + :code (behavior ((arg0 handle)) + (cond + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.05)) + (ja-channel-push! 1 (seconds 0.065)) + (ja-no-eval :group! jakb-ladder-jump-on-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.25)) + (ja-no-eval :group! jakb-ladder-get-on-ja :num! (seek! max 4.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 4.0)) + ) + ) + ) + (go target-ladder-stance) + ) + :post (behavior () + (send-event (handle->process (-> self ladder ladder)) 'stance) + (let ((v1-8 (-> self state parent))) + (when v1-8 + (let ((t9-1 (-> v1-8 post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-ladder-stance (target) + :parent target-ladder + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (if (!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (go target-ladder-walk-up) + ) + (can-play-stance-amibent?) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (or (= v1-2 jakb-ladder-up-to-stance-ja) (= v1-2 jakb-ladder-slide-stop-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (or (= v1-16 jakb-ladder-slide-start-ja) (= v1-16 jakb-ladder-slide-loop-ja))) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-ladder-slide-stop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (else + (let ((v1-45 (ja-group))) + (cond + ((and v1-45 (or (= v1-45 jakb-ladder-stance-to-up-ja) (= v1-45 jakb-ladder-stance-to-down-ja))) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.25)) + ) + ) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! jakb-ladder-stance-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (-> target-ladder-start post) + ) + +;; failed to figure out what this is: +(defstate target-ladder-walk-up (target) + :parent target-ladder + :trans (behavior () + (local-vars (gp-0 symbol)) + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (cond + ((and (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'move) + (set! (-> a1-0 param 0) (the-as uint 0)) + (let* ((f0-1 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-0))) + (f0-2 (- f0-1 (* (the float (the int (/ f0-1 0.5))) 0.5))) + ) + (or (< 0.4 f0-2) (< f0-2 0.01)) + ) + ) + ) + (go target-ladder-stance) + ) + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + ) + ((< (the-as uint 128) (-> self control cpad lefty)) + (go target-ladder-walk-down) + ) + ((let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'pos) + (set! (-> a1-1 param 0) (the-as uint (new 'stack-no-clear 'vector))) + (and (= (send-event-function (handle->process (-> self ladder ladder)) a1-1) 1.0) + (begin + (let ((gp-1 #t) + (a1-2 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'options) + (let ((v1-56 + (the-as int (logand (the-as int (send-event-function (handle->process (-> self ladder ladder)) a1-2)) 4)) + ) + ) + (cmove-#f-nonzero gp-0 v1-56 gp-1) + ) + ) + gp-0 + ) + ) + ) + (go + target-edge-grab-jump + (-> *TARGET-bank* edge-grab-jump-height-min) + (-> *TARGET-bank* edge-grab-jump-height-max) + 'ladder + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 jakb-ladder-up-to-stance-ja)) + (ja-no-eval :num! (seek! 0.0)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-13 (ja-group))) + (and v1-13 (= v1-13 jakb-ladder-stance-to-up-ja)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-ladder-up-ja) + (until #f + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 1) + (set! (-> a1-3 message) 'move) + (set! (-> a1-3 param 0) + (the-as + uint + (* (-> *TARGET-bank* ladder-walk-up-speed) (fmax 0.4 (-> self control cpad stick0-speed)) (seconds-per-frame)) + ) + ) + (let ((f0-8 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-3))) + (a0-20 (-> self skel root-channel 0)) + ) + (let ((f0-9 (- f0-8 (* (the float (the int (/ f0-8 1.0))) 1.0))) + (v1-49 (ja-group)) + ) + (set! (-> a0-20 param 0) (* f0-9 (the float (+ (-> v1-49 frames num-frames) -1)))) + ) + (set! (-> a0-20 param 1) 1000.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate target-ladder-walk-down (target) + :parent target-ladder + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (cond + ((and (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'move) + (set! (-> a1-0 param 0) (the-as uint 0)) + (let* ((f0-1 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-0))) + (f0-2 (- f0-1 (* (the float (the int (/ f0-1 0.5))) 0.5))) + ) + (or (< 0.49 f0-2) (< f0-2 0.1)) + ) + ) + ) + (go target-ladder-stance) + ) + ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) + ) + ((< (-> self control cpad lefty) (the-as uint 128)) + (go target-ladder-walk-up) + ) + ((= (the-as float (send-event (handle->process (-> self ladder ladder)) 'pos (new 'stack-no-clear 'vector))) + 0.0 + ) + (go target-stance) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (when (and v1-2 (= v1-2 jakb-ladder-stance-to-down-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! jakb-ladder-down-ja) + (until #f + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'move) + (set! (-> a1-2 param 0) (the-as uint (* (- (-> *TARGET-bank* ladder-walk-down-speed)) + (fmax 0.4 (-> self control cpad stick0-speed)) + (seconds-per-frame) + ) + ) + ) + (let ((f0-7 (the-as float (send-event-function (handle->process (-> self ladder ladder)) a1-2))) + (a0-14 (-> self skel root-channel 0)) + ) + (let ((f0-9 (- 1.0 (- f0-7 (* (the float (the int (/ f0-7 1.0))) 1.0)))) + (v1-39 (ja-group)) + ) + (set! (-> a0-14 param 0) (* f0-9 (the float (+ (-> v1-39 frames num-frames) -1)))) + ) + (set! (-> a0-14 param 1) 1000.0) + (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate target-ladder-slide-down (target) + :parent target-ladder + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self control unknown-sound-id00) (new-sound-id)) + ) + :exit (behavior () + (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-0 command) (sound-command set-param)) + (set! (-> v1-0 id) (-> self control unknown-sound-id00)) + (set! (-> v1-0 params volume) -4) + (set! (-> v1-0 auto-time) 24) + (set! (-> v1-0 auto-from) 2) + (set! (-> v1-0 params mask) (the-as uint 17)) + (-> v1-0 id) + ) + (let ((v1-3 (-> self prev-state parent))) + (when v1-3 + (let ((t9-1 (-> v1-3 exit))) + (if t9-1 + (t9-1) + ) + ) + ) + ) + ) + :trans (behavior () + (let ((a0-0 (-> self state parent))) + (when a0-0 + (let ((t9-0 (-> a0-0 trans))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + (if (and (not (cpad-hold? (-> self control cpad number) circle)) + (time-elapsed? (-> self state-time) (seconds 0.25)) + ) + (go target-ladder-stance) + ) + (set! (-> self control unknown-sound-id00) + (sound-play "ladder-slide" :id (-> self control unknown-sound-id00)) + ) + ) + :code (behavior () + (set! (-> self control unknown-word04) (the-as uint 0.0)) + (let ((v1-3 (ja-group))) + (cond + ((and v1-3 (= v1-3 jakb-ladder-slide-start-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-17 (ja-group))) + (and v1-17 (= v1-17 jakb-ladder-slide-loop-ja)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-ladder-slide-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + ) + (ja :group! jakb-ladder-slide-loop-ja) + (until #f + (ja :num! (loop!)) + (suspend) + ) + #f + ) + :post (behavior () + (set! (-> self control unknown-word04) + (the-as uint (seek + (the-as float (-> self control unknown-word04)) + (- (-> *TARGET-bank* ladder-slide-speed)) + (* 2.0 (seconds-per-frame) (-> *TARGET-bank* ladder-slide-speed)) + ) + ) + ) + (if (= (the-as float (send-event + (handle->process (-> self ladder ladder)) + 'move + (* (the-as float (-> self control unknown-word04)) (seconds-per-frame)) + ) + ) + 0.0 + ) + (go target-ladder-stance) + ) + (let ((v1-21 (-> self state parent))) + (when v1-21 + (let ((t9-3 (-> v1-21 post))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate target-ladder-switch (target) + :parent target-ladder + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (-> self ladder flip))) + (ja-no-eval :group! jakb-ladder-switch-ja :num! (seek! max 1.25) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (set! (-> self ladder flip) + (the float (sar (shl (the int (lerp-scale f30-0 (+ 32768.0 f30-0) (ja-aframe-num 0) 0.0 30.0)) 48) 48)) + ) + (suspend) + (ja :num! (seek! max 1.25)) + ) + (set! (-> self ladder flip) (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + (go target-ladder-stance) + ) + :post (-> target-ladder-start post) + ) + +;; failed to figure out what this is: +(defstate target-ladder-jump-off (target) + :parent target-ladder + :trans #f + :code (behavior () + (set! (-> self control mod-surface) *turn-around-mods*) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! jakb-ladder-jump-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (compute-alignment! (-> self align)) + (align! (-> self align) (align-opts adjust-quat) 1.0 1.0 1.0) + (suspend) + (ja :num! (seek!)) + ) + (rot->dir-targ! (-> self control)) + (set-forward-vel 16384.0) + (go target-jump-forward (-> *TARGET-bank* jump-height-max) (-> *TARGET-bank* jump-height-max) #f) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target-part_REF.gc b/test/decompiler/reference/jak3/engine/target/target-part_REF.gc new file mode 100644 index 0000000000..4882cfaf9e --- /dev/null +++ b/test/decompiler/reference/jak3/engine/target/target-part_REF.gc @@ -0,0 +1,4546 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function spt-birth-func-brightness-part-droppings-for +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-part-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 41) 100)) + (s3-0 (mod (the-as int (rand-uint31-gen *random-generator*)) 21)) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 71) 20)) + (v1-7 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 41) 70)) + ) + (set! (-> arg2 r-g-b-a x) (the float (- s5-0 s3-0))) + (set! (-> arg2 r-g-b-a y) (the float (- s5-0 s4-0))) + (set! (-> arg2 r-g-b-a z) (the float (- s5-0 v1-7))) + ) + (none) + ) + +;; definition for function birth-func-copy-target-y-rot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-copy-target-y-rot ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((v1-0 *target*)) + (when v1-0 + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 rvec quad) (the-as uint128 0)) + (set! (-> s5-0 uvec quad) (the-as uint128 0)) + (set! (-> s5-0 fvec quad) (the-as uint128 0)) + (set! (-> s5-0 trans quad) (the-as uint128 0)) + (let ((f0-1 (+ -16384.0 (y-angle (-> v1-0 control))))) + (matrix-rotate-y! s5-0 f0-1) + ) + (vector3s-rotate*! (the-as vector3s (-> arg1 vel-sxvel)) (the-as vector3s (-> arg1 vel-sxvel)) s5-0) + (vector3s-rotate*! (the-as vector3s (-> arg1 acc)) (the-as vector3s (-> arg1 acc)) s5-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function birth-func-ground-orient +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-ground-orient ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-10 float) (v1-11 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 *target*) + ) + (set! (-> s4-0 start-pos quad) (-> arg2 launchrot quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -20480.0 0.0 1.0) + (+! (-> s4-0 start-pos y) 4096.0) + (let ((v1-3 s4-0)) + (set! (-> v1-3 radius) 40.96) + (set! (-> v1-3 collide-with) + (collide-spec + backgnd + bot + crate + civilian + enemy + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + tobot + pusher + vehicle-mesh + obstacle-for-jak + shield + vehicle-mesh-no-block-use + ) + ) + (set! (-> v1-3 ignore-process0) s5-0) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0) + (let ((s2-0 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> s2-0 x) (-> s4-0 best-other-tri normal z)) + (set! (-> s2-0 y) 0.0) + (set! (-> s2-0 z) (- (-> s4-0 best-other-tri normal x))) + (vector-normalize! s2-0 1.0) + (quaternion-vector-angle! s3-1 s2-0 (acos (-> s4-0 best-other-tri normal y))) + (let ((s4-1 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s4-1 *up-vector* (+ 32768.0 (y-angle (-> s5-0 control)))) + (quaternion-normalize! (quaternion*! s3-1 s4-1 s3-1)) + ) + (cond + ((< (-> s3-1 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-10 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-11 vf1) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function birth-func-target-orient +;; WARN: Return type mismatch int vs none. +(defun birth-func-target-orient ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-10 float) (v1-11 float) (sv-16 target)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! sv-16 *target*) + (when sv-16 + (let ((s3-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((s2-0 (-> sv-16 control local-normal))) + (set! (-> s3-0 x) (-> s2-0 z)) + (set! (-> s3-0 y) 0.0) + (set! (-> s3-0 z) (- (-> s2-0 x))) + (vector-normalize! s3-0 1.0) + (quaternion-vector-angle! s5-0 s3-0 (acos (-> s2-0 y))) + ) + (let ((s3-1 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s3-1 *up-vector* (+ 32768.0 (-> arg1 user-float) (y-angle (-> sv-16 control)))) + (quaternion-normalize! (quaternion*! s5-0 s5-0 s3-1)) + ) + (cond + ((< (-> s5-0 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-10 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-11 vf1) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +;; definition for function birth-func-vector-orient +;; WARN: Return type mismatch int vs none. +(defun birth-func-vector-orient ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (local-vars (v1-3 float) (v1-4 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when *target* + (let ((s4-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (the-as sprite-vec-data-2d (-> arg1 user-float))) + ) + (when (nonzero? s3-0) + (set! (-> s4-0 x) (-> s3-0 x-y-z-sx z)) + (set! (-> s4-0 y) 0.0) + (set! (-> s4-0 z) (- (-> s3-0 x-y-z-sx x))) + (vector-normalize! s4-0 1.0) + (quaternion-vector-angle! (the-as quaternion s5-0) s4-0 (acos (-> s3-0 x-y-z-sx y))) + (cond + ((< (-> s5-0 w) 0.0) + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-3 vf1) + ) + (else + (.lvf vf1 (&-> arg2 conerot quad)) + (.lvf vf2 (&-> s5-0 quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 conerot quad) vf1) + (.mov v1-4 vf1) + ) + ) + ) + ) + ) + 0 + ) + (none) + ) + ) + +;; definition for function birth-func-set-alpha-from-userdata +(defun birth-func-set-alpha-from-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (let ((f0-0 (-> arg1 user-float))) + (set! (-> arg2 coneradius) (* (-> arg2 coneradius) f0-0)) + ) + ) + +;; definition for function part-tracker-track-target-joint +;; WARN: Return type mismatch int vs none. +(defun part-tracker-track-target-joint ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (let* ((v1-0 *target*) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> v1-0 node-list data (the int (-> arg1 user-float))))) + ) + (set! (-> arg2 x) (-> v1-2 x)) + (set! (-> arg2 y) (-> v1-2 y)) + (set! (-> arg2 z) (-> v1-2 z)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-target-hit + :id 10 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 70 :period (seconds 0.5) :length (seconds 0.017)) + (sp-item 71 :period (seconds 0.5) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 71 + :init-specs ((:texture (suckpart level-default-sprite)) + (:num 16.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.005) (meters 0.005)) + (:r 128.0 128.0) + (:g 128.0 128.0) + (:b 128.0 128.0) + (:a 32.0 12.0) + (:scalevel-x (meters 0.3) (meters 0.2)) + (:scalevel-y (meters 0.00125)) + (:fade-a -0.8 -0.8) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 12288.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 70 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 64)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.7)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.4) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 16384.0) + (:func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-spin-hit + :id 11 + :duration (seconds 0.017) + :linger-duration (seconds 0.167) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 72 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpartgroup group-punch-hit + :id 12 + :duration (seconds 0.017) + :linger-duration (seconds 0.167) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 72 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 72 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 5)) + (:rot-x (degrees 5.625)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0) + (:g 196.0) + (:b 196.0) + (:a 12.0) + (:scalevel-x (meters 1)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.2) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-smack-surface + :id 13 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 74) + (sp-item 75) + (sp-item 76 :binding 73) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + (sp-item 73 :flags (sp2 sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 74 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-copy-target-y-rot) + (:num 16.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0 32.0) + (:b 96.0 32.0) + (:a 32.0 32.0) + (:vel-y (meters 0.04) (meters 0.02)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 75 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-copy-target-y-rot) + (:num 8.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0) + (:g 96.0 32.0) + (:b 96.0 32.0) + (:a 32.0 32.0) + (:vel-y (meters 0.08) (meters 0.02)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85333335) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 76 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 12.0 8.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:a 0.0) + (:timer (seconds 2.015)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 9.0) + (:func 'part-tracker-track-target-joint) + ) + ) + +;; failed to figure out what this is: +(defpart 73 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters -1.3333334) (meters 2.6666667)) + (:z (meters 0.5) (meters 0.5)) + (:scale-x (meters 0.1) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 32.0 92.0) + (:g 128.0 128.0) + (:b 0.0) + (:a 32.0 96.0) + (:omega (degrees 0) (degrees 360)) + (:vel-x (meters -0.053333335) 1 (meters 0.10666667)) + (:vel-y (meters 0)) + (:vel-z (meters 0.0033333334)) + (:fade-a -0.30476192) + (:timer (seconds 2.015)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-san + :id 14 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 77) (sp-item 78) (sp-item 79)) + ) + +;; failed to figure out what this is: +(defpart 77 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 78 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 79 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00066666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-drt + :id 15 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 80) (sp-item 81) (sp-item 82)) + ) + +;; failed to figure out what this is: +(defpart 80 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 81 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 82 + :init-specs ((:texture (rockbit07 level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00066666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-snw + :id 16 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 83) (sp-item 84) (sp-item 85)) + ) + +;; failed to figure out what this is: +(defpart 83 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 196.0 64.0) + (:b 196.0 64.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 84 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 196.0 64.0) + (:b 196.0 64.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 85 + :init-specs ((:texture (middot level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00066666666)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-ice + :id 17 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 83) (sp-item 84) (sp-item 85)) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-grs + :id 18 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 86) (sp-item 87) (sp-item 88)) + ) + +;; failed to figure out what this is: +(defpart 86 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 87 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 88 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-for + :id 19 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 89) (sp-item 90) (sp-item 91)) + ) + +;; failed to figure out what this is: +(defpart 89 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 90 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 91 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-land-droppings-for) + (:num 32.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.015) (meters 0.006666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; definition for function spt-birth-func-part-land-droppings-for +(defun spt-birth-func-part-land-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 (the-as sparticle-launchinfo arg2)) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-wod + :id 20 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 92) (sp-item 93)) + ) + +;; failed to figure out what this is: +(defpart 92 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 93 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-cwd + :id 21 + :duration (seconds 0.017) + :linger-duration (seconds 2.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 92) (sp-item 93) (sp-item 94) (sp-item 94)) + ) + +;; this part is debug only +(when *debug-segment* +;; failed to figure out what this is: +(defpartgroup group-land-poof-unk + :id 22 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 95) (sp-item 96)) + ) + +;; failed to figure out what this is: +(defpart 95 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-clean) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 96.0) + (:a 255.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 96 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-clean) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +) +;; failed to figure out what this is: +(defpartgroup group-land-poof-stn + :id 23 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 97) (sp-item 98)) + ) + +;; failed to figure out what this is: +(defpart 97 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 98 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-land-poof-pmt + :id 24 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 99) (sp-item 100)) + ) + +;; failed to figure out what this is: +(defpart 99 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 24.0 24.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:fade-a -0.16) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 100 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 12.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 16.0 16.0) + (:vel-y (meters 0.053333335) (meters 0.02)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334) + (:accel-y (meters -0.00033333333)) + (:friction 0.95) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; this part is debug only +(when *debug-segment* +;; failed to figure out what this is: +(defpartgroup group-run-poof-unk + :id 25 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 101)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-unk + :id 26 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 101)) + ) + +;; failed to figure out what this is: +(defpart 101 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-clean) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 32.0) + (:a 255.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.45714286) + (:friction 0.965) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +) +;; failed to figure out what this is: +(defpartgroup group-run-poof-stn + :id 27 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 102)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-stn + :id 28 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 102)) + ) + +;; failed to figure out what this is: +(defpart 102 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-snw + :id 29 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103) (sp-item 104 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-snw + :id 30 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-footprint-snw + :id 31 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 104 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 104 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 64.0) + (:fade-a -0.07111111) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 103 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 196.0 64.0) + (:g 196.0 64.0) + (:b 196.0 64.0) + (:a 24.0 24.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-ice + :id 32 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-ice + :id 33 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 103)) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-cwd + :id 34 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 105) (sp-item 105) (sp-item 94)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-cwd + :id 35 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 106)) + ) + +;; failed to figure out what this is: +(defpart 94 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:y (meters -1)) + (:scale-x (meters 1) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 0.0) + (:vel-y (meters 0) (meters -0.0033333334)) + (:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16) + (:accel-y (meters -0.00006666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.25) (seconds 0.247)) + (:next-launcher 107) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0) (meters 3)) + ) + ) + +;; failed to figure out what this is: +(defpart 107 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.5) (seconds 0.497)) (:next-launcher 108)) + ) + +;; failed to figure out what this is: +(defpart 108 + :init-specs ((:fade-a -0.08)) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-wod + :id 36 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 105)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-wod + :id 37 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 105)) + ) + +;; failed to figure out what this is: +(defpart 105 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-pmt + :id 38 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 109)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-pmt + :id 39 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 109)) + ) + +;; failed to figure out what this is: +(defpart 109 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-grs + :id 40 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 110) (sp-item 111 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-grs + :id 41 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 110)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-footprint-grs + :id 42 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 111 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 110 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 111 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 48.0) + (:fade-a -0.053333335) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-for + :id 43 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 112) (sp-item 113 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-for + :id 44 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 110)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-footprint-for + :id 45 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 111 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 112 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 113 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 48.0) + (:fade-a -0.053333335) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-san + :id 46 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 106) (sp-item 114 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-san + :id 47 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 106)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-footprint-san + :id 48 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 114 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 106 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 114 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-run-poof-drt + :id 49 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 115)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-poof-drt + :id 50 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 115)) + ) + +;; failed to figure out what this is: +(defpartgroup group-just-footprint-drt + :id 51 + :duration (seconds 0.017) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 116 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 115 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:fade-a -0.48) + (:friction 0.965) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 116 + :init-specs ((:texture (footprntr level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:x (meters -0.25)) + (:scale-x (meters 0.6)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 16.0) + (:a 32.0) + (:fade-a -0.035555556) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 117 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 0.0 6.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:rotate-z (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 118 + :init-specs ((:texture (rockbit15 level-default-sprite)) + (:num 0.0 6.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 119 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 0.0 2.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.1)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 96.0 32.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 120 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-droppings-for) + (:num 0.0 0.5) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.2) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 aux-list sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + ) + ) + +;; definition for function spt-birth-func-part-droppings-for +(defun spt-birth-func-part-droppings-for ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for arg0 arg1 (the-as sprite-vec-data-2d arg2) arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 121 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 6.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 64.0 64.0) + (:vel-x (meters -0.00083333335) (meters 0.0016666667)) + (:vel-y (meters 0.005) (meters 0.006666667)) + (:vel-z (meters -0.00083333335) (meters 0.0016666667)) + (:fade-a -0.42666668) + (:accel-y (meters -0.00066666666) (meters 0.00033333333)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-san + :id 52 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 122) (sp-item 123)) + ) + +;; failed to figure out what this is: +(defpart 122 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 123 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-drt + :id 53 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 124) (sp-item 125)) + ) + +;; failed to figure out what this is: +(defpart 124 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 125 + :init-specs ((:texture (rockbit15 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-grs + :id 54 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 126) (sp-item 127)) + ) + +;; failed to figure out what this is: +(defpart 126 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 96.0 32.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 127 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-for + :id 55 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 128) (sp-item 129)) + ) + +;; failed to figure out what this is: +(defpart 128 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 96.0 32.0) + (:b 64.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 129 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-slide-droppings-for) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.008333334) (meters 0.0033333334)) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.001) (meters 0.0005)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + (:conerot-x (degrees 30) (degrees 50.000004)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 0.5)) + ) + ) + +;; definition for function spt-birth-func-part-slide-droppings-for +(defun spt-birth-func-part-slide-droppings-for ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for + (the-as sparticle-system arg0) + arg1 + (the-as sprite-vec-data-2d arg2) + arg3 + arg4 + ) + (birth-func-texture-group-2d arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-stn + :id 56 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 130)) + ) + +;; failed to figure out what this is: +(defpart 130 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 96.0) + (:b 96.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-pmt + :id 57 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 131)) + ) + +;; failed to figure out what this is: +(defpart 131 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 70.0 32.0) + (:b 40.0 20.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-snw + :id 58 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 132)) + ) + +;; failed to figure out what this is: +(defpart 132 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-ice + :id 59 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 132)) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-wod + :id 60 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 133)) + ) + +;; failed to figure out what this is: +(defpart 133 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0 6.0) + (:scale-x (meters 0.6) (meters 0.6)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 96.0 32.0) + (:g 64.0) + (:b 0.0 32.0) + (:a 16.0 16.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.17777778) + (:accel-y (meters -0.00006666667)) + (:friction 0.94) + (:timer (seconds 0.6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 60) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slide-poof-cwd + :id 61 + :duration (seconds 0.017) + :linger-duration (seconds 2.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 133)) + ) + +;; failed to figure out what this is: +(defpart 134 + :init-specs ((:texture (rockbit12 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 135 + :init-specs ((:texture (rockbit15 level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 128.0 2 32.0) + (:g 64.0 1 64.0) + (:b 32.0 1 32.0) + (:a 64.0 64.0) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 136 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.07) (meters 0.02)) + (:scale-y :copy scale-x) + (:r 196.0 1 64.0) + (:g 196.0 1 64.0) + (:b 196.0 1 64.0) + (:a 64.0 64.0) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 137 + :init-specs ((:texture (woodchip level-default-sprite)) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 0.0 2.0 64.0) + (:g 64.0 2 64.0) + (:a 64.0 64.0) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 138 + :init-specs ((:texture (leaf1 level-default-sprite)) + (:birth-func 'spt-birth-func-part-jump-droppings-for) + (:num 0.0 8.0) + (:x (meters -0.4) (meters 0.8)) + (:y (meters -0.1) (meters 0.4)) + (:z (meters -0.4) (meters 0.8)) + (:scale-x (meters 0.15) (meters 0.35)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.15)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -2.4) (degrees 4.8)) + (:fade-a -0.42666668) + (:accel-y (meters -0.0013333333) (meters 0.00083333335)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x40b400 #x40b500 #x40b600)) + ) + ) + +;; definition for function spt-birth-func-part-jump-droppings-for +(defun spt-birth-func-part-jump-droppings-for ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (spt-birth-func-brightness-part-droppings-for + (the-as sparticle-system arg0) + arg1 + (the-as sprite-vec-data-2d arg2) + arg3 + arg4 + ) + (birth-func-texture-group-2d arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 139 + ) + +;; failed to figure out what this is: +(defpart 140 + ) + +;; failed to figure out what this is: +(defpart 141 + ) + +;; failed to figure out what this is: +(defpart 142 + ) + +;; failed to figure out what this is: +(defpartgroup group-dark-eco-death + :id 62 + :duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 145 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017) :binding 143) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 143 :flags (sp2 sp3) :binding 144) + (sp-item 144 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp2)) + (sp-item 146 :period (seconds 2) :length (seconds 0.017)) + (sp-item 147 :fade-after (meters 80) :falloff-to (meters 80) :period (seconds 2) :length (seconds 0.135)) + (sp-item 148 :period (seconds 2) :length (seconds 0.067)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-slime-death + :id 63 + :linger-duration (seconds 3) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 149 :period (seconds 10) :length (seconds 1.667)) + (sp-item 150 :period (seconds 10) :length (seconds 3)) + ) + ) + +;; failed to figure out what this is: +(defpart 149 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 0.8) + (:scale-x (meters -1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0) + (:g 200.0) + (:b 200.0) + (:a 0.0) + (:omega (degrees 0.225)) + (:vel-y (meters 0.06666667)) + (:scalevel-x (meters 0.01) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.32 0.32) + (:accel-y (meters 0.0016666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.167)) + (:next-launcher 151) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 151 + :init-specs ((:fade-a -0.10666667 -0.10666667) (:func 'none)) + ) + +;; failed to figure out what this is: +(defpart 150 + :init-specs ((:texture (mud-bubble ctywide-sprite)) + (:num 4.0) + (:x (meters 0.2) (meters 1.5)) + (:y (meters 0)) + (:scale-x (meters 0.1)) + (:scale-y :copy scale-x) + (:r 80.0 40.0) + (:g 110.0) + (:b 60.0) + (:a 128.0) + (:scalevel-x (meters 0.00066666666) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.167) (seconds 0.33)) + (:flags ()) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lava-death + :id 64 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 152) (sp-item 153) (sp-item 154) (sp-item 155)) + ) + +;; failed to figure out what this is: +(defpartgroup group-explode-death + :id 65 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 153) (sp-item 154)) + ) + +;; failed to figure out what this is: +(defpartgroup group-burn-death + :id 66 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 152)) + ) + +;; failed to figure out what this is: +(defpart 155 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 8.0 16.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 256.0) + (:g 0.0 128.0) + (:a 128.0 128.0) + (:vel-y (meters 0.013333334) (meters 0.04)) + (:scalevel-x (meters -0.0023333333)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0013333333)) + (:timer (seconds 1.2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 60)) + (:conerot-y (degrees 0) (degrees 360)) + (:conerot-radius (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 152 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 5.0) + (:x (meters 0) (meters 0.5)) + (:y (meters 0) (meters 3)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 32.0 64.0) + (:vel-y (meters 0.053333335) (meters 0.053333335)) + (:scalevel-x (meters 0.023529412)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.5058824) + (:friction 0.98) + (:timer (seconds 0.27)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 153 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 32.0) + (:x (meters 0.5) (meters 2)) + (:y (meters 0.5) (meters 0.5)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 32.0 64.0) + (:vel-y (meters 0) (meters 0.0016666667)) + (:scalevel-x (meters 0.04444444)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -2.8444443) + (:friction 0.98) + (:timer (seconds 0.14)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 90)) + (:conerot-y (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 154 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 3)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 2) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.013333334) (meters 0.013333334)) + (:scalevel-x (meters 0.008888889)) + (:rotvel-z (degrees -0.6) (degrees 1.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.56666666) + (:fade-g -0.56666666) + (:fade-b -0.56666666) + (:fade-a 0.15) + (:friction 0.97) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.27) (seconds 0.267)) + (:next-launcher 156) + (:conerot-x (degrees 0) (degrees 30)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 156 + :init-specs ((:fade-a -0.08)) + ) + +;; failed to figure out what this is: +(defpart 157 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 32.0) + (:g 32.0 32.0) + (:b 32.0 32.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:friction 0.98) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.05) (seconds 0.197)) + (:next-launcher 158) + ) + ) + +;; failed to figure out what this is: +(defpart 158 + :init-specs ((:fade-a -0.28444445)) + ) + +;; definition for function process-drawable-burn-effect +;; INFO: Used lq/sq +(defbehavior process-drawable-burn-effect target ((arg0 time-frame)) + (sound-play "get-burned") + (let ((s5-1 (new 'stack 'rgbaf)) + (s3-0 (current-time)) + (s4-1 (-> self parent)) + ) + (set! (-> s5-1 quad) (-> (the-as process-drawable (-> s4-1 0)) draw color-mult quad)) + (let ((s2-1 (vector-float*! (the-as vector (new 'stack 'rgbaf)) (the-as vector s5-1) 0.0))) + (while (not (time-elapsed? s3-0 arg0)) + (let ((v1-8 (- (current-time) s3-0))) + (if (< v1-8 (the-as time-frame (/ arg0 2))) + (vector-lerp! + (-> (the-as process-drawable (-> s4-1 0)) draw color-mult) + s5-1 + s2-1 + (/ (the float v1-8) (the float arg0)) + ) + (vector-lerp! + (-> (the-as process-drawable (-> s4-1 0)) draw color-mult) + s5-1 + s2-1 + (- 1.0 (/ (the float v1-8) (the float arg0))) + ) + ) + ) + (let ((v1-13 (process-drawable-random-point! + (the-as process-drawable (ppointer->process s4-1)) + (new 'stack-no-clear 'vector) + ) + ) + (t9-7 sp-launch-particles-var) + (a0-18 *sp-particle-system-2d*) + (a1-7 (-> *part-id-table* 157)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> v1-13 quad)) + (t9-7 a0-18 a1-7 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (suspend) + 0 + ) + ) + (let ((v0-8 (-> (the-as process-drawable (-> s4-1 0)) draw color-mult))) + (set! (-> v0-8 quad) (-> s5-1 quad)) + v0-8 + ) + ) + ) + +;; failed to figure out what this is: +(defpart 159 + :init-specs ((:texture (gun-blue-puffs level-default-sprite)) + (:birth-func 'birth-func-target-orient) + (:num 1.0) + (:y (meters 0.02)) + (:scale-x (meters 0.5) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 110.0 32.0) + (:g 128.0 32.0) + (:b 96.0 32.0) + (:a 8.0 40.0) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:userdata -8192.0) + ) + ) + +;; failed to figure out what this is: +(defpart 160 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.017)) + (:next-launcher 161) + ) + ) + +;; failed to figure out what this is: +(defpart 161 + :init-specs ((:scale-x (meters 0.2) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g 128.0 64.0) + (:b 255.0) + (:a 24.0 32.0) + (:next-time (seconds 0.017)) + (:next-launcher 161) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightning-glow + :id 67 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 162 :flags (sp6)) (sp-item 163 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 162 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 32.0 96.0) + (:b 128.0 128.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 163 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0 128.0) + (:b 255.0) + (:a 6.0 12.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightning-green-glow + :id 68 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 164 :flags (sp6)) (sp-item 165 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 164 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 128.0 128.0) + (:b 32.0 96.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 165 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 128.0 128.0) + (:b 32.0 96.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightning-red-glow + :id 69 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 166 :flags (sp6)) (sp-item 167 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 166 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b 0.0 32.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 167 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 2)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0 128.0) + (:g 32.0 96.0) + (:b 0.0 32.0) + (:a 4.0 8.0) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0) (meters 1)) + ) + ) + +;; definition for function lightning-probe-callback +;; WARN: Return type mismatch int vs none. +(defun lightning-probe-callback ((arg0 lightning-tracker)) + (let ((v1-1 (+ (-> arg0 user-time 0) 1))) + (set! (-> arg0 user-time 0) v1-1) + (when (= v1-1 (seconds 0.007)) + (let* ((v1-2 (rand-vu-int-range 64 128)) + (v0-3 (logior (logior (logior #x800000 v1-2) (* v1-2 256)) (shl (rand-vu-int-range 32 64) 24))) + (v1-6 (-> arg0 lightning state)) + ) + (set! (-> v1-6 start-color) (the-as rgba v0-3)) + (set! (-> v1-6 end-color) (the-as rgba v0-3)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 1) (new 'static 'lightning-spec + :name "lightning-shock" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 2) (new 'static 'lightning-spec + :name "lightning-shock-dim" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x20) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 3) (new 'static 'lightning-spec + :name "lightning-shock-red" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 4) (new 'static 'lightning-spec + :name "lightning-shock-green" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3b :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 5) (new 'static 'lightning-spec + :name "lightning-dark" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.52 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1228.8 + :duration 30.0 + :sound (static-sound-spec "shock" :group 1) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-lightning-dark-shot-tip-hit-replace + :id 70 + :duration (seconds 0.017) + :linger-duration (seconds 0.085) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 168 :flags (sp7) :period (seconds 10) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 168 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 2.0 3.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters 0.01) (meters 0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.7) + (:friction 0.99) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-lightning-2d-spline-align-plus-rotz) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function process-drawable-shock-effect-replace +;; INFO: Used lq/sq +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Stack slot offset 720 signed mismatch +;; WARN: Return type mismatch int vs none. +(defun process-drawable-shock-effect-replace ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 int) + (arg4 int) + (arg5 float) + ) + (local-vars + (sv-640 (pointer process)) + (sv-720 float) + (sv-736 int) + (sv-752 matrix) + (sv-768 collide-query) + (sv-784 symbol) + (sv-800 vector) + (sv-816 int) + (sv-832 process) + ) + (set! sv-720 arg5) + (let ((s5-0 *lightning-probe-vars*)) + (if (= arg3 256) + (set! sv-736 arg3) + (set! sv-736 (rand-vu-int-range 3 (/ (+ (-> arg0 node-list length) -1) 2))) + ) + (set! sv-752 (new 'stack-no-clear 'matrix)) + (set! sv-768 (new 'stack-no-clear 'collide-query)) + (set! sv-784 (the-as symbol #f)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> *up-vector* quad)) + (when (nonzero? arg3) + (set! sv-736 arg3) + sv-736 + ) + (if (= arg3 256) + (set! (-> sv-768 start-pos quad) (-> arg0 root trans quad)) + (vector<-cspace! (-> sv-768 start-pos) (-> arg0 node-list data sv-736)) + ) + (set! sv-800 (-> sv-768 move-dist)) + (set! (-> sv-800 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-800 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-800 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-800 w) 1.0) + (matrix-rotate-zyx! sv-752 (-> sv-768 move-dist)) + (set! sv-816 6) + (while (nonzero? sv-816) + (set! sv-816 (+ sv-816 -1)) + (vector-rotate*! (-> sv-768 move-dist) (-> s5-0 probe-dirs sv-816) sv-752) + (vector-normalize! (-> sv-768 move-dist) sv-720) + (let ((v1-31 sv-768)) + (set! (-> v1-31 radius) 409.6) + (set! (-> v1-31 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) + (set! (-> v1-31 ignore-process0) arg0) + (set! (-> v1-31 ignore-process1) #f) + (set! (-> v1-31 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-31 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-768) 0.0) + (set-time! (-> s5-0 last-valid-time)) + (set! (-> s5-0 src-joint-index) (the-as uint sv-736)) + (set! (-> s5-0 end-pos quad) (-> sv-768 best-other-tri intersect quad)) + (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-768 start-pos))) + (set! (-> gp-0 quad) (-> sv-768 best-other-tri normal quad)) + (set! sv-784 #t) + (goto cfg-15) + ) + ) + ) + (label cfg-15) + (when sv-784 + (let* ((a0-24 *default-dead-pool*) + (t9-10 (method-of-object a0-24 get-process)) + (a1-14 lightning-tracker) + (a2-2 (the-as object #x4000)) + (a3-1 0) + ) + (set! sv-832 (t9-10 a0-24 a1-14 (the-as int a2-2) a3-1)) + (set! sv-640 + (when sv-832 + (let ((t9-11 (method-of-type lightning-tracker activate))) + (t9-11 (the-as lightning-tracker sv-832) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (set! a2-2 arg1) + (set! a3-1 arg4) + (run-now-in-process + sv-832 + lightning-tracker-init + (the-as lightning-spec a2-2) + a3-1 + arg2 + arg0 + (if (= arg3 256) + (-> arg0 root trans) + (-> s5-0 src-joint-index) + ) + (-> s5-0 end-pos) + ) + (-> sv-832 ppointer) + ) + ) + (when sv-640 + (set! (-> (the-as lightning-tracker (-> sv-640 0)) user-time 0) 0) + (let ((v1-63 (get-field-spec-by-id (-> *part-id-table* 168) (sp-field-id spt-timer)))) + (if v1-63 + (set! (-> v1-63 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> sv-640 0)) duration))) + ) + ) + (let ((s4-1 (matrix-u-compose (new 'stack-no-clear 'matrix) gp-0 (the-as vector a2-2) (the-as vector a3-1)))) + (set! (-> s4-1 trans quad) (-> s5-0 end-pos quad)) + (vector+float*! (-> s4-1 trans) (-> s4-1 trans) gp-0 409.6) + (if (logtest? (-> *part-group-id-table* 70 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 70) + :mat-joint s4-1 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 70) :mat-joint s4-1) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function process-drawable-shock-effect +;; INFO: Used lq/sq +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Stack slot offset 640 signed mismatch +;; WARN: Return type mismatch int vs object. +(defun process-drawable-shock-effect ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 sparticle-launcher) + (arg4 int) + (arg5 int) + (arg6 float) + ) + (local-vars + (sv-624 (pointer process)) + (sv-640 float) + (sv-656 int) + (sv-672 matrix) + (sv-688 collide-query) + (sv-704 symbol) + (sv-720 vector) + (sv-736 int) + (sv-752 process) + ) + (set! sv-640 arg6) + (when (or (= arg4 256) (and (nonzero? (-> arg0 node-list)) (> (-> arg0 node-list length) 0))) + (let ((s5-0 *lightning-probe-vars*)) + (if (= arg4 256) + (set! sv-656 arg4) + (set! sv-656 (rand-vu-int-range 3 (/ (+ (-> arg0 node-list length) -1) 2))) + ) + (set! sv-672 (new 'stack-no-clear 'matrix)) + (set! sv-688 (new 'stack-no-clear 'collide-query)) + (set! sv-704 (the-as symbol #f)) + (when (nonzero? arg4) + (set! sv-656 arg4) + sv-656 + ) + (if (= arg4 256) + (set! (-> sv-688 start-pos quad) (-> arg0 root trans quad)) + (vector<-cspace! (-> sv-688 start-pos) (-> arg0 node-list data sv-656)) + ) + (set! sv-720 (-> sv-688 move-dist)) + (set! (-> sv-720 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 w) 1.0) + (matrix-rotate-zyx! sv-672 (-> sv-688 move-dist)) + (set! sv-736 6) + (while (nonzero? sv-736) + (set! sv-736 (+ sv-736 -1)) + (vector-rotate*! (-> sv-688 move-dist) (-> s5-0 probe-dirs sv-736) sv-672) + (vector-normalize! (-> sv-688 move-dist) sv-640) + (let ((v1-35 sv-688)) + (set! (-> v1-35 radius) 409.6) + (set! (-> v1-35 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) + (set! (-> v1-35 ignore-process0) arg0) + (set! (-> v1-35 ignore-process1) #f) + (set! (-> v1-35 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-35 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) + (set-time! (-> s5-0 last-valid-time)) + (set! (-> s5-0 src-joint-index) (the-as uint sv-656)) + (set! (-> s5-0 end-pos quad) (-> sv-688 best-other-tri intersect quad)) + (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-688 start-pos))) + (set! sv-704 #t) + (goto cfg-21) + ) + ) + ) + (label cfg-21) + (when sv-704 + (set! sv-752 (get-process *default-dead-pool* lightning-tracker #x4000 0)) + (set! sv-624 + (when sv-752 + (let ((t9-11 (method-of-type lightning-tracker activate))) + (t9-11 (the-as lightning-tracker sv-752) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (run-now-in-process + sv-752 + lightning-tracker-init + arg1 + arg5 + arg2 + arg0 + (if (= arg4 256) + (-> arg0 root trans) + (-> s5-0 src-joint-index) + ) + (-> s5-0 end-pos) + ) + (-> sv-752 ppointer) + ) + ) + (when sv-624 + (set! (-> (the-as lightning-tracker (-> sv-624 0)) user-time 0) 0) + (when arg3 + (let ((v1-66 (get-field-spec-by-id arg3 (sp-field-id spt-timer)))) + (if v1-66 + (set! (-> v1-66 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> sv-624 0)) duration))) + ) + ) + (let ((t9-14 sp-launch-particles-var) + (a0-30 *sp-particle-system-2d*) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (t9-14 a0-30 arg3 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + ) + 0 + ) + +;; definition for function process-drawable-shock-wall-effect +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function process-drawable2-shock-effect +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun process-drawable2-shock-effect ((arg0 process-drawable) + (arg1 process-drawable) + (arg2 lightning-spec) + (arg3 (function lightning-tracker none)) + (arg4 sparticle-launcher) + ) + (local-vars (sv-16 int) (sv-64 vector) (sv-68 vector) (sv-72 (pointer process))) + (when (and (nonzero? (-> arg0 skel)) (nonzero? (-> arg1 skel))) + (let* ((v1-7 (-> arg0 draw lod-set lod (-> arg0 draw lod-set max-lod) geo length)) + (s0-0 (-> arg1 draw lod-set lod (-> arg1 draw lod-set max-lod) geo length)) + (s1-0 (rand-vu-int-range 3 (+ v1-7 -1))) + ) + (set! sv-16 (rand-vu-int-range 3 (+ s0-0 -1))) + (set! sv-64 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data s1-0))) + (set! sv-68 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg1 node-list data sv-16))) + (set! sv-72 (process-spawn + lightning-tracker + :init lightning-tracker-init + arg2 + 0 + arg3 + arg0 + s1-0 + sv-16 + :name "lightning-tracker" + :to arg1 + :unk 0 + ) + ) + ) + (when (and arg4 sv-72) + (let ((v1-19 (get-field-spec-by-id arg4 (sp-field-id spt-timer)))) + (if v1-19 + (set! (-> v1-19 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> sv-72 0)) duration))) + ) + ) + (let ((t9-8 sp-launch-particles-var) + (a0-20 *sp-particle-system-2d*) + (a1-14 arg4) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> sv-64 quad)) + (t9-8 a0-20 a1-14 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-9 sp-launch-particles-var) + (a0-21 *sp-particle-system-2d*) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> sv-68 quad)) + (t9-9 a0-21 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 6) (new 'static 'lightning-spec + :name "lightning-shock-skel" + :flags (lightning-spec-flags lsf0) + :rand-func #x2 + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.5 + :num-points 32 + :box-size 6144.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound #f + ) + ) + +;; definition for function process-drawable-shock-skel-effect +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: new jak 2 until loop case, check carefully +;; WARN: new jak 2 until loop case, check carefully +(defun process-drawable-shock-skel-effect ((arg0 process-drawable) + (arg1 lightning-spec) + (arg2 (function lightning-tracker none)) + (arg3 sparticle-launcher) + (arg4 float) + (arg5 int) + (arg6 int) + ) + (local-vars + (sv-416 int) + (sv-432 vector) + (sv-448 vector) + (sv-464 vector) + (sv-480 quaternion) + (sv-496 vector) + (sv-512 matrix) + (sv-528 vector) + (sv-544 vector) + (sv-560 process) + (sv-576 int) + (sv-592 (function lightning-control int vector none)) + (sv-608 lightning-control) + (sv-624 int) + (sv-640 vector) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s1-0 (-> arg0 draw lod-set lod (-> arg0 draw cur-lod) geo length))) + (set! sv-416 (rand-vu-int-range 4 (+ s1-0 -1))) + (let ((s1-1 (rand-vu-int-range 4 (+ s1-0 -1)))) + (when (!= arg5 -1) + (set! sv-416 arg5) + sv-416 + ) + (if (!= arg6 -1) + (set! s1-1 arg6) + ) + (-> arg0 node-list data sv-416) + (let ((s0-1 (-> arg0 node-list data sv-416)) + (a0-9 (-> arg0 node-list data s1-1)) + (v1-18 #t) + ) + (until #f + (let ((a1-3 a0-9)) + (until #f + (cond + ((and (-> a1-3 joint) (>= (-> a1-3 joint number) 2)) + (when (= s0-1 a1-3) + #t + (goto cfg-24) + ) + (set! a1-3 (-> a1-3 parent)) + ) + (else + (set! s0-1 (-> s0-1 parent)) + (when (or (not (-> s0-1 joint)) (< (-> s0-1 joint number) 2)) + (set! v1-18 #f) + (goto cfg-24) + ) + (goto cfg-23) + ) + ) + ) + ) + #f + (label cfg-23) + ) + #f + (label cfg-24) + (when v1-18 + (let ((s5-1 (the-as (array cspace) (new 'stack 'boxed-array cspace 32)))) + (let ((v1-21 0)) + (set! (-> s5-1 length) 0) + (let ((a1-12 (-> arg0 node-list data sv-416)) + (a0-19 (-> arg0 node-list data s1-1)) + ) + (set! (-> s5-1 (-> s5-1 length)) a1-12) + (+! (-> s5-1 length) 1) + (while (!= a1-12 s0-1) + (set! a1-12 (-> a1-12 parent)) + (set! (-> s5-1 (-> s5-1 length)) a1-12) + (+! (-> s5-1 length) 1) + ) + (while (!= a0-19 s0-1) + (set! a0-19 (-> a0-19 parent)) + (+! (-> s5-1 length) 1) + ) + ) + (let ((a0-23 (-> arg0 node-list data s1-1))) + (while (!= a0-23 s0-1) + (let ((a1-18 (-> a0-23 parent))) + (+! v1-21 1) + (set! (-> s5-1 (- (-> s5-1 length) v1-21)) a0-23) + (set! a0-23 a1-18) + ) + ) + ) + ) + (when (< 2 (-> s5-1 length)) + (let ((s1-2 (new 'stack-no-clear 'vector))) + (set! sv-512 (new 'stack-no-clear 'matrix)) + (let ((s0-2 (new 'stack-no-clear 'vector))) + (set! sv-432 (new 'stack-no-clear 'vector)) + (set! sv-448 (new 'stack-no-clear 'vector)) + (set! sv-464 (new 'stack-no-clear 'vector)) + (set! sv-480 (new 'stack-no-clear 'quaternion)) + (set! sv-496 s1-2) + (set! (-> sv-496 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-496 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-496 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-496 w) 1.0) + (matrix-rotate-zyx! sv-512 s1-2) + (vector-rotate*! sv-448 *up-vector* sv-512) + (vector<-cspace! sv-432 (-> s5-1 0)) + (set! sv-544 s0-2) + (set! sv-528 (vector<-cspace! (new 'stack-no-clear 'vector) (-> s5-1 0))) + (let ((v0-10 (vector<-cspace! (new 'stack-no-clear 'vector) (-> s5-1 1)))) + (.lvf vf4 (&-> sv-528 quad)) + (.lvf vf5 (&-> v0-10 quad)) + ) + (.mov.vf vf6 vf0 :mask #b1000) + (.sub.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> sv-544 quad) vf6) + (vector-normalize! s0-2 1.0) + (set! sv-560 (get-process *default-dead-pool* lightning-tracker #x4000 0)) + (let ((a0-35 (when sv-560 + (let ((t9-13 (method-of-type lightning-tracker activate))) + (t9-13 (the-as lightning-tracker sv-560) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (run-now-in-process sv-560 lightning-tracker-init arg1 0 arg2 arg0 #f #f) + (-> sv-560 ppointer) + ) + ) + ) + (when a0-35 + (set! (-> (the-as lightning-tracker (-> a0-35 0)) user-time 0) 0) + (let ((s4-1 (-> (the-as lightning-tracker (-> a0-35 0)) lightning)) + (s3-1 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-1 state points-to-draw) 0) + (let ((a1-32 s3-1)) + (let ((v1-44 sv-432)) + (let ((a0-38 sv-448)) + (let ((a2-30 arg4)) + (.mov vf7 a2-30) + ) + (.lvf vf5 (&-> a0-38 quad)) + ) + (.lvf vf4 (&-> v1-44 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-32 quad) vf6) + ) + (set-point! s4-1 (-> s4-1 state points-to-draw) s3-1) + (+! (-> s4-1 state points-to-draw) 1) + (set! sv-576 0) + (while (< sv-576 (+ (-> s5-1 length) -1)) + (set! sv-640 (new 'stack-no-clear 'vector)) + (vector<-cspace! sv-640 (-> s5-1 (+ sv-576 1))) + (vector-! sv-464 sv-640 sv-432) + (vector-normalize! sv-464 1.0) + (quaternion-from-two-vectors! sv-480 s0-2 sv-464) + (vector-orient-by-quat! s1-2 sv-448 sv-480) + (set! (-> s1-2 quad) (-> sv-448 quad)) + (let ((a1-40 s2-1)) + (let ((v1-56 sv-640)) + (let ((a0-47 s1-2)) + (let ((a2-34 arg4)) + (.mov vf7 a2-34) + ) + (.lvf vf5 (&-> a0-47 quad)) + ) + (.lvf vf4 (&-> v1-56 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-40 quad) vf6) + ) + (set! sv-608 s4-1) + (set! sv-592 (method-of-object sv-608 set-point!)) + (set! sv-624 (-> s4-1 state points-to-draw)) + (let ((a2-36 (vector-average! (new 'stack-no-clear 'vector) s2-1 s3-1))) + (sv-592 sv-608 sv-624 a2-36) + ) + (+! (-> s4-1 state points-to-draw) 1) + (set-point! s4-1 (-> s4-1 state points-to-draw) s2-1) + (+! (-> s4-1 state points-to-draw) 1) + (set! (-> s3-1 quad) (-> s2-1 quad)) + (set! (-> s0-2 quad) (-> sv-464 quad)) + (set! (-> sv-448 quad) (-> s1-2 quad)) + (set! (-> sv-432 quad) (-> sv-640 quad)) + (set! sv-576 (+ sv-576 1)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-bomb + :id 71 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 169 :period (seconds 10) :length (seconds 0.167)) + (sp-item 170 :period (seconds 10) :length (seconds 0.017)) + (sp-item 171 :flags (sp6) :period (seconds 10) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 169 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 3.0) + (:scale-x (meters 1)) + (:rot-x (degrees 1.125)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 128.0 128.0) + (:a 16.0) + (:scalevel-x (meters 0.53333336) (meters 0.53333336)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.45714286) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 170 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 128.0 128.0) + (:a 24.0) + (:scalevel-x (meters 0.34285715)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.117)) + (:next-launcher 172) + ) + ) + +;; failed to figure out what this is: +(defpart 172 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.05625)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.875) + (:fade-b 0.0) + (:fade-a -0.15) + ) + ) + +;; failed to figure out what this is: +(defpart 171 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 16)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters 1.6)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-transform + :id 72 + :duration (seconds 0.25) + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 169 :period (seconds 10) :length (seconds 0.167)) + (sp-item 170 :period (seconds 10) :length (seconds 0.017)) + (sp-item 171 :period (seconds 10) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 7) (new 'static 'lightning-spec + :name "lightning-darkjak-transform" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 90.0 + :sound (static-sound-spec "transform-zap" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 8) (new 'static 'lightning-spec + :name "lightning-darkjak-pill" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 90.0 + :sound (static-sound-spec "transform-zap" :group 1) + :delay 60.0 + :delay-rand 120.0 + ) + ) + +;; definition for symbol *lightning-darkjak-pill*, type lightning-spec +(define *lightning-darkjak-pill* (-> *lightning-spec-id-table* 8)) + +;; failed to figure out what this is: +(defpart 173 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.1) (meters 0.15)) + (:rot-x 4) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 8.0 12.0) + (:omega (degrees 0.225)) + (:vel-y (meters 0.053333335) (meters 0.026666667)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.26666668) + (:friction 0.99 0.005) + (:timer (seconds 0.25)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-smack-trail + :id 73 + :flags (sp0 sp4 sp13) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 174 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 174 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.64) + (:fade-b -0.85333335) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-smack + :id 74 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 175 :flags (sp3 sp7) :period (seconds 10) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpart 175 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 50.0) + (:y (meters 0) (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 200.0) + (:a 1.0) + (:omega (degrees 0.1125)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.006666667) + (:accel-z (meters 0.0026666666)) + (:friction 1.1) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -2) (degrees 4)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-smack-charge + :id 75 + :flags (sp12) + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 176 :flags (sp6)) (sp-item 177 :flags (sp6)) (sp-item 178)) + ) + +;; failed to figure out what this is: +(defpart 176 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 50.0 10.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 177 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.01)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 5.0) + (:rotvel-z (degrees 0.3)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 glow)) + (:userdata 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 178 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.42666668) + (:fade-a 0.4) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 1.0) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-smack-wall-explode + :id 76 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 179 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 180 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.667)) + (sp-item 181 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.667)) + ) + ) + +;; failed to figure out what this is: +(defpart 179 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 100.0) + (:x (meters 0.1) (meters 0.1)) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 16.0 1 84.0) + (:g 0.0 1 100.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters 0.3) (meters 0.033333335)) + (:scalevel-x (meters 0.033333335)) + (:fade-r -0.16666667) + (:fade-g -0.6666667) + (:fade-a -0.85) + (:friction 0.83) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.25)) + (:next-launcher 182) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 182 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.033333335) + (:fade-b -0.033333335) + (:friction 0.99) + ) + ) + +;; failed to figure out what this is: +(defpart 180 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 5.0) + (:scale-x (meters 2) (meters 4)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 3)) + (:r 20.0 1 60.0) + (:g 0.0 1 80.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 181 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 4) (meters 8)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 3)) + (:r 20.0 1 60.0) + (:g 0.0 1 80.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-darkjak-smack-hit + :id 77 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 183 :flags (sp7) :period (seconds 20) :length (seconds 0.035)) + (sp-item 184 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.5)) + (sp-item 185 :flags (sp6 sp7) :period (seconds 20) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 183 + :init-specs ((:texture (water-radiate level-default-sprite)) + (:num 50.0) + (:x (meters 0.1) (meters 0.1)) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 80.0 1 80.0) + (:g 0.0 1 64.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters 0.1)) + (:fade-g -2.6666667) + (:fade-b -0.6666667 -0.6666667) + (:fade-a -0.85 -0.85) + (:friction 0.83) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:next-time (seconds 0.25)) + (:next-launcher 186) + (:conerot-y (degrees 0) (degrees 180)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 186 + :init-specs ((:fade-g -0.06666667) (:fade-b -0.06666667) (:friction 0.99)) + ) + +;; failed to figure out what this is: +(defpart 184 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 10.0) + (:scale-x (meters 0.3) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 1)) + (:r 80.0 1 80.0) + (:g 0.0 1 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 185 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 3)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 1)) + (:r 80.0 1 80.0) + (:g 0.0 1 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 9) (new 'static 'lightning-spec + :name "lightning-darkjak-local" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 150.0 + :sound (static-sound-spec "transform-zap" :group 1) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 10) (new 'static 'lightning-spec + :name "lightning-darkjak-attack" + :flags (lightning-spec-flags lsf0 lsf4) + :adjust-distance #xa + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 20 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :duration-rand 150.0 + :sound (static-sound-spec "stretched-zap" :group 1) + ) + ) + +;; failed to figure out what this is: +(defpart 187 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:next-time (seconds 0.017)) + (:next-launcher 188) + ) + ) + +;; failed to figure out what this is: +(defpart 188 + :init-specs ((:scale-x (meters 0.2) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 200.0 55.0) + (:g 0.0 128.0) + (:b 200.0 55.0) + (:a 24.0 8.0) + (:next-time (seconds 0.017)) + (:next-launcher 188) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-daxter-death-freeze + :id 78 + :flags (sp4) + :bounds (static-bspherem 0 -2 0 40) + :parts ((sp-item 189 :flags (is-3d)) (sp-item 190 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 189 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 90)) + (:scale-y (meters 1.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667)) + (:timer (seconds 5)) + (:func 'sparticle-track-root) + (:next-time (seconds 1.835)) + (:next-launcher 191) + ) + ) + +;; failed to figure out what this is: +(defpart 191 + :init-specs ((:rot-x (degrees 90)) (:rotvel-x (degrees -0.6)) (:next-time (seconds 0.45)) (:next-launcher 192)) + ) + +;; failed to figure out what this is: +(defpart 192 + :init-specs ((:rotvel-x (degrees 0))) + ) + +;; failed to figure out what this is: +(defpart 190 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5)) + (:rot-x (degrees 0)) + (:scale-y (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters -0.05)) + (:timer (seconds 5)) + (:func 'sparticle-track-root) + (:next-time (seconds 1.835)) + (:next-launcher 193) + ) + ) + +;; failed to figure out what this is: +(defpart 193 + :init-specs ((:rot-x (degrees 0)) (:rotvel-x (degrees -0.6)) (:next-time (seconds 0.45)) (:next-launcher 194)) + ) + +;; failed to figure out what this is: +(defpart 195 + :init-specs ((:rotvel-x (degrees 0))) + ) + +;; failed to figure out what this is: +(defpartgroup group-daxter-death-zap + :id 79 + :flags (sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 196) (sp-item 197) (sp-item 198)) + ) + +;; failed to figure out what this is: +(defpart 196 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 10.0 5.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 197 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.4 1.0) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.92) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.035)) + (:next-launcher 199) + ) + ) + +;; failed to figure out what this is: +(defpart 198 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.4 1.0) + (:scale-x (meters 0.3) (meters 1.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.92) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:next-time (seconds 0.035)) + (:next-launcher 199) + ) + ) + +;; failed to figure out what this is: +(defpart 199 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -1.2) (:fade-g -0.48) (:fade-a -2.4)) + ) + +;; failed to figure out what this is: +(defpartgroup group-daxter-death-zap-smoke + :id 80 + :flags (sp4) + :bounds (static-bspherem 0 -2 0 24) + :parts ((sp-item 201 :binding 200) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + (sp-item 200 :flags (sp2 sp3)) + ) + ) + +;; failed to figure out what this is: +(defpart 201 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.39) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.00033333333)) + (:timer (seconds 2.5)) + (:flags ()) + ) + ) + +;; failed to figure out what this is: +(defpart 200 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:z (meters 0.1)) + (:scale-x (meters 0.05) (meters 0.03)) + (:scale-y (meters 0.3) (meters 0.03)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:omega (degrees 0)) + (:vel-x (meters 0.029629631)) + (:fade-a -0.08533333) + (:timer (seconds 2.5)) + (:flags (ready-to-launch sp-cpuinfo-flag-13)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-daxter-death-limb-zap + :id 81 + :flags (sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 202) (sp-item 203 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 202 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 10.0 5.0) + (:omega (degrees 6761.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 203 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.2)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6761.25)) + (:vel-y (meters 0.0033333334)) + (:rotvel-z (degrees 0.6)) + (:fade-a -1.28) + (:timer (seconds 0.085) (seconds 0.165)) + (:flags (glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-dark-maker-idol-eye-part + :id 82 + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 204 :flags (sp7)) (sp-item 205 :flags (sp7)) (sp-item 206 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 204 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:x (meters 0.25)) + (:y (meters 0.1)) + (:z (meters 0.1)) + (:scale-x (meters 0)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y (meters 0)) + (:r 178.0) + (:g 100.0 30.0) + (:b 155.0) + (:a 7.0) + (:vel-y (meters 0)) + (:scalevel-x (meters 0.06) (meters 0.02)) + (:rotvel-z (degrees 0)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 206 + :init-specs ((:texture (tinyspeck level-default-sprite)) + (:num 1.0) + (:x (meters 2)) + (:scale-x (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 55.0) + (:b 155.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.12444445) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.835)) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 205 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:x (meters -0.25)) + (:y (meters 0.1)) + (:z (meters 0.1)) + (:scale-x (meters 0)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 20)) + (:scale-y (meters 0)) + (:r 178.0) + (:g 100.0 30.0) + (:b 155.0) + (:a 7.0) + (:vel-y (meters 0)) + (:scalevel-x (meters 0.06) (meters 0.02)) + (:rotvel-z (degrees 0)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc index 457a0a82d0..8eec0a844b 100644 --- a/test/decompiler/reference/jak3/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-util_REF.gc @@ -1635,7 +1635,7 @@ (set! (-> s4-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s4-0 1 y))) (set! (-> s4-0 1 r) (-> *TARGET-bank* body-radius)) (let ((v1-12 gp-0)) - (set! (-> v1-12 spheres) s4-0) + (set! (-> v1-12 best-dist) (the-as float s4-0)) (set! (-> v1-12 best-other-prim) (the-as collide-shape-prim 2)) (set! (-> v1-12 collide-with) (logclear @@ -1805,12 +1805,7 @@ (set! (-> arg1 control invul2-off-time) arg0) ) ) - (let ((t9-0 (method-of-object (-> arg1 control) collide-shape-method-49))) - 2 - #x8000 - 0 - (t9-0) - ) + (modify-collide-as! (-> arg1 control) 2 (collide-spec jak-vulnerable) (collide-spec)) (logior! (-> arg1 focus-status) (focus-status ignore)) 0 (none) @@ -1834,12 +1829,7 @@ ) (when (not (logtest? (target-flags tinvuln1 tinvuln2) (-> arg0 target-flags))) (logclear! (-> arg0 draw status) (draw-control-status no-draw-bounds)) - (let ((t9-0 (method-of-object (-> arg0 control) collide-shape-method-49))) - 2 - 0 - #x8000 - (t9-0) - ) + (modify-collide-as! (-> arg0 control) 2 (collide-spec) (collide-spec jak-vulnerable)) ) 0 (none) diff --git a/test/decompiler/reference/jak3/engine/target/target2_REF.gc b/test/decompiler/reference/jak3/engine/target/target2_REF.gc index df78d5a003..768651e1cb 100644 --- a/test/decompiler/reference/jak3/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target2_REF.gc @@ -800,15 +800,25 @@ :event target-standard-event-handler :exit (-> target-pole-cycle exit) :code (behavior ((arg0 float) (arg1 float) (arg2 float)) + (local-vars (a2-2 (function joint-control-channel float float float float :behavior process))) (let ((f0-2 (+ 1.0 (fmin 17.0 (ja-aframe-num 0))))) (ja-no-eval :group! jakb-pole-flip-up-ja :num! (seek!) :frame-num (ja-aframe f0-2 0)) ) (until (ja-done? 0) (suspend) - (ja :num! (seek!)) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) + (set! (-> a0-4 param 1) 1.0) + (let ((t9-3 joint-control-channel-group-eval!) + (a1-3 #f) + ) + (set! a2-2 num-func-seek!) + (t9-3 a0-4 (the-as art-joint-anim a1-3) a2-2) + ) + ) ) (set-forward-vel arg2) - (go target-pole-flip-up-jump arg0 arg1) + (go target-pole-flip-up-jump arg0 arg1 (the-as symbol a2-2)) ) :post target-no-move-post ) @@ -816,8 +826,8 @@ ;; failed to figure out what this is: (defstate target-pole-flip-up-jump (target) :event target-standard-event-handler - :enter (behavior ((arg0 float) (arg1 float)) - ((-> target-jump-forward enter) arg0 arg1) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + ((-> target-jump-forward enter) arg0 arg1 arg2) (set! (-> self control mod-surface) *forward-pole-jump-mods*) ) :exit target-exit @@ -825,7 +835,7 @@ ((-> target-jump-forward trans)) (vector-flatten! (-> self control transv) (-> self control transv) (-> self control edge-grab-edge-dir)) ) - :code (behavior ((arg0 float) (arg1 float)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (send-event *camera* 'damp-up) (ja :group! jakb-pole-jump-loop-ja :num! min) (let ((f0-1 (target-height-above-ground)) @@ -954,7 +964,7 @@ ((or (< -0.2 (local-pad-angle)) (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) (let ((v1-25 a1-2)) - (set! (-> v1-25 spheres) (-> *collide-edge-work* world-player-leap-up-spheres)) + (set! (-> v1-25 best-dist) (the-as float (-> *collide-edge-work* world-player-leap-up-spheres))) (set! (-> v1-25 best-other-prim) (the-as collide-shape-prim 6)) (set! (-> v1-25 collide-with) (-> self control root-prim prim-core collide-with)) (set! (-> v1-25 ignore-process0) #f) @@ -1094,6 +1104,7 @@ ) :exit (-> target-edge-grab exit) :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) + (local-vars (a2-4 (function joint-control-channel float float float float :behavior process))) (case arg2 (('ladder) (ja-channel-push! 1 (seconds 0.1)) @@ -1148,7 +1159,16 @@ (move-by-vector! (-> self control) s3-0) ) (suspend) - (ja :num! (seek!)) + (let ((a0-18 (-> self skel root-channel 0))) + (set! (-> a0-18 param 0) (the float (+ (-> a0-18 frame-group frames num-frames) -1))) + (set! (-> a0-18 param 1) 1.0) + (let ((t9-10 joint-control-channel-group-eval!) + (a1-7 #f) + ) + (set! a2-4 num-func-seek!) + (t9-10 a0-18 (the-as art-joint-anim a1-7) a2-4) + ) + ) ) ) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1156,7 +1176,7 @@ (set-forward-vel 16384.0) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (send-event *camera* 'damp-up) - (go target-jump-forward arg0 arg1) + (go target-jump-forward arg0 arg1 (the-as symbol a2-4)) ) :post target-no-move-post ) @@ -1766,12 +1786,7 @@ :event target-generic-event-handler :enter (behavior ((arg0 string) (arg1 handle)) (set! (-> self control anim-handle) arg1) - (let ((t9-0 (method-of-object (-> self control) collide-shape-moving-method-60))) - #x47200000 - #x47200000 - (-> self control root-prim prim-core collide-with) - (t9-0) - ) + (move-to-ground (-> self control) 40960.0 40960.0 #f (-> self control root-prim prim-core collide-with)) (logior! (-> self focus-status) (focus-status grabbed)) (set! (-> self neck flex-blend) 0.0) ) @@ -1828,13 +1843,7 @@ (move-to-point! (-> self control) a1-2) (matrix->quaternion (-> self control quat-for-control) (-> gp-0 bone transform)) (quaternion-copy! (-> self control quat) (-> self control quat-for-control)) - (let ((t9-5 (method-of-object (-> self control) collide-shape-moving-method-60))) - #x45800000 - #x47200000 - #t - (-> self control root-prim prim-core collide-with) - (t9-5) - ) + (move-to-ground (-> self control) 4096.0 40960.0 #t (-> self control root-prim prim-core collide-with)) (when (logtest? (-> self control status) (collide-status on-water)) (let ((a1-6 (new-stack-vector0))) (set! (-> a1-6 x) (-> self control trans x)) diff --git a/test/decompiler/reference/jak3/engine/target/target_REF.gc b/test/decompiler/reference/jak3/engine/target/target_REF.gc index 03217fe8ad..81b9e7b8d8 100644 --- a/test/decompiler/reference/jak3/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target_REF.gc @@ -1400,13 +1400,13 @@ ;; failed to figure out what this is: (defstate target-jump-forward (target) :event target-jump-event-handler - :enter (behavior ((arg0 float) (arg1 float)) + :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) ((-> target-jump enter) arg0 arg1 (the-as surface #f)) (set! (-> self control mod-surface) *forward-jump-mods*) ) :exit target-exit :trans (-> target-jump trans) - :code (behavior ((arg0 float) (arg1 float)) + :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (when (and (using-gun? self) (not (-> self gun charge-active?))) (set! (-> self gun top-anim-low-high) 0.0) (case (gun->eco (-> self gun gun-type)) @@ -3307,7 +3307,7 @@ (suspend) (ja :num! (seek! (ja-aframe 7.0 0))) ) - (go target-darkjak-bomb1) + (go target-darkjak-bomb1 arg0 arg1) ) (else (ja-no-eval :group! jakb-attack-uppercut-ja :num! (seek! (ja-aframe 7.0 0)) :frame-num (ja-aframe f30-0 0)) diff --git a/test/decompiler/reference/jak3/engine/util/glist-h_REF.gc b/test/decompiler/reference/jak3/engine/util/glist-h_REF.gc new file mode 100644 index 0000000000..a82a870305 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/util/glist-h_REF.gc @@ -0,0 +1,130 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition of type glst-node +(deftype glst-node (structure) + ((next glst-node) + (prev glst-node) + ) + ) + +;; definition for method 3 of type glst-node +(defmethod inspect ((this glst-node)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'glst-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (label cfg-4) + this + ) + +;; definition of type glst-named-node +(deftype glst-named-node (glst-node) + ((privname string) + ) + ) + +;; definition for method 3 of type glst-named-node +(defmethod inspect ((this glst-named-node)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'glst-named-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tprivname: ~A~%" (-> this privname)) + (label cfg-4) + this + ) + +;; definition of type glst-list +(deftype glst-list (structure) + ((head glst-node) + (tail glst-node) + (tailpred glst-node) + (numelem int32) + ) + :pack-me + ) + +;; definition for method 3 of type glst-list +(defmethod inspect ((this glst-list)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'glst-list) + (format #t "~1Thead: #~%" (-> this head)) + (format #t "~1Ttail: #~%" (-> this tail)) + (format #t "~1Ttailpred: #~%" (-> this tailpred)) + (format #t "~1Tnumelem: ~D~%" (-> this numelem)) + (label cfg-4) + this + ) + +;; definition for function glst-next +(defun glst-next ((arg0 glst-node)) + "return the next node in the list" + (-> arg0 next) + ) + +;; definition for function glst-prev +(defun glst-prev ((arg0 glst-node)) + "return the previous node in the list" + (-> arg0 prev) + ) + +;; definition for function glst-head +(defun glst-head ((arg0 glst-list)) + "return the start of the list" + (-> arg0 head) + ) + +;; definition for function glst-tail +(defun glst-tail ((arg0 glst-list)) + "return the tail of the list" + (-> arg0 tailpred) + ) + +;; definition for function glst-end-of-list? +(defun glst-end-of-list? ((arg0 glst-node)) + "is this node the end of the list. #t = end" + (not (-> arg0 next)) + ) + +;; definition for function glst-start-of-list? +(defun glst-start-of-list? ((arg0 glst-node)) + "is this node the start of the list. #t = start" + (not (-> arg0 prev)) + ) + +;; definition for function glst-empty? +(defun glst-empty? ((arg0 glst-list)) + "is the list empty, #t = empty" + (= (-> arg0 tailpred) arg0) + ) + +;; definition for function glst-node-name +(defun glst-node-name ((arg0 glst-named-node)) + (-> arg0 privname) + ) + +;; definition for function glst-set-name! +(defun glst-set-name! ((arg0 glst-named-node) (arg1 string)) + (set! (-> arg0 privname) arg1) + arg1 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/engine/util/glist_REF.gc b/test/decompiler/reference/jak3/engine/util/glist_REF.gc new file mode 100644 index 0000000000..b4a1d7bb95 --- /dev/null +++ b/test/decompiler/reference/jak3/engine/util/glist_REF.gc @@ -0,0 +1,199 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) + +;; definition for function glst-num-elements +(defun glst-num-elements ((arg0 glst-list)) + (-> arg0 numelem) + ) + +;; definition for function glst-remove +(defun glst-remove ((arg0 glst-list) (arg1 glst-node)) + (let ((v1-0 arg1)) + "return the previous node in the list" + (let ((v1-1 (-> v1-0 prev)) + (a2-1 arg1) + ) + "return the next node in the list" + (let ((a2-2 (-> a2-1 next))) + (set! (-> v1-1 next) a2-2) + (set! (-> a2-2 prev) v1-1) + ) + ) + ) + (+! (-> arg0 numelem) -1) + arg1 + ) + +;; definition for function glst-remove-tail +(defun glst-remove-tail ((arg0 glst-list)) + (let ((v1-0 arg0)) + "return the tail of the list" + (let* ((a1-1 (-> v1-0 tailpred)) + (v1-1 a1-1) + ) + "is this node the start of the list. #t = start" + (if (not (not (-> v1-1 prev))) + (glst-remove arg0 a1-1) + (the-as glst-node #f) + ) + ) + ) + ) + +;; definition for function glst-remove-head +(defun glst-remove-head ((arg0 glst-list)) + (let ((v1-0 arg0)) + "return the start of the list" + (let* ((a1-1 (-> v1-0 head)) + (v1-1 a1-1) + ) + "is this node the end of the list. #t = end" + (if (not (not (-> v1-1 next))) + (glst-remove arg0 a1-1) + (the-as glst-node #f) + ) + ) + ) + ) + +;; definition for function glst-insert-before +(defun glst-insert-before ((arg0 glst-list) (arg1 glst-node) (arg2 glst-node)) + (let ((v1-0 arg1)) + "return the previous node in the list" + (let ((v1-1 (-> v1-0 prev))) + (set! (-> arg2 prev) v1-1) + (set! (-> arg2 next) arg1) + (set! (-> v1-1 next) arg2) + ) + ) + (set! (-> arg1 prev) arg2) + (+! (-> arg0 numelem) 1) + arg2 + ) + +;; definition for function glst-insert-after +(defun glst-insert-after ((arg0 glst-list) (arg1 glst-node) (arg2 glst-node)) + (let ((v1-0 arg1)) + "return the next node in the list" + (let ((v1-1 (-> v1-0 next))) + (set! (-> arg2 prev) arg1) + (set! (-> arg2 next) v1-1) + (set! (-> v1-1 prev) arg2) + ) + ) + (set! (-> arg1 next) arg2) + (+! (-> arg0 numelem) 1) + arg2 + ) + +;; definition for function glst-add-tail +(defun glst-add-tail ((arg0 glst-list) (arg1 glst-node)) + (glst-insert-before arg0 (the-as glst-node (&-> arg0 tail)) arg1) + arg1 + ) + +;; definition for function glst-add-head +(defun glst-add-head ((arg0 glst-list) (arg1 glst-node)) + (glst-insert-after arg0 (the-as glst-node arg0) arg1) + arg1 + ) + +;; definition for function glst-init-list! +(defun glst-init-list! ((arg0 glst-list)) + (set! (-> arg0 head) (the-as glst-node (&-> arg0 tail))) + (set! (-> arg0 tail) #f) + (set! (-> arg0 tailpred) (the-as glst-node (&-> arg0 head))) + (set! (-> arg0 numelem) 0) + arg0 + ) + +;; definition for function glst-find-node-by-name +(defun glst-find-node-by-name ((arg0 glst-list) (arg1 string)) + (let ((v1-0 arg0)) + "return the start of the list" + (let ((s5-0 (-> v1-0 head))) + (while (let ((v1-6 s5-0)) + "is this node the end of the list. #t = end" + (not (not (-> v1-6 next))) + ) + (if (name= (-> (the-as glst-named-node s5-0) privname) arg1) + (return s5-0) + ) + "return the next node in the list" + (set! s5-0 (-> s5-0 next)) + ) + ) + ) + (the-as glst-node #f) + ) + +;; definition for function glst-get-node-by-index +(defun glst-get-node-by-index ((arg0 glst-list) (arg1 int)) + (when (and (< arg1 (glst-num-elements arg0)) (>= arg1 0)) + "return the start of the list" + (let ((v1-3 (-> arg0 head))) + (dotimes (a0-3 arg1) + (nop!) + (nop!) + (nop!) + (nop!) + "return the next node in the list" + (set! v1-3 (-> v1-3 next)) + ) + (return v1-3) + ) + ) + (the-as glst-node #f) + ) + +;; definition for function glst-length-of-longest-name +(defun glst-length-of-longest-name ((arg0 glst-list)) + (let ((gp-0 0)) + (let ((v1-0 arg0)) + "return the start of the list" + (let ((s5-0 (-> v1-0 head))) + (while (let ((v1-6 s5-0)) + "is this node the end of the list. #t = end" + (not (not (-> v1-6 next))) + ) + (let ((v1-3 (length (-> (the-as glst-named-node s5-0) privname)))) + (if (< gp-0 v1-3) + (set! gp-0 v1-3) + ) + ) + "return the next node in the list" + (set! s5-0 (-> s5-0 next)) + ) + ) + ) + gp-0 + ) + ) + +;; definition for function glst-get-node-index +(defun glst-get-node-index ((arg0 glst-list) (arg1 glst-node)) + (let ((v1-0 0)) + "return the start of the list" + (let ((a0-1 (-> arg0 head))) + (while (let ((a2-3 a0-1)) + "is this node the end of the list. #t = end" + (not (not (-> a2-3 next))) + ) + (if (= a0-1 arg1) + (return v1-0) + ) + (+! v1-0 1) + "return the next node in the list" + (set! a0-1 (-> a0-1 next)) + ) + ) + ) + -1 + ) + + + + diff --git a/test/decompiler/reference/jak3/engine/util/script-h_REF.gc b/test/decompiler/reference/jak3/engine/util/script-h_REF.gc index 6260541f80..b825927c80 100644 --- a/test/decompiler/reference/jak3/engine/util/script-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/util/script-h_REF.gc @@ -7,6 +7,7 @@ (spec pair) (func (function script-context object)) ) + :pack-me (:methods (script-form-method-9 () none) ) @@ -42,8 +43,8 @@ (:methods (new (symbol type object process vector) _type_) (eval! (_type_ pair) object) - (script-context-method-10 () none) - (script-context-method-11 () none) + (script-context-method-10 (_type_ object pair) object) + (script-context-method-11 (_type_ pair pair symbol) symbol) ) ) @@ -95,3 +96,7 @@ ;; failed to figure out what this is: 0 + + + + diff --git a/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc b/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc new file mode 100644 index 0000000000..721f905bb8 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common-obs/ladder_REF.gc @@ -0,0 +1,257 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ladder +(deftype ladder (process-drawable) + ((root collide-shape :override) + (rider-unit float) + (rider-time time-frame) + (art-height meters) + (set-height meters) + (meters-per-unit meters) + (meters-per-rung meters) + (options ladder-options) + ) + (:state-methods + idle + (active handle) + ) + (:methods + (init-collision! (_type_) none) + (init-skel! (_type_) none) + (init-params! (_type_) none) + (ladder-method-25 (_type_ matrix float) matrix) + (nop (_type_) none) + ) + ) + +;; definition for method 3 of type ladder +(defmethod inspect ((this ladder)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Trider-unit: ~f~%" (-> this rider-unit)) + (format #t "~2Trider-time: ~D~%" (-> this rider-time)) + (format #t "~2Tart-height: (meters ~m)~%" (-> this art-height)) + (format #t "~2Tset-height: (meters ~m)~%" (-> this set-height)) + (format #t "~2Tmeters-per-unit: (meters ~m)~%" (-> this meters-per-unit)) + (format #t "~2Tmeters-per-rung: (meters ~m)~%" (-> this meters-per-rung)) + (format #t "~2Toptions: ~D~%" (-> this options)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-ladder ladder ladder-lod0-jg ladder-idle-ja + ((ladder-lod0-mg (meters 999999))) + :bounds (static-spherem 0 8 0 16) + ) + +;; failed to figure out what this is: +(defstate idle (ladder) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touch 'attack) + (let* ((s4-0 proc) + (s2-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s2-0 + (let ((s4-1 (ladder-method-25 self (new 'stack-no-clear 'matrix) 0.0)) + (s3-0 (ladder-method-25 self (new 'stack-no-clear 'matrix) 1.0)) + (s1-0 (get-trans (the-as process-focusable s2-0) 0)) + (s2-1 (new 'stack-no-clear 'vector)) + ) + (vector-segment-distance-point! s1-0 (-> s4-1 trans) (-> s3-0 trans) s2-1) + (when (and (time-elapsed? (-> self rider-time) (seconds 0.2)) + (if (< 0.0 (vector-dot (vector-! (new 'stack-no-clear 'vector) s1-0 s2-1) (-> s4-1 fvec))) + (not (logtest? (-> self options) (ladder-options lo0))) + (not (logtest? (-> self options) (ladder-options lo1))) + ) + (send-event proc 'ladder (-> block param 0)) + ) + (set! (-> self meters-per-unit) (vector-vector-distance (-> s4-1 trans) (-> s3-0 trans))) + (set! (-> self rider-unit) (/ (vector-vector-distance (-> s4-1 trans) s2-1) (-> self meters-per-unit))) + (set-time! (-> self rider-time)) + (go-virtual active (process->handle proc)) + ) + ) + (the-as ladder-options #f) + ) + ) + ) + (('options) + (-> self options) + ) + ) + ) + :code (behavior () + (until #f + (nop self) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate active (ladder) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('matrix) + (let ((v0-0 (the-as object (ladder-method-25 self (the-as matrix (-> block param 0)) (-> self rider-unit))))) + (set-time! (-> self rider-time)) + v0-0 + ) + ) + (('move) + (set! (-> self rider-unit) + (fmax 0.0 (fmin 1.0 (+ (-> self rider-unit) (/ (the-as float (-> block param 0)) (-> self meters-per-unit))))) + ) + (* (-> self rider-unit) (/ (-> self meters-per-unit) (-> self meters-per-rung))) + ) + (('pos) + (if (> argc 0) + (set! (-> (the-as vector (-> block param 0)) quad) (-> self node-list data 5 bone transform uvec quad)) + ) + (-> self rider-unit) + ) + (('stance) + (let* ((f0-8 (/ (* 0.5 (-> self meters-per-rung)) (-> self meters-per-unit))) + (f1-12 (* (the float (the int (/ (+ (-> self rider-unit) (* 0.5 f0-8)) f0-8))) f0-8)) + ) + (+! (-> self rider-unit) (* 0.1 (- f1-12 (-> self rider-unit)))) + (set! (-> self rider-unit) (seek (-> self rider-unit) f1-12 (* 2.0 (seconds-per-frame) f0-8))) + ) + ) + (('options) + (-> self options) + ) + ) + ) + :code (behavior ((arg0 handle)) + (set-time! (-> self rider-time)) + (while (let ((s5-0 (handle->process arg0))) + (and (if (type? s5-0 process-focusable) + s5-0 + ) + (not (time-elapsed? (-> self rider-time) (seconds 0.1))) + ) + ) + (nop self) + (suspend) + ) + (go-virtual idle) + ) + ) + +;; definition for method 22 of type ladder +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this ladder)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 0) + (set-vector! (-> v1-2 local-sphere) 0.0 10240.0 0.0 12288.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-2) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-5 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type ladder +;; WARN: Return type mismatch int vs none. +(defmethod init-skel! ((this ladder)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ladder" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +;; definition for method 24 of type ladder +;; WARN: Return type mismatch int vs none. +(defmethod init-params! ((this ladder)) + (set! (-> this meters-per-rung) 6144.0) + (set! (-> this art-height) 94208.0) + (set! (-> this set-height) (res-lump-float (-> this entity) 'height :default 94208.0)) + (set! (-> this options) (res-lump-value (-> this entity) 'options ladder-options :time -1000000000.0)) + 0 + (none) + ) + +;; definition for method 25 of type ladder +;; INFO: Used lq/sq +(defmethod ladder-method-25 ((this ladder) (arg0 matrix) (arg1 float)) + (let ((s4-0 (-> this node-list data 4 bone transform)) + (s3-0 (new 'stack-no-clear 'matrix)) + ) + (let* ((a2-1 (-> this node-list data 5 bone transform)) + (v1-4 (-> a2-1 rvec quad)) + (a0-1 (-> a2-1 uvec quad)) + (a1-1 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> s3-0 rvec quad) v1-4) + (set! (-> s3-0 uvec quad) a0-1) + (set! (-> s3-0 fvec quad) a1-1) + (set! (-> s3-0 trans quad) a2-2) + ) + (vector+! + (-> s3-0 trans) + (-> s3-0 trans) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> s4-0 trans) (-> s3-0 trans)) 9830.4) + ) + (matrix-lerp! arg0 s4-0 s3-0 arg1) + ) + ) + +;; definition for method 26 of type ladder +;; WARN: Return type mismatch int vs none. +(defmethod nop ((this ladder)) + 0 + (none) + ) + +;; definition for method 11 of type ladder +(defmethod init-from-entity! ((this ladder) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (init-skel! this) + (init-params! this) + (if (logtest? (-> this options) (ladder-options nodraw)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + ) + (set! (-> this root scale y) (/ (-> this set-height) (-> this art-height))) + (set! (-> this draw bounds y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) + (set! (-> this draw bounds w) (+ 2048.0 (* 0.5 (-> this set-height)))) + (set! (-> this root root-prim local-sphere y) (/ (* 0.5 (-> this set-height)) (-> this root scale y))) + (set! (-> this root root-prim local-sphere w) (+ 2048.0 (* 0.5 (-> this set-height)))) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/offline/config/jak3/config.jsonc b/test/offline/config/jak3/config.jsonc index d29c79cc56..4672219120 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -1,7 +1,8 @@ { "dgos": [ "CGO/KERNEL.CGO", - "CGO/GAME.CGO" + "CGO/GAME.CGO", + "DGO/HALFPIPE.DGO" ], "skip_compile_files": [ @@ -138,7 +139,40 @@ // aligner "(method 9 align-control)", // gun-red-shot - "gun-fire-red-3" + "gun-fire-red-3", + // collide-mesh + "(method 9 collide-mesh-cache)", + "(method 10 collide-mesh)", + "(method 11 collide-mesh)", + "(method 13 collide-mesh)", + // collide-shape + "(method 18 collide-shape-prim-group)", + "(method 19 collide-shape-prim)", + "(method 36 collide-shape)", + "(method 12 collide-shape-prim-group)", + "(method 13 collide-shape-prim)", + "collide-shape-draw-debug-marks", + // spatial-hash + "(method 11 grid-hash)", + "(method 15 sphere-hash)", + // collide-cache + "test-closest-pt-in-triangle", + // default-menu + "all-texture-tweak-adjust", + "debug-menu-make-shader-menu", + // sparticle-launcher + "sp-relaunch-particle-3d", + "execute-part-engine", + "sparticle-respawn-heights", + "sparticle-respawn-timer", + "sparticle-mode-animate", + "sparticle-mode-animate", + "sparticle-texture-animate", + "sparticle-texture-day-night", + "sparticle-motion-blur", // clipping + "birth-func-texture-group", + // script + "command-get-process" ], "skip_compile_states": {}