decomp: the majority of navigate and rolling-lightning-mole (#741)

* decomp: Add texture-upload to ref tests

* maybe 50% done?

* 5 functions to go!

* decomp: stuck in `navigate`

* work-around fp issue

* some cleanup and label casts

* working on supporting asm instructions -- this is currently WRONG

* support ASM operations

* fixes for asm op support

* decomp: finish the vast majority of `navigate`

* format

* update test though i think this suggests a regression!

* decomp: cleanup some more of navigate

* decomp: finish `rolling-lightning-mole`

* revert `r0` handling for `pcpyud` and `pextuw`

* update ref tests

* lint

* fix a failing test

* help

* navigate mostly works now, with some potential bugs

* remove my debugging logs

* update ref tests

* review feedback cleanup

* these are all likely fine

* can't get the crab to chase me anymore

* the crab is back
This commit is contained in:
Tyler Wilding
2022-01-18 01:14:47 -05:00
committed by GitHub
parent f8fa95f9bf
commit 142961a747
70 changed files with 11764 additions and 909 deletions
+22 -3
View File
@@ -58,13 +58,21 @@
}
]
},
"(\\d+\\(sp\\))": {
"filterFileRegex": ".*ir2\\.asm",
"decorations": [
{
"overviewRulerColor": "transparent",
"color": "#00ff08"
}
]
},
"(sp, -?\\d+ )": {
"filterFileRegex": ".*ir2\\.asm",
"decorations": [
{
"overviewRulerColor": "transparent",
"color": "#00ff08",
"fontWeight": "bold"
"color": "#00ff08"
}
]
},
@@ -282,7 +290,18 @@
}
]
},
"(WARN:.*)": {
"(WARN: Unsupported.*)": {
"filterFileRegex": ".*ir2\\.asm",
"decorations": [
{
"overviewRulerColor": "#ea00ff",
"color": "#ea00ff",
"fontWeight": "bold",
"filterFileRegex": ".*ir2\\.asm"
}
]
},
"(WARN: (?!Unsupported).*)": {
"filterFileRegex": ".*ir2\\.asm",
"decorations": [
{
+1 -1
View File
@@ -9,7 +9,7 @@ tasks:
ignore_error: true
run-game:
cmds:
- ./out/build/Release/bin/gk.exe -fakeiso -debug
- ./out/build/Release/bin/gk.exe -fakeiso -debug -v
run-game-headless:
cmds:
- ./out/build/Release/bin/gk.exe -fakeiso -debug -nodisplay
+10 -1
View File
@@ -306,6 +306,9 @@ std::string get_simple_expression_op_name(SimpleExpression::Kind kind) {
return "vec3dot";
case SimpleExpression::Kind::VECTOR_4_DOT:
return "vec4dot";
case SimpleExpression::Kind::SET_ON_LESS_THAN:
case SimpleExpression::Kind::SET_ON_LESS_THAN_IMM:
return "set-on-less-than";
default:
assert(false);
return {};
@@ -367,6 +370,9 @@ int get_simple_expression_arg_count(SimpleExpression::Kind kind) {
case SimpleExpression::Kind::VECTOR_3_DOT:
case SimpleExpression::Kind::VECTOR_4_DOT:
return 2;
case SimpleExpression::Kind::SET_ON_LESS_THAN:
case SimpleExpression::Kind::SET_ON_LESS_THAN_IMM:
return 2;
default:
assert(false);
return -1;
@@ -512,7 +518,10 @@ AsmOp::AsmOp(Instruction instr, int my_idx) : AtomicOp(my_idx), m_instr(std::mov
if (src.is_reg()) {
auto reg = src.get_reg();
if (reg.get_kind() == Reg::FPR || reg.get_kind() == Reg::GPR || reg.get_kind() == Reg::VF) {
m_src[i] = RegisterAccess(AccessMode::READ, reg, my_idx, true);
if (reg != Register(Reg::GPR, Reg::R0) ||
(m_instr.kind == InstructionKind::PCPYUD || m_instr.kind == InstructionKind::PEXTUW)) {
m_src[i] = RegisterAccess(AccessMode::READ, reg, my_idx, true);
}
}
}
}
+3 -1
View File
@@ -235,7 +235,9 @@ class SimpleExpression {
VECTOR_CROSS,
SUBU_L32_S7, // use SUBU X, src0, s7 to check if lower 32-bits are s7.
VECTOR_3_DOT,
VECTOR_4_DOT
VECTOR_4_DOT,
SET_ON_LESS_THAN,
SET_ON_LESS_THAN_IMM
};
// how many arguments?
+2 -1
View File
@@ -828,7 +828,8 @@ TypeState AsmOp::propagate_types_internal(const TypeState& input,
}
// sllv out, in, r0
if (m_instr.kind == InstructionKind::SLLV && m_src[1]->reg() == Register(Reg::GPR, Reg::R0)) {
if (m_instr.kind == InstructionKind::SLLV &&
instruction().src[1].is_reg(Register(Reg::GPR, Reg::R0))) {
auto type = dts.ts.lookup_type(result.get(m_src[0]->reg()).typespec());
auto as_bitfield = dynamic_cast<BitFieldType*>(type);
if (as_bitfield) {
+4
View File
@@ -572,6 +572,10 @@ class ConditionElement : public FormElement {
FormPool& pool,
const std::vector<Form*>& source_forms,
const std::vector<TypeSpec>& types);
FormElement* make_geq_zero_unsigned_check_generic(const Env& env,
FormPool& pool,
const std::vector<Form*>& source_forms,
const std::vector<TypeSpec>& types);
FormElement* make_geq_zero_signed_check_generic(const Env& env,
FormPool& pool,
const std::vector<Form*>& source_forms,
+32 -5
View File
@@ -1065,7 +1065,8 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
result->push_back(pool.alloc_element<DerefElement>(args.at(1), rd_ok.addr_of, tokens));
return;
} else {
lg::error("Bad is {}\n", args.at(0)->to_string(env));
// TODO - output error to IR
lg::error("Bad {} at OP: {}\n", args.at(0)->to_string(env), m_my_idx);
throw std::runtime_error("Failed to match product_with_constant inline array access 2.");
}
}
@@ -4022,6 +4023,31 @@ FormElement* ConditionElement::make_geq_zero_signed_check_generic(
}
}
FormElement* ConditionElement::make_geq_zero_unsigned_check_generic(
const Env& env,
FormPool& pool,
const std::vector<Form*>& source_forms,
const std::vector<TypeSpec>& types) {
assert(source_forms.size() == 1);
// (>= (shl (the-as int iter) 62) 0) -> (not (pair? iter))
// match (shl [(the-as int [x]) | [x]] 62)
auto shift_match =
match(Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::SHL),
{
Matcher::match_or({Matcher::cast("uint", Matcher::any(0)),
Matcher::any(0)}), // the val
Matcher::integer(62) // get the bit in the highest position.
}),
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));
casted.push_back(zero);
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::GEQ),
casted);
}
FormElement* ConditionElement::make_generic(const Env& env,
FormPool& pool,
const std::vector<Form*>& source_forms,
@@ -4092,6 +4118,10 @@ FormElement* ConditionElement::make_generic(const Env& env,
return make_geq_zero_signed_check_generic(env, pool, source_forms, types);
}
case IR2_Condition::Kind::GEQ_ZERO_UNSIGNED: {
return make_geq_zero_unsigned_check_generic(env, pool, source_forms, types);
}
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>(
@@ -4352,13 +4382,10 @@ void push_asm_sllv_to_stack(const AsmOp* op,
auto dst = op->dst();
assert(dst.has_value());
auto sav = op->src(1);
assert(sav.has_value());
auto arg0_type = env.get_variable_type(*var, true);
auto type_info = env.dts->ts.lookup_type(arg0_type);
auto bitfield_info = dynamic_cast<BitFieldType*>(type_info);
if (sav->reg() == Register(Reg::GPR, Reg::R0)) {
if (op->instruction().src[1].is_reg(Register(Reg::GPR, Reg::R0))) {
if (bitfield_info) {
auto base = pop_to_forms({*var}, env, pool, stack, true).at(0);
auto read_elt = pool.alloc_element<BitfieldAccessElement>(base, arg0_type);
+37 -14
View File
@@ -18,7 +18,7 @@ const std::map<InstructionKind, OpenGOALAsm::Function> MIPS_ASM_TO_OPEN_GOAL_FUN
{InstructionKind::PAND, {".pand", {}}},
// Parallel Pack
{InstructionKind::PPACH, {".ppach", {}}},
{InstructionKind::PPACH, {".ppach", {MOD::QWORD_CAST}}},
// Parallel Compares
{InstructionKind::PCEQB, {".pceqb", {}}},
@@ -42,6 +42,11 @@ const std::map<InstructionKind, OpenGOALAsm::Function> MIPS_ASM_TO_OPEN_GOAL_FUN
// lots of implicit logic in OpenGOAL depending on argument types!
{InstructionKind::MFC1, {".mov", {}}},
{InstructionKind::MOVN, {"move-if-not-zero", {}}}, // s7 special case is handled elsewhere
{InstructionKind::SLT, {"set-on-less-than", {}}},
{InstructionKind::SLTI, {"set-on-less-than", {}}},
{InstructionKind::SRA, {"shift-arith-right-32", {}}},
// ---- COP2 -----
// TODO - VMOVE supports dest, but OpenGOAL does NOT yet!
{InstructionKind::VMOVE, {".mov.vf", {MOD::DEST_MASK}}},
@@ -143,11 +148,11 @@ bool OpenGOALAsm::Function::allows_modifier(InstructionModifiers mod) {
return std::find(modifiers.begin(), modifiers.end(), mod) != modifiers.end();
}
OpenGOALAsm::OpenGOALAsm(Instruction _instr) : instr(_instr) {
if (MIPS_ASM_TO_OPEN_GOAL_FUNCS.count(instr.kind) == 0) {
OpenGOALAsm::OpenGOALAsm(Instruction _instr) : m_instr(_instr) {
if (MIPS_ASM_TO_OPEN_GOAL_FUNCS.count(m_instr.kind) == 0) {
valid = false;
} else {
func = MIPS_ASM_TO_OPEN_GOAL_FUNCS.at(instr.kind);
func = MIPS_ASM_TO_OPEN_GOAL_FUNCS.at(m_instr.kind);
if (func.funcTemplate.rfind("TODO", 0) == 0) {
todo = true;
}
@@ -157,11 +162,11 @@ OpenGOALAsm::OpenGOALAsm(Instruction _instr) : instr(_instr) {
OpenGOALAsm::OpenGOALAsm(Instruction _instr,
std::optional<RegisterAccess> _dst,
const std::vector<std::optional<RegisterAccess>>& _src)
: instr(_instr), m_dst(_dst), m_src(_src) {
if (MIPS_ASM_TO_OPEN_GOAL_FUNCS.count(instr.kind) == 0) {
: m_instr(_instr), m_dst(_dst), m_src(_src) {
if (MIPS_ASM_TO_OPEN_GOAL_FUNCS.count(m_instr.kind) == 0) {
valid = false;
} else {
func = MIPS_ASM_TO_OPEN_GOAL_FUNCS.at(instr.kind);
func = MIPS_ASM_TO_OPEN_GOAL_FUNCS.at(m_instr.kind);
if (func.funcTemplate.rfind("TODO", 0) == 0) {
todo = true;
}
@@ -172,8 +177,8 @@ std::string OpenGOALAsm::full_function_name() {
std::string func_name = func.funcTemplate;
// OpenGOAL uses the function name for broadcast specification
if (func.allows_modifier(MOD::BROADCAST)) {
if (instr.cop2_bc != 0xff) {
std::string bc = std::string(1, instr.cop2_bc_to_char());
if (m_instr.cop2_bc != 0xff) {
std::string bc = std::string(1, m_instr.cop2_bc_to_char());
func_name = fmt::format(func_name, bc);
}
}
@@ -186,9 +191,9 @@ std::vector<goos::Object> OpenGOALAsm::get_args(const std::vector<DecompilerLabe
std::vector<goos::Object> named_args;
bool got_fsf = false;
for (int i = 0; i < instr.n_src; i++) {
for (int i = 0; i < m_instr.n_src; i++) {
auto v = m_src.at(i);
InstructionAtom atom = instr.get_src(i);
InstructionAtom atom = m_instr.get_src(i);
if (v.has_value()) {
// Normal register / constant args
@@ -219,7 +224,19 @@ std::vector<goos::Object> OpenGOALAsm::get_args(const std::vector<DecompilerLabe
named_args.push_back(pretty_print::to_symbol(fmt::format(":offset {}", atom.get_imm())));
}
} else {
args.push_back(pretty_print::to_symbol(atom.to_string(labels)));
// if it's r0, replace it with a `0`
// unless it is pextuw or pcpyud
if (atom.is_reg() && atom.get_reg().get_kind() == decompiler::Reg::RegisterKind::GPR &&
atom.get_reg().reg_id() == decompiler::Reg::R0 &&
m_instr.kind != InstructionKind::PEXTUW && m_instr.kind != InstructionKind::PCPYUD) {
if (func.allows_modifier(MOD::QWORD_CAST)) {
args.push_back(pretty_print::to_symbol("(the-as uint128 0)"));
} else {
args.push_back(pretty_print::to_symbol("0"));
}
} else {
args.push_back(pretty_print::to_symbol(atom.to_string(labels)));
}
}
}
@@ -229,9 +246,10 @@ std::vector<goos::Object> OpenGOALAsm::get_args(const std::vector<DecompilerLabe
}
// Handle destination masks
if (func.allows_modifier(MOD::DEST_MASK) && instr.cop2_dest != 0xff && instr.cop2_dest != 15) {
if (func.allows_modifier(MOD::DEST_MASK) && m_instr.cop2_dest != 0xff &&
m_instr.cop2_dest != 15) {
named_args.push_back(
pretty_print::to_symbol(fmt::format(":mask #b{:b}", instr.cop2_dest_mask_intel())));
pretty_print::to_symbol(fmt::format(":mask #b{:b}", m_instr.cop2_dest_mask_intel())));
}
// Some functions are configured, or its easiest to swap the source args
@@ -240,6 +258,11 @@ std::vector<goos::Object> OpenGOALAsm::get_args(const std::vector<DecompilerLabe
std::swap(args.at(0), args.at(1));
}
if (m_instr.kind == InstructionKind::MOVZ || m_instr.kind == InstructionKind::MOVN) {
RegisterAccess ra(AccessMode::READ, m_dst->reg(), m_dst->idx());
args.push_back(ra.to_form(env));
}
args.insert(args.end(), named_args.begin(), named_args.end());
return args;
}
+3 -2
View File
@@ -22,7 +22,8 @@ struct OpenGOALAsm {
FSF,
OFFSET,
SWAP_FIRST_TWO_SOURCE_ARGS,
ACC_THIRD_SRC_ARG
ACC_THIRD_SRC_ARG,
QWORD_CAST
};
struct Function {
@@ -40,7 +41,7 @@ struct OpenGOALAsm {
bool valid = true;
bool todo = false;
Instruction instr;
Instruction m_instr;
std::optional<RegisterAccess> m_dst;
std::vector<std::optional<RegisterAccess>> m_src;
OpenGOALAsm::Function func;
+1 -1
View File
@@ -2201,4 +2201,4 @@ FunctionAtomicOps convert_function_to_atomic_ops(
assert(func.basic_blocks.size() == result.block_id_to_first_atomic_op.size());
return result;
}
} // namespace decompiler
} // namespace decompiler
+1 -1
View File
@@ -42,7 +42,7 @@ bool rewrite_inline_asm_instructions(Form* top_level_form,
/*lg::warn("[ASM Re-Write] - Unsupported inline assembly instruction kind - [{}]",
asmOp.instr.kind);*/
f.warnings.general_warning("Unsupported inline assembly instruction kind - [{}]",
asmOp.instr.to_string(f.ir2.env.file->labels));
asmOp.m_instr.to_string(f.ir2.env.file->labels));
new_entries.push_back(entry);
continue;
} else if (asmOp.todo) {
+267 -199
View File
@@ -647,20 +647,24 @@
:bitfield #t
:type uint32
(display-marks 0)
(bit1 1)
(bit2 2)
(bit3 3) ;; TODO - nav-enemy::45
(bit4 4)
(bit5 5) ;; TODO - nav-enemy::45
(bit6 6) ;; TODO - nav-enemy::45
(bit7 7) ;; TODO - nav-enemy::45
(bit1 1) ;; TODO - nav-control::9
(bit2 2) ;; TODO - nav-control::9
(bit3 3) ;; TODO - nav-enemy::45 | nav-control::9
(bit4 4) ;; TODO - nav-control::9
(bit5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9
(bit6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9
(bit7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9
(bit8 8)
(bit9 9) ;; TODO - nav-control::14 | 11
(bit10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post
(bit11 11) ;; TODO - nav-control::28
(bit12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy)
(bit13 13)
(bit17 17)
(bit19 19) ;; TODO - nav-enemy::lambda::17
(bit21 21)
(bit17 17) ;; TODO - nav-control::11
(bit18 18) ;; TODO - nav-control::11
(bit19 19) ;; TODO - nav-control::11 | 17
(bit20 20) ;; TODO - nav-mesh::28
(bit21 21) ;; TODO - nav-control::19
)
(defenum task-status
@@ -1959,7 +1963,7 @@
(deftype vector4w-3 (structure)
((data int32 12 :score -9999 :offset-assert 0)
(quad uint128 3 :offset 0)
(vector vector4w 3 :inline :offset 0)
(vector vector4w 3 :inline :score 100 :offset 0)
)
:method-count-assert 9
:size-assert #x30
@@ -10231,6 +10235,7 @@
(declare-type sparticle-launch-control basic)
(declare-type water-control basic)
(declare-type collide-shape basic)
(declare-type nav-control basic)
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
@@ -11182,6 +11187,54 @@
(mother-spider 13)
(cak-14 14) ;; unused
(blue-eco-suck 15) ;; manipy, orb-cache-top,
(unknown-16 16)
(unknown-17 17)
(unknown-18 18)
(unknown-19 19)
(unknown-20 20)
(unknown-21 21)
(unknown-22 22)
(unknown-23 23)
(unknown-24 24)
(unknown-25 25)
(unknown-26 26)
(unknown-27 27)
(unknown-28 28)
(unknown-29 29)
(unknown-30 30)
(unknown-31 31)
(unknown-32 32)
(unknown-33 33)
(unknown-34 34)
(unknown-35 35)
(unknown-36 36)
(unknown-37 37)
(unknown-38 38)
(unknown-39 39)
(unknown-40 40)
(unknown-41 41)
(unknown-42 42)
(unknown-43 43)
(unknown-44 44)
(unknown-45 45)
(unknown-46 46)
(unknown-47 47)
(unknown-48 48)
(unknown-49 49)
(unknown-50 50)
(unknown-51 51)
(unknown-52 52)
(unknown-53 53)
(unknown-54 54)
(unknown-55 55)
(unknown-56 56)
(unknown-57 57)
(unknown-58 58)
(unknown-59 59)
(unknown-60 60)
(unknown-61 61)
(unknown-62 62)
(unknown-63 63)
)
(defenum collide-action
@@ -15257,6 +15310,7 @@
(adj-poly uint8 3 :offset-assert 4)
(pat uint8 :offset-assert 7)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
@@ -15285,10 +15339,10 @@
(next-poly nav-poly :offset-assert 52)
(len meters :offset-assert 56)
(last-edge int8 :offset-assert 60)
(terminated basic :offset-assert 64)
(reached-dest basic :offset-assert 68)
(hit-boundary basic :offset-assert 72)
(hit-gap basic :offset-assert 76)
(terminated symbol :offset-assert 64) ;; TODO - guesses
(reached-dest symbol :offset-assert 68) ;; TODO - guesses
(hit-boundary symbol :offset-assert 72) ;; TODO - guesses
(hit-gap symbol :offset-assert 76) ;; TODO - guesses
)
:method-count-assert 9
:size-assert #x50
@@ -15306,7 +15360,7 @@
)
(deftype clip-travel-vector-to-mesh-return-info (structure)
((found-boundary basic :offset-assert 0)
((found-boundary symbol :offset-assert 0)
(intersection vector :inline :offset-assert 16)
(boundary-normal vector :inline :offset-assert 32)
(prev-normal vector :inline :offset-assert 48)
@@ -15366,46 +15420,60 @@
(deftype nav-mesh (basic)
((user-list engine :offset-assert 4)
(poly-lookup-history uint8 2 :offset-assert 8)
(poly-lookup-history uint8 2 :offset-assert 8)
(debug-time uint8 :offset-assert 10)
(static-sphere-count uint8 :offset-assert 11)
(static-sphere uint32 :offset-assert 12)
(static-sphere (inline-array nav-sphere) :offset-assert 12)
(bounds sphere :inline :offset-assert 16)
(origin vector :inline :offset-assert 32)
(cache nav-lookup-elem 4 :inline :offset-assert 48) ;; guess on type
(node-count int32 :offset-assert 176)
(nodes uint32 :offset-assert 180)
(nodes (inline-array nav-node) :offset-assert 180)
(vertex-count int32 :offset-assert 184)
(vertex (inline-array vector) :offset-assert 188)
(vertex (inline-array nav-vertex) :offset-assert 188)
(poly-count int32 :offset-assert 192)
(poly uint32 :offset-assert 196)
(route uint32 :offset-assert 200)
(poly (inline-array nav-poly) :offset-assert 196)
(route (inline-array vector4ub) :offset-assert 200) ;; this is a guess, it's probably wrong -- but its something with a uint8 at offset 0
)
:method-count-assert 30
:size-assert #xcc
:flag-assert #x1e000000cc
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 (_type_) none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-18 () none 18)
(tri-centroid-world (_type_ nav-poly vector) vector 9) ;; finds the centroid of the given triangle, in the "world" coordinate system.
(tri-centroid-local (_type_ nav-poly vector) vector 10) ;; finds the centroid of the given triangle, in the local nav-mesh coordinate system.
(get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11)
(setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) ;; sets up a portal between two polys.
(initialize-mesh! (_type_) none 13)
(move-along-nav-ray! (_type_ nav-ray) none 14) ;; think this updates the current position in a nav-ray, and updates which triangle you're in.
;; this takes in a point/direction/distance, and see what would happen if you tried to move this way.
;; it returns the distance you can go before one of these happens:
;; - you reach the destination
;; - you hit a nav mesh boundary/gap
;; - you cross 15 triangles.
(try-move-along-ray (_type_ nav-poly vector vector float) meters 15)
(TODO-RENAME-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16)
(update-route-table (_type_) none 17) ;; (initialization related)
(dummy-18 (_type_ int vector int (pointer int8) int) none 18) ;; something to do with routes.
(compute-bounding-box (_type_ vector vector) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(debug-draw-poly (_type_ nav-poly rgba) none 20) ;; TODO - is rgba a vector4w?
(point-in-poly? (_type_ nav-poly vector) symbol 21) ;; is the point inside of the triangle?
(find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) ;; given two triangles that share an edge, get the indices of the two vertices that aren't part of the edge.
(dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23)
(closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) ;; find the closest point on the perimeter of the triangle.
(project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) ;; will move a 3D point in space to the surface of this nav-poly
;; Looking from the top down, is the point inside the nav-poly?
;; - if the point is inside the triangle, returns that point.
;; - if the point is outside the triangle, move it to the closest point (will be on the edge)
(project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26)
;; finds which triangle the given point is in.
;; also has some caching stuff so if you look up the same point multiple times, it won't redo the work.
;; I _think_ this is only an approximate check that may return #f even if you are inside.
;; But, if it returns a poly, it will be right.
(find-poly-fast (_type_ vector meters) nav-poly 27)
(find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) ;; The accurate version of find-poly (tries find-poly-fast first)
;; checks to see if the triangle is in the mesh or not.
;; not sure why it's separate from 27 (and such a different implementation). there might be some details I'm missing here.
(is-in-mesh? (_type_ vector float meters) symbol 29)
)
)
@@ -15461,31 +15529,31 @@
:flag-assert #x24000000e0
(:methods
(new (symbol type collide-shape int float) _type_)
(dummy-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(point-in-bounds? (_type_ vector) symbol 10)
(dummy-11 (_type_ vector) none 11)
(dummy-12 () none 12)
(dummy-13 (_type_ vector vector) vector 13) ;; see - puffer::20
(dummy-11 (_type_ vector) vector 11)
(TODO-RENAME-12 (_type_ nav-gap-info) symbol 12)
(dummy-13 (_type_ vector vector) vector 13) ;; see - puffer::20 | second vector may be clip-travel-vector-to-mesh-return-info though
(set-current-poly! (_type_ nav-poly) none 14)
(set-target-pos! (_type_ vector) none 15)
(dummy-16 (_type_ vector) nav-poly 16) ; see - nav-enemy-test-point-in-nav-mesh?
(dummy-17 (_type_ vector vector) none 17)
(TODO-RENAME-18 (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ vector) symbol 21)
(dummy-22 () none 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed
(project-onto-nav-mesh (_type_ vector vector) vector 17) ;; moves point to nav-mesh.
(find-poly (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19) ;; csm not trsqv? ret not vector?
(project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20)
(TODO-RENAME-21 (_type_ vector) nav-poly 21)
(TODO-RENAME-22 (_type_ vector float) symbol 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed maybe (dummy-23 (_type_ vector matrix) float 23)
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)
(dummy-25 (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh?
(dummy-26 (_type_) none 26)
(dummy-27 (_type_) none 27)
(dummy-28 (_type_ int) none 28)
(is-in-mesh? (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh?
(TODO-RENAME-26 (_type_) none 26) ;; stub
(TODO-RENAME-27 (_type_) none 27)
(TODO-RENAME-28 (_type_ collide-kind) none 28)
(should-display? (_type_) symbol 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-30 (_type_ vector vector vector) sphere 30) ;; TODO - last arg? - it has a float as the first arg, vector is a total guess
(intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31)
(TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32)
(TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33)
(dummy-34 () none 34)
(dummy-35 (_type_ vector vector vector vector float) none 35)
)
@@ -20601,149 +20669,149 @@
;; - Types
; (deftype cfs-travel-vec (structure)
; ((dir vector :inline :offset-assert 0)
; (delta-angle float :offset-assert 16)
; )
; :method-count-assert 9
; :size-assert #x14
; :flag-assert #x900000014
; )
(deftype cfs-travel-vec (structure)
((dir vector :inline :offset-assert 0)
(delta-angle float :offset-assert 16)
)
:method-count-assert 9
:size-assert #x14
:flag-assert #x900000014
)
; (deftype cfs-work (structure)
; ((desired-travel-dist float :offset-assert 0)
; (desired-angle float :offset-assert 4)
; (max-dist float :offset-assert 8)
; (old-angle float :offset-assert 12)
; (modified int32 :offset-assert 16)
; (blocked-mask uint64 :offset-assert 24)
; (travel vector :inline :offset-assert 32)
; (current vector :inline :offset-assert 48)
; (new-travel UNKNOWN 2 :offset-assert 64)
; (temp-travel UNKNOWN 2 :offset-assert 128)
; (prev-dir vector :inline :offset-assert 192)
; (attempt-dir vector :inline :offset-assert 208)
; (tangent UNKNOWN 2 :offset-assert 224)
; )
; :method-count-assert 9
; :size-assert #x100
; :flag-assert #x900000100
; )
(deftype cfs-work (structure)
((desired-travel-dist float :offset-assert 0)
(desired-angle float :offset-assert 4)
(max-dist float :offset-assert 8)
(old-angle float :offset-assert 12)
(modified int32 :offset-assert 16)
(blocked-mask uint64 :offset-assert 24)
(travel vector :inline :offset-assert 32)
(current vector :inline :offset-assert 48)
(new-travel cfs-travel-vec 2 :inline :offset-assert 64)
(temp-travel cfs-travel-vec 2 :inline :offset-assert 128)
(prev-dir vector :inline :offset-assert 192)
(attempt-dir vector :inline :offset-assert 208)
(tangent vector 2 :inline :offset-assert 224)
)
:method-count-assert 9
:size-assert #x100
:flag-assert #x900000100
)
; (deftype nav-control-cfs-work (structure)
; ((in-dir vector :inline :offset-assert 0)
; (right-dir vector :inline :offset-assert 16)
; (best-dir UNKNOWN 2 :offset-assert 32)
; (temp-dir UNKNOWN 2 :offset-assert 64)
; (away-dir vector :inline :offset-assert 96)
; (best-dir-angle UNKNOWN 2 :offset-assert 112)
; (ignore-mask uint64 :offset-assert 120)
; (initial-ignore-mask uint64 :offset-assert 128)
; (i-sphere int32 :offset-assert 136)
; (i-first-sphere int32 :offset-assert 140)
; (i-inside-sphere int32 :offset-assert 144)
; (inside-sphere-dist float :offset-assert 148)
; (sign float :offset-assert 152)
; (travel-len float :offset-assert 156)
; (dist2 float :offset-assert 160)
; (inside-dist float :offset-assert 164)
; (rand-angle float :offset-assert 168)
; (dir-update basic :offset-assert 172)
; (debug-offset vector :inline :offset-assert 176)
; )
; :method-count-assert 9
; :size-assert #xc0
; :flag-assert #x9000000c0
; )
(deftype nav-control-cfs-work (structure)
((in-dir vector :inline :offset-assert 0)
(right-dir vector :inline :offset-assert 16)
(best-dir vector 2 :inline :offset-assert 32)
(temp-dir vector 2 :inline :offset-assert 64)
(away-dir vector :inline :offset-assert 96)
(best-dir-angle degrees 2 :offset-assert 112) ;; maybe degs?
(ignore-mask uint64 :offset-assert 120)
(initial-ignore-mask uint64 :offset-assert 128)
(i-sphere int32 :offset-assert 136)
(i-first-sphere int32 :offset-assert 140)
(i-inside-sphere int32 :offset-assert 144)
(inside-sphere-dist float :offset-assert 148)
(sign float :offset-assert 152)
(travel-len float :offset-assert 156)
(dist2 float :offset-assert 160)
(inside-dist float :offset-assert 164)
(rand-angle float :offset-assert 168)
(dir-update basic :offset-assert 172)
(debug-offset vector :inline :offset-assert 176)
)
:method-count-assert 9
:size-assert #xc0
:flag-assert #x9000000c0
)
;; - Functions
(define-extern test-xz-point-on-line-segment? function)
(define-extern ray-ccw-line-segment-intersection? function)
(define-extern choose-travel-portal-vertex function)
(define-extern init-ray function)
(define-extern ray-line-segment-intersection? function)
(define-extern point-triangle-distance-min function)
(define-extern nav-mesh-update-route-table function)
(define-extern nav-mesh-lookup-route function)
(define-extern nav-ray-test-local? function)
(define-extern init-ray-local function)
(define-extern init-ray-dir-local function)
(define-extern circle-triangle-intersection? function)
(define-extern point-inside-rect? function)
(define-extern recursive-inside-poly function)
(define-extern point-inside-poly? function)
(define-extern vu-point-triangle-intersection? function)
(define-extern pke-nav-hack function)
(define-extern debug-report-nav-stats function)
(define-extern inc-mod3 function)
(define-extern dec-mod3 function)
(define-extern circle-triangle-intersection-proc? function)
(define-extern nav-ray-test function)
(define-extern clip-vector-to-halfspace! function)
(define-extern add-nav-sphere function)
(define-extern add-collide-shape-spheres function)
(define-extern circle-tangent-directions function)
(define-extern find-closest-circle-ray-intersection function)
(define-extern sign-bit function)
(define-extern compute-dir-parm function)
(define-extern debug-nav-validate-current-poly function)
(define-extern start-collect-nav function)
(define-extern end-collect-nav function)
(define-extern nav-sphere-from-cam function)
(define-extern test-xz-point-on-line-segment? (function vector vector vector float symbol))
(define-extern ray-ccw-line-segment-intersection? (function vector vector vector vector symbol))
(define-extern choose-travel-portal-vertex (function nav-mesh nav-route-portal nav-poly vector int))
(define-extern init-ray (function nav-ray symbol))
(define-extern ray-line-segment-intersection? (function vector vector vector vector symbol))
(define-extern point-triangle-distance-min (function vector float (inline-array nav-vertex) float))
(define-extern nav-mesh-update-route-table (function nav-mesh int int uint uint))
(define-extern nav-mesh-lookup-route (function nav-mesh int int uint))
(define-extern nav-ray-test-local? (function nav-mesh nav-poly vector vector symbol))
(define-extern init-ray-local (function nav-ray nav-poly vector vector symbol))
(define-extern init-ray-dir-local (function nav-ray nav-poly vector vector float symbol))
(define-extern circle-triangle-intersection? (function vector float (inline-array nav-vertex) symbol))
(define-extern point-inside-rect? (function nav-node vector float symbol))
(define-extern recursive-inside-poly (function nav-mesh nav-node vector float int)) ;; unused
(define-extern point-inside-poly? (function nav-mesh uint vector float symbol))
(define-extern vu-point-triangle-intersection? (function vector vector vector vector symbol))
(define-extern pke-nav-hack (function none))
(define-extern debug-report-nav-stats (function none)) ;; empty stub
(define-extern inc-mod3 (function int int))
(define-extern dec-mod3 (function int int))
(define-extern circle-triangle-intersection-proc? (function vector float (inline-array nav-vertex) symbol))
(define-extern nav-ray-test (function nav-mesh nav-poly vector vector meters))
(define-extern clip-vector-to-halfspace! (function vector float float float float))
(define-extern add-nav-sphere (function nav-control vector none))
(define-extern add-collide-shape-spheres (function nav-control collide-shape vector none)) ;; unused
(define-extern circle-tangent-directions (function vector vector vector vector vector))
(define-extern find-closest-circle-ray-intersection (function vector vector float int (inline-array vector) int int)) ;; last int arg may be a float but...it does a logand with it
(define-extern sign-bit (function int int))
(define-extern compute-dir-parm (function vector vector vector float))
(define-extern debug-nav-validate-current-poly (function nav-mesh nav-poly vector symbol)) ;; unused
(define-extern start-collect-nav (function none))
(define-extern end-collect-nav (function none))
(define-extern nav-sphere-from-cam (function none))
;; - Unknowns
;;(define-extern *edge-vert0-table* object) ;; unknown type
;;(define-extern *edge-vert1-table* object) ;; unknown type
;;(define-extern *edge-mask-table* object) ;; unknown type
;;(define-extern *nav-patch-route-table* object) ;; unknown type
;;(define-extern *nav-timer* object) ;; unknown type
;;(define-extern *nav-update-route-table-ray-count* object) ;; unknown type
;;(define-extern *nav-update-route-table-route-count* object) ;; unknown type
;;(define-extern *debug-traverse* object) ;; unknown type
;;(define-extern *debug-tests* object) ;; unknown type
;;(define-extern *color-red* object) ;; unknown type
;;(define-extern *color-blue* object) ;; unknown type
;;(define-extern *color-green* object) ;; unknown type
;;(define-extern *color-cyan* object) ;; unknown type
;;(define-extern *color-yellow* object) ;; unknown type
;;(define-extern *color-white* object) ;; unknown type
;;(define-extern *travel-timer* object) ;; unknown type
;;(define-extern *clip-for-spheres-timer* object) ;; unknown type
;;(define-extern *find-poly-timer* object) ;; unknown type
;;(define-extern *nav-timer-enable* object) ;; unknown type
;;(define-extern *nav-triangle-test-count* object) ;; unknown type
;;(define-extern *nav-last-triangle-test-count* object) ;; unknown type
;;(define-extern *debug-output* object) ;; unknown type
;;(define-extern *debug-nav* object) ;; unknown type
;;(define-extern *debug-nav-ray* object) ;; unknown type
;;(define-extern *debug-ray-offset* object) ;; unknown type
;;(define-extern *debug-nav-travel* object) ;; unknown type
;;(define-extern *color-black* object) ;; unknown type
;;(define-extern *color-gray* object) ;; unknown type
;;(define-extern *color-magenta* object) ;; unknown type
;;(define-extern *color-light-red* object) ;; unknown type
;;(define-extern *color-light-green* object) ;; unknown type
;;(define-extern *color-light-blue* object) ;; unknown type
;;(define-extern *color-light-cyan* object) ;; unknown type
;;(define-extern *color-light-magenta* object) ;; unknown type
;;(define-extern *color-light-yellow* object) ;; unknown type
;;(define-extern *color-dark-red* object) ;; unknown type
;;(define-extern *color-dark-green* object) ;; unknown type
;;(define-extern *color-dark-blue* object) ;; unknown type
;;(define-extern *color-dark-cyan* object) ;; unknown type
;;(define-extern *color-dark-magenta* object) ;; unknown type
;;(define-extern *color-dark-yellow* object) ;; unknown type
;;(define-extern *color-orange* object) ;; unknown type
;;(define-extern *nav-one-third* object) ;; unknown type
;;(define-extern *debug-offset* object) ;; unknown type
;;(define-extern *debug-ray-test* object) ;; unknown type
;;(define-extern *debug-ray-test-capture-mode* object) ;; unknown type
;;(define-extern *debug-ray-test-capture-output* object) ;; unknown type
;;(define-extern *test-ray-start-poly-id* object) ;; unknown type
;;(define-extern *test-ray-src-pos* object) ;; unknown type
;;(define-extern *test-ray-dest-pos* object) ;; unknown type
(define-extern *edge-vert0-table* (array int8))
(define-extern *edge-vert1-table* (array int8))
(define-extern *edge-mask-table* (array int8))
(define-extern *nav-patch-route-table* symbol)
(define-extern *nav-timer* stopwatch)
(define-extern *nav-update-route-table-ray-count* int)
(define-extern *nav-update-route-table-route-count* int)
(define-extern *debug-traverse* int)
(define-extern *debug-tests* int)
(define-extern *color-red* rgba)
(define-extern *color-blue* rgba)
(define-extern *color-green* rgba)
(define-extern *color-cyan* rgba)
(define-extern *color-yellow* rgba)
(define-extern *color-white* rgba)
(define-extern *travel-timer* stopwatch)
(define-extern *clip-for-spheres-timer* stopwatch)
(define-extern *find-poly-timer* stopwatch)
(define-extern *nav-timer-enable* symbol)
(define-extern *nav-triangle-test-count* int)
(define-extern *nav-last-triangle-test-count* int)
(define-extern *debug-output* symbol) ;; TODO - could be wrong
(define-extern *debug-nav* symbol)
(define-extern *debug-nav-ray* nav-ray)
(define-extern *debug-ray-offset* vector) ;; TODO - or some other 4 word type
(define-extern *debug-nav-travel* symbol) ;; TODO - ??
(define-extern *color-black* rgba)
(define-extern *color-gray* rgba)
(define-extern *color-magenta* rgba)
(define-extern *color-light-red* rgba)
(define-extern *color-light-green* rgba)
(define-extern *color-light-blue* rgba)
(define-extern *color-light-cyan* rgba)
(define-extern *color-light-magenta* rgba)
(define-extern *color-light-yellow* rgba)
(define-extern *color-dark-red* rgba)
(define-extern *color-dark-green* rgba)
(define-extern *color-dark-blue* rgba)
(define-extern *color-dark-cyan* rgba)
(define-extern *color-dark-magenta* rgba)
(define-extern *color-dark-yellow* rgba)
(define-extern *color-orange* rgba)
(define-extern *nav-one-third* vector)
(define-extern *debug-offset* vector) ;; TODO - or some other 4 word type
(define-extern *debug-ray-test* nav-ray) ;; TODO - ??
(define-extern *debug-ray-test-capture-mode* symbol) ;; TODO - ??
(define-extern *debug-ray-test-capture-output* symbol) ;; TODO - ??
(define-extern *test-ray-start-poly-id* int)
(define-extern *test-ray-src-pos* vector) ;; TODO - or some other 4 word type
(define-extern *test-ray-dest-pos* vector) ;; TODO - or some other 4 word type
;; ----------------------
@@ -31883,11 +31951,11 @@
(define-extern lightning-mole-task-complete? (function symbol :behavior lightning-mole))
(define-extern fleeing-nav-enemy-clip-travel (function fleeing-nav-enemy vector symbol))
(define-extern fleeing-nav-enemy-adjust-travel (function fleeing-nav-enemy vector))
(define-extern fleeing-nav-enemy-adjust-travel (function fleeing-nav-enemy object vector)) ;; unused second arg
(define-extern fleeing-nav-enemy-chase-post-func (function float :behavior fleeing-nav-enemy))
(define-extern fleeing-nav-enemy-adjust-nav-info (function float :behavior fleeing-nav-enemy))
(define-extern find-adjacent-bounds-one function)
(define-extern find-adjacent-bounds (function basic clip-travel-vector-to-mesh-return-info none))
(define-extern find-adjacent-bounds-one (function nav-mesh nav-poly int (array int8) (array int8) vector symbol))
(define-extern find-adjacent-bounds (function nav-mesh clip-travel-vector-to-mesh-return-info none))
(define-extern fleeing-nav-enemy-chase-post (function none :behavior fleeing-nav-enemy))
(define-extern lightning-mole-hole-post (function none :behavior lightning-mole))
(define-extern lightning-mole-run-code (function none :behavior lightning-mole))
@@ -275,9 +275,6 @@
// memory-usage BUG
//"(method 14 level)",
// navigate BUG
"(method 32 nav-control)",
// ocean
"draw-large-polygon-ocean", // CFG
@@ -496,9 +493,13 @@
"(anon-function 9 racer)" : [75],
"(method 13 collide-edge-work)" : [0, 2],
"(method 17 collide-edge-work)" : [0, 1, 2, 3, 4],
"(method 9 edge-grab-info)" : [15, 16, 18, 19, 21, 22, 24]
// "(method 18 collide-edge-work)" : [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24]
"(method 9 edge-grab-info)" : [15, 16, 18, 19, 21, 22, 24],
// "(method 18 collide-edge-work)" : [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24],
"target-falling-anim-trans" : [5, 6],
"(method 27 nav-mesh)" : [8],
"(method 32 nav-control)": [12, 21, 32],
"start-collect-nav": [0],
"end-collect-nav": [0]
},
// Sometimes the game might use format strings that are fetched dynamically,
@@ -1609,11 +1609,17 @@
"rolling-lightning-mole": [
["L181", "vector"],
["L185", "rgba", true],
["L186", "rgba", true],
["L187", "rgba", true],
["L189", "rgba", true],
["L195", "vector"]
["L185", "vector4w"],
["L186", "vector4w"],
["L187", "vector4w"],
["L189", "vector4w"],
["L195", "vector"],
["L201", "vector4w"],
["L202", "vector4w"],
["L203", "vector4w"],
["L204", "vector4w"],
["L205", "vector4w"],
["L206", "vector4w"]
],
"rolling-robber": [
@@ -2080,11 +2086,31 @@
["L38", "vector"]
],
"depth-cue": [
["L17", "depth-cue-work"]
],
"navigate": [
["L402", "vector"],
["L403", "vector"],
["L404", "vector"],
["L405", "vector"],
["L406", "vector"],
["L422", "vector"],
["L419", "(pointer uint8)", 4],
["L425", "float", true],
["L426", "float", true],
["L429", "float", true],
["L430", "float", true],
["L436", "float", true],
["L438", "float", true],
["L444", "float", true],
["L442", "float", true],
["L520", "vector"],
["L522", "float", true], // TODO - meters
["L523", "float", true] // TODO - meters
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
}
@@ -6199,5 +6199,159 @@
[48, "event-message-block"]
],
"(method 20 nav-mesh)": [
[16, "vector"],
[32, "vector"]
],
"nav-ray-test": [
[16, "vector"],
[32, "vector"]
],
"circle-tangent-directions": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"(method 18 nav-control)": [
[16, "vector"]
],
"(method 9 nav-control)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "vector"],
[96, "vector"],
[112, "vector"],
[128, "vector"],
[144, "vector"],
[160, "vector"],
[176, "vector"]
],
"(method 11 nav-control)": [
[16, "vector"],
[32, "nav-gap-info"],
[64, "event-message-block"]
],
"(method 12 nav-control)": [
[16, "vector"]
],
"(method 13 nav-mesh)": [
[16, "vector"]
],
"(method 18 nav-mesh)": [
[16, "vector"]
],
"(method 24 nav-control)": [
[16, "vector"]
],
"(method 24 nav-mesh)": [
[16, "vector"],
[32, "vector"]
],
"(method 22 nav-control)": [
[16, "vector"]
],
"(method 17 nav-control)": [
[16, "vector"]
],
"(method 19 nav-control)": [
[16, "vector"],
[32, "vector"]
],
"(method 17 nav-mesh)": [
[16, "vector"],
[32, "vector"],
[48, ["array", "int8", 256]]
],
"(method 25 nav-mesh)": [
[16, "vector"],
[32, "matrix"]
],
"debug-nav-validate-current-poly": [
[16, "vector"]
],
"(method 13 nav-control)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "nav-route-portal"], // nav-poly | nav-route-portal | nav-route-portal
[112, "vector"],
[128, "clip-travel-vector-to-mesh-return-info"],
[288, "vector"]
],
"(method 28 nav-mesh)": [
[16, ["inline-array", "nav-vertex", 3]]
],
"choose-travel-portal-vertex": [
[16, "nav-route-portal"]
],
"(method 33 nav-control)": [
[16, "event-message-block"]
],
"(method 27 nav-control)": [
[16, "nav-ray"]
],
"(method 16 nav-mesh)": [
[16, "nav-ray"]
],
"(method 29 nav-mesh)": [
[16, ["inline-array", "nav-vertex", 6]]
],
"find-closest-circle-ray-intersection": [
[16, "vector"]
],
"(method 20 nav-control)": [
[16, "vector"]
],
"(method 21 nav-control)": [
[16, "vector"]
],
"(method 23 nav-control)": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"(method 16 nav-control)": [
[16, "vector"]
],
"(method 25 nav-control)": [
[16, "vector"]
],
"(method 28 nav-control)": [
[16, "vector"]
],
"(method 35 nav-control)": [
[16, "vector"]
],
"(method 15 nav-mesh)": [
[16, "nav-ray"]
],
"nav-ray-test-local?": [
[16, "nav-ray"]
],
"find-adjacent-bounds": [
[16, "vector"]
],
"(method 32 nav-control)": [
[16, "nav-control-cfs-work"]
],
"placeholder-do-not-add-below!": []
}
@@ -7775,5 +7775,52 @@
[29, "a0", "process-drawable"],
[156, "s5", "collide-shape-prim"]
],
"circle-triangle-intersection-proc?": [
[[113, 134], "v1", "vector"]
],
"(method 28 nav-control)": [
[170, "v1", "connection"],
[[170, 245], "s0", "collide-shape"]
],
"(method 29 nav-mesh)": [
[38, "v1", "int"],
[40, "v1", "int"],
[41, "v1", "int"],
[64, "f1", "float"],
[63, "v1", "float"]
],
"nav-mesh-update-route-table": [
[19, "a3", "(pointer uint8)"],
[24, "a0", "(pointer uint8)"]
],
"nav-mesh-lookup-route": [
[6, "a0", "(pointer uint8)"]
],
"(method 11 nav-mesh)": [
[12, "a2", "(pointer uint8)"]
],
"(method 12 nav-mesh)": [
[13, "a2", "(pointer uint8)"]
],
"recursive-inside-poly": [
[16, "a0", "(pointer nav-node)"],
[29, "v1", "(pointer nav-node)"]
],
"entity-nav-login": [
["_stack_", 16, "res-tag"]
],
"(method 18 nav-mesh)": [
[34, "v1", "nav-poly"]
],
"placeholder-do-not-add-below": []
}
@@ -3944,5 +3944,33 @@
}
},
"recursive-inside-poly": {
"vars": {
"a1-2": ["a1-2", "nav-node"]
}
},
"vu-point-triangle-intersection?": {
"vars": {
"v1-0": ["v1-0", "int"],
"a0-1": ["a0-1", "int"],
"a1-1": ["a1-1", "int"]
}
},
"point-inside-poly?": {
"vars": {
"v1-6": ["v1-6", "int"],
"a0-3": ["a0-3", "int"],
"a1-6": ["a1-6", "int"]
}
},
"(method 29 nav-mesh)": {
"vars": {
"v1-10": ["v1-10", "int"]
}
},
"aaaaaaaaaaaaaaaaaaaaaaa": {}
}
+48 -2
View File
@@ -336,8 +336,9 @@ goos::Object decomp_ref_to_inline_array_guess_size(
// verify the stride matches the type system
auto elt_type_info = ts.lookup_type(array_elt_type);
assert(stride == align(elt_type_info->get_size_in_memory(),
elt_type_info->get_inline_array_stride_alignment()));
int ye = align(elt_type_info->get_size_in_memory(),
elt_type_info->get_inline_array_stride_alignment());
assert(stride == ye);
// the input is the location of the data field.
// we expect that to be a label:
@@ -450,6 +451,39 @@ goos::Object sp_field_init_spec_decompile(const std::vector<LinkedWord>& words,
file, TypeSpec("sp-field-init-spec"), 16);
}
goos::Object nav_mesh_vertex_arr_decompile(const std::vector<LinkedWord>& words,
const std::vector<DecompilerLabel>& labels,
int my_seg,
int field_location,
const TypeSystem& ts,
const std::vector<std::vector<LinkedWord>>& all_words,
const LinkedObjectFile* file) {
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words,
file, TypeSpec("nav-vertex"), 16);
}
goos::Object nav_mesh_poly_arr_decompile(const std::vector<LinkedWord>& words,
const std::vector<DecompilerLabel>& labels,
int my_seg,
int field_location,
const TypeSystem& ts,
const std::vector<std::vector<LinkedWord>>& all_words,
const LinkedObjectFile* file) {
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words,
file, TypeSpec("nav-poly"), 8);
}
goos::Object nav_mesh_route_arr_decompile(const std::vector<LinkedWord>& words,
const std::vector<DecompilerLabel>& labels,
int my_seg,
int field_location,
const TypeSystem& ts,
const std::vector<std::vector<LinkedWord>>& all_words,
const LinkedObjectFile* file) {
return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words,
file, TypeSpec("vector4ub"), 4);
}
goos::Object sp_launch_grp_launcher_decompile(const std::vector<LinkedWord>& words,
const std::vector<DecompilerLabel>& labels,
int my_seg,
@@ -676,6 +710,18 @@ goos::Object decompile_structure(const TypeSpec& type,
field_defs_out.emplace_back(
field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment,
field_start, ts, words, file));
} else if (field.name() == "vertex" && type.print() == "nav-mesh") {
field_defs_out.emplace_back(
field.name(), nav_mesh_vertex_arr_decompile(obj_words, labels, label.target_segment,
field_start, ts, words, file));
} else if (field.name() == "poly" && type.print() == "nav-mesh") {
field_defs_out.emplace_back(
field.name(), nav_mesh_poly_arr_decompile(obj_words, labels, label.target_segment,
field_start, ts, words, file));
} else if (field.name() == "route" && type.print() == "nav-mesh") {
field_defs_out.emplace_back(
field.name(), nav_mesh_route_arr_decompile(obj_words, labels, label.target_segment,
field_start, ts, words, file));
} else if (field.name() == "launcher" && type.print() == "sparticle-launch-group") {
field_defs_out.emplace_back(field.name(), sp_launch_grp_launcher_decompile(
obj_words, labels, label.target_segment,
+2
View File
@@ -28,6 +28,8 @@
(define-extern cam-collision-record-save (function vector vector int symbol camera-slave none))
(define-extern slave-los-state->string (function slave-los-state string))
(define-extern cam-debug-reset-coll-tri (function none)) ;; not confirmed
;; TODO - for rolling-lightning-mole
(define-extern camera-line-rel (function vector vector vector4w none))
(declare-type clm basic)
(define-extern *clm* clm) ;; unknown type
+52 -4
View File
@@ -236,9 +236,9 @@
:type uint64
:bitfield #t
(background 0)
(cak-1 1) ;;
(cak-2 2)
(cak-3 3)
(cak-1 1) ;; hit by player
(cak-2 2) ;; usually hit by player
(cak-3 3) ;; hit by others
(target 4) ;; target
(water 5)
(powerup 6)
@@ -250,7 +250,55 @@
(target-attack 12) ;; all target attacks
(mother-spider 13)
(cak-14 14) ;; unused
(blue-eco-suck 15) ;; manipy, orb-cache-top,
(blue-eco-suck 15) ;; manipy, orb-cache-top,
(unknown-16 16)
(unknown-17 17)
(unknown-18 18)
(unknown-19 19)
(unknown-20 20)
(unknown-21 21)
(unknown-22 22)
(unknown-23 23)
(unknown-24 24)
(unknown-25 25)
(unknown-26 26)
(unknown-27 27)
(unknown-28 28)
(unknown-29 29)
(unknown-30 30)
(unknown-31 31)
(unknown-32 32)
(unknown-33 33)
(unknown-34 34)
(unknown-35 35)
(unknown-36 36)
(unknown-37 37)
(unknown-38 38)
(unknown-39 39)
(unknown-40 40)
(unknown-41 41)
(unknown-42 42)
(unknown-43 43)
(unknown-44 44)
(unknown-45 45)
(unknown-46 46)
(unknown-47 47)
(unknown-48 48)
(unknown-49 49)
(unknown-50 50)
(unknown-51 51)
(unknown-52 52)
(unknown-53 53)
(unknown-54 54)
(unknown-55 55)
(unknown-56 56)
(unknown-57 57)
(unknown-58 58)
(unknown-59 59)
(unknown-60 60)
(unknown-61 61)
(unknown-62 62)
(unknown-63 63)
)
(defenum collide-action
+4 -2
View File
@@ -1054,7 +1054,7 @@
(debug-print-channels (-> (the-as process-drawable s5-2) skel) (the-as symbol *stdcon*))
)
(if (nonzero? (-> (the-as process-drawable s5-2) nav))
(dummy-9 (-> (the-as process-drawable s5-2) nav))
(debug-draw (-> (the-as process-drawable s5-2) nav))
)
(if (nonzero? (-> (the-as process-drawable s5-2) path))
(dummy-9 (-> (the-as process-drawable s5-2) path))
@@ -1115,7 +1115,7 @@
(the-as (function object object) (lambda ((arg0 process-drawable))
(when (type-type? (-> arg0 type) process-drawable)
(if (nonzero? (-> arg0 nav))
(dummy-9 (-> arg0 nav))
(debug-draw (-> arg0 nav))
)
(if (nonzero? (-> arg0 path))
(dummy-9 (-> arg0 path))
@@ -1258,6 +1258,7 @@
(define-extern racer type)
(define-extern launcher type)
(define-extern warp-gate-switch type)
(define-extern lurkercrab type)
(defmacro heap-size-hack (info entity-type)
`(cond
@@ -1286,6 +1287,7 @@
(type-type? (-> obj etype) racer)
(type-type? (-> obj etype) launcher)
(type-type? (-> obj etype) warp-gate-switch)
(type-type? (-> obj etype) lurkercrab) ;; crash on death
;(type-type? (-> obj etype) crate)
)
+103 -80
View File
@@ -5,32 +5,41 @@
;; name in dgo: navigate-h
;; dgos: GAME, ENGINE
(declare-type nav-mesh basic)
(declare-type nav-node structure)
(define-extern recursive-inside-poly (function nav-mesh nav-node vector float int))
(defenum nav-control-flags
:bitfield #t
:type uint32
(display-marks 0)
(bit1 1)
(bit2 2)
(bit3 3) ;; TODO - nav-enemy::45
(bit4 4)
(bit5 5) ;; TODO - nav-enemy::45
(bit6 6) ;; TODO - nav-enemy::45
(bit7 7) ;; TODO - nav-enemy::45
(bit1 1) ;; TODO - nav-control::9
(bit2 2) ;; TODO - nav-control::9
(bit3 3) ;; TODO - nav-enemy::45 | nav-control::9
(bit4 4) ;; TODO - nav-control::9
(bit5 5) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9
(bit6 6) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9
(bit7 7) ;; TODO - nav-enemy::45 | ;; TODO - nav-control::9
(bit8 8)
(bit9 9) ;; TODO - nav-control::14 | 11
(bit10 10) ;; TODO - nav-enemy::nav-enemy-patrol-post
(bit11 11) ;; TODO - nav-control::28
(bit12 12) ;; TODO - rolling-lightning-mole::(enter nav-enemy-chase fleeing-nav-enemy)
(bit13 13)
(bit17 17)
(bit19 19) ;; TODO - nav-enemy::lambda::17
(bit21 21)
(bit17 17) ;; TODO - nav-control::11
(bit18 18) ;; TODO - nav-control::11
(bit19 19) ;; TODO - nav-control::11 | 17
(bit20 20) ;; TODO - nav-mesh::28
(bit21 21) ;; TODO - nav-control::19
)
(deftype nav-poly (structure)
((id uint8 :offset-assert 0)
((id uint8 :offset-assert 0)
(vertex uint8 3 :offset-assert 1)
(adj-poly uint8 3 :offset-assert 4)
(pat uint8 :offset-assert 7) ;; pat-material, mode, event?
(pat uint8 :offset-assert 7)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
@@ -52,17 +61,17 @@
)
(deftype nav-ray (structure)
((current-pos vector :inline :offset-assert 0)
(dir vector :inline :offset-assert 16)
(dest-pos vector :inline :offset-assert 32)
(current-poly nav-poly :offset-assert 48)
(next-poly nav-poly :offset-assert 52)
(len meters :offset-assert 56)
(last-edge int8 :offset-assert 60)
(terminated basic :offset-assert 64)
(reached-dest basic :offset-assert 68)
(hit-boundary basic :offset-assert 72)
(hit-gap basic :offset-assert 76)
((current-pos vector :inline :offset-assert 0)
(dir vector :inline :offset-assert 16)
(dest-pos vector :inline :offset-assert 32)
(current-poly nav-poly :offset-assert 48)
(next-poly nav-poly :offset-assert 52)
(len meters :offset-assert 56)
(last-edge int8 :offset-assert 60)
(terminated symbol :offset-assert 64) ;; TODO - guesses
(reached-dest symbol :offset-assert 68) ;; TODO - guesses
(hit-boundary symbol :offset-assert 72) ;; TODO - guesses
(hit-gap symbol :offset-assert 76) ;; TODO - guesses
)
:method-count-assert 9
:size-assert #x50
@@ -81,7 +90,7 @@
(deftype clip-travel-vector-to-mesh-return-info (structure)
((found-boundary basic :offset-assert 0)
((found-boundary symbol :offset-assert 0)
(intersection vector :inline :offset-assert 16)
(boundary-normal vector :inline :offset-assert 32)
(prev-normal vector :inline :offset-assert 48)
@@ -140,47 +149,61 @@
)
(deftype nav-mesh (basic)
((user-list engine :offset-assert 4)
(poly-lookup-history uint8 2 :offset-assert 8)
(debug-time uint8 :offset-assert 10)
(static-sphere-count uint8 :offset-assert 11)
(static-sphere uint32 :offset-assert 12)
(bounds sphere :inline :offset-assert 16)
(origin vector :inline :offset-assert 32)
(cache nav-lookup-elem 4 :inline :offset-assert 48)
(node-count int32 :offset-assert 176)
(nodes uint32 :offset-assert 180)
(vertex-count int32 :offset-assert 184)
(vertex (inline-array vector) :offset-assert 188)
(poly-count int32 :offset-assert 192)
(poly uint32 :offset-assert 196)
(route uint32 :offset-assert 200)
((user-list engine :offset-assert 4)
(poly-lookup-history uint8 2 :offset-assert 8)
(debug-time uint8 :offset-assert 10)
(static-sphere-count uint8 :offset-assert 11)
(static-sphere (inline-array nav-sphere) :offset-assert 12)
(bounds sphere :inline :offset-assert 16)
(origin vector :inline :offset-assert 32)
(cache nav-lookup-elem 4 :inline :offset-assert 48) ;; guess on type
(node-count int32 :offset-assert 176)
(nodes (inline-array nav-node) :offset-assert 180)
(vertex-count int32 :offset-assert 184)
(vertex (inline-array nav-vertex) :offset-assert 188)
(poly-count int32 :offset-assert 192)
(poly (inline-array nav-poly) :offset-assert 196)
(route (inline-array vector4ub) :offset-assert 200) ;; this is a guess, it's probably wrong -- but its something with a uint8 at offset 0
)
:method-count-assert 30
:size-assert #xcc
:flag-assert #x1e000000cc
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 (_type_) none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-18 () none 18)
(tri-centroid-world (_type_ nav-poly vector) vector 9) ;; finds the centroid of the given triangle, in the "world" coordinate system.
(tri-centroid-local (_type_ nav-poly vector) vector 10) ;; finds the centroid of the given triangle, in the local nav-mesh coordinate system.
(get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11)
(setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) ;; sets up a portal between two polys.
(initialize-mesh! (_type_) none 13)
(move-along-nav-ray! (_type_ nav-ray) none 14) ;; think this updates the current position in a nav-ray, and updates which triangle you're in.
;; this takes in a point/direction/distance, and see what would happen if you tried to move this way.
;; it returns the distance you can go before one of these happens:
;; - you reach the destination
;; - you hit a nav mesh boundary/gap
;; - you cross 15 triangles.
(try-move-along-ray (_type_ nav-poly vector vector float) meters 15)
(TODO-RENAME-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16)
(update-route-table (_type_) none 17) ;; (initialization related)
(dummy-18 (_type_ int vector int (pointer int8) int) none 18) ;; something to do with routes.
(compute-bounding-box (_type_ vector vector) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(debug-draw-poly (_type_ nav-poly rgba) none 20) ;; TODO - is rgba a vector4w?
(point-in-poly? (_type_ nav-poly vector) symbol 21) ;; is the point inside of the triangle?
(find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) ;; given two triangles that share an edge, get the indices of the two vertices that aren't part of the edge.
(dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23)
(closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) ;; find the closest point on the perimeter of the triangle.
(project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) ;; will move a 3D point in space to the surface of this nav-poly
;; Looking from the top down, is the point inside the nav-poly?
;; - if the point is inside the triangle, returns that point.
;; - if the point is outside the triangle, move it to the closest point (will be on the edge)
(project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26)
;; finds which triangle the given point is in.
;; also has some caching stuff so if you look up the same point multiple times, it won't redo the work.
;; I _think_ this is only an approximate check that may return #f even if you are inside.
;; But, if it returns a poly, it will be right.
(find-poly-fast (_type_ vector meters) nav-poly 27)
(find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) ;; The accurate version of find-poly (tries find-poly-fast first)
;; checks to see if the triangle is in the mesh or not.
;; not sure why it's separate from 27 (and such a different implementation). there might be some details I'm missing here.
(is-in-mesh? (_type_ vector float meters) symbol 29)
)
)
@@ -238,31 +261,31 @@
:flag-assert #x24000000e0
(:methods
(new (symbol type collide-shape int float) _type_)
(dummy-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(point-in-bounds? (_type_ vector) symbol 10)
(dummy-11 (_type_ vector) none 11)
(dummy-12 () none 12)
(dummy-13 (_type_ vector vector) vector 13) ;; see - puffer::20
(dummy-11 (_type_ vector) vector 11)
(TODO-RENAME-12 (_type_ nav-gap-info) symbol 12)
(dummy-13 (_type_ vector vector) vector 13) ;; see - puffer::20 | second vector may be clip-travel-vector-to-mesh-return-info though
(set-current-poly! (_type_ nav-poly) none 14)
(set-target-pos! (_type_ vector) none 15)
(dummy-16 (_type_ vector) nav-poly 16) ; see - nav-enemy-test-point-in-nav-mesh?
(dummy-17 (_type_ vector vector) none 17)
(TODO-RENAME-18 (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ vector) symbol 21)
(dummy-22 () none 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed
(project-onto-nav-mesh (_type_ vector vector) vector 17) ;; moves point to nav-mesh.
(find-poly (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19) ;; csm not trsqv? ret not vector?
(project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20)
(TODO-RENAME-21 (_type_ vector) nav-poly 21)
(TODO-RENAME-22 (_type_ vector float) symbol 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) ;; TODO - unconfirmed maybe (dummy-23 (_type_ vector matrix) float 23)
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)
(dummy-25 (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh?
(dummy-26 (_type_) none 26)
(dummy-27 (_type_) none 27)
(dummy-28 (_type_ int) none 28)
(is-in-mesh? (_type_ vector float) symbol 25) ; see - nav-enemy-test-point-near-nav-mesh?
(TODO-RENAME-26 (_type_) none 26) ;; stub
(TODO-RENAME-27 (_type_) none 27)
(TODO-RENAME-28 (_type_ collide-kind) none 28)
(should-display? (_type_) symbol 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-30 (_type_ vector vector vector) sphere 30) ;; TODO - last arg? - it has a float as the first arg, vector is a total guess
(intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31)
(TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32)
(TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33)
(dummy-34 () none 34)
(dummy-35 (_type_ vector vector vector vector float) none 35)
)
@@ -305,8 +328,8 @@
)
;; do some setup
(dummy-13 entity-nav-mesh)
(dummy-17 entity-nav-mesh)
(initialize-mesh! entity-nav-mesh)
(update-route-table entity-nav-mesh)
)
;; in all cases, do the connection
File diff suppressed because it is too large Load Diff
+180 -263
View File
@@ -9,64 +9,26 @@
;; DECOMP BEGINS
(define
*sidekick-remap*
'(
("run-to-stance-left"
"run-to-stance"
)
("run-to-stance-loop-left"
"run-to-stance-loop"
)
("stance-loop-left"
"stance-loop"
)
("run-to-stance-right"
"run-to-stance"
)
("run-to-stance-loop-right"
"run-to-stance-loop"
)
("stance-loop-right"
"stance-loop"
)
("run-to-stance-up"
"run-to-stance"
)
("run-to-stance-loop-up"
"run-to-stance-loop"
)
("stance-loop-up"
"stance-loop"
)
("run-to-stance-down"
"run-to-stance"
)
("run-to-stance-loop-down"
"run-to-stance-loop"
)
("stance-loop-down"
"stance-loop"
)
("run-right"
"run"
)
("run-left"
"run"
)
("walk-right"
"walk"
)
("walk-left"
"walk"
)
("edge-grab-stance1"
"edge-grab-stance1"
"edge-grab-stance1-alt"
)
("pole-cycle" "pole-cycle" "pole-cycle2")
)
)
(define *sidekick-remap* '(("run-to-stance-left" "run-to-stance")
("run-to-stance-loop-left" "run-to-stance-loop")
("stance-loop-left" "stance-loop")
("run-to-stance-right" "run-to-stance")
("run-to-stance-loop-right" "run-to-stance-loop")
("stance-loop-right" "stance-loop")
("run-to-stance-up" "run-to-stance")
("run-to-stance-loop-up" "run-to-stance-loop")
("stance-loop-up" "stance-loop")
("run-to-stance-down" "run-to-stance")
("run-to-stance-loop-down" "run-to-stance-loop")
("stance-loop-down" "stance-loop")
("run-right" "run")
("run-left" "run")
("walk-right" "walk")
("walk-left" "walk")
("edge-grab-stance1" "edge-grab-stance1" "edge-grab-stance1-alt")
("pole-cycle" "pole-cycle" "pole-cycle2")
)
)
(defun cspace<-cspace+quaternion! ((arg0 cspace) (arg1 cspace) (arg2 quaternion))
(rlet ((Q :class vf)
@@ -77,223 +39,184 @@
(vf4 :class vf)
(vf5 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (-> arg0 bone transform)))
(quaternion->matrix s5-0 arg2)
(.lvf vf1 (&-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad))
(.lvf vf2 (&-> (-> arg1 bone) transform vector 3 quad))
(.lvf vf3 (&-> s5-0 vector 0 quad))
(.lvf vf4 (&-> s5-0 vector 1 quad))
(.lvf vf5 (&-> s5-0 vector 2 quad))
(.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11)
(.wait.vf)
(.mul.vf vf2 vf2 Q :mask #b111)
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.svf (&-> s5-0 vector 3 quad) vf2)
(.svf (&-> s5-0 vector 0 quad) vf3)
(.svf (&-> s5-0 vector 1 quad) vf4)
(.svf (&-> s5-0 vector 2 quad) vf5)
s5-0
(init-vf0-vector)
(let ((s5-0 (-> arg0 bone transform)))
(quaternion->matrix s5-0 arg2)
(.lvf vf1 (&-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad))
(.lvf vf2 (&-> (-> arg1 bone) transform vector 3 quad))
(.lvf vf3 (&-> s5-0 vector 0 quad))
(.lvf vf4 (&-> s5-0 vector 1 quad))
(.lvf vf5 (&-> s5-0 vector 2 quad))
(.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11)
(.wait.vf)
(.mul.vf vf2 vf2 Q :mask #b111)
(.mov.vf vf2 vf0 :mask #b1000)
(.mul.x.vf vf3 vf3 vf1)
(.mul.y.vf vf4 vf4 vf1)
(.mul.z.vf vf5 vf5 vf1)
(.svf (&-> s5-0 vector 3 quad) vf2)
(.svf (&-> s5-0 vector 0 quad) vf3)
(.svf (&-> s5-0 vector 1 quad) vf4)
(.svf (&-> s5-0 vector 2 quad) vf5)
s5-0
)
)
)
)
(defstate sidekick-clone (sidekick)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-0 object))
(case arg2
(('matrix)
(case (-> arg3 param 0)
(('play-anim)
(set! v0-0 (-> self node-list data))
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param0)
cspace<-cspace+quaternion!
(local-vars (v0-0 object))
(case arg2
(('matrix)
(case (-> arg3 param 0)
(('play-anim)
(set! v0-0 (-> self node-list data))
(set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace+quaternion!)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param1)
(the-as basic (-> self parent-override 0 node-list data))
)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param2)
(the-as basic (-> self parent-override 0 control quat))
)
)
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param1)
(the-as basic (-> self parent-override 0 node-list data))
)
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param2)
(the-as basic (-> self parent-override 0 control quat))
(('copy-parent)
(set! v0-0 (-> self node-list data))
(set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace!)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param1)
(the-as basic (-> self parent-override 0 node-list data))
)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f)
)
(else
(set! v0-0 (-> self node-list data))
(set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace+quaternion!)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param1)
(the-as basic (-> self parent-override 0 control unknown-cspace10 parent))
)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param2)
(the-as basic (-> self parent-override 0 control quat))
)
)
)
(('copy-parent)
(set! v0-0 (-> self node-list data))
(set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace!)
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param1)
(the-as basic (-> self parent-override 0 node-list data))
)
(set! (-> (the-as (inline-array cspace) v0-0) 0 param2) #f)
)
(else
(set! v0-0 (-> self node-list data))
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param0)
cspace<-cspace+quaternion!
)
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param1)
(the-as
basic
(-> self parent-override 0 control unknown-cspace10 parent)
)
)
(set!
(-> (the-as (inline-array cspace) v0-0) 0 param2)
(the-as basic (-> self parent-override 0 control quat))
)
)
v0-0
)
v0-0
)
(('shadow)
(set! v0-0 (-> arg3 param 0))
(set! (-> self shadow-in-movie?) (the-as symbol v0-0))
v0-0
)
(('blend-shape)
(cond
((-> arg3 param 0)
(set! v0-0 (logior (-> self skel status) 8))
(set! (-> self skel status) (the-as uint v0-0))
(('shadow)
(set! v0-0 (-> arg3 param 0))
(set! (-> self shadow-in-movie?) (the-as symbol v0-0))
v0-0
)
(else
(set! v0-0 (logand -9 (-> self skel status)))
(set! (-> self skel status) (the-as uint v0-0))
(('blend-shape)
(cond
((-> arg3 param 0)
(set! v0-0 (logior (-> self skel status) 8))
(set! (-> self skel status) (the-as uint v0-0))
)
(else
(set! v0-0 (logand -9 (-> self skel status)))
(set! (-> self skel status) (the-as uint v0-0))
)
)
v0-0
)
)
v0-0
)
)
)
:code
(the-as (function none :behavior sidekick) looping-code)
:post
(behavior ()
(let ((v1-0 'process-drawable-art-error)
(a0-0 (-> self parent-override))
)
(when (!= (-> (if a0-0
(-> a0-0 0 self-override)
)
next-state
name
)
v1-0
)
(quaternion-copy!
(-> self root quat)
(-> self parent-override 0 control quat)
)
(set! (-> self anim-seed) (-> self parent-override 0 anim-seed))
(set! (-> self draw status) (-> self parent-override 0 draw status))
(joint-control-copy! (-> self skel) (-> self parent-override 0 skel))
(joint-control-remap!
(-> self skel)
(-> self draw art-group)
(-> self parent-override 0 draw art-group)
*sidekick-remap*
(the-as int (-> self anim-seed))
""
)
(let ((v1-22 (-> self parent-override 0 draw color-mult quad)))
(set! (-> self draw color-mult quad) v1-22)
)
(let ((v1-26 (-> self parent-override 0 draw color-emissive quad)))
(set! (-> self draw color-emissive quad) v1-26)
)
(set!
(-> self draw secondary-interp)
(-> self parent-override 0 draw secondary-interp)
)
(if *debug-segment*
(add-frame
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
'draw
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
)
)
(dummy-17 self)
(if *debug-segment*
(add-frame
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
'draw
(new 'static 'rgba :r #x80 :a #x80)
)
)
(vector<-cspace!
(-> self draw origin)
(-> self node-list data (-> self draw origin-joint-index))
)
)
)
(when *display-sidekick-stats*
(format *stdcon* "~%")
(debug-print-channels (-> self skel) (the-as symbol *stdcon*))
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
(->
self
parent-override
0
control
unknown-cspace10
parent
bone
transform
vector
3
)
409.6
(new 'static 'rgba :g #xff :a #x80)
)
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
(-> self node-list data 3 bone transform vector 3)
409.6
(new 'static 'rgba :r #xff :g #xff :a #x80)
)
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
(-> self draw origin)
409.6
(new 'static 'rgba :r #xff :g #x80 :a #x80)
)
)
(set!
(-> self draw shadow)
(the-as shadow-geo (if (and (movie?) (-> self shadow-in-movie?))
(-> self draw art-group data 2)
(let ((v1-0 'process-drawable-art-error)
(a0-0 (-> self parent-override))
)
(when (!= (-> (if a0-0
(-> a0-0 0 self-override)
)
)
)
(#unless TARGET_STARTUP_HACKS
(let ((a0-26 (-> self skel effect)))
(if a0-26
(TODO-RENAME-9 a0-26)
)
next-state
name
)
v1-0
)
(quaternion-copy! (-> self root quat) (-> self parent-override 0 control quat))
(set! (-> self anim-seed) (-> self parent-override 0 anim-seed))
(set! (-> self draw status) (-> self parent-override 0 draw status))
(joint-control-copy! (-> self skel) (-> self parent-override 0 skel))
(joint-control-remap!
(-> self skel)
(-> self draw art-group)
(-> self parent-override 0 draw art-group)
*sidekick-remap*
(the-as int (-> self anim-seed))
""
)
(let ((v1-22 (-> self parent-override 0 draw color-mult quad)))
(set! (-> self draw color-mult quad) v1-22)
)
(let ((v1-26 (-> self parent-override 0 draw color-emissive quad)))
(set! (-> self draw color-emissive quad) v1-26)
)
(set! (-> self draw secondary-interp) (-> self parent-override 0 draw secondary-interp))
(if *debug-segment*
(add-frame
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
'draw
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
)
(if (logtest? (-> self skel status) 72)
(merc-blend-shape self)
)
(if (logtest? (-> self skel status) 384)
(merc-eye-anim self)
)
)
(none)
)
(dummy-17 self)
(if *debug-segment*
(add-frame
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
'draw
(new 'static 'rgba :r #x80 :a #x80)
)
)
(vector<-cspace! (-> self draw origin) (-> self node-list data (-> self draw origin-joint-index)))
)
)
(when *display-sidekick-stats*
(format *stdcon* "~%")
(debug-print-channels (-> self skel) (the-as symbol *stdcon*))
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
(-> self parent-override 0 control unknown-cspace10 parent bone transform vector 3)
409.6
(new 'static 'rgba :g #xff :a #x80)
)
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
(-> self node-list data 3 bone transform vector 3)
409.6
(new 'static 'rgba :r #xff :g #xff :a #x80)
)
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
(-> self draw origin)
409.6
(new 'static 'rgba :r #xff :g #x80 :a #x80)
)
)
(set! (-> self draw shadow) (the-as shadow-geo (if (and (movie?) (-> self shadow-in-movie?))
(-> self draw art-group data 2)
)
)
)
(#unless TARGET_STARTUP_HACKS
(let ((a0-26 (-> self skel effect)))
(if a0-26
(TODO-RENAME-9 a0-26)
)
)
(if (logtest? (-> self skel status) 72)
(merc-blend-shape self)
)
(if (logtest? (-> self skel status) 384)
(merc-eye-anim self)
))
(none)
)
)
(defskelgroup *sidekick-sg* sidekick
@@ -318,16 +241,10 @@
(set! (-> self draw shadow-ctrl) *target-shadow-control*)
(logior! (-> self skel status) 256)
(let ((v1-14 (-> self node-list data)))
(set! (-> v1-14 0 param0) cspace<-cspace+quaternion!)
(set!
(-> v1-14 0 param1)
(the-as basic (-> self parent-override 0 control unknown-cspace10 parent))
(set! (-> v1-14 0 param0) cspace<-cspace+quaternion!)
(set! (-> v1-14 0 param1) (the-as basic (-> self parent-override 0 control unknown-cspace10 parent)))
(set! (-> v1-14 0 param2) (the-as basic (-> self parent-override 0 control quat)))
)
(set!
(-> v1-14 0 param2)
(the-as basic (-> self parent-override 0 control quat))
)
)
(set! (-> self shadow-in-movie?) #t)
(go sidekick-clone)
(none)
+19
View File
@@ -113,6 +113,21 @@
`(#cond (,clause ,true) (#t ,false))
)
(defmacro move-if-not-zero (result value check original)
`(if (!= ,check 0)
(set! ,result (the-as int ,value))
(set! ,result (the-as int ,original))
)
)
(defmacro set-on-less-than (dest src1 src2)
"dest = src1 < src2 ? 1 : 0 -- Compare as Signed Integers"
`(if (< (the int ,src1) (the int ,src2))
(set! ,dest 1)
(set! ,dest 0)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; TARGET CONTROL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -578,6 +593,10 @@
`(&-> (the-as (pointer ,t) ,addr) ,@fields)
)
(defmacro shift-arith-right-32 (result in sa)
`(set! ,result (sext32 (sar (logand #xffffffff (the-as int ,in)) ,sa)))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Bit Macros
;;;;;;;;;;;;;;;;;;;;;;;;;;;
+77 -7
View File
@@ -83,7 +83,7 @@
(set-collide-offense (-> obj collide-info) 2 (collide-offense touch))
(set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags)))
)
(dummy-14 (-> obj draw shadow-ctrl))
(#unless TARGET_STARTUP_HACKS (dummy-14 (-> obj draw shadow-ctrl)))
(when *target*
(if *target*
(look-at-enemy!
@@ -551,7 +551,7 @@ nav-enemy-default-event-handler
)
(defbehavior nav-enemy-test-point-near-nav-mesh? nav-enemy ((arg0 vector))
(and (dummy-25 (-> self nav) arg0 (-> self nav-info notice-nav-radius))
(and (is-in-mesh? (-> self nav) arg0 (-> self nav-info notice-nav-radius))
(< (-> arg0 y) (+ (-> self collide-info trans y) (-> self enemy-info notice-top)))
)
)
@@ -727,7 +727,8 @@ nav-enemy-default-event-handler
(and (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance))
(vector-vector-distance (-> obj collide-info trans) (camera-pos))
)
(or (logtest? (-> obj draw status) (draw-status drwf03)) (!= (-> obj next-state name) 'nav-enemy-idle))
(or (#if TARGET_STARTUP_HACKS #t (logtest? (-> self draw status) (draw-status drwf03)))
(!= (-> obj next-state name) 'nav-enemy-idle))
)
)
(and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel)))
@@ -768,7 +769,7 @@ nav-enemy-default-event-handler
)
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
(nonzero? (-> self draw))
(logtest? (-> self draw status) (draw-status drwf03))
(#if TARGET_STARTUP_HACKS #t (logtest? (-> self draw status) (draw-status drwf03)))
)
(go-virtual nav-enemy-patrol)
)
@@ -832,7 +833,8 @@ nav-enemy-default-event-handler
(behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30)
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
(if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status drwf03)))
(if (and (nonzero? (-> self draw))
(#if TARGET_STARTUP_HACKS #t (logtest? (-> self draw status) (draw-status drwf03))))
(set! (-> self free-time) (-> *display* base-frame-counter))
)
(if (or (or (not *target*) (< (-> self enemy-info idle-distance)
@@ -2116,7 +2118,7 @@ nav-enemy-default-event-handler
(set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold)))
(logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
(set! (-> obj nav gap-event) 'jump)
(dummy-26 (-> obj nav))
(TODO-RENAME-26 (-> obj nav))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> obj enemy-info)
@@ -2198,7 +2200,75 @@ nav-enemy-default-event-handler
(set! (-> s4-0 quad) (-> obj collide-info trans quad))
(set! (-> obj collide-info trans quad) (-> arg0 quad))
(let ((gp-0 (-> obj nav)))
(dummy-28 gp-0 -1)
(TODO-RENAME-28
gp-0
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(set! (-> obj collide-info trans quad) (-> s4-0 quad))
(let* ((v1-8 (-> gp-0 mesh origin))
(f0-1 (- (-> arg0 x) (-> v1-8 x)))
+1 -1
View File
@@ -207,7 +207,7 @@ nav-enemy-default-event-handler
(vector-normalize! (-> self dir) 1.0)
(vector+*! gp-0 s4-0 (-> self dir) (- (-> self spawn-distance)))
)
(dummy-17 (-> self nav) gp-0 gp-0)
(project-onto-nav-mesh (-> self nav) gp-0 gp-0)
(set! (-> gp-0 y) (-> self y-min))
(set! (-> self spawn-point quad) (-> gp-0 quad))
)
+70 -4
View File
@@ -1408,7 +1408,7 @@
(> (-> self birthing-counter) 0)
(and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor)))
(zero? (logand (-> *target* state-flags) #x80f8))
(dummy-21 (-> self nav) (-> self root-override trans))
(TODO-RENAME-21 (-> self nav) (-> self root-override trans))
)
)
(go mother-spider-birth-baby)
@@ -1480,7 +1480,7 @@
(if (letgo-player? self)
(go mother-spider-traveling (the-as uint 0))
)
(if (not (dummy-21 (-> self nav) (-> self root-override trans)))
(if (not (TODO-RENAME-21 (-> self nav) (-> self root-override trans)))
(go mother-spider-birthing)
)
(TODO-RENAME-29 self #t #t)
@@ -1546,7 +1546,73 @@
(defmethod TODO-RENAME-20 mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector))
(set! (-> obj nav nav-cull-radius) 40960.0)
(set-current-poly! (-> obj nav) (dummy-16 (-> obj nav) (-> obj root-override trans)))
(dummy-28 (-> obj nav) -1)
(TODO-RENAME-28 (-> obj nav) (collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(dotimes (s3-1 4)
(let ((f28-0 (+ 32768.0 (-> obj orient-rot y)))
(f30-0 (rand-vu-float-range 16384.0 40960.0))
@@ -1594,7 +1660,7 @@
)
)
)
(dummy-17 (-> obj nav) arg0 (-> obj root-override trans))
(project-onto-nav-mesh (-> obj nav) arg0 (-> obj root-override trans))
(let ((a1-12 (new 'stack-no-clear 'vector))
(s3-2 (new 'stack-no-clear 'collide-tri-result))
)
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -457,7 +457,7 @@
1.0
)
(let ((s5-1 #f))
(dummy-28 (-> obj nav) 2560)
(TODO-RENAME-28 (-> obj nav) (collide-kind wall-object ground-object))
(let ((v1-4 (-> obj nav travel)))
(.lvf vf1 (&-> (-> obj root-override transv) quad))
(let ((f0-8 (-> *display* seconds-per-frame)))
@@ -749,7 +749,7 @@
#f
#f
)
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(none)
)
:code
+209 -7
View File
@@ -363,7 +363,7 @@
)
(logior! (-> self collide-info nav-flags) 1)
(set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags)))
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(go double-lurker-top-resume)
(none)
)
@@ -441,7 +441,7 @@
(defmethod dummy-51 double-lurker-top ((obj double-lurker-top))
(restore-collide-with-as (-> obj collide-info))
(logior! (-> obj collide-info nav-flags) 1)
(the-as object (dummy-27 (-> obj nav)))
(the-as object (TODO-RENAME-27 (-> obj nav)))
)
(defmethod initialize-collision double-lurker-top ((obj double-lurker-top))
@@ -815,7 +815,75 @@
(.svf (&-> v1-7 quad) vf1)
)
(let ((gp-0 #f))
(dummy-28 (-> self nav) -1)
(TODO-RENAME-28
(-> self nav)
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(let ((a2-1 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info)))
(if (>= (dummy-23 (-> self nav) (-> self nav travel) a2-1) 0.0)
(set! gp-0 #t)
@@ -846,7 +914,7 @@
(-> self nav-info hover-if-no-ground)
#f
)
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(none)
)
)
@@ -878,7 +946,73 @@
)
(defmethod dummy-52 double-lurker ((obj double-lurker) (arg0 vector))
(dummy-28 (-> obj nav) -1)
(TODO-RENAME-28 (-> obj nav) (collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(let ((a1-2 (new 'stack-no-clear 'vector)))
(vector-float*! a1-2 (-> obj hit-from-dir) 22937.602)
(vector+! a1-2 a1-2 (-> obj collide-info trans))
@@ -994,7 +1128,75 @@
(.svf (&-> v1-7 quad) vf1)
)
(let ((gp-0 #f))
(dummy-28 (-> self nav) -1)
(TODO-RENAME-28
(-> self nav)
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(let ((a2-1 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info)))
(if (>= (dummy-23 (-> self nav) (-> self nav travel) a2-1) 0.0)
(set! gp-0 #t)
@@ -1025,7 +1227,7 @@
(-> self nav-info hover-if-no-ground)
#f
)
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(none)
)
)
+72 -4
View File
@@ -208,7 +208,7 @@
)
(defmethod dummy-24 puffer ((obj puffer) (arg0 vector))
(and (dummy-25 (-> obj nav) arg0 11468.8)
(and (is-in-mesh? (-> obj nav) arg0 11468.8)
(< (-> arg0 y) (+ (-> obj root-override trans y) (-> obj fact-info-override notice-top)))
)
)
@@ -361,8 +361,76 @@
(seek-with-smooth (-> obj travel-speed) 18432.0 (* 2048.0 (-> *display* seconds-per-frame)) 0.125 40.96)
)
)
(dummy-27 (-> obj nav))
(dummy-28 (-> obj nav) -1)
(TODO-RENAME-27 (-> obj nav))
(TODO-RENAME-28
(-> obj nav)
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(dummy-13 (-> obj nav) arg0 (-> obj root-override transv))
(let ((f30-0 (* (vector-xz-length (-> obj nav travel)) (-> *display* frames-per-second))))
(let ((f0-11 (atan (-> obj nav travel x) (-> obj nav travel z)))
@@ -1139,7 +1207,7 @@
(set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist)))
(set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0))
(logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
(dummy-26 (-> obj nav))
(TODO-RENAME-26 (-> obj nav))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> obj fact-info-override)
+1 -1
View File
@@ -913,7 +913,7 @@
)
(set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0))
(logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
(set-current-poly! (-> self nav) (TODO-RENAME-18 (-> self nav) (-> self root-override trans)))
(set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans)))
(+! (-> self parent-process 0 hit-points) 3)
(dummy-21 self)
(when (zero? (-> self skel))
+2
View File
@@ -436,6 +436,8 @@ class Compiler {
Val* compile_asm_load_sym(const goos::Object& form, const goos::Object& rest, Env* env);
Val* compile_asm_jr(const goos::Object& form, const goos::Object& rest, Env* env);
Val* compile_asm_mov(const goos::Object& form, const goos::Object& rest, Env* env);
Val* compile_asm_movn(const goos::Object& form, const goos::Object& rest, Env* env);
Val* compile_asm_slt(const goos::Object& form, const goos::Object& rest, Env* env);
// Vector Float Operations
Val* compile_asm_lvf(const goos::Object& form, const goos::Object& rest, Env* env);
+3 -1
View File
@@ -37,7 +37,9 @@ files_with_modifications = [
"sage-finalboss-FIN",
"progress",
"entity",
"ogreboss"
"ogreboss",
"navigate",
"nav-enemy"
]
for file in files:
+20 -1
View File
@@ -814,6 +814,25 @@
)
)
(defmacro move-if-not-zero (result value check original)
`(if (!= ,check 0)
(set! ,result (the-as int ,value))
(set! ,result (the-as int ,original))
)
)
(defmacro shift-arith-right-32 (result in sa)
`(set! ,result (sext32 (sar (logand #xffffffff (the-as int ,in)) ,sa)))
)
(defmacro set-on-less-than (dest src1 src2)
"dest = src1 < src2 ? 1 : 0 -- Compare as Signed Integers"
`(if (< (the int ,src1) (the int ,src2))
(set! ,dest 1)
(set! ,dest 0)
)
)
(defmacro send-event (proc msg &rest params)
"Send an event to a process. This should be used over send-event-function"
@@ -902,4 +921,4 @@
;; Copies the contents of a gpr to a cop0 (system control) register
(fake-asm .mtc0 dest src)
(fake-asm .mtpc dest src)
(fake-asm .mfpc dest src)
(fake-asm .mfpc dest src)
+2 -2
View File
@@ -20,7 +20,7 @@
:size-assert #x30
:flag-assert #xa00000030
(:methods
(dummy-9 (_type_) _type_ 9)
(debug-print-frames (_type_) _type_ 9)
)
)
@@ -70,7 +70,7 @@
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 (_type_) float 9)
(dummy-10 (_type_ symbol) int 10)
(debug-print-channels (_type_ symbol) int 10)
)
)
+2 -2
View File
@@ -175,7 +175,7 @@
)
;; definition for method 9 of type joint-control-channel
(defmethod dummy-9 joint-control-channel ((obj joint-control-channel))
(defmethod debug-print-frames joint-control-channel ((obj joint-control-channel))
(let ((s5-0 (-> obj frame-group))
(f30-0 (-> obj frame-num))
)
@@ -188,7 +188,7 @@
)
;; definition for method 10 of type joint-control
(defmethod dummy-10 joint-control ((obj joint-control) (arg0 symbol))
(defmethod debug-print-channels joint-control ((obj joint-control) (arg0 symbol))
(dotimes (s4-0 (-> obj active-channels))
(let* ((v1-6 (if (and (-> obj channel s4-0 frame-group) (nonzero? (-> obj channel s4-0 frame-group)))
(-> obj channel s4-0 frame-group)
+21 -18
View File
@@ -8,7 +8,7 @@
(local-vars
(r0-0 int)
(r0-1 int)
(r0-2 uint128)
(r0-2 int)
(r0-3 int)
(v1-1 uint128)
(v1-2 uint128)
@@ -46,7 +46,7 @@
(.mov r0-1 f31-0)
(.por v1-2 a1-2 v1-1)
(.mov r0-2 f31-0)
(.ppach v1-3 r0-2 v1-2)
(.ppach v1-3 (the-as uint128 0) v1-2)
(.mov r0-3 f31-0)
(let ((v1-4 (shl (the-as int v1-3) 16)))
(nop!)
@@ -60,13 +60,12 @@
;; Used lq/sq
(defun instance-sphere-box-intersect? ((arg0 drawable) (arg1 instance-tie) (arg2 bounding-box4w))
(local-vars
(r0-0 uint128)
(r0-0 int)
(r0-1 int)
(r0-2 uint128)
(r0-2 int)
(r0-3 int)
(r0-4 int)
(r0-5 uint128)
(r0-6 int)
(r0-5 int)
(v1-3 uint128)
(v1-4 uint128)
(v1-5 uint128)
@@ -103,19 +102,19 @@
(let ((a3-0 (the-as uint128 (-> arg1 origin vector4h 3 long))))
(nop!)
(let ((t2-0 (the-as uint128 (-> arg1 origin vector4h 0 long))))
(.pextlh a3-1 a3-0 r0-0)
(.pextlh a3-1 a3-0 0)
(let ((t0-0 (the-as uint128 (-> arg1 origin vector4h 1 long))))
(.pw.sra t1-0 a3-1 10)
(let ((a3-2 (the-as uint128 (-> arg1 origin vector4h 2 long))))
(.pextlh t2-1 t2-0 r0-0)
(.mov r0-1 f31-0)
(.pextlh t2-1 t2-0 0)
(.mov r0-0 f31-0)
(.pw.sra t2-2 t2-1 16)
(.mov r0-2 f31-0)
(.pextlh t0-1 t0-0 r0-2)
(.mov r0-1 f31-0)
(.pextlh t0-1 t0-0 0)
(.mov vf8 t1-0)
(.pw.sra t0-2 t0-1 16)
(.mov vf5 t2-2)
(.pextlh a3-3 a3-2 r0-2)
(.pextlh a3-3 a3-2 0)
)
)
)
@@ -166,14 +165,14 @@
(nop!)
(.pcgtw a1-2 a2-1 a1-1)
)
(.mov r0-3 f31-0)
(.mov r0-2 f31-0)
(.pcgtw v1-3 v1-2 a0-2)
)
(.mov r0-4 f31-0)
(.mov r0-3 f31-0)
(.por v1-4 a1-2 v1-3)
(.mov r0-4 f31-0)
(.ppach v1-5 (the-as uint128 0) v1-4)
(.mov r0-5 f31-0)
(.ppach v1-5 r0-5 v1-4)
(.mov r0-6 f31-0)
(let ((v1-6 (shl (the-as int v1-5) 16)))
(nop!)
(zero? v1-6)
@@ -184,7 +183,7 @@
;; definition for function instance-tfragment-add-debug-sphere
;; Used lq/sq
(defun instance-tfragment-add-debug-sphere ((arg0 drawable) (arg1 instance-tie))
(local-vars (r0-0 uint128) (v1-1 uint128) (v1-2 uint128) (a3-0 float))
(local-vars (v1-1 uint128) (v1-2 uint128) (a3-0 float))
(rlet ((vf0 :class vf)
(vf10 :class vf)
(vf11 :class vf)
@@ -194,7 +193,7 @@
(init-vf0-vector)
(nop!)
(let ((v1-0 (the-as uint128 (-> arg1 origin vector4h 3 long))))
(.pextlh v1-1 v1-0 r0-0)
(.pextlh v1-1 v1-0 0)
)
(.lvf vf9 (&-> arg0 bsphere quad))
(.pw.sra v1-2 v1-1 10)
@@ -217,3 +216,7 @@
)
)
)
+2 -2
View File
@@ -944,7 +944,7 @@
(ja-post)
(when (logtest? (-> self flags) (anim-tester-flags fanimt4))
(draw-joint-spheres self)
(dummy-10 (-> self skel) (the-as symbol *stdcon*))
(debug-print-channels (-> self skel) (the-as symbol *stdcon*))
)
)
(none)
@@ -2497,7 +2497,7 @@
)
(logclear! (-> self flags) (anim-tester-flags fanimt1))
(when (!= *master-mode* 'menu)
(dummy-10 (-> self skel) (the-as symbol *stdcon*))
(debug-print-channels (-> self skel) (the-as symbol *stdcon*))
(add-debug-x
#t
(bucket-id debug-draw1)
+9 -9
View File
@@ -395,9 +395,9 @@
(set! (-> arg2 w) 1.0)
(set! (-> arg3 w) 1.0)
(set! (-> arg4 w) 1.0)
(when (and (transform-point-qword! (the-as vector4w (-> s5-0 quad)) arg2)
(transform-point-qword! (the-as vector4w (&-> s5-0 quad 1)) arg3)
(transform-point-qword! (the-as vector4w (&-> s5-0 quad 2)) arg4)
(when (and (transform-point-qword! (the-as vector4w (-> s5-0 vector)) arg2)
(transform-point-qword! (-> s5-0 vector 1) arg3)
(transform-point-qword! (-> s5-0 vector 2) arg4)
)
(let* ((v1-9 (-> *display* frames (-> *display* on-screen) frame debug-buf))
(a2-1 (-> v1-9 base))
@@ -445,12 +445,12 @@
(let* ((a1-21 v1-9)
(a3-5 (the-as (inline-array vector4w-3) (-> a1-21 base)))
)
(set! (-> a3-5 0 quad 0) (-> s4-0 quad 0))
(set! (-> a3-5 0 quad 1) (-> s5-0 quad 0))
(set! (-> a3-5 0 quad 2) (-> s4-0 quad 0))
(set! (-> a3-5 1 quad 0) (-> (&-> s5-0 quad 1) 0))
(set! (-> a3-5 1 quad 1) (-> s4-0 quad 0))
(set! (-> a3-5 1 quad 2) (-> (&-> s5-0 quad 2) 0))
(set! (-> a3-5 0 vector 0 quad) (-> s4-0 vector 0 quad))
(set! (-> a3-5 0 vector 1 quad) (-> s5-0 vector 0 quad))
(set! (-> a3-5 0 vector 2 quad) (-> s4-0 vector 0 quad))
(set! (-> a3-5 1 vector 0 quad) (-> s5-0 vector 1 quad))
(set! (-> a3-5 1 vector 1 quad) (-> s4-0 vector 0 quad))
(set! (-> a3-5 1 vector 2 quad) (-> s5-0 vector 2 quad))
(set! (-> a1-21 base) (&+ (the-as pointer a3-5) 96))
)
(let ((a1-25 (/ (the-as int (+ (&- (the-as pointer -16) (the-as uint a0-9)) (the-as int (-> v1-9 base)))) 16)))
+5 -6
View File
@@ -127,15 +127,14 @@
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
(defmethod reset! perf-stat ((obj perf-stat))
(local-vars (r0-0 none))
(let ((v1-0 (-> obj ctrl)))
(+! (-> obj count) 1)
(b! (zero? v1-0) cfg-2 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf v1-0)
@@ -155,9 +154,9 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc v1, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc v1, pcr1]
(defmethod read! perf-stat ((obj perf-stat))
(local-vars (r0-0 none) (v1-1 int) (v1-3 int))
(local-vars (v1-1 int) (v1-3 int))
(b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc v1-1 pcr0)
+1 -6
View File
@@ -40,7 +40,6 @@
)
;; definition for method 16 of type drawable-tree
;; WARN: Unsupported inline assembly instruction kind - [sra t4, t4, 1]
(defmethod unpack-vis drawable-tree ((obj drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8)))
(local-vars (t5-1 int))
(let* ((v1-0 (the-as drawable-inline-array-node (-> obj data 0)))
@@ -78,7 +77,7 @@
(set! (-> t2-3 0) t5-1)
(label cfg-9)
(+! t0-5 -1)
(b! (zero? t0-5) cfg-12 :delay (.sra t4-0 t4-0 1))
(b! (zero? t0-5) cfg-12 :delay (shift-arith-right-32 t4-0 t4-0 1))
(b! (nonzero? t4-0) cfg-7 :delay (set! t2-3 (&-> t2-3 1)))
)
)
@@ -92,7 +91,3 @@
)
arg1
)
+20 -33
View File
@@ -7,7 +7,7 @@
;; WARN: Bad vector register dependency: vf18
;; WARN: Bad vector register dependency: vf19
(defun sphere-cull ((arg0 vector))
(local-vars (r0-0 uint128) (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
(local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf10 :class vf)
@@ -25,8 +25,8 @@
(.sub.mul.w.vf vf9 vf19 vf0 acc)
(.add.w.vf vf9 vf9 vf10)
(.mov v1-0 vf9)
(.pcgtw v1-1 r0-0 v1-0)
(.ppach v1-2 r0-0 v1-1)
(.pcgtw v1-1 0 v1-0)
(.ppach v1-2 (the-as uint128 0) v1-1)
(zero? (the-as int v1-2))
)
)
@@ -37,7 +37,7 @@
;; WARN: Bad vector register dependency: vf22
;; WARN: Bad vector register dependency: vf23
(defun guard-band-cull ((arg0 vector))
(local-vars (r0-0 uint128) (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
(local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf10 :class vf)
@@ -55,15 +55,15 @@
(.sub.mul.w.vf vf9 vf23 vf0 acc)
(.sub.w.vf vf9 vf9 vf10)
(.mov v1-0 vf9)
(.pcgtw v1-1 r0-0 v1-0)
(.ppach v1-2 r0-0 v1-1)
(.pcgtw v1-1 0 v1-0)
(.ppach v1-2 (the-as uint128 0) v1-1)
(nonzero? (the-as int v1-2))
)
)
;; definition for function sphere-in-view-frustum?
(defun sphere-in-view-frustum? ((arg0 sphere))
(local-vars (r0-0 uint128) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128))
(local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
@@ -87,23 +87,15 @@
(.sub.mul.w.vf vf5 vf4 vf0 acc)
(.add.w.vf vf5 vf5 vf6)
(.mov v1-1 vf5)
(.pcgtw v1-2 r0-0 v1-1)
(.ppach v1-3 r0-0 v1-2)
(.pcgtw v1-2 0 v1-1)
(.ppach v1-3 (the-as uint128 0) v1-2)
(zero? (the-as int v1-3))
)
)
;; definition for function line-in-view-frustum?
(defun line-in-view-frustum? ((arg0 vector) (arg1 vector))
(local-vars
(r0-0 uint128)
(v1-1 uint128)
(v1-2 uint128)
(v1-3 uint128)
(a0-1 uint128)
(a0-2 uint128)
(a0-3 uint128)
)
(local-vars (v1-1 uint128) (v1-2 uint128) (v1-3 uint128) (a0-1 uint128) (a0-2 uint128) (a0-3 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf10 :class vf)
@@ -131,11 +123,11 @@
(.add.mul.z.vf acc vf18 vf10 acc)
(.sub.mul.w.vf vf10 vf19 vf0 acc)
(.mov v1-1 vf9)
(.pcgtw v1-2 r0-0 v1-1)
(.ppach v1-3 r0-0 v1-2)
(.pcgtw v1-2 0 v1-1)
(.ppach v1-3 (the-as uint128 0) v1-2)
(.mov a0-1 vf10)
(.pcgtw a0-2 r0-0 a0-1)
(.ppach a0-3 r0-0 a0-2)
(.pcgtw a0-2 0 a0-1)
(.ppach a0-3 (the-as uint128 0) a0-2)
(zero? (logand (the-as int v1-3) (the-as int a0-3)))
)
)
@@ -143,12 +135,11 @@
;; definition for function vis-cull
;; WARN: Type Propagation failed: Failed type prop at op 3 ((set! v1 (l.b (+ v1 #x38b0)))): Could not get type of load: (set! v1 (l.b (+ v1 #x38b0))).
;; WARN: Type Propagation failed: Type analysis failed
;; WARN: Unsupported inline assembly instruction kind - [sra a1, a0, 3]
;; WARN: Unsupported inline assembly instruction kind - [addiu a0, a0, 56]
(defun vis-cull ((a0-0 int))
(local-vars (v0-0 none) (v1-0 int) (v1-1 int) (v1-2 none) (v1-3 none) (a0-1 none) (a0-2 none) (a1-0 int))
(set! v1-0 #x70000000)
(.sra a1-0 a0-0 3)
(shift-arith-right-32 a1-0 a0-0 3)
(set! v1-1 (+ a1-0 v1-0))
(set! v1-2 (the-as none (l.b (+ v1-1 #x38b0))))
(set! a0-1 (the-as none (logand a0-0 7)))
@@ -1209,7 +1200,7 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun real-main-draw-hook ()
(local-vars (r0-0 none) (a0-74 int) (a0-76 int))
(local-vars (a0-74 int) (a0-76 int))
(when *slow-frame-rate*
(dotimes (v1-2 #xc3500)
(nop!)
@@ -1478,11 +1469,11 @@
)
(+! (-> v1-178 count) 1)
(b! (zero? a0-72) cfg-77 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-72)
@@ -1494,7 +1485,7 @@
(finish-background)
(let ((v1-181 (-> *perf-stats* data 3)))
(b! (zero? (-> v1-181 ctrl)) cfg-79 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-74 pcr0)
@@ -2205,7 +2196,3 @@
(debug-set-camera-pos-rot! a0-0 a1-0)
)
)
+5 -5
View File
@@ -1030,10 +1030,10 @@
)
)
(if (nonzero? (-> (the-as process-drawable s5-2) skel))
(dummy-10 (-> (the-as process-drawable s5-2) skel) (the-as symbol *stdcon*))
(debug-print-channels (-> (the-as process-drawable s5-2) skel) (the-as symbol *stdcon*))
)
(if (nonzero? (-> (the-as process-drawable s5-2) nav))
(dummy-9 (-> (the-as process-drawable s5-2) nav))
(debug-draw (-> (the-as process-drawable s5-2) nav))
)
(if (nonzero? (-> (the-as process-drawable s5-2) path))
(dummy-9 (-> (the-as process-drawable s5-2) path))
@@ -1092,7 +1092,7 @@
(the-as (function object object) (lambda ((arg0 process-drawable))
(when (type-type? (-> arg0 type) process-drawable)
(if (nonzero? (-> arg0 nav))
(dummy-9 (-> arg0 nav))
(debug-draw (-> arg0 nav))
)
(if (nonzero? (-> arg0 path))
(dummy-9 (-> arg0 path))
@@ -1889,14 +1889,14 @@
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
;; WARN: Unsupported inline assembly instruction kind - [mfc0 s4, Count]
(defun-debug entity-speed-test ((arg0 string))
(local-vars (r0-0 none) (s4-0 int))
(local-vars (s4-0 int))
(let ((gp-0 (entity-by-name arg0)))
(when gp-0
(set! *spawn-actors* #f)
(reset-actors 'debug)
0
(disable-irq)
(.mtc0 Count r0-0)
(.mtc0 Count r0)
(.sync.p)
(birth! gp-0)
(.mfc0 s4-0 Count)
+9 -9
View File
@@ -979,7 +979,7 @@
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
(defbehavior display-loop process ()
(local-vars (r0-0 none) (a0-54 int) (a0-56 int) (a0-73 int) (a0-75 int))
(local-vars (a0-54 int) (a0-56 int) (a0-73 int) (a0-75 int))
(stack-size-set! (-> self main-thread) 512)
(let ((disp *display*))
(dma-send-to-spr (the-as uint #x70000000) (the-as uint *terrain-context*) (the-as uint 0) #t)
@@ -1109,7 +1109,7 @@
)
(let ((v1-112 (-> *perf-stats* data)))
(b! (zero? (-> v1-112 0 ctrl)) cfg-46 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-54 pcr0)
@@ -1135,11 +1135,11 @@
)
(+! (-> v1-123 0 count) 1)
(b! (zero? a0-60) cfg-51 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-60)
@@ -1168,7 +1168,7 @@
)
(let ((v1-152 (-> *perf-stats* data)))
(b! (zero? (-> v1-152 0 ctrl)) cfg-68 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-73 pcr0)
@@ -1362,11 +1362,11 @@
)
(+! (-> v1-228 0 count) 1)
(b! (zero? a0-112) cfg-98 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-112)
+30 -32
View File
@@ -103,12 +103,11 @@
;; Used lq/sq
(defun ocean-trans-add-upload-table ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 (pointer float)) (arg4 int) (arg5 symbol))
(local-vars
(r0-0 uint128)
(r0-1 uint128)
(r0-2 uint128)
(r0-3 uint128)
(r0-4 uint128)
(r0-5 uint128)
(r0-0 int)
(r0-1 int)
(r0-2 int)
(r0-3 int)
(r0-4 int)
(v1-12 (inline-array vector))
(v1-14 float)
(a0-23 uint128)
@@ -215,23 +214,23 @@
(t0-10 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ (* 52 (+ a0-16 1)) a1-11))))
(a0-22 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ a1-11 1 (* 52 (+ a0-16 1))))))
)
(.pextlb a1-15 r0-0 a2-14)
(.pextlb a1-15 0 a2-14)
(.mov r0-0 f31-0)
(.pextlb a2-15 0 a3-9)
(.mov r0-1 f31-0)
(.pextlb a2-15 r0-1 a3-9)
(.pextlb a3-10 0 t0-10)
(.mov r0-2 f31-0)
(.pextlb a3-10 r0-2 t0-10)
(.mov r0-3 f31-0)
(.pextlb a0-23 r0-3 a0-22)
(.pextlb a0-23 0 a0-22)
)
)
(.mov r0-3 f31-0)
(.pextlh a1-16 0 a1-15)
(.mov r0-4 f31-0)
(.pextlh a1-16 r0-4 a1-15)
(.mov r0-5 f31-0)
(.pextlh a2-16 r0-5 a2-15)
(.pextlh a2-16 0 a2-15)
(.mov vf1 a1-16)
(.pextlh a1-17 r0-5 a3-10)
(.pextlh a1-17 0 a3-10)
(.mov vf2 a2-16)
(.pextlh a0-24 r0-5 a0-23)
(.pextlh a0-24 0 a0-23)
(.mov vf3 a1-17)
(nop!)
(.mov vf4 a0-24)
@@ -306,12 +305,11 @@
;; Used lq/sq
(defun ocean-trans-add-upload-strip ((arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 uint) (arg4 uint) (arg5 uint))
(local-vars
(r0-0 uint128)
(r0-1 uint128)
(r0-2 uint128)
(r0-3 uint128)
(r0-4 uint128)
(r0-5 uint128)
(r0-0 int)
(r0-1 int)
(r0-2 int)
(r0-3 int)
(r0-4 int)
(v1-8 float)
(a0-23 uint128)
(a0-24 uint128)
@@ -366,22 +364,22 @@
(a2-14 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2))))
(a3-10 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1)))))))
)
(.pextlb a0-23 r0-0 a0-22)
(.pextlb a0-23 0 a0-22)
(.mov r0-0 f31-0)
(.pextlb a1-14 0 a1-13)
(.mov r0-1 f31-0)
(.pextlb a1-14 r0-1 a1-13)
(.pextlb a2-15 0 a2-14)
(.mov r0-2 f31-0)
(.pextlb a2-15 r0-2 a2-14)
(.mov r0-3 f31-0)
(.pextlb a3-11 r0-3 a3-10)
(.pextlb a3-11 0 a3-10)
)
(.mov r0-3 f31-0)
(.pextlh a0-24 0 a0-23)
(.mov r0-4 f31-0)
(.pextlh a0-24 r0-4 a0-23)
(.mov r0-5 f31-0)
(.pextlh a1-15 r0-5 a1-14)
(.pextlh a1-15 0 a1-14)
(.mov vf1 a0-24)
(.pextlh a0-25 r0-5 a2-15)
(.pextlh a0-25 0 a2-15)
(.mov vf2 a1-15)
(.pextlh a1-16 r0-5 a3-11)
(.pextlh a1-16 0 a3-11)
(.mov vf3 a0-25)
(nop!)
(.mov vf4 a1-16)
+6 -12
View File
@@ -161,17 +161,11 @@
)
;; definition for function sp-get-particle
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movn t1, t2, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movn t3, t1, t1]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t2, t1]
(defun sp-get-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-launch-state))
(local-vars
@@ -215,36 +209,36 @@
(let ((t2-4 (shl t1-15 32))
(t3-0 (+ a2-2 32))
)
(.movn t1-16 t2-4 t2-4 t1-15)
(move-if-not-zero t1-16 t2-4 t2-4 t1-15)
(.movz a2-3 t3-0 t2-4 a2-2)
)
(let ((t2-5 (shl t1-16 16))
(t3-1 (+ a2-3 16))
)
(.movn t1-17 t2-5 t2-5 t1-16)
(move-if-not-zero t1-17 t2-5 t2-5 t1-16)
(.movz a2-4 t3-1 t2-5 a2-3)
)
(let ((t2-6 (* t1-17 256))
(t3-2 (+ a2-4 8))
)
(.movn t1-18 t2-6 t2-6 t1-17)
(move-if-not-zero t1-18 t2-6 t2-6 t1-17)
(.movz a2-5 t3-2 t2-6 a2-4)
)
(let ((t2-7 (* t1-18 16))
(t3-3 (+ a2-5 4))
)
(.movn t1-19 t2-7 t2-7 t1-18)
(move-if-not-zero t1-19 t2-7 t2-7 t1-18)
(.movz a2-6 t3-3 t2-7 a2-5)
)
(let ((t2-8 (* t1-19 4))
(t3-4 (+ a2-6 2))
)
(.movn t1-20 t2-8 t2-8 t1-19)
(move-if-not-zero t1-20 t2-8 t2-8 t1-19)
(.movz a2-7 t3-4 t2-8 a2-6)
(let ((t1-21 (* t1-20 2))
(t2-9 (+ a2-7 1))
)
(.movn t3-5 t1-21 t1-21 t3-4)
(move-if-not-zero t3-5 t1-21 t1-21 t3-4)
(.movz a2-8 t2-9 t1-21 a2-7)
)
)
+5 -6
View File
@@ -290,7 +290,6 @@
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; WARN: Unsupported inline assembly instruction kind - [sync.p]
(defun-debug start-perf-stat-collection ()
(local-vars (r0-0 none))
(let ((frame-idx (+ (-> *perf-stats* data 0 frame-number) 1)))
(set! (-> *perf-stats* data 0 frame-number) frame-idx)
(let ((gp-0 (mod frame-idx (the-as uint 34))))
@@ -369,11 +368,11 @@
)
(+! (-> v1-31 0 count) 1)
(b! (zero? a0-76) cfg-28 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-76)
@@ -394,10 +393,10 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun-debug end-perf-stat-collection ()
(local-vars (r0-0 none) (a0-1 int) (a0-3 int))
(local-vars (a0-1 int) (a0-3 int))
(let ((v1-1 (-> *perf-stats* data)))
(b! (zero? (-> v1-1 0 ctrl)) cfg-2 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-1 pcr0)
+36 -36
View File
@@ -59,7 +59,7 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
(local-vars (r0-0 none) (a0-20 int) (a0-22 int) (a0-38 int) (a0-40 int) (sv-16 (pointer uint8)))
(local-vars (a0-20 int) (a0-22 int) (a0-38 int) (a0-40 int) (sv-16 (pointer uint8)))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -107,11 +107,11 @@
)
(+! (-> v1-28 count) 1)
(b! (zero? a0-17) cfg-8 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-17)
@@ -123,7 +123,7 @@
(draw-inline-array-tfrag sv-16 (the-as drawable-inline-array s4-1) s3-0 s1-0)
(let ((v1-31 (-> *perf-stats* data 5)))
(b! (zero? (-> v1-31 ctrl)) cfg-10 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-20 pcr0)
@@ -180,11 +180,11 @@
)
(+! (-> v1-52 count) 1)
(b! (zero? a0-35) cfg-15 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-35)
@@ -196,7 +196,7 @@
(draw-inline-array-tfrag-near sv-16 (the-as drawable-inline-array s4-1) s3-0 s1-1)
(let ((v1-55 (-> *perf-stats* data 6)))
(b! (zero? (-> v1-55 ctrl)) cfg-17 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-38 pcr0)
@@ -283,7 +283,7 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-trans-tfrag ((arg0 drawable-tree-trans-tfrag))
(local-vars (r0-0 none) (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
(local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -331,11 +331,11 @@
)
(+! (-> v1-24 count) 1)
(b! (zero? a0-14) cfg-8 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-14)
@@ -353,7 +353,7 @@
)
(let ((v1-32 (-> *perf-stats* data 5)))
(b! (zero? (-> v1-32 ctrl)) cfg-10 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-18 pcr0)
@@ -405,11 +405,11 @@
)
(+! (-> v1-48 count) 1)
(b! (zero? a0-32) cfg-15 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-32)
@@ -421,7 +421,7 @@
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
(let ((v1-51 (-> *perf-stats* data 6)))
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-35 pcr0)
@@ -496,7 +496,7 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-dirt-tfrag ((arg0 drawable-tree-dirt-tfrag))
(local-vars (r0-0 none) (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
(local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -533,11 +533,11 @@
)
(+! (-> v1-24 count) 1)
(b! (zero? a0-14) cfg-8 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-14)
@@ -555,7 +555,7 @@
)
(let ((v1-32 (-> *perf-stats* data 5)))
(b! (zero? (-> v1-32 ctrl)) cfg-10 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-18 pcr0)
@@ -600,11 +600,11 @@
)
(+! (-> v1-48 count) 1)
(b! (zero? a0-32) cfg-15 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-32)
@@ -616,7 +616,7 @@
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
(let ((v1-51 (-> *perf-stats* data 6)))
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-35 pcr0)
@@ -691,7 +691,7 @@
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr0]
;; WARN: Unsupported inline assembly instruction kind - [mfpc a0, pcr1]
(defun draw-drawable-tree-ice-tfrag ((arg0 drawable-tree-ice-tfrag))
(local-vars (r0-0 none) (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
(local-vars (a0-18 int) (a0-20 int) (a0-35 int) (a0-37 int) (sv-16 (pointer uint8)))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-frag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
@@ -732,11 +732,11 @@
)
(+! (-> v1-24 count) 1)
(b! (zero? a0-14) cfg-8 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-14)
@@ -754,7 +754,7 @@
)
(let ((v1-32 (-> *perf-stats* data 5)))
(b! (zero? (-> v1-32 ctrl)) cfg-10 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-18 pcr0)
@@ -799,11 +799,11 @@
)
(+! (-> v1-48 count) 1)
(b! (zero? a0-32) cfg-15 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-32)
@@ -815,7 +815,7 @@
(draw-inline-array-tfrag-near sv-16 s5-1 s4-1 s2-1)
(let ((v1-51 (-> *perf-stats* data 6)))
(b! (zero? (-> v1-51 ctrl)) cfg-17 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-35 pcr0)
+16 -17
View File
@@ -309,7 +309,6 @@
;; Used lq/sq
(defun draw-drawable-tree-instance-tie ((arg0 drawable-tree-instance-tie) (arg1 level))
(local-vars
(r0-0 none)
(a0-31 int)
(a0-33 int)
(a0-46 int)
@@ -376,11 +375,11 @@
)
(+! (-> v1-32 count) 1)
(b! (zero? a0-28) cfg-12 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-28)
@@ -396,7 +395,7 @@
)
(let ((v1-35 (-> *perf-stats* data 9)))
(b! (zero? (-> v1-35 ctrl)) cfg-14 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-31 pcr0)
@@ -439,11 +438,11 @@
)
(+! (-> v1-60 count) 1)
(b! (zero? a0-43) cfg-20 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-43)
@@ -455,7 +454,7 @@
(draw-inline-array-prototype-tie-generic-asm s3-1 s5-1 s4-1)
(let ((v1-63 (-> *perf-stats* data 10)))
(b! (zero? (-> v1-63 ctrl)) cfg-22 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-46 pcr0)
@@ -498,11 +497,11 @@
)
(+! (-> v1-85 count) 1)
(b! (zero? a0-59) cfg-28 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-59)
@@ -514,7 +513,7 @@
(draw-inline-array-prototype-tie-asm s1-1 s5-1 s4-1)
(let ((v1-88 (-> *perf-stats* data 11)))
(b! (zero? (-> v1-88 ctrl)) cfg-30 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-62 pcr0)
@@ -575,11 +574,11 @@
)
(+! (-> v1-114 count) 1)
(b! (zero? a0-79) cfg-39 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 r0-0)
(.mtpc pcr1 r0-0)
(.mtpc pcr0 r0)
(.mtpc pcr1 r0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-79)
@@ -591,7 +590,7 @@
(draw-inline-array-prototype-tie-near-asm s1-2 s5-1 s4-1)
(let ((v1-117 (-> *perf-stats* data 12)))
(b! (zero? (-> v1-117 ctrl)) cfg-41 :delay (nop!))
(.mtc0 Perf r0-0)
(.mtc0 Perf r0)
(.sync.l)
(.sync.p)
(.mfpc a0-82 pcr0)
+2 -2
View File
@@ -154,7 +154,7 @@
;; definition for method 10 of type bsp-header
;; Used lq/sq
(defmethod draw bsp-header ((obj bsp-header) (other-draw bsp-header) (disp-frame display-frame))
(local-vars (r0-0 uint128) (a3-4 uint128) (a3-5 uint128))
(local-vars (a3-4 uint128) (a3-5 uint128))
(rlet ((vf16 :class vf)
(vf17 :class vf)
(vf18 :class vf)
@@ -196,7 +196,7 @@
)
(dotimes (current-qw vis-list-qwc2)
(let ((a3-3 (-> vis-list-spad current-qw)))
(.pnor a3-4 a3-3 r0-0)
(.pnor a3-4 a3-3 0)
)
(let ((t0-2 (-> vis-list-lev current-qw)))
(.pand a3-5 a3-4 t0-2)
+1 -2
View File
@@ -802,12 +802,11 @@
)
;; definition for method 10 of type level
;; WARN: Unsupported inline assembly instruction kind - [sra a0, a1, 3]
;; WARN: Unsupported inline assembly instruction kind - [addiu a0, a0, 56]
(defmethod is-object-visible? level ((obj level) (arg0 int))
(local-vars (a0-1 int) (a0-3 int))
(let ((v1-0 (-> obj vis-bits)))
(.sra a0-1 arg0 3)
(shift-arith-right-32 a0-1 arg0 3)
(let ((v1-2 (-> (the-as (pointer int8) (+ a0-1 (the-as int v1-0))))))
(let ((a0-2 (logand arg0 7)))
(.addiu a0-3 a0-2 56)
+2 -4
View File
@@ -60,7 +60,6 @@
;; definition for function unpack-comp-huf
;; INFO: Return type mismatch int vs none.
;; WARN: Unsupported inline assembly instruction kind - [sra v1, v1, 1]
(defun unpack-comp-huf ((arg0 (pointer uint8)) (arg1 (pointer uint8)) (arg2 uint) (arg3 huf-dictionary-node))
(local-vars (t1-1 uint) (t3-2 object))
(nop!)
@@ -76,7 +75,7 @@
(set! arg1 (&-> arg1 1))
(label cfg-2)
(let ((t3-0 (logand t0-0 v1-4)))
(.sra v1-4 v1-4 1)
(shift-arith-right-32 v1-4 v1-4 1)
(b! (zero? t3-0) cfg-4 :delay (set! t1-1 t1-0))
)
)
@@ -108,7 +107,6 @@
)
;; definition for method 16 of type level
;; WARN: Unsupported inline assembly instruction kind - [sra s2, s2, 3]
;; Used lq/sq
(defmethod update-vis! level ((obj level) (vis-info level-vis-info) (arg1 uint) (arg2 uint))
(local-vars (t0-3 uint128) (vis-buffer object))
@@ -209,7 +207,7 @@
(set! vis-buffer (the-as int spad-start))
(set! spad-start spad-end)
(set! spad-end (the-as int vis-buffer))
(.sra lower-flag-bits lower-flag-bits 3)
(shift-arith-right-32 lower-flag-bits lower-flag-bits 3)
)
(let ((s2-1 vis-buffer)
(s1-1 (the-as (pointer uinteger) (-> obj bsp all-visible-list)))
+3 -3
View File
@@ -307,9 +307,9 @@
;; definition for method 3 of type vector4w-3
(defmethod inspect vector4w-3 ((obj vector4w-3))
(format #t "[~8x] ~A~%" obj 'vector4w-3)
(format #t "~Tdata[12] @ #x~X~%" (-> obj quad))
(format #t "~Tquad[3] @ #x~X~%" (-> obj quad))
(format #t "~Tvector[3] @ #x~X~%" (-> obj quad))
(format #t "~Tdata[12] @ #x~X~%" (-> obj vector))
(format #t "~Tquad[3] @ #x~X~%" (-> obj vector))
(format #t "~Tvector[3] @ #x~X~%" (-> obj vector))
obj
)
+59 -58
View File
@@ -8,6 +8,7 @@
(adj-poly uint8 3 :offset-assert 4)
(pat uint8 :offset-assert 7)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
@@ -69,10 +70,10 @@
(next-poly nav-poly :offset-assert 52)
(len meters :offset-assert 56)
(last-edge int8 :offset-assert 60)
(terminated basic :offset-assert 64)
(reached-dest basic :offset-assert 68)
(hit-boundary basic :offset-assert 72)
(hit-gap basic :offset-assert 76)
(terminated symbol :offset-assert 64)
(reached-dest symbol :offset-assert 68)
(hit-boundary symbol :offset-assert 72)
(hit-gap symbol :offset-assert 76)
)
:method-count-assert 9
:size-assert #x50
@@ -118,7 +119,7 @@
;; definition of type clip-travel-vector-to-mesh-return-info
(deftype clip-travel-vector-to-mesh-return-info (structure)
((found-boundary basic :offset-assert 0)
((found-boundary symbol :offset-assert 0)
(intersection vector :inline :offset-assert 16)
(boundary-normal vector :inline :offset-assert 32)
(prev-normal vector :inline :offset-assert 48)
@@ -236,47 +237,47 @@
;; definition of type nav-mesh
(deftype nav-mesh (basic)
((user-list engine :offset-assert 4)
(poly-lookup-history uint8 2 :offset-assert 8)
(debug-time uint8 :offset-assert 10)
(static-sphere-count uint8 :offset-assert 11)
(static-sphere uint32 :offset-assert 12)
(bounds sphere :inline :offset-assert 16)
(origin vector :inline :offset-assert 32)
(cache nav-lookup-elem 4 :inline :offset-assert 48)
(node-count int32 :offset-assert 176)
(nodes uint32 :offset-assert 180)
(vertex-count int32 :offset-assert 184)
(vertex (inline-array vector) :offset-assert 188)
(poly-count int32 :offset-assert 192)
(poly uint32 :offset-assert 196)
(route uint32 :offset-assert 200)
((user-list engine :offset-assert 4)
(poly-lookup-history uint8 2 :offset-assert 8)
(debug-time uint8 :offset-assert 10)
(static-sphere-count uint8 :offset-assert 11)
(static-sphere (inline-array nav-sphere) :offset-assert 12)
(bounds sphere :inline :offset-assert 16)
(origin vector :inline :offset-assert 32)
(cache nav-lookup-elem 4 :inline :offset-assert 48)
(node-count int32 :offset-assert 176)
(nodes (inline-array nav-node) :offset-assert 180)
(vertex-count int32 :offset-assert 184)
(vertex (inline-array nav-vertex) :offset-assert 188)
(poly-count int32 :offset-assert 192)
(poly (inline-array nav-poly) :offset-assert 196)
(route (inline-array vector4ub) :offset-assert 200)
)
:method-count-assert 30
:size-assert #xcc
:flag-assert #x1e000000cc
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 (_type_) none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-18 () none 18)
(tri-centroid-world (_type_ nav-poly vector) vector 9)
(tri-centroid-local (_type_ nav-poly vector) vector 10)
(get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11)
(setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12)
(initialize-mesh! (_type_) none 13)
(move-along-nav-ray! (_type_ nav-ray) none 14)
(try-move-along-ray (_type_ nav-poly vector vector float) meters 15)
(TODO-RENAME-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16)
(update-route-table (_type_) none 17)
(dummy-18 (_type_ int vector int (pointer int8) int) none 18)
(compute-bounding-box (_type_ vector vector) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(debug-draw-poly (_type_ nav-poly rgba) none 20)
(point-in-poly? (_type_ nav-poly vector) symbol 21)
(find-opposite-vertices (_type_ nav-poly nav-poly) uint 22)
(dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23)
(closest-point-on-boundary (_type_ nav-poly vector vector) vector 24)
(project-point-into-tri-3d (_type_ nav-poly vector vector) none 25)
(project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26)
(find-poly-fast (_type_ vector meters) nav-poly 27)
(find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28)
(is-in-mesh? (_type_ vector float meters) symbol 29)
)
)
@@ -373,31 +374,31 @@
:flag-assert #x24000000e0
(:methods
(new (symbol type collide-shape int float) _type_ 0)
(dummy-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(point-in-bounds? (_type_ vector) symbol 10)
(dummy-11 (_type_ vector) none 11)
(dummy-12 () none 12)
(dummy-11 (_type_ vector) vector 11)
(TODO-RENAME-12 (_type_ nav-gap-info) symbol 12)
(dummy-13 (_type_ vector vector) vector 13)
(set-current-poly! (_type_ nav-poly) none 14)
(set-target-pos! (_type_ vector) none 15)
(dummy-16 (_type_ vector) nav-poly 16)
(dummy-17 (_type_ vector vector) none 17)
(TODO-RENAME-18 (_type_ vector) nav-poly 18)
(project-onto-nav-mesh (_type_ vector vector) vector 17)
(find-poly (_type_ vector) nav-poly 18)
(dummy-19 (_type_ vector collide-shape-moving vector float) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ vector) symbol 21)
(dummy-22 () none 22)
(project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20)
(TODO-RENAME-21 (_type_ vector) nav-poly 21)
(TODO-RENAME-22 (_type_ vector float) symbol 22)
(dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23)
(dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24)
(dummy-25 (_type_ vector float) symbol 25)
(dummy-26 (_type_) none 26)
(dummy-27 (_type_) none 27)
(dummy-28 (_type_ int) none 28)
(is-in-mesh? (_type_ vector float) symbol 25)
(TODO-RENAME-26 (_type_) none 26)
(TODO-RENAME-27 (_type_) none 27)
(TODO-RENAME-28 (_type_ collide-kind) none 28)
(should-display? (_type_) symbol 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-30 (_type_ vector vector vector) sphere 30)
(intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31)
(TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32)
(TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33)
(dummy-34 () none 34)
(dummy-35 (_type_ vector vector vector vector float) none 35)
)
@@ -462,8 +463,8 @@
(set! (-> entity-nav-mesh user-list) (s1-0 s0-0 sv-16 sv-32 (the-as int a3-1)))
)
)
(dummy-13 entity-nav-mesh)
(dummy-17 entity-nav-mesh)
(initialize-mesh! entity-nav-mesh)
(update-route-table entity-nav-mesh)
)
(add-connection (-> entity-nav-mesh user-list) proc nothing proc nav-cont trans)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -480,7 +480,7 @@
(-> arg0 control unknown-float81)
(-> arg0 control unknown-float82)
)
(dummy-10 (-> arg0 skel) arg1)
(debug-print-channels (-> arg0 skel) arg1)
)
(draw-history (-> arg0 control))
#f
+1 -1
View File
@@ -170,7 +170,7 @@
)
(when *display-sidekick-stats*
(format *stdcon* "~%")
(dummy-10 (-> self skel) (the-as symbol *stdcon*))
(debug-print-channels (-> self skel) (the-as symbol *stdcon*))
(add-debug-sphere
*display-sidekick-stats*
(bucket-id debug-draw1)
+71 -3
View File
@@ -617,7 +617,7 @@ nav-enemy-default-event-handler
;; definition for function nav-enemy-test-point-near-nav-mesh?
(defbehavior nav-enemy-test-point-near-nav-mesh? nav-enemy ((arg0 vector))
(and (dummy-25 (-> self nav) arg0 (-> self nav-info notice-nav-radius))
(and (is-in-mesh? (-> self nav) arg0 (-> self nav-info notice-nav-radius))
(< (-> arg0 y) (+ (-> self collide-info trans y) (-> self enemy-info notice-top)))
)
)
@@ -2238,7 +2238,7 @@ nav-enemy-default-event-handler
(set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold)))
(logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
(set! (-> obj nav gap-event) 'jump)
(dummy-26 (-> obj nav))
(TODO-RENAME-26 (-> obj nav))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> obj enemy-info)
@@ -2334,7 +2334,75 @@ nav-enemy-default-event-handler
(set! (-> s4-0 quad) (-> obj collide-info trans quad))
(set! (-> obj collide-info trans quad) (-> arg0 quad))
(let ((gp-0 (-> obj nav)))
(dummy-28 gp-0 -1)
(TODO-RENAME-28
gp-0
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(set! (-> obj collide-info trans quad) (-> s4-0 quad))
(let* ((v1-8 (-> gp-0 mesh origin))
(f0-1 (- (-> arg0 x) (-> v1-8 x)))
+1 -1
View File
@@ -250,7 +250,7 @@ nav-enemy-default-event-handler
(vector-normalize! (-> self dir) 1.0)
(vector+*! gp-0 s4-0 (-> self dir) (- (-> self spawn-distance)))
)
(dummy-17 (-> self nav) gp-0 gp-0)
(project-onto-nav-mesh (-> self nav) gp-0 gp-0)
(set! (-> gp-0 y) (-> self y-min))
(set! (-> self spawn-point quad) (-> gp-0 quad))
)
+17
View File
@@ -0,0 +1,17 @@
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(setup-font-texture! *texture-pool*)
;; definition for symbol *shadow-middot-texture*, type texture
(define *shadow-middot-texture* (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x2)))
;; definition for symbol *generic-envmap-texture*, type texture
(define *generic-envmap-texture* (lookup-texture-by-id (the-as texture-id #x10000014)))
;; definition for symbol *ocean-texture*, type texture
(define *ocean-texture* (lookup-texture-by-id (new 'static 'texture-id :page #x370)))
;; failed to figure out what this is:
(set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate)
+70 -4
View File
@@ -1437,7 +1437,7 @@
(> (-> self birthing-counter) 0)
(and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor)))
(zero? (logand (-> *target* state-flags) #x80f8))
(dummy-21 (-> self nav) (-> self root-override trans))
(TODO-RENAME-21 (-> self nav) (-> self root-override trans))
)
)
(go mother-spider-birth-baby)
@@ -1510,7 +1510,7 @@
(if (letgo-player? self)
(go mother-spider-traveling (the-as uint 0))
)
(if (not (dummy-21 (-> self nav) (-> self root-override trans)))
(if (not (TODO-RENAME-21 (-> self nav) (-> self root-override trans)))
(go mother-spider-birthing)
)
(TODO-RENAME-29 self #t #t)
@@ -1578,7 +1578,73 @@
(defmethod TODO-RENAME-20 mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector))
(set! (-> obj nav nav-cull-radius) 40960.0)
(set-current-poly! (-> obj nav) (dummy-16 (-> obj nav) (-> obj root-override trans)))
(dummy-28 (-> obj nav) -1)
(TODO-RENAME-28 (-> obj nav) (collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(dotimes (s3-1 4)
(let ((f28-0 (+ 32768.0 (-> obj orient-rot y)))
(f30-0 (rand-vu-float-range 16384.0 40960.0))
@@ -1626,7 +1692,7 @@
)
)
)
(dummy-17 (-> obj nav) arg0 (-> obj root-override trans))
(project-onto-nav-mesh (-> obj nav) arg0 (-> obj root-override trans))
(let ((a1-12 (new 'stack-no-clear 'vector))
(s3-2 (new 'stack-no-clear 'collide-tri-result))
)
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -498,7 +498,7 @@
1.0
)
(let ((s5-1 #f))
(dummy-28 (-> obj nav) 2560)
(TODO-RENAME-28 (-> obj nav) (collide-kind wall-object ground-object))
(let ((v1-4 (-> obj nav travel)))
(.lvf vf1 (&-> (-> obj root-override transv) quad))
(let ((f0-8 (-> *display* seconds-per-frame)))
@@ -793,7 +793,7 @@
#f
#f
)
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(none)
)
:code
+209 -7
View File
@@ -385,7 +385,7 @@
)
(logior! (-> self collide-info nav-flags) 1)
(set! (-> self collide-info nav-flags) (logand -3 (-> self collide-info nav-flags)))
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(go double-lurker-top-resume)
(none)
)
@@ -468,7 +468,7 @@
(defmethod dummy-51 double-lurker-top ((obj double-lurker-top))
(restore-collide-with-as (-> obj collide-info))
(logior! (-> obj collide-info nav-flags) 1)
(the-as object (dummy-27 (-> obj nav)))
(the-as object (TODO-RENAME-27 (-> obj nav)))
)
;; definition for method 47 of type double-lurker-top
@@ -861,7 +861,75 @@
(.svf (&-> v1-7 quad) vf1)
)
(let ((gp-0 #f))
(dummy-28 (-> self nav) -1)
(TODO-RENAME-28
(-> self nav)
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(let ((a2-1 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info)))
(if (>= (dummy-23 (-> self nav) (-> self nav travel) a2-1) 0.0)
(set! gp-0 #t)
@@ -892,7 +960,7 @@
(-> self nav-info hover-if-no-ground)
#f
)
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(none)
)
)
@@ -926,7 +994,73 @@
;; definition for method 52 of type double-lurker
;; Used lq/sq
(defmethod dummy-52 double-lurker ((obj double-lurker) (arg0 vector))
(dummy-28 (-> obj nav) -1)
(TODO-RENAME-28 (-> obj nav) (collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(let ((a1-2 (new 'stack-no-clear 'vector)))
(vector-float*! a1-2 (-> obj hit-from-dir) 22937.602)
(vector+! a1-2 a1-2 (-> obj collide-info trans))
@@ -1045,7 +1179,75 @@
(.svf (&-> v1-7 quad) vf1)
)
(let ((gp-0 #f))
(dummy-28 (-> self nav) -1)
(TODO-RENAME-28
(-> self nav)
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(let ((a2-1 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info)))
(if (>= (dummy-23 (-> self nav) (-> self nav travel) a2-1) 0.0)
(set! gp-0 #t)
@@ -1076,7 +1278,7 @@
(-> self nav-info hover-if-no-ground)
#f
)
(dummy-27 (-> self nav))
(TODO-RENAME-27 (-> self nav))
(none)
)
)
+72 -4
View File
@@ -241,7 +241,7 @@
;; definition for method 24 of type puffer
(defmethod dummy-24 puffer ((obj puffer) (arg0 vector))
(and (dummy-25 (-> obj nav) arg0 11468.8)
(and (is-in-mesh? (-> obj nav) arg0 11468.8)
(< (-> arg0 y) (+ (-> obj root-override trans y) (-> obj fact-info-override notice-top)))
)
)
@@ -412,8 +412,76 @@
(seek-with-smooth (-> obj travel-speed) 18432.0 (* 2048.0 (-> *display* seconds-per-frame)) 0.125 40.96)
)
)
(dummy-27 (-> obj nav))
(dummy-28 (-> obj nav) -1)
(TODO-RENAME-27 (-> obj nav))
(TODO-RENAME-28
(-> obj nav)
(collide-kind
background
cak-1
cak-2
cak-3
target
water
powerup
crate
enemy
wall-object
projectile
ground-object
target-attack
mother-spider
cak-14
blue-eco-suck
unknown-16
unknown-17
unknown-18
unknown-19
unknown-20
unknown-21
unknown-22
unknown-23
unknown-24
unknown-25
unknown-26
unknown-27
unknown-28
unknown-29
unknown-30
unknown-31
unknown-32
unknown-33
unknown-34
unknown-35
unknown-36
unknown-37
unknown-38
unknown-39
unknown-40
unknown-41
unknown-42
unknown-43
unknown-44
unknown-45
unknown-46
unknown-47
unknown-48
unknown-49
unknown-50
unknown-51
unknown-52
unknown-53
unknown-54
unknown-55
unknown-56
unknown-57
unknown-58
unknown-59
unknown-60
unknown-61
unknown-62
unknown-63
)
)
(dummy-13 (-> obj nav) arg0 (-> obj root-override transv))
(let ((f30-0 (* (vector-xz-length (-> obj nav travel)) (-> *display* frames-per-second))))
(let ((f0-11 (atan (-> obj nav travel x) (-> obj nav travel z)))
@@ -1208,7 +1276,7 @@
(set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist)))
(set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0))
(logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
(dummy-26 (-> obj nav))
(TODO-RENAME-26 (-> obj nav))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> obj fact-info-override)
+1 -1
View File
@@ -996,7 +996,7 @@
)
(set! (-> self nav) (new 'process 'nav-control (-> self root-override) 16 40960.0))
(logior! (-> self nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
(set-current-poly! (-> self nav) (TODO-RENAME-18 (-> self nav) (-> self root-override trans)))
(set-current-poly! (-> self nav) (find-poly (-> self nav) (-> self root-override trans)))
(+! (-> self parent-process 0 hit-points) 3)
(dummy-21 self)
(when (zero? (-> self skel))
@@ -1613,4 +1613,4 @@ TEST_F(FormRegressionTest, VectorLineDistance) {
" )";
test_with_stack_structures(func, type, expected,
R"([[16, "vector"], [32, "vector"], [48, "vector"], [64, "vector"]])");
}
}
+4
View File
@@ -203,6 +203,10 @@
// generic-obs
"command-get-process", // handle casts
// navigate
"end-collect-nav",
"start-collect-nav",
// appears twice
"(method 9 drawable-tree-instance-tie)",
"(method 11 drawable-tree-instance-tie)",