diff --git a/common/math/Vector.h b/common/math/Vector.h index 01bd3c21b2..203274f9bf 100644 --- a/common/math/Vector.h +++ b/common/math/Vector.h @@ -77,7 +77,17 @@ class Vector { return true; } + bool operator==(const T other) const { + for (int i = 0; i < Size; i++) { + if (m_data[i] != other) { + return false; + } + } + return true; + } + bool operator!=(const Vector& other) const { return !((*this) == other); } + bool operator!=(const T other) const { return !((*this) == other); } const T length() const { return std::sqrt(squared_length()); } diff --git a/common/util/print_float.cpp b/common/util/print_float.cpp index 1f4c605c0d..3a96697a57 100644 --- a/common/util/print_float.cpp +++ b/common/util/print_float.cpp @@ -29,6 +29,14 @@ std::string meters_to_string(float value, bool append_trailing_decimal) { return float_to_string(value / METER_LENGTH, append_trailing_decimal); } +/*! + * Wrapper around float_to_string, for printing degrees. Unlike float_to_string, it does not append + * decimals by default. + */ +std::string degrees_to_string(float value, bool append_trailing_decimal) { + return float_to_string(value / DEGREES_LENGTH, append_trailing_decimal); +} + /*! * Convert a fixed point value to a float. Fixed point values usually end up with strange numbers * that were definitely not what was written when we do a naive conversion. This function diff --git a/common/util/print_float.h b/common/util/print_float.h index e502d90fb1..5dc47d44cf 100644 --- a/common/util/print_float.h +++ b/common/util/print_float.h @@ -8,5 +8,6 @@ float fixed_point_to_float(s64 value, s64 scale); std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal = false); std::string float_to_string(float value, bool append_trailing_decimal = true); std::string meters_to_string(float value, bool append_trailing_decimal = false); +std::string degrees_to_string(float value, bool append_trailing_decimal = false); std::string seconds_to_string(s64 value, bool append_trailing_decimal = false); int float_to_cstr(float value, char* buffer, bool append_trailing_decimal = true); diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 0999f35df0..b6884aa6e4 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -2481,11 +2481,12 @@ void DecompiledDataElement::get_modified_regs(RegSet&) const {} void DecompiledDataElement::do_decomp(const Env& env, const LinkedObjectFile* file) { if (m_label_info) { - m_description = decompile_at_label_with_hint(*m_label_info, m_label, env.file->labels, - env.file->words_by_seg, *env.dts, file); + m_description = + decompile_at_label_with_hint(*m_label_info, m_label, env.file->labels, + env.file->words_by_seg, *env.dts, file, env.version); } else { m_description = decompile_at_label_guess_type(m_label, env.file->labels, env.file->words_by_seg, - env.dts->ts, file); + env.dts->ts, file, env.version); } m_decompiled = true; } @@ -3095,11 +3096,13 @@ goos::Object DefpartgroupElement::to_form_internal(const Env& env) const { forms.push_back(pretty_print::to_symbol(fmt::format("defpartgroup {}", name()))); forms.push_back(pretty_print::to_symbol(fmt::format(":id {}", m_group_id))); if (m_static_info.duration != 3000) { - forms.push_back(pretty_print::to_symbol(fmt::format(":duration {}", m_static_info.duration))); + forms.push_back(pretty_print::to_symbol( + fmt::format(":duration (seconds {})", seconds_to_string(m_static_info.duration)))); } if (m_static_info.linger != 1500) { - forms.push_back( - pretty_print::to_symbol(fmt::format(":linger-duration {}", m_static_info.linger))); + // 5 seconds is default + forms.push_back(pretty_print::to_symbol( + fmt::format(":linger-duration (seconds {})", seconds_to_string(m_static_info.linger)))); } if (m_static_info.flags != 0) { auto things = decompile_bitfield_enum_from_int(TypeSpec("sp-group-flag"), env.dts->ts, @@ -3118,6 +3121,21 @@ goos::Object DefpartgroupElement::to_form_internal(const Env& env) const { meters_to_string(m_static_info.bounds.y()), meters_to_string(m_static_info.bounds.z()), meters_to_string(m_static_info.bounds.w())))); + if (env.version != GameVersion::Jak1) { + // jak 2 stuff. + if (m_static_info.rot != 0) { + forms.push_back(pretty_print::to_symbol(fmt::format( + ":rotate ((degrees {}) (degrees {}) (degrees {}))", + meters_to_string(m_static_info.rot.x()), meters_to_string(m_static_info.rot.y()), + meters_to_string(m_static_info.rot.z())))); + } + if (m_static_info.scale != 1) { + forms.push_back(pretty_print::to_symbol(fmt::format( + ":scale ({} {} {})", float_to_string(m_static_info.rot.x()), + float_to_string(m_static_info.rot.y()), float_to_string(m_static_info.rot.z())))); + } + } + std::vector item_forms; for (const auto& e : m_static_info.elts) { s32 launcher = e.part_id; @@ -3204,12 +3222,11 @@ goos::Object DefpartElement::to_form_internal(const Env& env) const { std::vector item_forms; for (const auto& e : m_static_info.fields) { - if (e.field_id == 67) { + if (e.is_sp_end(env.version)) { // sp-end break; } - ASSERT(env.version == GameVersion::Jak1); // need to update enums - item_forms.push_back(decompile_sparticle_field_init(e, env.dts->ts)); + item_forms.push_back(decompile_sparticle_field_init(e, env.dts->ts, env.version)); } if (!item_forms.empty()) { forms.push_back(pretty_print::to_symbol(":init-specs")); diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index 44a1e343f3..7775e9f4c8 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -1721,6 +1721,9 @@ class DefpartgroupElement : public FormElement { u16 flags; std::string name; math::Vector4f bounds; + // added in jak 2 + math::Vector3f rot; + math::Vector3f scale; struct PartGroupItem { u32 part_id; @@ -1763,6 +1766,19 @@ class DefpartElement : public FormElement { u16 flags; std::vector data; goos::Object sound_spec; + goos::Object userdata; // backup + + bool is_sp_end(GameVersion version) const { + switch (version) { + case GameVersion::Jak1: + return field_id == 67; + case GameVersion::Jak2: + return field_id == 72; + default: + ASSERT_MSG(false, fmt::format("unknown version {} for is_sp_end")); + return false; + } + } }; std::vector fields; }; diff --git a/decompiler/analysis/find_defpartgroup.cpp b/decompiler/analysis/find_defpartgroup.cpp index 034d16cd2b..6b94558d13 100644 --- a/decompiler/analysis/find_defpartgroup.cpp +++ b/decompiler/analysis/find_defpartgroup.cpp @@ -1,5 +1,6 @@ #include "find_defpartgroup.h" #include "common/goos/PrettyPrinter.h" +#include "common/util/BitUtils.h" #include "decompiler/IR2/Form.h" #include "decompiler/IR2/GenericElementMatcher.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" @@ -39,24 +40,24 @@ L81: L82: */ - int start_word_idx = (lab.offset / 4) - 1; + int word_idx = (lab.offset / 4) - 1; auto& words = env.file->words_by_seg.at(lab.target_segment); - auto& first_word = words.at(start_word_idx); + auto& first_word = words.at(word_idx++); if (first_word.kind() != LinkedWord::TYPE_PTR || first_word.symbol_name() != "sparticle-launch-group") { env.func->warnings.error_and_throw( "Reference to sparticle-launch-group bad: invalid type pointer"); } - auto& word_1 = words.at(start_word_idx + 1); + auto& word_1 = words.at(word_idx++); s16 len = word_1.data & 0xffff; group.duration = (word_1.data >> 16) & 0xffff; - auto& word_2 = words.at(start_word_idx + 2); + auto& word_2 = words.at(word_idx++); group.linger = word_2.data & 0xffff; group.flags = (word_2.data >> 16) & 0xffff; - auto& string_word = words.at(start_word_idx + 3); + auto& string_word = words.at(word_idx++); if (string_word.kind() != LinkedWord::PTR) { env.func->warnings.error_and_throw( "Reference to sparticle-launch-group bad: invalid name label"); @@ -64,7 +65,7 @@ L82: group.name = env.file->get_goal_string_by_label( env.file->get_label_by_name(env.file->get_label_name(string_word.label_id()))); - auto& array_word = words.at(start_word_idx + 4); + auto& array_word = words.at(word_idx++); if (array_word.kind() != LinkedWord::PTR) { env.func->warnings.error_and_throw( "Reference to sparticle-launch-group bad: invalid array label"); @@ -87,13 +88,34 @@ L82: item.binding = array_words.at(item_idx + 6).data; } + if (env.version != GameVersion::Jak1) { + // added fields in jak 2 + for (int i = 0; i < 3; i++) { + auto& word = words.at(word_idx++); + if (word.kind() != LinkedWord::PLAIN_DATA) { + env.func->warnings.error_and_throw("Reference to sparticle-launch-group bad: invalid rot"); + } + group.rot[i] = *reinterpret_cast(&word.data); + } + for (int i = 0; i < 3; i++) { + auto& word = words.at(word_idx++); + if (word.kind() != LinkedWord::PLAIN_DATA) { + env.func->warnings.error_and_throw( + "Reference to sparticle-launch-group bad: invalid scale"); + } + group.scale[i] = *reinterpret_cast(&word.data); + } + } + + word_idx = align4(word_idx); for (int i = 0; i < 4; i++) { - auto& word = words.at(start_word_idx + 8 + i); + auto& word = words.at(word_idx + i); if (word.kind() != LinkedWord::PLAIN_DATA) { env.func->warnings.error_and_throw("Reference to sparticle-launch-group bad: invalid bounds"); } group.bounds[i] = *reinterpret_cast(&word.data); } + word_idx += 4; } void read_static_part_data(DecompiledDataElement* src, @@ -159,7 +181,10 @@ L80: auto& fld = car(cur_field); item.sound_spec = cdr(cdr(cdr(cdr(&fld))))->as_pair()->car; } - if (item.field_id == 67) { + if (item.field_id == 48) { + item.userdata = car(cur_field); + } + if (item.is_sp_end(env.version)) { // sp-end break; } diff --git a/decompiler/analysis/mips2c.cpp b/decompiler/analysis/mips2c.cpp index 9fdd63c4e6..e31abb7b09 100644 --- a/decompiler/analysis/mips2c.cpp +++ b/decompiler/analysis/mips2c.cpp @@ -616,11 +616,14 @@ Mips2C_Line handle_daddiu(Mips2C_Output& out, } } -Mips2C_Line handle_sw(Mips2C_Output& out, const Instruction& i0, const std::string& instr_str) { +Mips2C_Line handle_sw(Mips2C_Output& out, + const Instruction& i0, + const std::string& instr_str, + GameVersion version) { if (i0.get_src(1).is_sym() && i0.get_src(2).is_reg(rs7())) { out.require_symbol(i0.get_src(1).get_sym()); - return {fmt::format("c->store_symbol({}, cache.{});", reg_to_name(i0.get_src(0)), - goal_to_c_name(i0.get_src(1).get_sym())), + return {fmt::format("c->store_symbol{}({}, cache.{});", version == GameVersion::Jak1 ? "" : "2", + reg_to_name(i0.get_src(0)), goal_to_c_name(i0.get_src(1).get_sym())), instr_str}; return handle_unknown(instr_str); // auto name = i0.get_src(1).get_sym(); @@ -998,7 +1001,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, case InstructionKind::OR: return handle_or(i0, instr_str); case InstructionKind::SW: - return handle_sw(output, i0, instr_str); + return handle_sw(output, i0, instr_str, version); case InstructionKind::VMOVE: return handle_generic_op2_mask(i0, instr_str, "vmove"); case InstructionKind::VITOF0: @@ -1071,6 +1074,7 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output, case InstructionKind::PAND: case InstructionKind::PCEQB: case InstructionKind::PPACW: + case InstructionKind::PCEQW: return handle_generic_op3(i0, instr_str, {}); case InstructionKind::MULS: return handle_generic_op3(i0, instr_str, "muls"); diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index c31063a793..f46a293a0b 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -3073,7 +3073,7 @@ (bucket-311 311) ;; depth-cue (tex-all-sprite 312) - (bucket-313 313) ;; particles | progress (percent bar) + (particles 313) ;; particles (bucket-314 314) ;; shadow (bucket-315 315) ;; effects (tex-all-warp 316) ;; tex @@ -5008,6 +5008,7 @@ :bitfield #t (needs-log-in 8) (bit-9 9) + (backup-sprite-tex 10) ;; set when particle-setup-adgif fails texture lookup. ) @@ -19685,7 +19686,7 @@ (get-field-spec-by-id "Returns the [[sp-field-init-spec]] that has the matching [[sp-field-id]]" (_type_ sp-field-id) sp-field-init-spec 9) - (sparticle-launcher-method-10 (_type_ string) none 10) + (setup-user-array (_type_ string) none 10) ) ) @@ -19770,11 +19771,11 @@ :size-assert #x70 :flag-assert #x1000000070 (:methods - (initialize (_type_ sparticle-launch-group process) none 9) ;; - (sparticle-launch-control-method-10 (_type_ vector) symbol 10) ;; (is-visible? (_type_ vector) symbol 10) + (initialize (_type_ sparticle-launch-group process) none 9) + (is-visible? (_type_ vector) symbol 10) (spawn (_type_ vector) none 11) ;; TODO - CFG ;; (spawn (_type_ vector) object 11) - (sparticle-launch-control-method-12 (_type_ matrix) none 12) - (sparticle-launch-control-method-13 (_type_ cspace) none 13) + (spawn-with-matrix (_type_ matrix) none 12) + (spawn-with-cspace (_type_ cspace) none 13) (kill-and-free-particles (_type_) none 14) (kill-particles (_type_) none 15) ) @@ -19815,6 +19816,12 @@ ) ;; ---sparticle-h:sp-cpuinfo-flag +(defenum sp-cpuinfo-flag-s32 + :bitfield #t + :type int32 + :copy-entries sp-cpuinfo-flag + ) + (declare-type sparticle-system basic) (deftype sparticle-cpuinfo (structure) ((sprite sprite-vec-data-2d :offset-assert 0) @@ -19833,6 +19840,7 @@ (friction float :offset-assert 96) (timer int32 :offset-assert 100) (flags sp-cpuinfo-flag :offset-assert 104) ;; NOTE - loaded with lw and lwu? + (flags-s32 sp-cpuinfo-flag-s32 :offset 104) (user-int32 int32 :offset-assert 108) (user-uint32 uint32 :offset 108) (user-float float :offset 108 :score 1) @@ -19850,7 +19858,7 @@ (key-alt sparticle-launch-state :offset 132) (binding sparticle-launch-state :offset-assert 136) (data uint32 1 :offset 12) ;; guessed by decompiler - (datab uint8 4 :offset 12) + (datab int8 4 :offset 12) (dataf float 1 :offset 12) ;; guessed by decompiler (datac uint8 1 :offset 12) ;; guessed by decompiler ) @@ -24228,20 +24236,6 @@ ;; sparticle-launcher ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype sparticle-launcher (basic) - () - :method-count-assert 11 - :size-assert #x10 - :flag-assert #xb00000010 - ;; Failed to read fields. - (:methods - (sparticle-launcher-method-9 () none 9) - (sparticle-launcher-method-10 () none 10) - ) - ) -|# - (deftype sp-queued-launch-particles (structure) ((sp-system sparticle-system :offset-assert 0) ;; guessed by decompiler (sp-launcher sparticle-launcher :offset-assert 4) ;; guessed by decompiler @@ -24310,15 +24304,15 @@ "Verifies if the given pointer, points to a [[sparticle-launch-group]]" (function pointer symbol)) (define-extern unlink-part-group-by-heap (function kheap int)) ;; -(define-extern sp-init-fields! (function object (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol object)) ;; TODO - mips2c +(define-extern sp-init-fields! (function object (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol object)) (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 adgif-shader texture-id none)) ;; TODO - assertion failure +(define-extern particle-setup-adgif (function adgif-shader int none)) ;; TODO - assertion failure (define-extern *particle-adgif-cache* particle-adgif-cache) ;; (define-extern particle-adgif-cache-flush "Clear [[*particle-adgif-cache*]]" (function none)) -(define-extern particle-adgif (function adgif-shader texture-id none)) ;; TODO - particle-adgif atomic ops, MIPS2C -(define-extern particle-adgif-callback (function adgif-shader none)) ;; TODO bad VF dependencies +(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)) ;; @@ -24343,8 +24337,8 @@ (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 vector none)) -(define-extern sparticle-mode-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 "Unused" (function object sparticle-cpuinfo sprite-vec-data-3d object)) (define-extern sparticle-set-conerot (function sparticle-launcher vector none)) @@ -24365,16 +24359,16 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (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) ;; sparticle-system +(define-extern *sp-particle-system-2d* sparticle-system) +(define-extern *sp-particle-system-3d* sparticle-system) (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)) ;; TODO - manually fixed in jak 1? gross +(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 sparticle-system sparticle-cpuinfo vector none)) ;; -(define-extern sp-process-block-2d (function sparticle-system int int int int symbol none)) ;; TODO - mips2c -(define-extern sp-process-block-3d (function sparticle-system int int int int symbol none)) ;; TODO - mips2c +(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)) ;; TODO - these are all actually uints, but this is needed to get the casts right... (define-extern sp-copy-from-spr (function int pointer int none)) ;; TODO - these are all actually uints, but this is needed to get the casts right... (define-extern memcpy function) ;; TODO - was done manually as well? @@ -25633,15 +25627,15 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-extern group-rain-screend-drop sparticle-launch-group) ;; -(define-extern update-snow (function target none)) -;; (define-extern birth-func-omega-normal-orient function) -;; (define-extern birth-func-rain function) -;; (define-extern check-drop-level-rain function) ;; (function sparticle-system sparticle-cpuinfo vector none) -;; (define-extern check-drop-level-rain2 function) -;; (define-extern check-drop-level-splash function) -(define-extern update-rain (function target none)) +(define-extern update-snow (function float vector vector none)) +(define-extern birth-func-omega-normal-orient (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern birth-func-rain (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d sparticle-launcher sparticle-launch-state none)) +(define-extern check-drop-level-rain (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern check-drop-level-rain2 (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern check-drop-level-splash (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern update-rain (function float vector vector none)) (define-extern cam-master-effect (function none :behavior camera-master)) ;; -;; (define-extern sparticle-track-sun function) ;; (function int sparticle-cpuinfo matrix none) +(define-extern sparticle-track-sun (function int sparticle-cpuinfo matrix none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; time-of-day ;; @@ -30578,21 +30572,22 @@ ;; part-tester ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype part-tester (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 +(deftype part-tester (process) + ((root trsqv) + (part sparticle-launch-control) + (old-group sparticle-launch-group)) + :heap-base 16 + :size-assert #x8c + :flag-assert #xe0010008c ;; Failed to read fields. ) -|# -;; (define-extern *part-tester-name* object) ;; string -;; (define-extern part-tester-idle state) ;; (state part-tester) -;; (define-extern part-tester-init-by-other function) ;; (function vector none :behavior process-drawable) -;; (define-extern *debug-part-dead-pool* object) ;; dead-pool -;; (define-extern start-part function) ;; (function none) +(define-extern *part-tester-name* string) +(define-extern part-tester-idle (state part-tester)) +(define-extern part-tester-init-by-other (function vector none :behavior process-drawable)) +(define-extern *debug-part-dead-pool* dead-pool) +(define-extern start-part (function none)) +(define-extern *part-tester* (pointer process)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; editable-h ;; diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 9b05202c82..62d612ea01 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -140,9 +140,6 @@ "(anon-function 4 gun-states)", "(anon-function 28 grenadier)", "(anon-function 24 grenadier)", - // no longer bug or asm, not done yet - "particle-adgif-callback", - // texture "adgif-shader<-texture!" ], @@ -390,7 +387,13 @@ "render-boundary-quad", "render-boundary-tri", "clip-polygon-against-negative-hyperplane", - "clip-polygon-against-positive-hyperplane" + "clip-polygon-against-positive-hyperplane", + "sp-init-fields!", + "particle-adgif", + "sp-launch-particles-var", + "sparticle-motion-blur", + "sp-process-block-2d", + "sp-process-block-3d" ], "mips2c_jump_table_functions": {}, diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index dcccc3528d..a390f2af8f 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -275,6 +275,7 @@ "tie-methods": [["L328", "(inline-array tie-init-data)", 6]], "blocking-plane": [["L43", "vector"]], "elec-gate": [["L141", "attack-info"]], + "part-tester": [["L35", "uint64", true], ["L30", "uint64", true]], "progress-draw": [ ["L933", "uint64", true], ["L934", "uint64", true], diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index b4dcc24ab1..09ab838af1 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -928,6 +928,18 @@ [16, "vector"], [32, "vector"] ], + "particle-adgif-callback": [ + [16, ["inline-array", "vector", 4]] + ], + "sparticle-respawn-heights": [ + [16, "vector"] + ], + "sparticle-respawn-timer": [ + [16, "vector"] + ], + "check-drop-level-rain": [ + [16, "vector"] + ], "progress-post": [[112, "hud-box"]], "(method 10 menu-missions-option)": [[224, "hud-box"]], "(method 10 menu-secret-option)": [[64, "hud-box"]], diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 4bdb463712..0d901a61ad 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -1434,13 +1434,50 @@ [[49, 61], "v1", "dma-packet"] ], "sparticle-track-root-prim": [[3, "v1", "collide-shape"]], - "(method 10 sparticle-launcher)": [[41, "gp", "(array float)"]], - "birth-func-texture-group": [[3, "s5", "(pointer int32)"]], + "(method 10 sparticle-launcher)": [[[41, 75], "gp", "(array int32)"]], + "birth-func-texture-group": [[[2, 10], "s5", "(array int32)"]], "(method 9 sparticle-launch-control)": [[22, "a2", "process-drawable"]], "(method 10 sparticle-launch-control)": [[42, "a3", "float"]], "execute-part-engine": [ [11, "v1", "connection"], - [137, "a3", "vector"] + [12, "a0", "process-drawable"], + [13, "v1", "connection"], + [[19, 53], "s0", "vector"], + [23, "v1", "connection"], + [28, "v1", "connection"], + [29, "v1", "int"], + [137, "a3", "vector"], + [35, "a0", "process-drawable"] + ], + "sparticle-respawn-heights": [ + [[0, 58], "gp", "(array int32)"], + [58, "gp", "(array int32)"], + [34, "v1", "int"] + ], + "sparticle-respawn-timer": [ + [[9, 15], "gp", "(array int32)"], + [34, "gp", "(array int32)"], + [10, "v1", "int"] + ], + "sparticle-texture-animate": [ + [[0, 31], "v1", "(array int32)"], + [47, "v1", "(array int32)"] + ], + "sparticle-texture-day-night": [ + [[21, 78], "s2", "(array int32)"] + ], + "sparticle-mode-animate": [ + [5, "v1", "(array symbol)"], + [[7, 16], "a1", "(array uint32)"], + [18, "a1", "vector4w"], + [21, "a1", "(pointer int32)"], + [26, "a1", "(array int32)"], + [28, "v1", "(array int32)"], + [32, "a0", "(pointer int64)"], + // [33, "a0", "(pointer int64)"], + [44, "v1", "(pointer int32)"], + [46, "v1", "(pointer int32)"] + ], "(method 2 sparticle-cpuinfo)": [[14, "f0", "float"]], "sp-kill-particle": [ @@ -2931,6 +2968,9 @@ [99, "a0", "dma-packet"], [97, "a1", "dma-packet"] ], + "(code part-tester-idle)": [ + [[16, 22], "s5", "process-drawable"] + ], "(method 25 progress)": [[[19, 31], "a0", "menu-option"]], "(method 24 progress)": [ [70, "a0", "(array menu-option)"], diff --git a/decompiler/config/jak2_ntsc_v1.jsonc b/decompiler/config/jak2_ntsc_v1.jsonc index fcee13e3ed..4e3d7b149a 100644 --- a/decompiler/config/jak2_ntsc_v1.jsonc +++ b/decompiler/config/jak2_ntsc_v1.jsonc @@ -7,7 +7,7 @@ // if you want to filter to only some object names. // it will make the decompiler much faster. - "allowed_objects": ["mood"], + "allowed_objects": [], "banned_objects": ["effect-control", "target-util", "ctywide-scenes"], //////////////////////////// diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 331989c308..7b57e04eb7 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -26,7 +26,8 @@ goos::Object decompile_at_label_with_hint(const LabelInfo& hint, const std::vector& labels, const std::vector>& words, DecompilerTypeSystem& dts, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { const auto& type = hint.result_type; if (!hint.array_size.has_value()) { // if we don't have an array size, treat it as just a normal type. @@ -34,7 +35,7 @@ goos::Object decompile_at_label_with_hint(const LabelInfo& hint, throw std::runtime_error(fmt::format( "Label {} was marked as a value, but is being decompiled as a reference.", hint.name)); } - return decompile_at_label(type, label, labels, words, dts.ts, file); + return decompile_at_label(type, label, labels, words, dts.ts, file, version); } if (type.base_type() == "pointer") { @@ -95,8 +96,8 @@ goos::Object decompile_at_label_with_hint(const LabelInfo& hint, fake_label.target_segment = label.target_segment; fake_label.offset = label.offset + field_type_info->get_offset() + stride * elt; fake_label.name = fmt::format("fake-label-{}-elt-{}", type.get_single_arg().print(), elt); - array_def.push_back( - decompile_at_label(type.get_single_arg(), fake_label, labels, words, dts.ts, file)); + array_def.push_back(decompile_at_label(type.get_single_arg(), fake_label, labels, words, + dts.ts, file, version)); } return pretty_print::build_list(array_def); } @@ -151,12 +152,13 @@ goos::Object decompile_at_label_guess_type(const DecompilerLabel& label, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { auto guessed_type = get_type_of_label(label, words); if (!guessed_type.has_value()) { throw std::runtime_error("Could not guess the type of " + label.name); } - return decompile_at_label(*guessed_type, label, labels, words, ts, file); + return decompile_at_label(*guessed_type, label, labels, words, ts, file, version); } goos::Object decompile_function_at_label(const DecompilerLabel& label, @@ -187,6 +189,7 @@ goos::Object decompile_at_label(const TypeSpec& type, const std::vector>& words, const TypeSystem& ts, const LinkedObjectFile* file, + GameVersion version, bool in_static_pair) { if (type == TypeSpec("string")) { return decompile_string_at_label(label, words); @@ -201,15 +204,15 @@ goos::Object decompile_at_label(const TypeSpec& type, if (type.has_single_arg()) { content_type_spec = type.get_single_arg(); } - return decompile_boxed_array(label, labels, words, ts, file, content_type_spec); + return decompile_boxed_array(label, labels, words, ts, file, content_type_spec, version); } if (ts.tc(TypeSpec("structure"), type)) { - return decompile_structure(type, label, labels, words, ts, file, true); + return decompile_structure(type, label, labels, words, ts, file, true, version); } if (type == TypeSpec("pair")) { - return decompile_pair(label, labels, words, ts, true, file); + return decompile_pair(label, labels, words, ts, true, file, version); } throw std::runtime_error("Unimplemented decompile_at_label for " + type.print()); @@ -439,7 +442,8 @@ goos::Object decomp_ref_to_inline_array_guess_size( const std::vector>& all_words, const LinkedObjectFile* file, const TypeSpec& array_elt_type, - int stride) { + int stride, + GameVersion version) { // lg::print("Decomp decomp_ref_to_inline_array_guess_size {}\n", array_elt_type.print()); // verify the stride matches the type system @@ -511,7 +515,7 @@ goos::Object decomp_ref_to_inline_array_guess_size( fake_label.target_segment = my_seg; // same segment fake_label.offset = start_label.offset + elt * stride; array_def.push_back( - decompile_at_label(array_elt_type, fake_label, labels, all_words, ts, file)); + decompile_at_label(array_elt_type, fake_label, labels, all_words, ts, file, version)); } // build into a list. @@ -532,9 +536,10 @@ goos::Object ocean_near_indices_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("ocean-near-index"), 32); + file, TypeSpec("ocean-near-index"), 32, version); } goos::Object ocean_mid_masks_decompile(const std::vector& words, @@ -543,9 +548,10 @@ goos::Object ocean_mid_masks_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("ocean-mid-mask"), 8); + file, TypeSpec("ocean-mid-mask"), 8, version); } goos::Object sp_field_init_spec_decompile(const std::vector& words, @@ -554,9 +560,10 @@ goos::Object sp_field_init_spec_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("sp-field-init-spec"), 16); + file, TypeSpec("sp-field-init-spec"), 16, version); } goos::Object nav_mesh_vertex_arr_decompile(const std::vector& words, @@ -565,9 +572,10 @@ goos::Object nav_mesh_vertex_arr_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("nav-vertex"), 16); + file, TypeSpec("nav-vertex"), 16, version); } goos::Object nav_mesh_poly_arr_decompile(const std::vector& words, @@ -576,9 +584,10 @@ goos::Object nav_mesh_poly_arr_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("nav-poly"), 8); + file, TypeSpec("nav-poly"), 8, version); } goos::Object nav_mesh_poly_arr_jak2_decompile(const std::vector& words, @@ -587,9 +596,10 @@ goos::Object nav_mesh_poly_arr_jak2_decompile(const std::vector& wor int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("nav-poly"), 64); + file, TypeSpec("nav-poly"), 64, version); } goos::Object nav_mesh_nav_control_arr_decompile( @@ -599,9 +609,10 @@ goos::Object nav_mesh_nav_control_arr_decompile( int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("nav-control"), 288); + file, TypeSpec("nav-control"), 288, version); } goos::Object xz_height_map_data_arr_decompile(const std::vector& words, @@ -610,9 +621,10 @@ goos::Object xz_height_map_data_arr_decompile(const std::vector& wor int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("vector4b"), 4); + file, TypeSpec("vector4b"), 4, version); } goos::Object nav_mesh_route_arr_decompile(const std::vector& words, @@ -621,9 +633,10 @@ goos::Object nav_mesh_route_arr_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("vector4ub"), 4); + file, TypeSpec("vector4ub"), 4, version); } goos::Object sp_launch_grp_launcher_decompile(const std::vector& words, @@ -632,9 +645,10 @@ goos::Object sp_launch_grp_launcher_decompile(const std::vector& wor int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("sparticle-group-item"), 32); + file, TypeSpec("sparticle-group-item"), 32, version); } goos::Object probe_dir_decompile(const std::vector& words, const std::vector& labels, @@ -642,9 +656,10 @@ goos::Object probe_dir_decompile(const std::vector& words, int field_location, const TypeSystem& ts, const std::vector>& all_words, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, - file, TypeSpec("vector"), 16); + file, TypeSpec("vector"), 16, version); } goos::Object decompile_sound_spec(const TypeSpec& type, @@ -652,7 +667,8 @@ goos::Object decompile_sound_spec(const TypeSpec& type, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { // auto normal = decompile_structure(type, label, labels, words, ts, file, false); // lg::print("Doing: {}\n", normal.print()); auto uncast_type_info = ts.lookup_type(type); @@ -673,7 +689,7 @@ goos::Object decompile_sound_spec(const TypeSpec& type, for (int i = 0; i < word_count - 1; ++i) { if (i == word_count - 2 && !obj_words.at(i).data) { // just some default initialized sound spec, don't attempt anything fancy. - return decompile_structure(type, label, labels, words, ts, file, false); + return decompile_structure(type, label, labels, words, ts, file, false, version); } if (obj_words.at(i).data) break; @@ -801,14 +817,15 @@ goos::Object decompile_structure(const TypeSpec& type, const std::vector>& words, const TypeSystem& ts, const LinkedObjectFile* file, - bool use_fancy_macros) { + bool use_fancy_macros, + GameVersion version) { // some structures we want to decompile to fancy macros instead of a raw static definiton // temp hack!! if (use_fancy_macros && file) { if (file->version == GameVersion::Jak1) { if (type == TypeSpec("sp-field-init-spec")) { ASSERT(file->version == GameVersion::Jak1); // need to update enums - return decompile_sparticle_field_init(type, label, labels, words, ts, file); + return decompile_sparticle_field_init(type, label, labels, words, ts, file, version); } if (type == TypeSpec("sparticle-group-item")) { ASSERT(file->version == GameVersion::Jak1); // need to update enums @@ -816,7 +833,7 @@ goos::Object decompile_structure(const TypeSpec& type, } } if (type == TypeSpec("sound-spec")) { - return decompile_sound_spec(type, label, labels, words, ts, file); + return decompile_sound_spec(type, label, labels, words, ts, file, version); } } @@ -851,7 +868,7 @@ goos::Object decompile_structure(const TypeSpec& type, // try again with the right type. this resets back to decompile_at_label because we may // want to get the specific function/string/etc implementations. - return decompile_at_label(actual_type, label, labels, words, ts, file); + return decompile_at_label(actual_type, label, labels, words, ts, file, version); } else { throw std::runtime_error( fmt::format("Basic has the wrong type pointer, got {} expected {} at label {}:{}", @@ -1017,49 +1034,49 @@ goos::Object decompile_structure(const TypeSpec& type, // first, get the label: field_defs_out.emplace_back( field.name(), ocean_near_indices_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "data" && type.print() == "ocean-mid-masks") { field_defs_out.emplace_back( field.name(), ocean_mid_masks_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "init-specs" && type.print() == "sparticle-launcher") { field_defs_out.emplace_back( field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "vertex" && type.print() == "nav-mesh" && file->version == GameVersion::Jak1) { field_defs_out.emplace_back( field.name(), nav_mesh_vertex_arr_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "poly" && type.print() == "nav-mesh" && file->version == GameVersion::Jak1) { field_defs_out.emplace_back( field.name(), nav_mesh_poly_arr_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "poly-array" && type.print() == "nav-mesh" && file->version == GameVersion::Jak2) { field_defs_out.emplace_back(field.name(), nav_mesh_poly_arr_jak2_decompile( obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "nav-control-array" && type.print() == "nav-mesh" && file->version == GameVersion::Jak2) { field_defs_out.emplace_back(field.name(), nav_mesh_nav_control_arr_decompile( obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "data" && type.print() == "xz-height-map" && file->version == GameVersion::Jak2) { field_defs_out.emplace_back(field.name(), xz_height_map_data_arr_decompile( obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "route" && type.print() == "nav-mesh" && file->version == GameVersion::Jak1) { field_defs_out.emplace_back( field.name(), nav_mesh_route_arr_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "launcher" && type.print() == "sparticle-launch-group") { field_defs_out.emplace_back(field.name(), sp_launch_grp_launcher_decompile( obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else if (field.name() == "col-mesh-indexes" && type.print() == "ropebridge-tuning") { field_defs_out.emplace_back( field.name(), decomp_ref_to_integer_array_guess_size( @@ -1068,7 +1085,7 @@ goos::Object decompile_structure(const TypeSpec& type, } else if (field.name() == "probe-dirs" && type.print() == "lightning-probe-vars") { field_defs_out.emplace_back(field.name(), probe_dir_decompile(obj_words, labels, label.target_segment, - field_start, ts, words, file)); + field_start, ts, words, file, version)); } else { if (field.type().base_type() == "pointer") { if (obj_words.at(field_start / 4).kind() != LinkedWord::SYM_PTR) { @@ -1105,7 +1122,8 @@ goos::Object decompile_structure(const TypeSpec& type, fake_label.offset = offset_location + field.offset() + field_type_info->get_offset(); fake_label.name = fmt::format("fake-label-{}-{}", actual_type.print(), field.name()); field_defs_out.emplace_back( - field.name(), decompile_at_label(field.type(), fake_label, labels, words, ts, file)); + field.name(), + decompile_at_label(field.type(), fake_label, labels, words, ts, file, version)); } else if (!field.is_dynamic() && field.is_array() && field.is_inline()) { // it's an inline array. let's figure out the len and stride auto len = field.array_size(); @@ -1126,7 +1144,7 @@ goos::Object decompile_structure(const TypeSpec& type, fake_label.name = fmt::format("fake-label-{}-{}-elt-{}", actual_type.print(), field.name(), elt); array_def.push_back( - decompile_at_label(field.type(), fake_label, labels, words, ts, file)); + decompile_at_label(field.type(), fake_label, labels, words, ts, file, version)); } field_defs_out.emplace_back(field.name(), pretty_print::build_list(array_def)); } else if (!field.is_dynamic() && field.is_array() && !field.is_inline()) { @@ -1154,7 +1172,7 @@ goos::Object decompile_structure(const TypeSpec& type, if (word.kind() == LinkedWord::PTR) { array_def.push_back(decompile_at_label(field.type(), labels.at(word.label_id()), labels, - words, ts, file)); + words, ts, file, version)); } else if (word.kind() == LinkedWord::PLAIN_DATA && word.data == 0) { // do nothing, the default is zero? array_def.push_back(pretty_print::to_symbol("0")); @@ -1430,7 +1448,8 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label, const std::vector>& words, const TypeSystem& ts, const LinkedObjectFile* file, - const std::optional& content_type_override) { + const std::optional& content_type_override, + GameVersion version) { TypeSpec content_type; auto type_ptr_word_idx = (label.offset / 4) - 1; if ((label.offset % 8) == 4) { @@ -1487,11 +1506,11 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label, result.push_back(pretty_print::to_symbol("0")); } else if (word.kind() == LinkedWord::PTR) { if (content_type == TypeSpec("object")) { - result.push_back( - decompile_at_label_guess_type(labels.at(word.label_id()), labels, words, ts, file)); + result.push_back(decompile_at_label_guess_type(labels.at(word.label_id()), labels, words, + ts, file, version)); } else { result.push_back(decompile_at_label(content_type, labels.at(word.label_id()), labels, - words, ts, file)); + words, ts, file, version)); } } else if (word.kind() == LinkedWord::SYM_PTR) { result.push_back(pretty_print::to_symbol(fmt::format("'{}", word.symbol_name()))); @@ -1519,7 +1538,7 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label, auto segment = labels.at(word.label_id()).target_segment; result.push_back(decomp_ref_to_inline_array_guess_size( words.at(segment), labels, segment, (first_elt_word_idx + elt) * 4, ts, words, file, - content_type.get_single_arg(), ts.get_deref_info(content_type).stride)); + content_type.get_single_arg(), ts.get_deref_info(content_type).stride, version)); } return pretty_print::build_list(result); @@ -1552,7 +1571,8 @@ goos::Object decompile_pair_elt(const LinkedWord& word, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { if (word.kind() == LinkedWord::PTR) { auto& label = labels.at(word.label_id()); auto guessed_type = get_type_of_label(label, words); @@ -1561,10 +1581,10 @@ goos::Object decompile_pair_elt(const LinkedWord& word, } if (guessed_type == TypeSpec("pair")) { - return decompile_pair(label, labels, words, ts, false, file); + return decompile_pair(label, labels, words, ts, false, file, version); } - return decompile_at_label(*guessed_type, label, labels, words, ts, file, true); + return decompile_at_label(*guessed_type, label, labels, words, ts, file, version, true); } else if (word.kind() == LinkedWord::PLAIN_DATA && word.data == 0) { // do nothing, the default is zero? return pretty_print::to_symbol("0"); @@ -1589,7 +1609,8 @@ goos::Object decompile_pair(const DecompilerLabel& label, const std::vector>& words, const TypeSystem& ts, bool add_quote, - const LinkedObjectFile* file) { + const LinkedObjectFile* file, + GameVersion version) { if ((label.offset % 8) != 2) { if ((label.offset % 4) != 0) { throw std::runtime_error( @@ -1618,7 +1639,7 @@ goos::Object decompile_pair(const DecompilerLabel& label, if ((to_print.offset % 8) == 2) { // continue auto car_word = words.at(to_print.target_segment).at((to_print.offset - 2) / 4); - list_tokens.push_back(decompile_pair_elt(car_word, labels, words, ts, file)); + list_tokens.push_back(decompile_pair_elt(car_word, labels, words, ts, file, version)); auto cdr_word = words.at(to_print.target_segment).at((to_print.offset + 2) / 4); // if empty @@ -1636,7 +1657,7 @@ goos::Object decompile_pair(const DecompilerLabel& label, } // improper list_tokens.push_back(pretty_print::to_symbol(".")); - list_tokens.push_back(decompile_pair_elt(cdr_word, labels, words, ts, file)); + list_tokens.push_back(decompile_pair_elt(cdr_word, labels, words, ts, file, version)); if (add_quote) { return pretty_print::build_list("quote", pretty_print::build_list(list_tokens)); } else { @@ -1649,8 +1670,9 @@ goos::Object decompile_pair(const DecompilerLabel& label, } else { // improper list_tokens.push_back(pretty_print::to_symbol(".")); - list_tokens.push_back(decompile_pair_elt( - words.at(to_print.target_segment).at(to_print.offset / 4), labels, words, ts, file)); + list_tokens.push_back( + decompile_pair_elt(words.at(to_print.target_segment).at(to_print.offset / 4), labels, + words, ts, file, version)); if (add_quote) { return pretty_print::build_list("quote", pretty_print::build_list(list_tokens)); } else { diff --git a/decompiler/util/data_decompile.h b/decompiler/util/data_decompile.h index 2337a4b6cc..13a7883543 100644 --- a/decompiler/util/data_decompile.h +++ b/decompiler/util/data_decompile.h @@ -5,6 +5,7 @@ #include "common/goos/Object.h" #include "common/type_system/TypeSpec.h" #include "common/type_system/TypeSystem.h" +#include "common/versions.h" #include "decompiler/Disasm/DecompilerLabel.h" #include "decompiler/IR2/LabelDB.h" @@ -25,37 +26,43 @@ goos::Object decompile_at_label(const TypeSpec& type, const std::vector>& words, const TypeSystem& ts, const LinkedObjectFile* file, + GameVersion version, bool in_static_pair = false); goos::Object decompile_at_label_with_hint(const LabelInfo& hint, const DecompilerLabel& label, const std::vector& labels, const std::vector>& words, DecompilerTypeSystem& dts, - const LinkedObjectFile* file); + const LinkedObjectFile* file, + GameVersion version); goos::Object decompile_at_label_guess_type(const DecompilerLabel& label, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file); + const LinkedObjectFile* file, + GameVersion version); goos::Object decompile_structure(const TypeSpec& actual_type, const DecompilerLabel& label, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, const LinkedObjectFile* file, - bool use_fancy_macros); + bool use_fancy_macros, + GameVersion version); goos::Object decompile_pair(const DecompilerLabel& label, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, bool add_quote, - const LinkedObjectFile* file); + const LinkedObjectFile* file, + GameVersion version); goos::Object decompile_boxed_array(const DecompilerLabel& label, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, const LinkedObjectFile* file, - const std::optional& content_type_override); + const std::optional& content_type_override, + GameVersion version); goos::Object decompile_value(const TypeSpec& type, const std::vector& bytes, const TypeSystem& ts); diff --git a/decompiler/util/sparticle_decompile.cpp b/decompiler/util/sparticle_decompile.cpp index c1747c338c..2bc9574e27 100644 --- a/decompiler/util/sparticle_decompile.cpp +++ b/decompiler/util/sparticle_decompile.cpp @@ -80,6 +80,83 @@ enum class FieldId { SPT_END = 67, }; +// jak2 version +enum class FieldId2 { + MISC_FIELDS_START = 0, + SPT_TEXTURE = 1, + SPT_ANIM = 2, + SPT_ANIM_SPEED = 3, + SPT_BIRTH_FUNC = 4, + SPT_JOINT_REFPOINT = 5, + SPT_NUM = 6, + SPT_SOUND = 7, + MISC_FIELDS_END = 8, + SPRITE_FIELDS_START = 9, + SPT_X = 10, + SPT_Y = 11, + SPT_Z = 12, + SPT_SCALE_X = 13, + SPT_ROT_X = 14, + SPT_ROT_Y = 15, + SPT_ROT_Z = 16, + SPT_SCALE_Y = 17, + SPT_R = 18, + SPT_G = 19, + SPT_B = 20, + SPT_A = 21, + SPRITE_FIELDS_END = 22, + CPU_FIELDS_START = 23, + SPT_OMEGA = 24, + SPT_VEL_X = 25, + SPT_VEL_Y = 26, + SPT_VEL_Z = 27, + SPT_SCALEVEL_X = 28, + SPT_ROTVEL_X = 29, + SPT_ROTVEL_Y = 30, + SPT_ROTVEL_Z = 31, + SPT_SCALEVEL_Y = 32, + SPT_FADE_R = 33, + SPT_FADE_G = 34, + SPT_FADE_B = 35, + SPT_FADE_A = 36, + SPT_ACCEL_X = 37, + SPT_ACCEL_Y = 38, + SPT_ACCEL_Z = 39, + SPT_DUMMY = 40, + SPT_QUAT_X = 41, + SPT_QUAT_Y = 42, + SPT_QUAT_Z = 43, + SPT_QUAD_W = 44, + SPT_FRICTION = 45, + SPT_TIMER = 46, + SPT_FLAGS = 47, + SPT_USERDATA = 48, + SPT_FUNC = 49, + SPT_NEXT_TIME = 50, + SPT_NEXT_LAUNCHER = 51, + CPU_FIELDS_END = 52, + LAUNCH_FIELDS_START = 53, + SPT_LAUNCHROT_X = 54, + SPT_LAUNCHROT_Y = 55, + SPT_LAUNCHROT_Z = 56, + SPT_LAUNCHROT_W = 57, + SPT_CONEROT_X = 58, + SPT_CONEROT_Y = 59, + SPT_CONEROT_Z = 60, + SPT_CONEROT_W = 61, + SPT_ROTATE_X = 62, + SPT_ROTATE_Y = 63, + SPT_ROTATE_Z = 64, + SPT_CONEROT_RADIUS = 65, + SPT_MAT_SCALE_X = 66, + SPT_MAT_SCALE_Y = 67, + SPT_MAT_SCALE_Z = 68, + LAUNCH_FIELDS_END = 69, + SPT_SCALE = 70, + SPT_SCALEVEL = 71, + SPT_END = 72, +}; + // flag vals: // 0: timer, flags, end // 1: texture, float, random-rangef @@ -115,7 +192,7 @@ struct SparticleFieldDecomp { FieldKind kind = FieldKind::INVALID; }; -const SparticleFieldDecomp field_kinds[68] = { +const SparticleFieldDecomp field_kind_jak1[68] = { {false}, // MISC_FIELDS_START = 0 {true, FieldKind::TEXTURE_ID}, // SPT_TEXTURE = 1 {false}, // SPT_ANIM = 2 @@ -183,10 +260,89 @@ const SparticleFieldDecomp field_kinds[68] = { {false}, // LAUNCH_FIELDS_END = 64 {false}, // SPT_SCALE = 65 {false}, // SPT_SCALEVEL = 66 - {true, FieldKind::END_FLAG}, // SPT_END = 67 - + {true, FieldKind::END_FLAG} // SPT_END = 67 }; +const SparticleFieldDecomp field_kind_jak2[73] = { + {false}, // MISC_FIELDS_START = 0 + {true, FieldKind::TEXTURE_ID}, // SPT_TEXTURE = 1 + {false}, // SPT_ANIM = 2 + {false}, // SPT_ANIM_SPEED = 3 + {true, FieldKind::FUNCTION}, // SPT_BIRTH_FUNC = 4 + {false}, // SPT_JOINT/REFPOINT = 5 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_NUM = 6 + {true, FieldKind::SOUND_SPEC}, // SPT_SOUND = 7 + {false}, // MISC_FIELDS_END = 8 + {false}, // SPRITE_FIELDS_START = 9 + {true, FieldKind::METER_WITH_RAND}, // SPT_X = 10 + {true, FieldKind::METER_WITH_RAND}, // SPT_Y = 11 + {true, FieldKind::METER_WITH_RAND}, // SPT_Z = 12 + {true, FieldKind::METER_WITH_RAND}, // SPT_SCALE_X = 13 + {true, FieldKind::ROT_X}, // SPT_ROT_X = 14 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROT_Y = 15 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROT_Z = 16 + {true, FieldKind::METER_WITH_RAND}, // SPT_SCALE_Y = 17 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_R = 18 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_G = 19 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_B = 20 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_A = 21 + {false}, // SPRITE_FIELDS_END = 22 + {false}, // CPU_FIELDS_START = 23 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_OMEGA = 24 + {true, FieldKind::METER_WITH_RAND}, // SPT_VEL_X = 25 (likely m/s) + {true, FieldKind::METER_WITH_RAND}, // SPT_VEL_Y = 26 + {true, FieldKind::METER_WITH_RAND}, // SPT_VEL_Z = 27 + {true, FieldKind::METER_WITH_RAND}, // SPT_SCALEVEL_X = 28 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROTVEL_X = 29 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROTVEL_Y = 30 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROTVEL_Z = 31 + {true, FieldKind::METER_WITH_RAND}, // SPT_SCALEVEL_Y = 32 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_FADE_R = 33 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_FADE_G = 34 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_FADE_B = 35 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_FADE_A = 36 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_ACCEL_X = 37 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_ACCEL_Y = 38 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_ACCEL_Z = 39 + {false}, // SPT_DUMMY = 40 + {false}, // SPT_QUAT_X = 41 + {false}, // SPT_QUAT_Y = 42 + {false}, // SPT_QUAT_Z = 43 + {false}, // SPT_QUAD_W = 44 + {true, FieldKind::FLOAT_WITH_RAND}, // SPT_FRICTION = 45 + {true, FieldKind::PLAIN_INT_WITH_RANDS}, // SPT_TIMER = 46 + {true, FieldKind::CPUINFO_FLAGS}, // SPT_FLAGS = 47 + {true, FieldKind::USERDATA}, // SPT_USERDATA = 48 + {true, FieldKind::FUNCTION}, // SPT_FUNC = 49 + {true, FieldKind::PLAIN_INT_WITH_RANDS}, // SPT_NEXT_TIME = 50 + {true, FieldKind::LAUNCHER_BY_ID}, // SPT_NEXT_LAUNCHER = 51 + {false}, // CPU_FIELDS_END = 52 + {false}, // LAUNCH_FIELDS_START = 53 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_LAUNCHROT_X = 54 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_LAUNCHROT_Y = 55 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_LAUNCHROT_Z = 56 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_LAUNCHROT_W = 57 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_CONEROT_X = 58 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_CONEROT_Y = 59 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_CONEROT_Z = 60 + {false}, // SPT_CONEROT_W = 61 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROTATE_X = 62 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROTATE_Y = 63 + {true, FieldKind::DEGREES_WITH_RAND}, // SPT_ROTATE_Z = 64 + {true, FieldKind::METER_WITH_RAND}, // SPT_CONEROT_RADIUS = 65 + {true, FieldKind::METER_WITH_RAND}, // SPT_MAT_SCALE_X = 66 + {true, FieldKind::METER_WITH_RAND}, // SPT_MAT_SCALE_X = 67 + {true, FieldKind::METER_WITH_RAND}, // SPT_MAT_SCALE_X = 68 + {false}, // LAUNCH_FIELDS_END = 69 + {false}, // SPT_SCALE = 70 + {false}, // SPT_SCALEVEL = 71 + {true, FieldKind::END_FLAG} // SPT_END = 72 +}; + +const std::unordered_map field_kinds = { + {GameVersion::Jak1, field_kind_jak1}, + {GameVersion::Jak2, field_kind_jak2}}; + std::string make_flags_str(const std::vector& flags) { if (flags.empty()) { return ""; @@ -536,8 +692,9 @@ goos::Object decompile_sparticle_field_init(const TypeSpec& type, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file) { - auto normal = decompile_structure(type, label, labels, words, ts, file, false); + const LinkedObjectFile* file, + GameVersion version) { + auto normal = decompile_structure(type, label, labels, words, ts, file, false, version); // lg::print("Doing: {}\n", normal.print()); auto uncast_type_info = ts.lookup_type(type); auto type_info = dynamic_cast(uncast_type_info); @@ -560,7 +717,7 @@ goos::Object decompile_sparticle_field_init(const TypeSpec& type, ASSERT(field_id <= (u32)FieldId::SPT_END); auto field_name = decompile_int_enum_from_int(TypeSpec("sp-field-id"), ts, field_id); - const auto& field_info = field_kinds[field_id]; + const auto& field_info = field_kinds.at(version)[field_id]; if (!field_info.known) { throw std::runtime_error("Unknown sparticle field: " + field_name); } @@ -624,24 +781,47 @@ goos::Object decompile_sparticle_field_init(const TypeSpec& type, return result; } +std::string debug_print(const LinkedWord& word) { + switch (word.kind()) { + case LinkedWord::PLAIN_DATA: + return fmt::format("0x{:08x}", word.data); + case LinkedWord::TYPE_PTR: + return fmt::format("type: {}\n", word.symbol_name()); + case LinkedWord::EMPTY_PTR: + return fmt::format("'()"); + case LinkedWord::HI_PTR: + return fmt::format("hi ptr"); + case LinkedWord::LO_PTR: + return fmt::format("lo ptr"); + case LinkedWord::PTR: + return fmt::format("ptr"); + case LinkedWord::SYM_OFFSET: + return fmt::format("offset '{}", word.symbol_name()); + case LinkedWord::SYM_PTR: + return fmt::format("ptr '{}", word.symbol_name()); + } +} + goos::Object decompile_sparticle_userdata_ASSERT(const std::vector& words, const std::string& field_name, const std::string& flag_name) { if (flag_name == "int-with-rand" || flag_name == "float-with-rand") { return decompile_sparticle_float_with_rand_init(words, field_name, flag_name); } else { + fmt::print("flag name is {}\n", flag_name); ASSERT(false); } } goos::Object decompile_sparticle_field_init(const DefpartElement::StaticInfo::PartField& field, - const TypeSystem& ts) { + const TypeSystem& ts, + GameVersion version) { auto field_id = field.field_id; auto flags = field.flags; ASSERT(field_id <= (u32)FieldId::SPT_END); auto field_name = decompile_int_enum_from_int(TypeSpec("sp-field-id"), ts, field_id); - const auto& field_info = field_kinds[field_id]; + const auto& field_info = field_kinds.at(version)[field_id]; if (!field_info.known) { throw std::runtime_error("Unknown sparticle field: " + field_name); } @@ -691,7 +871,7 @@ goos::Object decompile_sparticle_field_init(const DefpartElement::StaticInfo::Pa result = decompile_sparticle_func(field.data, field_name, flag_name); break; case FieldKind::USERDATA: - result = decompile_sparticle_userdata_ASSERT(field.data, field_name, flag_name); + result = decompile_sparticle_userdata(field.data, field_name, flag_name, field.userdata); break; case FieldKind::ROT_X: result = decompile_sparticle_rot_x(field.data, field_name, flag_name); diff --git a/decompiler/util/sparticle_decompile.h b/decompiler/util/sparticle_decompile.h index 1d3f9866fd..cc0ee53337 100644 --- a/decompiler/util/sparticle_decompile.h +++ b/decompiler/util/sparticle_decompile.h @@ -13,9 +13,11 @@ goos::Object decompile_sparticle_field_init(const TypeSpec& type, const std::vector& labels, const std::vector>& words, const TypeSystem& ts, - const LinkedObjectFile* file); + const LinkedObjectFile* file, + GameVersion version); goos::Object decompile_sparticle_field_init(const DefpartElement::StaticInfo::PartField& field, - const TypeSystem& ts); + const TypeSystem& ts, + GameVersion version); goos::Object decompile_sparticle_group_item(const TypeSpec& type, const DecompilerLabel& label, const std::vector& labels, diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 7f6e1324d5..d3cb89bcdc 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -87,6 +87,8 @@ set(RUNTIME_SOURCE mips2c/jak2_functions/font.cpp mips2c/jak2_functions/joint.cpp mips2c/jak2_functions/sky.cpp + mips2c/jak2_functions/sparticle.cpp + mips2c/jak2_functions/sparticle_launcher.cpp mips2c/jak2_functions/texture.cpp overlord/dma.cpp overlord/fake_iso.cpp diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index b672a7cbd4..ff7c91720a 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -88,23 +88,94 @@ void OpenGLRenderer::init_bucket_renderers_jak2() { using namespace jak2; m_bucket_renderers.resize((int)BucketId::MAX_BUCKETS); m_bucket_categories.resize((int)BucketId::MAX_BUCKETS, BucketCategory::OTHER); + // 0 init_bucket_renderer("vis", BucketCategory::OTHER, BucketId::SPECIAL_BUCKET_2); + init_bucket_renderer("tex-lcom-sky-pre", BucketCategory::TEX, + BucketId::TEX_LCOM_SKY_PRE); + init_bucket_renderer("tex-l0-tfrag", BucketCategory::TEX, + BucketId::TEX_L0_TFRAG); init_bucket_renderer("tfrag-l0-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L0_TFRAG, std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 0); init_bucket_renderer("tie-l0-tfrag", BucketCategory::TIE, BucketId::TIE_L0_TFRAG, 0); + // 10 + init_bucket_renderer("tex-l1-tfrag", BucketCategory::TEX, + BucketId::TEX_L1_TFRAG); init_bucket_renderer("tfrag-l1-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L1_TFRAG, std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 1); + // 20 init_bucket_renderer("tie-l1-tfrag", BucketCategory::TIE, BucketId::TIE_L1_TFRAG, 1); + // 30 + // 40 + // 50 + // 60 + // 70 + init_bucket_renderer("tex-l0-shrub", BucketCategory::TEX, + BucketId::TEX_L0_SHRUB); init_bucket_renderer("shrub-l0-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L0_SHRUB); + // 80 + init_bucket_renderer("tex-l1-shrub", BucketCategory::TEX, + BucketId::TEX_L1_SHRUB); init_bucket_renderer("shrub-l1-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L1_SHRUB); + // 90 + // 100 + // 110 + // 120 init_bucket_renderer("tfrag-t-l0-alpha", BucketCategory::TFRAG, BucketId::TFRAG_T_L0_ALPHA, std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 0); + // 130 + // 140 + // 150 + // 160 + // 170 + // 180 + init_bucket_renderer("tex-lcom-tfrag", BucketCategory::TEX, + BucketId::TEX_LCOM_TFRAG); + // 190 + init_bucket_renderer("tex-lcom-shrub", BucketCategory::TEX, + BucketId::TEX_LCOM_SHRUB); + + init_bucket_renderer("tex-l0-pris", BucketCategory::TEX, + BucketId::TEX_L0_PRIS); + // 200 + init_bucket_renderer("tex-l2-pris", BucketCategory::TEX, + BucketId::TEX_L2_PRIS); + // 210 + // 220 + init_bucket_renderer("tex-lcom-pris", BucketCategory::TEX, + BucketId::TEX_LCOM_PRIS); + // 230 + // 240 + // 250 + init_bucket_renderer("tex-l0-water", BucketCategory::TEX, + BucketId::TEX_L0_WATER); init_bucket_renderer("tfrag-w-l0-alpha", BucketCategory::TFRAG, BucketId::TFRAG_W_L0_WATER, std::vector{tfrag3::TFragmentTreeKind::WATER}, false, 0); + // 260 + init_bucket_renderer("tex-l1-water", BucketCategory::TEX, + BucketId::TEX_L1_WATER); + // 270 + init_bucket_renderer("tex-l2-water", BucketCategory::TEX, + BucketId::TEX_L2_WATER); + // 280 + // 290 + // 300 + init_bucket_renderer("tex-lcom-water", BucketCategory::TEX, + BucketId::TEX_LCOM_WATER); + init_bucket_renderer("tex-lcom-sky-post", BucketCategory::TEX, + BucketId::TEX_LCOM_SKY_POST); + // 310 + init_bucket_renderer("tex-all-sprite", BucketCategory::TEX, + BucketId::TEX_ALL_SPRITE); + init_bucket_renderer("particles", BucketCategory::SPRITE, BucketId::PARTICLES); + init_bucket_renderer("tex-all-warp", BucketCategory::TEX, + BucketId::TEX_ALL_WARP); init_bucket_renderer("debug-no-zbuf1", BucketCategory::OTHER, BucketId::DEBUG_NO_ZBUF1, 0x8000); + init_bucket_renderer("tex-all-map", BucketCategory::TEX, + BucketId::TEX_ALL_MAP); + // 320 init_bucket_renderer("debug2", BucketCategory::OTHER, BucketId::DEBUG2, 0x8000); init_bucket_renderer("debug-no-zbuf2", BucketCategory::OTHER, BucketId::DEBUG_NO_ZBUF2, 0x8000); diff --git a/game/graphics/opengl_renderer/Sprite3.cpp b/game/graphics/opengl_renderer/Sprite3.cpp index a24bbf2ba8..301a23d09c 100644 --- a/game/graphics/opengl_renderer/Sprite3.cpp +++ b/game/graphics/opengl_renderer/Sprite3.cpp @@ -762,7 +762,7 @@ void Sprite3::distort_setup_framebuffer_dims(SharedRenderState* render_state) { * This should get the dma chain immediately after the call to sprite-draw-distorters. * It ends right before the sprite-add-matrix-data for the 3d's */ -void Sprite3::handle_sprite_frame_setup(DmaFollower& dma) { +void Sprite3::handle_sprite_frame_setup(DmaFollower& dma, GameVersion version) { // first is some direct data auto direct_data = dma.read_and_advance(); ASSERT(direct_data.size_bytes == 3 * 16); @@ -771,17 +771,38 @@ void Sprite3::handle_sprite_frame_setup(DmaFollower& dma) { // next would be the program, but it's 0 size on the PC and isn't sent. // next is the "frame data" - auto frame_data = dma.read_and_advance(); - ASSERT(frame_data.size_bytes == (int)sizeof(SpriteFrameData)); // very cool - ASSERT(frame_data.vifcode0().kind == VifCode::Kind::STCYCL); - VifCodeStcycl frame_data_stcycl(frame_data.vifcode0()); - ASSERT(frame_data_stcycl.cl == 4); - ASSERT(frame_data_stcycl.wl == 4); - ASSERT(frame_data.vifcode1().kind == VifCode::Kind::UNPACK_V4_32); - VifCodeUnpack frame_data_unpack(frame_data.vifcode1()); - ASSERT(frame_data_unpack.addr_qw == SpriteDataMem::FrameData); - ASSERT(frame_data_unpack.use_tops_flag == false); - memcpy(&m_frame_data, frame_data.data, sizeof(SpriteFrameData)); + switch (version) { + case GameVersion::Jak1: { + auto frame_data = dma.read_and_advance(); + ASSERT(frame_data.size_bytes == (int)sizeof(SpriteFrameDataJak1)); // very cool + ASSERT(frame_data.vifcode0().kind == VifCode::Kind::STCYCL); + VifCodeStcycl frame_data_stcycl(frame_data.vifcode0()); + ASSERT(frame_data_stcycl.cl == 4); + ASSERT(frame_data_stcycl.wl == 4); + ASSERT(frame_data.vifcode1().kind == VifCode::Kind::UNPACK_V4_32); + VifCodeUnpack frame_data_unpack(frame_data.vifcode1()); + ASSERT(frame_data_unpack.addr_qw == SpriteDataMem::FrameData); + ASSERT(frame_data_unpack.use_tops_flag == false); + SpriteFrameDataJak1 jak1_data; + memcpy(&jak1_data, frame_data.data, sizeof(SpriteFrameDataJak1)); + m_frame_data.from_jak1(jak1_data); + } break; + case GameVersion::Jak2: { + auto frame_data = dma.read_and_advance(); + ASSERT(frame_data.size_bytes == (int)sizeof(SpriteFrameData)); // very cool + ASSERT(frame_data.vifcode0().kind == VifCode::Kind::STCYCL); + VifCodeStcycl frame_data_stcycl(frame_data.vifcode0()); + ASSERT(frame_data_stcycl.cl == 4); + ASSERT(frame_data_stcycl.wl == 4); + ASSERT(frame_data.vifcode1().kind == VifCode::Kind::UNPACK_V4_32); + VifCodeUnpack frame_data_unpack(frame_data.vifcode1()); + ASSERT(frame_data_unpack.addr_qw == SpriteDataMem::FrameData); + ASSERT(frame_data_unpack.use_tops_flag == false); + memcpy(&m_frame_data, frame_data.data, sizeof(SpriteFrameData)); + } break; + default: + ASSERT_NOT_REACHED(); + } // next, a MSCALF. auto mscalf = dma.read_and_advance(); @@ -951,6 +972,84 @@ void Sprite3::render_2d_group1(DmaFollower& dma, } void Sprite3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) { + switch (render_state->version) { + case GameVersion::Jak1: + render_jak1(dma, render_state, prof); + break; + case GameVersion::Jak2: + render_jak2(dma, render_state, prof); + break; + default: + ASSERT_NOT_REACHED(); + } +} + +void Sprite3::render_jak2(DmaFollower& dma, + SharedRenderState* render_state, + ScopedProfilerNode& prof) { + m_debug_stats = {}; + auto data0 = dma.read_and_advance(); + ASSERT(data0.vif1() == 0 || data0.vifcode1().kind == VifCode::Kind::NOP); + ASSERT(data0.vif0() == 0 || data0.vifcode0().kind == VifCode::Kind::MARK); + ASSERT(data0.size_bytes == 0); + + if (dma.current_tag_offset() == render_state->next_bucket) { + fmt::print("early exit!"); + return; + } + + // First is the distorter (temporarily disabled for jak 2) + { + // auto child = prof.make_scoped_child("distorter"); + // render_distorter(dma, render_state, child); + } + + // next, the normal sprite stuff + render_state->shaders[ShaderId::SPRITE3].activate(); + handle_sprite_frame_setup(dma, render_state->version); + + // 3d sprites + render_3d(dma); + + // 2d draw + // m_sprite_renderer.reset_state(); + { + auto child = prof.make_scoped_child("2d-group0"); + render_2d_group0(dma, render_state, child); + flush_sprites(render_state, prof, false); + } + + // shadow draw + render_fake_shadow(dma); + + // 2d draw (HUD) + { + auto child = prof.make_scoped_child("2d-group1"); + render_2d_group1(dma, render_state, child); + flush_sprites(render_state, prof, true); + } + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendEquation(GL_FUNC_ADD); + + // TODO finish this up. + // fmt::print("next bucket is 0x{}\n", render_state->next_bucket); + while (dma.current_tag_offset() != render_state->next_bucket) { + // auto tag = dma.current_tag(); + // fmt::print("@ 0x{:x} tag: {}", dma.current_tag_offset(), tag.print()); + auto data = dma.read_and_advance(); + VifCode code(data.vif0()); + // fmt::print(" vif0: {}\n", code.print()); + if (code.kind == VifCode::Kind::NOP) { + // fmt::print(" vif1: {}\n", VifCode(data.vif1()).print()); + } + } +} + +void Sprite3::render_jak1(DmaFollower& dma, + SharedRenderState* render_state, + ScopedProfilerNode& prof) { m_debug_stats = {}; // First thing should be a NEXT with two nops. this is a jump from buckets to sprite data auto data0 = dma.read_and_advance(); @@ -976,7 +1075,7 @@ void Sprite3::render(DmaFollower& dma, SharedRenderState* render_state, ScopedPr render_state->shaders[ShaderId::SPRITE3].activate(); // next, sprite frame setup. - handle_sprite_frame_setup(dma); + handle_sprite_frame_setup(dma, render_state->version); // 3d sprites render_3d(dma); @@ -1160,7 +1259,7 @@ void Sprite3::handle_zbuf(u64 val, // way - 24-bit, at offset 448. GsZbuf x(val); ASSERT(x.psm() == TextureFormat::PSMZ24); - ASSERT(x.zbp() == 448); + ASSERT(x.zbp() == 448 || x.zbp() == 304); // 304 for jak 2. m_current_mode.set_depth_write_enable(!x.zmsk()); } diff --git a/game/graphics/opengl_renderer/Sprite3.h b/game/graphics/opengl_renderer/Sprite3.h index e638ebb0d3..5b7777cffe 100644 --- a/game/graphics/opengl_renderer/Sprite3.h +++ b/game/graphics/opengl_renderer/Sprite3.h @@ -19,6 +19,9 @@ class Sprite3 : public BucketRenderer { static constexpr int SPRITES_PER_CHUNK = 48; private: + void render_jak1(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof); + void render_jak2(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof); + void opengl_setup(); void opengl_setup_normal(); void opengl_setup_distort(); @@ -33,7 +36,7 @@ class Sprite3 : public BucketRenderer { void distort_draw_instanced(SharedRenderState* render_state, ScopedProfilerNode& prof); void distort_draw_common(SharedRenderState* render_state, ScopedProfilerNode& prof); void distort_setup_framebuffer_dims(SharedRenderState* render_state); - void handle_sprite_frame_setup(DmaFollower& dma); + void handle_sprite_frame_setup(DmaFollower& dma, GameVersion version); void render_3d(DmaFollower& dma); void render_2d_group0(DmaFollower& dma, SharedRenderState* render_state, diff --git a/game/graphics/opengl_renderer/TextureUploadHandler.cpp b/game/graphics/opengl_renderer/TextureUploadHandler.cpp index e152b75644..97ee641aca 100644 --- a/game/graphics/opengl_renderer/TextureUploadHandler.cpp +++ b/game/graphics/opengl_renderer/TextureUploadHandler.cpp @@ -15,6 +15,7 @@ void TextureUploadHandler::render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) { // this is the data we get from the PC Port modification. + m_upload_count = 0; std::vector uploads; // loop through all data, grabbing buckets @@ -60,38 +61,18 @@ void TextureUploadHandler::flush_uploads(std::vector& uploads, if (m_fake_uploads) { uploads.clear(); } else { + m_upload_count += uploads.size(); // NOTE: we don't actually copy the textures in the dma chain copying because they aren't // reference by DMA tag. So there's the potential for race conditions if the game gets messed // up and corrupts the texture memory. const u8* ee_mem = (const u8*)render_state->ee_main_memory; - if (uploads.size() == 2 && uploads[0].mode == 2 && uploads[1].mode == -2 && - uploads[0].page == uploads[1].page) { - render_state->texture_pool->handle_upload_now(ee_mem + uploads[0].page, -2, ee_mem, + for (auto& upload : uploads) { + render_state->texture_pool->handle_upload_now(ee_mem + upload.page, upload.mode, ee_mem, render_state->offset_of_s7); - render_state->texture_pool->handle_upload_now(ee_mem + uploads[0].page, 2, ee_mem, - render_state->offset_of_s7); - } else if (uploads.size() == 1 && uploads[0].mode == -1) { - render_state->texture_pool->handle_upload_now(ee_mem + uploads[0].page, -1, ee_mem, - render_state->offset_of_s7); - } else if (uploads.size() == 1 && uploads[0].mode == -2) { - render_state->texture_pool->handle_upload_now(ee_mem + uploads[0].page, -2, ee_mem, - render_state->offset_of_s7); - } else if (uploads.size() == 1 && uploads[0].mode == 0) { - render_state->texture_pool->handle_upload_now(ee_mem + uploads[0].page, 0, ee_mem, - render_state->offset_of_s7); - } - - else if (uploads.empty()) { - // do nothing. - } else { - lg::error("unhandled upload sequence in {}:", m_name); - for (auto& upload : uploads) { - lg::error(" page: 0x{:x} mode: {}", upload.page, upload.mode); - } - ASSERT(false); } } } void TextureUploadHandler::draw_debug_window() { ImGui::Checkbox("Fake Uploads", &m_fake_uploads); + ImGui::Text("Uploads: %d", m_upload_count); } diff --git a/game/graphics/opengl_renderer/TextureUploadHandler.h b/game/graphics/opengl_renderer/TextureUploadHandler.h index 1aa39ccffc..c275a347d1 100644 --- a/game/graphics/opengl_renderer/TextureUploadHandler.h +++ b/game/graphics/opengl_renderer/TextureUploadHandler.h @@ -21,4 +21,5 @@ class TextureUploadHandler : public BucketRenderer { }; void flush_uploads(std::vector& uploads, SharedRenderState* render_state); bool m_fake_uploads = false; + int m_upload_count = 0; }; diff --git a/game/graphics/opengl_renderer/buckets.h b/game/graphics/opengl_renderer/buckets.h index 69159412a2..1217bd5221 100644 --- a/game/graphics/opengl_renderer/buckets.h +++ b/game/graphics/opengl_renderer/buckets.h @@ -82,15 +82,34 @@ namespace jak2 { enum class BucketId { SPECIAL_BUCKET_2 = 2, + TEX_LCOM_SKY_PRE = 4, + TEX_L0_TFRAG = 7, TFRAG_L0_TFRAG = 8, TIE_L0_TFRAG = 9, + TEX_L1_TFRAG = 18, TFRAG_L1_TFRAG = 19, TIE_L1_TFRAG = 20, + TEX_L0_SHRUB = 73, SHRUB_L0_SHRUB = 74, + TEX_L1_SHRUB = 82, SHRUB_L1_SHRUB = 83, TFRAG_T_L0_ALPHA = 128, + TEX_LCOM_TFRAG = 187, + TEX_LCOM_SHRUB = 191, + TEX_L0_PRIS = 196, + TEX_L2_PRIS = 204, + TEX_LCOM_PRIS = 220, + TEX_L0_WATER = 252, TFRAG_W_L0_WATER = 255, + TEX_L1_WATER = 261, + TEX_L2_WATER = 270, + TEX_LCOM_WATER = 306, + TEX_LCOM_SKY_POST = 309, + TEX_ALL_SPRITE = 312, + PARTICLES = 313, + TEX_ALL_WARP = 316, DEBUG_NO_ZBUF1 = 318, + TEX_ALL_MAP = 319, DEBUG2 = 324, DEBUG_NO_ZBUF2 = 325, DEBUG3 = 326, diff --git a/game/graphics/opengl_renderer/shaders/sprite3_3d.vert b/game/graphics/opengl_renderer/shaders/sprite3_3d.vert index be42f88fd9..129ddcd18f 100644 --- a/game/graphics/opengl_renderer/shaders/sprite3_3d.vert +++ b/game/graphics/opengl_renderer/shaders/sprite3_3d.vert @@ -28,7 +28,7 @@ out flat vec4 fragment_color; out vec3 tex_coord; out flat uvec2 tex_info; -const float SCISSOR_ADJUST = 512.0/448.0; +const float SCISSOR_ADJUST = HEIGHT_SCALE * 512.0/448.0; vec4 matrix_transform(mat4 mtx, vec3 pt) { return mtx[3] diff --git a/game/graphics/opengl_renderer/sprite_common.h b/game/graphics/opengl_renderer/sprite_common.h index c26daf0a8f..619ee08d1e 100644 --- a/game/graphics/opengl_renderer/sprite_common.h +++ b/game/graphics/opengl_renderer/sprite_common.h @@ -12,7 +12,7 @@ using math::Vector4f; /*! * GOAL sprite-frame-data, all the data that's uploaded once per frame for the sprite system. */ -struct SpriteFrameData { +struct SpriteFrameDataJak1 { Vector4f xy_array[8]; Vector4f st_array[4]; Vector4f xyz_array[4]; @@ -41,6 +41,71 @@ struct SpriteFrameData { float bonus; }; +struct SpriteFrameData { + Vector4f xy_array[8]; + Vector4f st_array[4]; + Vector4f xyz_array[4]; + Vector4f hmge_scale; + float pfog0; + float deg_to_rad; + float min_scale; + float inv_area; + GifTag adgif_giftag; + GifTag sprite_2d_giftag; + GifTag sprite_2d_giftag2; + Vector4f sincos[5]; + Vector4f basis_x; + Vector4f basis_y; + GifTag sprite_3d_giftag; + GifTag sprite_3d_giftag_2; + AdGifData screen_shader; + GifTag clipped_giftag; + Vector4f inv_hmge_scale; + Vector4f stq_offset; + Vector4f stq_scale; + Vector4f rgba_plain; + GifTag warp_giftag; + float fog_min; + float fog_max; + float max_scale; + float bonus; + + void from_jak1(const SpriteFrameDataJak1& data) { + for (int i = 0; i < 8; i++) { + xy_array[i] = data.xy_array[i]; + } + for (int i = 0; i < 4; i++) { + st_array[i] = data.st_array[i]; + xyz_array[i] = data.xyz_array[i]; + } + hmge_scale = data.hmge_scale; + pfog0 = data.pfog0; + deg_to_rad = data.deg_to_rad; + min_scale = data.min_scale; + inv_area = data.inv_area; + adgif_giftag = data.adgif_giftag; + sprite_2d_giftag = data.sprite_2d_giftag; + sprite_2d_giftag2 = data.sprite_2d_giftag2; + for (int i = 0; i < 5; i++) { + sincos[i] = data.sincos[i]; + } + basis_x = data.basis_x; + basis_y = data.basis_y; + sprite_3d_giftag = data.sprite_3d_giftag; + screen_shader = data.screen_shader; + clipped_giftag = data.clipped_giftag; + inv_hmge_scale = data.inv_hmge_scale; + stq_offset = data.stq_offset; + stq_scale = data.stq_scale; + rgba_plain = data.rgba_plain; + warp_giftag = data.warp_giftag; + fog_min = data.fog_min; + fog_max = data.fog_max; + max_scale = data.max_scale; + bonus = data.bonus; + } +}; + /*! * "Matrix Data" for 3D sprites. This is shared for all 3D sprites */ @@ -143,4 +208,5 @@ enum SpriteProgMem { }; static_assert(offsetof(SpriteFrameData, hmge_scale) == 256); -static_assert(sizeof(SpriteFrameData) == 0x290, "SpriteFrameData size"); \ No newline at end of file +static_assert(sizeof(SpriteFrameDataJak1) == 0x290, "SpriteFrameData size"); +static_assert(sizeof(SpriteFrameData) == 0x2a0, "SpriteFrameData size"); \ No newline at end of file diff --git a/game/mips2c/jak2_functions/sparticle.cpp b/game/mips2c/jak2_functions/sparticle.cpp new file mode 100644 index 0000000000..feb8fa57c8 --- /dev/null +++ b/game/mips2c/jak2_functions/sparticle.cpp @@ -0,0 +1,712 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +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, L113 + // 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, L103 + // 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, L101 + // 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, L102 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(v1) == 0; // beq v1, r0, L112 + // 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, L113 + 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, L113 // beq r0, r0, L113 + 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, L104 + 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, L112 + 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, L105 + 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, L106 + // 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, L107 + 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, L107 + 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, L108 + 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, L109 + 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, L110 + 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, L110 + 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, L112 + // nop // sll r0, r0, 0 + if (bc) {goto block_31;} // branch non-likely + + + block_26: + bc = c->sgpr64(a1) == 0; // beq a1, r0, L111 + 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, L112 + // nop // sll r0, r0, 0 + if (bc) {goto block_31;} // branch non-likely + + + block_28: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L113 + // 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, L112 + 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, L113 + // 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, L100 + 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("*fake-scratchpad-data*").c(); + cache.add_to_sprite_aux_list = intern_from_c("add-to-sprite-aux-list").c(); + cache.sp_free_particle = intern_from_c("sp-free-particle").c(); + cache.sp_orbiter = intern_from_c("sp-orbiter").c(); + cache.sp_relaunch_particle_2d = intern_from_c("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/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +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, L98 + // 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, L86 + // 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, L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_5;} // branch non-likely + + bc = c->sgpr64(v1) == 0; // beq v1, r0, L97 + // 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, L98 + 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, L98 // beq r0, r0, L98 + 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, L87 + 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, L97 + 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, L88 + 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, L89 + // 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, L90 + 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, L90 + 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, L91 + 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, L92 + // 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 L93 + // 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, L94 // beq r0, r0, L94 + // 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, L95 + 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, L95 + 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, L97 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + + block_27: + bc = c->sgpr64(a1) == 0; // beq a1, r0, L96 + 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, L97 + // nop // sll r0, r0, 0 + if (bc) {goto block_32;} // branch non-likely + + + block_29: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L98 + // 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, L97 + 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, L98 + // 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, L84 + 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("*fake-scratchpad-data*").c(); + cache.quaternion = intern_from_c("quaternion*!").c(); + cache.quaternion_normalize = intern_from_c("quaternion-normalize!").c(); + cache.sp_free_particle = intern_from_c("sp-free-particle").c(); + cache.sp_relaunch_particle_3d = intern_from_c("sp-relaunch-particle-3d").c(); + gLinkedFunctionTable.reg("sp-process-block-3d", execute, 512); +} + +} // namespace sp_process_block_3d +} // namespace Mips2C diff --git a/game/mips2c/jak2_functions/sparticle_launcher.cpp b/game/mips2c/jak2_functions/sparticle_launcher.cpp new file mode 100644 index 0000000000..9d51f68421 --- /dev/null +++ b/game/mips2c/jak2_functions/sparticle_launcher.cpp @@ -0,0 +1,1557 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +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, L277 + 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, L292 + // nop // sll r0, r0, 0 + if (bc) {goto block_44;} // 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, L290 + c->vrget(DEST::xyzw, vf1); // vrget.xyzw vf1 + if (bc) {goto block_41;} // 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, L280 + c->addiu(t1, r0, 1); // addiu t1, r0, 1 + if (bc) {goto block_18;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L281 + c->addiu(t1, r0, 2); // addiu t1, r0, 2 + if (bc) {goto block_20;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L285 + c->addiu(t1, r0, 7); // addiu t1, r0, 7 + if (bc) {goto block_30;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L283 + c->addiu(t1, r0, 3); // addiu t1, r0, 3 + if (bc) {goto block_25;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L286 + c->addiu(t1, r0, 5); // addiu t1, r0, 5 + if (bc) {goto block_33;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L287 + c->addiu(t1, r0, 6); // addiu t1, r0, 6 + if (bc) {goto block_35;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L288 + c->addiu(t1, r0, 4); // addiu t1, r0, 4 + if (bc) {goto block_37;} // branch non-likely + + bc = c->sgpr64(a1) == c->sgpr64(t1); // beq a1, t1, L289 + // nop // sll r0, r0, 0 + if (bc) {goto block_39;} // branch non-likely + + bc = c->sgpr64(t2) == 0; // beq t2, r0, L279 + // nop // sll r0, r0, 0 + if (bc) {goto block_16;} // 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, L278 + 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_16: + 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, L278 + 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_18: + 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, L278 + 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_20: + bc = c->sgpr64(t2) == 0; // beq t2, r0, L282 + c->vrxor(vf2, BC::w); // vrxorw vf2 + if (bc) {goto block_23;} // 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, L278 + 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_23: + 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, L278 + 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_25: + bc = c->sgpr64(t2) == 0; // beq t2, r0, L284 + c->vrxor(vf2, BC::w); // vrxorw vf2 + if (bc) {goto block_28;} // 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, L278 + 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_28: + 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, L278 + 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_30: + bc = c->sgpr64(t2) == 0; // beq t2, r0, L282 + c->vrxor(vf2, BC::w); // vrxorw vf2 + if (bc) {goto block_23;} // 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, L278 + 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_33: + 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, L278 + 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_35: + 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, L278 + 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_37: + 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, L278 + 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_39: + 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, L278 + 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_41: + if (((s64)c->sgpr64(t0)) != ((s64)c->sgpr64(s7))) {// bnel t0, s7, L291 + c->sw(r0, 0, a0); // sw r0, 0(a0) + goto block_43; + } + + block_43: + 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, L278 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + + block_44: + //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("*part-id-table*").c(); + cache.sp_temp = intern_from_c("*sp-temp*").c(); + gLinkedFunctionTable.reg("sp-init-fields!", execute, 0); +} + +} // namespace sp_init_fields +} // namespace Mips2C + +namespace Mips2C::jak2 { +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, L270 + 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, L269 + 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, L270 + 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, L268 + 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, L271 + 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, L270 + 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("*particle-adgif-cache*").c(); + cache.particle_setup_adgif = intern_from_c("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/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +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* 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; + 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, L219 + 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, L221 + 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, L220 + 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, L220 + // nop // sll r0, r0, 0 + if (bc) {goto block_7;} // branch non-likely + + bc = c->sgpr64(t1) != c->sgpr64(v1); // bne t1, v1, L220 + // 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->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, L222 + 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, L250 + // nop // sll r0, r0, 0 + if (bc) {goto block_79;} // branch non-likely + + //beq r0, r0, L223 // beq r0, r0, L223 + // 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, L250 + // nop // sll r0, r0, 0 + if (bc) {goto block_79;} // 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, L224 + // 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, L224 + // 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, L250 + c->mov64(s2, v0); // or s2, v0, r0 + if (bc) {goto block_79;} // 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 + bc = c->sgpr64(s6) != c->sgpr64(s7); // bne s6, s7, L227 + // nop // sll r0, r0, 0 + if (bc) {goto block_24;} // branch non-likely + + bc = c->sgpr64(s1) == c->sgpr64(s7); // beq s1, s7, L225 + // nop // sll r0, r0, 0 + if (bc) {goto block_22;} // branch non-likely + + c->lw(v1, 12, s1); // lw v1, 12(s1) + bc = c->sgpr64(v1) == c->sgpr64(s7); // beq v1, s7, L225 + // nop // sll r0, r0, 0 + if (bc) {goto block_22;} // 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, L225 + c->lb(v1, 28, s1); // lb v1, 28(s1) + if (bc) {goto block_22;} // 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, L226 + // nop // sll r0, r0, 0 + if (bc) {goto block_23;} // 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, L226 // beq r0, r0, L226 + c->sw(v1, 212, sp); // sw v1, 212(sp) + goto block_23; // branch always + + + block_22: + 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_23: + 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_24: + 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, L228 + c->vmini_bc(DEST::xyz, BC::x, vf4, vf4, vf31); // vminix.xyz vf4, vf4, vf31 + if (bc) {goto block_26;} // 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_26: + c->addiu(v1, r0, 8); // addiu v1, r0, 8 + c->sb(v1, 129, s2); // sb v1, 129(s2) + bc = c->sgpr64(s1) == c->sgpr64(s7); // beq s1, s7, L229 + c->andi(v1, s5, 64); // andi v1, s5, 64 + if (bc) {goto block_29;} // branch non-likely + + c->lwu(a0, 16, s1); // lwu a0, 16(s1) + c->lwu(a0, 8, a0); // lwu a0, 8(a0) + c->lw(a0, 0, a0); // lw a0, 0(a0) + c->sb(a0, 129, s2); // sb a0, 129(s2) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L229 + c->lw(a0, 192, sp); // lw a0, 192(sp) + if (bc) {goto block_29;} // 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_29: + c->sw(s7, 136, s2); // sw s7, 136(s2) + // nop // sll r0, r0, 0 + bc = c->sgpr64(s0) == c->sgpr64(s7); // beq s0, s7, L233 + // nop // sll r0, r0, 0 + if (bc) {goto block_38;} // 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, L233 + // nop // sll r0, r0, 0 + if (bc) {goto block_38;} // branch non-likely + + c->lw(a2, 0, s1); // lw a2, 0(s1) + c->daddiu(a3, s1, 108); // daddiu a3, s1, 108 + + block_32: + 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, L232 + c->lh(v1, 4, a3); // lh v1, 4(a3) + if (bc) {goto block_37;} // 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, L232 + // nop // sll r0, r0, 0 + if (bc) {goto block_37;} // 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, L231 + c->lw(a0, 0, s2); // lw a0, 0(s2) + goto block_36; + } + + block_36: + 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, L233 // beq r0, r0, L233 + // nop // sll r0, r0, 0 + goto block_38; // branch always + + + block_37: + bc = c->sgpr64(a2) != 0; // bne a2, r0, L230 + c->daddiu(a3, a3, 48); // daddiu a3, a3, 48 + if (bc) {goto block_32;} // branch non-likely + + + block_38: + 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, L234 + c->daddiu(a3, sp, 80); // daddiu a3, sp, 80 + if (bc) {goto block_40;} // 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_40: + bc = c->sgpr64(s6) == c->sgpr64(s7); // beq s6, s7, L235 + // nop // sll r0, r0, 0 + if (bc) {goto block_42;} // 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_42: + bc = c->sgpr64(s0) == c->sgpr64(s7); // beq s0, s7, L236 + // nop // sll r0, r0, 0 + if (bc) {goto block_46;} // 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, L236 + c->daddiu(a0, sp, 192); // daddiu a0, sp, 192 + if (bc) {goto block_46;} // branch non-likely + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L236 + c->mov64(a1, s2); // or a1, s2, r0 + if (bc) {goto block_46;} // 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_46: + 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, L237 + c->sd(a1, 48, a2); // sd a1, 48(a2) + goto block_48; + } + + block_48: + 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, L238 + c->daddiu(a2, sp, 192); // daddiu a2, sp, 192 + if (bc) {goto block_50;} // 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_50: + 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, L239 + // nop // sll r0, r0, 0 + if (bc) {goto block_53;} // 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, L239 + c->load_symbol2(t9, cache.new_sound_id); // lw t9, new-sound-id(s7) + if (bc) {goto block_53;} // 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_53: + 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, L240 + c->dsubu(a0, r0, a0); // dsubu a0, r0, a0 + if (bc) {goto block_55;} // 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_55: + c->load_symbol2(a0, cache.level); // lw a0, *level*(s7) + // nop // sll r0, r0, 0 + c->lw(v1, 300, a0); // lw v1, 300(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L241 + // nop // sll r0, r0, 0 + if (bc) {goto block_58;} // branch non-likely + + c->lw(v1, 304, a0); // lw v1, 304(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L241 + // nop // sll r0, r0, 0 + if (bc) {goto block_58;} // branch non-likely + + //beq r0, r0, L246 // beq r0, r0, L246 + c->mov64(s5, s5); // or s5, s5, r0 + goto block_71; // branch always + + + block_58: + c->lw(v1, 5532, a0); // lw v1, 5532(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L242 + // nop // sll r0, r0, 0 + if (bc) {goto block_61;} // branch non-likely + + c->lw(v1, 5536, a0); // lw v1, 5536(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L242 + // nop // sll r0, r0, 0 + if (bc) {goto block_61;} // branch non-likely + + //beq r0, r0, L246 // beq r0, r0, L246 + c->ori(s5, s5, 512); // ori s5, s5, 512 + goto block_71; // branch always + + + block_61: + c->lw(v1, 10764, a0); // lw v1, 10764(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L243 + // nop // sll r0, r0, 0 + if (bc) {goto block_64;} // branch non-likely + + c->lw(v1, 10768, a0); // lw v1, 10768(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L243 + // nop // sll r0, r0, 0 + if (bc) {goto block_64;} // branch non-likely + + //beq r0, r0, L246 // beq r0, r0, L246 + c->ori(s5, s5, 1024); // ori s5, s5, 1024 + goto block_71; // branch always + + + block_64: + c->lw(v1, 15996, a0); // lw v1, 15996(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L244 + // nop // sll r0, r0, 0 + if (bc) {goto block_67;} // branch non-likely + + c->lw(v1, 16000, a0); // lw v1, 16000(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L244 + // nop // sll r0, r0, 0 + if (bc) {goto block_67;} // branch non-likely + + //beq r0, r0, L246 // beq r0, r0, L246 + c->ori(s5, s5, 1536); // ori s5, s5, 1536 + goto block_71; // branch always + + + block_67: + c->lw(v1, 21228, a0); // lw v1, 21228(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) < 0; // bltz v1, L245 + // nop // sll r0, r0, 0 + if (bc) {goto block_70;} // branch non-likely + + c->lw(v1, 21232, a0); // lw v1, 21232(a0) + // nop // sll r0, r0, 0 + c->dsubu(v1, s4, v1); // dsubu v1, s4, v1 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(v1)) >= 0; // bgez v1, L245 + // nop // sll r0, r0, 0 + if (bc) {goto block_70;} // branch non-likely + + //beq r0, r0, L246 // beq r0, r0, L246 + c->ori(s5, s5, 2048); // ori s5, s5, 2048 + goto block_71; // branch always + + + block_70: + c->ori(s5, s5, 2560); // ori s5, s5, 2560 + // nop // sll r0, r0, 0 + + block_71: + c->andi(v1, s5, 4224); // andi v1, s5, 4224 + c->addiu(a0, r0, 4096); // addiu a0, r0, 4096 + bc = c->sgpr64(v1) != c->sgpr64(a0); // bne v1, a0, L247 + c->load_symbol2(a0, cache.time_of_day_context); // lw a0, *time-of-day-context*(s7) + if (bc) {goto block_73;} // branch non-likely + + c->lqc2(vf4, 108, a0); // lqc2 vf4, 108(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, L248 // beq r0, r0, L248 + c->sqc2(vf6, 48, s2); // sqc2 vf6, 48(s2) + goto block_75; // branch always + + + block_73: + // nop // sll r0, r0, 0 + c->andi(v1, s5, 128); // andi v1, s5, 128 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L248 + c->lqc2(vf5, 224, sp); // lqc2 vf5, 224(sp) + if (bc) {goto block_75;} // 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_75: + 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, L249 + c->lui(v1, 16256); // lui v1, 16256 + if (bc) {goto block_78;} // 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, L223 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + //beq r0, r0, L250 // beq r0, r0, L250 + // nop // sll r0, r0, 0 + goto block_79; // branch always + + + block_78: + 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, L223 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + + block_79: + 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("*level*").c(); + cache.sp_launcher_enable = intern_from_c("*sp-launcher-enable*").c(); + cache.sp_launcher_lock = intern_from_c("*sp-launcher-lock*").c(); + cache.time_of_day_context = intern_from_c("*time-of-day-context*").c(); + cache.add_to_sprite_aux_list = intern_from_c("add-to-sprite-aux-list").c(); + cache.cos = intern_from_c("cos").c(); + cache.new_sound_id = intern_from_c("new-sound-id").c(); + cache.particle_adgif = intern_from_c("particle-adgif").c(); + cache.quaternion_axis_angle = intern_from_c("quaternion-axis-angle!").c(); + cache.sin = intern_from_c("sin").c(); + cache.sound_play_by_spec = intern_from_c("sound-play-by-spec").c(); + cache.sp_adjust_launch = intern_from_c("sp-adjust-launch").c(); + cache.sp_euler_convert = intern_from_c("sp-euler-convert").c(); + cache.sp_get_particle = intern_from_c("sp-get-particle").c(); + cache.sp_init_fields = intern_from_c("sp-init-fields!").c(); + cache.sp_queue_launch = intern_from_c("sp-queue-launch").c(); + cache.sp_rotate_system = intern_from_c("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/jak2/kscheme.h" +using ::jak2::intern_from_c; +namespace Mips2C::jak2 { +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, L36 + 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, L36 + 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, L36 + 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, L37 + 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, L37 // beq r0, r0, L37 + 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 L37 + 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("*math-camera*").c(); + cache.atan = intern_from_c("atan").c(); + gLinkedFunctionTable.reg("sparticle-motion-blur", execute, 128); +} + +} // namespace sparticle_motion_blur +} // namespace Mips2C diff --git a/game/mips2c/mips2c_private.h b/game/mips2c/mips2c_private.h index a5da76deb9..9fc4a4ea77 100644 --- a/game/mips2c/mips2c_private.h +++ b/game/mips2c/mips2c_private.h @@ -274,6 +274,8 @@ struct ExecutionContext { gprs[gpr].ds64[0] = val; // sign extend and set } + void store_symbol2(int gpr, void* sym_addr) { memcpy((u8*)sym_addr - 1, &gprs[gpr].ds32[0], 4); } + void load_symbol_addr(int gpr, void* sym_addr) { gprs[gpr].du64[0] = ((const u8*)sym_addr) - g_ee_main_mem; } @@ -719,6 +721,14 @@ struct ExecutionContext { } } + void pceqw(int dst, int rs, int rt) { + auto s = gpr_src(rs); + auto t = gpr_src(rt); + for (int i = 0; i < 4; i++) { + gprs[dst].du32[i] = (s.du32[i] == t.du32[i]) ? 0xffffffff : 0; + } + } + void pmfhl_lh(int dest) { gprs[dest].du16[0] = lo.du16[0]; gprs[dest].du16[1] = lo.du16[2]; @@ -1430,6 +1440,37 @@ struct ExecutionContext { gprs[dst].du64[0] = (gprs[dst].du64[0] & LDR_MASK[shift]) | (mem >> LDR_SHIFT[shift]); } + u32 clip(int xyz_idx, int w_idx, u32 old_clip) { + u32 result = (old_clip << 6); + auto xyz_vec = vf_src(xyz_idx); + float w = vf_src(w_idx).f[3]; + + float plus = std::abs(w); + float minus = -plus; + + if (xyz_vec.f[0] > plus) { + result |= 0b1; + } + if (xyz_vec.f[0] < minus) { + result |= 0b10; + } + + if (xyz_vec.f[1] > plus) { + result |= 0b100; + } + if (xyz_vec.f[1] < minus) { + result |= 0b1000; + } + + if (xyz_vec.f[2] > plus) { + result |= 0b10000; + } + if (xyz_vec.f[2] < minus) { + result |= 0b100000; + } + return result & 0xffffff; // only 24 bits + } + std::string print_vf_float(int vf) { auto src = vf_src(vf); return fmt::format("{} {} {} {}", src.f[0], src.f[1], src.f[2], src.f[3]); diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index 41feb5b73d..656e70b22f 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -129,6 +129,12 @@ namespace render_boundary_tri { extern void link(); } namespace render_boundary_quad { extern void link(); } namespace set_sky_vf27 { extern void link(); } namespace draw_boundary_polygon { extern void link(); } +namespace sp_init_fields { extern void link(); } +namespace particle_adgif { extern void link(); } +namespace sp_launch_particles_var { extern void link(); } +namespace sparticle_motion_blur { extern void link(); } +namespace sp_process_block_2d { extern void link(); } +namespace sp_process_block_3d { extern void link(); } } // clang-format on @@ -213,7 +219,11 @@ PerGameVersion>> gMips2C {"debug", {jak2::debug_line_clip::link, jak2::init_boundary_regs::link, jak2::render_boundary_quad::link, jak2::render_boundary_tri::link, jak2::set_sky_vf27::link, - jak2::draw_boundary_polygon::link}}}, + jak2::draw_boundary_polygon::link}}, + {"sparticle-launcher", + {jak2::sp_init_fields::link, jak2::particle_adgif::link, jak2::sp_launch_particles_var::link, + jak2::sparticle_motion_blur::link}}, + {"sparticle", {jak2::sp_process_block_2d::link, jak2::sp_process_block_3d::link}}}, }; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { diff --git a/goal_src/jak2/engine/camera/cam-interface-h.gc b/goal_src/jak2/engine/camera/cam-interface-h.gc index fc5909415c..7d9d61cef2 100644 --- a/goal_src/jak2/engine/camera/cam-interface-h.gc +++ b/goal_src/jak2/engine/camera/cam-interface-h.gc @@ -9,11 +9,13 @@ (define-extern position-in-front-of-camera! (function vector float float vector)) -;; NOTE - for sparticle-launcher + (define-extern math-camera-matrix "Returns [[*math-camera*]]'s `inv-camera-rot`" (function matrix)) +(define-extern matrix-local->world (function symbol matrix)) + ;; DECOMP BEGINS (define-perm *camera-init-mat* matrix #f) diff --git a/goal_src/jak2/engine/debug/debug-part.gc b/goal_src/jak2/engine/debug/debug-part.gc index c1dabd88ac..5c6b549917 100644 --- a/goal_src/jak2/engine/debug/debug-part.gc +++ b/goal_src/jak2/engine/debug/debug-part.gc @@ -7,3 +7,2018 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +(defpart 335 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 20) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + ) + ) + +(defpartgroup group-red-eco-strike-ground + :id 96 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 336) (sp-item 337)) + ) + +(defpart 336 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 24.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 32.0) + (sp-rnd-flt spt-a 8.0 56.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.13333334) (meters 0.16666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.013333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.4222223) + (sp-flt spt-fade-a -0.35555556) + (sp-flt spt-accel-y 0.34133333) + (sp-flt spt-friction 0.7) + (sp-int spt-timer 180) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 338) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 337 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 32.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-rnd-flt spt-a 64.0 8.0 1.0) + (sp-flt spt-vel-y (meters 0.3)) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -2.8444445) + (sp-flt spt-fade-a -0.82222223) + (sp-flt spt-friction 0.7) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 45) + (sp-launcher-by-id spt-next-launcher 338) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpartgroup group-red-eco-spinkick + :id 97 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 339) (sp-item 340) (sp-item 341 :flags (bit6))) + ) + +(defpart 339 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 32.0) + (sp-rnd-flt spt-a 8.0 56.0 1.0) + (sp-flt spt-scalevel-x (meters 0.013333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.4222223) + (sp-flt spt-fade-a -0.35555556) + (sp-flt spt-accel-y 0.34133333) + (sp-int spt-timer 180) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 338) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +(defpart 338 + :init-specs ((sp-flt spt-fade-r -0.7111111) (sp-flt spt-fade-g 0.7111111) (sp-flt spt-fade-b 0.35555556)) + ) + +(defpart 340 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.66) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-rnd-flt spt-a 64.0 8.0 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -2.8444445) + (sp-flt spt-fade-a -0.82222223) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 45) + (sp-launcher-by-id spt-next-launcher 338) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +(defpart 341 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 96.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -4.0) + (sp-flt spt-accel-y 0.34133333) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +(defpartgroup group-eco-blue + :id 98 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 348 :flags (launch-asap) :binding 342) + (sp-item 342 :fade-after (meters 40) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 60) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 130) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :flags (start-dead launch-asap) :binding 343) + (sp-item 343 :flags (start-dead launch-asap) :binding 344) + (sp-item 343 :flags (start-dead launch-asap) :binding 345) + (sp-item 343 :flags (start-dead launch-asap) :binding 346) + (sp-item 343 :flags (start-dead launch-asap) :binding 344) + (sp-item 343 :flags (start-dead launch-asap) :binding 345) + (sp-item 343 :flags (start-dead launch-asap) :binding 346) + (sp-item 344 :fade-after (meters 60) :flags (start-dead) :binding 347) + (sp-item 345 :fade-after (meters 70) :flags (start-dead) :binding 347) + (sp-item 346 :fade-after (meters 80) :flags (start-dead) :binding 347) + (sp-item 344 :fade-after (meters 90) :flags (start-dead) :binding 347) + (sp-item 345 :fade-after (meters 100) :flags (start-dead) :binding 347) + (sp-item 346 :fade-after (meters 100) :flags (start-dead) :binding 347) + (sp-item 347 :flags (start-dead)) + ) + ) + +(defpart 348 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 4)) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +(defpart 342 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.3) (meters 0.15) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 96.0 1.0) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.0148148155) (meters 0.0044444446) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 349) + ) + ) + +(defpart 349 + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + ) + +(defpart 343 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.8) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 192.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-flt spt-rotvel-z (degrees 269.52002) (degrees 208.99998) 1.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 350) + ) + ) + +(defpart 350 + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + ) + +(defpart 344 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 345 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 346 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 347 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.2 0.2 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 192.0) + (sp-rnd-flt spt-a 96.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpartgroup group-eco-blue-collect + :id 99 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 356 :flags (launch-asap) :binding 352) + (sp-item 352 :flags (start-dead launch-asap) :binding 353) + (sp-item 352 :flags (start-dead launch-asap) :binding 354) + (sp-item 352 :flags (start-dead launch-asap) :binding 353) + (sp-item 352 :flags (start-dead launch-asap) :binding 354) + (sp-item 352 :flags (start-dead launch-asap) :binding 355) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + ) + ) + +(defpart 356 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'part-tracker-track-root) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 277) + ) + ) + +(defpart 352 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) + (sp-flt spt-z (meters 0.08)) + (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.00048828125) 145.63556) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.08)) + (sp-flt spt-accel-z -21.845333) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 353 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 354 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 355 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpartgroup group-part-vent-blue-active + :id 100 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 360 :fade-after (meters 140) :falloff-to (meters 140) :binding 357) + (sp-item 360 :fade-after (meters 140) :falloff-to (meters 140) :binding 358) + (sp-item 360 :fade-after (meters 140) :falloff-to (meters 140) :binding 359) + (sp-item 361) + (sp-item 362 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 363 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 364 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 359 :fade-after (meters 30) :falloff-to (meters 30) :flags (start-dead)) + (sp-item 358 :fade-after (meters 60) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 357 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 359 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 358 :fade-after (meters 100) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 357 :fade-after (meters 110) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 359 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) + (sp-item 358 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) + ) + ) + +(defpartgroup group-part-vent-blue-inactive + :id 101 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 360 :fade-after (meters 100)) (sp-item 361)) + ) + +(defpart 361 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-flt spt-fade-a -0.2) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 360 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.05 0.1 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 96.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 357 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 358 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 359 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 362 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.1 0.5 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 10.0) (degrees 160.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 91) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 363 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.2 0.4 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 10.0) (degrees 160.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 91) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 364 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.3 0.1 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 10.0) (degrees 160.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 91) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +(defpart 351 + :init-specs ((sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-fade-r -1.0) + (sp-flt spt-fade-g -1.0) + (sp-flt spt-fade-a -2.0) + ) + ) + +(defpartgroup group-eco-red + :id 102 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 369 :flags (launch-asap) :binding 365) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 366 :flags (start-dead launch-asap) :binding 367) + (sp-item 366 :flags (start-dead launch-asap) :binding 367) + (sp-item 366 :flags (start-dead launch-asap) :binding 367) + (sp-item 367 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 368) + (sp-item 367 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 368) + (sp-item 367 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 368) + (sp-item 368 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 368 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 368 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + ) + ) + +(defpart 369 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 4)) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +(defpart 365 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 24.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.0148148155) (meters 0.0044444446) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 370) + ) + ) + +(defpart 370 + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + ) + +(defpart 366 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 371) + ) + ) + +(defpart 371 + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + ) + +(defpart 367 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.07) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-vel-x (meters 0.11259259)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 371) + ) + ) + +(defpart 368 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters -0.00038095238)) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.01904762) + (sp-rnd-flt spt-accel-y 0.40960002 0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 372) + ) + ) + +(defpart 372 + :init-specs ((sp-flt spt-fade-g 0.0)) + ) + +(defpartgroup group-eco-red-collect + :id 103 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 375 :flags (launch-asap) :binding 373) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + ) + ) + +(defpart 375 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'part-tracker-track-root) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 277) + ) + ) + +(defpart 373 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) + (sp-flt spt-z (meters 0.08)) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.00048828125) 145.63556) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.08)) + (sp-flt spt-accel-z -21.845333) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 374 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.006666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.005555555)) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -2.0) + (sp-flt spt-fade-a -0.22857143) + (sp-rnd-flt spt-accel-y 0.40960002 0.6144 1.0) + (sp-int spt-timer 54) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 376) + ) + ) + +(defpartgroup group-part-vent-red-active + :id 104 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 380 :fade-after (meters 30) :period 330 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 60) :period 736 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 90) :period 936 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 130) :period 528 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 170) :period 801 :length 5 :binding 377) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 50) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 381 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 382) + ) + ) + +(defpartgroup group-part-vent-red-inactive + :id 105 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 381 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 382)) + ) + +(defpart 382 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.6 0.6 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.9) (meters 1.9) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 381 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.3 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.1) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 380 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-a 1.0) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 5.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 377 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-flt spt-z (meters 0.5)) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.017777778) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.28444445) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 378 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 379 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.006666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.0023809525)) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.07619048) + (sp-rnd-flt spt-accel-y 0.40960002 0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 376) + ) + ) + +(defpart 376 + :init-specs ((sp-flt spt-fade-g 0.0)) + ) + +(defpartgroup group-part-vent-yellow-active + :id 106 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 386 :fade-after (meters 40) :period 330 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 60) :period 736 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 80) :period 936 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 100) :period 528 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 130) :period 801 :length 5 :binding 383) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 387 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 388) + ) + ) + +(defpartgroup group-part-vent-yellow-inactive + :id 107 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 387 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 388)) + ) + +(defpart 388 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.6 0.6 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.9) (meters 1.9) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 387 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.3 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.1) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 386 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-a 1.0) + (sp-rnd-flt spt-vel-y (meters 0.013333334) (meters 0.013333334) 1.0) + (sp-int spt-timer 375) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 5.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 383 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.2) 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-vel-x (meters 0.10666667)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.3) 1 109.22667) + (sp-flt spt-fade-a -0.34133333) + (sp-int spt-timer 375) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 384 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-flt spt-z (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-vel-x (meters 0.11259259)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.3) 1 109.22667) + (sp-flt spt-fade-a -0.34133333) + (sp-int spt-timer 375) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 385 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 389) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + ) + ) + +(defpart 389 + :init-specs ((sp-flt spt-fade-r 0.0)) + ) + +(defpartgroup group-eco-yellow + :id 108 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 394 :flags (launch-asap) :binding 390) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + ) + ) + +(defpart 394 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 4)) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +(defpart 390 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 16.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.0148148155) (meters 0.0044444446) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 395) + ) + ) + +(defpart 395 + :init-specs ((sp-flt spt-fade-a -0.10666667) (sp-int spt-timer 150)) + ) + +(defpart 391 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.75) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 396) + ) + ) + +(defpart 396 + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + ) + +(defpart 392 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.12) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-vel-x (meters 0.11259259)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 396) + ) + ) + +(defpart 393 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters -0.0006190476)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.01904762) + (sp-rnd-flt spt-accel-y -0.40960002 -0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 397) + ) + ) + +(defpart 397 + :init-specs ((sp-flt spt-fade-g 0.0)) + ) + +(defpartgroup group-eco-yellow-collect + :id 109 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 400 :flags (launch-asap) :binding 398) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + ) + ) + +(defpart 400 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'part-tracker-track-root) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 277) + ) + ) + +(defpart 398 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) + (sp-flt spt-z (meters 0.08)) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.00048828125) 145.63556) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.08)) + (sp-flt spt-accel-z -21.845333) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +(defpart 399 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters -0.0006190476)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.01904762) + (sp-rnd-flt spt-accel-y -0.40960002 -0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 397) + ) + ) + +(defpartgroup group-part-vent-green-active + :id 110 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 403 :fade-after (meters 80) :falloff-to (meters 80) :period 48 :length 5 :binding 401) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 404 :fade-after (meters 100)) + (sp-item 405) + ) + ) + +(defpart 405 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.6 0.6 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.9) (meters 1.9) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-rnd-flt spt-g 92.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 404 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.3 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.1) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 403 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-int spt-timer 750) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 401 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.053333335) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-flt spt-fade-r -0.2) + (sp-int-plain-rnd spt-timer 600 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 450 149 1) + (sp-launcher-by-id spt-next-launcher 406) + ) + ) + +(defpart 406 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) + ) + +(defpart 402 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.2)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters -0.0006060606)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -2.8333333) + (sp-flt spt-accel-y -0.81920004) + (sp-int-plain-rnd spt-timer 30 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 286) + ) + ) + +(defpartgroup group-fuel-cell-starburst + :id 111 + :bounds (static-bspherem 0 0.5 0 1.5) + :parts ((sp-item 407 :fade-after (meters 35)) + (sp-item 408 :fade-after (meters 20)) + (sp-item 409 :flags (bit1 launch-asap)) + (sp-item 410 :flags (bit1 launch-asap)) + ) + ) + +(defpart 407 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.8) 1.0) + (sp-rnd-int spt-r 0 1 255.0) + (sp-rnd-int spt-g 0 1 255.0) + (sp-rnd-int spt-b 0 1 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 0.35555556) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 411) + ) + ) + +(defpart 411 + :init-specs ((sp-flt spt-fade-a -0.53333336)) + ) + +(defpart 408 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.06) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.2)) + (sp-rnd-int spt-r 0 1 255.0) + (sp-rnd-int spt-g 0 1 255.0) + (sp-rnd-int spt-b 0 1 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-fade-a 0.32) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 411) + ) + ) + +(defpart 409 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 3)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 64.0) + (sp-flt spt-rotvel-z (degrees -0.4)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +(defpart 410 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 3.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 64.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +;; ERROR: function has no type analysis. Cannot decompile. + +(defpart 412 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.8) 1.0) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 0.35555556) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 413) + ) + ) + +(defpart 413 + :init-specs ((sp-flt spt-fade-a -0.53333336)) + ) + +(defpart 414 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.06) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.2)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-fade-a 0.32) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 413) + ) + ) + +(defpart 415 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 2)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-rotvel-z (degrees -0.4)) + (sp-int spt-timer 3600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-track-root-money) + ) + ) + +(defpart 416 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 2.5)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer 3600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-track-root-money) + ) + ) + +(defpartgroup group-money-starburst :id 112 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 417))) + +(defpartgroup group-buzzer-effect + :id 113 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 418 :flags (is-3d)) (sp-item 419 :flags (is-3d))) + ) + +(defpart 418 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 2.0) + (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-x 0.0 12743.111 1.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 32.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-launchrot-x (degrees -180.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -180.0) (degrees 360.0) 1.0) + ) + ) + +(defpart 419 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 2.0) + (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-x 20024.889 12743.111 1.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 32.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-launchrot-x (degrees -180.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -180.0) (degrees 360.0) 1.0) + ) + ) + +(defpartgroup group-blue-collect + :id 114 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 420) (sp-item 421) (sp-item 422)) + ) + +(defpart 420 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 60.0 20.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +(defpart 421 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 60.0 20.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +(defpart 422 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 60.0 20.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.42666668) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 310) + ) + ) + +(defpartgroup group-yellow-collect + :id 115 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 423) (sp-item 424) (sp-item 425)) + ) + +(defpart 423 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +(defpart 424 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +(defpart 425 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.42666668) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 310) + ) + ) + +(defpart 310 + :init-specs ((sp-flt spt-scalevel-x (meters -0.025)) (sp-copy-from-other spt-scalevel-y -4)) + ) + +(defpartgroup group-red-collect + :id 116 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 426) (sp-item 427) (sp-item 428)) + ) + +(defpart 426 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +(defpart 427 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +(defpart 428 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.42666668) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 310) + ) + ) + +) diff --git a/goal_src/jak2/engine/debug/part-tester.gc b/goal_src/jak2/engine/debug/part-tester.gc index 0e1f524a96..2db6228538 100644 --- a/goal_src/jak2/engine/debug/part-tester.gc +++ b/goal_src/jak2/engine/debug/part-tester.gc @@ -7,3 +7,141 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; failed to figure out what this is: +(defpartgroup group-part-tester + :id 127 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 640) + :rotate ((degrees 2) (degrees 0) (degrees 0)) + :parts ((sp-item 209)) + ) + +;; definition of type part-tester +(deftype part-tester (process) + ((root trsqv :offset-assert 128) + (part sparticle-launch-control :offset-assert 132) + (old-group sparticle-launch-group :offset-assert 136) + ) + :heap-base #x10 + :method-count-assert 14 + :size-assert #x8c + :flag-assert #xe0010008c + ) +(define-extern *part-tester* (pointer process)) + +;; definition for method 3 of type part-tester +(defmethod inspect part-tester ((obj part-tester)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Troot: ~A~%" (-> obj root)) + (format #t "~2Tpart: ~A~%" (-> obj part)) + (format #t "~2Told-group: ~A~%" (-> obj old-group)) + (label cfg-4) + obj + ) + +;; definition for symbol *part-tester-name*, type string +(define *part-tester-name* (the-as string #f)) + +;; definition for method 10 of type part-tester +(defmethod deactivate part-tester ((obj part-tester)) + (if (nonzero? (-> obj part)) + (kill-and-free-particles (-> obj part)) + ) + ((method-of-type process deactivate) obj) + (none) + ) + +;; failed to figure out what this is: +(defstate part-tester-idle (part-tester) + :code (behavior () + (until #f + (let ((gp-0 (entity-by-name *part-tester-name*))) + (when gp-0 + (let ((s5-0 (-> gp-0 extra process))) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> (the-as process-drawable s5-0) root))) + (set! (-> self root trans quad) (-> (the-as process-drawable s5-0) root trans quad)) + (set! (-> self root trans quad) (-> gp-0 extra trans quad)) + ) + ) + ) + ) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + ;(let ((gp-1 (-> *part-group-id-table* 127))) + (let ((gp-1 (-> *part-group-id-table* 96))) + (let ((s5-1 (-> self root trans))) + (when (!= gp-1 (-> self old-group)) + (when (nonzero? (-> self part)) + (kill-and-free-particles (-> self part)) + (set! (-> self heap-cur) (&-> (-> self part) type)) + ) + (set! (-> self part) (create-launch-control gp-1 self)) + ) + (if (nonzero? (-> self part)) + (spawn (-> self part) (cond + ((logtest? (-> gp-1 flags) (sp-group-flag screen-space)) + *zero-vector* + ) + (else + (empty) + s5-1 + ) + ) + ) + ) + ) + (set! (-> self old-group) gp-1) + ) + (suspend) + ) + #f + (none) + ) + ) + +;; definition for function part-tester-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior part-tester-init-by-other process-drawable ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! *part-tester* (process->ppointer self)) + (go part-tester-idle) + (none) + ) + +;; definition (perm) for symbol *debug-part-dead-pool*, type dead-pool +(define-perm *debug-part-dead-pool* dead-pool (new 'debug 'dead-pool 1 #x10000 "*debug-part-dead-pool*")) + +;; definition for function start-part +;; WARN: Return type mismatch (pointer process) vs none. +(defun start-part () + (kill-by-type part-tester *active-pool*) + (process-spawn + part-tester + (if *anim-tester* + (-> *anim-tester* 0 root trans) + (target-pos 0) + ) + :from *debug-part-dead-pool* + ) + (none) + ) + +) + + + diff --git a/goal_src/jak2/engine/draw/drawable.gc b/goal_src/jak2/engine/draw/drawable.gc index 947af10092..a9641b7143 100644 --- a/goal_src/jak2/engine/draw/drawable.gc +++ b/goal_src/jak2/engine/draw/drawable.gc @@ -375,12 +375,12 @@ ; ) ;; run the sprite/particle system. - ; (if (not (paused?)) - ; (execute-part-engine) - ; ) - ; (if (logtest? (vu1-renderer-mask rn29) (-> *display* vu1-enable-user)) - ; (sprite-draw *display*) - ; ) + (if (not (paused?)) + (execute-part-engine) + ) + (if (logtest? (vu1-renderer-mask sprite) (-> *display* vu1-enable-user)) + (sprite-draw *display*) + ) ;; debug draw collision stuff before processing it. (when *debug-segment* @@ -684,7 +684,7 @@ (*pre-draw-hook* (-> s5-1 calc-buf)) (when (not (paused?)) (clear *stdcon1*) - ;(debug-reset-buffers) + (debug-reset-buffers) ;(clear! *simple-sprite-system*) ) (set! (-> s5-1 bucket-group) (dma-buffer-add-buckets (-> s5-1 calc-buf) 327)) @@ -940,23 +940,23 @@ ; (generic-vu1-init-buffers) ;; sprite texture remaps - ; (when (-> *texture-pool* update-sprites-flag) - ; (update-sprites *texture-pool*) - ; (particle-adgif-cache-flush) - ; (remap-all-particles) - ; ) + (when (-> *texture-pool* update-sprites-flag) + (update-sprites *texture-pool*) + (particle-adgif-cache-flush) + (remap-all-particles) + ) ;; texture uploads while GS is not doing anything. - ; (with-profiler 'texture *profile-texture-color* - ; (let ((s3-1 (-> 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)) - ; ) - ; (upload-textures *texture-pool*) - ; (set! (-> pp clock) s3-1) - ; ) - ; ) + (with-profiler 'texture *profile-texture-color* + (let ((s3-1 (-> 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)) + ) + (upload-textures *texture-pool*) + (set! (-> pp clock) s3-1) + ) + ) ;; more texture mapping. ; (if (-> *texture-pool* update-flag) diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index 9979c6c998..40d4e071b1 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -620,7 +620,7 @@ ;; a few things before the actor updates... - ; (set! (-> *time-of-day-context* title-updated) #f) + (set! (-> *time-of-day-context* title-updated) #f) ;; update teleport counter ; (set! *teleport* #f) @@ -630,11 +630,11 @@ ; ) ;; update particles (we're racing the DMA transfer again, do this asap) - ; (let ((gp-1 (-> pp clock))) - ; (set! (-> pp clock) (-> *display* part-clock)) - ; (process-particles) - ; (set! (-> pp clock) gp-1) - ; ) + (let ((gp-1 (-> pp clock))) + (set! (-> pp clock) (-> *display* part-clock)) + (process-particles) + (set! (-> pp clock) gp-1) + ) ;; set up VU0's VIF for collision code run by actors ; (dma-send diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day.gc b/goal_src/jak2/engine/gfx/mood/time-of-day.gc index 20a36790b7..f0137f9431 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day.gc @@ -51,10 +51,10 @@ ) ) (when (and (-> *setting-control* user-current weather) gp-0) - (let ((s5-0 (new 'stack-no-clear 'vector))) - (let ((s4-0 (new 'stack-no-clear 'vector)) - (v1-8 (-> *math-camera* inv-camera-rot vector 2)) - ) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-8 (-> *math-camera* inv-camera-rot vector 2))) (set! (-> s5-0 quad) (-> *math-camera* trans quad)) (vector-! s4-0 s5-0 (-> *math-camera* prev-trans)) (let ((f0-1 (vector-dot s4-0 v1-8))) @@ -62,13 +62,13 @@ ) ) (set! (-> s5-0 y) (-> *math-camera* trans y)) + (if (< 0.0 (-> *setting-control* user-current rain)) + (update-rain (-> *setting-control* user-current rain) s5-0 s4-0) + ) + (if (< 0.0 (-> *setting-control* user-current snow)) + (update-snow (-> *setting-control* user-current snow) s5-0 s4-0) + ) ) - (if (< 0.0 (-> *setting-control* user-current rain)) - (update-rain (the-as target (-> *setting-control* user-current rain))) - ) - (if (< 0.0 (-> *setting-control* user-current snow)) - (update-snow (the-as target (-> *setting-control* user-current snow))) - ) ) (cond ((and (>= (-> self time-of-day) 6.25) @@ -124,6 +124,7 @@ (none) ) + ;; definition for function update-counters (defbehavior update-counters time-of-day-proc () (let ((v1-2 (-> *display* bg-clock frame-counter))) diff --git a/goal_src/jak2/engine/gfx/mood/weather-part.gc b/goal_src/jak2/engine/gfx/mood/weather-part.gc index 8dcc745bb0..259d499905 100644 --- a/goal_src/jak2/engine/gfx/mood/weather-part.gc +++ b/goal_src/jak2/engine/gfx/mood/weather-part.gc @@ -7,56 +7,959 @@ ;; DECOMP BEGINS -;; all these are stubbed out +(defpartgroup group-rain-screend-drop-real + :id 1 + :flags (screen-space) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 45 :binding 41) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 46 :binding 43) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + ) + ) -(defun update-rain ((a0-0 target)) +(define group-rain-screend-drop (-> *part-group-id-table* 1)) + +(defpart 46 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 0.1) + (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) + (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 12.0) + (sp-flt spt-scalevel-x (meters 0.16666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +(defpart 43 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 20.0) + (sp-flt spt-scalevel-x (meters 0.033333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 47) + ) + ) + +;; failed to figure out what this is: +(defpart 47 + :init-specs ((sp-flt spt-scalevel-x (meters 0.004166667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.06666667) + ) + ) + +;; failed to figure out what this is: +(defpart 44 + :init-specs ((sp-flt spt-num 1.0) + (sp-int spt-rot-x 12) + (sp-flt spt-r 4096.0) + (sp-flt spt-g 3276.8) + (sp-flt spt-b 3276.8) + (sp-flt spt-fade-r 6.068148) + (sp-flt spt-fade-g 68.26667) + (sp-flt spt-fade-b 3.034074) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags distort) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 48) + ) + ) + +;; failed to figure out what this is: +(defpart 48 + :init-specs ((sp-flt spt-fade-g -5.1200004)) + ) + +;; failed to figure out what this is: +(defpart 45 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 0.1) + (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) + (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 12.0) + (sp-flt spt-scalevel-x (meters 0.26666668)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 41 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.6)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 20.0) + (sp-flt spt-scalevel-x (meters 0.06666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 49) + ) + ) + +;; failed to figure out what this is: +(defpart 49 + :init-specs ((sp-flt spt-scalevel-x (meters 0.008333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.06666667) + ) + ) + +;; failed to figure out what this is: +(defpart 42 + :init-specs ((sp-flt spt-num 1.0) + (sp-int spt-rot-x 24) + (sp-flt spt-r 12288.0) + (sp-flt spt-g 6553.6) + (sp-flt spt-b 6553.6) + (sp-flt spt-fade-r 12.136296) + (sp-flt spt-fade-g 136.53334) + (sp-flt spt-fade-b 6.068148) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags distort) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 50) + ) + ) + +;; failed to figure out what this is: +(defpart 50 + :init-specs ((sp-flt spt-fade-g -10.240001)) + ) + +;; failed to figure out what this is: +(defpartgroup group-stars + :id 2 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 51 :flags (bit6)) (sp-item 52 :flags (bit6)) (sp-item 53 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 51 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 30) (meters 20) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 256.0) + (sp-flt spt-g 256.0) + (sp-flt spt-b 256.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 60 239 1) + (sp-launcher-by-id spt-next-launcher 54) + (sp-rnd-flt spt-conerot-x (degrees -89.0) (degrees 178.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 5000)) + ) + ) + +;; failed to figure out what this is: +(defpart 54 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 29999700) (sp-launcher-by-id spt-next-launcher 55)) + ) + +;; failed to figure out what this is: +(defpart 55 + :init-specs ((sp-flt spt-fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 52 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 30) (meters 20) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 256.0) + (sp-flt spt-g 256.0) + (sp-flt spt-b 256.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 60 239 1) + (sp-launcher-by-id spt-next-launcher 54) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 59.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 2880.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 5000)) + ) + ) + +;; failed to figure out what this is: +(defpart 53 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 30) (meters 20) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 60 239 1) + (sp-launcher-by-id spt-next-launcher 54) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 29.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 5760.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 5000)) + ) + ) + +;; failed to figure out what this is: +(defpart 56 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 4.0) + (sp-rnd-flt spt-x (meters 10) (meters 10) 1.0) + (sp-rnd-flt spt-y (meters 2) (meters 14) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters -0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-flt spt-fade-a 0.85333335) + (sp-int spt-timer 1500) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 75 74 1) + (sp-launcher-by-id spt-next-launcher 57) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 180.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 58 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.0) + (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) + (sp-flt spt-y (meters 16)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters -0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-flt spt-fade-a 0.85333335) + (sp-int spt-timer 1500) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 75 74 1) + (sp-launcher-by-id spt-next-launcher 57) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 57 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1200) (sp-launcher-by-id spt-next-launcher 59)) + ) + +;; failed to figure out what this is: +(defpart 59 + :init-specs ((sp-flt spt-fade-a -0.85333335)) + ) + +;; definition for function update-snow +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun update-snow ((arg0 float) (arg1 vector) (arg2 vector)) + (let ((f0-0 (lerp-scale 0.0 1.0 (vector-length arg2) 2048.0 40960.0))) + (set! (-> *part-id-table* 58 init-specs 1 initial-valuef) (- 1.0 f0-0)) + (set! (-> *part-id-table* 56 init-specs 1 initial-valuef) (* 4.0 f0-0)) + ) + (set! (-> *part-id-table* 56 init-specs 19 initial-valuef) (+ 32768.0 (vector-y-angle arg2))) + (let ((t9-2 sp-launch-particles-var) + (a0-3 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 58)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> arg1 quad)) + (t9-2 a0-3 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-3 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 56)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> arg1 quad)) + (t9-3 a0-4 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 (none) ) -(defun update-snow ((arg target)) - (none)) +;; failed to figure out what this is: +(defpart 60 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-func spt-birth-func 'birth-func-rain) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) + (sp-flt spt-y (meters 30)) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.1) (meters -0.2) 1.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 0.0) + (sp-func spt-func 'check-drop-level-rain) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) -(set! (-> *part-group-id-table* 4) - (new 'static 'sparticle-launch-group - :length 0 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag always-draw) - :name "group-green-sun" - :launcher (new 'static 'inline-array sparticle-group-item 0) - :scale-x 1.0 - :scale-y 1.0 - :scale-z 1.0 - :bounds (new 'static 'sphere :w 286720.0) +;; failed to figure out what this is: +(defpart 61 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-func spt-birth-func 'birth-func-rain) + (sp-flt spt-num 4.0) + (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) + (sp-flt spt-y (meters 30)) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.06666667) (meters -0.033333335) 1.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 0.0) + (sp-func spt-func 'check-drop-level-rain2) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 62 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 1.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.08) (meters 0.03) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-omega 2.8672 1.6384 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -20.48 -2.7306666 1.0) + (sp-flt spt-friction 0.98) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-flt spt-userdata 0.0) + (sp-func spt-func 'check-drop-level-splash) + (sp-int-plain-rnd spt-next-time 0 99 1) + (sp-launcher-by-id spt-next-launcher 63) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-x (degrees 0.0)) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 64 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-func spt-birth-func 'birth-func-omega-normal-orient) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 0.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.2) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 10 0 0 #xc0c900 #xc02600 #xc03300 #xc02c00) + ) + (sp-func spt-func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 65 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 2.0 4.0 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-scale-y (meters 0.06) (meters 0.03) 1.0) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 3.2768 2.048 1.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-g -2.55 -2.55 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-fade-a -0.32 -0.64 1.0) + (sp-rnd-flt spt-friction 0.8 0.02 1.0) + (sp-int-plain-rnd spt-timer 100 99 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 80.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 66 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.25)) + (sp-flt spt-rot-x 40.96) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 196.0 128.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-rnd-flt spt-a 96.0 16.0 1.0) + (sp-flt spt-omega 656998.4) + (sp-flt spt-scalevel-x (meters 0.08)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -6.375) + (sp-flt spt-fade-b -13.066667) + (sp-flt spt-fade-a -2.8) + (sp-int-plain-rnd spt-timer 15 9 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; definition for function birth-func-omega-normal-orient +;; WARN: Return type mismatch int vs none. +(defun birth-func-omega-normal-orient ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-6 float) (v1-7 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> s4-0 x) (* 0.007874016 (the float (-> arg1 datab 2)))) + (set! (-> s4-0 y) 0.0) + (set! (-> s4-0 z) (* -0.007874016 (the float (-> arg1 datab 0)))) + (vector-normalize! s4-0 1.0) + (quaternion-vector-angle! gp-0 s4-0 (acos (* 0.007874016 (the float (-> arg1 datab 1))))) + (cond + ((< (-> gp-0 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 vec quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 vec quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-7 vf1) + ) ) ) + 0 + (none) + ) + ) -(set! (-> *part-group-id-table* 3) - (new 'static 'sparticle-launch-group - :length 0 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag always-draw) - :name "group-sun" - :launcher (new 'static 'inline-array sparticle-group-item 0) - :scale-x 1.0 - :scale-y 1.0 - :scale-z 1.0 - :bounds (new 'static 'sphere :w 286720.0) +;; definition for function birth-func-rain +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-rain ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-0 start-pos quad) (-> arg2 x-y-z-sx quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* s4-0) + (cond + ((>= (collide-cache-method-16 *collide-cache* s4-0) 0.0) + (set! (-> arg1 user-float) (-> s4-0 best-other-tri intersect y)) + (let ((f0-8 (+ 65536.0 (-> *math-camera* trans y)))) + (if (< (-> arg1 user-float) f0-8) + (set! (-> arg2 x-y-z-sx y) f0-8) + ) + ) + (set! (-> arg1 datab 0) (the int (* 127.0 (-> s4-0 best-other-tri normal x)))) + (set! (-> arg1 datab 1) (the int (* 127.0 (-> s4-0 best-other-tri normal y)))) + (set! (-> arg1 datab 2) (the int (* 127.0 (-> s4-0 best-other-tri normal z)))) + (set! (-> arg1 datab 3) (the-as int (-> s4-0 best-other-tri pat event))) + ) + (else + (set! (-> arg1 omega) 65280.0) + (set! (-> arg1 user-float) (+ -204800.0 (-> arg2 x-y-z-sx y))) ) ) - -(set! (-> *part-group-id-table* 5) - (new 'static 'sparticle-launch-group - :length 0 - :duration #xbb8 - :linger-duration #x5dc - :flags (sp-group-flag always-draw) - :name "group-moon" - :launcher (new 'static 'inline-array sparticle-group-item 0) - :scale-x 1.0 - :scale-y 1.0 - :scale-z 1.0 - :bounds (new 'static 'sphere :w 286720.0) + ) + (let ((f0-21 (ocean-method-11 *ocean* (the-as (inline-array vector) (-> arg2 x-y-z-sx)) #f))) + (when (!= f0-21 4095996000.0) + (when (< (-> arg1 user-float) f0-21) + (set! (-> arg1 user-float) f0-21) + (set! (-> arg1 datab 0) 0) + (set! (-> arg1 datab 1) 127) + (set! (-> arg1 datab 2) 0) + (set! (-> arg1 datab 3) 0) + 0 ) ) + ) + 0 + (none) + ) + +;; definition for function check-drop-level-rain +;; INFO: Used lq/sq +(defun check-drop-level-rain ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (let ((f30-0 (-> arg1 user-float))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (-> arg1 omega) + (set-vector! + (-> gp-0 vector 1) + (* 0.007874016 (the float (-> arg1 datab 0))) + (* 0.007874016 (the float (-> arg1 datab 1))) + (* 0.007874016 (the float (-> arg1 datab 2))) + 0.0 + ) + (set-vector! (-> gp-0 vector 2) 0.0 0.0 1.0 0.0) + (vector-cross! (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (-> gp-0 vector 2)) + (set! (-> gp-0 trans quad) (-> s4-0 quad)) + (set! (-> *part-id-table* 62 init-specs 23 initial-valuef) (vector-y-angle (-> gp-0 vector 1))) + (set! (-> *part-id-table* 62 init-specs 22 initial-valuef) (- 16384.0 (vector-x-angle (-> gp-0 vector 1)))) + (set! (-> *part-id-table* 62 init-specs 16 initial-valuef) f30-0) + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 62) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (case (-> arg1 datab 3) + ((11 10) + (sound-play "sizzle-drips") + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 66) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 65) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (else + (sound-play "dry-drips") + (set! (-> *part-id-table* 64 init-specs 10 initial-valuef) (-> arg1 omega)) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 64) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function check-drop-level-rain2 +;; WARN: Return type mismatch symbol vs none. +(defun check-drop-level-rain2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (if (< (-> arg2 y) (-> arg1 user-float)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; definition for function check-drop-level-splash +;; WARN: Return type mismatch symbol vs none. +(defun check-drop-level-splash ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-motion-blur arg0 arg1 arg2) + (if (< (-> arg2 y) (-> arg1 user-float)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; definition for function update-rain +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun update-rain ((arg0 float) (arg1 vector) (arg2 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) (-> arg2 x)) + (set! (-> v1-0 y) 0.0) + (set! (-> v1-0 z) (-> arg2 z)) + (set! (-> v1-0 w) 1.0) + (let ((gp-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 v1-0 0.0))) + (let ((t9-0 matrix-local->world) + (a0-3 #f) + ) + (let* ((s4-0 (t9-0 a0-3)) + (f28-0 (lerp-scale 122.88 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + (f30-0 (lerp-scale 2048.0 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + ) + (let ((f26-0 (lerp-scale 0.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + (f0-11 (lerp-scale 1.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + ) + (if (< 0.0 f26-0) + (send-event *camera* 'part-water-drip f26-0 f0-11) + ) + ) + (set! (-> *part-id-table* 60 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 60 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 60 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 60 init-specs 6 random-rangef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 random-rangef) f30-0) + ) + ) + (set! (-> *part-id-table* 60 init-specs 2 initial-valuef) arg0) + (set! (-> *part-id-table* 61 init-specs 2 initial-valuef) (* 4.0 arg0)) + (let ((t9-6 sp-launch-particles-var) + (a0-10 *sp-particle-system-2d*) + (a1-7 (-> *part-id-table* 60)) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> gp-1 quad)) + (t9-6 a0-10 a1-7 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-7 sp-launch-particles-var) + (a0-11 *sp-particle-system-2d*) + (a1-8 (-> *part-id-table* 61)) + (a2-6 *launch-matrix*) + ) + (set! (-> a2-6 trans quad) (-> gp-1 quad)) + (t9-7 a0-11 a1-8 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function cam-master-effect +;; WARN: Return type mismatch int vs none. +(defbehavior cam-master-effect camera-master () + (when (not (or (movie?) (>= (+ (-> self clock frame-counter) (seconds -10)) (-> self water-drip-time)))) + (set! (-> *part-id-table* 46 init-specs 1 initial-valuef) (-> self water-drip-mult)) + (set! (-> *part-id-table* 45 init-specs 1 initial-valuef) (* 0.9 (-> self water-drip-mult))) + (set! (-> *part-id-table* 43 init-specs 11 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (set! (-> *part-id-table* 44 init-specs 8 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (set! (-> *part-id-table* 41 init-specs 11 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (set! (-> *part-id-table* 42 init-specs 8 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (spawn (-> self water-drip) *zero-vector*) + ) + 0 + (none) + ) + +;; definition for function sparticle-track-sun +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-sun ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (-> arg1 key) + (let* ((s3-0 (the int (-> arg1 user-float))) + (s5-0 (math-camera-pos)) + (s4-0 (+ (the-as uint (-> *sky-work* upload-data)) (* (/ s3-0 4) 64))) + ) + (let ((v1-3 (/ s3-0 4))) + (cond + ((zero? v1-3) + (set! (-> arg2 vector 1 z) (+ 8192.0 (* 0.5 (vector-y-angle (-> (math-camera-matrix) vector 2))))) + ) + ((= v1-3 1) + (set! (-> arg2 vector 1 z) (+ -8192.0 (* 0.5 (vector-y-angle (-> (math-camera-matrix) vector 2))))) + ) + ) + ) + (let ((v1-12 (vector+float*! (new 'stack-no-clear 'vector) s5-0 (the-as vector s4-0) 4096.0))) + (set! (-> arg2 vector 0 x) (-> v1-12 x)) + (set! (-> arg2 vector 0 y) (-> v1-12 y)) + (set! (-> arg2 vector 0 z) (-> v1-12 z)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-sun + :id 3 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 67 :flags (bit6)) (sp-item 68 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 67 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2550)) + (sp-flt spt-rot-x 307200.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 2550)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 16.0) + (sp-flt spt-a 70.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpart 68 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 12000)) + (sp-flt spt-rot-x 307200.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 12000)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 80.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-green-sun + :id 4 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 69 :flags (bit6)) (sp-item 70 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 69 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1500)) + (sp-flt spt-rot-x 204800.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 1500)) + (sp-flt spt-r 16.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 32.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 4.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpart 70 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3000)) + (sp-flt spt-rot-x 204800.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 3000)) + (sp-flt spt-r 0.0) + (sp-flt spt-g 43.0) + (sp-flt spt-b 8.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 4.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-moon + :id 5 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 71 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 71 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6000)) + (sp-flt spt-rot-x 544768.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 6000)) + (sp-flt spt-r 16.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 8.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc index fc1f515a20..d26cff86b8 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc @@ -36,16 +36,20 @@ ) ;; ---sp-cpuinfo-flag -;; NOTE - for relocate +(defenum sp-cpuinfo-flag-s32 + :bitfield #t + :type int32 + :copy-entries sp-cpuinfo-flag + ) + + (declare-type sparticle-system basic) (declare-type sparticle-cpuinfo structure) (declare-type sparticle-launch-control inline-array-class) (define-extern forall-particles-with-key (function sparticle-launch-control (function sparticle-system sparticle-cpuinfo none) symbol symbol none)) -;; NOTE - for many things (define-extern *part-id-table* (array sparticle-launcher)) -;; NOTE - for sparticle-launcher (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)) (define-extern sp-kill-particle (function sparticle-system sparticle-cpuinfo symbol)) @@ -70,7 +74,8 @@ (scalevely float :offset 44) (friction float :offset-assert 96) (timer int32 :offset-assert 100) - (flags sp-cpuinfo-flag :offset-assert 104) + (flags sp-cpuinfo-flag :offset-assert 104) ;; NOTE - loaded with lw and lwu? + (flags-s32 sp-cpuinfo-flag-s32 :offset 104) (user-int32 int32 :offset-assert 108) (user-uint32 uint32 :offset 108) (user-float float :offset 108) @@ -88,7 +93,7 @@ (key-alt sparticle-launch-state :offset 132) (binding sparticle-launch-state :offset-assert 136) (data uint32 1 :offset 12) - (datab uint8 4 :offset 12) + (datab int8 4 :offset 12) (dataf float 1 :offset 12) (datac uint8 1 :offset 12) ) @@ -144,3 +149,5 @@ +(define-extern *sp-particle-system-2d* sparticle-system) +(define-extern *sp-particle-system-3d* sparticle-system) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc index 1257ff51e3..9a0b39383c 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -137,6 +137,174 @@ (declare-type sparticle-cpuinfo structure) +(defmacro sp-item (launcher + &key (fade-after 0.0) + &key (falloff-to 0.0) + &key (flags ()) + &key (period 0) + &key (length 0) + &key (offset 0) + &key (hour-mask 0) + &key (binding 0) + ) + `(new 'static 'sparticle-group-item + :launcher ,launcher + :fade-after ,fade-after + :falloff-to ,falloff-to + :flags (sp-group-item-flag ,@flags) + :period ,period + :length ,length + :offset ,offset + :hour-mask ,hour-mask + :binding ,binding + ) + ) + +(defmacro defpartgroup (name &key id &key parts &key (duration 3000) &key (linger-duration 1500) &key (flags ()) &key bounds + &key (rotate (0.0 0.0 0.0)) &key (scale (1.0 1.0 1.0))) + "define a new part group. defines a constant with the name of the group with the ID as its value" + `(begin + (defconstant ,name ,id) + (set! (-> *part-group-id-table* ,id) + (new 'static 'sparticle-launch-group + :duration ,duration + :linger-duration ,linger-duration + :flags (sp-group-flag ,@flags) + :bounds ,bounds + :name ,(symbol->string name) + :length ,(length parts) + :launcher (new 'static 'inline-array sparticle-group-item ,(length parts) ,@parts) + :rotate-x ,(car rotate) + :rotate-y ,(cadr rotate) + :rotate-z ,(caddr rotate) + :scale-x ,(car scale) + :scale-y ,(cadr scale) + :scale-z ,(caddr scale) + ) + ) + ) + ) + +(defmacro defpart (id &key (init-specs ())) + "define a new sparticle-launcher" + `(set! (-> *part-id-table* ,id) + (new 'static 'sparticle-launcher + :init-specs (new 'static 'inline-array sp-field-init-spec ,(1+ (length init-specs)) + ,@init-specs + (sp-end) + ))) + ) + +(defmacro sp-tex (field-name tex-id) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-name) :tex ,tex-id) + ) + +(defmacro sp-rnd-flt (field-name val range mult) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-valuef ,val + :random-rangef ,range + :random-multf ,mult + :flags (sp-flag float-with-rand) + ) + ) + +(defmacro sp-flt (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-valuef ,val + :random-rangef 0.0 + :random-multf 1.0 + :flags (sp-flag float-with-rand) + ) + ) + +(defmacro sp-int (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :random-range 0 + :random-mult 1 + ) + ) + +(defmacro sp-int-plain-rnd (field-name val range mult) + "For when we use plain integer, but set the randoms." + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :random-range ,range + :random-mult ,mult + ) + ) + +(defmacro sp-rnd-int (field-name val range mult) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :random-range ,range + :random-multf ,mult + :flags (sp-flag int-with-rand) + ) + ) + + +(defmacro sp-rnd-int-flt (field-name val range mult) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-valuef ,val + :random-range ,range + :random-multf ,mult + :flags (sp-flag int-with-rand) + ) + ) + +(defmacro sp-cpuinfo-flags (&rest flags) + `(new 'static 'sp-field-init-spec + :field (sp-field-id spt-flags) + :initial-value (sp-cpuinfo-flag ,@flags) + :random-mult 1 + ) + ) + +(defmacro sp-launcher-by-id (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :flags (sp-flag part-by-id) + ) + ) + +(defmacro sp-func (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :sym ,val + :flags (sp-flag from-pointer) + ) + ) + +(defmacro sp-sound (sound) + `(new 'static 'sp-field-init-spec + :field (sp-field-id spt-sound) + :sound ,sound + :flags (sp-flag plain-v2) + ) + ) + +(defmacro sp-end () + `(new 'static 'sp-field-init-spec + :field (sp-field-id spt-end) + ) + ) + +(defmacro sp-copy-from-other (field-name offset) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,offset + :random-mult 1 + :flags (sp-flag copy-from-other-field) + ) + ) ;; DECOMP BEGINS @@ -189,7 +357,7 @@ :flag-assert #xb00000010 (:methods (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec 9) - (sparticle-launcher-method-10 (_type_ string) none 10) + (setup-user-array (_type_ string) none 10) ) ) @@ -279,10 +447,10 @@ :flag-assert #x1000000070 (:methods (initialize (_type_ sparticle-launch-group process) none 9) - (sparticle-launch-control-method-10 (_type_ vector) symbol 10) + (is-visible? (_type_ vector) symbol 10) (spawn (_type_ vector) none 11) - (sparticle-launch-control-method-12 (_type_ matrix) none 12) - (sparticle-launch-control-method-13 (_type_ cspace) none 13) + (spawn-with-matrix (_type_ matrix) none 12) + (spawn-with-cspace (_type_ cspace) none 13) (kill-and-free-particles (_type_) none 14) (kill-particles (_type_) none 15) ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc index da3aabcdba..971b6ca654 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -5,6 +5,8 @@ ;; name in dgo: sparticle-launcher ;; dgos: ENGINE, GAME +;; TODO sparticle-texture-day-night vf1/vf2 issue + ;; og:ignore-form:sp-relaunch-particle-3d ;; og:ignore-form:execute-part-engine ;; og:ignore-form:sparticle-respawn-heights @@ -19,7 +21,6 @@ (define-extern sp-init-fields! (function object (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol object)) ;; TODO - mips2c (define-extern particle-adgif (function adgif-shader texture-id none)) ;; TODO - particle-adgif atomic ops, MIPS2C -(define-extern particle-adgif-callback (function adgif-shader none)) ;; TODO bad VF dependencies (define-extern sp-launch-particles-var (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none)) ;; TODO - mips2c ;; DECOMP BEGINS @@ -95,7 +96,7 @@ 0 ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(def-mips2c sp-init-fields! (function object (inline-array sp-field-init-spec) sp-field-id sp-field-id symbol object)) (deftype sp-queued-launch-particles (structure) ((sp-system sparticle-system :offset-assert 0) @@ -128,7 +129,32 @@ (kmemclose) -;; ERROR: function has no type analysis. Cannot decompile. +(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 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x9b :page #xb))) + (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-alpha :b #x1 :d #x1)) + (set! (-> arg0 clamp) (new 'static 'gs-clamp :minu #x13 :minv #x101)) + 0 + (none) + ) + (deftype particle-adgif-cache (basic) ((used int32 :offset-assert 4) @@ -159,9 +185,46 @@ (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(def-mips2c particle-adgif (function adgif-shader texture-id none)) -;; ERROR: function was not converted to expressions. Cannot decompile. + +(defun particle-adgif-callback ((arg0 adgif-shader) (arg1 texture-id)) + "Callback to update the adgif of a particle, keeping only alpha and clamp. + This is new for jak 2. + There is some funny stuff going on with vf16 - vf20, but it seems like this function just + preserves those registers (which particle-adgif likely clobbers) so this doesn't clobber + registers used by particle system, which it assumes are preserved across callbacks." + (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) + ) + ) (defun sp-queue-launch ((arg0 sparticle-system) (arg1 sparticle-launcher) (arg2 matrix)) (let ((v1-0 *sp-launch-queue*)) @@ -327,7 +390,7 @@ ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(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)) @@ -567,11 +630,83 @@ (none) ) -;; ERROR: failed type prop at 32: Could not figure out load: (set! a1 (l.w (+ gp 104))) +(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) -;; TODO stub -(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) - (none) + ;; some truly strange flag weirdness. + (let* ((a1-1 (-> arg2 flags-s32)) + (v1-1 -2) + (a0-1 (the-as uint (-> arg3 r-g-b-a x))) + (a1-2 (logand a1-1 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14))) + ) + 1 + (let ((a1-3 (sar (the-as int 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 vec 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 vec 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 sparticle-launch-control ((obj sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) @@ -695,7 +830,7 @@ (none) ) -(defmethod sparticle-launch-control-method-10 sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) (let* ((v1-0 (-> obj group)) (f0-0 (-> v1-0 bounds r)) ) @@ -726,7 +861,7 @@ ) ) -(defmethod sparticle-launch-control-method-12 sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix)) +(defmethod spawn-with-matrix sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix)) (let* ((a2-0 (-> obj origin)) (a3-0 arg0) (v1-0 (-> a3-0 vector 0 quad)) @@ -772,7 +907,7 @@ (none) ) -(defmethod sparticle-launch-control-method-13 sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace)) +(defmethod spawn-with-cspace sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace)) (let* ((v1-0 (-> obj origin)) (a3-0 (-> arg0 bone transform)) (a0-2 (-> a3-0 vector 0 quad)) @@ -818,10 +953,298 @@ (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) + (with-pp + (set! (-> obj origin trans quad) (-> arg0 quad)) + (if (not (or (is-visible? obj arg0) (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)))) + (return 0) + ) + (let ((s4-0 (the-as int (-> pp clock frame-counter))) + (s5-0 (-> obj last-spawn-time)) + ) + (let ((v1-10 (-> *display* real-frame-clock integral-frame-counter))) + (if (!= v1-10 (+ (-> obj 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! (-> obj last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) + (set! (-> obj last-spawn-time) s4-0) + (when (logtest? (-> obj group flags) (sp-group-flag use-local-clock)) + (set! s5-0 (-> obj local-clock)) + (+! (-> obj local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) + (set! s4-0 (-> obj local-clock)) + ) + (let* ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) + (v1-26 1) + (a0-13 *time-of-day*) + (s3-1 (ash v1-26 (if a0-13 + (-> a0-13 0 hours) + 0 + ) + ) + ) + ) + (if (nonzero? (-> obj matrix)) + (set! f30-0 0.0) + ) + (let ((s2-1 (-> obj length))) + (b! #t cfg-95 :delay (nop!)) + (label cfg-19) + (+! s2-1 -1) + (let* ((a3-0 (-> obj data s2-1)) + (v1-33 (-> a3-0 group-item)) + (a1-4 (-> *part-id-table* (-> v1-33 launcher))) + ) + (b! + (not (and a1-4 (nonzero? a1-4) (logtest? (-> a3-0 flags) (sp-launch-state-flags launcher-active)))) + cfg-95 + :delay (empty-form) + ) + (let* ((f1-3 (if (!= (-> v1-33 falloff-to) 0.0) + (- 1.0 (/ f30-0 (-> v1-33 falloff-to))) + 1.0 + ) + ) + (f0-5 f1-3) + ) + (let ((a0-25 sparticle-launcher)) + (b! (!= (-> a1-4 type) a0-25) cfg-94 :delay (nop!)) + ) + (b! (not (logtest? (-> v1-33 flags) (sp-group-item-flag launch-asap))) cfg-42 :delay (nop!)) + (when (not (logtest? (-> a3-0 flags) (sp-launch-state-flags particles-active))) + (set! (-> a3-0 spawn-time) (the-as uint s4-0)) + (logior! (-> a3-0 flags) (sp-launch-state-flags particles-active)) + (when (< 0.0 f0-5) + (b! (not (logtest? (-> v1-33 flags) (sp-group-item-flag bit7))) cfg-37 :delay (nop!)) + (let ((t9-3 sp-launch-particles-var)) + (b! (not (logtest? (-> v1-33 flags) (sp-group-item-flag is-3d))) cfg-35 :delay (nop!)) + (let ((a0-36 *sp-particle-system-3d*)) + (b! #t cfg-36 :delay (nop!)) + (label cfg-35) + (set! a0-36 *sp-particle-system-2d*) + (label cfg-36) + (t9-3 a0-36 a1-4 (-> obj origin) a3-0 obj f0-5) + ) + ) + (b! #t cfg-41 :delay (nop!)) + (label cfg-37) + (let ((t9-4 sp-launch-particles-var) + (a0-38 (if (logtest? (-> v1-33 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> a3-0 center quad)) + (t9-4 a0-38 a1-4 a2-4 a3-0 obj f0-5) + ) + ) + ) + (label cfg-41) + (b! #t cfg-93 :delay (nop!)) + (label cfg-42) + (when (or (logtest? s3-1 (-> v1-33 hour-mask)) + (not (or (= (-> v1-33 fade-after) 0.0) (< f30-0 (-> v1-33 fade-after)))) + ) + 0 + (goto cfg-93) + ) + (b! (nonzero? (-> v1-33 period)) cfg-59 :delay (empty-form)) + (if (not (logtest? (-> v1-33 flags) (sp-group-item-flag bit6))) + (set! f0-5 (* 0.2 (the float (- s4-0 s5-0)) f0-5)) + ) + (b! #t cfg-81 :delay (nop!)) + (label cfg-59) + 0 + 0 + (let* ((a2-5 (-> v1-33 length)) + (a0-57 (-> v1-33 period)) + (t0-10 (mod (+ (- s5-0 (the-as int (-> obj data s2-1 offset))) a0-57) (the-as int a0-57))) + (a0-58 (mod (the-as uint (+ (- s4-0 (the-as int (-> obj data s2-1 offset))) a0-57)) a0-57)) + ) + (set! f0-5 (cond + ((and (< t0-10 (the-as int a2-5)) (< (the-as int a0-58) (the-as int a2-5))) + (* 0.2 (the float (- s4-0 s5-0)) f0-5) + ) + ((and (< t0-10 (the-as int a2-5)) (>= (the-as int a0-58) (the-as int a2-5))) + (* 0.2 (the float (- a2-5 (the-as uint t0-10))) f0-5) + ) + ((and (>= t0-10 (the-as int a2-5)) (< (the-as int a0-58) (the-as int a2-5))) + (* 0.2 (the float a0-58) f0-5) + ) + (else + (when (not (logtest? (-> v1-33 flags) (sp-group-item-flag bit1))) + 0 + (goto cfg-93) + ) + (when (< (the-as uint (- s4-0 (the-as int (-> obj data s2-1 spawn-time)))) (-> v1-33 period)) + 0 + (goto cfg-93) + ) + (set! (-> obj data s2-1 offset) (- (-> v1-33 period) a0-58)) + (* 0.2 (the float (- s4-0 s5-0)) f0-5) + ) + ) + ) + ) + (label cfg-81) + (set! (-> a3-0 spawn-time) (the-as uint s4-0)) + (logior! (-> a3-0 flags) (sp-launch-state-flags particles-active)) + (when (< 0.0 f0-5) + (if (logtest? (-> v1-33 flags) (sp-group-item-flag bit6)) + (set! f0-5 f1-3) + ) + (cond + ((logtest? (-> v1-33 flags) (sp-group-item-flag bit7)) + (sp-launch-particles-var + (if (logtest? (-> v1-33 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + a1-4 + (-> obj origin) + a3-0 + obj + f0-5 + ) + ) + (else + (let ((t9-6 sp-launch-particles-var) + (a0-83 (if (logtest? (-> v1-33 flags) (sp-group-item-flag is-3d)) + *sp-particle-system-3d* + *sp-particle-system-2d* + ) + ) + (a2-22 *launch-matrix*) + ) + (set! (-> a2-22 trans quad) (-> a3-0 center quad)) + (t9-6 a0-83 a1-4 a2-22 a3-0 obj f0-5) + ) + ) + ) + ) + ) + ) + (label cfg-93) + (b! #t cfg-95 :delay (nop!)) + (label cfg-94) + (format 0 "spawn called for non-sparticle-launcher~%") + (label cfg-95) + (b! (nonzero? s2-1) cfg-19 :delay (nop!)) + ) + ) + ) + 0 + (none) + ) + ) -;; ERROR: failed type prop at 12: Could not figure out load: (set! a1 (l.wu (+ a0 132))) +(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 vector 0 quad)) + (a2-2 (-> t0-0 vector 1 quad)) + (a3-0 (-> t0-0 vector 2 quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-7 vector 0 quad) a0-5) + (set! (-> v1-7 vector 1 quad) a2-2) + (set! (-> v1-7 vector 2 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) + (sp-launch-particles-var + gp-0 + sv-96 + s3-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + (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 (-> s0-1 param3))) + ) + (zero? (logand 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)) @@ -1027,29 +1450,335 @@ (none) ) -;; ERROR: failed type prop at 12: Could not figure out load: (set! v1 (l.w (+ gp 16))) +(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 (-> 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 (+ (the-as int (-> 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) + ) -;; ERROR: failed type prop at 9: Could not figure out load: (set! v1 (l.w gp)) -;; ERROR: failed type prop at 2: Could not figure out load: (set! a0 (l.w (+ v1 20))) +(defun sparticle-respawn-timer ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (<= (-> arg1 timer) 0) + (let ((gp-0 (the-as object (-> arg1 user-float)))) + (when (nonzero? (the-as float gp-0)) + (sp-kill-particle arg0 arg1) + (let ((s5-0 (+ (the-as int (-> (the-as (array int32) gp-0) length)) -1))) + (when (< 2 s5-0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (if (zero? (-> (the-as (array int32) 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* (-> (the-as (array int32) 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) + ) -;; ERROR: failed type prop at 21: Could not figure out load: (set! a1 (l.w (+ s2 40))) -;; ERROR: Bad vector register dependency: vf1 -;; ERROR: Bad vector register dependency: vf2 +(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 (-> v1-0 (+ (max 0 (min (+ (/ t0-1 a2-1) (-> arg1 user1-int16)) (+ a0-6 -1))) 3)))) + (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) + ) -;; ERROR: failed type prop at 5: Could not figure out load: (set! a1 (l.w (+ v1 12))) +;; TODO: vf1/vf2 get set from somewhere... +(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 uint) ;; changed + (t7-3 uint) ;; changed + (s3-0 float) + (s4-0 float) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((s2-0 (the-as object (-> arg1 user-float)))) + (when (nonzero? (the-as float 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 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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? (-> (the-as (array int32) 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 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14)))) + (.mov t7-0 vf1) + (let ((v1-17 (sar (the-as int 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 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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? (-> (the-as (array int32) 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 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14)))) + (.mov t7-3 vf1) + (let ((v1-31 (sar (the-as int 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) + ) + ) -;; ERROR: Expression building failed: In sparticle-motion-blur: [OP: 78] - Floating point math attempted on invalid types: uint and float in op (-.s f2-0 f3-0). -;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] -;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] -;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] -;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] -;; ERROR: Unsupported inline assembly instruction kind - [mula.s f3, f3] -;; ERROR: Unsupported inline assembly instruction kind - [madd.s f3, f4, f4] -;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] -;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] +(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 int (-> (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) + ) -;; WARN: Return type mismatch int vs object. +(def-mips2c sparticle-motion-blur (function sparticle-system sparticle-cpuinfo vector none)) + +(defun-debug sparticle-motion-blur-old ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d)) + "Unused" + (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))) @@ -1187,6 +1916,21 @@ (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* ((a0-1 (+ (-> s5-0 length) -3)) + (a1-1 (-> s5-0 (+ (rand-vu-int-count a0-1) 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 sparticle-launcher ((obj sparticle-launcher) (arg0 sp-field-id)) @@ -1211,4 +1955,37 @@ (the-as sp-field-init-spec #f) ) -;; ERROR: failed type prop at 45: Could not figure out load: (set! v1 (l.w (+ gp 12))) +(defmethod setup-user-array sparticle-launcher ((obj sparticle-launcher) (arg0 string)) + (let ((s5-0 (get-field-spec-by-id obj (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 obj (sp-field-id spt-userdata)))) + (when (and v1-3 (= (-> v1-3 flags) (sp-flag plain-v2))) + (let ((gp-1 (the-as object (-> v1-3 initial-valuef)))) + (when (and (= (logand (the-as int gp-1) 7) 4) + (type? (the-as float gp-1) array) + (logtest? (-> (the-as (array int32) gp-1) 1) 128) + ) + (set! (-> (the-as (array int32) gp-1) 0) (/ (-> (the-as (array int32) gp-1) 0) 8)) + (set! (-> (the-as (array int32) gp-1) 1) (/ (logand (-> (the-as (array int32) gp-1) 1) 8) 8)) + (set! (-> (the-as (array int32) gp-1) 2) (/ (-> (the-as (array int32) gp-1) 2) 8)) + (set! (-> (the-as (array int32) gp-1) content-type) int32) + (dotimes (s5-1 (+ (-> (the-as (array int32) gp-1) length) -3)) + (set! (-> (the-as (array int32) gp-1) (+ s5-1 3)) + (the-as + int + (lookup-texture-id-by-name (the-as string (-> (the-as (array int32) gp-1) (+ s5-1 3))) (the-as string #f)) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc index 7ea652b686..9d0d4d7426 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc @@ -161,12 +161,113 @@ (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] +(defmacro .movn (result value check original) + `(if (!= ,check 0) + (set! ,result (the-as int ,value)) + (set! ,result (the-as int ,original)) + ) + ) + +(defmacro .movz (result value check original) + `(if (= ,check 0) + (set! ,result (the-as int ,value)) + (set! ,result (the-as int ,original)) + ) + ) + +(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)) + ) + (.movn 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)) + ) + (.movn 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)) + ) + (.movn 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)) + ) + (.movn 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)) + ) + (.movn 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)) + ) + (.movn 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 @@ -226,13 +327,13 @@ (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. - -;; ERROR: function was not converted to expressions. Cannot decompile. +(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))) - (dma-send-to-spr-no-flush (the-as uint arg0) (the-as uint arg1) (the-as uint a2-1) #t) + ;(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) @@ -240,13 +341,15 @@ (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) + ;(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. +;; unused memcpy function (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)) @@ -264,8 +367,8 @@ ) (t9-2 sv-16 (the-as pointer a1-7) sv-32) ) - (set! sv-48 (+ #x70000000 s3-0)) - (set! sv-64 (+ #x70000000 s1-0)) + (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) @@ -292,7 +395,7 @@ (defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d)) (countdown (v1-0 13) (let ((a0-4 (-> *display* clock v1-0 sparticle-data quad))) - (set! (-> (the-as vector (+ #x70000000 (* v1-0 16))) quad) a0-4) + (set! (-> (the-as vector (+ (the int (scratchpad-start)) (* v1-0 16))) quad) a0-4) ) ) (let* ((v1-3 208) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite.gc b/goal_src/jak2/engine/gfx/sprite/sprite.gc index eb843965f5..63746c113b 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite.gc @@ -6,6 +6,8 @@ ;; dgos: ENGINE, GAME ;; the sprite renderer draw 2D or 3D sprites +;; TODO: glow is commented out. +;; TODO: distort is commented out. (defenum sprite-aux-type :bitfield #f @@ -126,21 +128,6 @@ :flag-assert #x900000010 ) -(defmethod inspect sprite-aux-elem ((obj sprite-aux-elem)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj 'sprite-aux-elem) - (format #t "~1Taux-type: ~D~%" (-> obj aux-type)) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tvec-data: #~%" (-> obj vec-data)) - (format #t "~1Tgif-data: #~%" (-> obj gif-data)) - (format #t "~1Taux-data: #~%" (-> obj aux-data)) - (label cfg-4) - obj - ) - (deftype sprite-aux-list (basic) ((num-entries int32 :offset-assert 4) ;; capacity (entry int32 :offset-assert 8) ;; current size @@ -254,50 +241,6 @@ :flag-assert #x9000002a0 ) -(defmethod inspect sprite-frame-data ((obj sprite-frame-data)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj 'sprite-frame-data) - (format #t "~1Tdata[42] @ #x~X~%" (-> obj cdata)) - (format #t "~1Tcdata[16] @ #x~X~%" (-> obj cdata)) - (format #t "~1Tfdata[26] @ #x~X~%" (-> obj hmge-scale)) - (format #t "~1Txy-array[8] @ #x~X~%" (-> obj cdata)) - (format #t "~1Tst-array[4] @ #x~X~%" (-> obj st-array)) - (format #t "~1Txyz-array[4] @ #x~X~%" (-> obj xyz-array)) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tconsts: #~%" (&-> obj pfog0)) - (format #t "~1Tpfog0: ~f~%" (-> obj pfog0)) - (format #t "~1Tdeg-to-rad: ~f~%" (-> obj deg-to-rad)) - (format #t "~1Tmin-scale: ~f~%" (-> obj min-scale)) - (format #t "~1Tinv-area: ~f~%" (-> obj inv-area)) - (format #t "~1Tadgif-giftag: #~%" (-> obj adgif-giftag)) - (format #t "~1Tsprite-2d-giftag: #~%" (-> obj sprite-2d-giftag)) - (format #t "~1Tsprite-2d-giftag-2: #~%" (-> obj sprite-2d-giftag-2)) - (format #t "~1Tsincos-01: #~%" (-> obj sincos-01)) - (format #t "~1Tsincos-23: #~%" (-> obj sincos-23)) - (format #t "~1Tsincos-45: #~%" (-> obj sincos-45)) - (format #t "~1Tsincos-67: #~%" (-> obj sincos-67)) - (format #t "~1Tsincos-89: #~%" (-> obj sincos-89)) - (format #t "~1Tbasis-x: #~%" (-> obj basis-x)) - (format #t "~1Tbasis-y: #~%" (-> obj basis-y)) - (format #t "~1Tsprite-3d-giftag: #~%" (-> obj sprite-3d-giftag)) - (format #t "~1Tsprite-3d-giftag-2: #~%" (-> obj sprite-3d-giftag-2)) - (format #t "~1Tscreen-shader: #~%" (-> obj screen-shader)) - (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~1Tstq-offset: #~%" (-> obj stq-offset)) - (format #t "~1Tstq-scale: #~%" (-> obj stq-scale)) - (format #t "~1Trgba-plain: #~%" (-> obj rgba-plain)) - (format #t "~1Twarp-giftag: #~%" (-> obj warp-giftag)) - (format #t "~1Tfog-clamp: #~%" (-> obj fog-clamp)) - (format #t "~1Tfog-min: ~f~%" (-> obj fog-clamp x)) - (format #t "~1Tfog-max: ~f~%" (-> obj fog-clamp y)) - (format #t "~1Tmax-scale: ~f~%" (-> obj max-scale)) - (label cfg-4) - obj - ) - (defun sprite-setup-frame-data ((data sprite-frame-data) (tbp-offset uint)) "Build the sprite-frame-data. This should be done once per frame" (set! (-> data hmge-scale quad) (-> *math-camera* hmge-scale quad)) @@ -476,7 +419,7 @@ (none) ) -(define sprite-vu1-block (new 'static 'vu-function :length #x35f :qlength #x1b0)) +(define sprite-vu1-block (new 'static 'vu-function :length 0 :qlength 0)) ;;;;;;;;;;;;;;;;;; ;; sprite-arrays @@ -872,10 +815,10 @@ ) ;; run the distorters - (when (or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1)) - (sprite-init-distorter dma-buff) - (sprite-draw-distorters dma-buff) - ) + ; (when (or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1)) + ; (sprite-init-distorter dma-buff) + ; (sprite-draw-distorters dma-buff) + ; ) ;; first packet - set up the GS registers (let* ((v1-17 dma-buff) @@ -987,9 +930,9 @@ ;;;;;;;;;;;;;;;; ;; TODO: figure out what this is doing - (sprite-glow-init-engine dma-buff) - (sprite-glow-draw dma-buff) - (simple-sprite-system-method-10 *simple-sprite-system* dma-buff) + ; (sprite-glow-init-engine dma-buff) + ; (sprite-glow-draw dma-buff) + ; (simple-sprite-system-method-10 *simple-sprite-system* dma-buff) (let* ((v1-26 dma-buff) (pkt6 (the-as dma-packet (-> v1-26 base))) ) @@ -1007,7 +950,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id bucket-313) + (bucket-id particles) dma-bucket-begin (the-as (pointer dma-tag) a3-0) ) diff --git a/goal_src/jak2/engine/gfx/texture/texture-anim.gc b/goal_src/jak2/engine/gfx/texture/texture-anim.gc index da3faaf24b..a43785f561 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-anim.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-anim.gc @@ -6,4 +6,8 @@ ;; dgos: ENGINE, GAME ;; DECOMP BEGINS +(defun update-texture-anim ((id bucket-id)) + ;; hack! + (none) + ) diff --git a/goal_src/jak2/engine/gfx/texture/texture-h.gc b/goal_src/jak2/engine/gfx/texture/texture-h.gc index 10d6932105..1b84a20913 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-h.gc @@ -289,6 +289,7 @@ :bitfield #t (needs-log-in 8) (bit-9 9) + (backup-sprite-tex 10) ;; set when particle-setup-adgif fails texture lookup. ) ;; GS texturing/blending settings, called adgif-shader. diff --git a/goal_src/jak2/engine/gfx/texture/texture.gc b/goal_src/jak2/engine/gfx/texture/texture.gc index 2d9a7fd199..2988b7c2df 100644 --- a/goal_src/jak2/engine/gfx/texture/texture.gc +++ b/goal_src/jak2/engine/gfx/texture/texture.gc @@ -1111,6 +1111,13 @@ (set! (-> (the-as (pointer gs-reg64) a0-28) 1) (gs-reg64 texflush)) (set! (-> v1-53 base) (&+ a0-28 16)) ) + + (#when PC_PORT + (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 mode) + ) + (let ((a3-3 (-> dma-buf base))) (let ((v1-54 (the-as dma-packet (-> dma-buf base)))) (set! (-> v1-54 dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -1628,10 +1635,10 @@ ) (((tpage-category sprite)) ;; sprite skips uploads if the level isn't drawing, but otherwise uploads the whole thing. - (if (or (= (-> lev display?) 'display) (= (-> lev display?) 'actor) (= (-> lev index) 6)) - (set! (-> lev upload-size 7) - (upload-vram-pages pool (-> pool segment-common) tpage (tex-upload-mode seg0-1-2) bucket) - ) + (when (or (= (-> lev display?) 'display) (= (-> lev display?) 'actor) (= (-> lev index) 6)) + (set! (-> lev upload-size 7) + (upload-vram-pages pool (-> pool segment-common) tpage (tex-upload-mode seg0-1-2) bucket) + ) ) ) (((tpage-category map)) diff --git a/goal_src/jak2/engine/gfx/vu1-user-h.gc b/goal_src/jak2/engine/gfx/vu1-user-h.gc index d049ac2b32..b409bffe4b 100644 --- a/goal_src/jak2/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak2/engine/gfx/vu1-user-h.gc @@ -392,7 +392,7 @@ (bucket-311 311) ;; depth-cue (tex-all-sprite 312) - (bucket-313 313) ;; particles + (particles 313) ;; particles (bucket-314 314) ;; shadow (bucket-315 315) ;; effects (tex-all-warp 316) ;; tex diff --git a/goal_src/jak2/engine/target/board/board-part.gc b/goal_src/jak2/engine/target/board/board-part.gc index 75bd146ca1..37f56d67e7 100644 --- a/goal_src/jak2/engine/target/board/board-part.gc +++ b/goal_src/jak2/engine/target/board/board-part.gc @@ -7,3 +7,218 @@ ;; DECOMP BEGINS +(defpartgroup group-board-land-straight + :id 119 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 209)) + ) + +(defpartgroup group-board-quick-jump + :id 120 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 209)) + ) + +(defpart 431 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-fade-g -0.85 -1.7 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.95) + (sp-int-plain-rnd spt-timer 50 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 45.0) (degrees 90.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpartgroup group-target-board + :id 118 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 432) (sp-item 433 :flags (is-3d)) (sp-item 434)) + ) + +(defpart 432 + :init-specs ((sp-flt spt-num 3.0) + (sp-flt spt-y (meters 0.25)) + (sp-int spt-rot-x 7) + (sp-flt spt-r 2048.0) + (sp-flt spt-g 1638.4) + (sp-flt spt-b 1843.2) + (sp-flt spt-fade-b -0.08533333) + (sp-int spt-timer 40) + (sp-cpuinfo-flags distort) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +(defpart 433 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-func spt-birth-func 'birth-func-target-orient) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) + (sp-flt spt-rot-x 0.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.02) (meters -0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.1) + (sp-int spt-timer 160) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + ) + ) + +(defpart 434 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 10.24) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-flt spt-fade-r -3.0) + (sp-flt spt-fade-g -3.0) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-flt spt-friction 0.95) + (sp-int-plain-rnd spt-timer 50 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 80.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +(defpart 435 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 0.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 32.0) + (sp-rnd-flt spt-a 8.0 56.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.13333334) (meters 0.16666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.013333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.4222223) + (sp-flt spt-fade-a -0.35555556) + (sp-flt spt-accel-y 0.34133333) + (sp-flt spt-friction 0.7) + (sp-int spt-timer 180) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +(defpartgroup group-board-spin-attack + :id 117 + :duration (seconds 50) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 8) (degrees 4)) + :parts ((sp-item 436 :flags (is-3d launch-asap bit6 bit7)) + (sp-item 437 :flags (is-3d launch-asap bit6 bit7)) + (sp-item 438 :flags (launch-asap bit6)) + ) + ) + +(defpart 438 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 0.5) 1.0) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -0.4) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 12288.0) + (sp-func spt-func 'sparticle-track-root) + ) + ) + +(defpart 437 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 0)) + (sp-flt spt-scale-x (meters 12)) + (sp-flt spt-rot-x 0.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 9)) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -0.086666666)) + (sp-flt spt-scalevel-y (meters -0.09)) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +(defpart 436 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 0)) + (sp-flt spt-scale-x (meters 1.4)) + (sp-flt spt-rot-x 0.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 0.9)) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -3.1875) + (sp-int spt-timer 20) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) diff --git a/scripts/gsrc/code_retention/all_types_retention.py b/scripts/gsrc/code_retention/all_types_retention.py index dc436bc8bc..4b791d8607 100644 --- a/scripts/gsrc/code_retention/all_types_retention.py +++ b/scripts/gsrc/code_retention/all_types_retention.py @@ -71,8 +71,10 @@ def update_all_blocks(game_name, block_dict): final_lines.append(line) block_id = line.split(";; +++")[1] # Look to see if we actually have that block + found_block = False for block in blocks: if block.block_id == block_id: + found_block = True # if we found the block, write the data, then proceed ahead until the end for block_line in block.data: final_lines.append(block_line) @@ -84,6 +86,8 @@ def update_all_blocks(game_name, block_dict): i = i + 1 break break + if not found_block: + i = i + 1 else: final_lines.append(line) i = i + 1 diff --git a/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc b/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc index ad86fdc381..4a626bf691 100644 --- a/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/collectables-part_REF.gc @@ -256,8 +256,8 @@ ;; failed to figure out what this is: (defpartgroup group-eco-blue-collect :id 43 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 11 :flags (launch-asap) :binding 12) (sp-item 12 :flags (start-dead launch-asap) :binding 13) @@ -737,8 +737,8 @@ ;; failed to figure out what this is: (defpartgroup group-eco-red-collect :id 49 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 168 :flags (launch-asap) :binding 169) @@ -1330,8 +1330,8 @@ ;; failed to figure out what this is: (defpartgroup group-eco-yellow-collect :id 57 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 199 :flags (launch-asap) :binding 200) (sp-item 200 :flags (start-dead launch-asap) :binding 201) @@ -1675,8 +1675,8 @@ ;; failed to figure out what this is: (defpartgroup group-eco-green-pill-collect :id 60 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 216 :flags (launch-asap) :binding 217) (sp-item 217 :flags (start-dead launch-asap) :binding 218) @@ -1695,8 +1695,8 @@ ;; failed to figure out what this is: (defpartgroup group-eco-green-collect :id 61 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 216 :flags (launch-asap) :binding 219) (sp-item 219 :flags (start-dead launch-asap) :binding 218) @@ -2228,8 +2228,8 @@ ;; failed to figure out what this is: (defpartgroup group-green-collect :id 66 - :duration 5 - :linger-duration 1200 + :duration (seconds 0.017) + :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 241) (sp-item 242) (sp-item 243)) @@ -2308,8 +2308,8 @@ ;; failed to figure out what this is: (defpartgroup group-blue-collect :id 67 - :duration 5 - :linger-duration 1200 + :duration (seconds 0.017) + :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 246) (sp-item 247) (sp-item 248)) @@ -2388,8 +2388,8 @@ ;; failed to figure out what this is: (defpartgroup group-yellow-collect :id 68 - :duration 5 - :linger-duration 1200 + :duration (seconds 0.017) + :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 249) (sp-item 250) (sp-item 251)) @@ -2478,8 +2478,8 @@ ;; failed to figure out what this is: (defpartgroup group-red-collect :id 69 - :duration 5 - :linger-duration 1200 + :duration (seconds 0.017) + :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 252) (sp-item 253) (sp-item 254)) diff --git a/test/decompiler/reference/jak1/engine/game/crates_REF.gc b/test/decompiler/reference/jak1/engine/game/crates_REF.gc index 366eccce74..fcdfb56195 100644 --- a/test/decompiler/reference/jak1/engine/game/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/crates_REF.gc @@ -274,7 +274,7 @@ ;; failed to figure out what this is: (defpartgroup group-crate-explode :id 71 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 286) (sp-item 288)) @@ -283,7 +283,7 @@ ;; failed to figure out what this is: (defpartgroup group-crate-steel-explode :id 72 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 281) (sp-item 283) (sp-item 285) (sp-item 288) (sp-item 288) (sp-item 288)) @@ -292,7 +292,7 @@ ;; failed to figure out what this is: (defpartgroup group-dark-eco-box-explosion :id 73 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) @@ -1296,8 +1296,8 @@ ;; failed to figure out what this is: (defpartgroup group-buzzer-crate :id 74 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 302)) ) diff --git a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc index 3c2a0fb7a3..b489fa5e17 100644 --- a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc @@ -172,8 +172,8 @@ ;; failed to figure out what this is: (defpartgroup group-blue-hit-ground-effect :id 70 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 261) (sp-item 262) (sp-item 263 :flags (is-3d)) (sp-item 264) (sp-item 265 :flags (is-3d))) ) diff --git a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc index 9c555c4bb5..715a0a832d 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc @@ -193,7 +193,7 @@ ;; failed to figure out what this is: (defpartgroup group-yellow-eco-fireball :id 102 - :duration 300 + :duration (seconds 1) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 349 :flags (launch-asap) :binding 350) (sp-item 350 :flags (start-dead launch-asap) :binding 351) @@ -340,7 +340,7 @@ ;; failed to figure out what this is: (defpartgroup group-part-yellow-eco-fireball-launcher :id 103 - :duration 600 + :duration (seconds 2) :bounds (static-bspherem 0 0 0 6) :parts ((sp-item 355 :flags (launch-asap)) (sp-item 356 :flags (bit1) :period 630 :length 15) @@ -519,7 +519,7 @@ ;; failed to figure out what this is: (defpartgroup group-part-yellow-eco-fireball-hit :id 104 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) :parts ((sp-item 2059 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc b/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc index 5a8da87f97..7a1b584ec3 100644 --- a/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/water/water_REF.gc @@ -273,7 +273,7 @@ ;; failed to figure out what this is: (defpartgroup group-part-water-splash :id 40 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) @@ -312,7 +312,7 @@ ;; failed to figure out what this is: (defpartgroup group-part-water-splash-small :id 41 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) diff --git a/test/decompiler/reference/jak1/engine/target/target-part_REF.gc b/test/decompiler/reference/jak1/engine/target/target-part_REF.gc index d6e4027984..72051c2c6b 100644 --- a/test/decompiler/reference/jak1/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-part_REF.gc @@ -193,7 +193,7 @@ ;; failed to figure out what this is: (defpartgroup group-target-hit :id 1 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 56) (sp-item 57)) @@ -247,8 +247,8 @@ ;; failed to figure out what this is: (defpartgroup group-red-eco-strike-ground :id 2 - :duration 10 - :linger-duration 450 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 59) (sp-item 60)) ) @@ -310,8 +310,8 @@ ;; failed to figure out what this is: (defpartgroup group-red-eco-spinkick :id 3 - :duration 10 - :linger-duration 450 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 62) (sp-item 63) (sp-item 64)) ) @@ -391,8 +391,8 @@ ;; failed to figure out what this is: (defpartgroup group-spin-hit :id 4 - :duration 10 - :linger-duration 450 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 65) (sp-item 66)) ) @@ -400,8 +400,8 @@ ;; failed to figure out what this is: (defpartgroup group-punch-hit :id 5 - :duration 10 - :linger-duration 450 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 65) (sp-item 66)) ) @@ -456,8 +456,8 @@ ;; failed to figure out what this is: (defpartgroup group-smack-surface :id 6 - :duration 10 - :linger-duration 450 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 68) (sp-item 69) @@ -578,8 +578,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-sand :id 8 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 73) (sp-item 74) (sp-item 75)) ) @@ -661,8 +661,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-dirt :id 575 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2371) (sp-item 2372) (sp-item 2370)) ) @@ -744,8 +744,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-snow :id 9 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 76) (sp-item 77) (sp-item 78)) ) @@ -827,8 +827,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-ice :id 580 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 76) (sp-item 77) (sp-item 78)) ) @@ -836,8 +836,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-grass :id 10 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 79) (sp-item 80) (sp-item 81)) ) @@ -920,8 +920,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-wood :id 11 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 82) (sp-item 83)) ) @@ -979,8 +979,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-crwood :id 12 - :duration 5 - :linger-duration 750 + :duration (seconds 0.017) + :linger-duration (seconds 2.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 82) (sp-item 83) (sp-item 84) (sp-item 84)) ) @@ -988,8 +988,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-stone :id 13 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 85) (sp-item 86)) ) @@ -1047,8 +1047,8 @@ ;; failed to figure out what this is: (defpartgroup group-land-poof-pcmetal :id 581 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2373) (sp-item 2374)) ) @@ -1104,8 +1104,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-stone :id 14 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 87)) ) @@ -1113,8 +1113,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-stone :id 15 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 87)) ) @@ -1142,8 +1142,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-snow :id 582 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2375) (sp-item 2376 :flags (is-3d))) ) @@ -1151,8 +1151,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-snow :id 583 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2375)) ) @@ -1160,8 +1160,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-footprint-snow :id 584 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2376 :flags (is-3d))) ) @@ -1207,8 +1207,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-ice :id 585 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2375)) ) @@ -1216,8 +1216,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-ice :id 586 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2375)) ) @@ -1225,8 +1225,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-crwood :id 16 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 89) (sp-item 89) (sp-item 84)) ) @@ -1234,8 +1234,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-crwood :id 17 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 88)) ) @@ -1279,8 +1279,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-wood :id 18 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 89)) ) @@ -1288,8 +1288,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-wood :id 19 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 89)) ) @@ -1317,8 +1317,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-pcmetal :id 587 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2377)) ) @@ -1326,8 +1326,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-pcmetal :id 588 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2377)) ) @@ -1355,8 +1355,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-grass :id 20 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 92) (sp-item 93 :flags (is-3d))) ) @@ -1364,8 +1364,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-grass :id 21 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 92)) ) @@ -1373,8 +1373,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-footprint-grass :id 22 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 93 :flags (is-3d))) ) @@ -1420,8 +1420,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-sand :id 23 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 88) (sp-item 94 :flags (is-3d))) ) @@ -1429,8 +1429,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-sand :id 24 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 88)) ) @@ -1438,8 +1438,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-footprint-sand :id 25 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 94 :flags (is-3d))) ) @@ -1485,8 +1485,8 @@ ;; failed to figure out what this is: (defpartgroup group-run-poof-dirt :id 576 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2378)) ) @@ -1494,8 +1494,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-poof-dirt :id 577 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2378)) ) @@ -1503,8 +1503,8 @@ ;; failed to figure out what this is: (defpartgroup group-just-footprint-dirt :id 578 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2379 :flags (is-3d))) ) @@ -1655,8 +1655,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-sand :id 26 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 100) (sp-item 101)) ) @@ -1713,8 +1713,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-dirt :id 579 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2380) (sp-item 2381)) ) @@ -1771,8 +1771,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-grass :id 27 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 102) (sp-item 103)) ) @@ -1830,8 +1830,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-stone :id 28 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 104)) ) @@ -1864,8 +1864,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-pcmetal :id 589 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2382)) ) @@ -1898,8 +1898,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-snow :id 590 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2383)) ) @@ -1932,8 +1932,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-ice :id 591 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2383)) ) @@ -1941,8 +1941,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-wood :id 29 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 105)) ) @@ -1975,8 +1975,8 @@ ;; failed to figure out what this is: (defpartgroup group-slide-poof-crwood :id 30 - :duration 5 - :linger-duration 750 + :duration (seconds 0.017) + :linger-duration (seconds 2.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 105)) ) @@ -2065,7 +2065,7 @@ ;; failed to figure out what this is: (defpartgroup group-dark-eco-death :id 31 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) @@ -2110,8 +2110,8 @@ ;; failed to figure out what this is: (defpartgroup group-lava-death :id 32 - :duration 75 - :linger-duration 600 + :duration (seconds 0.25) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2003) (sp-item 2004) (sp-item 2005) (sp-item 2006)) ) @@ -2119,8 +2119,8 @@ ;; failed to figure out what this is: (defpartgroup group-burn-death :id 708 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2003)) ) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc index e2272a93af..5207545e12 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -458,7 +458,7 @@ ;; failed to figure out what this is: (defpartgroup group-beach-harvester-rock-explosion :id 156 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 543 :period 1500 :length 5) diff --git a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc index 755000612c..1708393607 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc @@ -13,7 +13,7 @@ ;; failed to figure out what this is: (defpartgroup group-beach-rocks-start :id 553 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2340 :period 75 :length 10) @@ -146,7 +146,7 @@ ;; failed to figure out what this is: (defpartgroup group-beach-rocks-land :id 555 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2342 :period 900 :length 40) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc index 2cd9576e5a..22e1bc83ae 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc @@ -414,8 +414,8 @@ ;; failed to figure out what this is: (defpartgroup group-citb-generator-break :id 598 - :duration 600 - :linger-duration 600 + :duration (seconds 2) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) :parts ((sp-item 2423 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/common/dark-eco-pool_REF.gc b/test/decompiler/reference/jak1/levels/common/dark-eco-pool_REF.gc index 9b6712a26e..390ac93a87 100644 --- a/test/decompiler/reference/jak1/levels/common/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/dark-eco-pool_REF.gc @@ -185,8 +185,8 @@ ;; failed to figure out what this is: (defpartgroup group-dark-eco-pool-nasty :id 445 - :duration 600 - :linger-duration 600 + :duration (seconds 2) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2056 :fade-after (meters 100) :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc b/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc index ba6a2ed6ef..5f854327e3 100644 --- a/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/sharkey_REF.gc @@ -6,8 +6,8 @@ ;; failed to figure out what this is: (defpartgroup group-sharkey-splash :id 106 - :duration 120 - :linger-duration 780 + :duration (seconds 0.4) + :linger-duration (seconds 2.6) :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) diff --git a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc index 7ee6dddc9a..e71ed56c87 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc @@ -128,7 +128,7 @@ ;; failed to figure out what this is: (defpartgroup group-green-eco-lurker-death :id 643 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2585 :fade-after (meters 100) :period 600 :length 5 :binding 2583) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-part_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-part_REF.gc index 6328ac4d86..2eda1d430d 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-part_REF.gc @@ -592,7 +592,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-darkecobomb-glow :id 639 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2753) @@ -694,7 +694,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-darkecobomb-tick :id 663 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2756) (sp-item 2757) (sp-item 2758) (sp-item 2759)) @@ -1123,7 +1123,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-greenshot :id 664 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2769 :binding 2766) @@ -1293,7 +1293,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-redshot-charge :id 646 - :duration 900 + :duration (seconds 3) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2699) (sp-item 2700) (sp-item 2701)) ) @@ -1472,7 +1472,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-redshot-body :id 665 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2709) (sp-item 2710) (sp-item 2711)) @@ -1539,7 +1539,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-redshot-warning :id 647 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2712) (sp-item 2713) (sp-item 2714 :period 45 :length 5)) @@ -1644,7 +1644,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-redshot-test :id 679 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2772)) @@ -1996,7 +1996,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-yellowshot-charge :id 651 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2811) (sp-item 2812) (sp-item 2813)) @@ -2074,7 +2074,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-yellowshot :id 652 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2815) (sp-item 2816) (sp-item 2817) (sp-item 2818) (sp-item 2819)) @@ -3222,7 +3222,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-blue-claw-glow :id 674 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2324)) @@ -3231,7 +3231,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-green-claw-glow :id 675 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2324)) @@ -3240,7 +3240,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-red-claw-glow :id 676 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2324)) @@ -3249,7 +3249,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-yellow-claw-glow :id 677 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2324)) diff --git a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss-part_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss-part_REF.gc index d7349af379..653d7dbd2a 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss-part_REF.gc @@ -135,7 +135,7 @@ ;; failed to figure out what this is: (defpartgroup group-target-white-eco-ground :id 699 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2921) @@ -294,7 +294,7 @@ ;; failed to figure out what this is: (defpartgroup group-target-white-eco-joints :id 700 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2929) (sp-item 2930)) @@ -430,7 +430,7 @@ ;; failed to figure out what this is: (defpartgroup group-target-white-eco-hand-glow :id 701 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2892)) @@ -463,7 +463,7 @@ ;; failed to figure out what this is: (defpartgroup group-target-white-eco-hand-shot :id 702 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2893) (sp-item 2935)) @@ -514,7 +514,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-joints :id 703 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2936 :period 36 :length 5) @@ -601,7 +601,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-explode :id 696 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2939 :period 1200 :length 20 :binding 2938) @@ -832,7 +832,7 @@ ;; failed to figure out what this is: (defpartgroup group-robotboss-splash :id 704 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2949) (sp-item 2950)) @@ -897,7 +897,7 @@ ;; failed to figure out what this is: (defpartgroup group-bigdoor-open :id 698 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2952 :flags (is-3d)) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc index 110bfa711c..76bd9f6ecb 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc @@ -29,7 +29,7 @@ ;; failed to figure out what this is: (defpartgroup group-balloon :id 227 - :duration 5 + :duration (seconds 0.017) :bounds (static-bspherem 0 0 0 15) :parts ((sp-item 1006) (sp-item 1007) (sp-item 1008)) ) @@ -429,7 +429,7 @@ ;; failed to figure out what this is: (defpartgroup group-dark-cluster-explosion :id 228 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2100 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/flut_common/flut-part_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/flut-part_REF.gc index b8e8b5baa1..bd28547286 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/flut-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/flut-part_REF.gc @@ -71,8 +71,8 @@ ;; failed to figure out what this is: (defpartgroup group-flut-attack-strike-ground :id 121 - :duration 10 - :linger-duration 450 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 749) (sp-item 750)) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc index a27326e29a..500926b6a0 100644 --- a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc @@ -64,7 +64,7 @@ ;; failed to figure out what this is: (defpartgroup group-darkvine-puffs :id 175 - :duration 150 + :duration (seconds 0.5) :flags (use-local-clock) :bounds (static-bspherem 0 2 0 3) :parts ((sp-item 800) (sp-item 801) (sp-item 802)) diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index 15bf462658..6c42b520ad 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -37,8 +37,8 @@ ;; failed to figure out what this is: (defpartgroup group-bad-fish :id 177 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 828) (sp-item 2013)) @@ -92,8 +92,8 @@ ;; failed to figure out what this is: (defpartgroup group-normal-fish :id 178 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2001)) @@ -121,8 +121,8 @@ ;; failed to figure out what this is: (defpartgroup group-fish-collect :id 179 - :duration 5 - :linger-duration 1200 + :duration (seconds 0.017) + :linger-duration (seconds 4) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 830) (sp-item 831)) diff --git a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc index 22e186ec17..c10b0f1bb0 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc @@ -51,7 +51,7 @@ ;; failed to figure out what this is: (defpartgroup group-jungle-blue-eco-room-activate :id 190 - :duration 900 + :duration (seconds 3) :bounds (static-bspherem 0 -6 0 8) :parts ((sp-item 903) (sp-item 903) (sp-item 904 :flags (bit1) :period 1200 :length 15)) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc index 6e55b7599f..8fc991d8ac 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc @@ -1283,7 +1283,7 @@ ;; failed to figure out what this is: (defpartgroup group-lavaballoon :id 543 - :duration 5 + :duration (seconds 0.017) :bounds (static-bspherem 0 0 0 15) :parts ((sp-item 1987) (sp-item 1988) (sp-item 1989)) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc index 9bfd424253..3bcd3eef35 100644 --- a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc @@ -86,7 +86,7 @@ ;; failed to figure out what this is: (defpartgroup group-dark-crystal-gnd-explode :id 322 - :duration 75 + :duration (seconds 0.25) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) :parts ((sp-item 2153 :fade-after (meters 100) :period 600 :length 5 :binding 296) @@ -278,8 +278,8 @@ ;; failed to figure out what this is: (defpartgroup group-dark-crystal-water-explode :id 323 - :duration 75 - :linger-duration 12000 + :duration (seconds 0.25) + :linger-duration (seconds 40) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) :parts ((sp-item 2159 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc index 395eea89e9..154aba5395 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc @@ -72,8 +72,8 @@ ;; failed to figure out what this is: (defpartgroup group-spider-egg-hatches :id 324 - :duration 5 - :linger-duration 900 + :duration (seconds 0.017) + :linger-duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 2018 :fade-after (meters 50) :falloff-to (meters 50)) @@ -146,8 +146,8 @@ ;; failed to figure out what this is: (defpartgroup group-spider-egg-explodes :id 325 - :duration 5 - :linger-duration 375 + :duration (seconds 0.017) + :linger-duration (seconds 1.25) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 2074 :fade-after (meters 50) :falloff-to (meters 50))) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc index 5fa579f1fc..3dcc5dc1b4 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc @@ -24,7 +24,7 @@ ;; failed to figure out what this is: (defpartgroup group-mother-spider-proj-fly :id 326 - :duration 300 + :duration (seconds 1) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 718 :flags (launch-asap) :binding 716) (sp-item 716 :flags (start-dead) :binding 717) @@ -153,7 +153,7 @@ ;; failed to figure out what this is: (defpartgroup group-mother-spider-proj-hit :id 327 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 722) (sp-item 723) (sp-item 724)) @@ -232,7 +232,7 @@ ;; failed to figure out what this is: (defpartgroup group-mother-spider-proj-die :id 328 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 722)) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index 1bb6efdb54..0635101083 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -6,8 +6,8 @@ ;; failed to figure out what this is: (defpartgroup group-balloonlurker-pilot-death :id 203 - :duration 5 - :linger-duration 600 + :duration (seconds 0.017) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2015)) @@ -34,7 +34,7 @@ ;; failed to figure out what this is: (defpartgroup group-balloonlurker-mine-explosion :id 204 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) :parts ((sp-item 964 :period 1200 :length 30) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc index 26b0492c85..ad0d9af80a 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc @@ -8,8 +8,8 @@ ;; failed to figure out what this is: (defpartgroup group-keg-bounce :id 197 - :duration 10 - :linger-duration 600 + :duration (seconds 0.035) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2014 :fade-after (meters 100) :falloff-to (meters 100))) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc index 7b0aa84451..a5eb12541a 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc @@ -158,7 +158,7 @@ ;; failed to figure out what this is: (defpartgroup group-misty-bone-01 :id 192 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) :parts ((sp-item 914 :period 780 :length 15) @@ -404,7 +404,7 @@ ;; failed to figure out what this is: (defpartgroup group-misty-bone-03 :id 193 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) :parts ((sp-item 914 :period 780 :length 15) @@ -586,7 +586,7 @@ ;; failed to figure out what this is: (defpartgroup group-misty-bone-02 :id 194 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) :parts ((sp-item 914 :period 780 :length 15) @@ -768,7 +768,7 @@ ;; failed to figure out what this is: (defpartgroup group-misty-bone-07 :id 195 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 24) :parts ((sp-item 914 :period 780 :length 15) diff --git a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc index ff544708e6..c718c63f9e 100644 --- a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc @@ -134,7 +134,7 @@ ;; failed to figure out what this is: (defpartgroup group-quicksandlurker-pre-missile :id 199 - :duration 5 + :duration (seconds 0.017) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 2483)) ) @@ -170,7 +170,7 @@ ;; failed to figure out what this is: (defpartgroup group-quicksandlurker-missile-impact :id 200 - :duration 10 + :duration (seconds 0.035) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 2484) (sp-item 2485) (sp-item 2486)) ) @@ -248,7 +248,7 @@ ;; failed to figure out what this is: (defpartgroup group-quicksandlurker-hide :id 201 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) @@ -273,7 +273,7 @@ ;; failed to figure out what this is: (defpartgroup group-quicksandlurker-popup :id 202 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 -12 0 14) :parts ((sp-item 124 :flags (is-3d) :period 900 :length 63) diff --git a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc index 54b6076315..44d17bda32 100644 --- a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc @@ -180,7 +180,7 @@ ;; failed to figure out what this is: (defpartgroup group-evilsib-appear :id 557 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2345 :period 1500 :length 20 :offset 1500) @@ -849,7 +849,7 @@ ;; failed to figure out what this is: (defpartgroup group-sequenceC-glowing-can :id 560 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2298)) @@ -880,7 +880,7 @@ ;; failed to figure out what this is: (defpartgroup group-sequenceC-exploding-can :id 561 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2785 :period 1800 :length 5) @@ -1070,7 +1070,7 @@ ;; failed to figure out what this is: (defpartgroup group-sequenceC-dark-splash :id 562 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 295 :fade-after (meters 100) :period 600 :length 5 :binding 296) @@ -1115,8 +1115,8 @@ ;; failed to figure out what this is: (defpartgroup group-sequenceC-blow-dust :id 681 - :duration 5 - :linger-duration 900 + :duration (seconds 0.017) + :linger-duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2790)) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc index 6aa3bc939a..b028c75d5c 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc @@ -172,7 +172,7 @@ ;; failed to figure out what this is: (defpartgroup group-tntbarrel-explosion :id 474 - :duration 600 + :duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2079 :period 600 :length 5) @@ -1566,7 +1566,7 @@ ;; failed to figure out what this is: (defpartgroup group-shortcut-boulder-explosion :id 475 - :duration 300 + :duration (seconds 1) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 2149 :period 1500 :length 5) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc index 6f8042e6e7..09871083f1 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc @@ -4,8 +4,8 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboss-column-break :id 464 - :duration 1500 - :linger-duration 3000 + :duration (seconds 5) + :linger-duration (seconds 10) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2193 :period 1500 :length 5) @@ -144,8 +144,8 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboss-lava-splash :id 465 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2023)) @@ -174,8 +174,8 @@ ;; failed to figure out what this is: (defpartgroup group-ogre-bridge-splash :id 466 - :duration 75 - :linger-duration 600 + :duration (seconds 0.25) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2108) (sp-item 2109) (sp-item 2110) (sp-item 2111)) @@ -297,8 +297,8 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboss-boulder-grow :id 468 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 12) :parts ((sp-item 2201) (sp-item 2202) (sp-item 2203) (sp-item 2204)) @@ -459,8 +459,8 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboss-pre-missile :id 470 - :duration 150 - :linger-duration 600 + :duration (seconds 0.5) + :linger-duration (seconds 2) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 2079 :period 600 :length 5) @@ -506,7 +506,7 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboss-missile-impact :id 471 - :duration 300 + :duration (seconds 1) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) :parts ((sp-item 2079 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc index 1eab334a4f..31e55fa18a 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc @@ -1000,8 +1000,8 @@ ;; failed to figure out what this is: (defpartgroup group-racer-explode :id 116 - :duration 300 - :linger-duration 3000 + :duration (seconds 1) + :linger-duration (seconds 10) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 2279 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc index c1346e5edf..de95a4b493 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc @@ -1103,7 +1103,7 @@ ;; failed to figure out what this is: (defpartgroup group-peeper :id 456 - :duration 5 + :duration (seconds 0.017) :bounds (static-bspherem 0 0 0 15) :parts ((sp-item 1768) (sp-item 1769 :period 120 :length 30) (sp-item 1770 :period 120 :length 60)) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc index 5aa2303f2a..3d4dbc1757 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc @@ -517,7 +517,7 @@ ;; failed to figure out what this is: (defpartgroup group-dark-plant :id 455 - :duration 42 + :duration (seconds 0.14) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 15) :parts ((sp-item 1764) (sp-item 2356)) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc index 9fee54e139..74570d1323 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc @@ -46,7 +46,7 @@ ;; failed to figure out what this is: (defpartgroup group-rolling-ring :id 457 - :linger-duration 0 + :linger-duration (seconds 0) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1773 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1774 :fade-after (meters 80)) @@ -137,8 +137,8 @@ ;; failed to figure out what this is: (defpartgroup group-rolling-spawn-ring :id 458 - :duration 5 - :linger-duration 141 + :duration (seconds 0.017) + :linger-duration (seconds 0.47) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1777 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1778 :flags (is-3d)) @@ -249,8 +249,8 @@ ;; failed to figure out what this is: (defpartgroup group-rolling-explode-ring :id 459 - :duration 5 - :linger-duration 150 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1783 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1784 :flags (is-3d))) ) @@ -320,7 +320,7 @@ ;; failed to figure out what this is: (defpartgroup group-rolling-ring-blue :id 460 - :linger-duration 0 + :linger-duration (seconds 0) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1785 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1786 :fade-after (meters 80)) @@ -411,8 +411,8 @@ ;; failed to figure out what this is: (defpartgroup group-rolling-spawn-ring-blue :id 461 - :duration 5 - :linger-duration 141 + :duration (seconds 0.017) + :linger-duration (seconds 0.47) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1789 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1790 :flags (is-3d)) @@ -523,8 +523,8 @@ ;; failed to figure out what this is: (defpartgroup group-rolling-explode-ring-blue :id 462 - :duration 5 - :linger-duration 150 + :duration (seconds 0.017) + :linger-duration (seconds 0.5) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1795 :fade-after (meters 100) :falloff-to (meters 100)) (sp-item 1796 :flags (is-3d))) ) diff --git a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc index 92f80a00b9..fbfb02cc1a 100644 --- a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc @@ -235,8 +235,8 @@ ;; failed to figure out what this is: (defpartgroup group-ice-cube-foot-puff :id 567 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2325) (sp-item 2326) (sp-item 2327)) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc index 8a254f5e1a..01fd9e4f09 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -171,7 +171,7 @@ ;; failed to figure out what this is: (defpartgroup group-snow-yellow-eco-room-activate :id 511 - :duration 900 + :duration (seconds 3) :bounds (static-bspherem 0 -6 0 8) :parts ((sp-item 1994) (sp-item 1994) (sp-item 1995 :flags (bit1) :period 1200 :length 15)) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc index e70768aee4..cc337c5f48 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc @@ -291,7 +291,7 @@ ;; failed to figure out what this is: (defpartgroup group-ram-boss-proj-fly :id 522 - :duration 300 + :duration (seconds 1) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 1910 :flags (launch-asap) :binding 1908) (sp-item 1908 :flags (start-dead) :binding 1909) @@ -420,7 +420,7 @@ ;; failed to figure out what this is: (defpartgroup group-ram-boss-proj-hit :id 523 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1914) (sp-item 1915) (sp-item 1916)) @@ -497,7 +497,7 @@ ;; failed to figure out what this is: (defpartgroup group-ram-boss-proj-die :id 524 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1914)) @@ -849,8 +849,8 @@ ;; failed to figure out what this is: (defpartgroup group-ram-boss-foot-puff :id 574 - :duration 5 - :linger-duration 450 + :duration (seconds 0.017) + :linger-duration (seconds 1.5) :bounds (static-bspherem 0 0 0 2) :parts ((sp-item 2367) (sp-item 2368) (sp-item 2369)) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc index d495d959ff..01e3256ba3 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc @@ -170,7 +170,7 @@ ;; failed to figure out what this is: (defpartgroup group-exit-chamber-ripples :id 620 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2512 :flags (is-3d))) diff --git a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc index 8f2377ac83..470c97cf9f 100644 --- a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc @@ -327,7 +327,7 @@ ;; failed to figure out what this is: (defpartgroup group-kermit-pulse-impact :id 301 - :duration 5 + :duration (seconds 0.017) :bounds (static-bspherem 0 0 0 3) :parts ((sp-item 1371) (sp-item 1372)) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc index de1da7506d..7b0384f376 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc @@ -10,7 +10,7 @@ ;; failed to figure out what this is: (defpartgroup group-swamp-spike-up :id 289 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) @@ -106,7 +106,7 @@ ;; failed to figure out what this is: (defpartgroup group-swamp-spike-down :id 290 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1325 :fade-after (meters 120) :falloff-to (meters 120)) @@ -578,7 +578,7 @@ ;; failed to figure out what this is: (defpartgroup group-swamp-rock-explosion :id 291 - :duration 300 + :duration (seconds 1) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 8) :parts ((sp-item 1330 :period 1500 :length 5) diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc index 3df39f4bc1..b401f7565e 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc @@ -6,7 +6,7 @@ ;; failed to figure out what this is: (defpartgroup group-swamp-rat-nest-a-explosion :id 292 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) :parts ((sp-item 1334) (sp-item 1335) (sp-item 1336) (sp-item 1337) (sp-item 1338) (sp-item 1339)) @@ -15,7 +15,7 @@ ;; failed to figure out what this is: (defpartgroup group-swamp-rat-nest-b-explosion :id 293 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) :parts ((sp-item 1342) (sp-item 1339) (sp-item 1337) (sp-item 1334)) @@ -24,7 +24,7 @@ ;; failed to figure out what this is: (defpartgroup group-swamp-rat-nest-c-explosion :id 294 - :duration 5 + :duration (seconds 0.017) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 6) :parts ((sp-item 1335) (sp-item 1339) (sp-item 1337) (sp-item 1334)) diff --git a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc index daaed30370..92f0623d94 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -472,7 +472,7 @@ ;; failed to figure out what this is: (defpartgroup group-scarecrow-explode :id 143 - :duration 15 + :duration (seconds 0.05) :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 2912) (sp-item 2913) (sp-item 2914) (sp-item 2915) (sp-item 2916)) ) @@ -630,7 +630,7 @@ ;; failed to figure out what this is: (defpartgroup group-scarecrow-joint-explode :id 144 - :duration 15 + :duration (seconds 0.05) :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 2912)) ) @@ -638,7 +638,7 @@ ;; failed to figure out what this is: (defpartgroup group-scarecrow-hit :id 145 - :duration 15 + :duration (seconds 0.05) :bounds (static-bspherem 0 0 0 1) :parts ((sp-item 2913)) ) diff --git a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc index 922033e99f..bab28cefe9 100644 --- a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc @@ -4,7 +4,7 @@ ;; failed to figure out what this is: (defpartgroup group-sequenceAV-splash :id 686 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2854 :period 900 :length 600)) @@ -37,8 +37,8 @@ ;; failed to figure out what this is: (defpartgroup group-sequenceAV-spit :id 687 - :duration 5 - :linger-duration 900 + :duration (seconds 0.017) + :linger-duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2855)) diff --git a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc index 37c811b448..5347fc100d 100644 --- a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc @@ -1035,7 +1035,7 @@ ;; failed to figure out what this is: (defpartgroup group-levitator-on-big :id 660 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2751 :fade-after (meters 100) :falloff-to (meters 100) :binding 2750) @@ -1183,7 +1183,7 @@ ;; failed to figure out what this is: (defpartgroup group-levitator-on-small :id 661 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2679)) diff --git a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc index b3b7daef91..58382d7868 100644 --- a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc @@ -42,7 +42,7 @@ ;; failed to figure out what this is: (defpartgroup group-tetherrock-explode :id 285 - :duration 150 + :duration (seconds 0.5) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) :parts ((sp-item 2065 :period 600 :length 5) diff --git a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc index 531fb3037b..af6b15fb18 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc @@ -1212,7 +1212,7 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboulder-hit-wall :id 551 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2287 :period 900 :length 40)) @@ -1240,7 +1240,7 @@ ;; failed to figure out what this is: (defpartgroup group-ogreboulder-splash :id 552 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 64) :parts ((sp-item 2288 :period 900 :length 20) diff --git a/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc index 1973c09dbe..ed8e9a66c1 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc @@ -621,7 +621,7 @@ ;; failed to figure out what this is: (defpartgroup group-village2-fireboulder :id 271 - :duration 18000 + :duration (seconds 60) :bounds (static-bspherem 0 4 0 10.5) :parts ((sp-item 1153 :fade-after (meters 200) :falloff-to (meters 240)) (sp-item 1154 :fade-after (meters 100) :falloff-to (meters 120) :period 300 :length 60) @@ -1970,7 +1970,7 @@ ;; failed to figure out what this is: (defpartgroup group-village2-fireboulder-hover :id 678 - :duration 900 + :duration (seconds 3) :flags (use-local-clock) :bounds (static-bspherem 0 0 0 16) :parts ((sp-item 2792 :fade-after (meters 100) :falloff-to (meters 100) :binding 2791) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index fa0dd1b001..5fa7634c95 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -966,3 +966,180 @@ :mask (sound-mask ,@snd-mask) )) ) + +(defmacro sp-item (launcher + &key (fade-after 0.0) + &key (falloff-to 0.0) + &key (flags ()) + &key (period 0) + &key (length 0) + &key (offset 0) + &key (hour-mask 0) + &key (binding 0) + ) + `(new 'static 'sparticle-group-item + :launcher ,launcher + :fade-after ,fade-after + :falloff-to ,falloff-to + :flags (sp-group-item-flag ,@flags) + :period ,period + :length ,length + :offset ,offset + :hour-mask ,hour-mask + :binding ,binding + ) + ) + +(defmacro defpartgroup (name &key id &key parts &key (duration 3000) &key (linger-duration 1500) &key (flags ()) &key bounds + &key (rotate (0.0 0.0 0.0)) &key (scale (1.0 1.0 1.0))) + "define a new part group. defines a constant with the name of the group with the ID as its value" + `(begin + (defconstant ,name ,id) + (set! (-> *part-group-id-table* ,id) + (new 'static 'sparticle-launch-group + :duration ,duration + :linger-duration ,linger-duration + :flags (sp-group-flag ,@flags) + :bounds ,bounds + :name ,(symbol->string name) + :length ,(length parts) + :launcher (new 'static 'inline-array sparticle-group-item ,(length parts) ,@parts) + :rotate-x ,(car rotate) + :rotate-y ,(cadr rotate) + :rotate-z ,(caddr rotate) + :scale-x ,(car scale) + :scale-y ,(cadr scale) + :scale-z ,(caddr scale) + ) + ) + ) + ) + +(defmacro defpart (id &key (init-specs ())) + "define a new sparticle-launcher" + `(set! (-> *part-id-table* ,id) + (new 'static 'sparticle-launcher + :init-specs (new 'static 'inline-array sp-field-init-spec ,(1+ (length init-specs)) + ,@init-specs + (sp-end) + ))) + ) + +(defmacro sp-tex (field-name tex-id) + `(new 'static 'sp-field-init-spec :field (sp-field-id ,field-name) :tex ,tex-id) + ) + +(defmacro sp-rnd-flt (field-name val range mult) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-valuef ,val + :random-rangef ,range + :random-multf ,mult + :flags (sp-flag float-with-rand) + ) + ) + +(defmacro sp-flt (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-valuef ,val + :random-rangef 0.0 + :random-multf 1.0 + :flags (sp-flag float-with-rand) + ) + ) + +(defmacro sp-int (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :random-range 0 + :random-mult 1 + ) + ) + +(defmacro sp-int-plain-rnd (field-name val range mult) + "For when we use plain integer, but set the randoms." + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :random-range ,range + :random-mult ,mult + ) + ) + +(defmacro sp-rnd-int (field-name val range mult) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :random-range ,range + :random-multf ,mult + :flags (sp-flag int-with-rand) + ) + ) + + +(defmacro sp-rnd-int-flt (field-name val range mult) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-valuef ,val + :random-range ,range + :random-multf ,mult + :flags (sp-flag int-with-rand) + ) + ) + +(defmacro sp-cpuinfo-flags (&rest flags) + `(new 'static 'sp-field-init-spec + :field (sp-field-id spt-flags) + :initial-value (sp-cpuinfo-flag ,@flags) + :random-mult 1 + ) + ) + +(defmacro sp-launcher-by-id (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,val + :flags (sp-flag part-by-id) + ) + ) + +(defmacro sp-func (field-name val) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :sym ,val + :flags (sp-flag from-pointer) + ) + ) + +(defmacro sp-sound (sound) + `(new 'static 'sp-field-init-spec + :field (sp-field-id spt-sound) + :sound ,sound + :flags (sp-flag plain-v2) + ) + ) + +(defmacro sp-end () + `(new 'static 'sp-field-init-spec + :field (sp-field-id spt-end) + ) + ) + +(defmacro sp-copy-from-other (field-name offset) + `(new 'static 'sp-field-init-spec + :field (sp-field-id ,field-name) + :initial-value ,offset + :random-mult 1 + :flags (sp-flag copy-from-other-field) + ) + ) + +(defmacro static-spherem (x y z r) + "actually makes a vector. use bspherem for sphere." + `(new 'static 'vector :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,r)) + ) +(defmacro static-bspherem (x y z r) + `(new 'static 'sphere :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,r)) + ) diff --git a/test/decompiler/reference/jak2/engine/debug/debug-part_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug-part_REF.gc new file mode 100644 index 0000000000..2b39f9bf68 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/debug/debug-part_REF.gc @@ -0,0 +1,2137 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; failed to figure out what this is: +(defpart 335 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x47 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 5) (meters 2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 0.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 20) + (sp-cpuinfo-flags sp-cpuinfo-flag-2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-eco-strike-ground + :id 96 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 336) (sp-item 337)) + ) + +;; failed to figure out what this is: +(defpart 336 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 24.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 32.0) + (sp-rnd-flt spt-a 8.0 56.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.13333334) (meters 0.16666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.013333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.4222223) + (sp-flt spt-fade-a -0.35555556) + (sp-flt spt-accel-y 0.34133333) + (sp-flt spt-friction 0.7) + (sp-int spt-timer 180) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 338) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 337 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 32.0) + (sp-flt spt-y (meters 1)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-rnd-flt spt-a 64.0 8.0 1.0) + (sp-flt spt-vel-y (meters 0.3)) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -2.8444445) + (sp-flt spt-fade-a -0.82222223) + (sp-flt spt-friction 0.7) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 45) + (sp-launcher-by-id spt-next-launcher 338) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-eco-spinkick + :id 97 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 339) (sp-item 340) (sp-item 341 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 339 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 32.0) + (sp-rnd-flt spt-a 8.0 56.0 1.0) + (sp-flt spt-scalevel-x (meters 0.013333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.4222223) + (sp-flt spt-fade-a -0.35555556) + (sp-flt spt-accel-y 0.34133333) + (sp-int spt-timer 180) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 338) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 338 + :init-specs ((sp-flt spt-fade-r -0.7111111) (sp-flt spt-fade-g 0.7111111) (sp-flt spt-fade-b 0.35555556)) + ) + +;; failed to figure out what this is: +(defpart 340 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.66) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-rnd-flt spt-a 64.0 8.0 1.0) + (sp-flt spt-scalevel-x (meters 0.0033333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -2.8444445) + (sp-flt spt-fade-a -0.82222223) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 45) + (sp-launcher-by-id spt-next-launcher 338) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.1) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 341 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 96.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -4.0) + (sp-flt spt-accel-y 0.34133333) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-blue + :id 98 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 348 :flags (launch-asap) :binding 342) + (sp-item 342 :fade-after (meters 40) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 60) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :fade-after (meters 130) :flags (start-dead launch-asap) :binding 343) + (sp-item 342 :flags (start-dead launch-asap) :binding 343) + (sp-item 343 :flags (start-dead launch-asap) :binding 344) + (sp-item 343 :flags (start-dead launch-asap) :binding 345) + (sp-item 343 :flags (start-dead launch-asap) :binding 346) + (sp-item 343 :flags (start-dead launch-asap) :binding 344) + (sp-item 343 :flags (start-dead launch-asap) :binding 345) + (sp-item 343 :flags (start-dead launch-asap) :binding 346) + (sp-item 344 :fade-after (meters 60) :flags (start-dead) :binding 347) + (sp-item 345 :fade-after (meters 70) :flags (start-dead) :binding 347) + (sp-item 346 :fade-after (meters 80) :flags (start-dead) :binding 347) + (sp-item 344 :fade-after (meters 90) :flags (start-dead) :binding 347) + (sp-item 345 :fade-after (meters 100) :flags (start-dead) :binding 347) + (sp-item 346 :fade-after (meters 100) :flags (start-dead) :binding 347) + (sp-item 347 :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 348 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 4)) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 342 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.3) (meters 0.15) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 96.0 1.0) + (sp-rnd-flt spt-b 128.0 128.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.0148148155) (meters 0.0044444446) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 349) + ) + ) + +;; failed to figure out what this is: +(defpart 349 + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 343 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.8) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 192.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-flt spt-rotvel-z (degrees 269.52002) (degrees 208.99998) 1.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 350) + ) + ) + +;; failed to figure out what this is: +(defpart 350 + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 344 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 345 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 346 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.0 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.6) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 347 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.2 0.2 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 192.0) + (sp-rnd-flt spt-a 96.0 64.0 1.0) + (sp-int spt-timer 5) + (sp-cpuinfo-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 99 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 356 :flags (launch-asap) :binding 352) + (sp-item 352 :flags (start-dead launch-asap) :binding 353) + (sp-item 352 :flags (start-dead launch-asap) :binding 354) + (sp-item 352 :flags (start-dead launch-asap) :binding 353) + (sp-item 352 :flags (start-dead launch-asap) :binding 354) + (sp-item 352 :flags (start-dead launch-asap) :binding 355) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 353 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 354 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + (sp-item 355 :fade-after (meters 40) :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 356 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 96.0) + (sp-flt spt-g 96.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'part-tracker-track-root) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 277) + ) + ) + +;; failed to figure out what this is: +(defpart 352 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) + (sp-flt spt-z (meters 0.08)) + (sp-rnd-flt spt-scale-x (meters 0.75) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.00048828125) 145.63556) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.08)) + (sp-flt spt-accel-z -21.845333) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 353 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 354 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 355 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.15) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-rnd-flt spt-a 128.0 64.0 1.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-blue-active + :id 100 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 360 :fade-after (meters 140) :falloff-to (meters 140) :binding 357) + (sp-item 360 :fade-after (meters 140) :falloff-to (meters 140) :binding 358) + (sp-item 360 :fade-after (meters 140) :falloff-to (meters 140) :binding 359) + (sp-item 361) + (sp-item 362 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 363 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 364 :fade-after (meters 120) :falloff-to (meters 120)) + (sp-item 359 :fade-after (meters 30) :falloff-to (meters 30) :flags (start-dead)) + (sp-item 358 :fade-after (meters 60) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 357 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 359 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 358 :fade-after (meters 100) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 357 :fade-after (meters 110) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 359 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) + (sp-item 358 :fade-after (meters 120) :falloff-to (meters 120) :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-blue-inactive + :id 101 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 360 :fade-after (meters 100)) (sp-item 361)) + ) + +;; failed to figure out what this is: +(defpart 361 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x26 :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 32.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-flt spt-fade-a -0.2) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 360 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.05 0.1 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 192.0) + (sp-flt spt-a 96.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 357 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 358 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 359 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 90) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 362 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.1 0.5 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 10.0) (degrees 160.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 91) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 363 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.2 0.4 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 10.0) (degrees 160.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 91) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 364 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-rnd-flt spt-num 0.3 0.1 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 1.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 10.0) (degrees 160.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.2) (meters 0.1) 1.0) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -1.4) + (sp-int spt-timer 91) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 351) + ) + ) + +;; failed to figure out what this is: +(defpart 351 + :init-specs ((sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-fade-r -1.0) + (sp-flt spt-fade-g -1.0) + (sp-flt spt-fade-a -2.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-red + :id 102 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 369 :flags (launch-asap) :binding 365) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 365 :flags (start-dead launch-asap) :binding 366) + (sp-item 366 :flags (start-dead launch-asap) :binding 367) + (sp-item 366 :flags (start-dead launch-asap) :binding 367) + (sp-item 366 :flags (start-dead launch-asap) :binding 367) + (sp-item 367 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 368) + (sp-item 367 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 368) + (sp-item 367 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 368) + (sp-item 368 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 368 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 368 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 369 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 4)) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 365 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 24.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.0148148155) (meters 0.0044444446) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 370) + ) + ) + +;; failed to figure out what this is: +(defpart 370 + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 366 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.4) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 371) + ) + ) + +;; failed to figure out what this is: +(defpart 371 + :init-specs ((sp-flt spt-fade-a -0.21333334) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 367 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.07) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.6) (meters 0.6) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-vel-x (meters 0.11259259)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 371) + ) + ) + +;; failed to figure out what this is: +(defpart 368 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters -0.00038095238)) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.01904762) + (sp-rnd-flt spt-accel-y 0.40960002 0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 372) + ) + ) + +;; failed to figure out what this is: +(defpart 372 + :init-specs ((sp-flt spt-fade-g 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-red-collect + :id 103 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 375 :flags (launch-asap) :binding 373) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 373 :flags (start-dead launch-asap) :binding 374) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + (sp-item 374 :fade-after (meters 40) :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 375 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'part-tracker-track-root) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 277) + ) + ) + +;; failed to figure out what this is: +(defpart 373 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) + (sp-flt spt-z (meters 0.08)) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.00048828125) 145.63556) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.08)) + (sp-flt spt-accel-z -21.845333) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 374 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.006666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.005555555)) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -2.0) + (sp-flt spt-fade-a -0.22857143) + (sp-rnd-flt spt-accel-y 0.40960002 0.6144 1.0) + (sp-int spt-timer 54) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 376) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-red-active + :id 104 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 380 :fade-after (meters 30) :period 330 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 60) :period 736 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 90) :period 936 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 130) :period 528 :length 5 :binding 377) + (sp-item 380 :fade-after (meters 170) :period 801 :length 5 :binding 377) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 377 :flags (start-dead launch-asap) :binding 378) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 378 :flags (start-dead launch-asap) :binding 379) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 50) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 379 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 381 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 382) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-red-inactive + :id 105 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 381 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 382)) + ) + +;; failed to figure out what this is: +(defpart 382 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.6 0.6 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.9) (meters 1.9) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 381 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.3 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.1) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 380 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-a 1.0) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 5.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 377 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-flt spt-z (meters 0.5)) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.017777778) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.28444445) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 378 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.25) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 379 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0033333334) (meters 0.006666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.0023809525)) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.07619048) + (sp-rnd-flt spt-accel-y 0.40960002 0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 376) + ) + ) + +;; failed to figure out what this is: +(defpart 376 + :init-specs ((sp-flt spt-fade-g 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-yellow-active + :id 106 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 386 :fade-after (meters 40) :period 330 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 60) :period 736 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 80) :period 936 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 100) :period 528 :length 5 :binding 383) + (sp-item 386 :fade-after (meters 130) :period 801 :length 5 :binding 383) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 383 :flags (start-dead launch-asap) :binding 384) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 384 :flags (start-dead launch-asap) :binding 385) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 60) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 70) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 90) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 385 :fade-after (meters 90) :falloff-to (meters 100) :flags (start-dead)) + (sp-item 387 :fade-after (meters 140) :falloff-to (meters 140)) + (sp-item 388) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-yellow-inactive + :id 107 + :bounds (static-bspherem 0 3 0 5) + :parts ((sp-item 387 :fade-after (meters 140) :falloff-to (meters 140)) (sp-item 388)) + ) + +;; failed to figure out what this is: +(defpart 388 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.6 0.6 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.9) (meters 1.9) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 92.0 32.0 1.0) + (sp-rnd-flt spt-g 32.0 92.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 387 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.3 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.1) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 386 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 1.5) 1.0) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-a 1.0) + (sp-rnd-flt spt-vel-y (meters 0.013333334) (meters 0.013333334) 1.0) + (sp-int spt-timer 375) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 5.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 383 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.2) 1.0) + (sp-flt spt-scale-x (meters 1)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-vel-x (meters 0.10666667)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.3) 1 109.22667) + (sp-flt spt-fade-a -0.34133333) + (sp-int spt-timer 375) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 384 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-flt spt-z (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 0.5) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-vel-x (meters 0.11259259)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.3) 1 109.22667) + (sp-flt spt-fade-a -0.34133333) + (sp-int spt-timer 375) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 385 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.5 2.0 1.0) + (sp-flt spt-y (meters -0.05)) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.0023333333) (meters 0.0016666667) 1.0) + (sp-flt spt-scalevel-x (meters -0.0016666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.024242423) + (sp-rnd-flt spt-accel-y -0.40960002 -1.2288 1.0) + (sp-flt spt-friction 0.93) + (sp-int-plain-rnd spt-timer 30 209 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 389) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 180.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-conerot-radius (meters 0.05)) + ) + ) + +;; failed to figure out what this is: +(defpart 389 + :init-specs ((sp-flt spt-fade-r 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-yellow + :id 108 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 394 :flags (launch-asap) :binding 390) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 390 :flags (start-dead launch-asap) :binding 391) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 391 :flags (start-dead launch-asap) :binding 392) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 392 :fade-after (meters 100) :flags (start-dead launch-asap) :binding 393) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + (sp-item 393 :fade-after (meters 90) :falloff-to (meters 110) :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 394 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 4)) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 390 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.15) (meters 0.2) 1.0) + (sp-rnd-flt spt-scale-x (meters 2) (meters 2) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 16.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.0148148155) (meters 0.0044444446) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 395) + ) + ) + +;; failed to figure out what this is: +(defpart 395 + :init-specs ((sp-flt spt-fade-a -0.10666667) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 391 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.75) (meters 0.1) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.017777778) (meters 0.0148148155) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 396) + ) + ) + +;; failed to figure out what this is: +(defpart 396 + :init-specs ((sp-flt spt-fade-a -0.16) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 392 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.12) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.4) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-vel-x (meters 0.11259259)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-func spt-func 'eco-fadeout) + (sp-int spt-next-time 10) + (sp-launcher-by-id spt-next-launcher 396) + ) + ) + +;; failed to figure out what this is: +(defpart 393 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-rnd-flt spt-num 0.1 1.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters -0.0006190476)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.01904762) + (sp-rnd-flt spt-accel-y -0.40960002 -0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 397) + ) + ) + +;; failed to figure out what this is: +(defpart 397 + :init-specs ((sp-flt spt-fade-g 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-eco-yellow-collect + :id 109 + :duration (seconds 0.5) + :linger-duration (seconds 2) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 400 :flags (launch-asap) :binding 398) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 398 :flags (start-dead launch-asap) :binding 399) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + (sp-item 399 :fade-after (meters 40) :flags (start-dead)) + ) + ) + +;; failed to figure out what this is: +(defpart 400 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -3.2) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'part-tracker-track-root) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 277) + ) + ) + +;; failed to figure out what this is: +(defpart 398 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 5.0) + (sp-rnd-flt spt-y (meters -4) (meters 16) 1.0) + (sp-flt spt-z (meters 0.08)) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.2) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters -0.017777778) (meters 0.00048828125) 145.63556) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0.08)) + (sp-flt spt-accel-z -21.845333) + (sp-int spt-timer 150) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 399 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.1) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 100.0 28.0 1.0) + (sp-rnd-flt spt-g 64.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-rnd-flt spt-a 32.0 32.0 1.0) + (sp-flt spt-scalevel-x (meters -0.0006190476)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -0.4) + (sp-flt spt-fade-a -0.01904762) + (sp-rnd-flt spt-accel-y -0.40960002 -0.6144 1.0) + (sp-int-plain-rnd spt-timer 30 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 240) + (sp-launcher-by-id spt-next-launcher 397) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-vent-green-active + :id 110 + :bounds (static-bspherem 0 5 0 5) + :parts ((sp-item 403 :fade-after (meters 80) :falloff-to (meters 80) :period 48 :length 5 :binding 401) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 401 :fade-after (meters 80) :flags (start-dead launch-asap) :binding 402) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 402 :fade-after (meters 80) :falloff-to (meters 80) :flags (start-dead)) + (sp-item 404 :fade-after (meters 100)) + (sp-item 405) + ) + ) + +;; failed to figure out what this is: +(defpart 405 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-rnd-flt spt-num 0.6 0.6 1.0) + (sp-rnd-flt spt-x (meters -0.75) (meters 1.5) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.75) (meters 1.5) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.9) (meters 1.9) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 0.0 64.0 1.0) + (sp-rnd-flt spt-g 92.0 32.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 32.0) + (sp-rnd-flt spt-vel-y (meters 0.016666668) (meters 0.016666668) 1.0) + (sp-rnd-int-flt spt-rotvel-z (degrees -0.1) 1 36.40889) + (sp-flt spt-fade-a -0.10666667) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 404 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-rnd-flt spt-num 0.1 0.3 1.0) + (sp-rnd-flt spt-x (meters -0.5) (meters 1) 1.0) + (sp-flt spt-y (meters 0.5)) + (sp-rnd-flt spt-z (meters -0.5) (meters 1) 1.0) + (sp-rnd-flt spt-scale-x (meters 1.5) (meters 0.4) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 64.0) + (sp-rnd-flt spt-vel-y (meters 0.01) (meters 0.01) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -0.1) (degrees 0.1) 1.0) + (sp-flt spt-fade-a -0.21333334) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 403 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -1) (meters 2) 1.0) + (sp-flt spt-scale-x (meters 0.01)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-vel-y (meters 0.006666667) (meters 0.0033333334) 1.0) + (sp-int spt-timer 750) + (sp-cpuinfo-flags sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 401 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-y (meters 0) (meters 16) 1.0) + (sp-rnd-flt spt-z (meters 0.2) (meters 0.6) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.3) (meters 0.3) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 127.0) + (sp-rnd-flt spt-omega 0.0 65536.0 1.0) + (sp-rnd-flt spt-vel-x (meters 0.053333335) (meters 0.053333335) 1.0) + (sp-flt spt-vel-y (meters 0)) + (sp-flt spt-vel-z (meters 0)) + (sp-flt spt-fade-r -0.2) + (sp-int-plain-rnd spt-timer 600 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 450 149 1) + (sp-launcher-by-id spt-next-launcher 406) + ) + ) + +;; failed to figure out what this is: +(defpart 406 + :init-specs ((sp-flt spt-fade-r 0.0) (sp-flt spt-fade-a -0.8466667) (sp-int spt-timer 150)) + ) + +;; failed to figure out what this is: +(defpart 402 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.2)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 96.0) + (sp-flt spt-scalevel-x (meters -0.0006060606)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-r -2.8333333) + (sp-flt spt-accel-y -0.81920004) + (sp-int-plain-rnd spt-timer 30 299 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 286) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fuel-cell-starburst + :id 111 + :bounds (static-bspherem 0 0.5 0 1.5) + :parts ((sp-item 407 :fade-after (meters 35)) + (sp-item 408 :fade-after (meters 20)) + (sp-item 409 :flags (bit1 launch-asap)) + (sp-item 410 :flags (bit1 launch-asap)) + ) + ) + +;; failed to figure out what this is: +(defpart 407 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.8) 1.0) + (sp-rnd-int spt-r 0 1 255.0) + (sp-rnd-int spt-g 0 1 255.0) + (sp-rnd-int spt-b 0 1 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 0.35555556) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 411) + ) + ) + +;; failed to figure out what this is: +(defpart 411 + :init-specs ((sp-flt spt-fade-a -0.53333336)) + ) + +;; failed to figure out what this is: +(defpart 408 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.06) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.2)) + (sp-rnd-int spt-r 0 1 255.0) + (sp-rnd-int spt-g 0 1 255.0) + (sp-rnd-int spt-b 0 1 255.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-fade-a 0.32) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 411) + ) + ) + +;; failed to figure out what this is: +(defpart 409 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3.5)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 3)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 64.0) + (sp-flt spt-rotvel-z (degrees -0.4)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +;; failed to figure out what this is: +(defpart 410 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 3.5)) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 64.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root-prim) + ) + ) + +;; definition for function sparticle-track-root-money +;; ERROR: function has no type analysis. Cannot decompile. + +;; failed to figure out what this is: +(defpart 412 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.5) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.1) (meters 0.8) 1.0) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 0.35555556) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 90) + (sp-launcher-by-id spt-next-launcher 413) + ) + ) + +;; failed to figure out what this is: +(defpart 413 + :init-specs ((sp-flt spt-fade-a -0.53333336)) + ) + +;; failed to figure out what this is: +(defpart 414 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 0.06) + (sp-rnd-flt spt-scale-x (meters 2) (meters 0.5) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.2)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.15) (degrees 0.3) 1.0) + (sp-flt spt-fade-a 0.32) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-int spt-next-time 75) + (sp-launcher-by-id spt-next-launcher 413) + ) + ) + +;; failed to figure out what this is: +(defpart 415 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 2)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-rotvel-z (degrees -0.4)) + (sp-int spt-timer 3600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-track-root-money) + ) + ) + +;; failed to figure out what this is: +(defpart 416 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-flt spt-scale-y (meters 2.5)) + (sp-flt spt-r 192.0) + (sp-flt spt-g 192.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 32.0) + (sp-flt spt-rotvel-z (degrees 0.3)) + (sp-int spt-timer 3600) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-track-root-money) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-money-starburst :id 112 :bounds (static-bspherem 0 0.5 0 1.5) :parts ((sp-item 417))) + +;; failed to figure out what this is: +(defpartgroup group-buzzer-effect + :id 113 + :bounds (static-bspherem 0 0 0 1) + :parts ((sp-item 418 :flags (is-3d)) (sp-item 419 :flags (is-3d))) + ) + +;; failed to figure out what this is: +(defpart 418 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 2.0) + (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-x 0.0 12743.111 1.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 32.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-launchrot-x (degrees -180.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -180.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 419 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x9b :page #xb)) + (sp-flt spt-num 2.0) + (sp-rnd-flt spt-scale-x (meters 1.3) (meters 0.2) 1.0) + (sp-rnd-flt spt-rot-x 20024.889 12743.111 1.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 32.0) + (sp-flt spt-fade-a -1.0) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-rnd-flt spt-launchrot-x (degrees -180.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-launchrot-y (degrees -180.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-blue-collect + :id 114 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 420) (sp-item 421) (sp-item 422)) + ) + +;; failed to figure out what this is: +(defpart 420 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 60.0 20.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +;; failed to figure out what this is: +(defpart 421 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 60.0 20.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +;; failed to figure out what this is: +(defpart 422 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-rnd-flt spt-g 60.0 20.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.42666668) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 310) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-yellow-collect + :id 115 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 423) (sp-item 424) (sp-item 425)) + ) + +;; failed to figure out what this is: +(defpart 423 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +;; failed to figure out what this is: +(defpart 424 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +;; failed to figure out what this is: +(defpart 425 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 64.0 192.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.42666668) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 310) + ) + ) + +;; failed to figure out what this is: +(defpart 310 + :init-specs ((sp-flt spt-scalevel-x (meters -0.025)) (sp-copy-from-other spt-scalevel-y -4)) + ) + +;; failed to figure out what this is: +(defpartgroup group-red-collect + :id 116 + :duration (seconds 0.017) + :linger-duration (seconds 4) + :flags (use-local-clock) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 426) (sp-item 427) (sp-item 428)) + ) + +;; failed to figure out what this is: +(defpart 426 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 16.0) + (sp-rnd-flt spt-scale-x (meters 6) (meters 1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 1) 1.0) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-scalevel-y (meters 0.009765625)) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +;; failed to figure out what this is: +(defpart 427 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 6.0) + (sp-rnd-flt spt-scale-x (meters 8) (meters 2) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-flt spt-scale-y (meters 0.5)) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 0.0) + (sp-flt spt-scalevel-x (meters 0.009765625)) + (sp-rnd-flt spt-rotvel-z (degrees -0.3) (degrees 0.6) 1.0) + (sp-flt spt-fade-a 2.1333334) + (sp-int spt-timer 450) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int-plain-rnd spt-next-time 5 19 1) + (sp-launcher-by-id spt-next-launcher 307) + ) + ) + +;; failed to figure out what this is: +(defpart 428 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 128.0 128.0 1.0) + (sp-rnd-flt spt-g 0.0 64.0 1.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters 0.1)) + (sp-flt spt-rotvel-z (degrees -0.8)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.42666668) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-int spt-next-time 60) + (sp-launcher-by-id spt-next-launcher 310) + ) + ) + +) + + + diff --git a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc new file mode 100644 index 0000000000..596a51cc79 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc @@ -0,0 +1,136 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; failed to figure out what this is: +(defpartgroup group-part-tester + :id 127 + :flags (unk-4 unk-6) + :bounds (static-bspherem 0 0 0 640) + :rotate ((degrees 2) (degrees 0) (degrees 0)) + :parts ((sp-item 209)) + ) + +;; definition of type part-tester +(deftype part-tester (process) + ((root trsqv :offset-assert 128) + (part sparticle-launch-control :offset-assert 132) + (old-group sparticle-launch-group :offset-assert 136) + ) + :heap-base #x10 + :method-count-assert 14 + :size-assert #x8c + :flag-assert #xe0010008c + ) + +;; definition for method 3 of type part-tester +(defmethod inspect part-tester ((obj part-tester)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Troot: ~A~%" (-> obj root)) + (format #t "~2Tpart: ~A~%" (-> obj part)) + (format #t "~2Told-group: ~A~%" (-> obj old-group)) + (label cfg-4) + obj + ) + +;; definition for symbol *part-tester-name*, type string +(define *part-tester-name* (the-as string #f)) + +;; definition for method 10 of type part-tester +(defmethod deactivate part-tester ((obj part-tester)) + (if (nonzero? (-> obj part)) + (kill-and-free-particles (-> obj part)) + ) + ((method-of-type process deactivate) obj) + (none) + ) + +;; failed to figure out what this is: +(defstate part-tester-idle (part-tester) + :code (behavior () + (until #f + (let ((gp-0 (entity-by-name *part-tester-name*))) + (when gp-0 + (let ((s5-0 (-> gp-0 extra process))) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> (the-as process-drawable s5-0) root))) + (set! (-> self root trans quad) (-> (the-as process-drawable s5-0) root trans quad)) + (set! (-> self root trans quad) (-> gp-0 extra trans quad)) + ) + ) + ) + ) + (add-debug-x + #t + (bucket-id debug-no-zbuf1) + (-> self root trans) + (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + ) + (let ((gp-1 (-> *part-group-id-table* 127))) + (let ((s5-1 (-> self root trans))) + (when (!= gp-1 (-> self old-group)) + (when (nonzero? (-> self part)) + (kill-and-free-particles (-> self part)) + (set! (-> self heap-cur) (&-> (-> self part) type)) + ) + (set! (-> self part) (create-launch-control gp-1 self)) + ) + (if (nonzero? (-> self part)) + (spawn (-> self part) (cond + ((logtest? (-> gp-1 flags) (sp-group-flag screen-space)) + *zero-vector* + ) + (else + (empty) + s5-1 + ) + ) + ) + ) + ) + (set! (-> self old-group) gp-1) + ) + (suspend) + ) + #f + (none) + ) + ) + +;; definition for function part-tester-init-by-other +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defbehavior part-tester-init-by-other process-drawable ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! *part-tester* (process->ppointer self)) + (go part-tester-idle) + (none) + ) + +;; definition (perm) for symbol *debug-part-dead-pool*, type dead-pool +(define-perm *debug-part-dead-pool* dead-pool (new 'debug 'dead-pool 1 #x10000 "*debug-part-dead-pool*")) + +;; definition for function start-part +;; WARN: Return type mismatch (pointer process) vs none. +(defun start-part () + (kill-by-type part-tester *active-pool*) + (process-spawn + part-tester + (if *anim-tester* + (-> *anim-tester* 0 root trans) + (target-pos 0) + ) + :from *debug-part-dead-pool* + ) + (none) + ) + +) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc index 1ed80206d4..00fd577c7f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc @@ -43,10 +43,10 @@ ) ) (when (and (-> *setting-control* user-current weather) gp-0) - (let ((s5-0 (new 'stack-no-clear 'vector))) - (let ((s4-0 (new 'stack-no-clear 'vector)) - (v1-8 (-> *math-camera* inv-camera-rot vector 2)) - ) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-8 (-> *math-camera* inv-camera-rot vector 2))) (set! (-> s5-0 quad) (-> *math-camera* trans quad)) (vector-! s4-0 s5-0 (-> *math-camera* prev-trans)) (let ((f0-1 (vector-dot s4-0 v1-8))) @@ -54,13 +54,13 @@ ) ) (set! (-> s5-0 y) (-> *math-camera* trans y)) + (if (< 0.0 (-> *setting-control* user-current rain)) + (update-rain (-> *setting-control* user-current rain) s5-0 s4-0) + ) + (if (< 0.0 (-> *setting-control* user-current snow)) + (update-snow (-> *setting-control* user-current snow) s5-0 s4-0) + ) ) - (if (< 0.0 (-> *setting-control* user-current rain)) - (update-rain (the-as target (-> *setting-control* user-current rain))) - ) - (if (< 0.0 (-> *setting-control* user-current snow)) - (update-snow (the-as target (-> *setting-control* user-current snow))) - ) ) (cond ((and (>= (-> self time-of-day) 6.25) @@ -691,7 +691,3 @@ ;; failed to figure out what this is: (start-time-of-day) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc new file mode 100644 index 0000000000..7c78f44376 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/weather-part_REF.gc @@ -0,0 +1,963 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-rain-screend-drop-real + :id 1 + :flags (screen-space) + :bounds (static-bspherem 0 0 0 16) + :parts ((sp-item 45 :binding 41) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 41 :flags (start-dead launch-asap) :binding 42) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 42 :flags (start-dead launch-asap)) + (sp-item 46 :binding 43) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 43 :flags (start-dead launch-asap) :binding 44) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + (sp-item 44 :flags (start-dead launch-asap)) + ) + ) + +;; definition for symbol group-rain-screend-drop, type sparticle-launch-group +(define group-rain-screend-drop (-> *part-group-id-table* 1)) + +;; failed to figure out what this is: +(defpart 46 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 0.1) + (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) + (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 12.0) + (sp-flt spt-scalevel-x (meters 0.16666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 43 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1.5)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 20.0) + (sp-flt spt-scalevel-x (meters 0.033333335)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 47) + ) + ) + +;; failed to figure out what this is: +(defpart 47 + :init-specs ((sp-flt spt-scalevel-x (meters 0.004166667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.06666667) + ) + ) + +;; failed to figure out what this is: +(defpart 44 + :init-specs ((sp-flt spt-num 1.0) + (sp-int spt-rot-x 12) + (sp-flt spt-r 4096.0) + (sp-flt spt-g 3276.8) + (sp-flt spt-b 3276.8) + (sp-flt spt-fade-r 6.068148) + (sp-flt spt-fade-g 68.26667) + (sp-flt spt-fade-b 3.034074) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags distort) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 48) + ) + ) + +;; failed to figure out what this is: +(defpart 48 + :init-specs ((sp-flt spt-fade-g -5.1200004)) + ) + +;; failed to figure out what this is: +(defpart 45 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x29 :page #xc)) + (sp-flt spt-num 0.1) + (sp-rnd-flt spt-x (meters -4.5) (meters 9) 1.0) + (sp-rnd-flt spt-y (meters -3) (meters 6) 1.0) + (sp-flt spt-scale-x (meters 4)) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 12.0) + (sp-flt spt-scalevel-x (meters 0.26666668)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-int spt-timer 10) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + ) + ) + +;; failed to figure out what this is: +(defpart 41 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.6)) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 20.0) + (sp-flt spt-scalevel-x (meters 0.06666667)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.8) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int spt-next-time 15) + (sp-launcher-by-id spt-next-launcher 49) + ) + ) + +;; failed to figure out what this is: +(defpart 49 + :init-specs ((sp-flt spt-scalevel-x (meters 0.008333334)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.06666667) + ) + ) + +;; failed to figure out what this is: +(defpart 42 + :init-specs ((sp-flt spt-num 1.0) + (sp-int spt-rot-x 24) + (sp-flt spt-r 12288.0) + (sp-flt spt-g 6553.6) + (sp-flt spt-b 6553.6) + (sp-flt spt-fade-r 12.136296) + (sp-flt spt-fade-g 136.53334) + (sp-flt spt-fade-b 6.068148) + (sp-flt spt-accel-y -2.7306666) + (sp-int spt-timer 270) + (sp-cpuinfo-flags distort) + (sp-int spt-next-time 30) + (sp-launcher-by-id spt-next-launcher 50) + ) + ) + +;; failed to figure out what this is: +(defpart 50 + :init-specs ((sp-flt spt-fade-g -10.240001)) + ) + +;; failed to figure out what this is: +(defpartgroup group-stars + :id 2 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 51 :flags (bit6)) (sp-item 52 :flags (bit6)) (sp-item 53 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 51 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 30) (meters 20) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 256.0) + (sp-flt spt-g 256.0) + (sp-flt spt-b 256.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 60 239 1) + (sp-launcher-by-id spt-next-launcher 54) + (sp-rnd-flt spt-conerot-x (degrees -89.0) (degrees 178.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 1440.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 5000)) + ) + ) + +;; failed to figure out what this is: +(defpart 54 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 29999700) (sp-launcher-by-id spt-next-launcher 55)) + ) + +;; failed to figure out what this is: +(defpart 55 + :init-specs ((sp-flt spt-fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 52 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 30) (meters 20) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 256.0) + (sp-flt spt-g 256.0) + (sp-flt spt-b 256.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 60 239 1) + (sp-launcher-by-id spt-next-launcher 54) + (sp-rnd-flt spt-conerot-x (degrees 30.0) (degrees 59.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 2880.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 5000)) + ) + ) + +;; failed to figure out what this is: +(defpart 53 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 30) (meters 20) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 128.0) + (sp-flt spt-a 0.0) + (sp-flt spt-fade-a 0.42666668) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 60 239 1) + (sp-launcher-by-id spt-next-launcher 54) + (sp-rnd-flt spt-conerot-x (degrees 60.0) (degrees 29.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 5760.0) 1.0) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-conerot-radius (meters 5000)) + ) + ) + +;; failed to figure out what this is: +(defpart 56 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 4.0) + (sp-rnd-flt spt-x (meters 10) (meters 10) 1.0) + (sp-rnd-flt spt-y (meters 2) (meters 14) 1.0) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters -0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-flt spt-fade-a 0.85333335) + (sp-int spt-timer 1500) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 75 74 1) + (sp-launcher-by-id spt-next-launcher 57) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 180.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 58 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 0.0) + (sp-rnd-flt spt-x (meters 0) (meters 20) 1.0) + (sp-flt spt-y (meters 16)) + (sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 0.0) + (sp-rnd-flt spt-vel-y (meters -0.01) (meters -0.0033333334) 1.0) + (sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 2.4) 1.0) + (sp-flt spt-fade-a 0.85333335) + (sp-int spt-timer 1500) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14) + (sp-int-plain-rnd spt-next-time 75 74 1) + (sp-launcher-by-id spt-next-launcher 57) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 57 + :init-specs ((sp-flt spt-fade-a 0.0) (sp-int spt-next-time 1200) (sp-launcher-by-id spt-next-launcher 59)) + ) + +;; failed to figure out what this is: +(defpart 59 + :init-specs ((sp-flt spt-fade-a -0.85333335)) + ) + +;; definition for function update-snow +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun update-snow ((arg0 float) (arg1 vector) (arg2 vector)) + (let ((f0-0 (lerp-scale 0.0 1.0 (vector-length arg2) 2048.0 40960.0))) + (set! (-> *part-id-table* 58 init-specs 1 initial-valuef) (- 1.0 f0-0)) + (set! (-> *part-id-table* 56 init-specs 1 initial-valuef) (* 4.0 f0-0)) + ) + (set! (-> *part-id-table* 56 init-specs 19 initial-valuef) (+ 32768.0 (vector-y-angle arg2))) + (let ((t9-2 sp-launch-particles-var) + (a0-3 *sp-particle-system-2d*) + (a1-2 (-> *part-id-table* 58)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> arg1 quad)) + (t9-2 a0-3 a1-2 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-3 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-3 (-> *part-id-table* 56)) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> arg1 quad)) + (t9-3 a0-4 a1-3 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 60 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-func spt-birth-func 'birth-func-rain) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) + (sp-flt spt-y (meters 30)) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.1) (meters -0.2) 1.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 0.0) + (sp-func spt-func 'check-drop-level-rain) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 61 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-func spt-birth-func 'birth-func-rain) + (sp-flt spt-num 4.0) + (sp-rnd-flt spt-x (meters -20) (meters 40) 1.0) + (sp-flt spt-y (meters 30)) + (sp-rnd-flt spt-scale-x (meters 0.03) (meters 0.03) 1.0) + (sp-rnd-flt spt-scale-y (meters 0.5) (meters 0.5) 1.0) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 32.0 64.0 1.0) + (sp-rnd-flt spt-vel-y (meters -0.06666667) (meters -0.033333335) 1.0) + (sp-int spt-timer 900) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-flt spt-userdata 0.0) + (sp-func spt-func 'check-drop-level-rain2) + (sp-rnd-flt spt-rotate-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 62 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x21 :page #xc)) + (sp-rnd-flt spt-num 1.0 3.0 1.0) + (sp-rnd-flt spt-scale-x (meters 0.08) (meters 0.03) 1.0) + (sp-int spt-rot-x 4) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 64.0 64.0 1.0) + (sp-rnd-flt spt-omega 2.8672 1.6384 1.0) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -20.48 -2.7306666 1.0) + (sp-flt spt-friction 0.98) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 use-global-acc) + (sp-flt spt-userdata 0.0) + (sp-func spt-func 'check-drop-level-splash) + (sp-int-plain-rnd spt-next-time 0 99 1) + (sp-launcher-by-id spt-next-launcher 63) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 50.000004) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + (sp-flt spt-rotate-x (degrees 0.0)) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 64 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-func spt-birth-func 'birth-func-omega-normal-orient) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.2)) + (sp-rnd-flt spt-scale-x (meters 0.5) (meters 0.25) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 32.0 32.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-rnd-flt spt-b 64.0 32.0 1.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 0.0) + (sp-rnd-flt spt-scalevel-x (meters 0.006666667) (meters 0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -1.2) + (sp-int spt-timer 300) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (new 'static 'sp-field-init-spec + :field (sp-field-id spt-userdata) + :flags (sp-flag plain-v2) + :object (new 'static 'boxed-array :type int32 10 0 0 #xc0c900 #xc02600 #xc03300 #xc02c00) + ) + (sp-func spt-func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpart 65 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-rnd-flt spt-num 2.0 4.0 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-rnd-flt spt-scale-y (meters 0.06) (meters 0.03) 1.0) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-rnd-flt spt-b 0.0 128.0 1.0) + (sp-flt spt-a 128.0) + (sp-rnd-flt spt-omega 3.2768 2.048 1.0) + (sp-rnd-flt spt-vel-y (meters 0.1) (meters 0.06666667) 1.0) + (sp-rnd-flt spt-fade-g -2.55 -2.55 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-fade-a -0.32 -0.64 1.0) + (sp-rnd-flt spt-friction 0.8 0.02 1.0) + (sp-int-plain-rnd spt-timer 100 99 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 80.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 3600.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 66 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 0.25)) + (sp-flt spt-rot-x 40.96) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 3600.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 255.0) + (sp-rnd-flt spt-g 196.0 128.0 1.0) + (sp-rnd-flt spt-b 128.0 64.0 1.0) + (sp-rnd-flt spt-a 96.0 16.0 1.0) + (sp-flt spt-omega 656998.4) + (sp-flt spt-scalevel-x (meters 0.08)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -6.375) + (sp-flt spt-fade-b -13.066667) + (sp-flt spt-fade-a -2.8) + (sp-int-plain-rnd spt-timer 15 9 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 2048.0) + ) + ) + +;; definition for function birth-func-omega-normal-orient +;; WARN: Return type mismatch int vs none. +(defun birth-func-omega-normal-orient ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (local-vars (v1-6 float) (v1-7 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'quaternion)) + ) + (set! (-> s4-0 x) (* 0.007874016 (the float (-> arg1 datab 2)))) + (set! (-> s4-0 y) 0.0) + (set! (-> s4-0 z) (* -0.007874016 (the float (-> arg1 datab 0)))) + (vector-normalize! s4-0 1.0) + (quaternion-vector-angle! gp-0 s4-0 (acos (* 0.007874016 (the float (-> arg1 datab 1))))) + (cond + ((< (-> gp-0 w) 0.0) + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 vec quad)) + (.sub.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-6 vf1) + ) + (else + (.lvf vf1 (&-> arg2 qx-qy-qz-sy quad)) + (.lvf vf2 (&-> gp-0 vec quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg2 qx-qy-qz-sy quad) vf1) + (.mov v1-7 vf1) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function birth-func-rain +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun birth-func-rain ((arg0 sparticle-system) + (arg1 sparticle-cpuinfo) + (arg2 sprite-vec-data-3d) + (arg3 sparticle-launcher) + (arg4 sparticle-launch-state) + ) + (let ((s4-0 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-0 start-pos quad) (-> arg2 x-y-z-sx quad)) + (set-vector! (-> s4-0 move-dist) 0.0 -163840.0 0.0 1.0) + (let ((v1-2 s4-0)) + (set! (-> v1-2 radius) 40.96) + (set! (-> v1-2 collide-with) (collide-spec backgnd)) + (set! (-> v1-2 ignore-process0) #f) + (set! (-> v1-2 ignore-process1) #f) + (set! (-> v1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) + (set! (-> v1-2 action-mask) (collide-action solid)) + ) + (fill-using-line-sphere *collide-cache* s4-0) + (cond + ((>= (collide-cache-method-16 *collide-cache* s4-0) 0.0) + (set! (-> arg1 user-float) (-> s4-0 best-other-tri intersect y)) + (let ((f0-8 (+ 65536.0 (-> *math-camera* trans y)))) + (if (< (-> arg1 user-float) f0-8) + (set! (-> arg2 x-y-z-sx y) f0-8) + ) + ) + (set! (-> arg1 datab 0) (the int (* 127.0 (-> s4-0 best-other-tri normal x)))) + (set! (-> arg1 datab 1) (the int (* 127.0 (-> s4-0 best-other-tri normal y)))) + (set! (-> arg1 datab 2) (the int (* 127.0 (-> s4-0 best-other-tri normal z)))) + (set! (-> arg1 datab 3) (the-as int (-> s4-0 best-other-tri pat event))) + ) + (else + (set! (-> arg1 omega) 65280.0) + (set! (-> arg1 user-float) (+ -204800.0 (-> arg2 x-y-z-sx y))) + ) + ) + ) + (let ((f0-21 (ocean-method-11 *ocean* (the-as (inline-array vector) (-> arg2 x-y-z-sx)) #f))) + (when (!= f0-21 4095996000.0) + (when (< (-> arg1 user-float) f0-21) + (set! (-> arg1 user-float) f0-21) + (set! (-> arg1 datab 0) 0) + (set! (-> arg1 datab 1) 127) + (set! (-> arg1 datab 2) 0) + (set! (-> arg1 datab 3) 0) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for function check-drop-level-rain +;; INFO: Used lq/sq +(defun check-drop-level-rain ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (< (-> arg2 y) (-> arg1 user-float)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (let ((f30-0 (-> arg1 user-float))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0) + (-> arg1 omega) + (set-vector! + (-> gp-0 vector 1) + (* 0.007874016 (the float (-> arg1 datab 0))) + (* 0.007874016 (the float (-> arg1 datab 1))) + (* 0.007874016 (the float (-> arg1 datab 2))) + 0.0 + ) + (set-vector! (-> gp-0 vector 2) 0.0 0.0 1.0 0.0) + (vector-cross! (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (-> gp-0 vector 2)) + (set! (-> gp-0 trans quad) (-> s4-0 quad)) + (set! (-> *part-id-table* 62 init-specs 23 initial-valuef) (vector-y-angle (-> gp-0 vector 1))) + (set! (-> *part-id-table* 62 init-specs 22 initial-valuef) (- 16384.0 (vector-x-angle (-> gp-0 vector 1)))) + (set! (-> *part-id-table* 62 init-specs 16 initial-valuef) f30-0) + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 62) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (case (-> arg1 datab 3) + ((11 10) + (sound-play "sizzle-drips") + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 66) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + (sp-launch-particles-var + *sp-particle-system-2d* + (-> *part-id-table* 65) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + (else + (sound-play "dry-drips") + (set! (-> *part-id-table* 64 init-specs 10 initial-valuef) (-> arg1 omega)) + (sp-launch-particles-var + *sp-particle-system-3d* + (-> *part-id-table* 64) + gp-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) + ) + ) + ) + ) + (none) + ) + +;; definition for function check-drop-level-rain2 +;; WARN: Return type mismatch symbol vs none. +(defun check-drop-level-rain2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (if (< (-> arg2 y) (-> arg1 user-float)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; definition for function check-drop-level-splash +;; WARN: Return type mismatch symbol vs none. +(defun check-drop-level-splash ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (sparticle-motion-blur arg0 arg1 arg2) + (if (< (-> arg2 y) (-> arg1 user-float)) + (sp-kill-particle arg0 arg1) + ) + (none) + ) + +;; definition for function update-rain +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun update-rain ((arg0 float) (arg1 vector) (arg2 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 x) (-> arg2 x)) + (set! (-> v1-0 y) 0.0) + (set! (-> v1-0 z) (-> arg2 z)) + (set! (-> v1-0 w) 1.0) + (let ((gp-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 v1-0 0.0))) + (let ((t9-0 matrix-local->world) + (a0-3 #f) + ) + (let* ((s4-0 (t9-0 a0-3)) + (f28-0 (lerp-scale 122.88 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + (f30-0 (lerp-scale 2048.0 245.76 (fabs (-> s4-0 vector 2 y)) 0.0 0.7)) + ) + (let ((f26-0 (lerp-scale 0.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + (f0-11 (lerp-scale 1.0 0.1 (-> s4-0 vector 2 y) 0.3 0.7)) + ) + (if (< 0.0 f26-0) + (send-event *camera* 'part-water-drip f26-0 f0-11) + ) + ) + (set! (-> *part-id-table* 60 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 60 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 61 init-specs 5 random-rangef) f28-0) + (set! (-> *part-id-table* 60 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 60 init-specs 6 random-rangef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 61 init-specs 6 random-rangef) f30-0) + ) + ) + (set! (-> *part-id-table* 60 init-specs 2 initial-valuef) arg0) + (set! (-> *part-id-table* 61 init-specs 2 initial-valuef) (* 4.0 arg0)) + (let ((t9-6 sp-launch-particles-var) + (a0-10 *sp-particle-system-2d*) + (a1-7 (-> *part-id-table* 60)) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> gp-1 quad)) + (t9-6 a0-10 a1-7 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-7 sp-launch-particles-var) + (a0-11 *sp-particle-system-2d*) + (a1-8 (-> *part-id-table* 61)) + (a2-6 *launch-matrix*) + ) + (set! (-> a2-6 trans quad) (-> gp-1 quad)) + (t9-7 a0-11 a1-8 a2-6 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + 0 + (none) + ) + +;; definition for function cam-master-effect +;; WARN: Return type mismatch int vs none. +(defbehavior cam-master-effect camera-master () + (when (not (or (movie?) (>= (+ (-> self clock frame-counter) (seconds -10)) (-> self water-drip-time)))) + (set! (-> *part-id-table* 46 init-specs 1 initial-valuef) (-> self water-drip-mult)) + (set! (-> *part-id-table* 45 init-specs 1 initial-valuef) (* 0.9 (-> self water-drip-mult))) + (set! (-> *part-id-table* 43 init-specs 11 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (set! (-> *part-id-table* 44 init-specs 8 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (set! (-> *part-id-table* 41 init-specs 11 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (set! (-> *part-id-table* 42 init-specs 8 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) + (spawn (-> self water-drip) *zero-vector*) + ) + 0 + (none) + ) + +;; definition for function sparticle-track-sun +;; WARN: Return type mismatch int vs none. +(defun sparticle-track-sun ((arg0 int) (arg1 sparticle-cpuinfo) (arg2 matrix)) + (-> arg1 key) + (let* ((s3-0 (the int (-> arg1 user-float))) + (s5-0 (math-camera-pos)) + (s4-0 (+ (the-as uint (-> *sky-work* upload-data)) (* (/ s3-0 4) 64))) + ) + (let ((v1-3 (/ s3-0 4))) + (cond + ((zero? v1-3) + (set! (-> arg2 vector 1 z) (+ 8192.0 (* 0.5 (vector-y-angle (-> (math-camera-matrix) vector 2))))) + ) + ((= v1-3 1) + (set! (-> arg2 vector 1 z) (+ -8192.0 (* 0.5 (vector-y-angle (-> (math-camera-matrix) vector 2))))) + ) + ) + ) + (let ((v1-12 (vector+float*! (new 'stack-no-clear 'vector) s5-0 (the-as vector s4-0) 4096.0))) + (set! (-> arg2 vector 0 x) (-> v1-12 x)) + (set! (-> arg2 vector 0 y) (-> v1-12 y)) + (set! (-> arg2 vector 0 z) (-> v1-12 z)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-sun + :id 3 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 67 :flags (bit6)) (sp-item 68 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 67 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2550)) + (sp-flt spt-rot-x 307200.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 2550)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 16.0) + (sp-flt spt-a 70.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpart 68 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 12000)) + (sp-flt spt-rot-x 307200.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 12000)) + (sp-flt spt-r 64.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 0.0) + (sp-flt spt-a 80.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 1.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-green-sun + :id 4 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 69 :flags (bit6)) (sp-item 70 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 69 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 1500)) + (sp-flt spt-rot-x 204800.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 1500)) + (sp-flt spt-r 16.0) + (sp-flt spt-g 64.0) + (sp-flt spt-b 32.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 4.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpart 70 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 3000)) + (sp-flt spt-rot-x 204800.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 3000)) + (sp-flt spt-r 0.0) + (sp-flt spt-g 43.0) + (sp-flt spt-b 8.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 4.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-moon + :id 5 + :flags (always-draw) + :bounds (static-bspherem 0 0 0 70) + :parts ((sp-item 71 :flags (bit6))) + ) + +;; failed to figure out what this is: +(defpart 71 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 6000)) + (sp-flt spt-rot-x 544768.0) + (sp-flt spt-rot-z (degrees 30.0)) + (sp-flt spt-scale-y (meters 6000)) + (sp-flt spt-r 16.0) + (sp-flt spt-g 32.0) + (sp-flt spt-b 64.0) + (sp-flt spt-a 64.0) + (sp-flt spt-omega 0.0) + (sp-int spt-timer -1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow) + (sp-flt spt-userdata 8.0) + (sp-func spt-func 'sparticle-track-sun) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc index dd48d317a2..969c3e118c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc @@ -22,6 +22,7 @@ (friction float :offset-assert 96) (timer int32 :offset-assert 100) (flags sp-cpuinfo-flag :offset-assert 104) + (flags-s32 sp-cpuinfo-flag-s32 :offset 104) (user-int32 int32 :offset-assert 108) (user-uint32 uint32 :offset 108) (user-float float :offset 108) @@ -39,7 +40,7 @@ (key-alt sparticle-launch-state :offset 132) (binding sparticle-launch-state :offset-assert 136) (data uint32 1 :offset 12) - (datab uint8 4 :offset 12) + (datab int8 4 :offset 12) (dataf float 1 :offset 12) (datac uint8 1 :offset 12) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index 39987b36b3..7d29221fad 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -96,7 +96,7 @@ :flag-assert #xb00000010 (:methods (get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec 9) - (sparticle-launcher-method-10 (_type_ string) none 10) + (setup-user-array (_type_ string) none 10) ) ) @@ -272,10 +272,10 @@ :flag-assert #x1000000070 (:methods (initialize (_type_ sparticle-launch-group process) none 9) - (sparticle-launch-control-method-10 (_type_ vector) symbol 10) + (is-visible? (_type_ vector) symbol 10) (spawn (_type_ vector) none 11) - (sparticle-launch-control-method-12 (_type_ matrix) none 12) - (sparticle-launch-control-method-13 (_type_ cspace) none 13) + (spawn-with-matrix (_type_ matrix) none 12) + (spawn-with-cspace (_type_ cspace) none 13) (kill-and-free-particles (_type_) none 14) (kill-particles (_type_) none 15) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index edd52bf81e..44724a183a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -397,7 +397,32 @@ (kmemclose) ;; definition for function particle-setup-adgif -;; ERROR: function has no type analysis. Cannot decompile. +;; 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 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x9b :page #xb))) + (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-alpha :b #x1 :d #x1)) + (set! (-> arg0 clamp) (new 'static 'gs-clamp :minu #x13 :minv #x101)) + 0 + (none) + ) ;; definition of type particle-adgif-cache (deftype particle-adgif-cache (basic) @@ -454,7 +479,44 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function particle-adgif-callback -;; ERROR: function was not converted to expressions. Cannot decompile. +;; 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 @@ -909,223 +971,81 @@ ) ;; definition for function sp-relaunch-particle-3d -;; ERROR: failed type prop at 32: Could not figure out load: (set! a1 (l.w (+ gp 104))) -(defun sp-relaunch-particle-3d ((a0-0 object) (a1-0 sparticle-launcher) (a2-0 sparticle-cpuinfo) (a3-0 sprite-vec-data-3d)) - (local-vars - (v0-0 none) - (v0-1 none) - (v0-2 none) - (v0-3 none) - (v0-4 none) - (v1-0 quaternion) - (v1-1 none) - (v1-2 none) - (v1-3 none) - (v1-4 none) - (v1-5 none) - (v1-6 none) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-12 none) - (v1-13 none) - (v1-14 none) - (v1-16 none) - (v1-17 none) - (v1-18 none) - (a0-1 none) - (a0-2 none) - (a0-4 none) - (a0-6 none) - (a1-1 none) - (a1-2 none) - (a1-3 none) - (a1-4 none) - (a1-6 none) - (a2-1 sprite-vec-data-3d) - (a2-2 int) - (a2-4 sparticle-cpuinfo) - (a2-5 none) - (a3-1 sprite-vec-data-3d) - (s3-0 none) - (s4-0 quaternion) - (t9-0 (function object sparticle-launcher sparticle-cpuinfo sprite-vec-data-3d none)) - (t9-1 none) - (t9-2 none) - (t9-3 none) - (sp-0 none) - (f0-0 float) - (f0-1 float) - (f0-2 float) - (f0-3 float) - (f0-4 float) - (f0-5 float) - (f0-6 float) - (f0-7 none) - (f0-8 none) - (f0-9 none) - (f0-10 none) - (f0-11 none) - (f0-12 none) - (f0-13 none) - (f0-14 none) - (f0-15 none) - (f0-16 none) - (f0-17 none) - (f0-18 none) - (f0-19 none) - (f0-20 none) - (f0-21 none) - (f0-22 none) - (f0-23 none) - (f1-0 float) - (f1-1 float) - (f1-2 float) - (f1-3 none) - (f1-4 none) - (f1-5 none) - (f1-6 none) - (f1-7 none) - (f1-8 none) - (f1-9 none) - (f2-0 float) - (f2-1 float) - (f2-2 float) - (f3-0 float) - ) +;; 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) - (when (begin - (set! s4-0 (new 'stack-no-clear 'quaternion)) - (set! v1-0 s4-0) - (set! a2-1 a3-0) - (set! f0-0 (-> a2-1 qx-qy-qz-sy x)) - (set! f1-0 (-> a2-1 qx-qy-qz-sy y)) - (set! 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! a2-2 #x3f800000) - (set! f3-0 (the-as float (gpr->fpr a2-2))) - (set! f2-1 (*.s f2-0 f2-0)) - (set! f2-2 (-.s f3-0 f2-1)) - (set! f1-1 (*.s f1-0 f1-0)) - (set! f1-2 (-.s f2-2 f1-1)) - (set! f0-1 (*.s f0-0 f0-0)) - (set! f0-2 (-.s f1-2 f0-1)) - (set! f0-3 (sqrt.s f0-2)) - (set! (-> v1-0 w) f0-3) - (set! a2-3 (fpr->gpr f0-3)) - (set! f0-4 (the-as float 0)) - (set! (-> a3-0 qx-qy-qz-sy x) f0-4) - (set! f0-5 (the-as float 0)) - (set! (-> a3-0 qx-qy-qz-sy y) f0-5) - (set! f0-6 (the-as float 0)) - (set! (-> a3-0 qx-qy-qz-sy z) f0-6) - (set! t9-0 sp-relaunch-setup-fields) - (set! a2-4 a2-0) - (set! a3-1 a3-0) - (call! a0-0 a1-0 a2-4 a3-1) - (set! a1-1 (the-as none (l.w (+ a2-0 104)))) - (set! v1-1 (the-as none -2)) - (set! a0-1 (the-as none (-> a3-0 r-g-b-a x))) - (set! a1-2 (the-as none (logand a1-1 #x4000))) - (set! a2-5 (the-as none 1)) - (set! a1-3 (the-as none (sra a1-2 14))) - (set! v1-2 (the-as none (logand a0-1 v1-1))) - (set! v1-3 (the-as none (logior v1-2 a1-3))) - (set! (-> a3-0 r-g-b-a x) (the-as float v1-3)) - (set! a1-4 (the-as none (+ sp-0 32))) - (set! s3-0 (the-as none (+ sp-0 48))) - (set! v1-4 (the-as none a1-4)) - (set! f0-7 (the-as none (-> a3-0 qx-qy-qz-sy x))) - (s.f! v1-4 f0-7) - (set! f0-8 (the-as none (-> a3-0 qx-qy-qz-sy y))) - (s.f! (+ v1-4 4) f0-8) - (set! f0-9 (the-as none (-> a3-0 qx-qy-qz-sy z))) - (s.f! (+ v1-4 8) f0-9) - (set! a0-2 (the-as none #x3f800000)) - (set! f0-10 (the-as none (gpr->fpr a0-2))) - (s.f! (+ v1-4 12) f0-10) - (set! t9-1 (the-as none quaternion-zxy!)) - (set! a0-3 (the-as none s3-0)) - (call!) - (set! v1-5 (the-as none #x40000)) - (set! a0-4 (the-as none (-> a2-0 flags))) - (set! v1-6 (the-as none (logand v1-5 a0-4))) - (nonzero? v1-6) + (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 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14))) + ) + 1 + (let ((a1-3 (sar (the-as int 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! t9-2 (the-as none quaternion*!)) - (set! a0-5 (the-as none s3-0)) - (set! a2-6 (the-as none s3-0)) - (set! a1-5 (the-as none s4-0)) - (call!) - (set! v1-8 (the-as none v0-2)) - ) - (cond - ((begin (set! f0-11 (the-as none (l.f (+ s3-0 12)))) (set! f1-3 (the-as none 0)) (<.s f0-11 f1-3)) - (.lvf vf1 (+ a3-0 16)) - (.lvf vf2 s3-0) - (.sub.vf vf1 vf0 vf2 :mask #b111) - (s.vf! (+ a3-0 16) vf1) - (.mov v1-9 vf1) - ) - (else - (.lvf vf1 (+ a3-0 16)) - (.lvf vf2 s3-0) - (.add.vf vf1 vf0 vf2 :mask #b111) - (s.vf! (+ a3-0 16) vf1) - (.mov v1-10 vf1) + (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 vec 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 vec quad)) + (.add.vf vf1 vf0 vf2 :mask #b111) + (.svf (&-> arg3 qx-qy-qz-sy quad) vf1) + (.mov v1-10 vf1) + ) + ) ) ) (cond - ((begin (set! v1-11 (the-as none *sp-60-hz*)) v1-11) - (set! v1-12 (the-as none #x40a00000)) - (set! f0-12 (the-as none (gpr->fpr v1-12))) - (set! f1-4 (the-as none (l.f (+ a2-0 32)))) - (set! f0-13 (the-as none (*.s f0-12 f1-4))) - (s.f! (+ a2-0 32) f0-13) - (set! v1-13 (the-as none #x40a00000)) - (set! f0-14 (the-as none (gpr->fpr v1-13))) - (set! f1-5 (the-as none (l.f (+ a2-0 36)))) - (set! f0-15 (the-as none (*.s f0-14 f1-5))) - (s.f! (+ a2-0 36) f0-15) - (set! v1-14 (the-as none #x40a00000)) - (set! f0-16 (the-as none (gpr->fpr v1-14))) - (set! f1-6 (the-as none (l.f (+ a2-0 40)))) - (set! f0-17 (the-as none (*.s f0-16 f1-6))) - (s.f! (+ a2-0 40) f0-17) - (set! v1-15 (the-as none (fpr->gpr f0-17))) - ) + (*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! v1-16 (the-as none #x40c00000)) - (set! f0-18 (the-as none (gpr->fpr v1-16))) - (set! f1-7 (the-as none (l.f (+ a2-0 32)))) - (set! f0-19 (the-as none (*.s f0-18 f1-7))) - (s.f! (+ a2-0 32) f0-19) - (set! v1-17 (the-as none #x40c00000)) - (set! f0-20 (the-as none (gpr->fpr v1-17))) - (set! f1-8 (the-as none (l.f (+ a2-0 36)))) - (set! f0-21 (the-as none (*.s f0-20 f1-8))) - (s.f! (+ a2-0 36) f0-21) - (set! v1-18 (the-as none #x40c00000)) - (set! f0-22 (the-as none (gpr->fpr v1-18))) - (set! f1-9 (the-as none (l.f (+ a2-0 40)))) - (set! f0-23 (the-as none (*.s f0-22 f1-9))) - (s.f! (+ a2-0 40) f0-23) - (set! v1-19 (the-as none (fpr->gpr f0-23))) + (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))) ) ) - (set! t9-3 (the-as none quaternion-zxy!)) - (set! a0-6 (the-as none (+ a2-0 80))) - (set! a1-6 (the-as none (+ a2-0 32))) - (call!) - (set! v1-20 (the-as none v0-3)) - (set! v0-4 (the-as none 0)) - (ret-none) + (quaternion-zxy! (-> arg2 rotvel3d) (-> arg2 rot-syvel)) + 0 + (none) ) ) @@ -1257,7 +1177,7 @@ ) ;; definition for method 10 of type sparticle-launch-control -(defmethod sparticle-launch-control-method-10 sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) (let* ((v1-0 (-> obj group)) (f0-0 (-> v1-0 bounds r)) ) @@ -1290,7 +1210,7 @@ ;; definition for method 12 of type sparticle-launch-control ;; INFO: Used lq/sq -(defmethod sparticle-launch-control-method-12 sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix)) +(defmethod spawn-with-matrix sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix)) (let* ((a2-0 (-> obj origin)) (a3-0 arg0) (v1-0 (-> a3-0 vector 0 quad)) @@ -1338,7 +1258,7 @@ ;; definition for method 13 of type sparticle-launch-control ;; INFO: Used lq/sq -(defmethod sparticle-launch-control-method-13 sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace)) +(defmethod spawn-with-cspace sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace)) (let* ((v1-0 (-> obj origin)) (a3-0 (-> arg0 bone transform)) (a0-2 (-> a3-0 vector 0 quad)) @@ -1391,10 +1311,7 @@ (defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) (with-pp (set! (-> obj origin trans quad) (-> arg0 quad)) - (if (not (or (sparticle-launch-control-method-10 obj arg0) - (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)) - ) - ) + (if (not (or (is-visible? obj arg0) (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)))) (return 0) ) (let ((s4-0 (the-as int (-> pp clock frame-counter))) @@ -1580,280 +1497,110 @@ ;; definition for function execute-part-engine ;; INFO: Used lq/sq -;; ERROR: failed type prop at 12: Could not figure out load: (set! a1 (l.wu (+ a0 132))) ;; WARN: Return type mismatch int vs none. (defun execute-part-engine () - (local-vars - (v0-0 none) - (v0-1 none) - (v0-2 none) - (v0-3 vector) - (v0-4 float) - (v0-5 none) - (v0-6 int) - (v1-0 engine) - (v1-1 connectable) - (v1-2 none) - (v1-3 none) - (v1-4 none) - (v1-5 none) - (v1-6 none) - (v1-7 none) - (v1-8 none) - (v1-9 none) - (v1-12 int) - (v1-13 int) - (v1-14 int) - (v1-15 int) - (v1-16 level) - (v1-17 int) - (v1-18 int) - (v1-19 int) - (v1-20 symbol) - (v1-21 int) - (v1-22 symbol) - (v1-23 symbol) - (v1-25 vector) - (v1-28 level-group) - (v1-29 int) - (a0-1 connectable) - (a0-2 basic) - (a0-3 none) - (a0-4 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-11 none) - (a0-12 engine) - (a0-13 connectable) - (a0-14 (pointer time-of-day-proc)) - (a0-15 time-of-day-proc) - (a0-16 int) - (a0-18 level-group) - (a0-19 symbol) - (a0-22 vector) - (a0-23 connectable) - (a0-24 int) - (a0-25 sparticle-system) - (a1-0 none) - (a1-1 none) - (a1-3 none) - (a1-4 none) - (a1-5 none) - (a1-6 none) - (a1-8 none) - (a1-10 none) - (a1-12 symbol) - (a1-13 (pointer basic)) - (a1-14 connectable) - (a2-0 none) - (a2-1 none) - (a2-2 none) - (a2-5 matrix) - (a3-0 none) - (a3-2 vector) - (a3-3 uint128) - (a3-4 symbol) - (t0-0 none) - (t0-1 none) - (t0-3 symbol) - (t1-0 none) - (t1-1 float) - (s0-0 none) - (s0-1 connection) - (s1-0 connectable) - (s1-1 int) - (s2-0 vector) - (s2-1 engine) - (s3-0 matrix) - (s3-1 int) - (s4-0 (array sparticle-launcher)) - (s4-1 int) - (s5-0 engine) - (s5-1 vector) - (t9-0 none) - (t9-1 none) - (t9-2 none) - (t9-3 (function vector)) - (t9-4 (function vector vector float)) - (t9-5 - (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none) - ) - (gp-0 sparticle-system) - (f0-0 none) - (f0-1 none) - (f0-2 float) - (f1-0 none) - (f1-1 int) - (sv-96 none) - (sv-104 none) - ) - (set! gp-0 *sp-particle-system-2d*) - (set! s5-0 *part-engine*) - (set! s4-0 *part-id-table*) - (set! s3-0 (new 'stack-no-clear 'matrix)) - (set! s2-0 (new 'stack-no-clear 'vector)) - (set! v1-0 s5-0) - (set! v1-1 (-> v1-0 alive-list next0)) - (set! a0-0 s5-0) - (set! a0-1 v1-1) - (set! s1-0 (-> a0-1 next0)) - (while (begin (set! a0-12 s5-0) (set! a0-13 (-> a0-12 alive-list-end)) (!= v1-1 a0-13)) - (when (begin - (and (begin - (set! a0-2 (-> v1-1 param1)) - (set! a1-0 (the-as none (l.wu (+ a0-2 132)))) - (set! s0-0 (the-as none (l.w (+ v1-1 28)))) - (set! a2-0 (the-as none (l.hu (+ a1-0 4)))) - (set! a2-1 (the-as none (logand a2-0 8))) - (nonzero? a2-1) - ) - (begin - (set! f0-0 (the-as none (l.f (+ a1-0 108)))) - (set! f1-0 (the-as none (l.f (+ s0-0 12)))) - (set! a1-1 (the-as none (<.s f0-0 f1-0))) - ) - ) - a1-1 - ) - (when (begin - (set! a1-3 (the-as none (l.w (+ v1-1 24)))) - (set! a1-4 (the-as none (sll a1-3 2))) - (set! a1-5 (the-as none (+ a1-4 s4-0))) - (set! a1-6 (the-as none (l.wu (+ a1-5 12)))) - (set! sv-96 a1-6) - (set! v1-2 (the-as none (l.wu (+ v1-1 16)))) - (set! sv-104 v1-2) - (set! v1-3 sv-96) - (nonzero? v1-3) + (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 vector 0 quad)) + (a2-2 (-> t0-0 vector 1 quad)) + (a3-0 (-> t0-0 vector 2 quad)) + (t0-1 (-> t0-0 trans quad)) + ) + (set! (-> v1-7 vector 0 quad) a0-5) + (set! (-> v1-7 vector 1 quad) a2-2) + (set! (-> v1-7 vector 2 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) + (sp-launch-particles-var + gp-0 + sv-96 + s3-0 + (the-as sparticle-launch-state #f) + (the-as sparticle-launch-control #f) + 1.0 + ) ) - (set! v1-4 sv-104) - (set! v1-5 (the-as none (sll v1-4 5))) - (set! v1-6 (the-as none (+ v1-5 12))) - (set! a0-3 (the-as none (l.wu (+ a0-2 128)))) - (set! a1-8 (the-as none (+ v1-6 a0-3))) - (set! v1-7 (the-as none s3-0)) - (set! a0-4 (the-as none (l.wu (+ a1-8 16)))) - (set! t0-0 (the-as none (+ a0-4 0))) - (set! a0-5 (the-as none (l.q t0-0))) - (set! a2-2 (the-as none (l.q (+ t0-0 16)))) - (set! a3-0 (the-as none (l.q (+ t0-0 32)))) - (set! t0-1 (the-as none (l.q (+ t0-0 48)))) - (s.q! v1-7 a0-5) - (s.q! (+ v1-7 16) a2-2) - (s.q! (+ v1-7 32) a3-0) - (s.q! (+ v1-7 48) t0-1) - (set! t9-0 (the-as none vector<-cspace!)) - (set! a0-6 (the-as none (+ s3-0 48))) - (call!) - (set! v1-8 (the-as none s2-0)) - (set! a0-7 (the-as none (l.q s0-0))) - (s.q! v1-8 a0-7) - (set! v1-9 (the-as none #x3f800000)) - (set! f0-1 (the-as none (gpr->fpr v1-9))) - (s.f! (+ s2-0 12) f0-1) - (set! t9-1 (the-as none vector-matrix*!)) - (set! a0-8 (the-as none (+ s3-0 48))) - (set! a1-9 (the-as none s2-0)) - (set! a2-3 (the-as none s3-0)) - (call!) - (set! t9-2 (the-as none sp-launch-particles-var)) - (set! a0-9 (the-as none gp-0)) - (set! a1-10 sv-96) - (set! a2-4 (the-as none s3-0)) - (set! t1-0 (the-as none #x3f800000)) - (call!) - (set! a1-11 (the-as none v0-2)) + ) + ) + (set! v1-1 s1-0) + (set! s1-0 (-> s1-0 next0)) ) ) - (set! v1-1 (the-as connectable s1-0)) - (set! a0-10 (the-as none s5-0)) - (set! a0-11 (the-as none (l.wu s1-0))) - (set! s1-0 (the-as connectable a0-11)) - ) - (cond - ((begin - (set! t9-3 camera-pos) - (set! v0-3 (call!)) - (set! s5-1 v0-3) - (set! v1-12 1) - (set! a0-14 *time-of-day*) - a0-14 - ) - (set! a0-15 (-> a0-14 0)) - (set! a0-16 (-> a0-15 hours)) - ) - (else - (set! a0-16 0) - ) - ) - (set! s4-1 (ash.si v1-12 a0-16)) - (set! s3-1 0) - (while (begin (set! v1-28 *level*) (set! v1-29 (-> v1-28 length)) (<.si s3-1 v1-29)) - (when (begin - (set! v1-13 5232) - (set! v1-14 (*.si v1-13 s3-1)) - (set! v1-15 (+ v1-14 256)) - (set! a0-18 *level*) - (set! v1-16 (+ v1-15 a0-18)) - (set! a0-19 'active) - (set! a1-12 (-> v1-16 status)) - (= a1-12 a0-19) - ) - (when (begin (set! s2-1 (-> v1-16 part-engine)) s2-1) - (set! s1-1 (-> s2-1 length)) - (while (nonzero? s1-1) - (when (begin - (or (begin - (set! s1-1 (+ s1-1 -1)) - (set! v1-17 (sll s1-1 5)) - (set! v1-18 (+ v1-17 92)) - (set! s0-1 (+ v1-18 s2-1)) - (set! v1-19 (-> s0-1 param3)) - (zero? v1-19) - ) - (begin - (set! t9-4 vector-vector-distance) - (set! a0-22 s5-1) - (set! a1-13 (&-> s0-1 param0)) - (set! v0-4 (call! a0-22 a1-13)) - (set! f0-2 (gpr->fpr v0-4)) - (set! v1-21 (-> s0-1 param3)) - (set! f1-1 (gpr->fpr v1-21)) - (set! v1-20 (<.s f0-2 f1-1)) + (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)))) + ) + (zero? (logand 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 + ) ) ) - (and v1-20 (begin - (set! v1-23 #t) - (set! a0-23 (-> s0-1 prev1)) - (set! a0-24 (logand s4-1 a0-23)) - (cmove-#f-nonzero v1-22 a0-24 v1-23) - ) - ) - v1-22 + ) ) - (set! a1-14 (-> s0-1 next1)) - (set! t9-5 sp-launch-particles-var) - (set! a0-25 gp-0) - (set! a2-5 *launch-matrix*) - (set! v1-25 (-> a2-5 trans)) - (set! a3-2 (the-as vector (&-> s0-1 param0))) - (set! a3-3 (-> a3-2 quad)) - (set! (-> v1-25 quad) a3-3) - (set! a3-4 #f) - (set! t0-3 #f) - (set! t1-1 (the-as float #x3f800000)) - (call! a0-25 a1-14 a2-5 a3-4 t0-3 t1-1) - (set! v1-26 v0-5) + ) + ) ) ) ) ) - (set! s3-1 (+ s3-1 1)) ) - (set! v0-6 0) - (ret-none) + 0 + (none) ) ;; definition for function sparticle-track-root @@ -2081,873 +1828,302 @@ ;; definition for function sparticle-respawn-heights ;; INFO: Used lq/sq -;; ERROR: failed type prop at 12: Could not figure out load: (set! v1 (l.w (+ gp 16))) -(defun sparticle-respawn-heights ((a0-0 sparticle-system) (a1-0 sparticle-cpuinfo) (a2-0 vector)) - (local-vars - (v0-0 none) - (v0-1 none) - (v0-2 none) - (v1-0 none) - (v1-1 symbol) - (v1-2 none) - (v1-3 none) - (v1-4 none) - (v1-5 none) - (v1-7 none) - (v1-8 none) - (v1-10 none) - (v1-11 none) - (v1-12 none) - (v1-13 none) - (v1-14 none) - (v1-15 none) - (v1-16 none) - (v1-17 none) - (a0-1 none) - (a1-2 none) - (a1-3 none) - (a2-1 none) - (a3-0 none) - (a3-1 none) - (t1-0 none) - (s1-0 none) - (s2-0 none) - (s3-0 none) - (s5-1 none) - (t9-0 none) - (t9-1 none) - (gp-0 float) - (sp-0 none) - (f0-0 float) - (f0-1 float) - (f0-2 none) - (f0-3 none) - (f0-4 none) - (f0-5 none) - (f0-6 none) - (f0-7 none) - (f1-0 float) - (f1-1 none) - (f1-2 none) - (f1-3 none) - ) - (when (begin - (and (begin (set! gp-0 (-> a1-0 user-float)) (nonzero? gp-0)) - (or (begin - (and (begin (set! f0-0 (-> a1-0 vel-sxvel y)) (set! f1-0 (the-as float 0)) (set! v1-1 (<.s f0-0 f1-0)) v1-1) - (begin - (set! f0-1 (-> a2-0 y)) - (set! v1-3 (the-as none (l.w (+ gp-0 16)))) - (set! f1-1 (the-as none (gpr->fpr v1-3))) - (set! v1-2 (the-as none (<.s f0-1 f1-1))) - ) - ) - v1-2 - ) - (and (begin - (set! f0-2 (the-as none 0)) - (set! f1-2 (the-as none (l.f (+ a1-0 20)))) - (set! v1-4 (the-as none (<.s f0-2 f1-2))) - v1-4 - ) - (begin - (set! v1-5 (the-as none (l.w (+ gp-0 20)))) - (set! f0-3 (the-as none (gpr->fpr v1-5))) - (set! f1-3 (the-as none (l.f (+ a2-0 4)))) - (set! v1-0 (the-as none (<.s f0-3 f1-3))) - ) - ) +;; 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))) ) ) - v1-0 - ) - (when (begin - (set! t9-0 (the-as none sp-kill-particle)) - (set! a1-1 (the-as none a1-0)) - (call!) - (set! v1-7 (the-as none (l.w gp-0))) - (set! s3-0 (the-as none (+ v1-7 -1))) - (set! v1-8 (the-as none 2)) - (<.si v1-8 s3-0) + (sp-kill-particle arg0 arg1) + (let ((s3-0 (+ (the-as int (-> 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) + ) + ) ) - (if (begin (set! s2-0 (the-as none (+ sp-0 16))) (set! v1-10 (the-as none (l.w (+ gp-0 12)))) (zero? v1-10)) - (set! s1-0 (the-as none *sp-particle-system-2d*)) - (set! s1-0 (the-as none *sp-particle-system-3d*)) ) - (set! v1-11 (the-as none s2-0)) - (set! f0-4 (the-as none (l.f a2-0))) - (s.f! v1-11 f0-4) - (set! f0-5 (the-as none (l.f (+ a1-0 108)))) - (s.f! (+ v1-11 4) f0-5) - (set! f0-6 (the-as none (l.f (+ a2-0 8)))) - (s.f! (+ v1-11 8) f0-6) - (set! a0-1 (the-as none #x3f800000)) - (set! f0-7 (the-as none (gpr->fpr a0-1))) - (s.f! (+ v1-11 12) f0-7) - (set! s5-1 (the-as none 3)) - (while (>=.si s3-0 s5-1) - (set! t9-1 (the-as none sp-launch-particles-var)) - (set! a0-2 (the-as none s1-0)) - (set! v1-12 (the-as none (sll s5-1 2))) - (set! v1-13 (the-as none (+ v1-12 gp-0))) - (set! v1-14 (the-as none (l.w (+ v1-13 12)))) - (set! v1-15 (the-as none (sll v1-14 2))) - (set! a1-2 (the-as none *part-id-table*)) - (set! v1-16 (the-as none (+ v1-15 a1-2))) - (set! a1-3 (the-as none (l.wu (+ v1-16 12)))) - (set! a2-1 (the-as none *launch-matrix*)) - (set! v1-17 (the-as none (+ a2-1 48))) - (set! a3-0 (the-as none s2-0)) - (set! a3-1 (the-as none (l.q a3-0))) - (s.q! v1-17 a3-1) - (set! t1-0 (the-as none #x3f800000)) - (call!) - (set! s5-1 (the-as none (+ s5-1 1))) ) ) ) - (set! v0-2 (the-as none 0)) - (ret-none) + 0 + (none) ) ;; definition for function sparticle-respawn-timer ;; INFO: Used lq/sq -;; ERROR: failed type prop at 9: Could not figure out load: (set! v1 (l.w gp)) -(defun sparticle-respawn-timer ((a0-0 sparticle-system) (a1-0 sparticle-cpuinfo) (a2-0 vector)) - (local-vars - (v0-0 symbol) - (v0-1 none) - (v0-2 none) - (v1-0 int) - (v1-3 none) - (v1-4 none) - (v1-6 none) - (v1-7 none) - (v1-8 none) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-12 none) - (v1-13 none) - (a0-1 none) - (a1-1 sparticle-cpuinfo) - (a1-2 none) - (a1-3 none) - (a2-1 none) - (a3-0 none) - (a3-1 none) - (t1-0 none) - (s2-1 none) - (s3-0 none) - (s4-0 none) - (s5-0 none) - (t9-0 (function sparticle-system sparticle-cpuinfo symbol)) - (t9-1 none) - (gp-0 float) - (sp-0 none) - (f0-0 none) - (f0-1 none) - (f0-2 none) - (f0-3 none) - ) - (when (begin (set! v1-0 (-> a1-0 timer)) (<=0.si v1-0)) - (when (begin (set! gp-0 (-> a1-0 user-float)) (nonzero? gp-0)) - (when (begin - (set! t9-0 sp-kill-particle) - (set! a1-1 a1-0) - (call! a0-0 a1-1) - (set! v1-3 (the-as none (l.w gp-0))) - (set! s5-0 (the-as none (+ v1-3 -1))) - (set! v1-4 (the-as none 2)) - (<.si v1-4 s5-0) +;; 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 object (-> arg1 user-float)))) + (when (nonzero? (the-as float gp-0)) + (sp-kill-particle arg0 arg1) + (let ((s5-0 (+ (the-as int (-> (the-as (array int32) gp-0) length)) -1))) + (when (< 2 s5-0) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (if (zero? (-> (the-as (array int32) 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* (-> (the-as (array int32) 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) + ) + ) ) - (if (begin (set! s4-0 (the-as none (+ sp-0 16))) (set! v1-6 (the-as none (l.w (+ gp-0 12)))) (zero? v1-6)) - (set! s3-0 (the-as none *sp-particle-system-2d*)) - (set! s3-0 (the-as none *sp-particle-system-3d*)) ) - (set! v1-7 (the-as none s4-0)) - (set! f0-0 (the-as none (l.f a2-0))) - (s.f! v1-7 f0-0) - (set! f0-1 (the-as none (l.f (+ a1-0 108)))) - (s.f! (+ v1-7 4) f0-1) - (set! f0-2 (the-as none (l.f (+ a2-0 8)))) - (s.f! (+ v1-7 8) f0-2) - (set! a0-1 (the-as none #x3f800000)) - (set! f0-3 (the-as none (gpr->fpr a0-1))) - (s.f! (+ v1-7 12) f0-3) - (set! s2-1 (the-as none 3)) - (while (>=.si s5-0 s2-1) - (set! t9-1 (the-as none sp-launch-particles-var)) - (set! a0-2 (the-as none s3-0)) - (set! v1-8 (the-as none (sll s2-1 2))) - (set! v1-9 (the-as none (+ v1-8 gp-0))) - (set! v1-10 (the-as none (l.w (+ v1-9 12)))) - (set! v1-11 (the-as none (sll v1-10 2))) - (set! a1-2 (the-as none *part-id-table*)) - (set! v1-12 (the-as none (+ v1-11 a1-2))) - (set! a1-3 (the-as none (l.wu (+ v1-12 12)))) - (set! a2-1 (the-as none *launch-matrix*)) - (set! v1-13 (the-as none (+ a2-1 48))) - (set! a3-0 (the-as none s4-0)) - (set! a3-1 (the-as none (l.q a3-0))) - (s.q! v1-13 a3-1) - (set! t1-0 (the-as none #x3f800000)) - (call!) - (set! s2-1 (the-as none (+ s2-1 1))) ) ) ) ) - (set! v0-2 (the-as none 0)) - (ret-none) + 0 + (none) ) ;; definition for function sparticle-texture-animate -;; ERROR: failed type prop at 2: Could not figure out load: (set! a0 (l.w (+ v1 20))) -(defun sparticle-texture-animate ((a0-0 sparticle-system) (a1-0 sparticle-cpuinfo) (a2-0 vector)) - (local-vars - (v0-0 none) - (v0-1 none) - (v1-0 float) - (v1-1 none) - (v1-2 none) - (v1-3 none) - (v1-4 none) - (a0-2 none) - (a0-4 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-9 none) - (a0-11 none) - (a0-13 none) - (a0-14 none) - (a0-15 none) - (a0-17 none) - (a2-1 none) - (a2-2 none) - (a2-3 none) - (a2-4 none) - (a2-5 none) - (a2-6 none) - (a2-7 none) - (a3-0 none) - (a3-1 none) - (a3-2 none) - (a3-3 none) - (a3-4 none) - (a3-5 none) - (a3-6 none) - (a3-7 none) - (t0-0 none) - (t0-1 none) - (t0-2 none) - (t0-3 none) - (t0-4 none) - (t9-0 none) - (t9-1 none) - ) - (when (begin (set! v1-0 (-> a1-0 user-float)) (nonzero? v1-0)) - (cond - ((begin - (when (begin (set! a0-2 (the-as none (l.w (+ v1-0 20)))) (zero? a0-2)) - (set! a0-4 (the-as none (l.w (+ a1-0 100)))) - (s.w! (+ v1-0 20) a0-4) - ) - (cond - ((begin - (set! a0-5 (the-as none (l.w v1-0))) - (set! a0-6 (the-as none (+ a0-5 -3))) - (set! a2-1 (the-as none (l.w (+ v1-0 12)))) - (set! a3-0 (the-as none (l.w (+ v1-0 20)))) - (set! t0-0 (the-as none (l.w (+ a1-0 100)))) - (<0.si t0-0) - ) - (set! a3-1 (the-as none *display*)) - (set! a3-2 (the-as none (l.wu (+ a3-1 44)))) - (set! t0-1 (the-as none (l.d (+ a3-2 20)))) - ) - (else - (set! t0-2 (the-as none (l.w (+ a1-0 100)))) - (set! t0-1 (the-as none (- a3-0 t0-2))) +;; 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 (-> v1-0 (+ (max 0 (min (+ (/ t0-1 a2-1) (-> arg1 user1-int16)) (+ a0-6 -1))) 3)))) + (if (nonzero? v1-2) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id v1-2)) + ) ) ) - (set! a3-3 (the-as none (l.w (+ v1-0 16)))) - (zero? a3-3) - ) - (when (begin - (set! a3-4 (the-as none 0)) - (set! a2-2 (the-as none (/.si t0-1 a2-1))) - (set! t0-3 (the-as none (l.hu (+ a1-0 130)))) - (set! a2-3 (the-as none (+ a2-2 t0-3))) - (set! a2-4 (the-as none a2-3)) - (set! a0-7 (the-as none (+ a0-6 -1))) - (set! a2-5 (the-as none (min.si a2-4 a0-7))) - (set! a3-5 (the-as none (max.si a3-4 a2-5))) - (set! a0-8 (the-as none (+ a3-5 3))) - (set! a0-9 (the-as none (sll a0-8 2))) - (set! v1-1 (the-as none (+ a0-9 v1-0))) - (set! v1-2 (the-as none (l.w (+ v1-1 12)))) - (nonzero? v1-2) - ) - (set! t9-0 (the-as none particle-adgif-callback)) - (set! a0-11 (the-as none (l.wu (+ a1-0 4)))) - (set! a1-1 (the-as none v1-2)) - (call!) - (set! a0-12 (the-as none v0-0)) - ) - ) - (else - (when (begin - (set! a3-6 (the-as none 0)) - (set! a2-6 (the-as none (/.si t0-1 a2-1))) - (set! t0-4 (the-as none (l.hu (+ a1-0 130)))) - (set! a2-7 (the-as none (+ a2-6 t0-4))) - (set! a3-7 (the-as none (max.si a3-6 a2-7))) - (set! a0-13 (the-as none (mod.si a3-7 a0-6))) - (set! a0-14 (the-as none (+ a0-13 3))) - (set! a0-15 (the-as none (sll a0-14 2))) - (set! v1-3 (the-as none (+ a0-15 v1-0))) - (set! v1-4 (the-as none (l.w (+ v1-3 12)))) - (nonzero? v1-4) - ) - (set! t9-1 (the-as none particle-adgif-callback)) - (set! a0-17 (the-as none (l.wu (+ a1-0 4)))) - (set! a1-2 (the-as none v1-4)) - (call!) - (set! a0-18 (the-as none v0-1)) + (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)) + ) + ) + ) ) ) ) ) - (ret-none) + (none) ) ;; definition for function sparticle-texture-day-night ;; INFO: Used lq/sq -;; ERROR: failed type prop at 21: Could not figure out load: (set! a1 (l.w (+ s2 40))) +;; WARN: Return type mismatch symbol vs none. ;; ERROR: Bad vector register dependency: vf1 ;; ERROR: Bad vector register dependency: vf2 -(defun sparticle-texture-day-night ((a0-0 sparticle-system) (a1-0 sparticle-cpuinfo) (a2-0 vector)) +(defun sparticle-texture-day-night ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) (local-vars - (v0-0 float) - (v0-1 none) - (v0-2 none) - (v1-1 (pointer time-of-day-proc)) - (v1-2 time-of-day-proc) - (v1-3 symbol) - (v1-4 int) - (v1-6 none) - (v1-7 none) - (v1-8 uint128) (v1-9 uint128) (v1-10 uint128) - (v1-11 none) - (v1-12 uint128) (v1-13 uint128) (v1-14 uint128) - (v1-15 none) - (v1-16 none) - (v1-17 none) - (v1-20 none) - (v1-21 none) - (v1-22 uint128) (v1-23 uint128) (v1-24 uint128) - (v1-25 none) - (v1-26 uint128) (v1-27 uint128) (v1-28 uint128) - (v1-29 none) - (v1-30 none) - (v1-31 none) - (v1-33 none) - (a0-1 symbol) - (a0-2 none) - (a0-4 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-10 none) - (a0-11 none) - (a0-12 none) - (a0-13 none) - (a1-1 none) - (a1-2 none) - (t7-0 none) - (t7-1 none) - (t7-2 none) - (t7-3 none) - (t7-4 none) - (t7-5 none) - (s1-0 int) - (s2-0 float) + (v1-33 float) + (a0-5 float) + (a0-11 float) + (t7-0 float) + (t7-3 float) (s3-0 float) (s4-0 float) - (t9-0 (function float)) - (t9-1 none) - (t9-2 none) - (f0-0 float) ) (rlet ((vf1 :class vf) (vf2 :class vf) ) - (when (begin (set! s2-0 (-> a1-0 user-float)) (nonzero? s2-0)) - (cond - ((begin - (or (begin - (cond - ((begin (set! v1-1 *time-of-day*) v1-1) - (set! v1-2 (-> v1-1 0)) - (set! s1-0 (-> v1-2 hours)) - ) - (else - (set! s1-0 (the-as int 0)) + (let ((s2-0 (the-as object (-> arg1 user-float)))) + (when (nonzero? (the-as float 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 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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? (-> (the-as (array int32) 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 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14)))) + (.mov t7-0 vf1) + (let ((v1-17 (sar (the-as int v1-16) 14))) + (set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand t7-0 (the-as uint -2)) v1-17))) + ) ) ) - (set! t9-0 rand-vu) - (set! v0-0 (call!)) - (set! f0-0 (gpr->fpr v0-0)) - (.mov s4-0 vf1) - (.mov s3-0 vf2) - (set! a0-1 (<.si s1-0 6)) - a0-1 + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1)) ) - (begin (set! v1-4 18) (set! v1-3 (<.si v1-4 s1-0))) ) - v1-3 - ) - (when (begin (set! a1-1 (the-as none (l.w (+ s2-0 40)))) (nonzero? a1-1)) - (when (begin - (set! v1-6 (the-as none (fpr->gpr f0-0))) - (.mov vf2 v1-6) - (set! v1-7 (the-as none (l.w (+ s2-0 48)))) - (set! v1-8 (the-as uint128 (pcypld 0 v1-7))) - (.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) - (set! v1-11 (the-as none (l.w (+ s2-0 44)))) - (set! v1-12 (the-as uint128 (pcypld 0 v1-11))) - (.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) - (set! v1-15 (the-as none (l.w (+ a1-0 104)))) - (set! a0-2 (the-as none (l.w (+ s2-0 52)))) - (nonzero? a0-2) - ) - (set! a0-4 (the-as none *time-of-day-context*)) - (.lvf vf2 (+ a0-4 108)) - (.mul.vf vf1 vf1 vf2) - (.mov a0-5 vf1) ) - (set! v1-16 (the-as none (logand v1-15 #x4000))) - (.mov t7-0 vf1) - (set! v1-17 (the-as none (sra v1-16 14))) - (set! a0-6 (the-as none -2)) - (set! t7-1 (the-as none (logand t7-0 a0-6))) - (set! t7-2 (the-as none (logior t7-1 v1-17))) - (s.q! (+ a2-0 32) t7-2) - (set! t9-1 (the-as none particle-adgif-callback)) - (set! a0-7 (the-as none (l.wu (+ a1-0 4)))) - (call!) - (set! v1-18 (the-as none v0-1)) - ) - ) - (else - (when (begin (set! a1-2 (the-as none (l.w (+ s2-0 24)))) (nonzero? a1-2)) - (when (begin - (set! v1-20 (the-as none (fpr->gpr f0-0))) + (else + (let ((a1-2 (-> (the-as (array int32) s2-0) 3))) + (when (nonzero? a1-2) + (let ((v1-20 f0-0)) (.mov vf2 v1-20) - (set! v1-21 (the-as none (l.w (+ s2-0 32)))) - (set! v1-22 (the-as uint128 (pcypld 0 v1-21))) - (.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) - (set! v1-25 (the-as none (l.w (+ s2-0 28)))) - (set! v1-26 (the-as uint128 (pcypld 0 v1-25))) - (.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) - (set! v1-29 (the-as none (l.w (+ a1-0 104)))) - (set! a0-8 (the-as none (l.w (+ s2-0 36)))) - (nonzero? a0-8) ) - (set! a0-10 (the-as none *time-of-day-context*)) - (.lvf vf2 (+ a0-10 108)) - (.mul.vf vf1 vf1 vf2) - (.mov a0-11 vf1) + (let ((v1-22 (the-as uint128 (make-u128 0 (-> (the-as (array int32) 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 (-> (the-as (array int32) 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? (-> (the-as (array int32) 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 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14)))) + (.mov t7-3 vf1) + (let ((v1-31 (sar (the-as int 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)) + ) + ) ) - (set! v1-30 (the-as none (logand v1-29 #x4000))) - (.mov t7-3 vf1) - (set! v1-31 (the-as none (sra v1-30 14))) - (set! a0-12 (the-as none -2)) - (set! t7-4 (the-as none (logand t7-3 a0-12))) - (set! t7-5 (the-as none (logior t7-4 v1-31))) - (s.q! (+ a2-0 32) t7-5) - (set! t9-2 (the-as none particle-adgif-callback)) - (set! a0-13 (the-as none (l.wu (+ a1-0 4)))) - (call!) - (set! v1-32 (the-as none v0-2)) ) ) + (.mov vf1 s4-0) + (.mov vf2 s3-0) + (.mov v1-33 vf2) ) - (.mov vf1 s4-0) - (.mov vf2 s3-0) - (.mov v1-33 vf2) ) - (ret-none) + (none) ) ) ;; definition for function sparticle-mode-animate -;; ERROR: failed type prop at 5: Could not figure out load: (set! a1 (l.w (+ v1 12))) -(defun sparticle-mode-animate ((a0-0 sparticle-system) (a1-0 sparticle-cpuinfo) (a2-0 vector)) - (local-vars - (v0-0 none) - (v0-1 none) - (v0-2 none) - (v0-3 none) - (v1-0 float) - (a0-1 sparticle-launch-control) - (a0-2 none) - (a0-3 none) - (a0-4 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-9 none) - (a0-10 none) - (a0-11 none) - (a0-12 none) - (a0-13 none) - (a0-14 none) - (a1-1 none) - (a1-2 none) - (a1-3 none) - (a1-4 none) - (a1-5 none) - (a1-6 none) - (a1-7 none) - (a1-8 none) - (a1-10 none) - (a1-11 none) - (a1-12 none) - (a2-3 none) - (a2-4 none) - (a2-5 none) - (a2-6 none) - (a2-7 none) - (a2-8 none) - (a2-9 none) - (a2-10 none) - (a2-11 none) - (a2-12 none) - (a2-13 none) - (a2-14 none) - (a3-0 none) - (a3-1 none) - (a3-2 none) - (s4-0 none) - (t9-0 none) - (t9-1 none) - (t9-2 none) - (f0-0 none) - (f0-1 none) - (f0-2 none) - (f0-3 none) - ) - (when (begin (set! a0-1 (-> a1-0 key)) (set! v1-0 (-> a1-0 user-float)) (nonzero? v1-0)) - (when (begin - (set! a1-1 (the-as none (l.w (+ v1-0 12)))) - (set! a1-2 (the-as none (l.w (+ a1-1 -1)))) - (nonzero? a1-2) - ) - (when (begin - (set! a2-3 (the-as none (l.bu (+ a0-1 29)))) - (set! a2-4 (the-as none (+ a2-3 1))) - (set! a2-5 (the-as none a2-4)) - (set! a3-0 (the-as none (l.w a1-2))) - (set! a3-1 (the-as none (+ a3-0 -1))) - (set! a2-6 (the-as none (min.si a2-5 a3-1))) - (set! a2-7 (the-as none (sll a2-6 2))) - (set! a1-3 (the-as none (+ a2-7 a1-2))) - (set! a1-4 (the-as none (l.wu (+ a1-3 12)))) - (set! a0-2 (the-as none (l.wu (+ a0-1 32)))) - (set! a2-8 (the-as none (l.w (+ a1-4 12)))) - (set! a2-9 (the-as none (sra a2-8 3))) - (set! a0-3 (the-as none (/.ui a0-2 a2-9))) - (set! a2-10 (the-as none (l.w a1-4))) - (set! a2-11 (the-as none (+ a2-10 -1))) - (set! a0-4 (the-as none (mod.si a0-3 a2-11))) - (set! a0-5 (the-as none (+ a0-4 1))) - (set! a0-6 (the-as none (sll a0-5 2))) - (set! a0-7 (the-as none (+ a0-6 a1-4))) - (set! a0-8 (the-as none (l.w (+ a0-7 12)))) - (set! a1-5 (the-as none (l.w (+ v1-0 16)))) - (set! a1-6 (the-as none (sra a1-5 3))) - (set! a2-12 (the-as none (sra a1-6 6))) - (set! a2-13 (the-as none (sll a2-12 3))) - (set! a0-9 (the-as none (+ a0-8 a2-13))) - (set! a2-14 (the-as none (l.d a0-9))) - (set! a0-10 (the-as none #t)) - (set! a3-2 (the-as none 1)) - (set! a1-7 (the-as none (logand a1-6 63))) - (set! a1-8 (the-as none (ash.si a3-2 a1-7))) - (if (begin (set! a1-10 (the-as none (logand a2-14 a1-8))) (cmove-#f-zero a0-11 a1-10 a0-10) a0-11) - (set! s4-0 (the-as none (l.w (+ v1-0 24)))) - (set! s4-0 (the-as none (l.w (+ v1-0 20)))) - ) - (cond - (a0-11 - (set! t9-0 (the-as none rand-vu-float-range)) - (set! a0-12 (the-as none #x42800000)) - (set! a1-11 (the-as none #x43400000)) - (set! v0-0 (the-as none (call!))) - (set! f0-0 (the-as none (gpr->fpr v0-0))) - (s.f! (+ a2-0 32) f0-0) - (set! v1-1 (the-as none (fpr->gpr f0-0))) - ) - (else - (set! t9-1 (the-as none rand-vu-float-range)) - (set! a0-13 (the-as none #x42000000)) - (set! a1-12 (the-as none #x42400000)) - (set! v0-1 (the-as none (call!))) - (set! f0-1 (the-as none (gpr->fpr v0-1))) - (s.f! (+ a2-0 32) f0-1) - (set! v1-2 (the-as none (fpr->gpr f0-1))) - ) +;; 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 int (-> (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! f0-2 (the-as none (l.f (+ a2-0 32)))) - (s.f! (+ a2-0 36) f0-2) - (set! f0-3 (the-as none (l.f (+ a2-0 32)))) - (s.f! (+ a2-0 40) f0-3) - (nonzero? s4-0) - ) - (set! t9-2 (the-as none particle-adgif-callback)) - (set! a0-14 (the-as none (l.wu (+ a1-0 4)))) - (set! a1-13 (the-as none s4-0)) - (call!) - (set! a2-16 (the-as none v0-2)) + (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)) + ) + ) + ) ) ) ) - (set! v0-3 (the-as none 0)) - (ret-none) + 0 + (none) ) ;; definition for function sparticle-motion-blur -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. -;; ERROR: Expression building failed: In sparticle-motion-blur: [OP: 78] - Floating point math attempted on invalid types: uint and float in op (-.s f2-0 f3-0). -;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] -;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] -;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] -;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] -;; ERROR: Unsupported inline assembly instruction kind - [mula.s f3, f3] -;; ERROR: Unsupported inline assembly instruction kind - [madd.s f3, f4, f4] -;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] -;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defun sparticle-motion-blur ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) - (local-vars - (v0-0 float) - (v0-1 int) - (v1-0 math-camera) - (v1-1 int) - (v1-2 int) - (v1-3 int) - (v1-4 int) - (v1-5 float) - (a0-1 int) - (a0-2 uint128) - (a0-3 int) - (a0-4 float) - (a0-5 float) - (a0-6 uint) - (a0-7 float) - (a0-8 int) - (a1-1 int) - (a1-2 uint128) - (a1-3 uint128) - (a1-4 uint) - (a1-5 float) - (a1-6 float) - (a1-7 int) - (a2-1 uint128) - (a2-2 uint128) - (a2-3 float) - (s4-0 float) - (s5-0 uint) - (t9-0 (function float float float)) - (f0-0 float) - (f0-1 float) - (f0-2 float) - (f0-3 float) - (f0-4 float) - (f0-5 float) - (f0-6 float) - (f0-7 float) - (f0-8 float) - (f1-0 float) - (f1-1 float) - (f1-2 float) - (f1-3 float) - (f2-0 uint) - (f2-1 float) - (f2-2 float) - (f2-3 float) - (f2-4 float) - (f3-0 float) - (f3-1 float) - (f3-2 float) - (f3-3 float) - (f3-4 int) - (f4-0 float) - (f4-1 uint) - (f4-2 float) - (f5-0 int) - ) - (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) - (vf2 :class vf) - (vf24 :class vf) - (vf25 :class vf) - (vf26 :class vf) - (vf27 :class vf) - (vf29 :class vf) - (vf3 :class vf) - (vf30 :class vf) - (vf4 :class vf) - (vf5 :class vf) - (vf6 :class vf) - (vf7 :class vf) - (vf8 :class vf) - (vf9 :class vf) - ) - (init-vf0-vector) - (set! a0-1 #xffff) - (set! v1-0 *math-camera*) - (set! a1-1 (shl a0-1 48)) - (set! a0-2 (-> arg1 vel-sxvel quad)) - (.lvf vf1 (&-> arg2 quad)) - (.pceqw a2-1 a0-2 0) - (.lvf vf24 (&-> v1-0 camera-temp vector 0 quad)) - (.ppach a2-2 (the-as uint128 0) a2-1) - (.lvf vf25 (&-> v1-0 camera-temp vector 1 quad)) - (set! a1-2 (logior a2-2 a1-1)) - (.lvf vf26 (&-> v1-0 camera-temp vector 2 quad)) - (set! a1-3 (+ a1-2 1)) - (.lvf vf27 (&-> v1-0 camera-temp trans quad)) - ((b! (zero? a1-3) L36 (.qmtc2.i vf4 a0-2)) (.mov vf4 a0-2)) - (set! a0-3 #x42000000) - (.lvf vf30 (&-> v1-0 hvdf-off quad)) - (.lvf vf29 (&-> v1-0 hmge-scale quad)) - (.mul.x.vf acc vf24 vf1) - (.add.mul.y.vf acc vf25 vf1 acc) - (.add.mul.z.vf acc vf26 vf1 acc) - (.add.mul.w.vf vf10 vf27 vf0 acc) - (.mov vf5 a0-3) - (.mul.vf vf12 vf10 vf29) - (.mul.w.vf acc vf1 vf0) - (.add.mul.x.vf vf1 vf4 vf5 acc) - (.div.vf Q vf0 vf12 :fsf #b11 :ftf #b11) - (TODO.VCLIP vf12 vf12) - (.mul.x.vf acc vf24 vf1) - (.add.mul.y.vf acc vf25 vf1 acc) - (.add.mul.z.vf acc vf26 vf1 acc) - (.add.mul.w.vf vf11 vf27 vf0 acc) - (.wait.vf) - (.cfc2.i v1-1 Clipping) - (.mul.vf vf10 vf10 Q :mask #b111) - (.mul.vf vf13 vf11 vf29) - (set! v1-2 (logand v1-1 63)) - ((b! (nonzero? v1-2) L36 (.vadd.xyzw vf10 vf10 vf30)) (.add.vf vf10 vf10 vf30)) - (.div.vf Q vf0 vf13 :fsf #b11 :ftf #b11) - (TODO.VCLIP vf13 vf13) - (.max.x.vf vf10 vf10 vf0 :mask #b1000) - (vftoi4.xyzw vf2 vf10) - (.wait.vf) - (.mul.vf vf11 vf11 Q :mask #b111) - (.cfc2.i v1-3 Clipping) - (.itof.vf vf6 vf2) - (.add.vf vf11 vf11 vf30) - (set! v1-4 (logand v1-3 63)) - ((b! (nonzero? v1-4) L36 (.vdiv Q vf0 .w vf6 .z)) (.div.vf Q vf0 vf6 :fsf #b11 :ftf #b10)) - (.max.x.vf vf11 vf11 vf0 :mask #b1000) - (.add.w.vf vf9 vf0 vf0 :mask #b1) - (vftoi4.xyzw vf3 vf11) - (.itof.vf vf7 vf3) - (.sub.vf vf8 vf7 vf6 :mask #b11) - (.mov s4-0 vf8) - (set! s5-0 (sar (the-as int s4-0) 32)) - (.mul.vf vf9 vf9 Q :mask #b1) - (set! t9-0 atan) - (set! a0-4 s4-0) - (set! a1-4 s5-0) - (set! v0-0 (atan s4-0 (the-as float s5-0))) - (set! a0-5 v0-0) - (set! v1-5 (-> arg1 omega)) - (set! a1-5 -16384.0) - (set! f0-0 -16384.0) - (set! f1-0 a0-5) - (set! f0-1 (+ -16384.0 a0-5)) - (s.f! (+ arg2 24) f0-1) - ((b! (zero? v1-5) L37 (.qmfc2.i a0-6 vf9)) (.mov a0-6 vf9)) - (set! f2-0 (gpr->fpr a0-6)) - (set! a0-7 1.0) - (set! f1-1 0.0) - (set! a1-6 0.000001) - (set! a2-3 0.00000014285715) - (set! f0-2 a0-7) - (set! f3-0 a1-6) - (set! f4-0 a2-3) - (set! f2-1 (-.s f2-0 f3-0)) - (set! f3-1 (-.s f4-0 f3-0)) - (set! f2-2 (/.s f2-1 f3-1)) - (set! f3-2 (gpr->fpr s4-0)) - (set! f4-1 (gpr->fpr s5-0)) - (.mula.s f3-2 f3-2) - (.madd.s f3-3 f4-1 f4-1) - (set! f2-3 (max.s f2-2 f1-1)) - (set! f1-2 (sqrt.s f3-3)) - (set! f2-4 (min.s f2-3 f0-2)) - (set! a0-8 #x40400000) - (set! f0-3 (-.s f0-2 f2-4)) - (set! a1-7 #x3e800000) - (set! f3-4 (gpr->fpr a0-8)) - (set! f5-0 (gpr->fpr a1-7)) - (set! f4-2 (gpr->fpr v1-5)) - (.mula.s f0-3 f3-4) - (.madd.s f0-4 f2-4 f5-0) - (set! f0-5 (*.s f0-4 f1-2)) - (set! f0-6 (*.s f0-5 f4-2)) - ((b! #t L37 (s.f! (+ arg2 12) f0-6)) (set! (-> arg2 w) f0-6)) - (when (begin (label cfg-5) (set! f0-7 (-> arg1 omega)) (set! f1-3 0.0) (!=.s f0-7 f1-3)) - (set! f0-8 0.0) - (set! (-> arg2 w) f0-8) - (set! v1-7 (fpr->gpr f0-8)) - ) - (label cfg-7) - (set! v0-1 0) - (ret-none) - ) - ) +;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition (debug) for function sparticle-motion-blur-old ;; WARN: Return type mismatch int vs object. @@ -3152,11 +2328,13 @@ ;; 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 object (-> arg1 user-float)))) - (when (nonzero? (the-as float s5-0)) - (let ((a0-1 (+ (-> (the-as (pointer int32) s5-0) 0) -3))) - (if (nonzero? (l.w (+ (* (+ (rand-vu-int-count a0-1) 3) 4) (the-as int s5-0) 12))) - (particle-adgif-callback (-> arg1 adgif)) + (let ((s5-0 (the-as (array int32) (-> arg1 user-float)))) + (when (nonzero? s5-0) + (let* ((a0-1 (+ (-> s5-0 length) -3)) + (a1-1 (-> s5-0 (+ (rand-vu-int-count a0-1) 3))) + ) + (if (nonzero? a1-1) + (particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1)) ) ) ) @@ -3190,140 +2368,38 @@ ) ;; definition for method 10 of type sparticle-launcher -;; ERROR: failed type prop at 45: Could not figure out load: (set! v1 (l.w (+ gp 12))) -(defmethod sparticle-launcher-method-10 sparticle-launcher ((a0-0 sparticle-launcher) (a1-0 string)) - (local-vars - (v0-0 sp-field-init-spec) - (v0-1 texture-id) - (v0-2 sp-field-init-spec) - (v0-3 symbol) - (v0-4 none) - (v0-5 none) - (v1-0 type) - (v1-1 texture-id) - (v1-2 type) - (v1-3 sp-field-init-spec) - (v1-4 int) - (v1-5 int) - (v1-6 symbol) - (v1-7 symbol) - (v1-8 none) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-12 none) - (v1-13 none) - (v1-14 none) - (v1-15 none) - (v1-16 none) - (v1-17 none) - (v1-18 none) - (v1-19 none) - (v1-20 none) - (v1-21 none) - (v1-22 none) - (v1-23 none) - (a0-1 sparticle-launcher) - (a0-2 string) - (a0-5 sparticle-launcher) - (a0-6 symbol) - (a0-7 sp-flag) - (a0-9 symbol) - (a0-10 float) - (a0-11 float) - (a0-12 int) - (a0-14 none) - (a1-1 int) - (a1-2 symbol) - (a1-3 int) - (a1-4 sp-flag) - (a1-5 type) - (s5-0 sp-field-init-spec) - (s5-1 none) - (t9-0 (function sparticle-launcher sp-field-id sp-field-init-spec)) - (t9-1 (function string string texture-id)) - (t9-2 (function sparticle-launcher sp-field-id sp-field-init-spec)) - (t9-3 (function object type symbol)) - (t9-4 none) - (gp-1 object) +;; WARN: Return type mismatch int vs none. +(defmethod setup-user-array sparticle-launcher ((obj sparticle-launcher) (arg0 string)) + (let ((s5-0 (get-field-spec-by-id obj (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)) + ) ) - (when (begin - (when (begin - (set! a0-1 a0-0) - (set! v1-0 (-> a0-1 type)) - (set! t9-0 (method-of-type v1-0 get-field-spec-by-id)) - (set! a1-1 1) - (set! v0-0 (call! a0-1 a1-1)) - (set! s5-0 v0-0) - (set! t9-1 lookup-texture-id-by-name) - (set! a1-2 #f) - (set! a0-2 a1-0) - (set! v0-1 (call! a0-2 a1-2)) - (set! v1-1 v0-1) - s5-0 + (let ((v1-3 (get-field-spec-by-id obj (sp-field-id spt-userdata)))) + (when (and v1-3 (= (-> v1-3 flags) (sp-flag plain-v2))) + (let ((gp-1 (the-as object (-> v1-3 initial-valuef)))) + (when (and (= (logand (the-as int gp-1) 7) 4) + (type? (the-as float gp-1) array) + (logtest? (-> (the-as (array int32) gp-1) 1) 128) + ) + (set! (-> (the-as (array int32) gp-1) 0) (/ (-> (the-as (array int32) gp-1) 0) 8)) + (set! (-> (the-as (array int32) gp-1) 1) (/ (logand (-> (the-as (array int32) gp-1) 1) 8) 8)) + (set! (-> (the-as (array int32) gp-1) 2) (/ (-> (the-as (array int32) gp-1) 2) 8)) + (set! (-> (the-as (array int32) gp-1) content-type) int32) + (dotimes (s5-1 (+ (-> (the-as (array int32) gp-1) length) -3)) + (set! (-> (the-as (array int32) gp-1) (+ s5-1 3)) + (the-as + int + (lookup-texture-id-by-name (the-as string (-> (the-as (array int32) gp-1) (+ s5-1 3))) (the-as string #f)) + ) ) - (set! (-> s5-0 initial-valuef) (the-as float v1-1)) - (set! a0-4 v1-1) ) - (and (begin - (set! v1-2 (-> a0-0 type)) - (set! t9-2 (method-of-type v1-2 get-field-spec-by-id)) - (set! a1-3 48) - (set! a0-5 a0-0) - (set! v0-2 (call! a0-5 a1-3)) - (set! v1-3 v0-2) - v1-3 - ) - (begin (set! a0-7 (-> v1-3 flags)) (set! a1-4 (+ a0-7 -4)) (set! a0-6 (zero? a1-4))) - ) - a0-6 ) - (when (begin - (and (begin - (set! gp-1 (-> v1-3 initial-valuef)) - (set! v1-4 (logand gp-1 7)) - (set! v1-5 (+ v1-4 -4)) - (set! a0-9 (zero? v1-5)) - a0-9 - ) - (begin (set! t9-3 type?) (set! a0-10 gp-1) (set! a1-5 array) (set! v0-3 (call! a0-10 a1-5)) v0-3) - (begin - (set! v1-7 #t) - (set! a0-11 (-> gp-1 1)) - (set! a0-12 (logand a0-11 128)) - (cmove-#f-zero v1-6 a0-12 v1-7) - ) - ) - v1-6 - ) - (set! v1-8 (the-as none (l.w (+ gp-1 12)))) - (set! v1-9 (the-as none (sra v1-8 3))) - (s.w! (+ gp-1 12) v1-9) - (set! v1-10 (the-as none (l.w (+ gp-1 16)))) - (set! v1-11 (the-as none (logand v1-10 8))) - (set! v1-12 (the-as none (sra v1-11 3))) - (s.w! (+ gp-1 16) v1-12) - (set! v1-13 (the-as none (l.w (+ gp-1 20)))) - (set! v1-14 (the-as none (sra v1-13 3))) - (s.w! (+ gp-1 20) v1-14) - (set! v1-15 (the-as none int32)) - (s.w! (+ gp-1 8) v1-15) - (set! s5-1 (the-as none 0)) - (while (begin (set! v1-22 (the-as none (l.w gp-1))) (set! v1-23 (the-as none (+ v1-22 -3))) (<.si s5-1 v1-23)) - (set! t9-4 (the-as none lookup-texture-id-by-name)) - (set! v1-16 (the-as none (+ s5-1 3))) - (set! v1-17 (the-as none (sll v1-16 2))) - (set! v1-18 (the-as none (+ v1-17 gp-1))) - (set! a0-14 (the-as none (l.w (+ v1-18 12)))) - (set! v0-4 (the-as none (call!))) - (set! v1-19 (the-as none (+ s5-1 3))) - (set! v1-20 (the-as none (sll v1-19 2))) - (set! v1-21 (the-as none (+ v1-20 gp-1))) - (s.w! (+ v1-21 12) v0-4) - (set! s5-1 (the-as none (+ s5-1 1))) ) ) ) - (set! v0-5 (the-as none 0)) - (ret-none) + 0 + (none) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc index 3eb1e49299..fa5c836f95 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc @@ -894,7 +894,7 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id bucket-313) + (bucket-id particles) dma-bucket-begin (the-as (pointer dma-tag) a3-0) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-part_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-part_REF.gc new file mode 100644 index 0000000000..627dcdd930 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/target/board/board-part_REF.gc @@ -0,0 +1,230 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-board-land-straight + :id 119 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 209)) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-quick-jump + :id 120 + :duration (seconds 0.035) + :linger-duration (seconds 1.5) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 209)) + ) + +;; failed to figure out what this is: +(defpart 431 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (sp-flt spt-r 255.0) + (sp-flt spt-g 255.0) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 8.192) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-rnd-flt spt-fade-g -0.85 -1.7 1.0) + (sp-flt spt-fade-b -8.0) + (sp-rnd-flt spt-fade-a -0.16 -0.16 1.0) + (sp-rnd-flt spt-accel-y -6.826667 -2.7306666 1.0) + (sp-flt spt-friction 0.95) + (sp-int-plain-rnd spt-timer 50 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 45.0) (degrees 90.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-target-board + :id 118 + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 432) (sp-item 433 :flags (is-3d)) (sp-item 434)) + ) + +;; failed to figure out what this is: +(defpart 432 + :init-specs ((sp-flt spt-num 3.0) + (sp-flt spt-y (meters 0.25)) + (sp-int spt-rot-x 7) + (sp-flt spt-r 2048.0) + (sp-flt spt-g 1638.4) + (sp-flt spt-b 1843.2) + (sp-flt spt-fade-b -0.08533333) + (sp-int spt-timer 40) + (sp-cpuinfo-flags distort) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 433 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-func spt-birth-func 'birth-func-target-orient) + (sp-flt spt-num 1.0) + (sp-flt spt-y (meters 0.25)) + (sp-rnd-flt spt-scale-x (meters 4) (meters 2) 1.0) + (sp-flt spt-rot-x 0.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-rot-z (degrees 0.0)) + (sp-copy-from-other spt-scale-y -4) + (sp-rnd-flt spt-r 64.0 128.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 8.0 8.0 1.0) + (sp-rnd-flt spt-scalevel-x (meters -0.02) (meters -0.006666667) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -0.1) + (sp-int spt-timer 160) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-12) + ) + ) + +;; failed to figure out what this is: +(defpart 434 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x92 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-scale-x (meters 2.5)) + (sp-int spt-rot-x 4) + (sp-flt spt-scale-y (meters 0.05)) + (sp-rnd-flt spt-r 128.0 64.0 1.0) + (sp-copy-from-other spt-g -1) + (sp-flt spt-b 255.0) + (sp-rnd-flt spt-a 64.0 32.0 1.0) + (sp-flt spt-omega 10.24) + (sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.033333335) 1.0) + (sp-flt spt-fade-r -3.0) + (sp-flt spt-fade-g -3.0) + (sp-rnd-flt spt-fade-a -0.21333334 -0.21333334 1.0) + (sp-rnd-flt spt-accel-y -1.3653333 -1.3653333 1.0) + (sp-flt spt-friction 0.95) + (sp-int-plain-rnd spt-timer 50 149 1) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-12) + (sp-func spt-func 'sparticle-motion-blur) + (sp-rnd-flt spt-conerot-x (degrees 80.0) (degrees 10.0) 1.0) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + (sp-rnd-flt spt-conerot-radius (meters 0) (meters 0.5) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpart 435 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #xc)) + (sp-flt spt-num 0.0) + (sp-flt spt-y (meters 0)) + (sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) + (sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0) + (sp-copy-from-other spt-scale-y -4) + (sp-flt spt-r 128.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 32.0) + (sp-rnd-flt spt-a 8.0 56.0 1.0) + (sp-rnd-flt spt-vel-y (meters 0.13333334) (meters 0.16666667) 1.0) + (sp-flt spt-scalevel-x (meters 0.013333334)) + (sp-rnd-flt spt-rotvel-z (degrees -0.4) (degrees 0.8) 1.0) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-g -1.4222223) + (sp-flt spt-fade-a -0.35555556) + (sp-flt spt-accel-y 0.34133333) + (sp-flt spt-friction 0.7) + (sp-int spt-timer 180) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3) + (sp-flt spt-conerot-x (degrees 90.0)) + (sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-board-spin-attack + :id 117 + :duration (seconds 50) + :flags (use-local-clock unk-6) + :bounds (static-bspherem 0 0 0 2) + :rotate ((degrees 4) (degrees 8) (degrees 4)) + :parts ((sp-item 436 :flags (is-3d launch-asap bit6 bit7)) + (sp-item 437 :flags (is-3d launch-asap bit6 bit7)) + (sp-item 438 :flags (launch-asap bit6)) + ) + ) + +;; failed to figure out what this is: +(defpart 438 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) + (sp-flt spt-num 1.0) + (sp-rnd-flt spt-scale-x (meters 3) (meters 0.5) 1.0) + (sp-flt spt-rot-x 2048.0) + (sp-rnd-flt spt-scale-y (meters 4) (meters 0.5) 1.0) + (sp-flt spt-r 0.0) + (sp-flt spt-g 128.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 64.0) + (sp-flt spt-fade-a -0.4) + (sp-int spt-timer 80) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow) + (sp-flt spt-userdata 12288.0) + (sp-func spt-func 'sparticle-track-root) + ) + ) + +;; failed to figure out what this is: +(defpart 437 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xc9 :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 0)) + (sp-flt spt-scale-x (meters 12)) + (sp-flt spt-rot-x 0.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 9)) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 128.0) + (sp-flt spt-scalevel-x (meters -0.086666666)) + (sp-flt spt-scalevel-y (meters -0.09)) + (sp-int spt-timer 50) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) + +;; failed to figure out what this is: +(defpart 436 + :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2c :page #xc)) + (sp-flt spt-num 1.0) + (sp-flt spt-x (meters 0)) + (sp-flt spt-y (meters 0)) + (sp-flt spt-z (meters 0)) + (sp-flt spt-scale-x (meters 1.4)) + (sp-flt spt-rot-x 0.0) + (sp-flt spt-rot-y (degrees 0.0)) + (sp-flt spt-rot-z (degrees 90.0)) + (sp-flt spt-scale-y (meters 0.9)) + (sp-flt spt-r 0.0) + (sp-rnd-flt spt-g 128.0 128.0 1.0) + (sp-flt spt-b 255.0) + (sp-flt spt-a 255.0) + (sp-flt spt-scalevel-x (meters 0.3)) + (sp-copy-from-other spt-scalevel-y -4) + (sp-flt spt-fade-a -3.1875) + (sp-int spt-timer 20) + (sp-cpuinfo-flags sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14) + (sp-func spt-func 'sparticle-track-root) + (sp-flt spt-rotate-y (degrees 0.0)) + ) + ) diff --git a/test/decompiler/test_DataParser.cpp b/test/decompiler/test_DataParser.cpp index 0a9d10073b..cd73380de0 100644 --- a/test/decompiler/test_DataParser.cpp +++ b/test/decompiler/test_DataParser.cpp @@ -127,7 +127,7 @@ TEST_F(DataDecompTest, String) { " .word 0x0\n"; auto parsed = parse_data(input); auto decomp = decompile_at_label_guess_type(parsed.label("L62"), parsed.labels, {parsed.words}, - dts->ts, nullptr); + dts->ts, nullptr, GameVersion::Jak1); EXPECT_EQ(decomp.print(), "\"finalboss-fight\""); } @@ -148,8 +148,9 @@ TEST_F(DataDecompTest, SimpleStructure) { " .word 0x79637473\n" " .word 0x6c63\n"; auto parsed = parse_data(input); - auto decomp = decompile_at_label(TypeSpec("vif-disasm-element"), parsed.label("L217"), - parsed.labels, {parsed.words}, dts->ts, nullptr); + auto decomp = + decompile_at_label(TypeSpec("vif-disasm-element"), parsed.label("L217"), parsed.labels, + {parsed.words}, dts->ts, nullptr, GameVersion::Jak1); check_forms_equal(decomp.print(), "(new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stcycl) :print " "#x2 :string1 \"stcycl\")"); @@ -210,7 +211,7 @@ TEST_F(DataDecompTest, VifDisasmArray) { " .word 0x0"; auto parsed = parse_data(input); auto decomp = decompile_at_label_guess_type(parsed.label("L148"), parsed.labels, {parsed.words}, - dts->ts, nullptr); + dts->ts, nullptr, GameVersion::Jak1); check_forms_equal(decomp.print(), "(new 'static 'boxed-array :type vif-disasm-element\n" " (new 'static 'vif-disasm-element :mask #x7f :string1 \"nop\")\n" @@ -286,7 +287,7 @@ TEST_F(DataDecompTest, ContinuePoint) { " .word 0x747261"; auto parsed = parse_data(input); auto decomp = decompile_at_label_guess_type(parsed.label("L63"), parsed.labels, {parsed.words}, - dts->ts, nullptr); + dts->ts, nullptr, GameVersion::Jak1); check_forms_equal(decomp.print(), "(new 'static 'continue-point\n" " :name \"finalboss-start\"\n" @@ -344,7 +345,7 @@ TEST_F(DataDecompTest, FloatArray) { info.array_size = 7; info.is_value = false; auto decomp = decompile_at_label_with_hint(info, parsed.label("L63"), parsed.labels, - {parsed.words}, *dts, nullptr); + {parsed.words}, *dts, nullptr, GameVersion::Jak1); check_forms_equal(decomp.print(), "(new 'static 'array float 7\n" "1.0 0.0 1.0 0.0 1.0 0.0 1.0)"); @@ -382,7 +383,7 @@ TEST_F(DataDecompTest, KernelContext) { " .symbol #t\n"; auto parsed = parse_data(input); auto decomp = decompile_at_label_guess_type(parsed.label("L345"), parsed.labels, {parsed.words}, - dts->ts, nullptr); + dts->ts, nullptr, GameVersion::Jak1); check_forms_equal(decomp.print(), "(new 'static 'kernel-context\n" " :prevent-from-run (process-mask execute sleep)\n"