diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index bdabb9ea6f..ffca36f121 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -276,7 +276,7 @@ void insert_required_breaks(const std::vector& bfs_order) { const std::unordered_set always_break = { "when", "defun-debug", "countdown", "case", "defun", "defmethod", "let", "until", "while", "if", "dotimes", "cond", "else", "defbehavior", - "with-pp", "rlet", "defstate", "behavior", "defpart", "loop"}; + "with-pp", "rlet", "defstate", "behavior", "defpart", "loop", "let*"}; for (auto node : bfs_order) { if (!node->break_list && node->kind == Node::Kind::LIST && node->child_nodes.at(0).kind == Node::Kind::ATOM) { diff --git a/decompiler/IR2/AtomicOpTypeAnalysis.cpp b/decompiler/IR2/AtomicOpTypeAnalysis.cpp index 2ee3aaec58..6acf67430a 100644 --- a/decompiler/IR2/AtomicOpTypeAnalysis.cpp +++ b/decompiler/IR2/AtomicOpTypeAnalysis.cpp @@ -977,7 +977,7 @@ TP_Type LoadVarOp::get_src_type(const TypeState& input, return TP_Type::make_object_new(method_type); } if (method_id == GOAL_NEW_METHOD) { - return TP_Type::make_from_ts(method_type); + return TP_Type::make_non_object_new(method_type, TypeSpec(type_name)); } else if (input_type.kind == TP_Type::Kind::TYPE_OF_TYPE_NO_VIRTUAL) { return TP_Type::make_non_virtual_method(method_type, TypeSpec(type_name), method_id); } else { diff --git a/decompiler/IR2/ExpressionHelpers.cpp b/decompiler/IR2/ExpressionHelpers.cpp index b231cf114c..e907f14378 100644 --- a/decompiler/IR2/ExpressionHelpers.cpp +++ b/decompiler/IR2/ExpressionHelpers.cpp @@ -225,11 +225,48 @@ Form* var_to_form(const RegisterAccess& var, FormPool& pool) { return pool.alloc_single_element_form(nullptr, SimpleAtom::make_var(var)); } +/*! + * Try to see if this form is a variable, or variable in a cast. If so, return the variable, + * and set cast_out if there was a cast. + */ +std::optional try_strip_cast_get_var(Form* in, std::optional& cast_out) { + auto* elt = in->try_as_single_element(); + if (!elt) { + return {}; + } + auto* as_cast_elt = dynamic_cast(elt); + if (as_cast_elt) { + cast_out = as_cast_elt->type(); + elt = as_cast_elt->source()->try_as_single_element(); + } + if (!elt) { + return {}; + } + auto as_atom = form_element_as_atom(elt); + if (!as_atom || !as_atom->is_var()) { + return {}; + } + return as_atom->var(); +} + +/*! + * Return (the-as ) or . + */ +FormElement* maybe_cast(FormElement* in, std::optional& maybe_cast_type, FormPool& pool) { + if (maybe_cast_type) { + return pool.alloc_element(*maybe_cast_type, pool.alloc_single_form(nullptr, in)); + } else { + return in; + } +} + } // namespace /*! * Recognize the handle->process macro. * If it occurs inside of another and, the part_of_longer_sc argument should be set. + * + * Will move the cast out from the `if` to surround the output. */ FormElement* last_two_in_and_to_handle_get_proc(Form* first, Form* second, @@ -242,7 +279,7 @@ FormElement* last_two_in_and_to_handle_get_proc(Form* first, constexpr int reg_input_3 = 2; constexpr int reg_temp_1 = 10; constexpr int reg_temp_2 = 11; - constexpr int reg_temp_3 = 12; + constexpr int kValInIf = 12; // only used if part of a longer sc. Form* longer_sc_src = nullptr; // the source (can be found without repopping) @@ -294,7 +331,7 @@ FormElement* last_two_in_and_to_handle_get_proc(Form* first, {Matcher::deref(Matcher::any_reg(reg_input_3), false, {DerefTokenMatcher::string("pid")}), Matcher::deref(Matcher::any_reg(reg_temp_2), false, {DerefTokenMatcher::string("pid")})}), - Matcher::any_reg(reg_temp_3)); + Matcher::any(kValInIf)); auto second_matcher = Matcher::begin({setup_matcher, if_matcher}); @@ -321,7 +358,11 @@ FormElement* last_two_in_and_to_handle_get_proc(Form* first, return nullptr; } - if (temp_name != second_result.maps.regs.at(reg_temp_3)->to_string(env)) { + std::optional cast_type_for_result; + auto val_in_if = + try_strip_cast_get_var(second_result.maps.forms.at(kValInIf), cast_type_for_result); + + if (!val_in_if || temp_name != val_in_if->to_string(env)) { return nullptr; } @@ -346,10 +387,12 @@ FormElement* last_two_in_and_to_handle_get_proc(Form* first, return nullptr; } - return pool.alloc_element( - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "handle->process")), - longer_sc_src); + return maybe_cast( + pool.alloc_element( + GenericOperator::make_function( + pool.alloc_single_element_form(nullptr, "handle->process")), + longer_sc_src), + cast_type_for_result, pool); } else { // modify use def: auto* menv = const_cast(&env); @@ -363,10 +406,12 @@ FormElement* last_two_in_and_to_handle_get_proc(Form* first, repopped = var_to_form(in1, pool); } - return pool.alloc_element( - GenericOperator::make_function( - pool.alloc_single_element_form(nullptr, "handle->process")), - repopped); + return maybe_cast( + pool.alloc_element( + GenericOperator::make_function( + pool.alloc_single_element_form(nullptr, "handle->process")), + repopped), + cast_type_for_result, pool); } } } // namespace decompiler \ No newline at end of file diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 8de9ee4886..3199b17e65 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -72,13 +72,34 @@ Form* strip_pcypld_64(Form* in) { } } -std::optional get_goal_float_constant(Form* in) { - auto as_fc = in->try_as_element(); +std::optional get_goal_float_constant(FormElement* in) { + auto as_fc = dynamic_cast(in); if (as_fc) { return as_fc->value(); } return {}; } + +std::optional get_goal_float_constant(Form* in) { + auto elt = in->try_as_single_element(); + if (elt) { + return get_goal_float_constant(elt); + } else { + return {}; + } +} + +bool cond_has_only_single_elements(CondWithElseElement* in) { + for (auto& entry : in->entries) { + if (entry.body->elts().size() > 1) { + return false; + } + } + if (in->else_ir->elts().size() > 1) { + return false; + } + return true; +} } // namespace Form* try_cast_simplify(Form* in, @@ -198,6 +219,27 @@ Form* try_cast_simplify(Form* in, auto type_info = env.dts->ts.lookup_type_allow_partial_def(new_type); auto bitfield_info = dynamic_cast(type_info); + auto enum_info = dynamic_cast(type_info); + auto* in_as_cond = in->try_as_element(); + + // try to fix (the-as (if foo 12 13)) type stuff by applying the casts inside a cond if: + // - it's casting to a bitfield/enum (this could be expanded to more in the future if needed) + // - the cond has an explicit else case (otherwise the #f from not hitting any case...) + // - it's not a sound-id - these are basically used like ints so it gets worse + // - the cond doesn't have multiple entries in the body + // in theory this could be better if we could only apply a cast to the last element in the body + // but this is a bit too much work for exactly 1 case in jak 1. + if ((bitfield_info || enum_info) && in_as_cond && type_info->get_name() != "sound-id" && + cond_has_only_single_elements(in_as_cond)) { + for (auto& cas : in_as_cond->entries) { + cas.body = try_cast_simplify(cas.body, new_type, pool, env, tc_pass); + cas.body->parent_element = in_as_cond; + } + in_as_cond->else_ir = try_cast_simplify(in_as_cond->else_ir, new_type, pool, env, tc_pass); + in_as_cond->else_ir->parent_element = in_as_cond; + return in; + } + if (bitfield_info) { // todo remove this. if (bitfield_info->get_load_size() == 8) { @@ -206,7 +248,6 @@ Form* try_cast_simplify(Form* in, return cast_to_bitfield(bitfield_info, new_type, pool, env, in); } - auto enum_info = dynamic_cast(type_info); if (enum_info) { if (enum_info->is_bitfield()) { return cast_to_bitfield_enum(enum_info, new_type, pool, env, in); diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index d83e4dc26e..6d5137e506 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -6084,6 +6084,8 @@ (default 0) (one 1) (orange-red 3) + (fc-5 5) + (fc-6 6) ) (defenum font-flags @@ -25629,8 +25631,8 @@ ;; (define-extern process-drawable-idle state) ;; (state process-drawable) ;; (define-extern skeleton-group->draw-control function) (define-extern ja-done? (function int symbol :behavior process-drawable)) -(define-extern ja-min? (function int symbol :behavior process-drawable)) ;; -(define-extern ja-max? (function int symbol :behavior process-drawable)) ;; +(define-extern ja-min? (function int symbol :behavior process-drawable)) ;; +(define-extern ja-max? (function int symbol :behavior process-drawable)) ;; ;; (define-extern ja-num-frames function) ;; (function int int :behavior process-drawable) (define-extern ja-frame-num (function int float :behavior process-drawable)) (define-extern ja-aframe-num (function int float :behavior process-drawable)) @@ -25648,7 +25650,7 @@ (define-extern sleep-code (function symbol)) ;; (define-extern transform-and-sleep function) ;; (define-extern transform-and-sleep-code function) -(define-extern transform-post (function int :behavior process-drawable)) ;; +(define-extern transform-post (function int :behavior process-drawable)) ;; ;; (define-extern rider-trans function) ;; (function int :behavior process-drawable) ;; (define-extern rider-post function) ;; (function int :behavior process-drawable) ;; (define-extern pusher-post function) ;; (function int :behavior process-drawable) @@ -26488,7 +26490,7 @@ ;; (define-extern bend-gravity function) ;; (function symbol :behavior target) ;; (define-extern target-compute-edge function) ;; (function none :behavior target) ;; (define-extern target-compute-edge-rider function) ;; (function none :behavior target) -(define-extern target-compute-pole (function none :behavior target)) ;; +(define-extern target-compute-pole (function none :behavior target)) ;; ;; (define-extern target-calc-camera-pos function) ;; (function none :behavior target) ;; (define-extern joint-points function) ;; (function none :behavior target) ;; (define-extern do-target-gspot function) @@ -27650,13 +27652,13 @@ ;; (define-extern entity-deactivate-handler function) ;; (function process entity-actor none) ;; (define-extern check-for-rougue-process function) ;; (define-extern process-drawable-scale-from-entity! function) -(define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) ;; +(define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) ;; (define-extern reset-actors (function symbol none)) (define-extern reset-cameras (function none)) ;; (define-extern entity-birth-no-kill function) ;; (function entity none) ;; (define-extern entity-task-complete-on function) ;; (function entity none) ;; (define-extern entity-task-complete-off function) ;; (function entity none) -(define-extern process-entity-status! (function process entity-perm-status symbol int)) ;; +(define-extern process-entity-status! (function process entity-perm-status symbol int)) ;; ;; (define-extern find-nearest-entity function) ;; (define-extern entity-speed-test function) ;; (function string none) ;; (define-extern dump-entity-remap function) diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 00ed4a68bb..439450f2c7 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -156,7 +156,10 @@ "(method 207 metalhead-predator)", "(anon-function 4 gun-states)", "(anon-function 28 grenadier)", - "(anon-function 24 grenadier)" + "(anon-function 24 grenadier)", + + // no longer bug or asm, not done yet + "particle-adgif-callback" ], // these functions use pairs and the decompiler diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 0197c9d7e4..3e612cb77d 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -526,20 +526,10 @@ ], "(method 13 gui-control)": [[16, ["array", "sound-id", 4]]], "ja-play-spooled-anim": [[96, "event-message-block"]], - "(method 24 com-airlock)": [[16, "script-context"]], - "(code close com-airlock)": [[32, "script-context"]], - "(code open com-airlock)": [[16, "script-context"]], - "(method 23 com-airlock)": [[16, "script-context"]], "update-under-lights": [ [16, "matrix"], [64, "vector"] ], - "(method 25 com-airlock)": [[48, "script-context"]], - "(anon-function 13 airlock)": [ - [176, "script-context"], - [16, "script-context"] - ], - "(trans close com-airlock)": [[16, "script-context"]], // placeholder "placeholder-do-not-add-below": [] } diff --git a/decompiler/types2/ForwardProp.cpp b/decompiler/types2/ForwardProp.cpp index a187e65a3e..136aaf196e 100644 --- a/decompiler/types2/ForwardProp.cpp +++ b/decompiler/types2/ForwardProp.cpp @@ -1866,7 +1866,8 @@ bool load_var_op_determine_type(types2::Type& type_out, // another special case: calling the new method is never done virtually. so just handle it // without paying attention to virtual/non-virtual if (method_id == GOAL_NEW_METHOD) { - type_out.type = TP_Type::make_from_ts(method_type); + // special flag so later code knows + type_out.type = TP_Type::make_non_object_new(method_type, TypeSpec(type_name)); return true; } else if (input_type.kind == TP_Type::Kind::TYPE_OF_TYPE_NO_VIRTUAL) { // normal non-virtual method access @@ -2404,11 +2405,19 @@ void CallOp::propagate_types2(types2::Instruction& instr, m_write_regs.emplace_back(Reg::GPR, Reg::V0); if (can_backprop) { + bool is_new_method = in_tp.kind == TP_Type::Kind::NON_OBJECT_NEW_METHOD; for (int i = 0; i < int(m_call_type.arg_count()) - 1; i++) { auto& expected_type = m_call_type.get_arg(i); auto& actual_type = input_types[Register(Reg::GPR, arg_regs[i])]; if (actual_type->tag.has_tag()) { - types2::backprop_tagged_type(TP_Type::make_from_ts(expected_type), *actual_type, dts); + if (is_new_method && i == 0) { + // special case - new method first argument can be a stack structure + types2::backprop_tagged_type(TP_Type::make_from_ts(in_tp.method_from_type()), + *actual_type, dts); + } else { + // normal backprop + types2::backprop_tagged_type(TP_Type::make_from_ts(expected_type), *actual_type, dts); + } } } } diff --git a/decompiler/types2/types2.cpp b/decompiler/types2/types2.cpp index 59f5920231..04d321b7f0 100644 --- a/decompiler/types2/types2.cpp +++ b/decompiler/types2/types2.cpp @@ -725,9 +725,11 @@ end_type_pass: for (auto& instr : function_cache.instructions) { if (instr.unknown_label_tag) { if (!instr.unknown_label_tag->selected_type) { - throw std::runtime_error(fmt::format("Failed to guess label use for {} in {}:{}", - instr.unknown_label_tag->label_name, - input.func->name(), instr.aop_idx)); + env.func->warnings.error("Failed to guess label use for {} in {}:{}", + instr.unknown_label_tag->label_name, input.func->name(), + instr.aop_idx); + out.succeeded = false; + return; // abort here - the type analysis above likely failed } auto& type = instr.unknown_label_tag->selected_type.value(); int idx = instr.unknown_label_tag->label_idx; @@ -737,9 +739,11 @@ end_type_pass: if (instr.unknown_stack_structure_tag) { if (!instr.unknown_stack_structure_tag->selected_type) { - throw std::runtime_error(fmt::format("Failed to guess stack use for {} in {}:{}", - instr.unknown_stack_structure_tag->stack_offset, - input.func->name(), instr.aop_idx)); + env.func->warnings.error("Failed to guess stack use for {} in {}:{}", + instr.unknown_stack_structure_tag->stack_offset, + input.func->name(), instr.aop_idx); + out.succeeded = false; + return; // abort here - the type analysis above likely failed } auto& type = instr.unknown_stack_structure_tag->selected_type.value(); diff --git a/decompiler/util/TP_Type.cpp b/decompiler/util/TP_Type.cpp index 5126d8598e..d505bf4f49 100644 --- a/decompiler/util/TP_Type.cpp +++ b/decompiler/util/TP_Type.cpp @@ -44,6 +44,8 @@ std::string TP_Type::print() const { return fmt::format("<{} + (value x {})>", m_ts.print(), m_int); case Kind::OBJECT_NEW_METHOD: return fmt::format("<(object-new) for {}>", m_ts.print()); + case Kind::NON_OBJECT_NEW_METHOD: + return fmt::format("", m_method_from_type.print(), m_ts.print()); case Kind::STRING_CONSTANT: return fmt::format("", m_str); case Kind::FORMAT_STRING: @@ -113,6 +115,8 @@ bool TP_Type::operator==(const TP_Type& other) const { return m_ts == other.m_ts && m_int == other.m_int; case Kind::OBJECT_NEW_METHOD: return m_ts == other.m_ts; + case Kind::NON_OBJECT_NEW_METHOD: + return m_ts == other.m_ts && m_method_from_type == other.m_method_from_type; case Kind::STRING_CONSTANT: return m_str == other.m_str; case Kind::INTEGER_CONSTANT: @@ -175,6 +179,8 @@ TypeSpec TP_Type::typespec() const { // want to assume the return type incorrectly and you shouldn't try to do anything with // this as a typespec. return TypeSpec("function"); + case Kind::NON_OBJECT_NEW_METHOD: + return m_ts; case Kind::STRING_CONSTANT: return TypeSpec("string"); case Kind::INTEGER_CONSTANT: diff --git a/decompiler/util/TP_Type.h b/decompiler/util/TP_Type.h index 8630c6ae4f..ff2600f08c 100644 --- a/decompiler/util/TP_Type.h +++ b/decompiler/util/TP_Type.h @@ -26,6 +26,7 @@ class TP_Type { PRODUCT_WITH_CONSTANT, // representing: (val * multiplier) OBJECT_PLUS_PRODUCT_WITH_CONSTANT, // address: obj + (val * multiplier) OBJECT_NEW_METHOD, // the method new of object, as used in an (object-new) or similar. + NON_OBJECT_NEW_METHOD, // the method new of some type that's not object. STRING_CONSTANT, // a string that's part of the string pool FORMAT_STRING, // a string with a given number of format arguments INTEGER_CONSTANT, // a constant integer. @@ -75,6 +76,7 @@ class TP_Type { case Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION: case Kind::SET_TO_RUN_FUNCTION: case Kind::GET_ART_BY_NAME_METHOD: + case Kind::NON_OBJECT_NEW_METHOD: return false; case Kind::UNINITIALIZED: case Kind::OBJECT_NEW_METHOD: @@ -227,6 +229,14 @@ class TP_Type { return result; } + static TP_Type make_non_object_new(const TypeSpec& function_type, const TypeSpec& object_type) { + TP_Type result; + result.kind = Kind::NON_OBJECT_NEW_METHOD; + result.m_ts = function_type; + result.m_method_from_type = object_type; + return result; + } + /*! * flipped means it's int + obj. */ @@ -361,7 +371,7 @@ class TP_Type { const TypeSpec& method_from_type() const { ASSERT(kind == Kind::VIRTUAL_METHOD || kind == Kind::NON_VIRTUAL_METHOD || - kind == Kind::GET_ART_BY_NAME_METHOD); + kind == Kind::GET_ART_BY_NAME_METHOD || kind == Kind::NON_OBJECT_NEW_METHOD); return m_method_from_type; } diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index b9d43ffaba..00dc2cece0 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -460,11 +460,10 @@ ) (('clone-anim) (clone-anim-once - (the-as handle (if (handle->process (-> self cur-target-handle)) - (the-as int (-> self cur-target-handle)) - (ppointer->handle (-> self parent)) - ) - ) + (if (handle->process (-> self cur-target-handle)) + (the-as handle (-> self cur-target-handle)) + (ppointer->handle (-> self parent)) + ) (the-as int (-> self draw origin-joint-index)) (-> self clone-copy-trans) "" diff --git a/goal_src/jak1/engine/entity/ambient.gc b/goal_src/jak1/engine/entity/ambient.gc index bbbfec5f62..948f4fbdc1 100644 --- a/goal_src/jak1/engine/entity/ambient.gc +++ b/goal_src/jak1/engine/entity/ambient.gc @@ -1208,18 +1208,17 @@ (a3-7 (-> gp-0 w)) (v1-53 s5-0) ) - (t9-10 a0-11 (the-as bucket-id a1-9) a2-9 a3-7 (the-as rgba (cond - ((= v1-53 'sound) - (the-as uint #x8000ffff) - ) - ((= v1-53 'poi) - (the-as uint #x80ff8000) - ) - (else - (the-as uint #x800000ff) - ) - ) - ) + (t9-10 a0-11 (the-as bucket-id a1-9) a2-9 a3-7 (cond + ((= v1-53 'sound) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + ((= v1-53 'poi) + (new 'static 'rgba :g #x80 :b #xff :a #x80) + ) + (else + (new 'static 'rgba :r #xff :a #x80) + ) + ) ) ) (add-debug-text-3d diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index d3e3a70e8e..30da01e3b7 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -189,16 +189,16 @@ ) (until (ja-done? 0) (compute-alignment! (-> self align)) - (align! (-> self align) - (the-as align-opts (if gp-0 - 2 - 6 - ) - ) - (the-as float 1.0) - (the-as float 1.0) - (the-as float 1.5) - ) + (align! + (-> self align) + (if gp-0 + (align-opts adjust-y-vel) + (align-opts adjust-y-vel adjust-xz-vel) + ) + (the-as float 1.0) + (the-as float 1.0) + (the-as float 1.5) + ) (when (and (>= 25.0 (ja-aframe-num 0)) (and (>= (ja-aframe-num 0) 21.0) (= (-> self next-state name) 'target-flop-hit-ground) (!= (-> self control unknown-spoolanim00) 'stuck) diff --git a/goal_src/jak2/engine/debug/debug.gc b/goal_src/jak2/engine/debug/debug.gc index 8b7b18350f..bd48781dd0 100644 --- a/goal_src/jak2/engine/debug/debug.gc +++ b/goal_src/jak2/engine/debug/debug.gc @@ -1037,7 +1037,7 @@ ) (defun-debug add-debug-sphere-with-transform ((enable symbol) (bucket bucket-id) (position vector) (radius meters) (trans matrix) (color rgba)) - "Transform the given point by the given transform, then draw a debug sphere there. + "Transform the given point by the given transform, then draw a debug sphere there. The orientation of the debug sphere itself is not changed by the transform, just its origin." (rlet ((acc :class vf) (vf0 :class vf) @@ -1775,21 +1775,20 @@ buf (+ x -5) (+ y -4) - (the-as font-color (cond - ((= v1-7 1) - 3 - ) - ((= v1-7 2) - 5 - ) - ((= v1-7 4) - 6 - ) - (else - 0 - ) - ) - ) + (cond + ((= v1-7 1) + (font-color orange-red) + ) + ((= v1-7 2) + (font-color fc-5) + ) + ((= v1-7 4) + (font-color fc-6) + ) + (else + (font-color default) + ) + ) (font-flags shadow) ) ) diff --git a/goal_src/jak2/engine/gfx/font-h.gc b/goal_src/jak2/engine/gfx/font-h.gc index 59a8e184f5..d1914eaa00 100644 --- a/goal_src/jak2/engine/gfx/font-h.gc +++ b/goal_src/jak2/engine/gfx/font-h.gc @@ -14,6 +14,8 @@ (default 0) (one 1) (orange-red 3) + (fc-5 5) + (fc-6 6) ) ;; copied from jak1, not completely confirmed. diff --git a/goal_src/jak2/engine/load/load-dgo.gc b/goal_src/jak2/engine/load/load-dgo.gc index e981243875..740cb8e3f4 100644 --- a/goal_src/jak2/engine/load/load-dgo.gc +++ b/goal_src/jak2/engine/load/load-dgo.gc @@ -346,16 +346,16 @@ (-> *dgo-name* data) (the-as int (-> arg0 length)) arg1 - (the-as link-flag (if arg3 - 47 - 39 - ) - ) + (if arg3 + (link-flag output-load-msg output-load-true-msg execute-login print-login fast-link) + (link-flag output-load-msg output-load-true-msg execute-login fast-link) + ) ) ) ) ) + (defun destroy-mem ((arg0 (pointer uint32)) (arg1 (pointer uint32))) (while (< (the-as int arg0) (the-as int arg1)) (set! (-> arg0 0) (the-as uint #xffffffff)) diff --git a/goal_src/jak2/engine/util/profile.gc b/goal_src/jak2/engine/util/profile.gc index 87f69ae0eb..77d477a886 100644 --- a/goal_src/jak2/engine/util/profile.gc +++ b/goal_src/jak2/engine/util/profile.gc @@ -688,11 +688,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-0 100.0) - 3 - 0 - ) - ) + (if (>= f30-0 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -705,11 +704,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-0 100.0) - 3 - 0 - ) - ) + (if (>= f30-0 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -741,11 +739,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-1 100.0) - 3 - 0 - ) - ) + (if (>= f30-1 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -758,11 +755,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-1 100.0) - 3 - 0 - ) - ) + (if (>= f30-1 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -778,6 +774,7 @@ (none) ) + (defmethod draw-text! profile-array ((obj profile-array)) "Draw the table of times." (let ((gp-0 *profile-collapse*)) diff --git a/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc index b38df9d332..5decd98708 100644 --- a/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak1/engine/ambient/ambient_REF.gc @@ -1225,18 +1225,17 @@ (a3-7 (-> gp-0 w)) (v1-53 s5-0) ) - (t9-10 a0-11 (the-as bucket-id a1-9) a2-9 a3-7 (the-as rgba (cond - ((= v1-53 'sound) - (the-as uint #x8000ffff) - ) - ((= v1-53 'poi) - (the-as uint #x80ff8000) - ) - (else - (the-as uint #x800000ff) - ) - ) - ) + (t9-10 a0-11 (the-as bucket-id a1-9) a2-9 a3-7 (cond + ((= v1-53 'sound) + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + ((= v1-53 'poi) + (new 'static 'rgba :g #x80 :b #xff :a #x80) + ) + (else + (new 'static 'rgba :r #xff :a #x80) + ) + ) ) ) (add-debug-text-3d diff --git a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc index 37f4d4e729..203836803b 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc @@ -1323,7 +1323,11 @@ 1.0 ) (else - (let* ((f0-29 (* f0-28 f0-28)) (f0-30 (- 1.0 f0-29))) (* f0-30 (* f0-30 f0-30))) + (let* ((f0-29 (* f0-28 f0-28)) + (f0-30 (- 1.0 f0-29)) + ) + (* f0-30 (* f0-30 f0-30)) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/data/res_REF.gc b/test/decompiler/reference/jak1/engine/data/res_REF.gc index 0e53fa09ec..de8ce2cb3b 100644 --- a/test/decompiler/reference/jak1/engine/data/res_REF.gc +++ b/test/decompiler/reference/jak1/engine/data/res_REF.gc @@ -739,7 +739,11 @@ (defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) (local-vars (sv-16 object)) (set! sv-16 arg1) - (let* ((v1-0 arg0) (a1-4 (copy-and-set-field v1-0 inlined? 1))) (add-data! obj a1-4 (& sv-16))) + (let* ((v1-0 arg0) + (a1-4 (copy-and-set-field v1-0 inlined? 1)) + ) + (add-data! obj a1-4 (& sv-16)) + ) ) ;; definition for method 21 of type res-lump diff --git a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc index c06c3d57b9..0b6a24d1a0 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -1158,11 +1158,10 @@ s3-0 (-> arg1 xpos) (-> arg1 ypos) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1287,11 +1286,10 @@ s3-0 (-> arg1 xpos) (-> arg1 ypos) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1464,11 +1462,10 @@ s3-0 (-> arg1 xpos) (-> arg1 ypos) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) @@ -1748,11 +1745,10 @@ (-> arg1 xpos) (-> arg1 ypos) (the-as float 0.0) - (the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index)) - 15 - 12 - ) - ) + (if (= (-> arg1 the-index) (-> arg1 current-index)) + (font-color yellow-green) + (font-color dim-white) + ) (font-flags shadow kerning) ) ) diff --git a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc index 57ee349422..b6e5acfb9f 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc @@ -64,26 +64,24 @@ (let* ((a1-4 buf) (a3-2 (the-as gs-gif-tag (-> a1-4 base))) ) - (set! (-> a3-2 tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) - :nreg #x8 - ) + (set! (-> a3-2 tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x8 + ) ) - (set! (-> a3-2 regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - :regs4 (gif-reg-id rgbaq) - :regs5 (gif-reg-id xyzf2) - :regs6 (gif-reg-id rgbaq) - :regs7 (gif-reg-id xyzf2) - ) + (set! (-> a3-2 regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + :regs4 (gif-reg-id rgbaq) + :regs5 (gif-reg-id xyzf2) + :regs6 (gif-reg-id rgbaq) + :regs7 (gif-reg-id xyzf2) + ) ) (set! (-> a1-4 base) (&+ (the-as pointer a3-2) 16)) ) @@ -210,22 +208,20 @@ (let* ((a1-6 v1-28) (a3-3 (the-as gs-gif-tag (-> a1-6 base))) ) - (set! (-> a3-3 tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) - :nreg #x4 - ) + (set! (-> a3-3 tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) + :nreg #x4 + ) ) - (set! (-> a3-3 regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> a3-3 regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-6 base) (&+ (the-as pointer a3-3) 16)) ) @@ -414,24 +410,22 @@ (let* ((a1-7 v1-9) (a3-3 (the-as gs-gif-tag (-> a1-7 base))) ) - (set! (-> a3-3 tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri) :iip #x1 :abe #x1) - :nreg #x6 - ) + (set! (-> a3-3 tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri) :iip #x1 :abe #x1) + :nreg #x6 + ) ) - (set! (-> a3-3 regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - :regs4 (gif-reg-id rgbaq) - :regs5 (gif-reg-id xyzf2) - ) + (set! (-> a3-3 regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + :regs4 (gif-reg-id rgbaq) + :regs5 (gif-reg-id xyzf2) + ) ) (set! (-> a1-7 base) (&+ (the-as pointer a3-3) 16)) ) @@ -696,22 +690,20 @@ (let* ((a1-8 s4-0) (a2-5 (the-as gs-gif-tag (-> a1-8 base))) ) - (set! (-> a2-5 tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) - :nreg #x4 - ) + (set! (-> a2-5 tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) + :nreg #x4 + ) ) - (set! (-> a2-5 regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> a2-5 regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-8 base) (&+ (the-as pointer a2-5) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc index ae80477cbf..edc9ed4064 100644 --- a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc @@ -850,18 +850,17 @@ (set! (-> v1-2 origin x) (the float arg1)) (set! (-> v1-2 origin y) (the float a0-1)) ) - (set! (-> s5-0 color) (the-as font-color (cond - ((zero? arg3) - 12 - ) - (arg4 - 11 - ) - (else - 13 - ) - ) - ) + (set! (-> s5-0 color) (cond + ((zero? arg3) + (font-color dim-white) + ) + (arg4 + (font-color dark-light-blue) + ) + (else + (font-color dim-gray) + ) + ) ) (let* ((s3-0 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (s4-0 (-> s3-0 base)) @@ -946,24 +945,23 @@ (set! (-> a0-1 origin x) (the float arg1)) (set! (-> a0-1 origin y) (the float a1-1)) ) - (set! (-> v1-2 color) (the-as font-color (cond - ((= (-> arg0 is-on) 'invalid) - 19 - ) - ((-> arg0 is-on) - (if (zero? arg3) - 15 - 16 - ) - ) - ((zero? arg3) - 17 - ) - (else - 18 - ) - ) - ) + (set! (-> v1-2 color) (cond + ((= (-> arg0 is-on) 'invalid) + (font-color flat-dark-purple) + ) + ((-> arg0 is-on) + (if (zero? arg3) + (font-color yellow-green) + (font-color dark-green) + ) + ) + ((zero? arg3) + (font-color another-gray) + ) + (else + (font-color dark-dark-green) + ) + ) ) (let* ((s4-0 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (s5-0 (-> s4-0 base)) @@ -997,21 +995,20 @@ (set! (-> v1-2 origin x) (the float arg1)) (set! (-> v1-2 origin y) (the float a0-1)) ) - (set! (-> s5-0 color) (the-as font-color (cond - ((zero? arg3) - (if (-> arg0 grabbed-joypad-p) - 10 - 12 - ) - ) - (arg4 - 11 - ) - (else - 13 - ) - ) - ) + (set! (-> s5-0 color) (cond + ((zero? arg3) + (if (-> arg0 grabbed-joypad-p) + (font-color cyan) + (font-color dim-white) + ) + ) + (arg4 + (font-color dark-light-blue) + ) + (else + (font-color dim-gray) + ) + ) ) (let* ((s1-0 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (s4-0 (-> s1-0 base)) @@ -1092,15 +1089,18 @@ (defun debug-menu-render ((arg0 debug-menu) (arg1 int) (arg2 int) (arg3 debug-menu-node) (arg4 int)) (local-vars (sv-16 dma-buffer) (sv-32 pointer)) (let ((v1-0 0)) - (let* ((a0-1 (-> arg0 items)) (a1-1 (car a0-1))) (while (not (null? a0-1)) - (if (= a1-1 arg3) - (goto cfg-7) - ) - (+! v1-0 1) - (set! a0-1 (cdr a0-1)) - (set! a1-1 (car a0-1)) - ) - ) + (let* ((a0-1 (-> arg0 items)) + (a1-1 (car a0-1)) + ) + (while (not (null? a0-1)) + (if (= a1-1 arg3) + (goto cfg-7) + ) + (+! v1-0 1) + (set! a0-1 (cdr a0-1)) + (set! a1-1 (car a0-1)) + ) + ) (label cfg-7) (if (< 16 v1-0) (set! arg2 (- arg2 (* (+ v1-0 -16) 8))) @@ -1132,11 +1132,10 @@ ) (while (not (null? s1-1)) (when (= s0-1 arg3) - (set! (-> arg0 context font color) (the-as font-color (if (nonzero? arg4) - 13 - 12 - ) - ) + (set! (-> arg0 context font color) (if (nonzero? arg4) + (font-color dim-gray) + (font-color dim-white) + ) ) (let ((v1-16 (-> arg0 context font)) (a1-5 s3-1) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc index 34cc4b1955..16b801fff9 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc @@ -1400,25 +1400,24 @@ (t1-2 (the-as object (-> a3-4 base))) ) (set! (-> (the-as gs-gif-tag t1-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> (the-as gs-gif-tag t1-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag t1-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> a3-4 base) (&+ (the-as pointer t1-2) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc index 7a8e25f2d0..84101b40dc 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc @@ -900,11 +900,10 @@ ) ) ((or (= arg0 'full) (-> s0-0 extra process)) - (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (the-as rgba (if (-> s0-0 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s1-0 (if (-> s0-0 extra process) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + (new 'static 'rgba :r #xff :a #x80) + ) ) (set! sv-192 add-debug-text-3d) (set! sv-208 #t) @@ -1001,22 +1000,20 @@ (s4-2 (-> (the-as process-drawable s5-2) root trans)) ) (when s3-2 - (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (the-as rgba (if (-> s3-2 extra process) - (the-as uint #x8080ff80) - (the-as uint #x800000ff) - ) - ) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-2 (if (-> s3-2 extra process) + (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) + (new 'static 'rgba :r #xff :a #x80) + ) ) (add-debug-text-3d #t (bucket-id debug-no-zbuf) (res-lump-struct s3-2 'name string) s4-2 - (the-as font-color (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) - 1 - 1 - ) - ) + (if (logtest? (-> s3-2 extra perm status) (entity-perm-status bit-0 bit-1)) + (font-color white) + (font-color white) + ) (new 'static 'vector2h :y 8) ) (add-debug-text-3d @@ -1072,11 +1069,10 @@ (bucket-id debug-no-zbuf) (the-as vector (&+ v0-35 0)) (the-as vector (&+ v0-35 16)) - (the-as rgba (if (is-object-visible? (-> s5-3 extra level) a1-31) - (the-as uint #x80808000) - (the-as uint #x80800080) - ) - ) + (if (is-object-visible? (-> s5-3 extra level) a1-31) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :b #x80 :a #x80) + ) ) ) ) @@ -1168,11 +1164,10 @@ (bucket-id debug) (the-as vector (-> s3-4 data s2-4)) (the-as vector (+ (the-as uint (-> s3-4 data 0 max)) (* s2-4 32))) - (the-as rgba (if (zero? (-> s4-4 index)) - (the-as uint #x80808000) - (the-as uint #x808080ff) - ) - ) + (if (zero? (-> s4-4 index)) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc b/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc index c0cbcd9c2b..036ae1f9ae 100644 --- a/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/generic-obs_REF.gc @@ -511,11 +511,10 @@ ) (('clone-anim) (clone-anim-once - (the-as handle (if (handle->process (-> self cur-target-handle)) - (the-as int (-> self cur-target-handle)) - (ppointer->handle (-> self parent)) - ) - ) + (if (handle->process (-> self cur-target-handle)) + (the-as handle (-> self cur-target-handle)) + (ppointer->handle (-> self parent)) + ) (the-as int (-> self draw origin-joint-index)) (-> self clone-copy-trans) "" @@ -996,24 +995,30 @@ (('while) (let ((s3-0 (car s4-0))) (while (eval obj (the-as pair s3-0)) - (let* ((s2-0 (cdr s4-0)) (a1-3 (car s2-0))) (while (not (null? s2-0)) - (set! gp-0 (eval obj (the-as pair a1-3))) - (set! s2-0 (cdr s2-0)) - (set! a1-3 (car s2-0)) - ) - ) + (let* ((s2-0 (cdr s4-0)) + (a1-3 (car s2-0)) + ) + (while (not (null? s2-0)) + (set! gp-0 (eval obj (the-as pair a1-3))) + (set! s2-0 (cdr s2-0)) + (set! a1-3 (car s2-0)) + ) + ) ) ) ) (('until) (let ((s3-1 (car s4-0))) (while (not (eval obj (the-as pair s3-1))) - (let* ((s2-1 (cdr s4-0)) (a1-5 (car s2-1))) (while (not (null? s2-1)) - (set! gp-0 (eval obj (the-as pair a1-5))) - (set! s2-1 (cdr s2-1)) - (set! a1-5 (car s2-1)) - ) - ) + (let* ((s2-1 (cdr s4-0)) + (a1-5 (car s2-1)) + ) + (while (not (null? s2-1)) + (set! gp-0 (eval obj (the-as pair a1-5))) + (set! s2-1 (cdr s2-1)) + (set! a1-5 (car s2-1)) + ) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/depth-cue_REF.gc b/test/decompiler/reference/jak1/engine/gfx/depth-cue_REF.gc index c789060541..cc9192a474 100644 --- a/test/decompiler/reference/jak1/engine/gfx/depth-cue_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/depth-cue_REF.gc @@ -133,25 +133,24 @@ (t6-2 (the-as object (-> t5-1 base))) ) (set! (-> (the-as gs-gif-tag t6-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x4)) - (set! (-> (the-as gs-gif-tag t6-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag t6-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> t5-1 base) (&+ (the-as pointer t6-2) 16)) ) @@ -277,25 +276,24 @@ (t6-2 (the-as object (-> t5-1 base))) ) (set! (-> (the-as gs-gif-tag t6-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x5)) - (set! (-> (the-as gs-gif-tag t6-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag t6-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> t5-1 base) (&+ (the-as pointer t6-2) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/eye_REF.gc b/test/decompiler/reference/jak1/engine/gfx/eye_REF.gc index cdf70dc65d..cecf00db02 100644 --- a/test/decompiler/reference/jak1/engine/gfx/eye_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/eye_REF.gc @@ -72,25 +72,24 @@ (a0-8 (the-as object (-> v1-13 base))) ) (set! (-> (the-as gs-gif-tag a0-8) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-8) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-8) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-13 base) (&+ (the-as pointer a0-8) 16)) ) @@ -128,25 +127,24 @@ (a2-9 (the-as object (-> a1-23 base))) ) (set! (-> (the-as gs-gif-tag a2-9) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a2-9) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a2-9) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> a1-23 base) (&+ (the-as pointer a2-9) 16)) ) @@ -187,25 +185,24 @@ (a2-19 (the-as object (-> a1-30 base))) ) (set! (-> (the-as gs-gif-tag a2-19) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a2-19) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a2-19) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> a1-30 base) (&+ (the-as pointer a2-19) 16)) ) @@ -248,25 +245,24 @@ (a0-34 (the-as object (-> v1-25 base))) ) (set! (-> (the-as gs-gif-tag a0-34) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-34) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-34) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-25 base) (&+ (the-as pointer a0-34) 16)) ) @@ -308,25 +304,24 @@ (a2-29 (the-as object (-> a1-46 base))) ) (set! (-> (the-as gs-gif-tag a2-29) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a2-29) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a2-29) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> a1-46 base) (&+ (the-as pointer a2-29) 16)) ) @@ -372,25 +367,24 @@ (a2-39 (the-as object (-> a1-53 base))) ) (set! (-> (the-as gs-gif-tag a2-39) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a2-39) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a2-39) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> a1-53 base) (&+ (the-as pointer a2-39) 16)) ) @@ -498,25 +492,24 @@ (a2-49 (the-as object (-> a1-71 base))) ) (set! (-> (the-as gs-gif-tag a2-49) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a2-49) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a2-49) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> a1-71 base) (&+ (the-as pointer a2-49) 16)) ) @@ -845,11 +838,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> s5-3 level)) - 48 - 51 - ) - ) + (if (zero? (-> s5-3 level)) + (bucket-id pris-tex0) + (bucket-id pris-tex1) + ) s4-0 (the-as (pointer dma-tag) a3-6) ) @@ -898,25 +890,24 @@ (a0-87 (the-as object (-> v1-81 base))) ) (set! (-> (the-as gs-gif-tag a0-87) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-87) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-87) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-81 base) (&+ (the-as pointer a0-87) 16)) ) @@ -958,25 +949,24 @@ (a0-102 (the-as object (-> v1-93 base))) ) (set! (-> (the-as gs-gif-tag a0-102) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-102) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-102) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-93 base) (&+ (the-as pointer a0-102) 16)) ) @@ -1018,25 +1008,24 @@ (a0-117 (the-as object (-> v1-105 base))) ) (set! (-> (the-as gs-gif-tag a0-117) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-117) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-117) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-105 base) (&+ (the-as pointer a0-117) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1_REF.gc index 13af3dcaf6..792645b72c 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1_REF.gc @@ -68,40 +68,38 @@ (a0-4 (the-as gs-gif-tag (-> v1-4 base))) ) (set! (-> a0-4 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> a0-4 regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> a0-4 regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-4 base) (the-as pointer (&+ a0-4 16))) ) (let* ((v1-5 arg0) (a0-6 (-> v1-5 base)) ) - (set! (-> (the-as (pointer gs-test) a0-6) 0) - (new 'static 'gs-test - :ate #x1 - :atst (gs-atest greater-equal) - :aref #x26 - :afail #x1 - :zte #x1 - :ztst (gs-ztest greater-equal) - ) + (set! (-> (the-as (pointer gs-test) a0-6) 0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x26 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) ) (set! (-> (the-as (pointer uint64) a0-6) 1) (the-as uint (gs-reg test-1))) (set! (-> (the-as (pointer gs-zbuf) a0-6) 2) arg2) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc index 79a02c13e3..6cb190bb94 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc @@ -345,11 +345,10 @@ buf 488 (+ bar-pos 8) - (the-as font-color (if (>= f30-0 100.0) - 3 - 0 - ) - ) + (if (>= f30-0 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -373,12 +372,11 @@ (defun draw-sprite2d-xy ((buf dma-buffer) (x int) (y int) (w int) (h int) (color rgba)) (let* ((context (new 'stack 'draw-context x y w h color)) (draw-x (max 1792 (min 2304 (+ (-> context orgx) 1792)))) - (draw-y - (max - (min (+ (-> context orgy) (-> *video-parms* screen-miny)) (-> *video-parms* screen-maxy)) - (-> *video-parms* screen-miny) - ) - ) + (draw-y (max + (min (+ (-> context orgy) (-> *video-parms* screen-miny)) (-> *video-parms* screen-maxy)) + (-> *video-parms* screen-miny) + ) + ) (draw-w (-> context width)) (draw-h (-> context height)) (end-dma (the-as dma-packet (-> buf base))) @@ -436,12 +434,11 @@ ;; INFO: Return type mismatch pointer vs none. (defun draw-quad2d ((buf dma-buffer) (context draw-context)) (let ((draw-x (max 1792 (min 2304 (+ (-> context orgx) 1792)))) - (draw-y - (max - (min (+ (-> context orgy) (-> *video-parms* screen-miny)) (-> *video-parms* screen-maxy)) - (-> *video-parms* screen-miny) - ) - ) + (draw-y (max + (min (+ (-> context orgy) (-> *video-parms* screen-miny)) (-> *video-parms* screen-maxy)) + (-> *video-parms* screen-miny) + ) + ) (draw-w (-> context width)) (draw-h (-> context height)) (end-dma (-> buf base)) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc index c0b8a86a8d..8e960cccad 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc @@ -805,25 +805,24 @@ (gif-tag (the-as gs-gif-tag (-> buff-ptr5 base))) ) (set! (-> gif-tag tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) - (set! (-> gif-tag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> gif-tag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> buff-ptr5 base) (&+ (the-as pointer gif-tag) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc index 37a7a7b837..818d32c043 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc @@ -445,25 +445,24 @@ (a0-8 (the-as object (-> v1-9 base))) ) (set! (-> (the-as gs-gif-tag a0-8) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-8) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-8) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-9 base) (&+ (the-as pointer a0-8) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc index bceff0a5e8..229a57508f 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-near_REF.gc @@ -649,25 +649,24 @@ (a0-3 (the-as object (-> v1-1 base))) ) (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-3) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-3) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-1 base) (the-as pointer (the-as dma-packet (&+ (the-as pointer a0-3) 16)))) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-texture_REF.gc index a289cc6611..fb8e2cfdf4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-texture_REF.gc @@ -243,25 +243,24 @@ (a0-17 (the-as object (-> v1-14 base))) ) (set! (-> (the-as gs-gif-tag a0-17) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x6)) - (set! (-> (the-as gs-gif-tag a0-17) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-17) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-14 base) (&+ (the-as pointer a0-17) 16)) ) @@ -309,25 +308,24 @@ (a0-37 (the-as object (-> v1-36 base))) ) (set! (-> (the-as gs-gif-tag a0-37) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> (the-as gs-gif-tag a0-37) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-37) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-36 base) (&+ (the-as pointer a0-37) 16)) ) @@ -364,25 +362,24 @@ (a0-56 (the-as object (-> v1-51 base))) ) (set! (-> (the-as gs-gif-tag a0-56) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> (the-as gs-gif-tag a0-56) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-56) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-51 base) (&+ (the-as pointer a0-56) 16)) ) @@ -419,25 +416,24 @@ (a0-75 (the-as object (-> v1-66 base))) ) (set! (-> (the-as gs-gif-tag a0-75) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> (the-as gs-gif-tag a0-75) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-75) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-66 base) (&+ (the-as pointer a0-75) 16)) ) @@ -474,25 +470,24 @@ (a0-95 (the-as object (-> v1-81 base))) ) (set! (-> (the-as gs-gif-tag a0-95) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> (the-as gs-gif-tag a0-95) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-95) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-81 base) (&+ (the-as pointer a0-95) 16)) ) @@ -529,25 +524,24 @@ (a0-115 (the-as object (-> v1-96 base))) ) (set! (-> (the-as gs-gif-tag a0-115) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> (the-as gs-gif-tag a0-115) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-115) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-96 base) (&+ (the-as pointer a0-115) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc index ca2e0afd84..f7aa2c42d0 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc @@ -945,25 +945,24 @@ (a0-21 (the-as object (-> v1-32 base))) ) (set! (-> (the-as gs-gif-tag a0-21) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-21) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-21) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-32 base) (&+ (the-as pointer a0-21) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc index 66b5902320..7cc60ff779 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc @@ -850,25 +850,24 @@ (giftag (the-as gs-gif-tag (-> v1-14 base))) ) (set! (-> giftag tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-14 base) (&+ (the-as pointer giftag) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/texture_REF.gc b/test/decompiler/reference/jak1/engine/gfx/texture_REF.gc index 7300c860b3..d6af9fd8b4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/texture_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/texture_REF.gc @@ -926,25 +926,24 @@ (gif (the-as gs-gif-tag (-> v1-48 base))) ) (set! (-> gif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> gif regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> gif regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-48 base) (&+ (the-as pointer gif) 16)) ) @@ -1104,25 +1103,24 @@ (gif (the-as gs-gif-tag (-> v1-53 base))) ) (set! (-> gif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> gif regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> gif regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-53 base) (&+ (the-as pointer gif) 16)) ) @@ -1832,25 +1830,24 @@ (a0-3 (the-as object (-> v1-4 base))) ) (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-3) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-3) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-4 base) (&+ (the-as pointer a0-3) 16)) ) @@ -2220,25 +2217,24 @@ (a0-20 (the-as object (-> v1-16 base))) ) (set! (-> (the-as gs-gif-tag a0-20) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-20) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-20) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-16 base) (&+ (the-as pointer a0-20) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc index bfbcb26b56..99006ecb18 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc @@ -149,11 +149,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 6 - 13 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-0) + (bucket-id tfrag-1) + ) s2-0 (the-as (pointer dma-tag) a3-3) ) @@ -222,11 +221,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 7 - 14 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-near-0) + (bucket-id tfrag-near-1) + ) s2-1 (the-as (pointer dma-tag) a3-6) ) @@ -373,11 +371,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 32 - 39 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-trans-0) + (bucket-id tfrag-trans-1) + ) s3-0 (the-as (pointer dma-tag) a3-3) ) @@ -447,11 +444,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 33 - 40 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-trans-near-0) + (bucket-id tfrag-trans-near-1) + ) s3-1 (the-as (pointer dma-tag) a3-6) ) @@ -575,11 +571,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 34 - 41 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-dirt-0) + (bucket-id tfrag-dirt-1) + ) s3-0 (the-as (pointer dma-tag) a3-3) ) @@ -642,11 +637,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 35 - 42 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-dirt-near-0) + (bucket-id tfrag-dirt-near-1) + ) s3-1 (the-as (pointer dma-tag) a3-6) ) @@ -774,11 +768,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 36 - 43 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-ice-0) + (bucket-id tfrag-ice-1) + ) s3-0 (the-as (pointer dma-tag) a3-3) ) @@ -841,11 +834,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) - 37 - 44 - ) - ) + (if (zero? (-> (the-as terrain-context #x70000000) bsp lev-index)) + (bucket-id tfrag-ice-near-0) + (bucket-id tfrag-ice-near-1) + ) s3-1 (the-as (pointer dma-tag) a3-6) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc index c784a3ee64..2e79ddef9a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc @@ -361,25 +361,24 @@ (a0-4 (the-as object (-> v1-1 base))) ) (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-4) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-4) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) ) @@ -466,25 +465,24 @@ (a0-4 (the-as object (-> v1-1 base))) ) (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-4) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-4) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-1 base) (&+ (the-as pointer a0-4) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc index 6c5997db7f..b2e89bd0bd 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc @@ -538,11 +538,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> arg1 index)) - 9 - 16 - ) - ) + (if (zero? (-> arg1 index)) + (bucket-id tie-0) + (bucket-id tie-1) + ) s2-2 (the-as (pointer dma-tag) a3-11) ) @@ -615,11 +614,10 @@ ) (dma-bucket-insert-tag (-> *display* frames (-> *display* on-screen) frame bucket-group) - (the-as bucket-id (if (zero? (-> arg1 index)) - 8 - 15 - ) - ) + (if (zero? (-> arg1 index)) + (bucket-id tie-near-0) + (bucket-id tie-near-1) + ) s2-3 (the-as (pointer dma-tag) a3-16) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc index 87f58726e5..bd9ba4d5c1 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc @@ -375,25 +375,24 @@ (a0-4 (the-as object (-> v1-4 base))) ) (set! (-> (the-as gs-gif-tag a0-4) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-4) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-4) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-4 base) (the-as pointer (&+ (the-as gs-gif-tag a0-4) 16))) ) @@ -467,25 +466,24 @@ (a1-2 (the-as object (-> v1-4 base))) ) (set! (-> (the-as gs-gif-tag a1-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a1-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a1-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-4 base) (&+ (the-as pointer a1-2) 16)) ) diff --git a/test/decompiler/reference/jak1/engine/level/level_REF.gc b/test/decompiler/reference/jak1/engine/level/level_REF.gc index dce77acd44..6e42ecb485 100644 --- a/test/decompiler/reference/jak1/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/level_REF.gc @@ -773,19 +773,22 @@ ) ) ) - (let* ((s5-3 (-> obj info packages)) (a0-29 (car s5-3))) (while (not (null? s5-3)) - (case (rtype-of a0-29) - ((symbol) - (unload (symbol->string (the-as symbol a0-29))) - ) - ((string) - (unload (the-as string a0-29)) - ) - ) - (set! s5-3 (cdr s5-3)) - (set! a0-29 (car s5-3)) - ) + (let* ((s5-3 (-> obj info packages)) + (a0-29 (car s5-3)) + ) + (while (not (null? s5-3)) + (case (rtype-of a0-29) + ((symbol) + (unload (symbol->string (the-as symbol a0-29))) + ) + ((string) + (unload (the-as string a0-29)) + ) ) + (set! s5-3 (cdr s5-3)) + (set! a0-29 (car s5-3)) + ) + ) (vis-clear obj) (let ((v1-64 (-> obj heap))) (set! (-> v1-64 current) (-> v1-64 base)) diff --git a/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc index 31bc2d43c6..6876066ae5 100644 --- a/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc @@ -331,11 +331,10 @@ (-> *dgo-name* data) (the-as int (-> obj-file length)) heap - (the-as link-flag (if print-login - 47 - 39 - ) - ) + (if print-login + (link-flag output-load-msg output-load-true-msg execute-login print-login fast-link) + (link-flag output-load-msg output-load-true-msg execute-login fast-link) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/math/math_REF.gc b/test/decompiler/reference/jak1/engine/math/math_REF.gc index 9f5b772c04..2f7b323e73 100644 --- a/test/decompiler/reference/jak1/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/math_REF.gc @@ -95,18 +95,21 @@ ;; definition for function seekl (defun seekl ((arg0 int) (arg1 int) (arg2 int)) - (let* ((v1-0 (- arg1 arg0)) (a3-0 (abs v1-0))) (cond - ((>= arg2 a3-0) - arg1 - ) - ((>= v1-0 0) - (+ arg0 arg2) - ) - (else - (- arg0 arg2) - ) - ) + (let* ((v1-0 (- arg1 arg0)) + (a3-0 (abs v1-0)) + ) + (cond + ((>= arg2 a3-0) + arg1 + ) + ((>= v1-0 0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) ) + ) + ) ) ;; definition for function rand-vu-init diff --git a/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc b/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc index 4eb4eef5f1..e13ed2db78 100644 --- a/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/trigonometry_REF.gc @@ -655,7 +655,12 @@ 16383.996 ) (else - (let* ((f0-6 1.0) (f1-2 arg0) (f0-8 (sqrtf (- f0-6 (* f1-2 f1-2))))) (atan0 arg0 f0-8)) + (let* ((f0-6 1.0) + (f1-2 arg0) + (f0-8 (sqrtf (- f0-6 (* f1-2 f1-2)))) + ) + (atan0 arg0 f0-8) + ) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc index aebac73435..2ffe53d15a 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc @@ -1795,27 +1795,26 @@ (when (logtest? (-> obj flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) - (debug-draw-poly s5-0 s2-1 (the-as rgba (cond - ((logtest? (-> s2-1 pat) 1) - #x40808000 - ) - ((logtest? (-> s2-1 pat) 2) - #x4080ff00 - ) - ((logtest? (-> s2-1 pat) 4) - (the-as int (the-as uint #x8040ff00)) - ) - ((logtest? (-> s2-1 pat) 8) - (the-as int (the-as uint #xff408000)) - ) - ((logtest? (-> s2-1 pat) 16) - (the-as int (the-as uint #xff408000)) - ) - (else - (the-as int (the-as uint #x80ff8000)) - ) - ) - ) + (debug-draw-poly s5-0 s2-1 (cond + ((logtest? (-> s2-1 pat) 1) + (new 'static 'rgba :g #x80 :b #x80 :a #x40) + ) + ((logtest? (-> s2-1 pat) 2) + (new 'static 'rgba :g #xff :b #x80 :a #x40) + ) + ((logtest? (-> s2-1 pat) 4) + (new 'static 'rgba :g #xff :b #x40 :a #x80) + ) + ((logtest? (-> s2-1 pat) 8) + (new 'static 'rgba :g #x80 :b #x40 :a #xff) + ) + ((logtest? (-> s2-1 pat) 16) + (new 'static 'rgba :g #x80 :b #x40 :a #xff) + ) + (else + (new 'static 'rgba :g #x80 :b #xff :a #x80) + ) + ) ) (when (logtest? (-> obj flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) diff --git a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc index 8e5be9ce0e..e55bbbb409 100644 --- a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc @@ -932,7 +932,11 @@ (defun-debug make-sqrt-table () (format #t "static int sqrt_table[256] =~%{~%") (dotimes (gp-0 256) - (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) (a2-0 (the int (+ 0.5 f0-2)))) (format #t "~D,~%" a2-0)) + (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) + (a2-0 (the int (+ 0.5 f0-2))) + ) + (format #t "~D,~%" a2-0) + ) ) (format #t "};~%") 0 diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index 45c5e93cdd..208adf9889 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -176,11 +176,10 @@ (compute-alignment! (-> self align)) (align! (-> self align) - (the-as align-opts (if gp-0 - 2 - 6 - ) - ) + (if gp-0 + (align-opts adjust-y-vel) + (align-opts adjust-y-vel adjust-xz-vel) + ) (the-as float 1.0) (the-as float 1.0) (the-as float 1.5) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc index 3596861414..3d842eed4d 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc @@ -691,11 +691,10 @@ (print-game-text (lookup-text! *common-text* - (the-as game-text-id (if (= (-> obj display-state) (progress-screen load-game)) - 321 - 320 - ) - ) + (if (= (-> obj display-state) (progress-screen load-game)) + (game-text-id select-file-to-load) + (game-text-id select-file-to-save) + ) #f ) arg0 @@ -1944,12 +1943,10 @@ (when sv-912 (let ((f0-23 (-> obj transition-percentage-invert))) (let ((v1-235 sv-112)) - (set! (-> v1-235 color) - (the-as font-color (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) - 30 - 0 - ) - ) + (set! (-> v1-235 color) (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) + (font-color yellow-green-2) + (font-color default) + ) ) ) (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) diff --git a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc index 898cf0a983..af6616bfa2 100644 --- a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc @@ -974,11 +974,10 @@ ) ) ) - (set! (-> obj fuel-cell) (the-as handle (if s5-2 - (ppointer->handle s5-2) - (the-as int #f) - ) - ) + (set! (-> obj fuel-cell) (if s5-2 + (ppointer->handle s5-2) + (the-as handle #f) + ) ) (when s5-2 (send-event diff --git a/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc index 14578e115e..324f5b5f0c 100644 --- a/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/nav-enemy_REF.gc @@ -1962,75 +1962,73 @@ nav-enemy-default-event-handler (set! (-> s4-0 quad) (-> obj collide-info trans quad)) (set! (-> obj collide-info trans quad) (-> arg0 quad)) (let ((gp-0 (-> obj nav))) - (TODO-RENAME-28 - gp-0 - (collide-kind - background - cak-1 - cak-2 - cak-3 - target - water - powerup - crate - enemy - wall-object - projectile - ground-object - target-attack - mother-spider - cak-14 - blue-eco-suck - unknown-16 - unknown-17 - unknown-18 - unknown-19 - unknown-20 - unknown-21 - unknown-22 - unknown-23 - unknown-24 - unknown-25 - unknown-26 - unknown-27 - unknown-28 - unknown-29 - unknown-30 - unknown-31 - unknown-32 - unknown-33 - unknown-34 - unknown-35 - unknown-36 - unknown-37 - unknown-38 - unknown-39 - unknown-40 - unknown-41 - unknown-42 - unknown-43 - unknown-44 - unknown-45 - unknown-46 - unknown-47 - unknown-48 - unknown-49 - unknown-50 - unknown-51 - unknown-52 - unknown-53 - unknown-54 - unknown-55 - unknown-56 - unknown-57 - unknown-58 - unknown-59 - unknown-60 - unknown-61 - unknown-62 - unknown-63 - ) - ) + (TODO-RENAME-28 gp-0 (collide-kind + background + cak-1 + cak-2 + cak-3 + target + water + powerup + crate + enemy + wall-object + projectile + ground-object + target-attack + mother-spider + cak-14 + blue-eco-suck + unknown-16 + unknown-17 + unknown-18 + unknown-19 + unknown-20 + unknown-21 + unknown-22 + unknown-23 + unknown-24 + unknown-25 + unknown-26 + unknown-27 + unknown-28 + unknown-29 + unknown-30 + unknown-31 + unknown-32 + unknown-33 + unknown-34 + unknown-35 + unknown-36 + unknown-37 + unknown-38 + unknown-39 + unknown-40 + unknown-41 + unknown-42 + unknown-43 + unknown-44 + unknown-45 + unknown-46 + unknown-47 + unknown-48 + unknown-49 + unknown-50 + unknown-51 + unknown-52 + unknown-53 + unknown-54 + unknown-55 + unknown-56 + unknown-57 + unknown-58 + unknown-59 + unknown-60 + unknown-61 + unknown-62 + unknown-63 + ) + ) (set! (-> obj collide-info trans quad) (-> s4-0 quad)) (let* ((v1-8 (-> gp-0 mesh origin)) (f0-1 (- (-> arg0 x) (-> v1-8 x))) diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index eb17545edb..a01b533541 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -811,15 +811,18 @@ ;; INFO: Return type mismatch int vs symbol. (defmethod dummy-28 gnawer ((obj gnawer) (arg0 int) (arg1 int)) (when (> arg0 0) - (let* ((v1-1 (rand-vu-int-count arg0)) (a0-2 v1-1)) (until (= a0-2 v1-1) - (let ((a1-2 (ash 1 a0-2))) - (if (zero? (logand a1-2 arg1)) - (return (the-as symbol a1-2)) - ) - ) - (set! a0-2 (mod (+ a0-2 1) arg0)) - ) + (let* ((v1-1 (rand-vu-int-count arg0)) + (a0-2 v1-1) + ) + (until (= a0-2 v1-1) + (let ((a1-2 (ash 1 a0-2))) + (if (zero? (logand a1-2 arg1)) + (return (the-as symbol a1-2)) + ) ) + (set! a0-2 (mod (+ a0-2 1) arg0)) + ) + ) ) (the-as symbol 0) ) 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 0255fcb62f..b4d9f69147 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 @@ -1299,15 +1299,18 @@ swamp-rat-nest-default-event-handler ;; definition for method 21 of type swamp-rat-nest-dummy-c (defmethod dummy-21 swamp-rat-nest-dummy-c ((obj swamp-rat-nest-dummy-c)) (let ((v1-0 0)) - (let* ((a0-1 '(5 6)) (a1-0 (car a0-1))) (while (not (null? a0-1)) - (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) - (+! v1-0 1) - ) - (set! a0-1 (cdr a0-1)) - (set! a1-0 (car a0-1)) - ) + (let* ((a0-1 '(5 6)) + (a1-0 (car a0-1)) + ) + (while (not (null? a0-1)) + (when (< v1-0 6) + (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (+! v1-0 1) ) + (set! a0-1 (cdr a0-1)) + (set! a1-0 (car a0-1)) + ) + ) (set! (-> obj spawn-joint-count) v1-0) ) (set! (-> obj death-part) (-> *part-group-id-table* 294)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc index 9aa4c07d16..108eca152f 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc @@ -225,13 +225,12 @@ :nreg #x4 ) ) - (set! (-> (the-as gs-gif-tag a3-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> (the-as gs-gif-tag a3-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-1 base) (&+ (the-as pointer a3-2) 16)) ) diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index 68594b567f..3738ccfcf2 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -1315,7 +1315,11 @@ 1.0 ) (else - (let* ((f0-33 (* f0-32 f0-32)) (f0-34 (- 1.0 f0-33))) (* f0-34 (* f0-34 f0-34))) + (let* ((f0-33 (* f0-32 f0-32)) + (f0-34 (- 1.0 f0-33)) + ) + (* f0-34 (* f0-34 f0-34)) + ) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 65217c5f95..5a82888714 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -67,26 +67,24 @@ (let* ((a1-4 buf) (a3-2 (the-as gs-gif-tag (-> a1-4 base))) ) - (set! (-> a3-2 tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) - :nreg #x8 - ) + (set! (-> a3-2 tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x8 + ) ) - (set! (-> a3-2 regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - :regs4 (gif-reg-id rgbaq) - :regs5 (gif-reg-id xyzf2) - :regs6 (gif-reg-id rgbaq) - :regs7 (gif-reg-id xyzf2) - ) + (set! (-> a3-2 regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + :regs4 (gif-reg-id rgbaq) + :regs5 (gif-reg-id xyzf2) + :regs6 (gif-reg-id rgbaq) + :regs7 (gif-reg-id xyzf2) + ) ) (set! (-> a1-4 base) (&+ (the-as pointer a3-2) 16)) ) @@ -223,22 +221,20 @@ (let* ((a1-7 buf2) (giftag (the-as gs-gif-tag (-> a1-7 base))) ) - (set! (-> giftag tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) - :nreg #x4 - ) + (set! (-> giftag tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) + :nreg #x4 + ) ) - (set! (-> giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-7 base) (&+ (the-as pointer giftag) 16)) ) @@ -433,24 +429,22 @@ (let* ((a1-7 buf) (giftag (the-as gs-gif-tag (-> a1-7 base))) ) - (set! (-> giftag tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type tri) :iip #x1 :abe #x1) - :nreg #x6 - ) + (set! (-> giftag tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri) :iip #x1 :abe #x1) + :nreg #x6 + ) ) - (set! (-> giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - :regs4 (gif-reg-id rgbaq) - :regs5 (gif-reg-id xyzf2) - ) + (set! (-> giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + :regs4 (gif-reg-id rgbaq) + :regs5 (gif-reg-id xyzf2) + ) ) (set! (-> a1-7 base) (&+ (the-as pointer giftag) 16)) ) @@ -744,22 +738,20 @@ (let* ((a1-8 buf) (giftag (the-as gs-gif-tag (-> a1-8 base))) ) - (set! (-> giftag tag) - (new 'static 'gif-tag64 - :nloop #x1 - :eop #x1 - :pre #x1 - :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) - :nreg #x4 - ) + (set! (-> giftag tag) (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :iip #x1 :abe #x1) + :nreg #x4 + ) ) - (set! (-> giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-8 base) (&+ (the-as pointer giftag) 16)) ) @@ -1885,21 +1877,20 @@ buf (+ x -5) (+ y -4) - (the-as font-color (cond - ((= v1-7 1) - 3 - ) - ((= v1-7 2) - 5 - ) - ((= v1-7 4) - 6 - ) - (else - 0 - ) - ) - ) + (cond + ((= v1-7 1) + (font-color orange-red) + ) + ((= v1-7 2) + (font-color fc-5) + ) + ((= v1-7 4) + (font-color fc-6) + ) + (else + (font-color default) + ) + ) (font-flags shadow) ) ) @@ -1988,7 +1979,3 @@ ;; definition (debug) for function bugfix? ;; ERROR: function was not converted to expressions. Cannot decompile. - - - - diff --git a/test/decompiler/reference/jak2/engine/entity/res_REF.gc b/test/decompiler/reference/jak2/engine/entity/res_REF.gc index 368d29e715..6556db1b6b 100644 --- a/test/decompiler/reference/jak2/engine/entity/res_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/res_REF.gc @@ -726,7 +726,11 @@ (defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) (local-vars (sv-16 object)) (set! sv-16 arg1) - (let* ((v1-0 arg0) (a1-4 (copy-and-set-field v1-0 inlined? 1))) (add-data! obj a1-4 (& sv-16))) + (let* ((v1-0 arg0) + (a1-4 (copy-and-set-field v1-0 inlined? 1)) + ) + (add-data! obj a1-4 (& sv-16)) + ) ) ;; definition for method 21 of type res-lump diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc index c62981d6cb..a4d102ba2c 100644 --- a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc @@ -1388,47 +1388,52 @@ (f3-0 arg2) ) (.addu v1-1 arg3 v1-0) - (let* ((f1-0 a1-1) (f5-0 f1-0)) 0.0 0.0 (let* ((f0-2 (-> (the-as (pointer float) v1-1) 0)) - (f2-0 (-> (the-as (pointer float) v1-1) 1)) - (f0-3 (- f3-0 f0-2)) - (f4-0 (- f2-0 f3-0)) - (f10-0 (/ f1-0 (+ f4-0 f0-3))) - (f2-2 (-> (the-as (pointer float) v1-1) -1)) - (f8-0 (-> (the-as (pointer float) v1-1) 2)) - (f2-3 (- f3-0 f2-2)) - (f9-0 (+ f4-0 f2-3)) - (f6-0 (-> (the-as (pointer float) v1-1) -2)) - (f7-0 (-> (the-as (pointer float) v1-1) 3)) - (f9-1 (/ f1-0 f9-0)) - (f5-1 (* f5-0 f10-0)) - (f11-0 (* f4-0 f5-1)) - (f10-1 (* f0-3 f5-1)) - (f5-2 (- f8-0 f3-0)) - (f8-1 (* f11-0 f9-1)) - (f11-1 (/ f1-0 (+ f5-2 f0-3))) - (f9-3 (* f4-0 f8-1)) - (f8-2 (* f2-3 f8-1)) - (f11-2 (* f10-1 f11-1)) - (f10-3 (+ (* f5-2 f11-2) f8-2)) - (f8-3 (* f0-3 f11-2)) - (f6-1 (- f3-0 f6-0)) - (f3-1 (- f7-0 f3-0)) - (f7-3 (* f9-3 (/ f1-0 (+ f4-0 f6-1)))) - (f4-1 (* f4-0 f7-3)) - (f6-2 (* f6-1 f7-3)) - (f7-6 (* f10-3 (/ f1-0 (+ f5-2 f2-3)))) - (f5-4 (+ (* f5-2 f7-6) f6-2)) - (f2-4 (* f2-3 f7-6)) - (f1-2 (* f8-3 (the-as float (/ f1-0 (+ f3-1 f0-3))))) - (f2-5 (+ (* f3-1 f1-2) f2-4)) - (f0-4 (* f0-3 f1-2)) - ) - (set! (-> arg0 x) f4-1) - (set! (-> arg0 y) f5-4) - (set! (-> arg0 z) f2-5) - (set! (-> arg0 w) f0-4) - ) - ) + (let* ((f1-0 a1-1) + (f5-0 f1-0) + ) + 0.0 + 0.0 + (let* ((f0-2 (-> (the-as (pointer float) v1-1) 0)) + (f2-0 (-> (the-as (pointer float) v1-1) 1)) + (f0-3 (- f3-0 f0-2)) + (f4-0 (- f2-0 f3-0)) + (f10-0 (/ f1-0 (+ f4-0 f0-3))) + (f2-2 (-> (the-as (pointer float) v1-1) -1)) + (f8-0 (-> (the-as (pointer float) v1-1) 2)) + (f2-3 (- f3-0 f2-2)) + (f9-0 (+ f4-0 f2-3)) + (f6-0 (-> (the-as (pointer float) v1-1) -2)) + (f7-0 (-> (the-as (pointer float) v1-1) 3)) + (f9-1 (/ f1-0 f9-0)) + (f5-1 (* f5-0 f10-0)) + (f11-0 (* f4-0 f5-1)) + (f10-1 (* f0-3 f5-1)) + (f5-2 (- f8-0 f3-0)) + (f8-1 (* f11-0 f9-1)) + (f11-1 (/ f1-0 (+ f5-2 f0-3))) + (f9-3 (* f4-0 f8-1)) + (f8-2 (* f2-3 f8-1)) + (f11-2 (* f10-1 f11-1)) + (f10-3 (+ (* f5-2 f11-2) f8-2)) + (f8-3 (* f0-3 f11-2)) + (f6-1 (- f3-0 f6-0)) + (f3-1 (- f7-0 f3-0)) + (f7-3 (* f9-3 (/ f1-0 (+ f4-0 f6-1)))) + (f4-1 (* f4-0 f7-3)) + (f6-2 (* f6-1 f7-3)) + (f7-6 (* f10-3 (/ f1-0 (+ f5-2 f2-3)))) + (f5-4 (+ (* f5-2 f7-6) f6-2)) + (f2-4 (* f2-3 f7-6)) + (f1-2 (* f8-3 (the-as float (/ f1-0 (+ f3-1 f0-3))))) + (f2-5 (+ (* f3-1 f1-2) f2-4)) + (f0-4 (* f0-3 f1-2)) + ) + (set! (-> arg0 x) f4-1) + (set! (-> arg0 y) f5-4) + (set! (-> arg0 z) f2-5) + (set! (-> arg0 w) f0-4) + ) + ) ) arg0 ) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc index 9fa1821295..f823a7cbd3 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc @@ -433,25 +433,24 @@ (a2-3 (the-as object (-> v1-1 base))) ) (set! (-> (the-as gs-gif-tag a2-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) - (set! (-> (the-as gs-gif-tag a2-3) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a2-3) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-1 base) (&+ (the-as pointer a2-3) 16)) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc b/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc index 6f2502d042..2f7466d351 100644 --- a/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/merc/emerc_REF.gc @@ -69,25 +69,24 @@ (a0-6 (the-as object (-> v1-13 base))) ) (set! (-> (the-as gs-gif-tag a0-6) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) - (set! (-> (the-as gs-gif-tag a0-6) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> (the-as gs-gif-tag a0-6) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-13 base) (&+ (the-as pointer a0-6) 16)) ) 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 000fb9f955..6746f823d5 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 @@ -458,7 +458,7 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function particle-adgif-callback -;; ERROR: function has no type analysis. Cannot decompile. +;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function sp-queue-launch ;; INFO: Used lq/sq 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 e42b39647b..c2807bc019 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc @@ -812,25 +812,24 @@ (giftag (the-as gs-gif-tag (-> v1-18 base))) ) (set! (-> giftag tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) - (set! (-> giftag regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id a+d) - :regs1 (gif-reg-id a+d) - :regs2 (gif-reg-id a+d) - :regs3 (gif-reg-id a+d) - :regs4 (gif-reg-id a+d) - :regs5 (gif-reg-id a+d) - :regs6 (gif-reg-id a+d) - :regs7 (gif-reg-id a+d) - :regs8 (gif-reg-id a+d) - :regs9 (gif-reg-id a+d) - :regs10 (gif-reg-id a+d) - :regs11 (gif-reg-id a+d) - :regs12 (gif-reg-id a+d) - :regs13 (gif-reg-id a+d) - :regs14 (gif-reg-id a+d) - :regs15 (gif-reg-id a+d) - ) + (set! (-> giftag regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) ) (set! (-> v1-18 base) (the-as pointer (&+ giftag 16))) ) diff --git a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc index bfb7d5a191..5618871d9c 100644 --- a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc @@ -427,11 +427,10 @@ (-> *dgo-name* data) (the-as int (-> arg0 length)) arg1 - (the-as link-flag (if arg3 - 47 - 39 - ) - ) + (if arg3 + (link-flag output-load-msg output-load-true-msg execute-login print-login fast-link) + (link-flag output-load-msg output-load-true-msg execute-login fast-link) + ) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index ac2c5ba02c..c6da24e5d2 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -849,7 +849,7 @@ (local-vars (v0-59 int) (sv-176 int)) (let ((s2-0 arg2) (s1-0 arg3) - (gp-0 ((method-of-type spooler-block new) (new 'stack-no-clear 'symbol) spooler-block arg2 arg3)) + (gp-0 (new 'stack 'spooler-block arg2 arg3)) ) (let ((s5-0 gp-0)) (set! (-> s5-0 anim) arg0) diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc index ba90606820..733ff11455 100644 --- a/test/decompiler/reference/jak2/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -424,18 +424,21 @@ ;; definition for function seekl (defun seekl ((arg0 int) (arg1 int) (arg2 int)) - (let* ((v1-0 (- arg1 arg0)) (a3-0 (abs v1-0))) (cond - ((>= arg2 a3-0) - arg1 - ) - ((>= v1-0 0) - (+ arg0 arg2) - ) - (else - (- arg0 arg2) - ) - ) + (let* ((v1-0 (- arg1 arg0)) + (a3-0 (abs v1-0)) + ) + (cond + ((>= arg2 a3-0) + arg1 + ) + ((>= v1-0 0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) ) + ) + ) ) ;; definition for function rand-vu-init diff --git a/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc b/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc index 3273c51014..a73f1f74a0 100644 --- a/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc @@ -26,23 +26,27 @@ (let ((v1-1 (shl (the int arg0) 48)) (a0-2 (shl (the int arg1) 48)) ) - (let* ((a1-2 (shl (the int arg2) 48)) (a2-1 (- a0-2 v1-1)) (a3-0 (abs a2-1))) (set! a0-2 (cond - ((< a3-0 0) - (+ v1-1 a1-2) - ) - ((>= a1-2 a3-0) - (empty) - a0-2 - ) - ((>= a2-1 0) - (+ v1-1 a1-2) - ) - (else - (- v1-1 a1-2) - ) - ) - ) - ) + (let* ((a1-2 (shl (the int arg2) 48)) + (a2-1 (- a0-2 v1-1)) + (a3-0 (abs a2-1)) + ) + (set! a0-2 (cond + ((< a3-0 0) + (+ v1-1 a1-2) + ) + ((>= a1-2 a3-0) + (empty) + a0-2 + ) + ((>= a2-1 0) + (+ v1-1 a1-2) + ) + (else + (- v1-1 a1-2) + ) + ) + ) + ) (the float (sar a0-2 48)) ) ) @@ -488,7 +492,12 @@ 16383.996 ) (else - (let* ((f0-6 1.0) (f1-2 arg0) (f0-8 (sqrtf (- f0-6 (* f1-2 f1-2))))) (atan0 arg0 f0-8)) + (let* ((f0-6 1.0) + (f1-2 arg0) + (f0-8 (sqrtf (- f0-6 (* f1-2 f1-2)))) + ) + (atan0 arg0 f0-8) + ) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index d6d67c0ee1..33e6385d75 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -1235,7 +1235,11 @@ (defun-debug make-sqrt-table () (format #t "static int sqrt_table[256] =~%{~%") (dotimes (gp-0 256) - (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) (a2-0 (the int (+ 0.5 f0-2)))) (format #t "~D,~%" a2-0)) + (let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0)))) + (a2-0 (the int (+ 0.5 f0-2))) + ) + (format #t "~D,~%" a2-0) + ) ) (format #t "};~%") 0 diff --git a/test/decompiler/reference/jak2/engine/util/profile_REF.gc b/test/decompiler/reference/jak2/engine/util/profile_REF.gc index 23d59744d1..6063ab739c 100644 --- a/test/decompiler/reference/jak2/engine/util/profile_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile_REF.gc @@ -683,11 +683,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-0 100.0) - 3 - 0 - ) - ) + (if (>= f30-0 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -700,11 +699,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-0 100.0) - 3 - 0 - ) - ) + (if (>= f30-0 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -736,11 +734,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-1 100.0) - 3 - 0 - ) - ) + (if (>= f30-1 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) @@ -753,11 +750,10 @@ arg0 488 arg1 - (the-as font-color (if (>= f30-1 100.0) - 3 - 0 - ) - ) + (if (>= f30-1 100.0) + (font-color orange-red) + (font-color default) + ) (font-flags shadow right) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc index 5d4cb664de..0b511d797e 100644 --- a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -291,19 +291,22 @@ ) ) (arg0 - (let* ((s3-0 gp-1) (s2-0 (car s3-0))) (while (not (null? s3-0)) - (let ((v1-4 (level-status *level* (the-as symbol s2-0)))) - (if (not (or (= v1-4 'loaded) (= v1-4 'active))) - (return #f) - ) - ) - (if (= s2-0 'ctywide) - (set! s4-0 (-> ctywide borrow-level 1)) - ) - (set! s3-0 (cdr s3-0)) - (set! s2-0 (car s3-0)) - ) + (let* ((s3-0 gp-1) + (s2-0 (car s3-0)) + ) + (while (not (null? s3-0)) + (let ((v1-4 (level-status *level* (the-as symbol s2-0)))) + (if (not (or (= v1-4 'loaded) (= v1-4 'active))) + (return #f) + ) ) + (if (= s2-0 'ctywide) + (set! s4-0 (-> ctywide borrow-level 1)) + ) + (set! s3-0 (cdr s3-0)) + (set! s2-0 (car s3-0)) + ) + ) (when s4-0 (let ((v1-17 (level-status *level* s4-0))) (if (not (or (= v1-17 'loaded) (= v1-17 'active))) @@ -328,19 +331,22 @@ #t ) (else - (let* ((v1-33 gp-1) (a0-11 (car v1-33))) (while (not (null? v1-33)) - (dotimes (a1-10 6) - (if (= a0-11 (-> *load-state* want a1-10 name)) - (goto cfg-50) - ) - ) - #t - (return #f) - (label cfg-50) - (set! v1-33 (cdr v1-33)) - (set! a0-11 (car v1-33)) - ) + (let* ((v1-33 gp-1) + (a0-11 (car v1-33)) + ) + (while (not (null? v1-33)) + (dotimes (a1-10 6) + (if (= a0-11 (-> *load-state* want a1-10 name)) + (goto cfg-50) + ) ) + #t + (return #f) + (label cfg-50) + (set! v1-33 (cdr v1-33)) + (set! a0-11 (car v1-33)) + ) + ) #t ) )