mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 14:55:51 -04:00
[decomp] better handling of animation code and art files (#1352)
* update refs * [decompiler] read and process art groups * finish decompiler art group selection & detect in `ja-group?` * make art stuff work on offline tests! * [decompiler] detect `ja-group!` (primitive) * corrections. * more * use new feature on skel groups! * find `loop!` as well * fully fledged `ja` macro & decomp + `loop` detect * fancy fixed point printing! * update source * `:num! max` (i knew i should've done this) * Update jak1_ntsc_black_label.jsonc * hi imports * make compiling the game work * fix `defskelgroup` * clang * update refs * fix chan * fix seek and finalboss * fix tests * delete unused function * track let rewrite stats * reorder `rewrite_let` * Update .gitattributes * fix bug with `:num! max` * Update robotboss-part.gc * Update goal-lib.gc * document `ja` * get rid of pc fixes thing * use std::abs
This commit is contained in:
@@ -3,6 +3,8 @@ third-party/**/* linguist-generated
|
||||
test/decompiler/reference/** linguist-vendored
|
||||
# suppress from PR diffs - is just reviewing the same thing twice (if properly added to g_src)
|
||||
test/decompiler/reference/** linguist-generated
|
||||
goal_src/import/** linguist-vendored
|
||||
goal_src/import/** linguist-generated
|
||||
*.gc linguist-language=lisp
|
||||
*.gd linguist-language=lisp
|
||||
*.gs linguist-language=Scheme
|
||||
|
||||
@@ -1345,7 +1345,7 @@ Object Interpreter::eval_numequals(const Object& form,
|
||||
} break;
|
||||
|
||||
default:
|
||||
throw_eval_error(form, "+ must have a numeric argument");
|
||||
throw_eval_error(form, "= must have a numeric argument");
|
||||
return Object::make_empty_list();
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,9 @@ class Object {
|
||||
bool is_empty_list() const { return type == ObjectType::EMPTY_LIST; }
|
||||
bool is_list() const { return type == ObjectType::EMPTY_LIST || type == ObjectType::PAIR; }
|
||||
bool is_int() const { return type == ObjectType::INTEGER; }
|
||||
bool is_int(int val) const { return type == ObjectType::INTEGER && val == as_int(); }
|
||||
bool is_float() const { return type == ObjectType::FLOAT; }
|
||||
bool is_float(float val) const { return type == ObjectType::FLOAT && val == as_float(); }
|
||||
bool is_char() const { return type == ObjectType::CHAR; }
|
||||
bool is_symbol() const { return type == ObjectType::SYMBOL; }
|
||||
bool is_symbol(const std::string& name) const;
|
||||
|
||||
@@ -211,6 +211,14 @@ void break_list(Node* node) {
|
||||
if (name == "defun" || name == "defun-debug" || name == "defbehavior" || name == "defstate") {
|
||||
// things with three things in the top line: (defun <name> <args>
|
||||
node->top_line_count = 3;
|
||||
} else if (name == "defskelgroup") {
|
||||
// things with 5 things in the top line: (defskelgroup <name> <art> jgeo janim
|
||||
node->top_line_count = 5;
|
||||
node->sub_elt_indent += name.size();
|
||||
} else if (name == "ja" || name == "ja-no-eval") {
|
||||
// things with 2 things in the top line: (ja <:key value>
|
||||
node->top_line_count = 2;
|
||||
node->sub_elt_indent += name.size();
|
||||
} else if (name == "defmethod") {
|
||||
// things with 4 things in the top line: (defmethod <method> <type> <args>
|
||||
node->top_line_count = 4;
|
||||
@@ -261,9 +269,9 @@ void break_list(Node* node) {
|
||||
|
||||
void insert_required_breaks(const std::vector<Node*>& bfs_order) {
|
||||
const std::unordered_set<std::string> always_break = {
|
||||
"when", "defun-debug", "countdown", "case", "defun", "defmethod", "let",
|
||||
"until", "while", "if", "dotimes", "cond", "else", "defbehavior",
|
||||
"with-pp", "rlet", "defstate", "behavior", "defpart"};
|
||||
"when", "defun-debug", "countdown", "case", "defun", "defmethod", "let",
|
||||
"until", "while", "if", "dotimes", "cond", "else", "defbehavior",
|
||||
"with-pp", "rlet", "defstate", "behavior", "defpart", "loop"};
|
||||
for (auto node : bfs_order) {
|
||||
if (!node->break_list && node->kind == Node::Kind::LIST &&
|
||||
node->child_nodes.at(0).kind == Node::Kind::ATOM) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "third-party/fmt/core.h"
|
||||
#include "common/goal_constants.h"
|
||||
#include "third-party/dragonbox.h"
|
||||
#include "third-party/fmt/core.h"
|
||||
#include "print_float.h"
|
||||
#include "common/goal_constants.h"
|
||||
#include "common/util/Assert.h"
|
||||
|
||||
/*!
|
||||
@@ -27,6 +27,48 @@ std::string meters_to_string(float value, bool append_trailing_decimal) {
|
||||
return float_to_string(value / METER_LENGTH, append_trailing_decimal);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Convert a fixed point value to a string. Fixed point values usually end up with strange numbers
|
||||
* that were definitely not what was written when we do a naive conversion. This function
|
||||
* is a bit more clever.
|
||||
*/
|
||||
std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal) {
|
||||
float sign = value < 0 ? -1 : 1;
|
||||
value = std::abs(value);
|
||||
double naive = (double)value / scale;
|
||||
|
||||
double flt_scale = 1;
|
||||
while (flt_scale < scale) {
|
||||
// 1 -> 0.1
|
||||
flt_scale *= 10;
|
||||
}
|
||||
|
||||
// we have a scale with enough precision for our fixed point. now find a good decimal.
|
||||
|
||||
// start at something resonable.
|
||||
s64 fixed_start = (s64)(naive * flt_scale);
|
||||
fixed_start = fixed_start - (fixed_start % 5);
|
||||
// add e.g. 0.005 in a 1/1000 scale
|
||||
s64 fixed_add = 0;
|
||||
while ((s64)((fixed_start + fixed_add) / flt_scale * scale) < value) {
|
||||
fixed_add += 5;
|
||||
}
|
||||
if ((s64)((fixed_start + fixed_add) / flt_scale * scale) == value) {
|
||||
return float_to_string((fixed_start + fixed_add) / flt_scale * sign, append_trailing_decimal);
|
||||
}
|
||||
|
||||
// add e.g. 0.001 in a 1/1000 scale
|
||||
fixed_add = 0;
|
||||
while ((s64)((fixed_start + fixed_add) / flt_scale * scale) < value) {
|
||||
fixed_add += 1;
|
||||
}
|
||||
if ((s64)((fixed_start + fixed_add) / flt_scale * scale) == value) {
|
||||
return float_to_string((fixed_start + fixed_add) / flt_scale * sign, append_trailing_decimal);
|
||||
}
|
||||
// added too much!
|
||||
ASSERT_MSG(false, fmt::format("fixed_point_to_string failed hard. v: {} s: {}", value, scale));
|
||||
}
|
||||
|
||||
int float_to_cstr(float value, char* buffer, bool append_trailing_decimal) {
|
||||
ASSERT(std::isfinite(value));
|
||||
// dragonbox gives us:
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "common/common_types.h"
|
||||
|
||||
std::string fixed_point_to_string(s64 value, s64 scale, bool append_trailing_decimal = false);
|
||||
std::string float_to_string(float value, bool append_trailing_decimal = true);
|
||||
std::string meters_to_string(float value, bool append_trailing_decimal = false);
|
||||
int float_to_cstr(float value, char* buffer, bool append_trailing_decimal = true);
|
||||
|
||||
@@ -174,6 +174,8 @@ class Register {
|
||||
uint32_t get_special() const;
|
||||
bool allowed_local_gpr() const;
|
||||
|
||||
bool is_s6() const { return *this == Register(Reg::GPR, Reg::S6); }
|
||||
|
||||
bool operator==(const Register& other) const;
|
||||
bool operator!=(const Register& other) const;
|
||||
bool operator<(const Register& other) const { return id < other.id; }
|
||||
|
||||
@@ -65,7 +65,7 @@ FormElement* SetVarOp::get_as_form(FormPool& pool, const Env& env) const {
|
||||
}
|
||||
} else {
|
||||
// access a field
|
||||
auto arg0_type = env.get_types_before_op(m_my_idx).get(m_src.get_arg(0).var().reg());
|
||||
const auto& arg0_type = env.get_types_before_op(m_my_idx).get(m_src.get_arg(0).var().reg());
|
||||
if (arg0_type.kind == TP_Type::Kind::TYPESPEC) {
|
||||
FieldReverseLookupInput rd_in;
|
||||
rd_in.deref = std::nullopt;
|
||||
|
||||
@@ -566,4 +566,20 @@ void Env::set_stack_structure_hints(const std::vector<StackStructureHint>& hints
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<std::string> Env::get_art_elt_name(int idx) const {
|
||||
ASSERT(dts);
|
||||
auto it = dts->art_group_info.find(art_group());
|
||||
if (it == dts->art_group_info.end()) {
|
||||
return {};
|
||||
} else {
|
||||
const auto& art_group = it->second;
|
||||
auto it2 = art_group.find(idx);
|
||||
if (it2 == art_group.end()) {
|
||||
return {};
|
||||
} else {
|
||||
return it2->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace decompiler
|
||||
|
||||
@@ -150,6 +150,10 @@ class Env {
|
||||
|
||||
const std::unordered_map<int, StackTypeCast>& stack_casts() const { return m_stack_typecasts; }
|
||||
|
||||
void set_art_group(const std::string& art_group) { m_art_group = art_group; }
|
||||
const std::string& art_group() const { return m_art_group; }
|
||||
std::optional<std::string> get_art_elt_name(int idx) const;
|
||||
|
||||
void set_remap_for_function(const TypeSpec& ts);
|
||||
void set_remap_for_method(const TypeSpec& ts);
|
||||
void set_remap_for_new_method(const TypeSpec& ts);
|
||||
@@ -233,5 +237,7 @@ class Env {
|
||||
std::optional<TypeSpec> m_type_analysis_return_type;
|
||||
|
||||
StackSpillMap m_stack_spill_map;
|
||||
|
||||
std::string m_art_group;
|
||||
};
|
||||
} // namespace decompiler
|
||||
|
||||
+42
-10
@@ -1180,8 +1180,13 @@ void WhileElement::apply(const std::function<void(FormElement*)>& f) {
|
||||
|
||||
goos::Object WhileElement::to_form_internal(const Env& env) const {
|
||||
std::vector<goos::Object> list;
|
||||
list.push_back(pretty_print::to_symbol("while"));
|
||||
list.push_back(condition->to_form_as_condition(env));
|
||||
auto cond = condition->to_form_as_condition(env);
|
||||
if (cond == pretty_print::to_symbol("#t")) {
|
||||
list.push_back(pretty_print::to_symbol("loop"));
|
||||
} else {
|
||||
list.push_back(pretty_print::to_symbol("while"));
|
||||
list.push_back(condition->to_form_as_condition(env));
|
||||
}
|
||||
body->inline_forms(list, env);
|
||||
return pretty_print::build_list(list);
|
||||
}
|
||||
@@ -2984,16 +2989,35 @@ void DefskelgroupElement::get_modified_regs(RegSet& regs) const {
|
||||
|
||||
goos::Object DefskelgroupElement::to_form_internal(const Env& env) const {
|
||||
std::vector<goos::Object> forms;
|
||||
forms.push_back(
|
||||
pretty_print::to_symbol(fmt::format("defskelgroup {} {}", m_name, m_static_info.art_name)));
|
||||
forms.push_back(m_info.jgeo->to_form(env));
|
||||
forms.push_back(m_info.janim->to_form(env));
|
||||
forms.push_back(pretty_print::to_symbol("defskelgroup"));
|
||||
forms.push_back(pretty_print::to_symbol(m_name));
|
||||
forms.push_back(pretty_print::to_symbol(m_static_info.art_name));
|
||||
const auto& art = env.dts->art_group_info.find(m_static_info.art_name + "-ag");
|
||||
bool has_art = art != env.dts->art_group_info.end();
|
||||
auto jg = m_info.jgeo->to_form(env);
|
||||
if (jg.is_int() && has_art && art->second.count(jg.as_int())) {
|
||||
forms.push_back(pretty_print::to_symbol(art->second.at(jg.as_int())));
|
||||
} else {
|
||||
forms.push_back(jg);
|
||||
}
|
||||
auto ja = m_info.janim->to_form(env);
|
||||
if (ja.is_int() && has_art && art->second.count(ja.as_int())) {
|
||||
forms.push_back(pretty_print::to_symbol(art->second.at(ja.as_int())));
|
||||
} else {
|
||||
forms.push_back(ja);
|
||||
}
|
||||
|
||||
std::vector<goos::Object> lod_forms;
|
||||
for (const auto& e : m_info.lods) {
|
||||
auto f_dist = pretty_print::to_symbol(
|
||||
fmt::format("(meters {})", meters_to_string(e.lod_dist->to_form(env).as_float())));
|
||||
lod_forms.push_back(pretty_print::build_list(e.mgeo->to_form(env), f_dist));
|
||||
auto mg = e.mgeo->to_form(env);
|
||||
if (mg.is_int() && has_art && art->second.count(mg.as_int())) {
|
||||
lod_forms.push_back(
|
||||
pretty_print::build_list(pretty_print::to_symbol(art->second.at(mg.as_int())), f_dist));
|
||||
} else {
|
||||
lod_forms.push_back(pretty_print::build_list(mg, f_dist));
|
||||
}
|
||||
}
|
||||
forms.push_back(pretty_print::build_list(lod_forms));
|
||||
|
||||
@@ -3001,11 +3025,19 @@ goos::Object DefskelgroupElement::to_form_internal(const Env& env) const {
|
||||
":bounds (static-spherem {} {} {} {})", meters_to_string(m_static_info.bounds.x()),
|
||||
meters_to_string(m_static_info.bounds.y()), meters_to_string(m_static_info.bounds.z()),
|
||||
meters_to_string(m_static_info.bounds.w()))));
|
||||
forms.push_back(pretty_print::to_symbol(
|
||||
fmt::format(":longest-edge (meters {})", meters_to_string(m_static_info.longest_edge))));
|
||||
|
||||
if (m_static_info.longest_edge != 0) {
|
||||
forms.push_back(pretty_print::to_symbol(
|
||||
fmt::format(":longest-edge (meters {})", meters_to_string(m_static_info.longest_edge))));
|
||||
}
|
||||
|
||||
if (m_static_info.shadow != 0) {
|
||||
forms.push_back(pretty_print::to_symbol(fmt::format(":shadow {}", m_static_info.shadow)));
|
||||
if (has_art && art->second.count(m_static_info.shadow)) {
|
||||
forms.push_back(
|
||||
pretty_print::to_symbol(fmt::format(":shadow {}", art->second.at(m_static_info.shadow))));
|
||||
} else {
|
||||
forms.push_back(pretty_print::to_symbol(fmt::format(":shadow {}", m_static_info.shadow)));
|
||||
}
|
||||
}
|
||||
if (m_static_info.tex_level != 0) {
|
||||
forms.push_back(
|
||||
|
||||
+117
-115
@@ -1103,87 +1103,6 @@ class CastElement : public FormElement {
|
||||
bool m_numeric = false; // if true, use the. otherwise the-as
|
||||
};
|
||||
|
||||
class DerefToken {
|
||||
public:
|
||||
enum class Kind {
|
||||
INTEGER_CONSTANT,
|
||||
INTEGER_EXPRESSION, // some form which evaluates to an integer index. Not offset, index.
|
||||
FIELD_NAME,
|
||||
EXPRESSION_PLACEHOLDER,
|
||||
INVALID
|
||||
};
|
||||
static DerefToken make_int_constant(s64 int_constant);
|
||||
static DerefToken make_int_expr(Form* expr);
|
||||
static DerefToken make_field_name(const std::string& name);
|
||||
static DerefToken make_expr_placeholder();
|
||||
|
||||
void collect_vars(RegAccessSet& vars, bool recursive) const;
|
||||
goos::Object to_form(const Env& env) const;
|
||||
void apply(const std::function<void(FormElement*)>& f);
|
||||
void apply_form(const std::function<void(Form*)>& f);
|
||||
void get_modified_regs(RegSet& regs) const;
|
||||
|
||||
bool is_field_name(const std::string& name) const {
|
||||
return m_kind == Kind::FIELD_NAME && m_name == name;
|
||||
}
|
||||
|
||||
bool is_int(int x) const { return m_kind == Kind::INTEGER_CONSTANT && m_int_constant == x; }
|
||||
|
||||
bool is_expr() const { return m_kind == Kind::INTEGER_EXPRESSION; }
|
||||
|
||||
Kind kind() const { return m_kind; }
|
||||
const std::string& field_name() const {
|
||||
ASSERT(m_kind == Kind::FIELD_NAME);
|
||||
return m_name;
|
||||
}
|
||||
|
||||
s64 int_constant() const { return m_int_constant; }
|
||||
|
||||
Form* expr() {
|
||||
ASSERT(m_kind == Kind::INTEGER_EXPRESSION);
|
||||
return m_expr;
|
||||
}
|
||||
|
||||
private:
|
||||
Kind m_kind = Kind::INVALID;
|
||||
s64 m_int_constant = -1;
|
||||
std::string m_name;
|
||||
Form* m_expr = nullptr;
|
||||
};
|
||||
|
||||
DerefToken to_token(const FieldReverseLookupOutput::Token& in);
|
||||
|
||||
class DerefElement : public FormElement {
|
||||
public:
|
||||
DerefElement(Form* base, bool is_addr_of, DerefToken token);
|
||||
DerefElement(Form* base, bool is_addr_of, std::vector<DerefToken> tokens);
|
||||
goos::Object to_form_internal(const Env& env) const override;
|
||||
void apply(const std::function<void(FormElement*)>& f) override;
|
||||
void apply_form(const std::function<void(Form*)>& f) override;
|
||||
void collect_vars(RegAccessSet& vars, bool recursive) const override;
|
||||
void update_from_stack(const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects) override;
|
||||
void get_modified_regs(RegSet& regs) const override;
|
||||
|
||||
void inline_nested();
|
||||
|
||||
bool is_addr_of() const { return m_is_addr_of; }
|
||||
const Form* base() const { return m_base; }
|
||||
Form* base() { return m_base; }
|
||||
const std::vector<DerefToken>& tokens() const { return m_tokens; }
|
||||
std::vector<DerefToken>& tokens() { return m_tokens; }
|
||||
void set_base(Form* new_base);
|
||||
void set_addr_of(bool is_addr_of) { m_is_addr_of = is_addr_of; }
|
||||
|
||||
private:
|
||||
Form* m_base = nullptr;
|
||||
bool m_is_addr_of = false;
|
||||
std::vector<DerefToken> m_tokens;
|
||||
};
|
||||
|
||||
class DynamicMethodAccess : public FormElement {
|
||||
public:
|
||||
explicit DynamicMethodAccess(RegisterAccess source);
|
||||
@@ -1202,40 +1121,6 @@ class DynamicMethodAccess : public FormElement {
|
||||
RegisterAccess m_source;
|
||||
};
|
||||
|
||||
class ArrayFieldAccess : public FormElement {
|
||||
public:
|
||||
ArrayFieldAccess(RegisterAccess source,
|
||||
const std::vector<DerefToken>& deref_tokens,
|
||||
int expected_stride,
|
||||
int constant_offset,
|
||||
bool flipped);
|
||||
goos::Object to_form_internal(const Env& env) const override;
|
||||
void apply(const std::function<void(FormElement*)>& f) override;
|
||||
void apply_form(const std::function<void(Form*)>& f) override;
|
||||
void collect_vars(RegAccessSet& vars, bool recursive) const override;
|
||||
void update_from_stack(const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects) override;
|
||||
void get_modified_regs(RegSet& regs) const override;
|
||||
|
||||
void update_with_val(Form* new_val,
|
||||
const Env& env,
|
||||
FormPool& pool,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects);
|
||||
|
||||
bool flipped() const { return m_flipped; }
|
||||
|
||||
private:
|
||||
RegisterAccess m_source;
|
||||
std::vector<DerefToken> m_deref_tokens;
|
||||
int m_expected_stride = -1;
|
||||
int m_constant_offset = -1;
|
||||
bool m_flipped = false;
|
||||
};
|
||||
|
||||
class GetMethodElement : public FormElement {
|
||||
public:
|
||||
GetMethodElement(Form* in, std::string name, bool is_object);
|
||||
@@ -1312,6 +1197,123 @@ class ConstantFloatElement : public FormElement {
|
||||
float m_value;
|
||||
};
|
||||
|
||||
class DerefToken {
|
||||
public:
|
||||
enum class Kind {
|
||||
INTEGER_CONSTANT,
|
||||
INTEGER_EXPRESSION, // some form which evaluates to an integer index. Not offset, index.
|
||||
FIELD_NAME,
|
||||
EXPRESSION_PLACEHOLDER,
|
||||
INVALID
|
||||
};
|
||||
static DerefToken make_int_constant(s64 int_constant);
|
||||
static DerefToken make_int_expr(Form* expr);
|
||||
static DerefToken make_field_name(const std::string& name);
|
||||
static DerefToken make_expr_placeholder();
|
||||
|
||||
void collect_vars(RegAccessSet& vars, bool recursive) const;
|
||||
goos::Object to_form(const Env& env) const;
|
||||
void apply(const std::function<void(FormElement*)>& f);
|
||||
void apply_form(const std::function<void(Form*)>& f);
|
||||
void get_modified_regs(RegSet& regs) const;
|
||||
|
||||
bool is_field_name(const std::string& name) const {
|
||||
return m_kind == Kind::FIELD_NAME && m_name == name;
|
||||
}
|
||||
|
||||
bool is_int(int x) const { return m_kind == Kind::INTEGER_CONSTANT && m_int_constant == x; }
|
||||
|
||||
bool is_expr() const { return m_kind == Kind::INTEGER_EXPRESSION; }
|
||||
|
||||
Kind kind() const { return m_kind; }
|
||||
const std::string& field_name() const {
|
||||
ASSERT(m_kind == Kind::FIELD_NAME);
|
||||
return m_name;
|
||||
}
|
||||
|
||||
s64 int_constant() const { return m_int_constant; }
|
||||
|
||||
Form* expr() {
|
||||
ASSERT(m_kind == Kind::INTEGER_EXPRESSION);
|
||||
return m_expr;
|
||||
}
|
||||
|
||||
private:
|
||||
Kind m_kind = Kind::INVALID;
|
||||
s64 m_int_constant = -1;
|
||||
std::string m_name;
|
||||
Form* m_expr = nullptr;
|
||||
};
|
||||
|
||||
DerefToken to_token(const FieldReverseLookupOutput::Token& in);
|
||||
|
||||
class DerefElement : public FormElement {
|
||||
public:
|
||||
DerefElement(Form* base, bool is_addr_of, DerefToken token);
|
||||
DerefElement(Form* base, bool is_addr_of, std::vector<DerefToken> tokens);
|
||||
goos::Object to_form_internal(const Env& env) const override;
|
||||
void apply(const std::function<void(FormElement*)>& f) override;
|
||||
void apply_form(const std::function<void(Form*)>& f) override;
|
||||
void collect_vars(RegAccessSet& vars, bool recursive) const override;
|
||||
void update_from_stack(const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects) override;
|
||||
void get_modified_regs(RegSet& regs) const override;
|
||||
|
||||
void inline_nested();
|
||||
|
||||
bool is_addr_of() const { return m_is_addr_of; }
|
||||
const Form* base() const { return m_base; }
|
||||
Form* base() { return m_base; }
|
||||
const std::vector<DerefToken>& tokens() const { return m_tokens; }
|
||||
std::vector<DerefToken>& tokens() { return m_tokens; }
|
||||
void set_base(Form* new_base);
|
||||
void set_addr_of(bool is_addr_of) { m_is_addr_of = is_addr_of; }
|
||||
|
||||
private:
|
||||
ConstantTokenElement* try_as_art_const(const Env& env, FormPool& pool);
|
||||
|
||||
Form* m_base = nullptr;
|
||||
bool m_is_addr_of = false;
|
||||
std::vector<DerefToken> m_tokens;
|
||||
};
|
||||
|
||||
class ArrayFieldAccess : public FormElement {
|
||||
public:
|
||||
ArrayFieldAccess(RegisterAccess source,
|
||||
const std::vector<DerefToken>& deref_tokens,
|
||||
int expected_stride,
|
||||
int constant_offset,
|
||||
bool flipped);
|
||||
goos::Object to_form_internal(const Env& env) const override;
|
||||
void apply(const std::function<void(FormElement*)>& f) override;
|
||||
void apply_form(const std::function<void(Form*)>& f) override;
|
||||
void collect_vars(RegAccessSet& vars, bool recursive) const override;
|
||||
void update_from_stack(const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects) override;
|
||||
void get_modified_regs(RegSet& regs) const override;
|
||||
|
||||
void update_with_val(Form* new_val,
|
||||
const Env& env,
|
||||
FormPool& pool,
|
||||
std::vector<FormElement*>* result,
|
||||
bool allow_side_effects);
|
||||
|
||||
bool flipped() const { return m_flipped; }
|
||||
|
||||
private:
|
||||
RegisterAccess m_source;
|
||||
std::vector<DerefToken> m_deref_tokens;
|
||||
int m_expected_stride = -1;
|
||||
int m_constant_offset = -1;
|
||||
bool m_flipped = false;
|
||||
};
|
||||
|
||||
class StorePlainDeref : public FormElement {
|
||||
public:
|
||||
StorePlainDeref(Form* dst,
|
||||
|
||||
@@ -100,11 +100,9 @@ Form* try_cast_simplify(Form* in,
|
||||
if (fc) {
|
||||
double div = (double)*fc / METER_LENGTH; // GOOS will use doubles here
|
||||
if (div * METER_LENGTH == *fc) {
|
||||
return pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr,
|
||||
GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "meters")),
|
||||
pool.alloc_single_element_form<ConstantFloatElement>(nullptr, div));
|
||||
return pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("meters")),
|
||||
pool.form<ConstantFloatElement>(div));
|
||||
} else {
|
||||
lg::error("Floating point value {} could not be converted to meters.", *fc);
|
||||
}
|
||||
@@ -114,11 +112,9 @@ Form* try_cast_simplify(Form* in,
|
||||
if (fc) {
|
||||
double div = (double)*fc / DEGREES_LENGTH; // GOOS will use doubles here
|
||||
if (div * DEGREES_LENGTH == *fc) {
|
||||
return pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr,
|
||||
GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "degrees")),
|
||||
pool.alloc_single_element_form<ConstantFloatElement>(nullptr, div));
|
||||
return pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("degrees")),
|
||||
pool.form<ConstantFloatElement>(div));
|
||||
} else {
|
||||
lg::error("Floating point value {} could not be converted to degrees.", *fc);
|
||||
}
|
||||
@@ -142,21 +138,11 @@ Form* try_cast_simplify(Form* in,
|
||||
// if they used a 1 as a time-frame, they likely just want to literally remove 1
|
||||
// instead of (seconds 0.0034) or whatever the result would be.
|
||||
// also 0 is decompiled as just 0.
|
||||
return pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(value));
|
||||
return pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(value));
|
||||
}
|
||||
|
||||
// only rewrite if exact.
|
||||
s64 seconds_int = value / (s64)TICKS_PER_SECOND;
|
||||
if (seconds_int * (s64)TICKS_PER_SECOND == value) {
|
||||
return pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, fmt::format("(seconds {})", seconds_int));
|
||||
}
|
||||
double seconds = (double)value / TICKS_PER_SECOND;
|
||||
if (seconds * TICKS_PER_SECOND == value) {
|
||||
return pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, fmt::format("(seconds {})", float_to_string(seconds, false)));
|
||||
}
|
||||
return pool.form<ConstantTokenElement>(
|
||||
fmt::format("(seconds {})", fixed_point_to_string(value, TICKS_PER_SECOND)));
|
||||
} else {
|
||||
// not a constant like (seconds 2), probably an expression or function call. we pretend that a
|
||||
// cast to int happened instead.
|
||||
@@ -217,7 +203,7 @@ Form* try_cast_simplify(Form* in,
|
||||
if (as_atom && as_atom->is_var()) {
|
||||
if (env.get_variable_type(as_atom->var(), true) == new_type) {
|
||||
// we are a variable with the right type.
|
||||
return pool.alloc_single_element_form<SimpleAtomElement>(nullptr, *as_atom, true);
|
||||
return pool.form<SimpleAtomElement>(*as_atom, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,7 +285,7 @@ Form* repop_passthrough_arg(Form* in,
|
||||
* Create a form which represents a variable.
|
||||
*/
|
||||
Form* var_to_form(const RegisterAccess& var, FormPool& pool) {
|
||||
return pool.alloc_single_element_form<SimpleAtomElement>(nullptr, SimpleAtom::make_var(var));
|
||||
return pool.form<SimpleAtomElement>(SimpleAtom::make_var(var));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -429,7 +415,7 @@ Form* cast_form(Form* in,
|
||||
return result;
|
||||
}
|
||||
|
||||
return pool.alloc_single_element_form<CastElement>(nullptr, new_type, in);
|
||||
return pool.form<CastElement>(new_type, in);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -471,7 +457,7 @@ std::vector<Form*> pop_to_forms(const std::vector<RegisterAccess>& vars,
|
||||
// there is a separate system for casting variables that will do a better job.
|
||||
if (cast && !is_var) {
|
||||
forms[i] = cast_form(forms[i], *cast, pool, env);
|
||||
// pool.alloc_single_element_form<CastElement>(nullptr, *cast, forms[i]);
|
||||
// pool.form<CastElement>(*cast, forms[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,7 +927,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
|
||||
allow_side_effects);
|
||||
} else {
|
||||
args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects);
|
||||
args.push_back(pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
}
|
||||
|
||||
bool arg0_ptr = is_ptr_or_child(env, m_my_idx, m_expr.get_arg(0).var(), true);
|
||||
@@ -1251,11 +1237,11 @@ void SimpleExpressionElement::update_from_stack_mult_si(const Env& env,
|
||||
allow_side_effects);
|
||||
|
||||
if (!arg0_i) {
|
||||
args.at(0) = pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("int"), args.at(0));
|
||||
args.at(0) = pool.form<CastElement>(TypeSpec("int"), args.at(0));
|
||||
}
|
||||
|
||||
if (!arg1_i) {
|
||||
args.at(1) = pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("int"), args.at(1));
|
||||
args.at(1) = pool.form<CastElement>(TypeSpec("int"), args.at(1));
|
||||
}
|
||||
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
@@ -1299,7 +1285,7 @@ void SimpleExpressionElement::update_from_stack_force_si_2(const Env& env,
|
||||
|
||||
} else {
|
||||
args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects);
|
||||
args.push_back(pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
}
|
||||
|
||||
switch (kind) {
|
||||
@@ -1350,15 +1336,15 @@ void SimpleExpressionElement::update_from_stack_force_ui_2(const Env& env,
|
||||
allow_side_effects);
|
||||
} else {
|
||||
args = pop_to_forms({m_expr.get_arg(0).var()}, env, pool, stack, allow_side_effects);
|
||||
args.push_back(pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
}
|
||||
|
||||
if (!arg0_u) {
|
||||
args.at(0) = pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("uint"), args.at(0));
|
||||
args.at(0) = pool.form<CastElement>(TypeSpec("uint"), args.at(0));
|
||||
}
|
||||
|
||||
if (!arg1_u) {
|
||||
args.at(1) = pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("uint"), args.at(1));
|
||||
args.at(1) = pool.form<CastElement>(TypeSpec("uint"), args.at(1));
|
||||
}
|
||||
|
||||
auto new_form =
|
||||
@@ -1386,8 +1372,7 @@ void SimpleExpressionElement::update_from_stack_pcypld(const Env& env,
|
||||
args.push_back(popped_args.at(ras_idx));
|
||||
ras_idx++;
|
||||
} else {
|
||||
args.push_back(
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(arg_idx)));
|
||||
args.push_back(pool.form<SimpleAtomElement>(m_expr.get_arg(arg_idx)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1505,20 +1490,18 @@ void SimpleExpressionElement::update_from_stack_copy_first_int_2(const Env& env,
|
||||
if (bti) {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(kind), args.at(0),
|
||||
cast_form(pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)),
|
||||
arg0_type, pool, env));
|
||||
cast_form(pool.form<SimpleAtomElement>(m_expr.get_arg(1)), arg0_type, pool, env));
|
||||
result->push_back(new_form);
|
||||
} else {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(kind),
|
||||
pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("int"), args.at(0)),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
GenericOperator::make_fixed(kind), pool.form<CastElement>(TypeSpec("int"), args.at(0)),
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
}
|
||||
} else {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(kind), args.at(0),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
auto new_form =
|
||||
pool.alloc_element<GenericElement>(GenericOperator::make_fixed(kind), args.at(0),
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
}
|
||||
|
||||
@@ -1543,8 +1526,7 @@ void SimpleExpressionElement::update_from_stack_copy_first_int_2(const Env& env,
|
||||
args.at(0), args.at(1));
|
||||
result->push_back(new_form);
|
||||
} else {
|
||||
auto cast = pool.alloc_single_element_form<CastElement>(
|
||||
nullptr, TypeSpec(arg0_i ? "int" : "uint"), args.at(1));
|
||||
auto cast = pool.form<CastElement>(TypeSpec(arg0_i ? "int" : "uint"), args.at(1));
|
||||
if (kind == FixedOperatorKind::SUBTRACTION &&
|
||||
is_pointer_type(env, m_my_idx, m_expr.get_arg(0).var())) {
|
||||
kind = FixedOperatorKind::SUBTRACTION_PTR;
|
||||
@@ -1720,17 +1702,15 @@ FormElement* SimpleExpressionElement::update_from_stack_logor_or_logand_helper(
|
||||
if (integer && ((s64)*integer) < 0) {
|
||||
// clearing a bitfield.
|
||||
auto elts = decompile_bitfield_enum_from_int(arg1_type, env.dts->ts, ~*integer);
|
||||
auto oper =
|
||||
GenericOperator::make_function(pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, arg1_type.base_type()));
|
||||
auto oper = GenericOperator::make_function(
|
||||
pool.form<ConstantTokenElement>(arg1_type.base_type()));
|
||||
std::vector<Form*> form_elts;
|
||||
for (auto& x : elts) {
|
||||
form_elts.push_back(pool.alloc_single_element_form<ConstantTokenElement>(nullptr, x));
|
||||
form_elts.push_back(pool.form<ConstantTokenElement>(x));
|
||||
}
|
||||
auto inverted =
|
||||
pool.alloc_single_element_form<GenericElement>(nullptr, oper, form_elts);
|
||||
auto normal = pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(FixedOperatorKind::LOGNOT), inverted);
|
||||
auto inverted = pool.form<GenericElement>(oper, form_elts);
|
||||
auto normal = pool.form<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::LOGNOT), inverted);
|
||||
auto new_form = pool.alloc_element<GenericElement>(GenericOperator::make_fixed(kind),
|
||||
normal, args.at(1));
|
||||
return new_form;
|
||||
@@ -1757,8 +1737,7 @@ FormElement* SimpleExpressionElement::update_from_stack_logor_or_logand_helper(
|
||||
}
|
||||
}
|
||||
// types bad, insert cast.
|
||||
auto cast = pool.alloc_single_element_form<CastElement>(
|
||||
nullptr, TypeSpec(arg0_i ? "int" : "uint"), args.at(1));
|
||||
auto cast = pool.form<CastElement>(TypeSpec(arg0_i ? "int" : "uint"), args.at(1));
|
||||
auto new_form =
|
||||
pool.alloc_element<GenericElement>(GenericOperator::make_fixed(kind), args.at(0), cast);
|
||||
return new_form;
|
||||
@@ -1889,8 +1868,7 @@ void SimpleExpressionElement::update_from_stack_left_shift(const Env& env,
|
||||
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::MULTIPLICATION), args.at(0),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(multiplier)));
|
||||
pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(multiplier)));
|
||||
result->push_back(new_form);
|
||||
return;
|
||||
}
|
||||
@@ -1898,15 +1876,15 @@ void SimpleExpressionElement::update_from_stack_left_shift(const Env& env,
|
||||
auto arg0_i = is_int_type(env, m_my_idx, m_expr.get_arg(0).var());
|
||||
auto arg0_u = is_uint_type(env, m_my_idx, m_expr.get_arg(0).var());
|
||||
if (!arg0_i && !arg0_u) {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::SHL),
|
||||
pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("int"), args.at(0)),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
auto new_form =
|
||||
pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::SHL),
|
||||
pool.form<CastElement>(TypeSpec("int"), args.at(0)),
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
} else {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::SHL), args.at(0),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
}
|
||||
|
||||
@@ -1970,13 +1948,13 @@ void SimpleExpressionElement::update_from_stack_right_shift_logic(const Env& env
|
||||
if (!arg0_i && !arg0_u) {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::SHR),
|
||||
pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("int"), arg),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
pool.form<CastElement>(TypeSpec("int"), arg),
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
} else {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::SHR), arg,
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
}
|
||||
}
|
||||
@@ -2017,8 +1995,7 @@ void SimpleExpressionElement::update_from_stack_right_shift_arith(const Env& env
|
||||
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::DIVISION), arg,
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(multiplier)));
|
||||
pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(multiplier)));
|
||||
result->push_back(new_form);
|
||||
return;
|
||||
}
|
||||
@@ -2037,15 +2014,15 @@ void SimpleExpressionElement::update_from_stack_right_shift_arith(const Env& env
|
||||
}
|
||||
|
||||
if (!arg0_i && !arg0_u) {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::SAR),
|
||||
pool.alloc_single_element_form<CastElement>(nullptr, TypeSpec("int"), args.at(0)),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
auto new_form =
|
||||
pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::SAR),
|
||||
pool.form<CastElement>(TypeSpec("int"), args.at(0)),
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
} else {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::SAR), args.at(0),
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_expr.get_arg(1)));
|
||||
pool.form<SimpleAtomElement>(m_expr.get_arg(1)));
|
||||
result->push_back(new_form);
|
||||
}
|
||||
|
||||
@@ -2350,9 +2327,8 @@ void SetVarElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta
|
||||
m_dst.reg().get_kind() == Reg::FPR && src_as_se->expr().get_arg(0).is_int() &&
|
||||
src_as_se->expr().get_arg(0).get_int() == 0) {
|
||||
// not sure this is the best place for this.
|
||||
stack.push_value_to_reg(m_dst,
|
||||
pool.alloc_single_element_form<ConstantFloatElement>(nullptr, 0.0),
|
||||
true, m_src_type, m_var_info);
|
||||
stack.push_value_to_reg(m_dst, pool.form<ConstantFloatElement>(0.0), true, m_src_type,
|
||||
m_var_info);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2414,7 +2390,7 @@ void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack
|
||||
loc->parent_element = this;
|
||||
m_dst = loc;
|
||||
auto zero = SimpleAtom::make_int_constant(0);
|
||||
auto zero_form = pool.alloc_single_element_form<SimpleAtomElement>(nullptr, zero);
|
||||
auto zero_form = pool.form<SimpleAtomElement>(zero);
|
||||
m_src = zero_form;
|
||||
}
|
||||
}
|
||||
@@ -2453,16 +2429,13 @@ void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack
|
||||
|
||||
if (dst_form == src_form_in_func) {
|
||||
auto new_func_op = GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr,
|
||||
call_info.inplace_name));
|
||||
pool.form<ConstantTokenElement>(call_info.inplace_name));
|
||||
GenericElement* inplace_call = nullptr;
|
||||
|
||||
if (funcname == "seek" || funcname == "seekl") {
|
||||
inplace_call = pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, new_func_op,
|
||||
std::vector<Form*>{m_dst, src_as_generic->elts().at(1),
|
||||
src_as_generic->elts().at(2)})
|
||||
->try_as_element<GenericElement>();
|
||||
inplace_call = pool.alloc_element<GenericElement>(
|
||||
new_func_op, std::vector<Form*>{m_dst, src_as_generic->elts().at(1),
|
||||
src_as_generic->elts().at(2)});
|
||||
}
|
||||
ASSERT_MSG(
|
||||
inplace_call,
|
||||
@@ -2495,9 +2468,9 @@ void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack
|
||||
}
|
||||
|
||||
void StoreInSymbolElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) {
|
||||
auto sym = pool.alloc_single_element_form<SimpleExpressionElement>(
|
||||
nullptr, SimpleAtom::make_sym_val(m_sym_name).as_expr(), m_my_idx);
|
||||
auto val = pool.alloc_single_element_form<SimpleExpressionElement>(nullptr, m_value, m_my_idx);
|
||||
auto sym =
|
||||
pool.form<SimpleExpressionElement>(SimpleAtom::make_sym_val(m_sym_name).as_expr(), m_my_idx);
|
||||
auto val = pool.form<SimpleExpressionElement>(m_value, m_my_idx);
|
||||
val->update_children_from_stack(env, pool, stack, true);
|
||||
|
||||
if (m_cast_for_set) {
|
||||
@@ -2523,18 +2496,16 @@ void StoreInPairElement::push_to_stack(const Env& env, FormPool& pool, FormStack
|
||||
if (m_value.is_var()) {
|
||||
auto vars = std::vector<RegisterAccess>({m_value.var(), m_pair});
|
||||
auto popped = pop_to_forms(vars, env, pool, stack, true);
|
||||
auto addr = pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(op), popped.at(1));
|
||||
auto addr = pool.form<GenericElement>(GenericOperator::make_fixed(op), popped.at(1));
|
||||
addr->mark_popped();
|
||||
auto fr = pool.alloc_element<SetFormFormElement>(addr, popped.at(0));
|
||||
fr->mark_popped();
|
||||
stack.push_form_element(fr, true);
|
||||
} else {
|
||||
auto val = pool.alloc_single_element_form<SimpleExpressionElement>(nullptr, m_value, m_my_idx);
|
||||
auto val = pool.form<SimpleExpressionElement>(m_value, m_my_idx);
|
||||
val->mark_popped();
|
||||
auto addr = pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(op),
|
||||
pop_to_forms({m_pair}, env, pool, stack, true).at(0));
|
||||
auto addr = pool.form<GenericElement>(GenericOperator::make_fixed(op),
|
||||
pop_to_forms({m_pair}, env, pool, stack, true).at(0));
|
||||
addr->mark_popped();
|
||||
auto fr = pool.alloc_element<SetFormFormElement>(addr, val);
|
||||
fr->mark_popped();
|
||||
@@ -2612,10 +2583,8 @@ bool try_to_rewrite_vector_inline_ctor(const Env& env,
|
||||
|
||||
stack.push_value_to_reg(
|
||||
*matrix_entries->at(0).destination,
|
||||
pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr,
|
||||
GenericOperator::make_function(pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, fmt::format("new-stack-{}0", type_name)))),
|
||||
pool.form<GenericElement>(GenericOperator::make_function(
|
||||
pool.form<ConstantTokenElement>(fmt::format("new-stack-{}0", type_name)))),
|
||||
true, TypeSpec(type_name));
|
||||
return true;
|
||||
}
|
||||
@@ -2673,10 +2642,8 @@ bool try_to_rewrite_matrix_inline_ctor(const Env& env, FormPool& pool, FormStack
|
||||
stack.pop(5);
|
||||
|
||||
stack.push_value_to_reg(*matrix_entries->at(0).destination,
|
||||
pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, "new-stack-matrix0"))),
|
||||
pool.form<GenericElement>(GenericOperator::make_function(
|
||||
pool.form<ConstantTokenElement>("new-stack-matrix0"))),
|
||||
true, TypeSpec("matrix"));
|
||||
return true;
|
||||
}
|
||||
@@ -2715,7 +2682,7 @@ void StorePlainDeref::push_to_stack(const Env& env, FormPool& pool, FormStack& s
|
||||
make_optional_cast(m_dst_cast_type, popped.at(0), pool, env));
|
||||
m_dst->mark_popped();
|
||||
m_dst->try_as_element<DerefElement>()->inline_nested();
|
||||
auto val = pool.alloc_single_element_form<SimpleExpressionElement>(nullptr, m_expr, m_my_idx);
|
||||
auto val = pool.form<SimpleExpressionElement>(m_expr, m_my_idx);
|
||||
val->mark_popped();
|
||||
auto fr = pool.alloc_element<SetFormFormElement>(
|
||||
m_dst, make_optional_cast(m_src_cast_type, val, pool, env));
|
||||
@@ -2744,7 +2711,7 @@ void StoreArrayAccess::push_to_stack(const Env& env, FormPool& pool, FormStack&
|
||||
auto vars = std::vector<RegisterAccess>({m_base_var});
|
||||
auto popped = pop_to_forms(vars, env, pool, stack, true);
|
||||
m_dst->mark_popped();
|
||||
expr_form = pool.alloc_single_element_form<SimpleExpressionElement>(nullptr, m_expr, m_my_idx);
|
||||
expr_form = pool.form<SimpleExpressionElement>(m_expr, m_my_idx);
|
||||
array_form = popped.at(0);
|
||||
}
|
||||
|
||||
@@ -2961,21 +2928,17 @@ void FunctionCallElement::update_from_stack(const Env& env,
|
||||
{Matcher::any(0), Matcher::any_constant_token(1)});
|
||||
auto virtual_go_mr = match(virtual_go_state_matcher, go_next_state);
|
||||
if (virtual_go_mr.matched && virtual_go_mr.maps.forms.at(0)->to_string(env) == "self") {
|
||||
arg_forms.insert(arg_forms.begin(), pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, virtual_go_mr.maps.strings.at(1)));
|
||||
arg_forms.insert(arg_forms.begin(),
|
||||
pool.form<ConstantTokenElement>(virtual_go_mr.maps.strings.at(1)));
|
||||
auto go_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "go-virtual")),
|
||||
arg_forms);
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("go-virtual")), arg_forms);
|
||||
result->push_back(go_form);
|
||||
return;
|
||||
}
|
||||
|
||||
arg_forms.insert(arg_forms.begin(), go_next_state);
|
||||
auto go_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "go")),
|
||||
arg_forms);
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("go")), arg_forms);
|
||||
result->push_back(go_form);
|
||||
return;
|
||||
}
|
||||
@@ -3059,8 +3022,7 @@ void FunctionCallElement::update_from_stack(const Env& env,
|
||||
auto& var = all_pop_vars.at(i + 1); // 0 is the function itself.
|
||||
auto arg_type = env.get_types_before_op(var.idx()).get(var.reg()).typespec();
|
||||
if (!env.dts->ts.tc(expected_arg_types.at(i), arg_type)) {
|
||||
new_args.at(i) = pool.alloc_single_element_form<CastElement>(
|
||||
nullptr, expected_arg_types.at(i), new_args.at(i));
|
||||
new_args.at(i) = pool.form<CastElement>(expected_arg_types.at(i), new_args.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3101,8 +3063,7 @@ void FunctionCallElement::update_from_stack(const Env& env,
|
||||
type_2 = "boxed-array";
|
||||
}
|
||||
|
||||
auto quoted_type = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_sym_ptr(type_2));
|
||||
auto quoted_type = pool.form<SimpleAtomElement>(SimpleAtom::make_sym_ptr(type_2));
|
||||
|
||||
if (alloc == "global" && type_1 == "pair") {
|
||||
// cons!
|
||||
@@ -3194,7 +3155,7 @@ void FunctionCallElement::update_from_stack(const Env& env,
|
||||
":final in the deftype to disable virtual method calls",
|
||||
tp_type.method_from_type().print(), tp_type.method_id()));
|
||||
}
|
||||
auto method_op = pool.alloc_single_element_form<ConstantTokenElement>(nullptr, name);
|
||||
auto method_op = pool.form<ConstantTokenElement>(name);
|
||||
auto gop = GenericOperator::make_function(method_op);
|
||||
|
||||
result->push_back(pool.alloc_element<GenericElement>(gop, arg_forms));
|
||||
@@ -3227,10 +3188,9 @@ void FunctionCallElement::update_from_stack(const Env& env,
|
||||
|
||||
if (got_stack_new) {
|
||||
std::vector<Form*> stack_new_args;
|
||||
stack_new_args.push_back(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "'stack"));
|
||||
stack_new_args.push_back(pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, fmt::format("'{}", type_source_form->to_string(env))));
|
||||
stack_new_args.push_back(pool.form<ConstantTokenElement>("'stack"));
|
||||
stack_new_args.push_back(pool.form<ConstantTokenElement>(
|
||||
fmt::format("'{}", type_source_form->to_string(env))));
|
||||
for (size_t i = 2; i < arg_forms.size(); i++) {
|
||||
stack_new_args.push_back(arg_forms.at(i));
|
||||
}
|
||||
@@ -3241,8 +3201,7 @@ void FunctionCallElement::update_from_stack(const Env& env,
|
||||
}
|
||||
}
|
||||
|
||||
auto method_op =
|
||||
pool.alloc_single_element_form<GetMethodElement>(nullptr, type_source_form, name, false);
|
||||
auto method_op = pool.form<GetMethodElement>(type_source_form, name, false);
|
||||
auto gop = GenericOperator::make_function(method_op);
|
||||
|
||||
result->push_back(pool.alloc_element<GenericElement>(gop, arg_forms));
|
||||
@@ -3265,6 +3224,26 @@ void FunctionCallElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
||||
///////////////////
|
||||
// DerefElement
|
||||
///////////////////
|
||||
ConstantTokenElement* DerefElement::try_as_art_const(const Env& env, FormPool& pool) {
|
||||
auto mr = match(
|
||||
Matcher::deref(Matcher::s6(), false,
|
||||
{DerefTokenMatcher::string("draw"), DerefTokenMatcher::string("art-group"),
|
||||
DerefTokenMatcher::string("data"), DerefTokenMatcher::any_integer(0)}),
|
||||
this);
|
||||
|
||||
if (mr.matched) {
|
||||
auto elt_name = env.get_art_elt_name(mr.maps.ints.at(0));
|
||||
if (elt_name) {
|
||||
return pool.alloc_element<ConstantTokenElement>(*elt_name);
|
||||
} else {
|
||||
lg::error("function {}: did not find art element {} in {}", env.func->name(),
|
||||
mr.maps.ints.at(0), env.art_group());
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DerefElement::update_from_stack(const Env& env,
|
||||
FormPool& pool,
|
||||
FormStack& stack,
|
||||
@@ -3285,6 +3264,12 @@ void DerefElement::update_from_stack(const Env& env,
|
||||
// merge nested ->'s
|
||||
inline_nested();
|
||||
|
||||
auto as_art = try_as_art_const(env, pool);
|
||||
if (as_art) {
|
||||
result->push_back(as_art);
|
||||
return;
|
||||
}
|
||||
|
||||
result->push_back(this);
|
||||
}
|
||||
|
||||
@@ -3422,8 +3407,8 @@ Form* try_rewrite_as_process_to_ppointer(CondNoElseElement* value,
|
||||
}
|
||||
}
|
||||
|
||||
return pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(FixedOperatorKind::PROCESS_TO_PPOINTER), repopped);
|
||||
return pool.form<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::PROCESS_TO_PPOINTER), repopped);
|
||||
}
|
||||
|
||||
// (if x (-> x 0 self)) -> (ppointer->process x)
|
||||
@@ -3472,8 +3457,59 @@ Form* try_rewrite_as_pppointer_to_process(CondNoElseElement* value,
|
||||
repopped = var_to_form(condition_var, pool);
|
||||
}
|
||||
|
||||
return pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(FixedOperatorKind::PPOINTER_TO_PROCESS), repopped);
|
||||
return pool.form<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::PPOINTER_TO_PROCESS), repopped);
|
||||
}
|
||||
|
||||
// (if (> (-> self skel active-channels) 0)
|
||||
// (-> self skel root-channel 0 frame-group)
|
||||
// )
|
||||
// (ja-group :chan 0)
|
||||
Form* try_rewrite_as_ja_group(CondNoElseElement* value,
|
||||
FormStack& stack,
|
||||
FormPool& pool,
|
||||
const Env& env) {
|
||||
if (value->entries.size() != 1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto condition = value->entries.at(0).condition;
|
||||
auto body = value->entries[0].body;
|
||||
|
||||
// safe to look for a reg directly here.
|
||||
auto condition_matcher = Matcher::fixed_op(
|
||||
FixedOperatorKind::GT, {Matcher::deref(Matcher::s6(), false,
|
||||
{DerefTokenMatcher::string("skel"),
|
||||
DerefTokenMatcher::string("active-channels")}),
|
||||
Matcher::any(0)});
|
||||
auto condition_mr = match(condition_matcher, condition);
|
||||
if (!condition_mr.matched) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto body_matcher = Matcher::deref(
|
||||
Matcher::s6(), false,
|
||||
{DerefTokenMatcher::string("skel"), DerefTokenMatcher::string("root-channel"),
|
||||
DerefTokenMatcher::any_expr_or_int(0), DerefTokenMatcher::string("frame-group")});
|
||||
auto body_mr = match(body_matcher, body);
|
||||
|
||||
if (!body_mr.matched) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto chan = body_mr.int_or_form_to_form(pool, 0);
|
||||
auto obj_chan = chan->to_form(env);
|
||||
if (condition_mr.maps.forms.at(0)->to_form(env) == obj_chan) {
|
||||
auto func = GenericOperator::make_function(pool.form<ConstantTokenElement>("ja-group"));
|
||||
if (obj_chan.is_int(0)) {
|
||||
return pool.form<GenericElement>(func);
|
||||
} else {
|
||||
return pool.form<GenericElement>(func, pool.form<ConstantTokenElement>(":chan"),
|
||||
condition_mr.maps.forms.at(0));
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -3542,11 +3578,17 @@ void CondNoElseElement::push_to_stack(const Env& env, FormPool& pool, FormStack&
|
||||
stack.push_value_to_reg(write_as_value, as_ppointer_to_process, true,
|
||||
env.get_variable_type(final_destination, false));
|
||||
} else {
|
||||
// fmt::print("func {} final destination {} type {}\n", env.func->name(),
|
||||
// final_destination.to_string(env),
|
||||
// env.get_variable_type(final_destination, false).print());
|
||||
stack.push_value_to_reg(write_as_value, pool.alloc_single_form(nullptr, this), true,
|
||||
env.get_variable_type(final_destination, false));
|
||||
auto as_ja_group = try_rewrite_as_ja_group(this, stack, pool, env);
|
||||
if (as_ja_group) {
|
||||
stack.push_value_to_reg(write_as_value, as_ja_group, true,
|
||||
env.get_variable_type(final_destination, false));
|
||||
} else {
|
||||
// fmt::print("func {} final destination {} type {}\n", env.func->name(),
|
||||
// final_destination.to_string(env),
|
||||
// env.get_variable_type(final_destination, false).print());
|
||||
stack.push_value_to_reg(write_as_value, pool.alloc_single_form(nullptr, this), true,
|
||||
env.get_variable_type(final_destination, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3724,8 +3766,7 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
||||
|
||||
Form* result_value = pool.alloc_single_form(nullptr, this);
|
||||
if (!env.dts->ts.tc(expected_type, result_type)) {
|
||||
result_value =
|
||||
pool.alloc_single_element_form<CastElement>(nullptr, expected_type, result_value);
|
||||
result_value = pool.form<CastElement>(expected_type, result_value);
|
||||
}
|
||||
// fmt::print("{}\n", result_value->to_string(env));
|
||||
|
||||
@@ -3944,8 +3985,7 @@ FormElement* ConditionElement::make_zero_check_generic(const Env& env,
|
||||
source_forms.at(0));
|
||||
if (mr.matched) {
|
||||
s64 value = -mr.maps.ints.at(1);
|
||||
auto value_form = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(value));
|
||||
auto value_form = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(value));
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::EQ),
|
||||
std::vector<Form*>{mr.maps.forms.at(0), value_form});
|
||||
@@ -4018,12 +4058,7 @@ FormElement* try_make_logtest_cpad_macro(Form* in, FormPool& pool) {
|
||||
if (logtest_elt != nullptr) {
|
||||
auto buttons_form = logtest_elt->elts().at(1);
|
||||
std::vector<Form*> v;
|
||||
if (mr.maps.forms.find(0) != mr.maps.forms.end()) {
|
||||
v.push_back(mr.maps.forms.at(0));
|
||||
} else {
|
||||
v.push_back(
|
||||
pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(mr.maps.ints.at(0))));
|
||||
}
|
||||
v.push_back(mr.int_or_form_to_form(pool, 0));
|
||||
GenericElement* butts =
|
||||
dynamic_cast<GenericElement*>(buttons_form->at(0)); // the form with the buttons itself
|
||||
if (butts) {
|
||||
@@ -4063,8 +4098,7 @@ FormElement* ConditionElement::make_nonzero_check_generic(const Env& env,
|
||||
source_forms.at(0));
|
||||
if (mr.matched) {
|
||||
s64 value = -mr.maps.ints.at(1);
|
||||
auto value_form = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(value));
|
||||
auto value_form = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(value));
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::NEQ),
|
||||
std::vector<Form*>{mr.maps.forms.at(0), value_form});
|
||||
}
|
||||
@@ -4103,6 +4137,29 @@ FormElement* ConditionElement::make_equal_check_generic(const Env& env,
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::EQ),
|
||||
forms_with_cast);
|
||||
} else {
|
||||
{
|
||||
// (= (ja-group)
|
||||
// (-> self draw art-group data 7)
|
||||
// )
|
||||
// actually (ja-group? (-> self draw art-group data 7) :channel channel)
|
||||
auto mr =
|
||||
match(Matcher::op(GenericOpMatcher::func(Matcher::constant_token("ja-group")), {}),
|
||||
source_forms.at(0));
|
||||
// check if both things matched
|
||||
if (mr.matched) {
|
||||
// grab args from the ja-group and pass them on
|
||||
std::vector<Form*> macro_args;
|
||||
macro_args.push_back(source_forms.at(1));
|
||||
|
||||
auto jagroup = source_forms.at(0)->try_as_element<GenericElement>();
|
||||
for (int i = 1; i < jagroup->elts().size(); ++i) {
|
||||
macro_args.push_back(jagroup->elts().at(i));
|
||||
}
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("ja-group?")),
|
||||
macro_args);
|
||||
}
|
||||
}
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::EQ),
|
||||
cast_to_64_bit(source_forms, source_types, pool, env));
|
||||
@@ -4123,8 +4180,8 @@ FormElement* ConditionElement::make_not_equal_check_generic(
|
||||
// null?
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_compare(IR2_Condition::Kind::FALSE),
|
||||
pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(FixedOperatorKind::NULLP), source_forms.at(0)));
|
||||
pool.form<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::NULLP),
|
||||
source_forms.at(0)));
|
||||
} else {
|
||||
auto nice_constant =
|
||||
try_make_constant_for_compare(source_forms.at(1), source_types.at(0), pool, env);
|
||||
@@ -4164,8 +4221,7 @@ FormElement* ConditionElement::make_less_than_zero_signed_check_generic(
|
||||
shift_match.maps.forms.at(0));
|
||||
} else {
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env);
|
||||
auto zero = pool.alloc_single_element_form<SimpleAtomElement>(nullptr,
|
||||
SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::LT),
|
||||
casted);
|
||||
@@ -4193,13 +4249,11 @@ FormElement* ConditionElement::make_geq_zero_signed_check_generic(
|
||||
if (shift_match.matched) {
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_compare(IR2_Condition::Kind::FALSE),
|
||||
pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(FixedOperatorKind::PAIRP),
|
||||
shift_match.maps.forms.at(0)));
|
||||
pool.form<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::PAIRP),
|
||||
shift_match.maps.forms.at(0)));
|
||||
} else {
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env);
|
||||
auto zero = pool.alloc_single_element_form<SimpleAtomElement>(nullptr,
|
||||
SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::GEQ),
|
||||
casted);
|
||||
@@ -4225,8 +4279,7 @@ FormElement* ConditionElement::make_geq_zero_unsigned_check_generic(
|
||||
source_forms.at(0));
|
||||
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env);
|
||||
auto zero =
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::GEQ),
|
||||
casted);
|
||||
@@ -4280,8 +4333,7 @@ FormElement* ConditionElement::make_generic(const Env& env,
|
||||
|
||||
case IR2_Condition::Kind::LESS_THAN_ZERO_UNSIGNED: {
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env);
|
||||
auto zero = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::LT),
|
||||
casted);
|
||||
@@ -4289,8 +4341,7 @@ FormElement* ConditionElement::make_generic(const Env& env,
|
||||
|
||||
case IR2_Condition::Kind::LEQ_ZERO_SIGNED: {
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env);
|
||||
auto zero = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::LEQ),
|
||||
casted);
|
||||
@@ -4306,8 +4357,7 @@ FormElement* ConditionElement::make_generic(const Env& env,
|
||||
|
||||
case IR2_Condition::Kind::GREATER_THAN_ZERO_UNSIGNED: {
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env);
|
||||
auto zero = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::GT),
|
||||
casted);
|
||||
@@ -4315,8 +4365,7 @@ FormElement* ConditionElement::make_generic(const Env& env,
|
||||
|
||||
case IR2_Condition::Kind::GREATER_THAN_ZERO_SIGNED: {
|
||||
auto casted = make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env);
|
||||
auto zero = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(0));
|
||||
auto zero = pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(0));
|
||||
casted.push_back(zero);
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::GT),
|
||||
casted);
|
||||
@@ -4405,7 +4454,7 @@ void ConditionElement::push_to_stack(const Env& env, FormPool& pool, FormStack&
|
||||
if (m_src[i]->is_var()) {
|
||||
source_forms.push_back(popped_forms.at(popped_counter++));
|
||||
} else {
|
||||
source_forms.push_back(pool.alloc_single_element_form<SimpleAtomElement>(nullptr, *m_src[i]));
|
||||
source_forms.push_back(pool.form<SimpleAtomElement>(*m_src[i]));
|
||||
}
|
||||
}
|
||||
ASSERT(popped_counter == int(popped_forms.size()));
|
||||
@@ -4458,7 +4507,7 @@ void ConditionElement::update_from_stack(const Env& env,
|
||||
if (m_src[i]->is_var()) {
|
||||
source_forms.push_back(popped_forms.at(popped_counter++));
|
||||
} else {
|
||||
source_forms.push_back(pool.alloc_single_element_form<SimpleAtomElement>(nullptr, *m_src[i]));
|
||||
source_forms.push_back(pool.form<SimpleAtomElement>(*m_src[i]));
|
||||
}
|
||||
}
|
||||
ASSERT(popped_counter == int(popped_forms.size()));
|
||||
@@ -4591,8 +4640,8 @@ void push_asm_sllv_to_stack(const AsmOp* op,
|
||||
// these are lazily converted at the destination.
|
||||
stack.push_value_to_reg(
|
||||
*dst,
|
||||
pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr, GenericOperator::make_fixed(FixedOperatorKind::ASM_SLLV_R0), src_var),
|
||||
pool.form<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::ASM_SLLV_R0),
|
||||
src_var),
|
||||
true, env.get_variable_type(*dst, true));
|
||||
}
|
||||
}
|
||||
@@ -4750,7 +4799,7 @@ void AtomicOpElement::push_to_stack(const Env& env, FormPool& pool, FormStack& s
|
||||
auto delay = as_branch->branch_delay();
|
||||
ASSERT(delay);
|
||||
// this might not be enough - we may need to back up to the cfg builder and do something there.
|
||||
auto del = pool.alloc_single_element_form<AtomicOpElement>(nullptr, delay);
|
||||
auto del = pool.form<AtomicOpElement>(delay);
|
||||
auto be = pool.alloc_element<AsmBranchElement>(as_branch, del, false);
|
||||
be->push_to_stack(env, pool, stack);
|
||||
return;
|
||||
@@ -4832,27 +4881,22 @@ void BranchElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta
|
||||
auto src = m_op->branch_delay().var(1);
|
||||
auto dst = m_op->branch_delay().var(0);
|
||||
|
||||
auto src_form =
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, SimpleAtom::make_var(src));
|
||||
auto src_form = pool.form<SimpleAtomElement>(SimpleAtom::make_var(src));
|
||||
|
||||
branch_delay = pool.alloc_single_element_form<SetVarElement>(
|
||||
nullptr, dst, src_form, true, env.get_variable_type(src, true));
|
||||
branch_delay =
|
||||
pool.form<SetVarElement>(dst, src_form, true, env.get_variable_type(src, true));
|
||||
} break;
|
||||
case IR2_BranchDelay::Kind::SET_REG_FALSE: {
|
||||
auto dst = m_op->branch_delay().var(0);
|
||||
auto src_form = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_sym_val("#f"));
|
||||
auto src_form = pool.form<SimpleAtomElement>(SimpleAtom::make_sym_val("#f"));
|
||||
|
||||
branch_delay = pool.alloc_single_element_form<SetVarElement>(nullptr, dst, src_form, true,
|
||||
TypeSpec("symbol"));
|
||||
branch_delay = pool.form<SetVarElement>(dst, src_form, true, TypeSpec("symbol"));
|
||||
} break;
|
||||
case IR2_BranchDelay::Kind::SET_REG_TRUE: {
|
||||
auto dst = m_op->branch_delay().var(0);
|
||||
auto src_form = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_sym_val("#t"));
|
||||
auto src_form = pool.form<SimpleAtomElement>(SimpleAtom::make_sym_val("#t"));
|
||||
|
||||
branch_delay = pool.alloc_single_element_form<SetVarElement>(nullptr, dst, src_form, true,
|
||||
TypeSpec("symbol"));
|
||||
branch_delay = pool.form<SetVarElement>(dst, src_form, true, TypeSpec("symbol"));
|
||||
} break;
|
||||
default:
|
||||
throw std::runtime_error("Unhandled branch delay in BranchElement::push_to_stack: " +
|
||||
@@ -5241,8 +5285,7 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool,
|
||||
}
|
||||
|
||||
if (!val) {
|
||||
val = pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr,
|
||||
val = pool.form<GenericElement>(
|
||||
GenericOperator::make_compare(on_zero ? IR2_Condition::Kind::NONZERO
|
||||
: IR2_Condition::Kind::ZERO),
|
||||
std::vector<Form*>{popped.at(1)});
|
||||
@@ -5260,11 +5303,10 @@ void StackSpillStoreElement::push_to_stack(const Env& env, FormPool& pool, FormS
|
||||
if (m_value.is_var()) {
|
||||
src = pop_to_forms({m_value.var()}, env, pool, stack, true).at(0);
|
||||
} else {
|
||||
src = pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_value);
|
||||
src = pool.form<SimpleAtomElement>(m_value);
|
||||
}
|
||||
|
||||
auto dst = pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, env.get_spill_slot_var_name(m_stack_offset));
|
||||
auto dst = pool.form<ConstantTokenElement>(env.get_spill_slot_var_name(m_stack_offset));
|
||||
if (m_cast_type) {
|
||||
src = cast_form(src, *m_cast_type, pool, env);
|
||||
}
|
||||
@@ -5365,10 +5407,8 @@ bool try_vector_reset_inline(const Env& env,
|
||||
store = repop_passthrough_arg(store, stack, env, &orig, &got_orig);
|
||||
|
||||
// create the actual form
|
||||
Form* new_thing = pool.alloc_single_element_form<GenericElement>(
|
||||
nullptr,
|
||||
GenericOperator::make_function(
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "vector-reset!")),
|
||||
Form* new_thing = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("vector-reset!")),
|
||||
std::vector<Form*>{store});
|
||||
|
||||
if (got_orig) {
|
||||
@@ -5440,24 +5480,21 @@ void MethodOfTypeElement::update_from_stack(const Env& env,
|
||||
type_as_deref->tokens().pop_back();
|
||||
result->push_back(pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::METHOD_OF_OBJECT),
|
||||
std::vector<Form*>{type, pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, m_method_info.name)}));
|
||||
std::vector<Form*>{type, pool.form<ConstantTokenElement>(m_method_info.name)}));
|
||||
return;
|
||||
} else if (type_as_deref->tokens().size() == 1 &&
|
||||
type_as_deref->tokens().back().is_field_name("type")) {
|
||||
result->push_back(pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::METHOD_OF_OBJECT),
|
||||
std::vector<Form*>{
|
||||
type_as_deref->base(),
|
||||
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, m_method_info.name)}));
|
||||
std::vector<Form*>{type_as_deref->base(),
|
||||
pool.form<ConstantTokenElement>(m_method_info.name)}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
result->push_back(pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::METHOD_OF_TYPE),
|
||||
std::vector<Form*>{type, pool.alloc_single_element_form<ConstantTokenElement>(
|
||||
nullptr, m_method_info.name)}));
|
||||
std::vector<Form*>{type, pool.form<ConstantTokenElement>(m_method_info.name)}));
|
||||
}
|
||||
|
||||
void SimpleAtomElement::update_from_stack(const Env&,
|
||||
|
||||
@@ -15,6 +15,13 @@ Matcher Matcher::any_label(int match_id) {
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::reg(Register reg) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::REG;
|
||||
m.m_reg = reg;
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::op(const GenericOpMatcher& op, const std::vector<Matcher>& args) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::GENERIC_OP;
|
||||
@@ -184,7 +191,8 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
|
||||
maps_out->forms[m_form_match] = input;
|
||||
}
|
||||
return true;
|
||||
case Kind::ANY_REG: {
|
||||
case Kind::ANY_REG:
|
||||
case Kind::REG: {
|
||||
bool got = false;
|
||||
RegisterAccess result;
|
||||
|
||||
@@ -206,7 +214,9 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
|
||||
}
|
||||
|
||||
if (got) {
|
||||
if (m_reg_out_id != -1) {
|
||||
if (m_kind == Kind::REG) {
|
||||
return result.reg() == *m_reg;
|
||||
} else if (m_reg_out_id != -1) {
|
||||
maps_out->regs.resize(std::max(size_t(m_reg_out_id + 1), maps_out->regs.size()));
|
||||
maps_out->regs.at(m_reg_out_id) = result;
|
||||
}
|
||||
@@ -610,6 +620,14 @@ MatchResult match(const Matcher& spec, Form* input) {
|
||||
return result;
|
||||
}
|
||||
|
||||
MatchResult match(const Matcher& spec, FormElement* input) {
|
||||
Form hack;
|
||||
hack.elts().push_back(input);
|
||||
MatchResult result;
|
||||
result.matched = spec.do_match(&hack, &result.maps);
|
||||
return result;
|
||||
}
|
||||
|
||||
DerefTokenMatcher DerefTokenMatcher::string(const std::string& str) {
|
||||
DerefTokenMatcher result;
|
||||
result.m_kind = Kind::STRING;
|
||||
|
||||
@@ -20,12 +20,22 @@ struct MatchResult {
|
||||
std::unordered_map<int, s64> label;
|
||||
std::unordered_map<int, s64> ints;
|
||||
} maps;
|
||||
|
||||
Form* int_or_form_to_form(FormPool& pool, int key_idx) {
|
||||
if (maps.forms.find(key_idx) != maps.forms.end()) {
|
||||
return maps.forms.at(key_idx);
|
||||
} else {
|
||||
return pool.form<SimpleAtomElement>(SimpleAtom::make_int_constant(maps.ints.at(key_idx)));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class Matcher {
|
||||
public:
|
||||
static Matcher any_reg(int match_id = -1);
|
||||
static Matcher any_label(int match_id = -1);
|
||||
static Matcher reg(Register reg);
|
||||
static inline Matcher s6() { return Matcher::reg(Register(Reg::GPR, Reg::S6)); }
|
||||
static Matcher op(const GenericOpMatcher& op, const std::vector<Matcher>& args);
|
||||
static Matcher op_fixed(FixedOperatorKind op, const std::vector<Matcher>& args);
|
||||
static Matcher op_with_rest(const GenericOpMatcher& op, const std::vector<Matcher>& args);
|
||||
@@ -77,6 +87,7 @@ class Matcher {
|
||||
CONSTANT_TOKEN,
|
||||
SC_OR,
|
||||
BEGIN,
|
||||
REG, // a specific register. like s6.
|
||||
INVALID
|
||||
};
|
||||
|
||||
@@ -94,10 +105,12 @@ class Matcher {
|
||||
int m_label_out_id = -1;
|
||||
int m_int_out_id = -1;
|
||||
std::optional<int> m_int_match;
|
||||
std::optional<Register> m_reg;
|
||||
std::string m_str;
|
||||
};
|
||||
|
||||
MatchResult match(const Matcher& spec, Form* input);
|
||||
MatchResult match(const Matcher& spec, FormElement* input);
|
||||
|
||||
class DerefTokenMatcher {
|
||||
public:
|
||||
|
||||
@@ -65,6 +65,9 @@ class LinkedObjectFile {
|
||||
u32 read_data_word(const DecompilerLabel& label);
|
||||
const DecompilerLabel& get_label_by_name(const std::string& name) const;
|
||||
std::string get_goal_string_by_label(const DecompilerLabel& label) const;
|
||||
std::string get_goal_string_by_label(int label_id) const {
|
||||
return get_goal_string_by_label(labels.at(label_id));
|
||||
}
|
||||
std::string get_goal_string(int seg, int word_idx, bool with_quotes = true) const;
|
||||
bool is_string(int seg, int byte_idx) const;
|
||||
|
||||
|
||||
@@ -667,124 +667,94 @@ std::string ObjectFileDB::process_game_count_file() {
|
||||
return result;
|
||||
}
|
||||
|
||||
namespace {
|
||||
void get_art_info(ObjectFileDB& db, ObjectFileData& obj) {
|
||||
if (obj.obj_version == 4) {
|
||||
const auto& words = obj.linked_data.words_by_seg.at(MAIN_SEGMENT);
|
||||
if (words.at(0).kind() == LinkedWord::Kind::TYPE_PTR &&
|
||||
words.at(0).symbol_name() == "art-group") {
|
||||
// fmt::print("art-group {}:\n", obj.to_unique_name());
|
||||
auto name = obj.linked_data.get_goal_string_by_label(words.at(2).label_id());
|
||||
int length = words.at(3).data;
|
||||
// fmt::print(" length: {}\n", length);
|
||||
std::unordered_map<int, std::string> art_group_elts;
|
||||
for (int i = 0; i < length; ++i) {
|
||||
const auto& word = words.at(8 + i);
|
||||
if (word.kind() == LinkedWord::Kind::SYM_PTR && word.symbol_name() == "#f") {
|
||||
continue;
|
||||
}
|
||||
const auto& label = obj.linked_data.labels.at(word.label_id());
|
||||
auto elt_name =
|
||||
obj.linked_data.get_goal_string_by_label(words.at(label.offset / 4 + 1).label_id());
|
||||
std::string elt_type = words.at(label.offset / 4 - 1).symbol_name();
|
||||
std::string unique_name = elt_name;
|
||||
if (elt_type == "art-joint-geo") {
|
||||
// the skeleton!
|
||||
unique_name += "-jg";
|
||||
} else if (elt_type == "merc-ctrl" || elt_type == "shadow-geo") {
|
||||
// (maybe mesh-geo as well but that doesnt exist)
|
||||
// the skin!
|
||||
unique_name += "-mg";
|
||||
} else if (elt_type == "art-joint-anim") {
|
||||
// the animations!
|
||||
unique_name += "-ja";
|
||||
} else {
|
||||
// the something idk!
|
||||
throw std::runtime_error(
|
||||
fmt::format("unknown art elt type {} in {}", elt_type, obj.to_unique_name()));
|
||||
}
|
||||
art_group_elts[i] = unique_name;
|
||||
// fmt::print(" {}: {} ({}) -> {}\n", i, elt_name, elt_type, unique_name);
|
||||
}
|
||||
db.dts.art_group_info[obj.to_unique_name()] = art_group_elts;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
/*!
|
||||
* This is the main decompiler routine which runs after we've identified functions.
|
||||
* Get information from art groups.
|
||||
*/
|
||||
void ObjectFileDB::analyze_functions_ir1(const Config& config) {
|
||||
lg::info("- Analyzing Functions...");
|
||||
void ObjectFileDB::extract_art_info() {
|
||||
lg::info("Processing art groups...");
|
||||
Timer timer;
|
||||
|
||||
int total_functions = 0;
|
||||
|
||||
// Step 1 - analyze the "top level" or "login" code for each object file.
|
||||
// this will give us type definitions, method definitions, and function definitions...
|
||||
lg::info(" - Processing top levels...");
|
||||
|
||||
timer.start();
|
||||
for_each_obj([&](ObjectFileData& data) {
|
||||
if (data.linked_data.segments == 3) {
|
||||
// the top level segment should have a single function
|
||||
ASSERT(data.linked_data.functions_by_seg.at(2).size() == 1);
|
||||
|
||||
auto& func = data.linked_data.functions_by_seg.at(2).front();
|
||||
ASSERT(func.guessed_name.empty());
|
||||
func.guessed_name.set_as_top_level(data.to_unique_name());
|
||||
func.find_global_function_defs(data.linked_data, dts);
|
||||
func.find_type_defs(data.linked_data, dts);
|
||||
func.find_method_defs(data.linked_data, dts);
|
||||
for_each_obj([&](ObjectFileData& obj) {
|
||||
try {
|
||||
get_art_info(*this, obj);
|
||||
} catch (std::runtime_error& e) {
|
||||
lg::warn("Error when extracting art group info: {}", e.what());
|
||||
}
|
||||
});
|
||||
|
||||
// check for function uniqueness.
|
||||
std::unordered_set<std::string> unique_names;
|
||||
std::unordered_map<std::string, std::unordered_set<std::string>> duplicated_functions;
|
||||
lg::info("Processed art groups: in {:.2f} ms\n", timer.getMs());
|
||||
}
|
||||
|
||||
int uid = 1;
|
||||
for_each_obj([&](ObjectFileData& data) {
|
||||
int func_in_obj = 0;
|
||||
for (int segment_id = 0; segment_id < int(data.linked_data.segments); segment_id++) {
|
||||
for (auto& func : data.linked_data.functions_by_seg.at(segment_id)) {
|
||||
func.guessed_name.unique_id = uid++;
|
||||
func.guessed_name.id_in_object = func_in_obj++;
|
||||
func.guessed_name.object_name = data.to_unique_name();
|
||||
auto name = func.name();
|
||||
/*!
|
||||
* Write out the art group information.
|
||||
*/
|
||||
void ObjectFileDB::dump_art_info(const std::string& output_dir) {
|
||||
lg::info("Writing art group info...");
|
||||
Timer timer;
|
||||
|
||||
if (unique_names.find(name) != unique_names.end()) {
|
||||
duplicated_functions[name].insert(data.to_unique_name());
|
||||
}
|
||||
|
||||
unique_names.insert(name);
|
||||
|
||||
if (config.hacks.asm_functions_by_name.find(name) !=
|
||||
config.hacks.asm_functions_by_name.end()) {
|
||||
func.warnings.info("Flagged as asm by config");
|
||||
func.suspected_asm = true;
|
||||
}
|
||||
}
|
||||
if (!dts.art_group_info.empty()) {
|
||||
file_util::create_dir_if_needed(file_util::combine_path(output_dir, "import"));
|
||||
}
|
||||
for (const auto& [ag_name, info] : dts.art_group_info) {
|
||||
auto ag_fname = ag_name + ".gc";
|
||||
auto filename = file_util::get_file_path({output_dir, "import", ag_fname});
|
||||
std::string result = ";;-*-Lisp-*-\n";
|
||||
result += "(in-package goal)\n\n";
|
||||
result += fmt::format(";; {} - art group OpenGOAL import file\n", ag_fname);
|
||||
result += ";; THIS FILE IS AUTOMATICALLY GENERATED!\n\n";
|
||||
for (const auto& [idx, elt_name] : info) {
|
||||
result += print_art_elt_for_dump(ag_name, elt_name, idx);
|
||||
}
|
||||
});
|
||||
result += "\n";
|
||||
file_util::write_text_file(filename, result);
|
||||
}
|
||||
|
||||
for_each_function([&](Function& func, int segment_id, ObjectFileData& data) {
|
||||
(void)segment_id;
|
||||
auto name = func.name();
|
||||
|
||||
if (duplicated_functions.find(name) != duplicated_functions.end()) {
|
||||
duplicated_functions[name].insert(data.to_unique_name());
|
||||
func.warnings.info("Exists in multiple non-identical object files");
|
||||
}
|
||||
});
|
||||
|
||||
int total_trivial_cfg_functions = 0;
|
||||
int total_named_functions = 0;
|
||||
|
||||
int asm_funcs = 0;
|
||||
|
||||
std::map<int, std::vector<std::string>> unresolved_by_length;
|
||||
|
||||
timer.start();
|
||||
int total_basic_blocks = 0;
|
||||
|
||||
// Main Pass over each function...
|
||||
for_each_function_def_order([&](Function& func, int segment_id, ObjectFileData& data) {
|
||||
total_functions++;
|
||||
|
||||
// first, find basic blocks.
|
||||
auto blocks = find_blocks_in_function(data.linked_data, segment_id, func);
|
||||
total_basic_blocks += blocks.size();
|
||||
func.basic_blocks = blocks;
|
||||
|
||||
// analyze the proluge
|
||||
if (!func.suspected_asm) {
|
||||
// first, find the prologue/epilogue
|
||||
func.analyze_prologue(data.linked_data);
|
||||
}
|
||||
|
||||
if (!func.suspected_asm) {
|
||||
// run analysis
|
||||
|
||||
// build a control flow graph, just looking at branch instructions.
|
||||
func.cfg = build_cfg(data.linked_data, segment_id, func, {}, {});
|
||||
|
||||
// convert individual basic blocks to sequences of IR Basic Ops
|
||||
for (auto& block : func.basic_blocks) {
|
||||
if (block.end_word > block.start_word) {
|
||||
auto label_id =
|
||||
data.linked_data.get_label_at(segment_id, (func.start_word + block.start_word) * 4);
|
||||
if (label_id != -1) {
|
||||
block.label_name = data.linked_data.get_label_name(label_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
asm_funcs++;
|
||||
}
|
||||
});
|
||||
|
||||
lg::info("Found {} functions ({} with no control flow)", total_functions,
|
||||
total_trivial_cfg_functions);
|
||||
lg::info("Named {}/{} functions ({:.3f}%)", total_named_functions, total_functions,
|
||||
100.f * float(total_named_functions) / float(total_functions));
|
||||
lg::info("Excluding {} asm functions", asm_funcs);
|
||||
lg::info("Written art group info: in {:.2f} ms\n", timer.getMs());
|
||||
}
|
||||
|
||||
void ObjectFileDB::dump_raw_objects(const std::string& output_dir) {
|
||||
@@ -796,4 +766,10 @@ void ObjectFileDB::dump_raw_objects(const std::string& output_dir) {
|
||||
file_util::write_binary_file(dest, data.data.data(), data.data.size());
|
||||
});
|
||||
}
|
||||
|
||||
std::string print_art_elt_for_dump(const std::string& group_name,
|
||||
const std::string& name,
|
||||
int idx) {
|
||||
return fmt::format("(def-art-elt {} {} {})\n", group_name, name, idx);
|
||||
}
|
||||
} // namespace decompiler
|
||||
|
||||
@@ -10,9 +10,10 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "LinkedObjectFile.h"
|
||||
#include "decompiler/util/DecompilerTypeSystem.h"
|
||||
#include "common/common_types.h"
|
||||
#include "LinkedObjectFile.h"
|
||||
#include "third-party/fmt/core.h"
|
||||
#include "decompiler/util/DecompilerTypeSystem.h"
|
||||
#include "decompiler/data/TextureDB.h"
|
||||
#include "decompiler/analysis/symbol_def_map.h"
|
||||
#include "common/util/Assert.h"
|
||||
@@ -46,6 +47,28 @@ struct ObjectFileData {
|
||||
std::string output_with_skips;
|
||||
};
|
||||
|
||||
/*!
|
||||
* Stats structure for let rewriting.
|
||||
*/
|
||||
struct LetRewriteStats {
|
||||
int dotimes;
|
||||
int countdown;
|
||||
int abs;
|
||||
int abs2;
|
||||
int unused;
|
||||
int ja;
|
||||
int case_no_else;
|
||||
int case_with_else;
|
||||
int set_vector;
|
||||
int set_vector2;
|
||||
int send_event;
|
||||
|
||||
int total() const {
|
||||
return dotimes + countdown + abs + abs2 + unused + ja + case_no_else + case_with_else +
|
||||
set_vector + set_vector2 + send_event;
|
||||
}
|
||||
};
|
||||
|
||||
class ObjectFileDB {
|
||||
public:
|
||||
ObjectFileDB(const std::vector<std::string>& _dgos,
|
||||
@@ -59,6 +82,8 @@ class ObjectFileDB {
|
||||
void process_labels();
|
||||
void find_code(const Config& config);
|
||||
void find_and_write_scripts(const std::string& output_dir);
|
||||
void extract_art_info();
|
||||
void dump_art_info(const std::string& output_dir);
|
||||
void dump_raw_objects(const std::string& output_dir);
|
||||
|
||||
void write_object_file_words(const std::string& output_dir, bool dump_data, bool dump_code);
|
||||
@@ -67,7 +92,6 @@ class ObjectFileDB {
|
||||
bool disassemble_code,
|
||||
bool print_hex);
|
||||
|
||||
void analyze_functions_ir1(const Config& config);
|
||||
void analyze_functions_ir2(
|
||||
const std::string& output_dir,
|
||||
const Config& config,
|
||||
@@ -209,10 +233,13 @@ class ObjectFileDB {
|
||||
SymbolMapBuilder map_builder;
|
||||
|
||||
struct {
|
||||
LetRewriteStats let;
|
||||
uint32_t total_dgo_bytes = 0;
|
||||
uint32_t total_obj_files = 0;
|
||||
uint32_t unique_obj_files = 0;
|
||||
uint32_t unique_obj_bytes = 0;
|
||||
} stats;
|
||||
};
|
||||
|
||||
std::string print_art_elt_for_dump(const std::string& group_name, const std::string& name, int idx);
|
||||
} // namespace decompiler
|
||||
|
||||
@@ -58,26 +58,28 @@ void ObjectFileDB::analyze_functions_ir2(
|
||||
ir2_do_segment_analysis_phase1(MAIN_SEGMENT, config, data);
|
||||
ir2_setup_labels(config, data);
|
||||
ir2_do_segment_analysis_phase2(TOP_LEVEL_SEGMENT, config, data);
|
||||
try {
|
||||
if (data.linked_data.functions_by_seg.size() == 3) {
|
||||
if (data.linked_data.functions_by_seg.size() == 3) {
|
||||
enum { DEFPART, DEFSTATE, DEFSKELGROUP } step = DEFPART;
|
||||
try {
|
||||
run_defpartgroup(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front());
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
lg::error("Failed to find defpartgroups: {}", e.what());
|
||||
}
|
||||
try {
|
||||
if (data.linked_data.functions_by_seg.size() == 3) {
|
||||
step = DEFSTATE;
|
||||
run_defstate(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front(), skip_states);
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
lg::error("Failed to find defstates: {}", e.what());
|
||||
}
|
||||
try {
|
||||
if (data.linked_data.functions_by_seg.size() == 3) {
|
||||
step = DEFSKELGROUP;
|
||||
run_defskelgroups(data.linked_data.functions_by_seg.at(TOP_LEVEL_SEGMENT).front());
|
||||
|
||||
} catch (const std::exception& e) {
|
||||
switch (step) {
|
||||
case DEFPART:
|
||||
lg::error("Failed to find defpartgroups: {}", e.what());
|
||||
break;
|
||||
case DEFSTATE:
|
||||
lg::error("Failed to find defstates: {}", e.what());
|
||||
break;
|
||||
case DEFSKELGROUP:
|
||||
lg::error("Failed to find defskelgroups: {}", e.what());
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
lg::error("Failed to find defskelgroups: {}", e.what());
|
||||
}
|
||||
ir2_do_segment_analysis_phase2(DEBUG_SEGMENT, config, data);
|
||||
ir2_do_segment_analysis_phase2(MAIN_SEGMENT, config, data);
|
||||
@@ -104,6 +106,20 @@ void ObjectFileDB::analyze_functions_ir2(
|
||||
fmt::print("Done in {:.2f}ms\n", file_timer.getMs());
|
||||
});
|
||||
|
||||
int total = stats.let.total();
|
||||
lg::info("LET REWRITE STATS: {} total", total);
|
||||
lg::info(" dotimes: {}", stats.let.dotimes);
|
||||
lg::info(" countdown: {}", stats.let.countdown);
|
||||
lg::info(" abs: {}", stats.let.abs);
|
||||
lg::info(" abs2: {}", stats.let.abs2);
|
||||
lg::info(" ja: {}", stats.let.ja);
|
||||
lg::info(" set_vector: {}", stats.let.set_vector);
|
||||
lg::info(" set_vector2: {}", stats.let.set_vector2);
|
||||
lg::info(" case_no_else: {}", stats.let.case_no_else);
|
||||
lg::info(" case_with_else: {}", stats.let.case_with_else);
|
||||
lg::info(" unused: {}", stats.let.unused);
|
||||
lg::info(" send_event: {}", stats.let.send_event);
|
||||
|
||||
if (config.generate_symbol_definition_map) {
|
||||
lg::info("Generating symbol definition map...");
|
||||
map_builder.build_map();
|
||||
@@ -403,6 +419,7 @@ Value try_lookup(const std::unordered_map<Key, Value>& map, const Key& key) {
|
||||
* - NOTE: this will update register info usage more accurately for functions.
|
||||
*/
|
||||
void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectFileData& data) {
|
||||
auto obj_name = data.to_unique_name();
|
||||
for_each_function_in_seg_in_obj(seg, data, [&](Function& func) {
|
||||
if (!func.suspected_asm) {
|
||||
TypeSpec ts;
|
||||
@@ -414,9 +431,11 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF
|
||||
auto register_casts =
|
||||
try_lookup(config.register_type_casts_by_function_by_atomic_op_idx, func_name);
|
||||
func.ir2.env.set_type_casts(register_casts);
|
||||
|
||||
auto stack_casts =
|
||||
try_lookup(config.stack_type_casts_by_function_by_stack_offset, func_name);
|
||||
func.ir2.env.set_stack_casts(stack_casts);
|
||||
|
||||
if (config.hacks.pair_functions_by_name.find(func_name) !=
|
||||
config.hacks.pair_functions_by_name.end()) {
|
||||
func.ir2.env.set_sloppy_pair_typing();
|
||||
@@ -426,8 +445,18 @@ void ObjectFileDB::ir2_type_analysis_pass(int seg, const Config& config, ObjectF
|
||||
config.hacks.reject_cond_to_value.end()) {
|
||||
func.ir2.env.aggressively_reject_cond_to_value_rewrite = true;
|
||||
}
|
||||
|
||||
func.ir2.env.set_stack_structure_hints(
|
||||
try_lookup(config.stack_structure_hints_by_function, func_name));
|
||||
|
||||
if (config.art_groups_by_function.find(func_name) != config.art_groups_by_function.end()) {
|
||||
func.ir2.env.set_art_group(config.art_groups_by_function.at(func_name));
|
||||
} else if (config.art_groups_by_file.find(obj_name) != config.art_groups_by_file.end()) {
|
||||
func.ir2.env.set_art_group(config.art_groups_by_file.at(obj_name));
|
||||
} else {
|
||||
func.ir2.env.set_art_group(obj_name + "-ag");
|
||||
}
|
||||
|
||||
if (run_type_analysis_ir2(ts, dts, func)) {
|
||||
func.ir2.env.types_succeeded = true;
|
||||
} else {
|
||||
@@ -446,7 +475,7 @@ void ObjectFileDB::ir2_register_usage_pass(int seg, ObjectFileData& data) {
|
||||
if (!func.suspected_asm && func.ir2.atomic_ops_succeeded) {
|
||||
func.ir2.env.set_reg_use(analyze_ir2_register_usage(func));
|
||||
|
||||
auto block_0_start = func.ir2.env.reg_use().block.at(0).input;
|
||||
auto& block_0_start = func.ir2.env.reg_use().block.at(0).input;
|
||||
std::vector<Register> dep_regs;
|
||||
for (auto x : block_0_start) {
|
||||
dep_regs.push_back(x);
|
||||
@@ -572,12 +601,14 @@ void ObjectFileDB::ir2_insert_lets(int seg, ObjectFileData& data) {
|
||||
for_each_function_in_seg_in_obj(seg, data, [&](Function& func) {
|
||||
if (func.ir2.expressions_succeeded) {
|
||||
try {
|
||||
insert_lets(func, func.ir2.env, *func.ir2.form_pool, func.ir2.top_form);
|
||||
insert_lets(func, func.ir2.env, *func.ir2.form_pool, func.ir2.top_form, stats.let);
|
||||
} catch (const std::exception& e) {
|
||||
func.warnings.general_warning(
|
||||
fmt::format("Error while inserting lets: {}. Make sure that the return type is not "
|
||||
"none if something is actually returned.",
|
||||
e.what()));
|
||||
const auto err = fmt::format(
|
||||
"Error while inserting lets: {}. Make sure that the return type is not "
|
||||
"none if something is actually returned.",
|
||||
e.what());
|
||||
lg::warn(err);
|
||||
func.warnings.general_warning(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -792,58 +792,417 @@ FormElement* rewrite_as_case_with_else(LetElement* in, const Env& env, FormPool&
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool var_name_equal(const Env& env, const std::string& a, std::optional<RegisterAccess> b) {
|
||||
ASSERT(b);
|
||||
return env.get_variable_name(*b) == a;
|
||||
}
|
||||
|
||||
Form* match_ja_set(const Env& env,
|
||||
const std::string& ch_var_name,
|
||||
const std::string& field_name,
|
||||
int arr_idx,
|
||||
Form* in,
|
||||
int* idx,
|
||||
bool* bad) {
|
||||
ASSERT(idx);
|
||||
ASSERT(bad);
|
||||
if (*idx >= in->size()) {
|
||||
// *bad = true;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto deref_matcher =
|
||||
arr_idx == -1
|
||||
? Matcher::deref(Matcher::any_reg(0), false, {DerefTokenMatcher::string(field_name)})
|
||||
: Matcher::deref(
|
||||
Matcher::any_reg(0), false,
|
||||
{DerefTokenMatcher::string(field_name), DerefTokenMatcher::integer(arr_idx)});
|
||||
auto mr = match(Matcher::set(deref_matcher, Matcher::any(1)), in->at(*idx));
|
||||
if (!mr.matched) {
|
||||
// TODO what if didn't match but it was some weird thing?? i guess later size checks fix that.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!var_name_equal(env, ch_var_name, mr.maps.regs.at(0))) {
|
||||
lg::error("[{}] JA MACRO ERROR channel var not {} in set {} {}", env.func->name(), ch_var_name,
|
||||
field_name, arr_idx);
|
||||
*bad = true;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
*idx += 1;
|
||||
return mr.maps.forms.at(1);
|
||||
}
|
||||
|
||||
void ja_push_form_to_args(const Env& env,
|
||||
FormPool& pool,
|
||||
std::vector<Form*>& args,
|
||||
Form* form,
|
||||
const std::string& key_name) {
|
||||
if (form) {
|
||||
auto text = form->to_form(env).print();
|
||||
if (text.length() > 50) {
|
||||
args.push_back(pool.form<ConstantTokenElement>(fmt::format(":{}", key_name)));
|
||||
args.push_back(form);
|
||||
} else {
|
||||
args.push_back(pool.form<ConstantTokenElement>(fmt::format(":{} {}", key_name, text)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Form* strip_cast(const std::string& type, Form* in) {
|
||||
auto casted = dynamic_cast<CastElement*>(in->try_as_single_element());
|
||||
if (casted && casted->type() == TypeSpec(type)) {
|
||||
in = casted->source();
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool) {
|
||||
// this function checks for the behemoth (ja) macro.
|
||||
|
||||
// TODO this should honestly just use its own custom element instead of GenericElement
|
||||
// since it would make analyzing after rewriting it MUCH easier, but I am kind of lazy right now
|
||||
|
||||
const static std::unordered_map<std::string, std::string> num_func_remap = {
|
||||
{"num-func-identity", "identity"}, {"num-func-+!", "+!"}, {"num-func--!", "-!"},
|
||||
{"num-func-loop!", "loop!"}, {"num-func-seek!", "seek!"}, {"num-func-chan", "chan"},
|
||||
{"num-func-blend-in!", "blend-in!"}, {"num-func-none", "none"}};
|
||||
|
||||
// should have this anyway, but double check so we don't throw this away.
|
||||
if (in->entries().size() != 1) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto test = in->to_form(env).print();
|
||||
|
||||
// look for setting a var to (-> self skel root-channel ,channel).
|
||||
// yes, channel is actually not always just 0!
|
||||
auto ra = in->entries().at(0).dest;
|
||||
auto var = env.get_variable_name(ra);
|
||||
auto mr_chan = match(
|
||||
Matcher::deref(Matcher::s6(), false,
|
||||
{DerefTokenMatcher::string("skel"), DerefTokenMatcher::string("root-channel"),
|
||||
DerefTokenMatcher::any_expr_or_int(0)}),
|
||||
in->entries().at(0).src);
|
||||
if (!mr_chan.matched) {
|
||||
return nullptr;
|
||||
}
|
||||
auto channel_form = mr_chan.int_or_form_to_form(pool, 0);
|
||||
|
||||
// now we checks for set!'s. the actual contents of the macro are not very complicated to match.
|
||||
// there is just a LOT to match. and then to write!
|
||||
bool bad = false;
|
||||
int idx = 0;
|
||||
auto set_fi = match_ja_set(env, var, "frame-interp", -1, in->body(), &idx, &bad);
|
||||
auto set_dist = match_ja_set(env, var, "dist", -1, in->body(), &idx, &bad);
|
||||
auto set_fg = match_ja_set(env, var, "frame-group", -1, in->body(), &idx, &bad);
|
||||
auto set_p0 = match_ja_set(env, var, "param", 0, in->body(), &idx, &bad);
|
||||
auto set_p1 = match_ja_set(env, var, "param", 1, in->body(), &idx, &bad);
|
||||
auto set_nf = match_ja_set(env, var, "num-func", -1, in->body(), &idx, &bad);
|
||||
auto set_fn = match_ja_set(env, var, "frame-num", -1, in->body(), &idx, &bad);
|
||||
|
||||
// lastly, match the function call.
|
||||
enum { NO_FUNC, EVAL, NO_EVAL } func_status = NO_FUNC;
|
||||
Form* arg_group = nullptr;
|
||||
std::string arg_num_func;
|
||||
if (idx < in->body()->size()) {
|
||||
auto mr_func =
|
||||
match(Matcher::op(GenericOpMatcher::func(Matcher::any_symbol(3)),
|
||||
{Matcher::any_reg(0), Matcher::any(1), Matcher::any_symbol(2)}),
|
||||
in->body()->at(idx));
|
||||
if (mr_func.matched) {
|
||||
// NOTE : it's actually fine for there to be no func. we just forgo setting the num! param.
|
||||
if (!var_name_equal(env, var, mr_func.maps.regs.at(0))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
arg_group = mr_func.maps.forms.at(1);
|
||||
arg_num_func = mr_func.maps.strings.at(2);
|
||||
const auto& func_name = mr_func.maps.strings.at(3);
|
||||
if (func_name == "joint-control-channel-group!") {
|
||||
func_status = NO_EVAL;
|
||||
} else if (func_name == "joint-control-channel-group-eval!") {
|
||||
func_status = EVAL;
|
||||
} else {
|
||||
// wtf happened?
|
||||
lg::error("[{}] JA MACRO ERROR func name: {}", env.func->name(), func_name);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (num_func_remap.find(arg_num_func) == num_func_remap.end()) {
|
||||
lg::error("[{}] JA MACRO ERROR unknown num func: {}", env.func->name(), arg_num_func);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto group_lisp = strip_cast("art-joint-anim", arg_group)->to_form(env);
|
||||
if (group_lisp.is_symbol() && group_lisp.as_symbol()->name == "#f") {
|
||||
arg_group = nullptr;
|
||||
}
|
||||
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
// PSYCHE! there may actually be a second frame-num set. for some reason. sigh...
|
||||
auto set_fn2 = match_ja_set(env, var, "frame-num", -1, in->body(), &idx, &bad);
|
||||
|
||||
if (bad) {
|
||||
// an error occurred
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// check that we have nothing more
|
||||
if (in->body()->size() > idx) {
|
||||
lg::error("[{}] JA MACRO ERROR elts matched: {}/{}", env.func->name(), idx, in->body()->size());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// now check the arguments.
|
||||
if (set_fn && set_fn2) {
|
||||
lg::error("[{}] JA MACRO ERROR both frame nums: {}", env.func->name(),
|
||||
set_fn->to_form(env).print(), set_fn2->to_form(env).print());
|
||||
ASSERT(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (func_status != NO_FUNC && set_fg && arg_group) {
|
||||
ASSERT(set_fg->to_form(env) == arg_group->to_form(env));
|
||||
// lg::info("p0: {} p1: {} nf: {} fn: {}", !!set_p0, !!set_p1, !!set_nf, !!set_fn);
|
||||
}
|
||||
|
||||
auto form_fg = set_fg ? set_fg : arg_group;
|
||||
auto matcher_max_num = Matcher::cast(
|
||||
"float",
|
||||
Matcher::fixed_op(
|
||||
FixedOperatorKind::ADDITION,
|
||||
{form_fg
|
||||
? Matcher::deref(Matcher::any(1), false,
|
||||
{DerefTokenMatcher::string("data"), DerefTokenMatcher::integer(0),
|
||||
DerefTokenMatcher::string("length")})
|
||||
: Matcher::deref(
|
||||
Matcher::any_reg(0), false,
|
||||
{DerefTokenMatcher::string("frame-group"), DerefTokenMatcher::string("data"),
|
||||
DerefTokenMatcher::integer(0), DerefTokenMatcher::string("length")}),
|
||||
Matcher::integer(-1)}));
|
||||
|
||||
// DONE CHECKING EVERYTHING!!! Now write the goddamn macro.
|
||||
std::vector<Form*> args;
|
||||
|
||||
// check the channel arg
|
||||
auto channel_arg = channel_form->to_form(env);
|
||||
if (!channel_arg.is_int(0)) {
|
||||
ja_push_form_to_args(env, pool, args, channel_form, "chan");
|
||||
}
|
||||
|
||||
if (func_status != NO_FUNC) {
|
||||
// check the group! arg
|
||||
if (form_fg) {
|
||||
ja_push_form_to_args(env, pool, args, strip_cast("art-joint-anim", form_fg), "group!");
|
||||
}
|
||||
|
||||
const std::string prelim_num =
|
||||
num_func_remap.count(arg_num_func) == 0 ? "" : num_func_remap.at(arg_num_func);
|
||||
Form* num_form = nullptr;
|
||||
// check the num! arg
|
||||
if (prelim_num == "identity") {
|
||||
if (set_fn2) {
|
||||
auto obj_fn2 = set_fn2->to_form(env);
|
||||
if (obj_fn2.is_float(0.0)) {
|
||||
num_form = pool.form<ConstantTokenElement>("min");
|
||||
} else {
|
||||
auto mr = match(matcher_max_num, set_fn2);
|
||||
if (mr.matched &&
|
||||
((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) ||
|
||||
(!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) {
|
||||
num_form = pool.form<ConstantTokenElement>("max");
|
||||
} else {
|
||||
num_form = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>(prelim_num)),
|
||||
set_fn2);
|
||||
}
|
||||
}
|
||||
set_fn2 = nullptr;
|
||||
}
|
||||
} else if (prelim_num == "loop!" || prelim_num == "+!" || prelim_num == "-!") {
|
||||
if (set_p0) {
|
||||
auto obj_p0 = set_p0->to_form(env);
|
||||
if (obj_p0.is_float(1.0)) {
|
||||
num_form = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>(prelim_num)));
|
||||
} else {
|
||||
auto mr = match(matcher_max_num, set_p0);
|
||||
if (mr.matched &&
|
||||
((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) ||
|
||||
(!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) {
|
||||
num_form = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>(prelim_num)),
|
||||
pool.form<ConstantTokenElement>("max"));
|
||||
} else {
|
||||
num_form = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>(prelim_num)),
|
||||
set_p0);
|
||||
}
|
||||
}
|
||||
set_p0 = nullptr;
|
||||
}
|
||||
} else if (prelim_num == "chan") {
|
||||
if (set_p0) {
|
||||
auto obj_p0 = set_p0->to_form(env);
|
||||
if (obj_p0.is_float((goos::FloatType)((goos::IntType)obj_p0.as_float()))) {
|
||||
num_form = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("chan")),
|
||||
pool.form<SimpleAtomElement>(
|
||||
SimpleAtom::make_int_constant((goos::IntType)obj_p0.as_float())));
|
||||
} else {
|
||||
lg::error("[{}] JA MACRO ERROR bad chan arg: {}", env.func->name(), obj_p0.print());
|
||||
ASSERT_MSG(false, "chan case");
|
||||
}
|
||||
set_p0 = nullptr;
|
||||
}
|
||||
} else if (prelim_num == "seek!") {
|
||||
ASSERT(set_p0 && set_p1);
|
||||
std::vector<Form*> seek_args;
|
||||
|
||||
// (the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
// (the float (1- (-> ja-ch frame-group data 0 length)))
|
||||
auto mr = match(matcher_max_num, set_p0);
|
||||
if (!mr.matched || (form_fg && mr.maps.forms.at(1)->to_form(env) != form_fg->to_form(env)) ||
|
||||
(!form_fg && !var_name_equal(env, var, mr.maps.regs.at(0)))) {
|
||||
// did not match default
|
||||
seek_args.push_back(set_p0);
|
||||
}
|
||||
|
||||
auto obj_p1 = set_p1->to_form(env);
|
||||
if (!obj_p1.is_float(1.0)) {
|
||||
// did not match default
|
||||
if (seek_args.size() < 1) {
|
||||
seek_args.push_back(mr.matched ? pool.form<ConstantTokenElement>("max") : set_p0);
|
||||
}
|
||||
seek_args.push_back(set_p1);
|
||||
}
|
||||
|
||||
// do not print :param0 and :param1 keys
|
||||
set_p0 = nullptr;
|
||||
set_p1 = nullptr;
|
||||
|
||||
num_form = pool.form<GenericElement>(
|
||||
GenericOperator::make_function(pool.form<ConstantTokenElement>("seek!")), seek_args);
|
||||
}
|
||||
|
||||
if (!num_form) {
|
||||
num_form = pool.form<ConstantTokenElement>(prelim_num);
|
||||
}
|
||||
|
||||
ja_push_form_to_args(env, pool, args, num_form, "num!");
|
||||
} else if (form_fg) {
|
||||
ja_push_form_to_args(env, pool, args, strip_cast("art-joint-anim", form_fg), "group!");
|
||||
}
|
||||
|
||||
if (set_fn) {
|
||||
auto mr = match(matcher_max_num, set_fn);
|
||||
if (mr.matched && ((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) ||
|
||||
(!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) {
|
||||
set_fn = pool.form<ConstantTokenElement>("max");
|
||||
}
|
||||
}
|
||||
|
||||
// other generic args
|
||||
ja_push_form_to_args(env, pool, args, set_fi, "frame-interp");
|
||||
ja_push_form_to_args(env, pool, args, set_dist, "dist");
|
||||
// ja_push_form_to_args(env, pool, args, form_fg, "frame-group");
|
||||
ja_push_form_to_args(env, pool, args, set_p0, "param0");
|
||||
ja_push_form_to_args(env, pool, args, set_p1, "param1");
|
||||
ja_push_form_to_args(env, pool, args, set_nf, "num-func");
|
||||
ja_push_form_to_args(env, pool, args, set_fn, "frame-num");
|
||||
|
||||
// TODO
|
||||
if (set_fn2) {
|
||||
lg::error("[{}] JA MACRO ERROR ignoring frame-num 2: {}", env.func->name(),
|
||||
set_fn2->to_form(env).print());
|
||||
ASSERT(func_status != NO_FUNC && arg_num_func == "num-func-identity");
|
||||
return nullptr;
|
||||
}
|
||||
if (set_p0 || set_p1) {
|
||||
lg::error("[{}] JA MACRO ERROR something still using params: {}", env.func->name(), test);
|
||||
ASSERT(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_function(
|
||||
pool.form<ConstantTokenElement>(func_status == NO_EVAL ? "ja-no-eval" : "ja")),
|
||||
args);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Attempt to rewrite a let as another form. If it cannot be rewritten, this will return nullptr.
|
||||
*/
|
||||
FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool) {
|
||||
FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewriteStats& stats) {
|
||||
auto as_unused = rewrite_empty_let(in, env, pool);
|
||||
if (as_unused) {
|
||||
stats.unused++;
|
||||
return as_unused;
|
||||
}
|
||||
|
||||
auto as_joint_macro = rewrite_joint_macro(in, env, pool);
|
||||
if (as_joint_macro) {
|
||||
stats.ja++;
|
||||
return as_joint_macro;
|
||||
}
|
||||
|
||||
auto as_set_vector = rewrite_set_vector(in, env, pool);
|
||||
if (as_set_vector) {
|
||||
stats.set_vector++;
|
||||
return as_set_vector;
|
||||
}
|
||||
|
||||
auto as_dotimes = rewrite_as_dotimes(in, env, pool);
|
||||
if (as_dotimes) {
|
||||
stats.dotimes++;
|
||||
return as_dotimes;
|
||||
}
|
||||
|
||||
auto as_send_event = rewrite_as_send_event(in, env, pool);
|
||||
if (as_send_event) {
|
||||
stats.send_event++;
|
||||
return as_send_event;
|
||||
}
|
||||
|
||||
auto as_countdown = rewrite_as_countdown(in, env, pool);
|
||||
if (as_countdown) {
|
||||
stats.countdown++;
|
||||
return as_countdown;
|
||||
}
|
||||
|
||||
auto as_abs = fix_up_abs(in, env, pool);
|
||||
if (as_abs) {
|
||||
return as_abs;
|
||||
}
|
||||
|
||||
auto as_abs_2 = fix_up_abs_2(in, env, pool);
|
||||
if (as_abs_2) {
|
||||
return as_abs_2;
|
||||
}
|
||||
|
||||
auto as_unused = rewrite_empty_let(in, env, pool);
|
||||
if (as_unused) {
|
||||
return as_unused;
|
||||
}
|
||||
|
||||
auto as_case_no_else = rewrite_as_case_no_else(in, env, pool);
|
||||
if (as_case_no_else) {
|
||||
stats.case_no_else++;
|
||||
return as_case_no_else;
|
||||
}
|
||||
|
||||
auto as_case_with_else = rewrite_as_case_with_else(in, env, pool);
|
||||
if (as_case_with_else) {
|
||||
stats.case_with_else++;
|
||||
return as_case_with_else;
|
||||
}
|
||||
|
||||
auto as_set_vector = rewrite_set_vector(in, env, pool);
|
||||
if (as_set_vector) {
|
||||
return as_set_vector;
|
||||
}
|
||||
|
||||
auto as_set_vector2 = rewrite_set_vector_2(in, env, pool);
|
||||
if (as_set_vector2) {
|
||||
stats.set_vector2++;
|
||||
return as_set_vector2;
|
||||
}
|
||||
|
||||
auto as_send_event = rewrite_as_send_event(in, env, pool);
|
||||
if (as_send_event) {
|
||||
return as_send_event;
|
||||
auto as_abs_2 = fix_up_abs_2(in, env, pool);
|
||||
if (as_abs_2) {
|
||||
stats.abs2++;
|
||||
return as_abs_2;
|
||||
}
|
||||
|
||||
auto as_abs = fix_up_abs(in, env, pool);
|
||||
if (as_abs) {
|
||||
stats.abs++;
|
||||
return as_abs;
|
||||
}
|
||||
|
||||
// nothing matched.
|
||||
@@ -983,7 +1342,11 @@ bool register_can_hold_var(const Register& reg) {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_level_form) {
|
||||
LetStats insert_lets(const Function& func,
|
||||
Env& env,
|
||||
FormPool& pool,
|
||||
Form* top_level_form,
|
||||
LetRewriteStats& let_rewrite_stats) {
|
||||
(void)func;
|
||||
// if (func.name() != "(method 4 pair)") {
|
||||
// return {};
|
||||
@@ -1235,7 +1598,7 @@ LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_l
|
||||
for (auto& elt : f->elts()) {
|
||||
auto as_let = dynamic_cast<LetElement*>(elt);
|
||||
if (as_let) {
|
||||
auto rewritten = rewrite_let(as_let, env, pool);
|
||||
auto rewritten = rewrite_let(as_let, env, pool, let_rewrite_stats);
|
||||
if (rewritten) {
|
||||
rewritten->parent_form = f;
|
||||
elt = rewritten;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "decompiler/Function/Function.h"
|
||||
#include "decompiler/IR2/Env.h"
|
||||
#include "decompiler/IR2/Form.h"
|
||||
#include "decompiler/ObjectFile/ObjectFileDB.h"
|
||||
|
||||
namespace decompiler {
|
||||
|
||||
@@ -16,6 +17,10 @@ struct LetStats {
|
||||
}
|
||||
};
|
||||
|
||||
LetStats insert_lets(const Function& func, Env& env, FormPool& pool, Form* top_level_form);
|
||||
LetStats insert_lets(const Function& func,
|
||||
Env& env,
|
||||
FormPool& pool,
|
||||
Form* top_level_form,
|
||||
LetRewriteStats& let_stats);
|
||||
|
||||
} // namespace decompiler
|
||||
} // namespace decompiler
|
||||
|
||||
@@ -60,6 +60,7 @@ Config read_config_file(const std::string& path_to_config_file,
|
||||
config.process_tpages = cfg.at("process_tpages").get<bool>();
|
||||
config.process_game_text = cfg.at("process_game_text").get<bool>();
|
||||
config.process_game_count = cfg.at("process_game_count").get<bool>();
|
||||
config.process_art_groups = cfg.at("process_art_groups").get<bool>();
|
||||
config.hexdump_code = cfg.at("hexdump_code").get<bool>();
|
||||
config.hexdump_data = cfg.at("hexdump_data").get<bool>();
|
||||
config.dump_objs = cfg.at("dump_objs").get<bool>();
|
||||
@@ -225,6 +226,12 @@ Config read_config_file(const std::string& path_to_config_file,
|
||||
config.levels_to_extract = inputs_json.at("levels_to_extract").get<std::vector<std::string>>();
|
||||
config.levels_extract = cfg.at("levels_extract").get<bool>();
|
||||
|
||||
auto art_info_json = read_json_file_from_config(cfg, "art_info_file");
|
||||
config.art_groups_by_file =
|
||||
art_info_json.at("files").get<std::unordered_map<std::string, std::string>>();
|
||||
config.art_groups_by_function =
|
||||
art_info_json.at("functions").get<std::unordered_map<std::string, std::string>>();
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ struct Config {
|
||||
bool process_tpages = false;
|
||||
bool process_game_text = false;
|
||||
bool process_game_count = false;
|
||||
bool process_art_groups = false;
|
||||
bool rip_levels = false;
|
||||
bool extract_collision = false;
|
||||
|
||||
@@ -137,6 +138,9 @@ struct Config {
|
||||
bool levels_extract;
|
||||
|
||||
DecompileHacks hacks;
|
||||
|
||||
std::unordered_map<std::string, std::string> art_groups_by_file;
|
||||
std::unordered_map<std::string, std::string> art_groups_by_function;
|
||||
};
|
||||
|
||||
Config read_config_file(const std::string& path_to_config_file,
|
||||
|
||||
@@ -8076,7 +8076,7 @@
|
||||
)
|
||||
|
||||
(deftype skeleton-group (basic)
|
||||
((art-group-name basic :offset-assert 4)
|
||||
((art-group-name string :offset-assert 4)
|
||||
(jgeo int32 :offset-assert 8)
|
||||
(janim int32 :offset-assert 12)
|
||||
(bounds vector :inline :offset-assert 16)
|
||||
@@ -16369,8 +16369,8 @@
|
||||
(define-extern jacc-mem-usage (function joint-anim-compressed-control memory-usage-block int joint-anim-compressed-control))
|
||||
(define-extern joint-anim-inspect-elt (function joint-anim float joint-anim))
|
||||
(define-extern joint-anim-login (function joint-anim-drawable joint-anim-drawable))
|
||||
(define-extern joint-control-channel-eval (function joint-control-channel float))
|
||||
(define-extern joint-control-channel-eval! (function joint-control-channel (function joint-control-channel float float float) float))
|
||||
(define-extern joint-control-channel-eval (function joint-control-channel none))
|
||||
(define-extern joint-control-channel-eval! (function joint-control-channel (function joint-control-channel float float float) none))
|
||||
(define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
|
||||
(define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
|
||||
(define-extern joint-control-copy! (function joint-control joint-control joint-control))
|
||||
@@ -17831,7 +17831,7 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern ja-channel-push! (function int int int :behavior process-drawable))
|
||||
(define-extern ja-channel-push! (function int time-frame int :behavior process-drawable))
|
||||
(define-extern ja-channel-set! (function int int :behavior process-drawable))
|
||||
(define-extern kill-current-level-hint (function pair pair symbol none))
|
||||
(define-extern level-hint-surpress! (function none))
|
||||
@@ -20755,7 +20755,7 @@
|
||||
(define-extern target-hit-ground-anim (function symbol symbol :behavior target))
|
||||
(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target))
|
||||
(define-extern init-var-jump (function float float vector vector vector vector :behavior target)) ;; 1st and 2nd vectors may be symbols instead?
|
||||
(define-extern target-falling-anim (function time-frame int symbol :behavior target))
|
||||
(define-extern target-falling-anim (function time-frame time-frame symbol :behavior target))
|
||||
(define-extern target-falling-trans (function basic time-frame none :behavior target))
|
||||
(define-extern target-falling-anim-trans (function none :behavior target)) ;; unconfirmed
|
||||
|
||||
@@ -24662,7 +24662,7 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern lurkerworm-prebind-function (function process int lurkerworm none :behavior lurkerworm))
|
||||
(define-extern lurkerworm-prebind-function (function pointer int lurkerworm none :behavior lurkerworm))
|
||||
(define-extern lurkerworm-joint-callback (function lurkerworm none))
|
||||
(define-extern lurkerworm-default-event-handler (function process int symbol event-message-block object :behavior lurkerworm))
|
||||
(define-extern lurkerworm-default-post-behavior (function none :behavior lurkerworm))
|
||||
@@ -27681,7 +27681,7 @@
|
||||
(define-extern racer-buzz (function float none :behavior target))
|
||||
(define-extern target-racing-center-anim (function none :behavior target))
|
||||
(define-extern target-racing-turn-anim (function none :behavior target))
|
||||
(define-extern target-racing-jump-anim (function basic int none :behavior target))
|
||||
(define-extern target-racing-jump-anim (function basic time-frame none :behavior target))
|
||||
(define-extern target-racing-land-anim (function symbol none :behavior target))
|
||||
(define-extern target-racing-post (function none :behavior target))
|
||||
|
||||
@@ -33289,7 +33289,7 @@
|
||||
:flag-assert #x16004000b0
|
||||
(:methods
|
||||
(idle () _type_ :state 20)
|
||||
(active (basic symbol) _type_ :state 21)
|
||||
(active (handle symbol) _type_ :state 21)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
"process_game_text": true,
|
||||
// unpack game count to assets folder
|
||||
"process_game_count": true,
|
||||
// write goal imports for art groups
|
||||
"process_art_groups": true,
|
||||
|
||||
///////////////////////////
|
||||
// WEIRD OPTIONS
|
||||
@@ -56,7 +58,7 @@
|
||||
"hexdump_code": false,
|
||||
"hexdump_data": false,
|
||||
// dump raw obj files
|
||||
"dump_objs": true,
|
||||
"dump_objs": false,
|
||||
// print control flow graph
|
||||
"print_cfgs": false,
|
||||
|
||||
@@ -74,6 +76,7 @@
|
||||
"stack_structures_file": "decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc",
|
||||
"hacks_file": "decompiler/config/jak1_ntsc_black_label/hacks.jsonc",
|
||||
"inputs_file": "decompiler/config/jak1_ntsc_black_label/inputs.jsonc",
|
||||
"art_info_file": "decompiler/config/jak1_ntsc_black_label/art_info.jsonc",
|
||||
|
||||
// optional: a predetermined object file name map from a file.
|
||||
// this will make decompilation naming consistent even if you only run on some objects.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
//////////////////////
|
||||
// ART INFO
|
||||
//////////////////////
|
||||
|
||||
// defines what art group each file or function is using.
|
||||
// by default, the decompiler assumes to be the name of the current file + -ag
|
||||
// so you only need to specify it when that's not the case.
|
||||
// NOTE: it's fine to have a function and its file both in here. the function takes priority.
|
||||
|
||||
"files": {
|
||||
"target":"eichar-ag",
|
||||
"target2":"eichar-ag",
|
||||
"target-death":"eichar-ag",
|
||||
"powerups":"eichar-ag"
|
||||
},
|
||||
|
||||
"functions": {
|
||||
"(code target-warp-out)":"eichar-ag",
|
||||
"(code mistycannon-missile-idle)":"sack-ag",
|
||||
"(code billy-snack-eat)":"farthy-snack-ag",
|
||||
"(code plunger-lurker-plunge)":"plunger-lurker-ag",
|
||||
"(code plunger-lurker-flee)":"plunger-lurker-ag",
|
||||
"(code plunger-lurker-idle)":"plunger-lurker-ag"
|
||||
}
|
||||
}
|
||||
@@ -564,7 +564,7 @@
|
||||
],
|
||||
|
||||
"flying-lurker": [
|
||||
["L197", "(pointer uint32)", 26],
|
||||
["L197", "attack-info"],
|
||||
["L187", "vector"]
|
||||
],
|
||||
|
||||
|
||||
@@ -157,6 +157,11 @@ int main(int argc, char** argv) {
|
||||
config.write_hex_near_instructions);
|
||||
}
|
||||
|
||||
// process art groups (used in decompilation)
|
||||
if (config.decompile_code || config.process_art_groups) {
|
||||
db.extract_art_info();
|
||||
}
|
||||
|
||||
// main decompile.
|
||||
if (config.decompile_code) {
|
||||
db.analyze_functions_ir2(out_folder, config, {});
|
||||
@@ -168,6 +173,11 @@ int main(int argc, char** argv) {
|
||||
file_util::write_text_file(file_util::combine_path(out_folder, "all-syms.gc"),
|
||||
db.dts.dump_symbol_types());
|
||||
|
||||
// write art groups
|
||||
if (config.process_art_groups) {
|
||||
db.dump_art_info(out_folder);
|
||||
}
|
||||
|
||||
if (config.hexdump_code || config.hexdump_data) {
|
||||
db.write_object_file_words(out_folder, config.hexdump_data, config.hexdump_code);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class DecompilerTypeSystem {
|
||||
std::unordered_map<std::string, int> bad_format_strings;
|
||||
std::unordered_map<std::string, std::vector<std::vector<int>>>
|
||||
format_ops_with_dynamic_string_by_func_name;
|
||||
std::unordered_map<std::string, std::unordered_map<int, std::string>> art_group_info;
|
||||
|
||||
void add_symbol(const std::string& name) {
|
||||
if (symbols.find(name) == symbols.end()) {
|
||||
|
||||
@@ -1274,16 +1274,8 @@ goos::Object decompile_value(const TypeSpec& type,
|
||||
s64 value;
|
||||
memcpy(&value, bytes.data(), 8);
|
||||
|
||||
// only rewrite if exact.
|
||||
s64 seconds_int = value / (s64)TICKS_PER_SECOND;
|
||||
if (seconds_int * (s64)TICKS_PER_SECOND == value) {
|
||||
return pretty_print::to_symbol(fmt::format("(seconds {})", seconds_int));
|
||||
}
|
||||
double seconds = (double)value / TICKS_PER_SECOND;
|
||||
if (seconds * TICKS_PER_SECOND == value) {
|
||||
return pretty_print::to_symbol(fmt::format("(seconds {})", float_to_string(seconds, false)));
|
||||
}
|
||||
return pretty_print::to_symbol(fmt::format("#x{:x}", value));
|
||||
return pretty_print::to_symbol(
|
||||
fmt::format("(seconds {})", fixed_point_to_string(value, TICKS_PER_SECOND)));
|
||||
} else if (ts.tc(TypeSpec("uint64"), type)) {
|
||||
ASSERT(bytes.size() == 8);
|
||||
u64 value;
|
||||
|
||||
@@ -0,0 +1,371 @@
|
||||
(defglobalconstant all-import-files
|
||||
(
|
||||
"goal_src/import/fuel-cell-ag.gc"
|
||||
"goal_src/import/money-ag.gc"
|
||||
"goal_src/import/buzzer-ag.gc"
|
||||
"goal_src/import/ecovalve-ag.gc"
|
||||
"goal_src/import/crate-ag.gc"
|
||||
"goal_src/import/speaker-ag.gc"
|
||||
"goal_src/import/fuelcell-naked-ag.gc"
|
||||
"goal_src/import/eichar-ag.gc"
|
||||
"goal_src/import/sidekick-ag.gc"
|
||||
"goal_src/import/deathcam-ag.gc"
|
||||
"goal_src/import/babak-ag.gc"
|
||||
"goal_src/import/barrel-ag.gc"
|
||||
"goal_src/import/beachcam-ag.gc"
|
||||
"goal_src/import/bird-lady-ag.gc"
|
||||
"goal_src/import/bird-lady-beach-ag.gc"
|
||||
"goal_src/import/bladeassm-ag.gc"
|
||||
"goal_src/import/ecoventrock-ag.gc"
|
||||
"goal_src/import/flutflut-ag.gc"
|
||||
"goal_src/import/flutflutegg-ag.gc"
|
||||
"goal_src/import/grottopole-ag.gc"
|
||||
"goal_src/import/harvester-ag.gc"
|
||||
"goal_src/import/kickrock-ag.gc"
|
||||
"goal_src/import/lrocklrg-ag.gc"
|
||||
"goal_src/import/lurkercrab-ag.gc"
|
||||
"goal_src/import/lurkerpuppy-ag.gc"
|
||||
"goal_src/import/lurkerworm-ag.gc"
|
||||
"goal_src/import/mayor-ag.gc"
|
||||
"goal_src/import/mistycannon-ag.gc"
|
||||
"goal_src/import/orb-cache-top-ag.gc"
|
||||
"goal_src/import/pelican-ag.gc"
|
||||
"goal_src/import/sack-ag.gc"
|
||||
"goal_src/import/sculptor-ag.gc"
|
||||
"goal_src/import/sculptor-muse-ag.gc"
|
||||
"goal_src/import/seagull-ag.gc"
|
||||
"goal_src/import/sharkey-ag.gc"
|
||||
"goal_src/import/windmill-one-ag.gc"
|
||||
"goal_src/import/assistant-lavatube-end-ag.gc"
|
||||
"goal_src/import/bluesage-ag.gc"
|
||||
"goal_src/import/citadelcam-ag.gc"
|
||||
"goal_src/import/citb-arm-ag.gc"
|
||||
"goal_src/import/citb-arm-shoulder-ag.gc"
|
||||
"goal_src/import/citb-bunny-ag.gc"
|
||||
"goal_src/import/citb-button-ag.gc"
|
||||
"goal_src/import/citb-chain-plat-ag.gc"
|
||||
"goal_src/import/citb-chains-ag.gc"
|
||||
"goal_src/import/citb-coil-ag.gc"
|
||||
"goal_src/import/citb-disc-ag.gc"
|
||||
"goal_src/import/citb-donut-ag.gc"
|
||||
"goal_src/import/citb-drop-plat-ag.gc"
|
||||
"goal_src/import/citb-exit-plat-ag.gc"
|
||||
"goal_src/import/citb-firehose-ag.gc"
|
||||
"goal_src/import/citb-generator-ag.gc"
|
||||
"goal_src/import/citb-hose-ag.gc"
|
||||
"goal_src/import/citb-iris-door-ag.gc"
|
||||
"goal_src/import/citb-launcher-ag.gc"
|
||||
"goal_src/import/citb-robotboss-ag.gc"
|
||||
"goal_src/import/citb-rotatebox-ag.gc"
|
||||
"goal_src/import/citb-sagecage-ag.gc"
|
||||
"goal_src/import/citb-stopbox-ag.gc"
|
||||
"goal_src/import/evilbro-citadel-ag.gc"
|
||||
"goal_src/import/evilsis-citadel-ag.gc"
|
||||
"goal_src/import/green-sagecage-ag.gc"
|
||||
"goal_src/import/plat-citb-ag.gc"
|
||||
"goal_src/import/plat-eco-citb-ag.gc"
|
||||
"goal_src/import/redsage-ag.gc"
|
||||
"goal_src/import/warp-gate-switch-ag.gc"
|
||||
"goal_src/import/warpgate-ag.gc"
|
||||
"goal_src/import/yellowsage-ag.gc"
|
||||
"goal_src/import/baby-spider-ag.gc"
|
||||
"goal_src/import/cavecrystal-ag.gc"
|
||||
"goal_src/import/caveelevator-ag.gc"
|
||||
"goal_src/import/cavespatula-darkcave-ag.gc"
|
||||
"goal_src/import/cavetrapdoor-ag.gc"
|
||||
"goal_src/import/dark-crystal-ag.gc"
|
||||
"goal_src/import/mother-spider-ag.gc"
|
||||
"goal_src/import/spider-egg-ag.gc"
|
||||
"goal_src/import/water-anim-darkcave-ag.gc"
|
||||
"goal_src/import/darkecobomb-ag.gc"
|
||||
"goal_src/import/ecoclaw-ag.gc"
|
||||
"goal_src/import/finalbosscam-ag.gc"
|
||||
"goal_src/import/green-eco-lurker-ag.gc"
|
||||
"goal_src/import/greenshot-ag.gc"
|
||||
"goal_src/import/jak-white-ag.gc"
|
||||
"goal_src/import/light-eco-ag.gc"
|
||||
"goal_src/import/plat-eco-finalboss-ag.gc"
|
||||
"goal_src/import/power-left-ag.gc"
|
||||
"goal_src/import/power-right-ag.gc"
|
||||
"goal_src/import/powercellalt-ag.gc"
|
||||
"goal_src/import/redring-ag.gc"
|
||||
"goal_src/import/robotboss-ag.gc"
|
||||
"goal_src/import/robotboss-blueeco-ag.gc"
|
||||
"goal_src/import/robotboss-cinematic-ag.gc"
|
||||
"goal_src/import/robotboss-redeco-ag.gc"
|
||||
"goal_src/import/robotboss-yelloweco-ag.gc"
|
||||
"goal_src/import/silodoor-ag.gc"
|
||||
"goal_src/import/water-anim-finalboss-ag.gc"
|
||||
"goal_src/import/evilbro-ag.gc"
|
||||
"goal_src/import/evilsis-ag.gc"
|
||||
"goal_src/import/plant-boss-main+0-ag.gc"
|
||||
"goal_src/import/aphid-lurker-ag.gc"
|
||||
"goal_src/import/darkvine-ag.gc"
|
||||
"goal_src/import/eggtop-ag.gc"
|
||||
"goal_src/import/jng-iris-door-ag.gc"
|
||||
"goal_src/import/plant-boss-ag.gc"
|
||||
"goal_src/import/plat-flip-ag.gc"
|
||||
"goal_src/import/plat-jungleb-ag.gc"
|
||||
"goal_src/import/eichar-fish+0-ag.gc"
|
||||
"goal_src/import/accordian-ag.gc"
|
||||
"goal_src/import/bounceytarp-ag.gc"
|
||||
"goal_src/import/catch-fisha-ag.gc"
|
||||
"goal_src/import/catch-fishb-ag.gc"
|
||||
"goal_src/import/catch-fishc-ag.gc"
|
||||
"goal_src/import/fish-net-ag.gc"
|
||||
"goal_src/import/fisher-ag.gc"
|
||||
"goal_src/import/hopper-ag.gc"
|
||||
"goal_src/import/junglecam-ag.gc"
|
||||
"goal_src/import/junglefish-ag.gc"
|
||||
"goal_src/import/junglesnake-ag.gc"
|
||||
"goal_src/import/launcherdoor-ag.gc"
|
||||
"goal_src/import/logtrap-ag.gc"
|
||||
"goal_src/import/lurkerm-piston-ag.gc"
|
||||
"goal_src/import/lurkerm-tall-sail-ag.gc"
|
||||
"goal_src/import/maindoor-ag.gc"
|
||||
"goal_src/import/medres-firecanyon-ag.gc"
|
||||
"goal_src/import/periscope-ag.gc"
|
||||
"goal_src/import/plat-button-ag.gc"
|
||||
"goal_src/import/plat-eco-ag.gc"
|
||||
"goal_src/import/precurbridge-ag.gc"
|
||||
"goal_src/import/reflector-mirror-ag.gc"
|
||||
"goal_src/import/ropebridge-52-ag.gc"
|
||||
"goal_src/import/ropebridge-70-ag.gc"
|
||||
"goal_src/import/sidedoor-ag.gc"
|
||||
"goal_src/import/towertop-ag.gc"
|
||||
"goal_src/import/water-anim-jungle-ag.gc"
|
||||
"goal_src/import/eichar-racer+0-ag.gc"
|
||||
"goal_src/import/eichar-flut+0-ag.gc"
|
||||
"goal_src/import/eichar-tube+0-ag.gc"
|
||||
"goal_src/import/eichar-pole+0-ag.gc"
|
||||
"goal_src/import/eichar-ice+0-ag.gc"
|
||||
"goal_src/import/assistant-firecanyon-ag.gc"
|
||||
"goal_src/import/balloon-ag.gc"
|
||||
"goal_src/import/crate-darkeco-cluster-ag.gc"
|
||||
"goal_src/import/ef-plane-ag.gc"
|
||||
"goal_src/import/racer-ag.gc"
|
||||
"goal_src/import/spike-ag.gc"
|
||||
"goal_src/import/assistant-lavatube-start-ag.gc"
|
||||
"goal_src/import/chainmine-ag.gc"
|
||||
"goal_src/import/darkecobarrel-ag.gc"
|
||||
"goal_src/import/energyarm-ag.gc"
|
||||
"goal_src/import/energyball-ag.gc"
|
||||
"goal_src/import/energybase-ag.gc"
|
||||
"goal_src/import/energydoor-ag.gc"
|
||||
"goal_src/import/energyhub-ag.gc"
|
||||
"goal_src/import/lavaballoon-ag.gc"
|
||||
"goal_src/import/lavabase-ag.gc"
|
||||
"goal_src/import/lavafall-ag.gc"
|
||||
"goal_src/import/lavafallsewera-ag.gc"
|
||||
"goal_src/import/lavafallsewerb-ag.gc"
|
||||
"goal_src/import/lavashortcut-ag.gc"
|
||||
"goal_src/import/lavayellowtarp-ag.gc"
|
||||
"goal_src/import/water-anim-lavatube-ag.gc"
|
||||
"goal_src/import/driller-lurker-ag.gc"
|
||||
"goal_src/import/gnawer-ag.gc"
|
||||
"goal_src/import/launcherdoor-maincave-ag.gc"
|
||||
"goal_src/import/maincavecam-ag.gc"
|
||||
"goal_src/import/plat-ag.gc"
|
||||
"goal_src/import/spiderwebs-ag.gc"
|
||||
"goal_src/import/water-anim-maincave-ag.gc"
|
||||
"goal_src/import/water-anim-maincave-water-ag.gc"
|
||||
"goal_src/import/balloonlurker-ag.gc"
|
||||
"goal_src/import/boatpaddle-ag.gc"
|
||||
"goal_src/import/bonelurker-ag.gc"
|
||||
"goal_src/import/breakaway-left-ag.gc"
|
||||
"goal_src/import/breakaway-mid-ag.gc"
|
||||
"goal_src/import/breakaway-right-ag.gc"
|
||||
"goal_src/import/darkecocan-ag.gc"
|
||||
"goal_src/import/keg-ag.gc"
|
||||
"goal_src/import/keg-conveyor-ag.gc"
|
||||
"goal_src/import/keg-conveyor-paddle-ag.gc"
|
||||
"goal_src/import/mis-bone-bridge-ag.gc"
|
||||
"goal_src/import/mis-bone-platform-ag.gc"
|
||||
"goal_src/import/mistycam-ag.gc"
|
||||
"goal_src/import/muse-ag.gc"
|
||||
"goal_src/import/quicksandlurker-ag.gc"
|
||||
"goal_src/import/ropebridge-36-ag.gc"
|
||||
"goal_src/import/rounddoor-ag.gc"
|
||||
"goal_src/import/sidekick-human-ag.gc"
|
||||
"goal_src/import/silostep-ag.gc"
|
||||
"goal_src/import/teetertotter-ag.gc"
|
||||
"goal_src/import/water-anim-misty-ag.gc"
|
||||
"goal_src/import/wheel-ag.gc"
|
||||
"goal_src/import/windturbine-ag.gc"
|
||||
"goal_src/import/flying-lurker-ag.gc"
|
||||
"goal_src/import/medres-snow-ag.gc"
|
||||
"goal_src/import/ogre-bridge-ag.gc"
|
||||
"goal_src/import/ogre-bridgeend-ag.gc"
|
||||
"goal_src/import/ogre-isle-ag.gc"
|
||||
"goal_src/import/ogre-step-ag.gc"
|
||||
"goal_src/import/ogreboss-ag.gc"
|
||||
"goal_src/import/ogrecam-ag.gc"
|
||||
"goal_src/import/plunger-lurker-ag.gc"
|
||||
"goal_src/import/shortcut-boulder-ag.gc"
|
||||
"goal_src/import/tntbarrel-ag.gc"
|
||||
"goal_src/import/water-anim-ogre-ag.gc"
|
||||
"goal_src/import/cavecrusher-ag.gc"
|
||||
"goal_src/import/cavespatulatwo-ag.gc"
|
||||
"goal_src/import/water-anim-robocave-ag.gc"
|
||||
"goal_src/import/dark-plant-ag.gc"
|
||||
"goal_src/import/happy-plant-ag.gc"
|
||||
"goal_src/import/lightning-mole-ag.gc"
|
||||
"goal_src/import/pusher-ag.gc"
|
||||
"goal_src/import/race-ring-ag.gc"
|
||||
"goal_src/import/robber-ag.gc"
|
||||
"goal_src/import/rolling-start-ag.gc"
|
||||
"goal_src/import/rollingcam-ag.gc"
|
||||
"goal_src/import/water-anim-rolling-ag.gc"
|
||||
"goal_src/import/flut-saddle-ag.gc"
|
||||
"goal_src/import/flutflut-plat-large-ag.gc"
|
||||
"goal_src/import/flutflut-plat-med-ag.gc"
|
||||
"goal_src/import/flutflut-plat-small-ag.gc"
|
||||
"goal_src/import/ice-cube-ag.gc"
|
||||
"goal_src/import/ice-cube-break-ag.gc"
|
||||
"goal_src/import/ram-ag.gc"
|
||||
"goal_src/import/ram-boss-ag.gc"
|
||||
"goal_src/import/snow-ball-ag.gc"
|
||||
"goal_src/import/snow-bridge-36-ag.gc"
|
||||
"goal_src/import/snow-bumper-ag.gc"
|
||||
"goal_src/import/snow-bunny-ag.gc"
|
||||
"goal_src/import/snow-button-ag.gc"
|
||||
"goal_src/import/snow-eggtop-ag.gc"
|
||||
"goal_src/import/snow-fort-gate-ag.gc"
|
||||
"goal_src/import/snow-gears-ag.gc"
|
||||
"goal_src/import/snow-log-ag.gc"
|
||||
"goal_src/import/snow-spatula-ag.gc"
|
||||
"goal_src/import/snow-switch-ag.gc"
|
||||
"goal_src/import/snowcam-ag.gc"
|
||||
"goal_src/import/snowpusher-ag.gc"
|
||||
"goal_src/import/yeti-ag.gc"
|
||||
"goal_src/import/blue-eco-charger-ag.gc"
|
||||
"goal_src/import/blue-eco-charger-orb-ag.gc"
|
||||
"goal_src/import/bully-ag.gc"
|
||||
"goal_src/import/floating-launcher-ag.gc"
|
||||
"goal_src/import/helix-button-ag.gc"
|
||||
"goal_src/import/helix-slide-door-ag.gc"
|
||||
"goal_src/import/shover-ag.gc"
|
||||
"goal_src/import/steam-cap-ag.gc"
|
||||
"goal_src/import/sunkencam-ag.gc"
|
||||
"goal_src/import/sunkenfisha-ag.gc"
|
||||
"goal_src/import/wall-plat-ag.gc"
|
||||
"goal_src/import/water-anim-sunken-ag.gc"
|
||||
"goal_src/import/water-anim-sunken-dark-eco-ag.gc"
|
||||
"goal_src/import/double-lurker-ag.gc"
|
||||
"goal_src/import/double-lurker-top-ag.gc"
|
||||
"goal_src/import/exit-chamber-ag.gc"
|
||||
"goal_src/import/generic-button-ag.gc"
|
||||
"goal_src/import/orbit-plat-ag.gc"
|
||||
"goal_src/import/orbit-plat-bottom-ag.gc"
|
||||
"goal_src/import/plat-sunken-ag.gc"
|
||||
"goal_src/import/puffer-ag.gc"
|
||||
"goal_src/import/qbert-plat-ag.gc"
|
||||
"goal_src/import/qbert-plat-on-ag.gc"
|
||||
"goal_src/import/seaweed-ag.gc"
|
||||
"goal_src/import/side-to-side-plat-ag.gc"
|
||||
"goal_src/import/square-platform-ag.gc"
|
||||
"goal_src/import/sun-iris-door-ag.gc"
|
||||
"goal_src/import/wedge-plat-ag.gc"
|
||||
"goal_src/import/wedge-plat-outer-ag.gc"
|
||||
"goal_src/import/whirlpool-ag.gc"
|
||||
"goal_src/import/balance-plat-ag.gc"
|
||||
"goal_src/import/billy-ag.gc"
|
||||
"goal_src/import/billy-sidekick-ag.gc"
|
||||
"goal_src/import/farthy-snack-ag.gc"
|
||||
"goal_src/import/kermit-ag.gc"
|
||||
"goal_src/import/swamp-bat-ag.gc"
|
||||
"goal_src/import/swamp-rat-ag.gc"
|
||||
"goal_src/import/swamp-rat-nest-ag.gc"
|
||||
"goal_src/import/swamp-rock-ag.gc"
|
||||
"goal_src/import/swamp-spike-ag.gc"
|
||||
"goal_src/import/swampcam-ag.gc"
|
||||
"goal_src/import/tar-plat-ag.gc"
|
||||
"goal_src/import/logo-ag.gc"
|
||||
"goal_src/import/logo-black-ag.gc"
|
||||
"goal_src/import/logo-cam-ag.gc"
|
||||
"goal_src/import/logo-volumes-ag.gc"
|
||||
"goal_src/import/ndi-ag.gc"
|
||||
"goal_src/import/ndi-cam-ag.gc"
|
||||
"goal_src/import/ndi-volumes-ag.gc"
|
||||
"goal_src/import/pontoonfive-ag.gc"
|
||||
"goal_src/import/scarecrow-a-ag.gc"
|
||||
"goal_src/import/scarecrow-b-ag.gc"
|
||||
"goal_src/import/trainingcam-ag.gc"
|
||||
"goal_src/import/water-anim-training-ag.gc"
|
||||
"goal_src/import/assistant-ag.gc"
|
||||
"goal_src/import/evilplant-ag.gc"
|
||||
"goal_src/import/explorer-ag.gc"
|
||||
"goal_src/import/farmer-ag.gc"
|
||||
"goal_src/import/fishermans-boat-ag.gc"
|
||||
"goal_src/import/hutlamp-ag.gc"
|
||||
"goal_src/import/mayorgears-ag.gc"
|
||||
"goal_src/import/medres-beach-ag.gc"
|
||||
"goal_src/import/medres-beach1-ag.gc"
|
||||
"goal_src/import/medres-beach2-ag.gc"
|
||||
"goal_src/import/medres-beach3-ag.gc"
|
||||
"goal_src/import/medres-jungle-ag.gc"
|
||||
"goal_src/import/medres-jungle1-ag.gc"
|
||||
"goal_src/import/medres-jungle2-ag.gc"
|
||||
"goal_src/import/medres-misty-ag.gc"
|
||||
"goal_src/import/medres-training-ag.gc"
|
||||
"goal_src/import/medres-village11-ag.gc"
|
||||
"goal_src/import/medres-village12-ag.gc"
|
||||
"goal_src/import/medres-village13-ag.gc"
|
||||
"goal_src/import/oracle-ag.gc"
|
||||
"goal_src/import/reflector-middle-ag.gc"
|
||||
"goal_src/import/revcycle-ag.gc"
|
||||
"goal_src/import/revcycleprop-ag.gc"
|
||||
"goal_src/import/ropebridge-32-ag.gc"
|
||||
"goal_src/import/sage-ag.gc"
|
||||
"goal_src/import/sagesail-ag.gc"
|
||||
"goal_src/import/villa-starfish-ag.gc"
|
||||
"goal_src/import/village-cam-ag.gc"
|
||||
"goal_src/import/village1cam-ag.gc"
|
||||
"goal_src/import/water-anim-village1-ag.gc"
|
||||
"goal_src/import/windmill-sail-ag.gc"
|
||||
"goal_src/import/windspinner-ag.gc"
|
||||
"goal_src/import/yakow-ag.gc"
|
||||
"goal_src/import/allpontoons-ag.gc"
|
||||
"goal_src/import/assistant-village2-ag.gc"
|
||||
"goal_src/import/ceilingflag-ag.gc"
|
||||
"goal_src/import/exit-chamber-dummy-ag.gc"
|
||||
"goal_src/import/fireboulder-ag.gc"
|
||||
"goal_src/import/flutflut-bluehut-ag.gc"
|
||||
"goal_src/import/gambler-ag.gc"
|
||||
"goal_src/import/geologist-ag.gc"
|
||||
"goal_src/import/jaws-ag.gc"
|
||||
"goal_src/import/medres-rolling-ag.gc"
|
||||
"goal_src/import/medres-rolling1-ag.gc"
|
||||
"goal_src/import/medres-village2-ag.gc"
|
||||
"goal_src/import/ogreboss-village2-ag.gc"
|
||||
"goal_src/import/pontoonten-ag.gc"
|
||||
"goal_src/import/precursor-arm-ag.gc"
|
||||
"goal_src/import/sage-bluehut-ag.gc"
|
||||
"goal_src/import/sunken-elevator-ag.gc"
|
||||
"goal_src/import/swamp-blimp-ag.gc"
|
||||
"goal_src/import/swamp-rope-ag.gc"
|
||||
"goal_src/import/swamp-tetherrock-ag.gc"
|
||||
"goal_src/import/swamp-tetherrock-explode-ag.gc"
|
||||
"goal_src/import/village2cam-ag.gc"
|
||||
"goal_src/import/warrior-ag.gc"
|
||||
"goal_src/import/water-anim-village2-ag.gc"
|
||||
"goal_src/import/assistant-village3-ag.gc"
|
||||
"goal_src/import/cavegem-ag.gc"
|
||||
"goal_src/import/evilbro-village3-ag.gc"
|
||||
"goal_src/import/evilsis-village3-ag.gc"
|
||||
"goal_src/import/gondola-ag.gc"
|
||||
"goal_src/import/gondolacables-ag.gc"
|
||||
"goal_src/import/lavaspoutdrip-ag.gc"
|
||||
"goal_src/import/medres-finalboss-ag.gc"
|
||||
"goal_src/import/medres-ogre-ag.gc"
|
||||
"goal_src/import/medres-ogre2-ag.gc"
|
||||
"goal_src/import/medres-ogre3-ag.gc"
|
||||
"goal_src/import/minecartsteel-ag.gc"
|
||||
"goal_src/import/minershort-ag.gc"
|
||||
"goal_src/import/minertall-ag.gc"
|
||||
"goal_src/import/pistons-ag.gc"
|
||||
"goal_src/import/sage-village3-ag.gc"
|
||||
"goal_src/import/vil3-bridge-36-ag.gc"
|
||||
"goal_src/import/water-anim-village3-ag.gc"
|
||||
)
|
||||
)
|
||||
@@ -572,19 +572,17 @@
|
||||
|
||||
(defun joint-control-channel-eval ((arg0 joint-control-channel))
|
||||
"Run the joint control num-func callback, remember the current time"
|
||||
(let ((f0-2 ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1))))
|
||||
(set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
f0-2
|
||||
)
|
||||
((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1))
|
||||
(set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun joint-control-channel-eval! ((arg0 joint-control-channel) (arg1 (function joint-control-channel float float float)))
|
||||
"Set the joint control num-func, and evaluate it."
|
||||
(set! (-> arg0 num-func) arg1)
|
||||
(let ((f0-2 (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1))))
|
||||
(set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
f0-2
|
||||
)
|
||||
(arg1 arg0 (-> arg0 param 0) (-> arg0 param 1))
|
||||
(set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter)))
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun joint-control-channel-group-eval! ((arg0 joint-control-channel) (arg1 art-joint-anim) (arg2 (function joint-control-channel float float float)))
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(local-vars (sv-160 cam-rotation-tracker))
|
||||
(while #t
|
||||
(loop
|
||||
(when (and (zero? (logand (-> *camera* master-options) 2)) (!= (-> self tracking-status) 0))
|
||||
(set! (-> self tracking-status) (the-as uint 0))
|
||||
0
|
||||
|
||||
@@ -215,7 +215,7 @@
|
||||
(sv-288 int)
|
||||
)
|
||||
(let ((s4-0 0))
|
||||
(while #t
|
||||
(loop
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data)
|
||||
arg0
|
||||
@@ -3761,7 +3761,7 @@
|
||||
(defstate cam-layout-active (cam-layout)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(cam-layout-entity-info (the-as entity-actor (-> self cam-entity)))
|
||||
(cam-layout-entity-volume-info)
|
||||
(cam-layout-do-menu *clm*)
|
||||
|
||||
@@ -526,7 +526,7 @@
|
||||
(defun in-cam-entity-volume? ((arg0 vector) (arg1 entity) (arg2 float) (arg3 symbol))
|
||||
(local-vars (sv-16 res-tag))
|
||||
(let ((s2-0 0))
|
||||
(while #t
|
||||
(loop
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(let ((v1-1 (the-as object ((method-of-type res-lump get-property-data)
|
||||
arg1
|
||||
@@ -1621,7 +1621,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (and *dproc* *debug-segment*)
|
||||
(add-frame
|
||||
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
|
||||
@@ -1686,7 +1686,7 @@
|
||||
(defstate list-keeper-active (camera-master)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(change-to-last-brother self)
|
||||
(suspend)
|
||||
)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((s5-0 (new-stack-vector0))
|
||||
(gp-0 (new-stack-vector0))
|
||||
)
|
||||
@@ -415,7 +415,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((a2-0 (-> *camera* local-down)))
|
||||
(if (logtest? (-> self options) 8)
|
||||
(set! a2-0 (the-as vector #f))
|
||||
@@ -508,7 +508,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not *camera-orbit-target*)
|
||||
(cam-slave-go cam-free-floating)
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> self trans quad) (-> self saved-pt quad))
|
||||
@@ -87,7 +87,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(format *stdcon* "ERROR <GMJ>: stayed in cam-fixed-read-entity~%")
|
||||
(suspend)
|
||||
)
|
||||
@@ -125,7 +125,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(vector<-cspace!
|
||||
(-> self trans)
|
||||
@@ -207,7 +207,7 @@
|
||||
)
|
||||
(vector-normalize-copy! s5-0 (-> v1-11 vector 2) (the-as float 1.0))
|
||||
)
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(let ((s0-0
|
||||
(-> (the-as pov-camera (-> *camera* pov-handle process 0))
|
||||
@@ -286,7 +286,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not (paused?))
|
||||
(vector<-cspace!
|
||||
(-> self trans)
|
||||
@@ -357,7 +357,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(cam-calc-follow! (-> self tracking) (-> self trans) #t)
|
||||
(cam-standoff-calc-trans)
|
||||
@@ -409,7 +409,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(format *stdcon* "ERROR <GMJ>: stayed in cam-standoff-read-entity~%")
|
||||
(suspend)
|
||||
)
|
||||
@@ -479,7 +479,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(let ((gp-0 (-> *display* base-frame-counter)))
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(let ((s4-0 (vector-reset! (new-stack-vector0)))
|
||||
(s5-0 (new-stack-matrix0))
|
||||
@@ -649,7 +649,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(let ((s5-0 (vector-reset! (new-stack-vector0)))
|
||||
(s4-0 (vector-reset! (new-stack-vector0)))
|
||||
@@ -822,7 +822,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(cam-calc-follow! (-> self tracking) (-> self trans) #t)
|
||||
(new 'stack 'curve)
|
||||
@@ -856,7 +856,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(let ((s5-0 (new-stack-vector0))
|
||||
(gp-0 (new-stack-vector0))
|
||||
@@ -925,7 +925,7 @@
|
||||
(init! gp-0 s4-0 (the-as float 81.92) (fmax 819.2 (vector-length s5-0)) (the-as float 0.75))
|
||||
(set! (-> gp-0 vel quad) (-> s5-0 quad))
|
||||
)
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(set! (-> gp-0 target x) (-> (target-pos 0) x))
|
||||
(set! (-> gp-0 target z) (-> (target-pos 0) z))
|
||||
@@ -1224,7 +1224,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not (paused?))
|
||||
(cam-circular-code)
|
||||
)
|
||||
@@ -1254,7 +1254,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
@@ -1286,7 +1286,7 @@
|
||||
)
|
||||
(vector--float*! s5-0 s5-0 (-> *camera* local-down) (-> *CAMERA-bank* default-string-min-y))
|
||||
(set! (-> arg0 quad) (-> s5-0 quad))
|
||||
(while #t
|
||||
(loop
|
||||
(vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* target-height))
|
||||
(if (< (fill-and-probe-using-line-sphere
|
||||
*collide-cache*
|
||||
@@ -2979,7 +2979,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(set-string-parms)
|
||||
(cam-string-code)
|
||||
@@ -3215,7 +3215,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not (paused?))
|
||||
(cam-stick-code)
|
||||
)
|
||||
@@ -3382,7 +3382,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not (paused?))
|
||||
(cam-bike-code)
|
||||
)
|
||||
|
||||
@@ -73,40 +73,16 @@
|
||||
|
||||
(defbehavior pov-camera-play-and-reposition pov-camera ((arg0 art-joint-anim) (arg1 vector) (arg2 float))
|
||||
(let ((s4-0 #f))
|
||||
(let ((v1-2 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-2 frame-group) arg0)
|
||||
(set! (-> v1-2 param 0) (the float (+ (-> arg0 data 0 length) -1)))
|
||||
(set! (-> v1-2 param 1) arg2)
|
||||
(set! (-> v1-2 frame-num) 0.0)
|
||||
(joint-control-channel-group! v1-2 arg0 num-func-seek!)
|
||||
)
|
||||
(ja-no-eval :group! arg0 :num! (seek! max arg2) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(let ((v1-4 (and (not s4-0) (< (the float (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
0
|
||||
length
|
||||
)
|
||||
-4
|
||||
)
|
||||
)
|
||||
(ja-frame-num 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-4 (and (not s4-0) (< (the float (+ (-> (ja-group) data 0 length) -4)) (ja-frame-num 0)))))
|
||||
(when v1-4
|
||||
(set! s4-0 #t)
|
||||
(send-event *camera* 'teleport-to-vector-start-string arg1)
|
||||
)
|
||||
)
|
||||
(suspend)
|
||||
(let ((a0-4 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-4 param 1) arg2)
|
||||
(joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek! max arg2))
|
||||
)
|
||||
)
|
||||
0
|
||||
@@ -151,40 +127,11 @@
|
||||
(push-setting! *setting-control* self 'sfx-volume 'rel (-> self sfx-volume-movie) 0)
|
||||
(cond
|
||||
((= (-> self anim-name type) string)
|
||||
(let ((a0-4 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-4 frame-group) (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
0
|
||||
length
|
||||
)
|
||||
-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-4 param 1) 1.0)
|
||||
(set! (-> a0-4 frame-num) 0.0)
|
||||
(joint-control-channel-group!
|
||||
a0-4
|
||||
(if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
num-func-seek!
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(check-for-abort self)
|
||||
(suspend)
|
||||
(let ((a0-6 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-6 param 0) (the float (+ (-> a0-6 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-6 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-6 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
)
|
||||
((= (-> self anim-name type) spool-anim)
|
||||
@@ -218,7 +165,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(set-blackout-frames (seconds 0.033333335))
|
||||
(set-blackout-frames (seconds 0.035))
|
||||
(suspend)
|
||||
(suspend)
|
||||
(go-virtual pov-camera-done-playing)
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
;; the "skeleton group" is defined in code and tells the engine
|
||||
;; how to actually use the art from the level data for this object.
|
||||
(deftype skeleton-group (basic)
|
||||
((art-group-name basic :offset-assert 4)
|
||||
((art-group-name string :offset-assert 4)
|
||||
(jgeo int32 :offset-assert 8)
|
||||
(janim int32 :offset-assert 12)
|
||||
(bounds vector :inline :offset-assert 16)
|
||||
@@ -384,11 +384,26 @@
|
||||
(-> obj skeleton bones 0 position)
|
||||
)
|
||||
|
||||
(desfun art-elt->index (ag-name elt-name)
|
||||
(if (number? elt-name)
|
||||
elt-name
|
||||
(let ((ag-info (assoc ag-name *art-info*)))
|
||||
(if (null? ag-info)
|
||||
-1
|
||||
(let ((elt-info (assoc elt-name (cdr ag-info))))
|
||||
(if (null? elt-info)
|
||||
-1
|
||||
(cadr elt-info))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro defskelgroup (name art-name joint-geom joint-anim lods
|
||||
&key (shadow 0)
|
||||
&key bounds
|
||||
&key longest-edge
|
||||
&key (longest-edge 0.0)
|
||||
&key (texture-level 0)
|
||||
&key (sort 0)
|
||||
&key (version 6) ;; do NOT use this!
|
||||
@@ -402,18 +417,18 @@
|
||||
:longest-edge ,longest-edge
|
||||
:version ,version
|
||||
:max-lod ,(- (length lods) 1)
|
||||
:shadow ,shadow
|
||||
:shadow ,(art-elt->index (string->symbol-format "{}-ag" art-name) shadow)
|
||||
:texture-level ,texture-level
|
||||
:sort ,sort
|
||||
)))
|
||||
;; set joint geometry and joint bones
|
||||
(set! (-> skel jgeo) ,joint-geom)
|
||||
(set! (-> skel janim) ,joint-anim)
|
||||
(set! (-> skel jgeo) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-geom))
|
||||
(set! (-> skel janim) ,(art-elt->index (string->symbol-format "{}-ag" art-name) joint-anim))
|
||||
|
||||
;; set lods
|
||||
,@(apply-i (lambda (x i)
|
||||
`(begin
|
||||
(set! (-> skel mgeo ,i) ,(car x))
|
||||
(set! (-> skel mgeo ,i) ,(art-elt->index (string->symbol-format "{}-ag" art-name) (car x)))
|
||||
(set! (-> skel lod-dist ,i) ,(cadr x))
|
||||
)
|
||||
) lods)
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
(let ((v1-88 (-> arg0 the-node)))
|
||||
"is this node the start of the list. #t = start"
|
||||
(when (not (not (-> v1-88 prev)))
|
||||
(while #t
|
||||
(loop
|
||||
(let ((v1-92 (-> arg0 the-node)))
|
||||
"return the previous node in the list"
|
||||
(let ((v1-93 (-> v1-92 prev)))
|
||||
@@ -272,7 +272,7 @@
|
||||
(let ((v1-107 (-> arg0 the-node)))
|
||||
"is this node the end of the list. #t = end"
|
||||
(when (not (not (-> v1-107 next)))
|
||||
(while #t
|
||||
(loop
|
||||
(let ((v1-111 (-> arg0 the-node)))
|
||||
"return the next node in the list"
|
||||
(let ((v1-112 (-> v1-111 next)))
|
||||
@@ -429,10 +429,10 @@
|
||||
|
||||
(defun anim-tester-num-print ((arg0 basic) (arg1 float))
|
||||
(cond
|
||||
((= arg1 (-> (new 'static 'array float 1 -2.0) 0))
|
||||
((= arg1 -2.0)
|
||||
(format arg0 "max")
|
||||
)
|
||||
((= arg1 (-> (new 'static 'array float 1 -1.0) 0))
|
||||
((= arg1 -1.0)
|
||||
(format arg0 "min")
|
||||
)
|
||||
(else
|
||||
@@ -565,8 +565,8 @@
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) privname) arg1)
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) speed) 100)
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) blend) 0)
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) first-frame) (-> (new 'static 'array float 1 -1.0) 0))
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) last-frame) (-> (new 'static 'array float 1 -2.0) 0))
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) first-frame) -1.0)
|
||||
(set! (-> (the-as anim-test-seq-item v0-0) last-frame) -2.0)
|
||||
(the-as anim-test-seq-item v0-0)
|
||||
)
|
||||
)
|
||||
@@ -722,10 +722,8 @@
|
||||
(defbehavior anim-tester-update-anim-info anim-tester ((arg0 anim-test-seq-item))
|
||||
(set! (-> self anim-first) (-> arg0 first-frame))
|
||||
(set! (-> self anim-last) (-> arg0 last-frame))
|
||||
(set! (-> self anim-gspeed) (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> self speed))))
|
||||
(set! (-> self anim-speed)
|
||||
(* (-> (new 'static 'array float 1 0.01) 0) (-> self anim-gspeed) (the float (-> arg0 speed)))
|
||||
)
|
||||
(set! (-> self anim-gspeed) (* 0.01 (the float (-> self speed))))
|
||||
(set! (-> self anim-speed) (* 0.01 (-> self anim-gspeed) (the float (-> arg0 speed))))
|
||||
(when (< (-> self anim-speed) 0.0)
|
||||
(set! (-> self anim-first) (-> arg0 last-frame))
|
||||
(set! (-> self anim-last) (-> arg0 first-frame))
|
||||
@@ -774,8 +772,8 @@
|
||||
(set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1))
|
||||
(set! (-> self draw lod-set lod 0 geo) a1-4)
|
||||
)
|
||||
(set! (-> self draw lod-set lod 0 dist) (-> (new 'static 'array float 1 4095996000.0) 0))
|
||||
(set! (-> self draw bounds w) (-> (new 'static 'array float 1 40960.0) 0))
|
||||
(set! (-> self draw lod-set lod 0 dist) 4095996000.0)
|
||||
(set! (-> self draw bounds w) 40960.0)
|
||||
(set! (-> self draw data-format) (the-as uint 1))
|
||||
(let ((v1-16 (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad)))
|
||||
(set! (-> self draw color-mult quad) v1-16)
|
||||
@@ -812,13 +810,13 @@
|
||||
(gp-0 (-> s3-0 base))
|
||||
)
|
||||
(cond
|
||||
((= arg1 (-> (new 'static 'array float 1 -1.0) 0))
|
||||
((= arg1 -1.0)
|
||||
(let ((s2-1 draw-string-adv))
|
||||
(format (clear *temp-string*) "~Smin" arg0)
|
||||
(s2-1 *temp-string* s3-0 arg3)
|
||||
)
|
||||
)
|
||||
((= arg1 (-> (new 'static 'array float 1 -2.0) 0))
|
||||
((= arg1 -2.0)
|
||||
(let ((s2-2 draw-string-adv))
|
||||
(format (clear *temp-string*) "~Smax" arg0)
|
||||
(s2-2 *temp-string* s3-0 arg3)
|
||||
@@ -1087,7 +1085,7 @@
|
||||
"is the list empty, #t = empty"
|
||||
(when (not (= (-> v1-15 tailpred) v1-15))
|
||||
(let ((v1-17 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index))))
|
||||
(while #t
|
||||
(loop
|
||||
"return the previous node in the list"
|
||||
(set! v1-17 (-> (the-as anim-test-obj v1-17) prev))
|
||||
(let ((a0-23 (the-as anim-test-obj v1-17)))
|
||||
@@ -1111,7 +1109,7 @@
|
||||
"is the list empty, #t = empty"
|
||||
(when (not (= (-> v1-21 tailpred) v1-21))
|
||||
(let ((v1-23 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index))))
|
||||
(while #t
|
||||
(loop
|
||||
"return the next node in the list"
|
||||
(set! v1-23 (-> (the-as anim-test-obj v1-23) next))
|
||||
(let ((a0-40 (the-as anim-test-obj v1-23)))
|
||||
@@ -1263,7 +1261,7 @@
|
||||
"is the list empty, #t = empty"
|
||||
(when (not (= (-> v1-17 tailpred) v1-17))
|
||||
(let ((v1-19 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index))))
|
||||
(while #t
|
||||
(loop
|
||||
"return the previous node in the list"
|
||||
(set! v1-19 (-> (the-as anim-test-sequence v1-19) prev))
|
||||
(let ((a0-24 (the-as anim-test-sequence v1-19)))
|
||||
@@ -1287,7 +1285,7 @@
|
||||
"is the list empty, #t = empty"
|
||||
(when (not (= (-> v1-23 tailpred) v1-23))
|
||||
(let ((v1-25 (glst-get-node-by-index (-> arg1 list) (-> arg1 highlight-index))))
|
||||
(while #t
|
||||
(loop
|
||||
"return the next node in the list"
|
||||
(set! v1-25 (-> (the-as anim-test-sequence v1-25) next))
|
||||
(let ((a0-42 (the-as anim-test-sequence v1-25)))
|
||||
@@ -1392,32 +1390,32 @@
|
||||
(cond
|
||||
((cpad-hold? 0 down)
|
||||
(cond
|
||||
((= arg0 (-> (new 'static 'array float 1 -2.0) 0))
|
||||
(set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg1))
|
||||
((= arg0 -2.0)
|
||||
(set! arg0 (+ -1.0 arg1))
|
||||
)
|
||||
((!= arg0 (-> (new 'static 'array float 1 -1.0) 0))
|
||||
(set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg0))
|
||||
((!= arg0 -1.0)
|
||||
(set! arg0 (+ -1.0 arg0))
|
||||
(if (< arg0 0.0)
|
||||
(set! arg0 (-> (new 'static 'array float 1 -1.0) 0))
|
||||
(set! arg0 (the-as float -1.0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((cpad-hold? 0 up)
|
||||
(cond
|
||||
((= arg0 (-> (new 'static 'array float 1 -1.0) 0))
|
||||
(set! arg0 (-> (new 'static 'array float 1 0.0) 0))
|
||||
((= arg0 -1.0)
|
||||
(set! arg0 (the-as float 0.0))
|
||||
)
|
||||
((!= arg0 (-> (new 'static 'array float 1 -2.0) 0))
|
||||
(set! arg0 (+ (-> (new 'static 'array float 1 1.0) 0) arg0))
|
||||
((!= arg0 -2.0)
|
||||
(set! arg0 (+ 1.0 arg0))
|
||||
(if (>= arg0 arg1)
|
||||
(set! arg0 (-> (new 'static 'array float 1 -2.0) 0))
|
||||
(set! arg0 (the-as float -2.0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
arg0
|
||||
(the-as float arg0)
|
||||
)
|
||||
|
||||
(defun anim-tester-pick-item-setup ((arg0 anim-test-seq-item) (arg1 anim-test-sequence))
|
||||
@@ -1501,7 +1499,7 @@
|
||||
*font-default-matrix*
|
||||
(-> arg1 xpos)
|
||||
(-> arg1 ypos)
|
||||
(-> (new 'static 'array float 1 0.0) 0)
|
||||
(the-as float 0.0)
|
||||
(the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index))
|
||||
15
|
||||
12
|
||||
@@ -2209,7 +2207,7 @@
|
||||
(s4-0 (-> arg0 playing-item))
|
||||
)
|
||||
(when (logtest? (-> v0-0 flags) 5)
|
||||
(while #t
|
||||
(loop
|
||||
(+! s4-0 1)
|
||||
(if (>= s4-0 (glst-num-elements (-> arg0 item-list)))
|
||||
(set! s4-0 0)
|
||||
@@ -2256,7 +2254,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence))
|
||||
(while #t
|
||||
(loop
|
||||
(logclear! (-> self flags) (anim-tester-flags fanimt0))
|
||||
(let ((v1-2 (-> self obj-list)))
|
||||
"is the list empty, #t = empty"
|
||||
@@ -2334,40 +2332,25 @@
|
||||
(s4-1
|
||||
(logior! (-> self flags) (anim-tester-flags fanimt0))
|
||||
(if (nonzero? (-> s5-1 blend))
|
||||
(ja-channel-push! 1 (the int (* (the float (-> s5-1 blend)) (-> self anim-gspeed))))
|
||||
(ja-channel-push! 1 (the-as time-frame (the int (* (the float (-> s5-1 blend)) (-> self anim-gspeed)))))
|
||||
(ja-channel-set! 1)
|
||||
)
|
||||
(cond
|
||||
((= (-> self anim-first) (-> (new 'static 'array float 1 -1.0) 0))
|
||||
(let ((s3-0 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval! s3-0 s4-1 num-func-identity)
|
||||
(set! (-> s3-0 frame-num) 0.0)
|
||||
)
|
||||
((= (-> self anim-first) -1.0)
|
||||
(ja :group! s4-1 :num! min)
|
||||
)
|
||||
((= (-> self anim-first) (-> (new 'static 'array float 1 -2.0) 0))
|
||||
(let ((s3-1 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval! s3-1 s4-1 num-func-identity)
|
||||
(set! (-> s3-1 frame-num) (the float (+ (-> s4-1 data 0 length) -1)))
|
||||
)
|
||||
((= (-> self anim-first) -2.0)
|
||||
(ja :group! s4-1 :num! max)
|
||||
)
|
||||
(else
|
||||
(let ((s3-2 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval! s3-2 s4-1 num-func-identity)
|
||||
(set! (-> s3-2 frame-num) (-> self anim-first))
|
||||
)
|
||||
(ja :group! s4-1 :num! (identity (-> self anim-first)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> s5-1 blend))
|
||||
(while (and (!= (-> self skel root-channel 0) (-> self skel channel)) (logtest? (-> s5-1 flags) 2))
|
||||
(when (logtest? (-> self flags) (anim-tester-flags fanimt5))
|
||||
(TODO-RENAME-9 (-> self align))
|
||||
(TODO-RENAME-10
|
||||
(-> self align)
|
||||
31
|
||||
(-> (new 'static 'array float 1 1.0) 0)
|
||||
(-> (new 'static 'array float 1 1.0) 0)
|
||||
(-> (new 'static 'array float 1 1.0) 0)
|
||||
)
|
||||
(TODO-RENAME-10 (-> self align) 31 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0))
|
||||
)
|
||||
(suspend)
|
||||
)
|
||||
@@ -2375,49 +2358,23 @@
|
||||
(until (ja-done? 0)
|
||||
(when (logtest? (-> self flags) (anim-tester-flags fanimt5))
|
||||
(TODO-RENAME-9 (-> self align))
|
||||
(TODO-RENAME-10
|
||||
(-> self align)
|
||||
31
|
||||
(-> (new 'static 'array float 1 1.0) 0)
|
||||
(-> (new 'static 'array float 1 1.0) 0)
|
||||
(-> (new 'static 'array float 1 1.0) 0)
|
||||
)
|
||||
(TODO-RENAME-10 (-> self align) 31 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0))
|
||||
)
|
||||
(suspend)
|
||||
(anim-tester-update-anim-info s5-1)
|
||||
(let ((v1-73 (= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0))))
|
||||
(let ((v1-73 (= (-> self anim-last) -2.0)))
|
||||
(cond
|
||||
((or v1-73 (>= (-> self anim-last) (-> self anim-first)))
|
||||
(cond
|
||||
((= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0))
|
||||
(let ((a0-42 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-42 param 0) (the float (+ (-> a0-42 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-42 param 1) (-> self anim-speed))
|
||||
(joint-control-channel-group-eval! a0-42 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((a0-43 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-43 param 0) (-> self anim-last))
|
||||
(set! (-> a0-43 param 1) (-> self anim-speed))
|
||||
(joint-control-channel-group-eval! a0-43 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(if (= (-> self anim-last) -2.0)
|
||||
(ja :num! (seek! max (-> self anim-speed)))
|
||||
(ja :num! (seek! (-> self anim-last) (-> self anim-speed)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> self anim-last) (-> (new 'static 'array float 1 -1.0) 0))
|
||||
(let ((a0-44 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-44 param 0) 0.0)
|
||||
(set! (-> a0-44 param 1) (-> self anim-speed))
|
||||
(joint-control-channel-group-eval! a0-44 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
((= (-> self anim-last) -1.0)
|
||||
(ja :num! (seek! 0.0 (-> self anim-speed)))
|
||||
)
|
||||
(else
|
||||
(let ((a0-45 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-45 param 0) (-> self anim-last))
|
||||
(set! (-> a0-45 param 1) (-> self anim-speed))
|
||||
(joint-control-channel-group-eval! a0-45 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek! (-> self anim-last) (-> self anim-speed)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2463,11 +2420,7 @@
|
||||
(set! (-> self list-con list-owner) (the-as uint self))
|
||||
(quaternion-identity! (-> self root quat))
|
||||
(vector-identity! (-> self root scale))
|
||||
(position-in-front-of-camera!
|
||||
(-> self root trans)
|
||||
(-> (new 'static 'array float 1 40960.0) 0)
|
||||
(-> (new 'static 'array float 1 4096.0) 0)
|
||||
)
|
||||
(position-in-front-of-camera! (-> self root trans) (the-as float 40960.0) (the-as float 4096.0))
|
||||
(set! (-> self event-hook) anim-tester-standard-event-handler)
|
||||
(anim-tester-reset)
|
||||
(go anim-tester-process)
|
||||
|
||||
@@ -4055,7 +4055,7 @@
|
||||
(new-dm-func (symbol->string (the-as symbol (car iter)))
|
||||
(-> (the-as symbol (car iter)) value)
|
||||
(lambda ((info level-load-info))
|
||||
(let ((tf (new 'stack 'transformq)))
|
||||
(let ((tf (new 'stack-no-clear 'transformq)))
|
||||
(set! (-> tf trans x) (-> info bsphere x))
|
||||
(set! (-> tf trans y) (-> info bsphere y))
|
||||
(set! (-> tf trans z) (-> info bsphere z))
|
||||
@@ -4492,16 +4492,6 @@
|
||||
(flag "uk-english" 6 dm-subtitle-language)
|
||||
)
|
||||
(flag "Discord RPC" #t ,(dm-lambda-boolean-flag (-> *pc-settings* discord-rpc?)))
|
||||
(menu "Game fixes"
|
||||
(flag "sagecage crash" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes crash-sagecage)))
|
||||
;(flag "memory crash" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes crash-dma)))
|
||||
;(flag "light eco crash" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes crash-light-eco)))
|
||||
;(flag "softlock pelican" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes lockout-pelican)))
|
||||
;(flag "softlock pipegame" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes lockout-pipegame)))
|
||||
;(flag "softlock gambler" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes lockout-gambler)))
|
||||
;(flag "fix movies" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes fix-movies)))
|
||||
;(flag "fix credits" #f ,(dm-lambda-boolean-flag (-> *pc-settings* fixes fix-credits)))
|
||||
)
|
||||
(menu "PS2 settings"
|
||||
;(flag "PS2 Load speed" #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-read-speed?)))
|
||||
(flag "PS2 Particles" #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-parts?)))
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
(defstate part-tester-idle (part-tester)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((gp-0 (entity-by-name *part-tester-name*)))
|
||||
(when gp-0
|
||||
(let ((s5-0 (-> gp-0 extra process)))
|
||||
|
||||
@@ -31,23 +31,17 @@
|
||||
(defstate viewer-process (viewer)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(let ((a0-0 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-0 frame-group) (-> self janim))
|
||||
(set! (-> a0-0 param 0) (the float (+ (-> self janim data 0 length) -1)))
|
||||
(set! (-> a0-0 param 1) 1.0)
|
||||
(set! (-> a0-0 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-0 (-> self janim) num-func-seek!)
|
||||
)
|
||||
(loop
|
||||
(ja-no-eval :group! (-> self janim)
|
||||
:num!
|
||||
(seek! (the float (+ (-> self janim data 0 length) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(TODO-RENAME-9 (-> self align))
|
||||
(TODO-RENAME-10 (-> self align) 31 1.0 1.0 1.0)
|
||||
(suspend)
|
||||
(let ((a0-3 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-3 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
|
||||
@@ -49,12 +49,7 @@
|
||||
|
||||
(defun num-func-+! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
|
||||
"Increment the frame number, taking into account the animation speed and current game rate."
|
||||
(let ((f0-1
|
||||
(+ (-> arg0 frame-num)
|
||||
(* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio))))))
|
||||
(set! (-> arg0 frame-num) f0-1)
|
||||
f0-1
|
||||
)
|
||||
@@ -62,12 +57,7 @@
|
||||
|
||||
(defun num-func--! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
|
||||
"Decrement the frame number, taking into account the animation speed and current game rate."
|
||||
(let ((f0-1
|
||||
(- (-> arg0 frame-num)
|
||||
(* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio))))))
|
||||
(set! (-> arg0 frame-num) f0-1)
|
||||
f0-1
|
||||
)
|
||||
@@ -79,25 +69,21 @@
|
||||
;; get the duration from the joint-animation-compressed.
|
||||
(let* ((duration (the float (+ (-> chan frame-group data 0 length) -1)))
|
||||
;; increment (also add a full duration to it, I guess to avoid issues if inc is negative and we're near the start.)
|
||||
(after-inc (+ (+ (-> chan frame-num) duration)
|
||||
(* inc (* (-> chan frame-group speed) (-> *display* time-adjust-ratio)))
|
||||
)
|
||||
(after-inc
|
||||
(+ (-> chan frame-num) duration (* inc (* (-> chan frame-group speed) (-> *display* time-adjust-ratio))))
|
||||
)
|
||||
;; wrap.
|
||||
(wrapped (- after-inc (* (the float (the int (/ after-inc duration))) duration)))
|
||||
)
|
||||
(set! (-> chan frame-num) wrapped)
|
||||
wrapped
|
||||
)
|
||||
(set! (-> chan frame-num) wrapped)
|
||||
wrapped
|
||||
)
|
||||
)
|
||||
|
||||
(defun num-func-seek! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
|
||||
"Seek toward arg1 by at most arg2 (taking into account speed etc)"
|
||||
(let ((f0-3 (seek
|
||||
(-> arg0 frame-num)
|
||||
arg1
|
||||
(* arg2 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio)))
|
||||
)
|
||||
(let ((f0-3
|
||||
(seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> *display* time-adjust-ratio))))
|
||||
)
|
||||
)
|
||||
;; set it twice, just to make sure.
|
||||
@@ -109,9 +95,7 @@
|
||||
|
||||
(defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float) (arg2 float))
|
||||
"Seek frame-interp toward 1. Once its there, do a joint-control-reset."
|
||||
(let* ((v0-0 (seek (-> arg0 frame-interp) 1.0 (* arg1 (-> *display* time-adjust-ratio))))
|
||||
(f30-0 (the-as float v0-0))
|
||||
)
|
||||
(let ((f30-0 (seek (-> arg0 frame-interp) 1.0 (* arg1 (-> *display* time-adjust-ratio)))))
|
||||
(set! (-> arg0 frame-interp) f30-0)
|
||||
(set! (-> arg0 frame-interp) f30-0)
|
||||
(if (= f30-0 1.0)
|
||||
|
||||
@@ -476,7 +476,7 @@
|
||||
)
|
||||
(let ((s4-0 (load-to-heap-by-name
|
||||
(-> s1-0 art-group)
|
||||
(the-as string (-> arg0 art-group-name))
|
||||
(-> arg0 art-group-name)
|
||||
#f
|
||||
global
|
||||
(-> arg0 version)
|
||||
@@ -700,6 +700,18 @@
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(defmacro ja-group (&key (chan 0))
|
||||
"get the frame group for self. default channel is 0, the base channel. returns #f if no frame group."
|
||||
`(if (> (-> self skel active-channels) ,chan)
|
||||
(-> self skel root-channel ,chan frame-group))
|
||||
)
|
||||
|
||||
(defmacro ja-group? (group &key (chan 0))
|
||||
"is self in this frame group on this channel? default is channel 0, which is the base channel."
|
||||
`(= (ja-group) ,group)
|
||||
)
|
||||
|
||||
(defbehavior ja-num-frames process-drawable ((arg0 int))
|
||||
(+ (-> self skel root-channel arg0 frame-group data 0 length) -1)
|
||||
)
|
||||
@@ -765,7 +777,7 @@
|
||||
arg0
|
||||
)
|
||||
|
||||
(defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 int))
|
||||
(defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 time-frame))
|
||||
(cond
|
||||
((or (zero? (-> self skel active-channels))
|
||||
(zero? arg1)
|
||||
@@ -875,6 +887,128 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro ja (&key (chan 0)
|
||||
&key (group! #f)
|
||||
&key (num! #f)
|
||||
&key (param0 #f)
|
||||
&key (param1 #f)
|
||||
&key (num-func #f)
|
||||
&key (frame-num #f)
|
||||
&key (frame-interp #f)
|
||||
&key (dist #f)
|
||||
&key (eval? #t)
|
||||
)
|
||||
"set various joint anim parameters for self and eval them.
|
||||
you can use this for playing animations!
|
||||
|
||||
chan = the channel to modify. defaults to 0 (base channel). this is usually what you want.
|
||||
group! = when not #f, set this as the new frame-group. defaults to #f
|
||||
num! = set the frame playback function. this is what determines what frame an animation is at. funcs below.
|
||||
#f = no func will be set, and there wont be a frame eval.
|
||||
num-func = sets the num-func field for the channel. this lets you change the function with eval'ing.
|
||||
param0 = 1st parameter for the playback function. ONLY USE THESE WITH num-func !!
|
||||
param1 = 2nd parameter for the playback function. ONLY USE THESE WITH num-func !!
|
||||
frame-num = set the frame-num field.
|
||||
frame-interp = set the frame-interp field.
|
||||
dist = set the dist field.
|
||||
|
||||
available num! functions:
|
||||
- (+!) = advance anim.
|
||||
- (-!) = reverse anim.
|
||||
- (identity num) = play 'num' frame.
|
||||
- (seek! target speed) = animate towards frame target at a speed.
|
||||
speed is optional and defaults to 1.0 when not provided.
|
||||
target is optional and defaults to the last frame of the animation.
|
||||
if you want to set the speed, you therefore must also set the target.
|
||||
target can be max (no quote), which is just the same as the default value.
|
||||
- (loop! speed) = loop animation at a speed. default speed is 1.0 when not provided.
|
||||
- (chan channel) = copy frame from another channel.
|
||||
- min = the start of the animation.
|
||||
- max = the end of the animation.
|
||||
"
|
||||
|
||||
(let* ((num-args (if (pair? num!) (cdr num!) '()))
|
||||
(num! (if (pair? num!) (car num!) num!))
|
||||
(nf (cond
|
||||
((or (eq? num! 'identity)
|
||||
(eq? num! 'min)
|
||||
(eq? num! 'max)
|
||||
)
|
||||
'num-func-identity)
|
||||
((eq? num! 'none) 'num-func-none)
|
||||
((eq? num! '+!) 'num-func-+!)
|
||||
((eq? num! '-!) 'num-func--!)
|
||||
((eq? num! 'seek!) 'num-func-seek!)
|
||||
((eq? num! 'loop!) 'num-func-loop!)
|
||||
((eq? num! 'blend-in!) 'num-func-blend-in!)
|
||||
((eq? num! 'chan) 'num-func-chan)
|
||||
))
|
||||
(p0 (if param0 param0
|
||||
(cond
|
||||
((eq? num! 'chan) `(the float ,(car num-args)))
|
||||
((eq? num! '+!) (if (null? num-args) 1.0 (car num-args)))
|
||||
((eq? num! '-!) (if (null? num-args) 1.0 (car num-args)))
|
||||
((eq? num! 'loop!) (if (null? num-args) 1.0 (if (eq? 'max (car num-args))
|
||||
(if group!
|
||||
`(the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1- (-> ja-ch frame-group data 0 length)))
|
||||
)
|
||||
(car num-args))))
|
||||
((eq? num! 'seek!) (if (or (null? num-args) (eq? (car num-args) 'max))
|
||||
(if group!
|
||||
`(the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1- (-> ja-ch frame-group data 0 length)))
|
||||
)
|
||||
(car num-args)))
|
||||
)))
|
||||
(p1 (if param1 param1
|
||||
(cond
|
||||
((eq? num! 'seek!) (if (or (null? num-args) (null? (cdr num-args))) 1.0 (cadr num-args)))
|
||||
)))
|
||||
(frame-num (if (eq? 'max frame-num) (if group!
|
||||
`(the float (1- (-> (the art-joint-anim ,group!) data 0 length)))
|
||||
`(the float (1- (-> ja-ch frame-group data 0 length)))
|
||||
)
|
||||
frame-num))
|
||||
(frame-group (if (or p0 p1 frame-num (not nf)) group! #f))
|
||||
)
|
||||
`(let ((ja-ch (-> self skel root-channel ,chan)))
|
||||
,(if frame-interp `(set! (-> ja-ch frame-interp) ,frame-interp) `(none))
|
||||
,(if dist `(set! (-> ja-ch dist) ,dist) `(none))
|
||||
,(if frame-group `(set! (-> ja-ch frame-group) (the art-joint-anim ,frame-group)) `(none))
|
||||
,(if p0 `(set! (-> ja-ch param 0) ,p0) `(none))
|
||||
,(if p1 `(set! (-> ja-ch param 1) ,p1) `(none))
|
||||
,(if num-func `(set! (-> ja-ch num-func) ,num-func) `(none))
|
||||
,(if frame-num `(set! (-> ja-ch frame-num) ,frame-num) `(none))
|
||||
,(if nf
|
||||
`(,(if eval? 'joint-control-channel-group-eval! 'joint-control-channel-group!)
|
||||
ja-ch (the art-joint-anim ,group!) ,nf)
|
||||
`(none))
|
||||
,(cond
|
||||
((eq? num! 'min) `(set! (-> ja-ch frame-num) 0.0))
|
||||
((eq? num! 'max) (if group!
|
||||
`(set! (-> ja-ch frame-num) (the float (1- (-> (the art-joint-anim ,group!) data 0 length))))
|
||||
`(set! (-> ja-ch frame-num) (the float (1- (-> ja-ch frame-group data 0 length))))
|
||||
))
|
||||
((eq? num! 'identity) `(set! (-> ja-ch frame-num) ,(car num-args)))
|
||||
(#t `(none))
|
||||
)
|
||||
))
|
||||
)
|
||||
|
||||
(defmacro ja-no-eval (&key (chan 0)
|
||||
&key (group! #f)
|
||||
&key (num! #f)
|
||||
&key (param0 #f)
|
||||
&key (param1 #f)
|
||||
&key (num-func #f)
|
||||
&key (frame-num #f)
|
||||
&key (frame-interp #f)
|
||||
&key (dist #f)
|
||||
)
|
||||
`(ja :eval? #f :chan ,chan :group! ,group! :num! ,num! :param0 ,param0 :param1 ,param1 :num-func ,num-func :frame-num ,frame-num :frame-interp ,frame-interp :dist ,dist)
|
||||
)
|
||||
|
||||
(defbehavior ja-eval process-drawable ()
|
||||
(let ((gp-0 (-> self skel root-channel 0))
|
||||
(s5-0 (-> self skel channel (-> self skel active-channels)))
|
||||
|
||||
@@ -425,12 +425,9 @@
|
||||
(transform-post)
|
||||
(animate self)
|
||||
(suspend)
|
||||
(when (nonzero? (-> self skel))
|
||||
(let ((a0-10 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-10 param 0) 0.5)
|
||||
(joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!)
|
||||
(if (nonzero? (-> self skel))
|
||||
(ja :num! (loop! 0.5))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self root-override trans quad) (-> self jump-pos quad))
|
||||
@@ -587,7 +584,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((gp-0 (-> self part))
|
||||
(s5-0 (-> self root-override root-prim prim-core))
|
||||
)
|
||||
@@ -676,7 +673,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ((arg0 handle))
|
||||
(while #t
|
||||
(loop
|
||||
(set! (-> self root-override trans quad) (-> self base quad))
|
||||
(add-blue-motion #t #f #t #f)
|
||||
(update-transforms! (-> self root-override))
|
||||
@@ -1109,23 +1106,17 @@
|
||||
obj
|
||||
)
|
||||
|
||||
(defskelgroup *money-sg* money
|
||||
0
|
||||
4
|
||||
((1 (meters 20)) (2 (meters 40)) (3 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 0.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *money-sg* money money-lod0-jg money-idle-ja
|
||||
((money-lod0-mg (meters 20)) (money-lod1-mg (meters 40)) (money-lod2-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 0.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defskelgroup *fuel-cell-sg* fuel-cell
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *fuel-cell-sg* fuel-cell fuel-cell-lod0-jg fuel-cell-idle-ja
|
||||
((fuel-cell-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(deftype money (eco-collectable)
|
||||
()
|
||||
@@ -1165,7 +1156,7 @@
|
||||
:virtual #t
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(quaternion-rotate-y!
|
||||
(-> self root-override quat)
|
||||
(-> self root-override quat)
|
||||
@@ -1203,7 +1194,7 @@
|
||||
:virtual #t
|
||||
:code
|
||||
(behavior ((arg0 handle))
|
||||
(while #t
|
||||
(loop
|
||||
(quaternion-rotate-y!
|
||||
(-> self root-override quat)
|
||||
(-> self root-override quat)
|
||||
@@ -1548,10 +1539,8 @@
|
||||
(behavior ()
|
||||
0.5
|
||||
(let ((f28-0 0.0))
|
||||
(let ((v1-3 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 2)))
|
||||
)
|
||||
(while #t
|
||||
(ja :group! (-> self draw art-group data 2))
|
||||
(loop
|
||||
(let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0))))
|
||||
(set! f28-0
|
||||
(if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (zero? (logand (-> self flags) (collectable-flags anim))))
|
||||
@@ -1567,10 +1556,7 @@
|
||||
(transform-post)
|
||||
(fuel-cell-animate)
|
||||
(suspend)
|
||||
(let ((a0-11 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-11 param 0) f30-1)
|
||||
(joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!)
|
||||
)
|
||||
(ja :num! (loop! f30-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2166,9 +2152,7 @@
|
||||
(set! (-> self root-override trans quad) (-> self draw origin quad))
|
||||
(set! (-> self base quad) (-> self root-override trans quad))
|
||||
(ja-channel-set! 1)
|
||||
(let ((v1-20 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-20 frame-group) (the-as art-joint-anim (-> self draw art-group data 2)))
|
||||
)
|
||||
(ja :group! (-> self draw art-group data 2))
|
||||
(logclear! (-> self draw status) (draw-status hidden))
|
||||
(vector-reset! (-> self draw origin))
|
||||
(go-virtual wait)
|
||||
@@ -2211,14 +2195,11 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defskelgroup *buzzer-sg* buzzer
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *buzzer-sg* buzzer buzzer-lod0-jg buzzer-idle-ja
|
||||
((buzzer-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(deftype buzzer (eco-collectable)
|
||||
((victory-anim spool-anim :offset-assert 404)
|
||||
@@ -2264,7 +2245,7 @@
|
||||
(go-virtual pickup #t (the-as handle #f))
|
||||
)
|
||||
)
|
||||
(while #t
|
||||
(loop
|
||||
(transform-post)
|
||||
(animate self)
|
||||
(suspend)
|
||||
@@ -2806,14 +2787,11 @@
|
||||
)
|
||||
|
||||
|
||||
(defskelgroup *ecovalve-sg* ecovalve
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *ecovalve-sg* ecovalve ecovalve-geo-jg ecovalve-idle-ja
|
||||
((ecovalve-geo-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defstate ecovalve-idle (ecovalve)
|
||||
:code
|
||||
@@ -2821,7 +2799,7 @@
|
||||
(transform-post)
|
||||
(suspend)
|
||||
(transform-post)
|
||||
(while #t
|
||||
(loop
|
||||
(if (not ((-> self block-func) (the-as vent (ppointer->process (-> self parent)))))
|
||||
(set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0)
|
||||
)
|
||||
@@ -3034,7 +3012,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((a0-0 (-> self part))
|
||||
(a1-0 (-> self root-override trans))
|
||||
(gp-0 (-> self sound))
|
||||
@@ -3063,7 +3041,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not ((-> self block-func) self))
|
||||
(go vent-wait-for-touch)
|
||||
)
|
||||
|
||||
@@ -10,59 +10,44 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defskelgroup *crate-barrel-sg* crate
|
||||
17
|
||||
21
|
||||
((18 (meters 20)) (19 (meters 40)) (20 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *crate-barrel-sg* crate crate-barrel-lod0-jg crate-barrel-idle-ja
|
||||
((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defskelgroup *crate-bucket-sg* crate
|
||||
22
|
||||
24
|
||||
((23 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 4)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *crate-bucket-sg* crate crate-bucket-lod0-jg crate-bucket-idle-ja
|
||||
((crate-bucket-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 4)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defskelgroup *crate-wood-sg* crate
|
||||
0
|
||||
16
|
||||
((1 (meters 20)) (2 (meters 40)) (3 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *crate-wood-sg* crate crate-wood-lod0-jg crate-idle-ja
|
||||
((crate-wood-lod0-mg (meters 20)) (crate-wood-lod1-mg (meters 40)) (crate-wood-lod2-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defskelgroup *crate-iron-sg* crate
|
||||
4
|
||||
16
|
||||
((5 (meters 20)) (6 (meters 40)) (7 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *crate-iron-sg* crate crate-iron-lod0-jg crate-idle-ja
|
||||
((crate-iron-lod0-mg (meters 20)) (crate-iron-lod1-mg (meters 40)) (crate-iron-lod2-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defskelgroup *crate-steel-sg* crate
|
||||
8
|
||||
16
|
||||
((9 (meters 20)) (10 (meters 40)) (11 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *crate-steel-sg* crate crate-steel-lod0-jg crate-idle-ja
|
||||
((crate-steel-lod0-mg (meters 20)) (crate-steel-lod1-mg (meters 40)) (crate-steel-lod2-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defskelgroup *crate-darkeco-sg* crate
|
||||
12
|
||||
16
|
||||
((13 (meters 20)) (14 (meters 40)) (15 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *crate-darkeco-sg* crate crate-darkeco-lod0-jg crate-idle-ja
|
||||
((crate-darkeco-lod0-mg (meters 20))
|
||||
(crate-darkeco-lod1-mg (meters 40))
|
||||
(crate-darkeco-lod2-mg (meters 999999))
|
||||
)
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(deftype crate-bank (basic)
|
||||
((COLLIDE_YOFF float :offset-assert 4)
|
||||
@@ -730,7 +715,7 @@
|
||||
(suspend)
|
||||
(update-transforms! (-> self root-override))
|
||||
(logior! (-> self mask) (process-mask sleep))
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
@@ -784,7 +769,7 @@
|
||||
:code
|
||||
(behavior ((arg0 handle))
|
||||
(set! (-> self target) arg0)
|
||||
(while #t
|
||||
(loop
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(v1-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable))
|
||||
gp-0
|
||||
@@ -1409,7 +1394,7 @@
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(suspend)
|
||||
(update-transforms! (-> self root-override))
|
||||
(while #t
|
||||
(loop
|
||||
(set! (-> self state-time) (-> *display* base-frame-counter))
|
||||
(ja-post)
|
||||
(logior! (-> self mask) (process-mask sleep-code))
|
||||
@@ -1484,7 +1469,7 @@
|
||||
:virtual #t
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (or (not (-> self blocker)) (logtest? (-> self blocker extra perm status) (entity-perm-status complete)))
|
||||
(go-virtual die #t 0)
|
||||
)
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
(defstate swingpole-stance (swingpole)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (and *target*
|
||||
(< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range))
|
||||
(logtest? (-> *target* control root-prim prim-core action) (collide-action ca-6))
|
||||
@@ -369,17 +369,7 @@
|
||||
(('done)
|
||||
(case (-> self anim-mode)
|
||||
(('play1 'play)
|
||||
(>= (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
0
|
||||
length
|
||||
)
|
||||
-2
|
||||
)
|
||||
)
|
||||
)
|
||||
(>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -413,19 +403,10 @@
|
||||
)
|
||||
(when (and (-> self new-joint-anim)
|
||||
(nonzero? (-> self skel))
|
||||
(and (!= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(-> self new-joint-anim)
|
||||
)
|
||||
(!= (-> self anim-mode) 'clone-anim)
|
||||
)
|
||||
(and (!= (ja-group) (-> self new-joint-anim)) (!= (-> self anim-mode) 'clone-anim))
|
||||
)
|
||||
(ja-channel-push! 1 (the-as int (-> self new-joint-anim-blend)))
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval! gp-0 (-> self new-joint-anim) num-func-identity)
|
||||
(set! (-> gp-0 frame-num) 0.0)
|
||||
)
|
||||
(ja-channel-push! 1 (the-as time-frame (-> self new-joint-anim-blend)))
|
||||
(ja :group! (-> self new-joint-anim) :num! min)
|
||||
)
|
||||
(let ((v1-20 (handle->process (-> self cur-grab-handle))))
|
||||
(when v1-20
|
||||
@@ -451,7 +432,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(logclear! (-> self mask) (process-mask heap-shrunk))
|
||||
(while #t
|
||||
(loop
|
||||
((-> self cur-post-hook))
|
||||
(if (!= (-> self anim-mode) 'clone-anim)
|
||||
(ja-post)
|
||||
@@ -459,25 +440,16 @@
|
||||
(suspend)
|
||||
(case (-> self anim-mode)
|
||||
(('loop)
|
||||
(let ((a0-4 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-4 param 0) 1.0)
|
||||
(joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-loop!)
|
||||
)
|
||||
(ja :num! (loop!))
|
||||
)
|
||||
(('play)
|
||||
(let ((a0-7 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-7 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(('copy-parent)
|
||||
(let ((v1-18 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-18 num-func) num-func-identity)
|
||||
(set! (-> v1-18 frame-num)
|
||||
(-> (the-as process-drawable (ppointer->process (-> self parent))) skel root-channel 0 frame-num)
|
||||
)
|
||||
)
|
||||
(ja :num-func num-func-identity
|
||||
:frame-num
|
||||
(-> (the-as process-drawable (ppointer->process (-> self parent))) skel root-channel 0 frame-num)
|
||||
)
|
||||
)
|
||||
(('clone-parent)
|
||||
(let ((gp-0 (ppointer->process (-> self parent))))
|
||||
@@ -509,11 +481,7 @@
|
||||
(('still)
|
||||
)
|
||||
(('play1)
|
||||
(let ((a0-33 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-33 param 0) (the float (+ (-> a0-33 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-33 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-33 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
(if (ja-done? 0)
|
||||
(deactivate self)
|
||||
)
|
||||
@@ -579,10 +547,7 @@
|
||||
(set! (-> self draw?) #t)
|
||||
(cond
|
||||
((nonzero? (-> self skel))
|
||||
(set! (-> self new-joint-anim) (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! (-> self new-joint-anim) (ja-group))
|
||||
(set! (-> self anim-mode) 'loop)
|
||||
)
|
||||
(else
|
||||
@@ -1267,19 +1232,16 @@
|
||||
(vf17 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(while #t
|
||||
(loop
|
||||
(let ((a0-1 (level-get *level* (-> self level)))
|
||||
(v1-3 (-> *game-info* current-continue level))
|
||||
)
|
||||
(cond
|
||||
((and a0-1 (or (= (-> a0-1 display?) 'special) (= (-> a0-1 display?) 'special-vis)))
|
||||
(logclear! (-> self draw status) (draw-status hidden))
|
||||
(when (nonzero? (-> self skel))
|
||||
(let ((a0-5 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-5 param 0) 1.0)
|
||||
(joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-loop!)
|
||||
(if (nonzero? (-> self skel))
|
||||
(ja :num! (loop!))
|
||||
)
|
||||
)
|
||||
)
|
||||
((or (and a0-1 (= (-> a0-1 status) 'active)) (= v1-3 'firecanyon))
|
||||
(logior! (-> self draw status) (draw-status hidden))
|
||||
@@ -1292,12 +1254,9 @@
|
||||
(if (nonzero? (-> self part))
|
||||
(spawn (-> self part) (-> self root trans))
|
||||
)
|
||||
(when (nonzero? (-> self skel))
|
||||
(let ((a0-17 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-17 param 0) 1.0)
|
||||
(joint-control-channel-group-eval! a0-17 (the-as art-joint-anim #f) num-func-loop!)
|
||||
(if (nonzero? (-> self skel))
|
||||
(ja :num! (loop!))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1417,7 +1376,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(when (-> self enable)
|
||||
(spawn (-> self part) (-> self root trans))
|
||||
(if (nonzero? (-> self sound))
|
||||
@@ -1826,7 +1785,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(let ((gp-0 (-> *display* base-frame-counter)))
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0)
|
||||
(send-event *camera* 'teleport)
|
||||
@@ -1895,7 +1854,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(let ((gp-0 (-> *display* base-frame-counter)))
|
||||
(while #t
|
||||
(loop
|
||||
(when (not (paused?))
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector))
|
||||
(s5-0 (new 'stack-no-clear 'vector))
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
)
|
||||
(cond
|
||||
((zero? arg5)
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
)
|
||||
)
|
||||
@@ -614,12 +614,7 @@
|
||||
)
|
||||
)
|
||||
(let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0)))
|
||||
(if (not (= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(-> self draw art-group data 104)
|
||||
)
|
||||
)
|
||||
(if (not (ja-group? (-> self draw art-group data 104)))
|
||||
(set! f0-8 (* 0.75 f0-8))
|
||||
)
|
||||
(seek! (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame)))
|
||||
|
||||
@@ -272,22 +272,13 @@
|
||||
)
|
||||
|
||||
(defbehavior process-taskable-anim-loop process-taskable ()
|
||||
(when (!= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(get-art-elem self)
|
||||
)
|
||||
(ja-channel-push! 1 60)
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self)))
|
||||
)
|
||||
(when (!= (ja-group) (get-art-elem self))
|
||||
(ja-channel-push! 1 (seconds 0.2))
|
||||
(ja :group! (get-art-elem self))
|
||||
)
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
(let ((a0-8 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-8 param 0) 1.0)
|
||||
(joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!)
|
||||
)
|
||||
(ja :num! (loop!))
|
||||
(if (= (-> self next-state name) 'idle)
|
||||
(TODO-RENAME-43 self)
|
||||
)
|
||||
@@ -424,7 +415,7 @@
|
||||
(if (nonzero? *camera-look-through-other*)
|
||||
(set! *camera-look-through-other* 2)
|
||||
)
|
||||
(set-letterbox-frames (seconds 0.016666668))
|
||||
(set-letterbox-frames (seconds 0.017))
|
||||
(draw-npc-shadow self)
|
||||
(none)
|
||||
)
|
||||
@@ -504,10 +495,7 @@
|
||||
(else
|
||||
(when (not arg1)
|
||||
(format #t "ERROR<GMJ>: ~S ~S got #f from anim picker~%" (-> self name) (-> self state name))
|
||||
(set! arg1 (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! arg1 (ja-group))
|
||||
)
|
||||
(when (not (type-type? (-> arg1 type) art-joint-anim))
|
||||
(format
|
||||
@@ -516,58 +504,23 @@
|
||||
(-> self name)
|
||||
(-> self state name)
|
||||
)
|
||||
(set! arg1 (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! arg1 (ja-group))
|
||||
)
|
||||
(format #t "~S ~S anim ~S~%" (-> self name) (-> self state name) (-> (the-as art-joint-anim arg1) name))
|
||||
(ja-channel-push! 1 60)
|
||||
(ja-channel-push! 1 (seconds 0.2))
|
||||
(set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim arg1))
|
||||
(when (< (ja-num-frames 0) 3)
|
||||
(suspend)
|
||||
(suspend)
|
||||
0
|
||||
)
|
||||
(let ((a0-30 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-30 frame-group) (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
0
|
||||
length
|
||||
)
|
||||
-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-30 param 1) 1.0)
|
||||
(set! (-> a0-30 frame-num) 0.0)
|
||||
(joint-control-channel-group!
|
||||
a0-30
|
||||
(if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
num-func-seek!
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(when (and *debug-segment* (= (get-response (-> self query)) 'no))
|
||||
(let ((v1-106 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-106 num-func) num-func-identity)
|
||||
(set! (-> v1-106 frame-num) (the float (+ (-> v1-106 frame-group data 0 length) -1)))
|
||||
(if (and *debug-segment* (= (get-response (-> self query)) 'no))
|
||||
(ja :num-func num-func-identity :frame-num max)
|
||||
)
|
||||
)
|
||||
(suspend)
|
||||
(let ((a0-38 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-38 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-38 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
#f
|
||||
)
|
||||
@@ -780,9 +733,7 @@
|
||||
)
|
||||
(else
|
||||
(ja-channel-set! 1)
|
||||
(let ((gp-0 (-> self skel root-channel 0)))
|
||||
(set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self)))
|
||||
)
|
||||
(ja :group! (get-art-elem self))
|
||||
(restore-collide-with-as (-> self root-override))
|
||||
(process-entity-status! self (entity-perm-status bit-3) #t)
|
||||
(let ((v1-7 (-> self draw shadow-ctrl)))
|
||||
@@ -1343,7 +1294,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(let ((s2-0 (-> self hand process 0)))
|
||||
(when (not s2-0)
|
||||
(format #t "ERROR<GMJ>: othercam parent invalid~%")
|
||||
|
||||
@@ -47,13 +47,10 @@
|
||||
(the-as (function none :behavior process) nothing)
|
||||
)
|
||||
|
||||
(defskelgroup *voicebox-sg* speaker
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 4)
|
||||
:longest-edge (meters 0)
|
||||
)
|
||||
(defskelgroup *voicebox-sg* speaker speaker-lod0-jg speaker-idle-ja
|
||||
((speaker-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 4)
|
||||
)
|
||||
|
||||
(defbehavior voicebox-track voicebox ()
|
||||
(let ((gp-0 (new 'stack-no-clear 'vector))
|
||||
@@ -174,12 +171,9 @@
|
||||
voicebox-track
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
(let ((a0-0 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-0 param 0) 1.0)
|
||||
(joint-control-channel-group-eval! a0-0 (the-as art-joint-anim #f) num-func-loop!)
|
||||
)
|
||||
(ja :num! (loop!))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype eye (structure)
|
||||
((data vector 2 :inline :offset-assert 0)
|
||||
(x float :offset 0)
|
||||
(y float :offset 4)
|
||||
(lid float :offset 8)
|
||||
(iris-scale float :offset 16)
|
||||
(pupil-scale float :offset 20)
|
||||
(lid-scale float :offset 24)
|
||||
((data vector 2 :inline :offset-assert 0)
|
||||
(x float :offset 0)
|
||||
(y float :offset 4)
|
||||
(lid float :offset 8)
|
||||
(iris-scale float :offset 16)
|
||||
(pupil-scale float :offset 20)
|
||||
(lid-scale float :offset 24)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
|
||||
@@ -863,7 +863,7 @@
|
||||
)
|
||||
|
||||
(defun-extern level-hint-surpress! none) ;; ? TODO
|
||||
(define-extern ja-channel-push! (function int int int :behavior process-drawable))
|
||||
(define-extern ja-channel-push! (function int time-frame int :behavior process-drawable))
|
||||
(define-extern ja-channel-set! (function int int :behavior process-drawable))
|
||||
(define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
|
||||
(define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
|
||||
@@ -905,7 +905,7 @@
|
||||
)
|
||||
arg1
|
||||
)
|
||||
(ja-channel-push! 1 15)
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(let ((s2-0 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval! s2-0 arg1 num-func-identity)
|
||||
(set! (-> s2-0 frame-num) 0.0)
|
||||
@@ -1066,7 +1066,7 @@
|
||||
(clear-pending-settings-from-process *setting-control* self 'spooling)
|
||||
(cond
|
||||
((and arg1 (>= arg2 0))
|
||||
(ja-channel-push! 1 30)
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(set! (-> self skel root-channel 0 frame-group) arg1)
|
||||
(while (!= (-> self skel root-channel 0) (-> self skel channel))
|
||||
(spool-push *art-control* (-> arg0 name) arg2 self -20.0)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
;; name in dgo: sidekick
|
||||
;; dgos: GAME, ENGINE
|
||||
|
||||
(define-extern *sidekick-sg* skeleton-group)
|
||||
(load-art-import sidekick)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> self draw shadow) (the-as shadow-geo (if (and (movie?) (-> self shadow-in-movie?))
|
||||
(-> self draw art-group data 2)
|
||||
sidekick-shadow-mg
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -222,16 +222,14 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defskelgroup *sidekick-sg* sidekick
|
||||
0
|
||||
-1
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 3)
|
||||
:longest-edge (meters 1)
|
||||
:shadow 2
|
||||
:texture-level 2
|
||||
:sort 1
|
||||
)
|
||||
(defskelgroup *sidekick-sg* sidekick sidekick-lod0-jg -1
|
||||
((sidekick-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 3)
|
||||
:longest-edge (meters 1)
|
||||
:shadow sidekick-shadow-mg
|
||||
:texture-level 2
|
||||
:sort 1
|
||||
)
|
||||
|
||||
(defbehavior init-sidekick sidekick ()
|
||||
(logior! (-> self mask) (process-mask sidekick))
|
||||
|
||||
@@ -7,14 +7,11 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defskelgroup *deathcam-sg* deathcam
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 4)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *deathcam-sg* deathcam deathcam-lod0-jg deathcam-idle-ja
|
||||
((deathcam-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 0 0 4)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(define *auto-continue* #f)
|
||||
|
||||
@@ -469,9 +466,7 @@
|
||||
)
|
||||
)
|
||||
(ja-channel-set! 1)
|
||||
(let ((v1-264 (-> self skel root-channel 0)))
|
||||
(set! (-> v1-264 frame-group) (the-as art-joint-anim (-> self draw art-group data 5)))
|
||||
)
|
||||
(ja :group! eichar-stance-loop-ja)
|
||||
(suspend)
|
||||
(logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
|
||||
(go target-stance)
|
||||
@@ -745,19 +740,10 @@
|
||||
(defbehavior target-hit-setup-anim target ((arg0 attack-info))
|
||||
(case (-> arg0 angle)
|
||||
(('back)
|
||||
(when (not (= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(-> self draw art-group data 74)
|
||||
)
|
||||
)
|
||||
(ja-channel-push! 1 22)
|
||||
(when (not (ja-group? eichar-hit-from-back-ja))
|
||||
(ja-channel-push! 1 (seconds 0.075))
|
||||
(let ((gp-1 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval!
|
||||
gp-1
|
||||
(the-as art-joint-anim (-> self draw art-group data 74))
|
||||
num-func-identity
|
||||
)
|
||||
(joint-control-channel-group-eval! gp-1 (the-as art-joint-anim eichar-hit-from-back-ja) num-func-identity)
|
||||
(let ((f0-0 0.0))
|
||||
(set! (-> gp-1 frame-num) f0-0)
|
||||
f0-0
|
||||
@@ -766,19 +752,10 @@
|
||||
)
|
||||
)
|
||||
(('up 'up-forward)
|
||||
(when (not (= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(-> self draw art-group data 75)
|
||||
)
|
||||
)
|
||||
(ja-channel-push! 1 22)
|
||||
(when (not (ja-group? eichar-hit-up-ja))
|
||||
(ja-channel-push! 1 (seconds 0.075))
|
||||
(let ((gp-2 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval!
|
||||
gp-2
|
||||
(the-as art-joint-anim (-> self draw art-group data 75))
|
||||
num-func-identity
|
||||
)
|
||||
(joint-control-channel-group-eval! gp-2 (the-as art-joint-anim eichar-hit-up-ja) num-func-identity)
|
||||
(let ((f0-1 0.0))
|
||||
(set! (-> gp-2 frame-num) f0-1)
|
||||
f0-1
|
||||
@@ -787,16 +764,8 @@
|
||||
)
|
||||
)
|
||||
(('air 'jump)
|
||||
(ja-channel-push! 1 15)
|
||||
(let ((a0-21 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-21 frame-group) (the-as art-joint-anim (-> self draw art-group data 34)))
|
||||
(set! (-> a0-21 param 0)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 34)) data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-21 param 1) 1.0)
|
||||
(set! (-> a0-21 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-21 (the-as art-joint-anim (-> self draw art-group data 34)) num-func-seek!)
|
||||
)
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja-no-eval :group! eichar-jump-ja :num! (seek!) :frame-num 0.0)
|
||||
(when (= (-> arg0 angle) 'air)
|
||||
(sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t)
|
||||
(dummy-10 (-> self skel effect) 'group-smack-surface (the-as float 0.0) 5)
|
||||
@@ -804,32 +773,15 @@
|
||||
)
|
||||
)
|
||||
(('shove)
|
||||
(ja-channel-push! 1 15)
|
||||
(let ((a0-30 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-30 frame-group) (the-as art-joint-anim (-> self draw art-group data 78)))
|
||||
(set! (-> a0-30 param 0)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 78)) data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-30 param 1) 1.0)
|
||||
(set! (-> a0-30 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-30 (the-as art-joint-anim (-> self draw art-group data 78)) num-func-seek!)
|
||||
)
|
||||
(ja-channel-push! 1 (seconds 0.05))
|
||||
(ja-no-eval :group! eichar-smack-surface-ja :num! (seek!) :frame-num 0.0)
|
||||
(sound-play-by-name (static-sound-name "smack-surface") (new-sound-id) 1024 0 0 1 #t)
|
||||
)
|
||||
(else
|
||||
(when (not (= (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
(-> self draw art-group data 73)
|
||||
)
|
||||
)
|
||||
(ja-channel-push! 1 22)
|
||||
(when (not (ja-group? eichar-hit-from-front-ja))
|
||||
(ja-channel-push! 1 (seconds 0.075))
|
||||
(let ((gp-5 (-> self skel root-channel 0)))
|
||||
(joint-control-channel-group-eval!
|
||||
gp-5
|
||||
(the-as art-joint-anim (-> self draw art-group data 73))
|
||||
num-func-identity
|
||||
)
|
||||
(joint-control-channel-group-eval! gp-5 (the-as art-joint-anim eichar-hit-from-front-ja) num-func-identity)
|
||||
(let ((f0-10 0.0))
|
||||
(set! (-> gp-5 frame-num) f0-10)
|
||||
f0-10
|
||||
@@ -866,31 +818,12 @@
|
||||
)
|
||||
(set-quaternion! (-> self control) (-> self control dir-targ))
|
||||
#t
|
||||
(let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
data
|
||||
0
|
||||
length
|
||||
)
|
||||
-1
|
||||
)
|
||||
)
|
||||
(ja-step 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) data 0 length) -1)) (ja-step 0))))))
|
||||
(until v1-40
|
||||
(+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame)))
|
||||
(set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0))
|
||||
(suspend)
|
||||
(let ((a0-14 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-14 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
(set! v1-40 (or (ja-done? 0) (and arg1 (logtest? (-> self control status) (cshape-moving-flags onsurf)))))
|
||||
)
|
||||
(while (and (or (zero? (logand (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck))
|
||||
@@ -1121,16 +1054,8 @@
|
||||
|
||||
(defbehavior target-death-anim target ((arg0 spool-anim))
|
||||
(set! (-> self control unknown-surface00) *neutral-mods*)
|
||||
(ja-channel-push! 1 30)
|
||||
(let ((a0-3 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 76)))
|
||||
(set! (-> a0-3 param 0)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 76)) data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-3 param 1) 1.0)
|
||||
(set! (-> a0-3 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 76)) num-func-seek!)
|
||||
)
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(ja-no-eval :group! eichar-deatha-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(if arg0
|
||||
(spool-push *art-control* (-> arg0 name) 0 self (the-as float -99.0))
|
||||
@@ -1144,11 +1069,7 @@
|
||||
)
|
||||
)
|
||||
(suspend)
|
||||
(let ((a0-9 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-9 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
@@ -1246,16 +1167,16 @@
|
||||
(set! (-> self control unknown-surface00) *dive-mods*)
|
||||
(set! (-> self control dynam gravity-max) 6144.0)
|
||||
(set! (-> self control dynam gravity-length) 6144.0)
|
||||
(ja-channel-push! 1 30)
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(let ((f30-0 0.7)
|
||||
(gp-3 (-> self skel root-channel 0))
|
||||
)
|
||||
(set! (-> gp-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 93)))
|
||||
(set! (-> gp-3 frame-group) (the-as art-joint-anim eichar-swim-walk-to-down-ja))
|
||||
(set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0))
|
||||
(let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame)))))
|
||||
(set! (-> gp-3 param 1) f30-1)
|
||||
(set! (-> gp-3 frame-num) 0.0)
|
||||
(joint-control-channel-group! gp-3 (the-as art-joint-anim (-> self draw art-group data 93)) num-func-seek!)
|
||||
(joint-control-channel-group! gp-3 (the-as art-joint-anim eichar-swim-walk-to-down-ja) num-func-seek!)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let ((gp-4 (-> self skel root-channel 0)))
|
||||
@@ -1366,25 +1287,12 @@
|
||||
(none)
|
||||
)
|
||||
)
|
||||
(target-falling-anim (seconds 0.1) 99)
|
||||
(ja-channel-push! 1 90)
|
||||
(let ((a0-75 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-75 frame-group) (the-as art-joint-anim (-> self draw art-group data 43)))
|
||||
(set! (-> a0-75 param 0) 0.5)
|
||||
(set! (-> a0-75 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-75 (the-as art-joint-anim (-> self draw art-group data 43)) num-func-loop!)
|
||||
)
|
||||
(target-falling-anim (seconds 0.1) (seconds 0.33))
|
||||
(ja-channel-push! 1 (seconds 0.3))
|
||||
(ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0)
|
||||
(let ((gp-12 (-> *display* base-frame-counter)))
|
||||
(until (>= (- (-> *display* base-frame-counter) gp-12) (seconds 0.8))
|
||||
(let ((a0-76 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-76 frame-group) (the-as art-joint-anim (-> self draw art-group data 43)))
|
||||
(set! (-> a0-76 param 0) 0.5)
|
||||
(joint-control-channel-group-eval!
|
||||
a0-76
|
||||
(the-as art-joint-anim (-> self draw art-group data 43))
|
||||
num-func-loop!
|
||||
)
|
||||
)
|
||||
(ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5))
|
||||
(suspend)
|
||||
)
|
||||
)
|
||||
@@ -1392,23 +1300,11 @@
|
||||
)
|
||||
(('target-hit-ground-hard)
|
||||
(set! (-> self control unknown-surface00) *neutral-mods*)
|
||||
(ja-channel-push! 1 30)
|
||||
(let ((a0-81 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-81 frame-group) (the-as art-joint-anim (-> self draw art-group data 77)))
|
||||
(set! (-> a0-81 param 0)
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 77)) data 0 length) -1))
|
||||
)
|
||||
(set! (-> a0-81 param 1) 1.0)
|
||||
(set! (-> a0-81 frame-num) 0.0)
|
||||
(joint-control-channel-group! a0-81 (the-as art-joint-anim (-> self draw art-group data 77)) num-func-seek!)
|
||||
)
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(ja-no-eval :group! eichar-death-painful-land-ja :num! (seek!) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let ((a0-82 (-> self skel root-channel 0)))
|
||||
(set! (-> a0-82 param 0) (the float (+ (-> a0-82 frame-group data 0 length) -1)))
|
||||
(set! (-> a0-82 param 1) 1.0)
|
||||
(joint-control-channel-group-eval! a0-82 (the-as art-joint-anim #f) num-func-seek!)
|
||||
)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
)
|
||||
(('sharkey)
|
||||
|
||||
@@ -9,16 +9,14 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defskelgroup *jchar-sg* eichar
|
||||
0
|
||||
-1
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 2 0 3)
|
||||
:longest-edge (meters 1)
|
||||
:shadow 2
|
||||
:texture-level 2
|
||||
:sort 1
|
||||
)
|
||||
(defskelgroup *jchar-sg* eichar eichar-lod0-jg -1
|
||||
((eichar-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 2 0 3)
|
||||
:longest-edge (meters 1)
|
||||
:shadow eichar-shadow-mg
|
||||
:texture-level 2
|
||||
:sort 1
|
||||
)
|
||||
|
||||
(define *target-shadow-control*
|
||||
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
||||
@@ -768,11 +766,7 @@
|
||||
(when (and (zero? (logand (-> self control status) (cshape-moving-flags onsurf)))
|
||||
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout))
|
||||
(>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
|
||||
(let ((v1-15 (if (> (-> self skel active-channels) 0)
|
||||
(-> self skel root-channel 0 frame-group)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-15 (ja-group)))
|
||||
(or (not (or (= v1-15 (-> self draw art-group data 59))
|
||||
(= v1-15 (-> self draw art-group data 60))
|
||||
(= v1-15 (-> self draw art-group data 61))
|
||||
@@ -1094,11 +1088,7 @@
|
||||
(set! (-> arg0 group 4) arg6)
|
||||
(dotimes (s3-0 3)
|
||||
(set! (-> arg0 chan s3-0) (+ arg1 s3-0))
|
||||
(let ((s2-0 (-> self skel root-channel (-> arg0 chan s3-0))))
|
||||
(set! (-> s2-0 frame-interp) (fabs (-> arg0 blend s3-0)))
|
||||
(joint-control-channel-group-eval! s2-0 (the-as art-joint-anim arg2) num-func-identity)
|
||||
(set! (-> s2-0 frame-num) 0.0)
|
||||
)
|
||||
(ja :chan (-> arg0 chan s3-0) :group! arg2 :num! min :frame-interp (fabs (-> arg0 blend s3-0)))
|
||||
)
|
||||
arg0
|
||||
)
|
||||
@@ -1114,34 +1104,14 @@
|
||||
(set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-7)))))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((>= (-> arg0 blend 1) 0.0)
|
||||
(let ((v1-4 (-> self skel root-channel (-> arg0 chan 1))))
|
||||
(set! (-> v1-4 frame-interp) (fabs (-> arg0 blend 1)))
|
||||
(set! (-> v1-4 frame-group) (the-as art-joint-anim (-> arg0 group 1)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((v1-7 (-> self skel root-channel (-> arg0 chan 1))))
|
||||
(set! (-> v1-7 frame-interp) (fabs (-> arg0 blend 1)))
|
||||
(set! (-> v1-7 frame-group) (the-as art-joint-anim (-> arg0 group 2)))
|
||||
)
|
||||
(if (>= (-> arg0 blend 1) 0.0)
|
||||
(ja :chan (-> arg0 chan 1) :group! (-> arg0 group 1) :frame-interp (fabs (-> arg0 blend 1)))
|
||||
(ja :chan (-> arg0 chan 1) :group! (-> arg0 group 2) :frame-interp (fabs (-> arg0 blend 1)))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((>= (-> arg0 blend 2) 0.0)
|
||||
(let ((v1-10 (-> self skel root-channel (-> arg0 chan 2))))
|
||||
(set! (-> v1-10 frame-interp) (fabs (-> arg0 blend 2)))
|
||||
(set! (-> v1-10 frame-group) (the-as art-joint-anim (-> arg0 group 4)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((v1-13 (-> self skel root-channel (-> arg0 chan 2))))
|
||||
(set! (-> v1-13 frame-interp) (fabs (-> arg0 blend 2)))
|
||||
(set! (-> v1-13 frame-group) (the-as art-joint-anim (-> arg0 group 3)))
|
||||
)
|
||||
(if (>= (-> arg0 blend 2) 0.0)
|
||||
(ja :chan (-> arg0 chan 2) :group! (-> arg0 group 4) :frame-interp (fabs (-> arg0 blend 2)))
|
||||
(ja :chan (-> arg0 chan 2) :group! (-> arg0 group 3) :frame-interp (fabs (-> arg0 blend 2)))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
+440
-1540
File diff suppressed because it is too large
Load Diff
+290
-923
File diff suppressed because it is too large
Load Diff
@@ -927,14 +927,11 @@
|
||||
-0.011
|
||||
)
|
||||
|
||||
(defskelgroup *fuelcell-naked-sg* fuelcell-naked
|
||||
0
|
||||
2
|
||||
((1 (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:longest-edge (meters 0)
|
||||
:texture-level 2
|
||||
)
|
||||
(defskelgroup *fuelcell-naked-sg* fuelcell-naked fuelcell-naked-lod0-jg fuelcell-naked-idle-ja
|
||||
((fuelcell-naked-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 1 0 1.6)
|
||||
:texture-level 2
|
||||
)
|
||||
|
||||
(defpart 313
|
||||
:init-specs
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
:code
|
||||
(behavior ()
|
||||
(logior! (-> self mask) (process-mask sleep-code))
|
||||
(while #t
|
||||
(loop
|
||||
(suspend)
|
||||
)
|
||||
(none)
|
||||
@@ -352,7 +352,7 @@
|
||||
)
|
||||
:code
|
||||
(behavior ()
|
||||
(while #t
|
||||
(loop
|
||||
(if (not (paused?))
|
||||
(seekl! (-> self offset) 0 (the int (* 15.0 (-> *display* time-adjust-ratio))))
|
||||
)
|
||||
@@ -414,7 +414,7 @@
|
||||
(-> hud-arriving event)
|
||||
:code
|
||||
(behavior ((arg0 int))
|
||||
(while #t
|
||||
(loop
|
||||
(if (not (paused?))
|
||||
(seekl! (-> self offset) 128 (the int (* (the float arg0) (-> *display* time-adjust-ratio))))
|
||||
)
|
||||
@@ -496,7 +496,7 @@
|
||||
(f24-0 (-> self root-override scale y))
|
||||
(f22-0 (-> self root-override scale z))
|
||||
)
|
||||
(while #t
|
||||
(loop
|
||||
(let ((f0-7 (* f30-0 (-> *display* seconds-per-frame))))
|
||||
(+! f26-0 f0-7)
|
||||
(when (< 1.0 f26-0)
|
||||
|
||||
+58
-15
@@ -5,6 +5,9 @@
|
||||
;; OTHER STUFF
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; get list of all goal import files
|
||||
(asm-file "goal_src/build/all_imports.gc")
|
||||
|
||||
;; tell compiler about stuff defined/implemented in the runtime.
|
||||
(asm-file "goal_src/kernel-defs.gc")
|
||||
|
||||
@@ -34,6 +37,19 @@
|
||||
`(asm-file ,file :color :write)
|
||||
)
|
||||
|
||||
(desfun run-frontend-command (file)
|
||||
`(asm-file ,file :no-code)
|
||||
)
|
||||
|
||||
|
||||
(defmacro load-art-import (name)
|
||||
`(asm-file ,(string-append "goal_src/import/" (symbol->string name) "-ag.gc") :no-code :no-throw))
|
||||
|
||||
(defmacro load-imports ()
|
||||
`(begin
|
||||
,@(apply run-frontend-command all-import-files)
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro build-kernel ()
|
||||
"Build kernel and create the KERNEL CGO"
|
||||
@@ -45,15 +61,6 @@
|
||||
`(make-group "all-code")
|
||||
)
|
||||
|
||||
(defmacro build-data ()
|
||||
"Build all game data"
|
||||
`(begin
|
||||
(asm-data-file game-text "assets/game_text.txt")
|
||||
(asm-data-file game-count "assets/game_count.txt")
|
||||
(asm-data-file dir-tpages "assets/tpage-dir.txt")
|
||||
)
|
||||
)
|
||||
|
||||
(defmacro blg ()
|
||||
"Build engine and kernel CGOs (code only, no data for now) and load them in the listener
|
||||
Uses the blocking dgo-load."
|
||||
@@ -517,11 +524,11 @@
|
||||
)
|
||||
|
||||
(defmacro 1+! (place)
|
||||
`(set! ,place (+ 1 ,place))
|
||||
`(+! ,place 1)
|
||||
)
|
||||
|
||||
(defmacro 1- (var)
|
||||
`(- ,var 1)
|
||||
`(+ ,var -1)
|
||||
)
|
||||
|
||||
(defmacro dec (val)
|
||||
@@ -533,7 +540,7 @@
|
||||
)
|
||||
|
||||
(defmacro 1-! (place)
|
||||
`(set! ,place (+ -1 ,place))
|
||||
`(-! ,place 1)
|
||||
)
|
||||
|
||||
(defmacro *! (place amount)
|
||||
@@ -974,9 +981,6 @@
|
||||
`(sqrtf-no-fabs (fabs ,x))
|
||||
)
|
||||
|
||||
;; load the default project
|
||||
(load-project "goal_src/game.gp")
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; user stuf
|
||||
@@ -997,5 +1001,44 @@
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; art stuf
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defmacro def-art-elt (group name idx)
|
||||
"define a new art element. adds it to a global map stored in goos."
|
||||
|
||||
;; grab data about the art group
|
||||
(let ((ag-info (assoc group *art-info*)))
|
||||
;; no art group was found, make a new one and add it.
|
||||
(when (null? ag-info)
|
||||
(set! ag-info (cons group '()))
|
||||
(cons! *art-info* ag-info)
|
||||
)
|
||||
;; lookup art element in our art group
|
||||
(let ((elt-info (assoc name (cdr ag-info)))
|
||||
(elt-new (list name idx))) ;; this is the format of the individual entries
|
||||
;; found, check if valid
|
||||
(if (and (not (null? elt-info)) (not (eq? elt-info elt-new)))
|
||||
(fmt #t "error redefining art element. data mismatch: {}" elt-info elt-new)
|
||||
#f)
|
||||
;; not found. add to the art-group.
|
||||
(when (null? elt-info)
|
||||
(set! elt-info elt-new)
|
||||
(set-cdr! ag-info (cons elt-info (cdr ag-info)))
|
||||
)
|
||||
)
|
||||
)
|
||||
;; define a constant for it!
|
||||
`(defconstant ,name (-> self draw art-group data ,idx))
|
||||
)
|
||||
|
||||
|
||||
|
||||
;; load the default project
|
||||
(load-project "goal_src/game.gp")
|
||||
(seval (fmt #t "Loading imports...\n"))
|
||||
(load-imports)
|
||||
(seval (fmt #t "Loaded imports. Have a nice day.\n"))
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,17 @@
|
||||
`(if (not ,clause) (begin ,@body) #f)
|
||||
)
|
||||
|
||||
(defsmacro aif (condition true false)
|
||||
"Anaphoric if, similar to Common Lisp"
|
||||
|
||||
`(let ((it ,condition))
|
||||
(if it
|
||||
,true
|
||||
,false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(desfun factorial (x)
|
||||
(if (= x 1)
|
||||
1
|
||||
@@ -290,6 +301,8 @@
|
||||
`(or (float? ,x) (integer? ,x))
|
||||
)
|
||||
|
||||
(defsmacro neq? (a b) `(not (eq? ,a ,b)))
|
||||
|
||||
(defsmacro != (a b) `(not (= ,a ,b)))
|
||||
(defsmacro zero? (x) `(= ,x 0))
|
||||
(defsmacro nonzero? (x) `(!= ,x 0))
|
||||
@@ -425,3 +438,11 @@
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; GAME STUFF!!! ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; a map for art definitions used by art loading code.
|
||||
(define *art-info* '())
|
||||
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; accordian-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt accordian-ag accordian-lod0-jg 0)
|
||||
(def-art-elt accordian-ag accordian-lod0-mg 1)
|
||||
(def-art-elt accordian-ag accordian-lod1-mg 2)
|
||||
(def-art-elt accordian-ag accordian-idle-ja 3)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; allpontoons-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt allpontoons-ag allpontoons-lod0-jg 0)
|
||||
(def-art-elt allpontoons-ag allpontoons-lod0-mg 1)
|
||||
(def-art-elt allpontoons-ag allpontoons-idle-ja 2)
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; aphid-lurker-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-lod0-jg 0)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-lod0-mg 1)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-shadow-mg 2)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-idle-ja 3)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-walk-ja 4)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-walk-deadly-ja 5)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-spike-out-ja 6)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-give-up-ja 7)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-give-up-hop-ja 8)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-turn-ja 9)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-win-ja 10)
|
||||
(def-art-elt aphid-lurker-ag aphid-lurker-die-ja 11)
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; assistant-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt assistant-ag assistant-lod0-jg 0)
|
||||
(def-art-elt assistant-ag assistant-lod0-mg 1)
|
||||
(def-art-elt assistant-ag assistant-shadow-mg 2)
|
||||
(def-art-elt assistant-ag assistant-idle-leaning-right-ja 3)
|
||||
(def-art-elt assistant-ag assistant-idle-transition-right-to-left-ja 4)
|
||||
(def-art-elt assistant-ag assistant-idle-leaning-left-ja 5)
|
||||
(def-art-elt assistant-ag assistant-idle-transition-left-to-right-ja 6)
|
||||
(def-art-elt assistant-ag assistant-idle-wiping-brow-ja 7)
|
||||
(def-art-elt assistant-ag assistant-idle-transition-to-welding-ja 8)
|
||||
(def-art-elt assistant-ag assistant-idle-welding-ja 9)
|
||||
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; assistant-firecanyon-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-lod0-jg 0)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-lod0-mg 1)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-shadow-mg 2)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-twist-ja 3)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-down-ja 4)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-examine-ja 5)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-up-ja 6)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-fiddle-ja 7)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-a-ja 8)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-to-b-ja 9)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-b-ja 10)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-to-a-ja 11)
|
||||
(def-art-elt assistant-firecanyon-ag assistant-firecanyon-idle-wipe-brow-ja 12)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; assistant-lavatube-end-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-lod0-jg 0)
|
||||
(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-lod0-mg 1)
|
||||
(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-shadow-mg 2)
|
||||
(def-art-elt assistant-lavatube-end-ag assistant-lavatube-end-idle-ja 3)
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; assistant-lavatube-start-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-lod0-jg 0)
|
||||
(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-lod0-mg 1)
|
||||
(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-shadow-mg 2)
|
||||
(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-idle-ja 3)
|
||||
(def-art-elt assistant-lavatube-start-ag assistant-lavatube-start-idle-b-ja 4)
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; assistant-village2-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt assistant-village2-ag assistant-village2-lod0-jg 0)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-lod0-mg 1)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-lod1-mg 2)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-lod2-mg 3)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-shadow-mg 4)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-a-ja 5)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-to-b-ja 6)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-b-ja 7)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-to-a-ja 8)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-after-ja 9)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-hut-breath-ja 10)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-hut-look-right-ja 11)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-hut-start-welding-ja 12)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-hut-welding-ja 13)
|
||||
(def-art-elt assistant-village2-ag assistant-village2-idle-hut-stop-welding-ja 14)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; assistant-village3-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt assistant-village3-ag assistant-village3-lod0-jg 0)
|
||||
(def-art-elt assistant-village3-ag assistant-village3-lod0-mg 1)
|
||||
(def-art-elt assistant-village3-ag assistant-village3-shadow-mg 2)
|
||||
(def-art-elt assistant-village3-ag assistant-village3-idle-ja 3)
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; babak-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt babak-ag babak-lod0-jg 0)
|
||||
(def-art-elt babak-ag babak-lod0-mg 1)
|
||||
(def-art-elt babak-ag babak-lod1-mg 2)
|
||||
(def-art-elt babak-ag babak-lod2-mg 3)
|
||||
(def-art-elt babak-ag babak-shadow-mg 4)
|
||||
(def-art-elt babak-ag babak-idle-ja 5)
|
||||
(def-art-elt babak-ag babak-walk-ja 6)
|
||||
(def-art-elt babak-ag babak-spot-ja 7)
|
||||
(def-art-elt babak-ag babak-charge-ja 8)
|
||||
(def-art-elt babak-ag babak-give-up-ja 9)
|
||||
(def-art-elt babak-ag babak-give-up-hop-ja 10)
|
||||
(def-art-elt babak-ag babak-win-ja 11)
|
||||
(def-art-elt babak-ag babak-death-ja 12)
|
||||
(def-art-elt babak-ag babak-jump-ja 13)
|
||||
(def-art-elt babak-ag babak-jump-land-ja 14)
|
||||
(def-art-elt babak-ag babak-taunt-ja 15)
|
||||
(def-art-elt babak-ag babak-turn-ja 16)
|
||||
(def-art-elt babak-ag babak-look-ja 17)
|
||||
(def-art-elt babak-ag babak-stop-look-ja 18)
|
||||
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; baby-spider-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt baby-spider-ag baby-spider-lod0-jg 0)
|
||||
(def-art-elt baby-spider-ag baby-spider-lod0-mg 1)
|
||||
(def-art-elt baby-spider-ag baby-spider-lod1-mg 2)
|
||||
(def-art-elt baby-spider-ag baby-spider-lod2-mg 3)
|
||||
(def-art-elt baby-spider-ag baby-spider-shadow-mg 4)
|
||||
(def-art-elt baby-spider-ag baby-spider-birth-ja 5)
|
||||
(def-art-elt baby-spider-ag baby-spider-idle-ja 6)
|
||||
(def-art-elt baby-spider-ag baby-spider-run-ja 7)
|
||||
(def-art-elt baby-spider-ag baby-spider-walk-ja 8)
|
||||
(def-art-elt baby-spider-ag baby-spider-jump-up-ja 9)
|
||||
(def-art-elt baby-spider-ag baby-spider-jump-land-ja 10)
|
||||
(def-art-elt baby-spider-ag baby-spider-notice-ja 11)
|
||||
(def-art-elt baby-spider-ag baby-spider-celebrate-ja 12)
|
||||
(def-art-elt baby-spider-ag baby-spider-die-ja 13)
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; balance-plat-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt balance-plat-ag balance-plat-lod0-jg 0)
|
||||
(def-art-elt balance-plat-ag balance-plat-lod0-mg 1)
|
||||
(def-art-elt balance-plat-ag balance-plat-lod1-mg 2)
|
||||
(def-art-elt balance-plat-ag balance-plat-lod2-mg 3)
|
||||
(def-art-elt balance-plat-ag balance-plat-idle-ja 4)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; balloon-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt balloon-ag balloon-lod0-jg 0)
|
||||
(def-art-elt balloon-ag balloon-lod0-mg 1)
|
||||
(def-art-elt balloon-ag balloon-lod1-mg 2)
|
||||
(def-art-elt balloon-ag balloon-idle-ja 3)
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; balloonlurker-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt balloonlurker-ag balloonlurker-lod0-jg 0)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-lod0-mg 1)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-lod1-mg 2)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-lod2-mg 3)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-idle-ja 4)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-death-ja 5)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-pilot-lod0-jg 6)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-pilot-lod0-mg 7)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-pilot-lod1-mg 8)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-pilot-lod2-mg 9)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-pilot-idle-ja 10)
|
||||
(def-art-elt balloonlurker-ag balloonlurker-pilot-death-ja 11)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; barrel-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt barrel-ag barrel-lod0-jg 0)
|
||||
(def-art-elt barrel-ag barrel-lod0-mg 1)
|
||||
(def-art-elt barrel-ag barrel-idle-ja 2)
|
||||
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; beachcam-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt beachcam-ag beachcam-lod0-jg 0)
|
||||
(def-art-elt beachcam-ag beachcam-ecoventrock-7-ja 8)
|
||||
(def-art-elt beachcam-ag beachcam-lod0-mg 1)
|
||||
(def-art-elt beachcam-ag beachcam-anim-ja 2)
|
||||
(def-art-elt beachcam-ag beachcam-ecoventrock-4-ja 4)
|
||||
(def-art-elt beachcam-ag beachcam-ecoventrock-5-ja 5)
|
||||
(def-art-elt beachcam-ag beachcam-ecoventrock-6-ja 6)
|
||||
(def-art-elt beachcam-ag beachcam-ecoventrock-3-ja 7)
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; billy-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt billy-ag billy-lod0-jg 0)
|
||||
(def-art-elt billy-ag billy-lod0-mg 1)
|
||||
(def-art-elt billy-ag billy-shadow-mg 2)
|
||||
(def-art-elt billy-ag billy-billy-after-ja 10)
|
||||
(def-art-elt billy-ag billy-idle-breath-ja 3)
|
||||
(def-art-elt billy-ag billy-idle-shoo-ja 4)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; billy-sidekick-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt billy-sidekick-ag billy-sidekick-lod0-jg 0)
|
||||
(def-art-elt billy-sidekick-ag billy-sidekick-lod0-mg 1)
|
||||
(def-art-elt billy-sidekick-ag billy-sidekick-idle-ja 2)
|
||||
(def-art-elt billy-sidekick-ag billy-sidekick-billy-after-ja 3)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bird-lady-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bird-lady-ag bird-lady-lod0-jg 0)
|
||||
(def-art-elt bird-lady-ag bird-lady-lod0-mg 1)
|
||||
(def-art-elt bird-lady-ag bird-lady-shadow-mg 2)
|
||||
(def-art-elt bird-lady-ag bird-lady-idle-ja 3)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bird-lady-beach-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bird-lady-beach-ag bird-lady-beach-lod0-jg 0)
|
||||
(def-art-elt bird-lady-beach-ag bird-lady-beach-lod0-mg 1)
|
||||
(def-art-elt bird-lady-beach-ag bird-lady-beach-shadow-mg 2)
|
||||
(def-art-elt bird-lady-beach-ag bird-lady-beach-idle-ja 3)
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bladeassm-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bladeassm-ag bladeassm-lod0-jg 0)
|
||||
(def-art-elt bladeassm-ag bladeassm-lod0-mg 1)
|
||||
(def-art-elt bladeassm-ag bladeassm-lod1-mg 2)
|
||||
(def-art-elt bladeassm-ag bladeassm-lod2-mg 3)
|
||||
(def-art-elt bladeassm-ag bladeassm-idle-ja 4)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; blue-eco-charger-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt blue-eco-charger-ag blue-eco-charger-lod0-jg 0)
|
||||
(def-art-elt blue-eco-charger-ag blue-eco-charger-lod0-mg 1)
|
||||
(def-art-elt blue-eco-charger-ag blue-eco-charger-open-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; blue-eco-charger-orb-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt blue-eco-charger-orb-ag blue-eco-charger-orb-lod0-jg 0)
|
||||
(def-art-elt blue-eco-charger-orb-ag blue-eco-charger-orb-lod0-mg 1)
|
||||
(def-art-elt blue-eco-charger-orb-ag blue-eco-charger-orb-idle-ja 2)
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bluesage-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bluesage-ag bluesage-lod0-jg 0)
|
||||
(def-art-elt bluesage-ag bluesage-lod0-mg 1)
|
||||
(def-art-elt bluesage-ag bluesage-lod1-mg 2)
|
||||
(def-art-elt bluesage-ag bluesage-shadow-mg 3)
|
||||
(def-art-elt bluesage-ag bluesage-bluesage-idle-ja 4)
|
||||
(def-art-elt bluesage-ag bluesage-bluesage-attack-start-ja 5)
|
||||
(def-art-elt bluesage-ag bluesage-bluesage-attack-loop-ja 6)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; boatpaddle-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt boatpaddle-ag boatpaddle-lod0-jg 0)
|
||||
(def-art-elt boatpaddle-ag boatpaddle-lod0-mg 1)
|
||||
(def-art-elt boatpaddle-ag boatpaddle-lod1-mg 2)
|
||||
(def-art-elt boatpaddle-ag boatpaddle-idle-ja 3)
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bonelurker-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bonelurker-ag bonelurker-lod0-jg 0)
|
||||
(def-art-elt bonelurker-ag bonelurker-lod0-mg 1)
|
||||
(def-art-elt bonelurker-ag bonelurker-lod1-mg 2)
|
||||
(def-art-elt bonelurker-ag bonelurker-lod2-mg 3)
|
||||
(def-art-elt bonelurker-ag bonelurker-shadow-mg 4)
|
||||
(def-art-elt bonelurker-ag bonelurker-idle-ja 5)
|
||||
(def-art-elt bonelurker-ag bonelurker-walk-ja 6)
|
||||
(def-art-elt bonelurker-ag bonelurker-spot-ja 7)
|
||||
(def-art-elt bonelurker-ag bonelurker-charge-ja 8)
|
||||
(def-art-elt bonelurker-ag bonelurker-charge-left-ja 9)
|
||||
(def-art-elt bonelurker-ag bonelurker-charge-right-ja 10)
|
||||
(def-art-elt bonelurker-ag bonelurker-give-up-ja 11)
|
||||
(def-art-elt bonelurker-ag bonelurker-give-up-hop-ja 12)
|
||||
(def-art-elt bonelurker-ag bonelurker-win-ja 13)
|
||||
(def-art-elt bonelurker-ag bonelurker-death-ja 14)
|
||||
(def-art-elt bonelurker-ag bonelurker-stun-ja 15)
|
||||
(def-art-elt bonelurker-ag bonelurker-turn-ja 16)
|
||||
(def-art-elt bonelurker-ag bonelurker-jump-ja 17)
|
||||
(def-art-elt bonelurker-ag bonelurker-jump-land-ja 18)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bounceytarp-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bounceytarp-ag bounceytarp-lod0-jg 0)
|
||||
(def-art-elt bounceytarp-ag bounceytarp-lod0-mg 1)
|
||||
(def-art-elt bounceytarp-ag bounceytarp-idle-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; breakaway-left-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt breakaway-left-ag breakaway-left-lod0-jg 0)
|
||||
(def-art-elt breakaway-left-ag breakaway-left-lod0-mg 1)
|
||||
(def-art-elt breakaway-left-ag breakaway-left-idle-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; breakaway-mid-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt breakaway-mid-ag breakaway-mid-lod0-jg 0)
|
||||
(def-art-elt breakaway-mid-ag breakaway-mid-lod0-mg 1)
|
||||
(def-art-elt breakaway-mid-ag breakaway-mid-idle-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; breakaway-right-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt breakaway-right-ag breakaway-right-lod0-jg 0)
|
||||
(def-art-elt breakaway-right-ag breakaway-right-lod0-mg 1)
|
||||
(def-art-elt breakaway-right-ag breakaway-right-idle-ja 2)
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; bully-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt bully-ag bully-lod0-jg 0)
|
||||
(def-art-elt bully-ag bully-lod0-mg 1)
|
||||
(def-art-elt bully-ag bully-lod1-mg 2)
|
||||
(def-art-elt bully-ag bully-lod2-mg 3)
|
||||
(def-art-elt bully-ag bully-shadow-mg 4)
|
||||
(def-art-elt bully-ag bully-idle-ja 5)
|
||||
(def-art-elt bully-ag bully-notice-jump-up-ja 6)
|
||||
(def-art-elt bully-ag bully-notice-land-ja 7)
|
||||
(def-art-elt bully-ag bully-start-spin-ja 8)
|
||||
(def-art-elt bully-ag bully-spin-ja 9)
|
||||
(def-art-elt bully-ag bully-die-ja 10)
|
||||
(def-art-elt bully-ag bully-idle-bounced-ja 11)
|
||||
(def-art-elt bully-ag bully-spin-bounced-ja 12)
|
||||
(def-art-elt bully-ag bully-dizzy-ja 13)
|
||||
(def-art-elt bully-ag bully-broken-cage-lod0-jg 14)
|
||||
(def-art-elt bully-ag bully-broken-cage-lod0-mg 15)
|
||||
(def-art-elt bully-ag bully-broken-cage-explode-ja 16)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; buzzer-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt buzzer-ag buzzer-lod0-jg 0)
|
||||
(def-art-elt buzzer-ag buzzer-lod0-mg 1)
|
||||
(def-art-elt buzzer-ag buzzer-idle-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; catch-fisha-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt catch-fisha-ag catch-fisha-lod0-jg 0)
|
||||
(def-art-elt catch-fisha-ag catch-fisha-lod0-mg 1)
|
||||
(def-art-elt catch-fisha-ag catch-fisha-idle-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; catch-fishb-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt catch-fishb-ag catch-fishb-lod0-jg 0)
|
||||
(def-art-elt catch-fishb-ag catch-fishb-lod0-mg 1)
|
||||
(def-art-elt catch-fishb-ag catch-fishb-idle-ja 2)
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; catch-fishc-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt catch-fishc-ag catch-fishc-lod0-jg 0)
|
||||
(def-art-elt catch-fishc-ag catch-fishc-lod0-mg 1)
|
||||
(def-art-elt catch-fishc-ag catch-fishc-idle-ja 2)
|
||||
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; cavecrusher-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt cavecrusher-ag cavecrusher-lod0-jg 0)
|
||||
(def-art-elt cavecrusher-ag cavecrusher-lod0-mg 1)
|
||||
(def-art-elt cavecrusher-ag cavecrusher-lod1-mg 2)
|
||||
(def-art-elt cavecrusher-ag cavecrusher-lod2-mg 3)
|
||||
(def-art-elt cavecrusher-ag cavecrusher-idle-ja 4)
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; cavecrystal-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt cavecrystal-ag cavecrystal-lod0-jg 0)
|
||||
(def-art-elt cavecrystal-ag cavecrystal-lod0-mg 1)
|
||||
(def-art-elt cavecrystal-ag cavecrystal-lod1-mg 2)
|
||||
(def-art-elt cavecrystal-ag cavecrystal-idle-ja 3)
|
||||
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; caveelevator-ag.gc - art group OpenGOAL import file
|
||||
;; THIS FILE IS AUTOMATICALLY GENERATED!
|
||||
|
||||
(def-art-elt caveelevator-ag caveelevator-lod0-jg 0)
|
||||
(def-art-elt caveelevator-ag caveelevator-lod0-mg 1)
|
||||
(def-art-elt caveelevator-ag caveelevator-cycle-12m-ja 2)
|
||||
(def-art-elt caveelevator-ag caveelevator-one-way-58m-ja 3)
|
||||
(def-art-elt caveelevator-ag caveelevator-one-way-58m-reverse-ja 4)
|
||||
(def-art-elt caveelevator-ag caveelevator-cycle-3-floors-36m-ja 5)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user