[jak 2] merc (#2039)

This commit is contained in:
water111
2022-11-30 22:36:09 -05:00
committed by GitHub
parent ceebe3f7eb
commit 70e231fa72
113 changed files with 31406 additions and 974 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
#include "Printer.h"
#include <cmath>
#include <mutex>
#include "third-party/fmt/core.h"
@@ -23,7 +24,7 @@ goos::Object float_representation(float value) {
memcpy(&int_value, &value, 4);
u8 exp = (int_value >> 23) & 0xff;
u32 mant = int_value & 0x7fffff;
if ((exp == 0 && mant != 0) || exp == 0xff) {
if ((exp == 0 && mant != 0) || exp == 0xff || !std::isfinite(value)) {
// lg::warn("PS2-incompatible float (0x{:08X}) detected! Writing as the-as cast.", int_value);
return pretty_print::build_list("the-as", "float", fmt::format("#x{:x}", int_value));
} else if (const_floats.find(int_value) != const_floats.end()) {
+1 -1
View File
@@ -261,7 +261,7 @@ void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def
if (id != -1) {
// method id assert!
if (id != info.id) {
lg::print("WARNING - ID assert failed on method %s of type %s (wanted %d got %d)\n",
lg::print("WARNING - ID assert failed on method {} of type {} (wanted {} got {})\n",
method_name.c_str(), type->get_name().c_str(), id, info.id);
throw std::runtime_error("Method ID assert failed");
}
+1 -2
View File
@@ -184,11 +184,10 @@ goos::Object SimpleAtom::to_form(const std::vector<DecompilerLabel>& labels, con
s32 as_s32 = m_int;
ASSERT(((s64)as_s32) == m_int); // float should always be a sign extended 32-bit value.
memcpy(&f, &as_s32, 4);
if (f == f) {
if (f == f && std::isfinite(f)) {
return goos::Object::make_float(f);
} else {
// nan or weird
ASSERT(false); // let's abort on this for now, can remove if it actually comes up.
return pretty_print::to_symbol(fmt::format("(the-as float #x{:x})", m_int));
}
} else {
File diff suppressed because it is too large Load Diff
@@ -465,5 +465,17 @@
[15, "(function none :behavior target)"]
],
"generic-obs": [[9, "(function symbol :behavior touch-tracker)"]],
"gun-dark-shot": [[1, "(function handle none :behavior gun-dark-shot)"]]
"gun-dark-shot": [[1, "(function handle none :behavior gun-dark-shot)"]],
"ctywide-scenes": [
[3, "(function object)"],
[2, "(function object)"],
[1, "(function object)"],
[0, "(function object)"]
],
"fortress-obs": [
[3, "(function object)"]
],
"forexita-obs": [
[0, "(function object)"]
]
}
+13 -2
View File
@@ -441,7 +441,14 @@
288,
289,
290
]
],
"bones-mtx-calc-execute": [
19, 7
],
"foreground-draw": [
0, 1, 126
],
"dma-add-process-drawable": [0, 136]
},
// Sometimes the game might use format strings that are fetched dynamically,
@@ -509,6 +516,7 @@
"fill-bg-using-box-new",
"fill-bg-using-line-sphere-new",
"(method 12 collide-mesh)",
"(method 11 collide-mesh)",
"(method 14 collide-mesh)",
"(method 15 collide-mesh)",
"(method 10 collide-edge-hold-list)",
@@ -548,7 +556,10 @@
"(method 10 collide-cache-prim)",
"(method 17 collide-cache)",
"(method 9 collide-puss-work)",
"(method 10 collide-puss-work)"
"(method 10 collide-puss-work)",
"bones-mtx-calc",
"foreground-check-longest-edge-asm",
"foreground-merc"
],
"mips2c_jump_table_functions": {},
+13 -5
View File
@@ -13,7 +13,7 @@
"CGO/ENGINE.CGO",
"CGO/GAME.CGO",
"CGO/COMMON.CGO",
// "DGO/LWIDEB.DGO",
"DGO/LWIDEB.DGO",
"DGO/LMEETBRT.DGO",
"DGO/CTA.DGO",
"DGO/PALOUT.DGO",
@@ -23,7 +23,7 @@
// "DGO/HIDEOUT.DGO",
// "DGO/LWIDESTA.DGO",
// "DGO/LRACELIT.DGO",
// "DGO/CTB.DGO",
"DGO/CTB.DGO",
// "DGO/KIOSK.DGO",
// "DGO/DG1.DGO",
"DGO/FEB.DGO",
@@ -66,7 +66,7 @@
"DGO/PRI.DGO",
// "DGO/LKIDDOGE.DGO",
// "DGO/NESTT.DGO",
// "DGO/LWIDEC.DGO",
"DGO/LWIDEC.DGO",
// "DGO/SAG.DGO",
// "DGO/NEB.DGO",
// "DGO/COB.DGO",
@@ -102,7 +102,7 @@
// "DGO/LTENTOB.DGO",
// "DGO/LRACEBF.DGO",
// "DGO/LPROTECT.DGO",
// "DGO/FEA.DGO",
"DGO/FEA.DGO",
// "DGO/ONINTENT.DGO",
// "DGO/STA.DGO",
// "DGO/CGC.DGO",
@@ -113,7 +113,7 @@
// "DGO/CIA.DGO",
// "DGO/TOB.DGO",
// "DGO/LRACEDB.DGO",
// "DGO/LDJAKBRN.DGO",
"DGO/LDJAKBRN.DGO",
// "DGO/TOA.DGO",
// "DGO/STADBLMP.DGO",
// "DGO/UND.DGO",
@@ -187,8 +187,16 @@
"levels_to_extract": [
"PRI.DGO",
"CTA.DGO",
"CTB.DGO",
"CWI.DGO",
"LWIDEA.DGO",
"LWIDEB.DGO",
"LWIDEC.DGO",
"FEA.DGO",
"FEB.DGO",
"LDJAKBRN.DGO",
"VI1.DGO",
"CIB.DGO",
"FEB.DGO"
+42 -1
View File
@@ -483,7 +483,20 @@
["L1250", "uint64", true],
["L1158", "vector"],
["L1222", "uint64", true],
["L1223", "uint64", true]
["L1223", "uint64", true],
["L1221", "uint64", true],
["L815", "vector"],
["L801", "vector"],
["L787", "vector"],
["L773", "vector"],
["L766", "vector"],
["L752", "vector"],
["L738", "vector"],
["L724", "vector"],
["L710", "vector"],
["L696", "vector"],
["L682", "vector"]
],
"ocean-texture": [
["L55", "vector4w"],
@@ -532,5 +545,33 @@
"flitter": [
["L159", "vector"],
["L158", "vector"]
],
"foreground": [["L213", "vector"], ["L214", "(pointer bucket-id-16)", 200]],
"prison-part": [["L238", "uint64", true]],
"prison-obs": [["L293", "vector4w"], ["L292", "vector4w"]],
"ctywide-scenes": [
["L1164", "vector"],
["L1150", "vector"],
["L1136", "vector"],
["L1129", "vector"],
["L1122", "vector"],
["L1115", "vector"],
["L1108", "vector"],
["L1085", "traffic-danger-info"],
["L960", "vector"],
["L953", "vector"],
["L946", "vector"],
["L932", "vector"],
["L918", "vector"],
["L851", "traffic-danger-info"],
["L351", "vector"],
["L250", "vector"],
["L142", "vector"]
],
"forexita-part": [
["L191", "uint64", true]
],
"forexitb-part": [
["L197", "uint64", true]
]
}
+19 -1
View File
@@ -1202,5 +1202,23 @@
"(method 20 collide-cache)": [[16, "matrix"]],
"col-rend-draw": [[16, "matrix"]],
"(code jump enemy)": [[16, "enemy-jump-info"]],
"check-drop-level-flitter-dirt-rubble": [[16, "vector"]]
"check-drop-level-flitter-dirt-rubble": [[16, "vector"]],
"col-rend-draw": [
[16, "matrix"]
],
"dma-add-process-drawable": [
[64, "light-group"]
],
"dark-lightning-handler": [
[16, "matrix"]
],
"(method 25 joint-exploder)": [
[16, "matrix"]
],
"check-drop-level-forexitb-drop-userdata": [
[16, "vector"]
],
"check-drop-level-forexitb-drop-water-userdata": [
[16, "vector"]
]
}
+179 -2
View File
@@ -2081,8 +2081,8 @@
[45, "a0", "(pointer gs-test)"],
[47, "a0", "(pointer gs-reg64)"],
[49, "a1", "(pointer gs-reg64)"],
[52, "a0", "(pointer gs-test)"],
[54, "a0", "(pointer gs-test)"],
[52, "a0", "(pointer gs-zbuf)"],
[54, "a0", "(pointer gs-reg64)"],
[[63, 68], "v1", "dma-packet"]
],
"texture-usage-init": [
@@ -5077,5 +5077,182 @@
[28, "v1", "vector"],
[32, "v1", "vector"],
[36, "v1", "vector"]
],
"bones-set-sqwc": [[2, "v1", "dma-bank-control"]],
"bones-reset-sqwc": [[2, "v1", "dma-bank-control"]],
"bones-init": [
[1, "v1", "bone-memory"],
[6, "a1", "bone-memory"],
[10, "a1", "bone-memory"],
[14, "a1", "bone-memory"],
[18, "a1", "bone-memory"],
[22, "a1", "bone-memory"],
[26, "a1", "bone-memory"],
[44, "a0", "dma-packet"],
[45, "a0", "(pointer uint64)"]
],
"bones-mtx-calc-execute": [
[[126, 154], "a0", "pris-mtx"],
[[126, 154], "a1", "pris-mtx"],
[65, "v1", "bone-memory"],
[70, "a1", "bone-memory"],
[74, "a1", "bone-memory"],
[78, "a1", "bone-memory"],
[82, "a1", "bone-memory"],
[86, "a1", "bone-memory"],
[90, "a1", "bone-memory"],
[94, "a0", "dma-bank-control"],
[157, "a0", "dma-bank-control"]
],
"foreground-init": [
[[1, 100], "gp", "foreground-work"],
[21, "a0", "dma-packet"],
[22, "a0", "(pointer uint64)"]
],
"texscroll-make-request": [
[[5, 40], "a1", "mei-texture-scroll"]
],
"texscroll-execute": [
[19, "t1", "pointer"],
[15, "a2", "merc-fragment-control"],
[[20, 24], "t1", "merc-fragment"],
[40, "a2", "merc-fragment-control"],
[45, "a2", "merc-fragment-control"],
[48, "a2", "merc-fragment-control"],
[51, "a2", "int"],
[[10, 31], "a1", "mei-texture-scroll"],
[39, "t1", "(pointer int8)"]
],
"foreground-wrapup": [
[[1, 90], "gp", "foreground-work"],
[[25, 31], "a0", "dma-packet"],
[[55, 60], "a0", "dma-packet"]
],
"foreground-draw": [
[[1, 64], "at", "foreground-work"],
[13, "t0", "foreground-work"],
[27, "t1", "foreground-work"],
[32, "a2", "foreground-work"],
[37, "a1", "foreground-work"],
[70, "a0", "foreground-work"],
[114, "v1", "foreground-work"],
[116, "v1", "foreground-work"],
[118, "v1", "foreground-work"],
[142, "v1", "foreground-work"],
[187, "a0", "foreground-work"],
[220, "a0", "foreground-work"],
[233, "a0", "foreground-work"],
[256, "a0", "foreground-work"],
[369, "v1", "foreground-work"],
[377, "a0", "foreground-work"],
[417, "a0", "foreground-work"],
[432, "a0", "foreground-work"],
[445, "v1", "foreground-work"],
[468, "v1", "foreground-work"],
[475, "v1", "foreground-work"],
[500, "v1", "foreground-work"],
[518, "v1", "foreground-work"],
[524, "v1", "foreground-work"],
[553, "a0", "foreground-work"],
[583, "v1", "foreground-work"],
[594, "v1", "foreground-work"],
[602, "v1", "foreground-work"],
[611, "v1", "foreground-work"],
[654, "a0", "foreground-work"],
[648, "s5", "int"],
[315, "a2", "(pointer uint8)"],
[321, "v1", "pointer"],
[338, "a3", "(pointer uint8)"],
[344, "v1", "pointer"],
[[4, 61], "a0", "bone-calculation"],
[[185, 189], "v1", "mei-texture-scroll"],
[[252,281], "v1", "mei-envmap-tint"]
],
"foreground-add-mtx-calc": [
[1, "v1", "foreground-work"]
],
"foreground-shadow": [
[2, "v1", "foreground-work"],
[[13, 19], "t1", "vector"]
],
"dma-add-process-drawable": [
[433, "a0", "foreground-work"],
[545, "t0", "(pointer uint128)"],
[39, "a0", "foreground-work"],
[42, "a0", "foreground-work"],
[[128, 146], "v1", "mood-context"]
],
"foreground-ripple": [
[2, "v1", "foreground-work"],
[25, "v1", "foreground-work"],
[[27, 32], "a0", "foreground-work"]
],
"dark-lightning-handler": [
[64, "s5", "process-drawable"],
[211, "gp", "process-drawable"],
[147, "s5", "process-drawable"],
[251, "gp", "process-drawable"],
[312, "a0", "lightning-tracker"]
],
"(post idle air-train)": [
[4, "t9", "(function none)"]
],
"(anon-function 3 ctywide-scenes)": [
[13, "t9", "(function mood-context symbol)"],
[33, "t9", "(function mood-context symbol)"]
],
"(anon-function 2 ctywide-scenes)": [
[13, "t9", "(function mood-context symbol)"],
[33, "t9", "(function mood-context symbol)"]
],
"(anon-function 1 ctywide-scenes)": [
[13, "t9", "(function mood-context symbol)"],
[33, "t9", "(function mood-context symbol)"]
],
"(anon-function 0 ctywide-scenes)": [
[13, "t9", "(function mood-context symbol)"],
[33, "t9", "(function mood-context symbol)"]
],
"(method 11 fort-trap-door)": [
[53, "a0", "collide-shape-moving"]
],
"(method 0 joint-exploder-tuning)": [
[[5, 79], "v0", "joint-exploder-tuning"]
],
"joint-exploder-init-by-other": [
[48, "a0", "process-drawable"],
[57, "v1", "process-drawable"],
[64, "a0", "process-drawable"]
],
"(method 23 joint-exploder)": [
[26, "v1", "process-drawable"]
],
"(method 28 joint-exploder)": [
[[0, 250], "s5", "joint-exploder-list"]
],
"joint-exploder-joint-callback": [
[3, "s4", "joint-exploder"]
],
"(event idle fort-trap-door)": [
[4, "v1", "attack-info"]
]
}
+83
View File
@@ -2193,5 +2193,88 @@
"sv-56": "overhang-nrm",
"sv-52": "tangent"
}
},
"foreground-draw": {
"args": ["dc", "dma-buf", "dist-in"],
"vars": {
"at-0":"fg-work",
"a0-1":["bone-calc", "bone-calculation"],
"t1-0":"num-bones",
"a3-3":"bone-mem-size",
"t0-1":"fg-regs",
"v1-0":"matrix-mem",
"t0-2":"matrix-mem2",
"t1-2":"bflags",
"t4-0":"f-regs",
"a1-6":"bone-list",
"a2-5":"calc-to-add",
"t2-4":"jnt",
"t3-0":"bn",
"t4-1":"count",
"t5-0":"calc",
"s5-0":["dma-ptr", "pointer"],
"s4-0":"bucket-info",
"a0-5":"fg-lights",
"v1-6":"rotated-light-out",
"a1-8":"inv-cam-rot",
"s3-0":"geo",
"s2-0":"effect-mask",
"s1-0":"effect-idx",
"v1-40":"extra",
"v1-41":"tex-scroll-info",
"v1-70":"ei",
"v1-71":"tint-info",
"f1-1":"t-fade-0",
"f0-4":"t-fade-1",
"f1-3":"t-interp",
"f0-6":"t-amount",
"a0-75":"merc-fade-int",
"v1-156":"fade-enable",
"f0-11":"dist-until-gone"
}
},
"dma-add-process-drawable": {
"args": ["pd", "dc", "flag", "dma-buf"],
"vars": {
"s4-0":"fg-bounds",
"s3-0":"fg-lights",
"sv-272":"tod",
"sv-288": "shadow-mask",
"s0-0": "shadow-mask-not",
"sv-304":"lev-idx-for-mood",
"s1-1":"light-idx",
"s2-1":"lg",
"v1-53":"packed-shadow-vals",
"a0-28":"light-idx",
"a2-8":"light-pal-idx",
"s1-2":"fg-light-lev-idx",
"v1-62":"lev",
"s0-1":"light-hash",
"sv-320":"my-origin",
"sv-336":"lev-mood",
"v0-6":"light-lookup-result",
"sv-352":"light-result-bucket",
"sv-368":"index-ptr",
"sv-384":"index-index",
"a1-49":"light-sphere",
"v1-73":"palette-idx",
"f0-12":"interp",
"s1-3":"target-shadow-dir",
"s0-2":"current-shadow-dir",
"f30-0":"shadow-dir-w",
"v1-109":"fg-dist",
"s3-1":"lod-idx",
"f30-1":"dist-w",
"v1-133":"src-lev",
"f0-26":"corrected-dist",
"a0-64":"tex-use",
"a1-54":"use-fg-idx",
"a2-13":"use-idx",
"t0-0":"tex-lod"
}
},
"(method 0 joint-exploder-tuning)": {
"vars": {"v0-0":["v0-0", "joint-exploder-tuning"]}
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
// if you want to filter to only some object names.
// it will make the decompiler much faster.
"allowed_objects": [],
"banned_objects": ["ctywide-scenes", "texture-anim-tables", "traffic-engine"],
"banned_objects": ["texture-anim-tables", "traffic-engine"],
////////////////////////////
// CODE ANALYSIS OPTIONS
@@ -101,10 +101,6 @@ void extract_art_groups_from_level(const ObjectFileDB& db,
const std::vector<level_tools::TextureRemap>& tex_remap,
const std::string& dgo_name,
tfrag3::Level& level_data) {
if (db.version() == GameVersion::Jak2) {
lg::warn("skipping art group extraction for jak 2");
return;
}
const auto& files = db.obj_files_by_dgo.at(dgo_name);
for (const auto& file : files) {
if (file.name.length() > 3 && !file.name.compare(file.name.length() - 3, 3, "-ag")) {
+5 -7
View File
@@ -654,7 +654,6 @@ std::string debug_dump_to_ply(const std::vector<MercDraw>& draws,
ConvertedMercEffect convert_merc_effect(const MercEffect& input_effect,
const MercCtrlHeader& ctrl_header,
const TextureDB& tdb,
const std::vector<level_tools::TextureRemap>& map,
const std::string& debug_name,
size_t ctrl_idx,
@@ -726,9 +725,7 @@ ConvertedMercEffect convert_merc_effect(const MercEffect& input_effect,
u32 tpage = new_tex >> 20;
u32 tidx = (new_tex >> 8) & 0b1111'1111'1111;
u32 tex_combo = (((u32)tpage) << 16) | tidx;
// look up the texture to make sure it's valid
auto tex = tdb.textures.find(tex_combo);
ASSERT(tex != tdb.textures.end());
// remember the texture id
merc_state.merc_draw_mode.pc_combo_tex_id = tex_combo;
@@ -882,8 +879,8 @@ void extract_merc(const ObjectFileData& ag_data,
for (size_t ci = 0; ci < ctrls.size(); ci++) {
auto& effects_in_ctrl = all_effects.emplace_back();
for (size_t ei = 0; ei < ctrls[ci].effects.size(); ei++) {
effects_in_ctrl.push_back(convert_merc_effect(ctrls[ci].effects[ei], ctrls[ci].header, tex_db,
map, ctrls[ci].name, ci, ei, dump_level));
effects_in_ctrl.push_back(convert_merc_effect(ctrls[ci].effects[ei], ctrls[ci].header, map,
ctrls[ci].name, ci, ei, dump_level));
}
}
@@ -941,7 +938,8 @@ void extract_merc(const ObjectFileData& ag_data,
// not added to level, add it
auto tex_it = tex_db.textures.find(draw.state.merc_draw_mode.pc_combo_tex_id);
if (tex_it == tex_db.textures.end()) {
ASSERT(false);
lg::error("failed to find texture: 0x{:x} for {}\n",
draw.state.merc_draw_mode.pc_combo_tex_id, ctrl.name);
} else {
idx_in_level_texture = out.textures.size();
auto& new_tex = out.textures.emplace_back();
-1
View File
@@ -735,7 +735,6 @@ end_type_pass:
}
auto& type = instr.unknown_label_tag->selected_type.value();
int idx = instr.unknown_label_tag->label_idx;
ASSERT(type.base_type() != "pointer"); // want to test this if we find example...
env.file->label_db->set_and_get_previous(idx, type, false, {});
}
+9 -2
View File
@@ -156,7 +156,7 @@ goos::Object decompile_at_label_guess_type(const DecompilerLabel& label,
GameVersion version) {
auto guessed_type = get_type_of_label(label, words);
if (!guessed_type.has_value()) {
throw std::runtime_error("Could not guess the type of " + label.name);
throw std::runtime_error("(1) Could not guess the type of " + label.name);
}
return decompile_at_label(*guessed_type, label, labels, words, ts, file, version);
}
@@ -1567,7 +1567,14 @@ goos::Object decompile_pair_elt(const LinkedWord& word,
auto& label = labels.at(word.label_id());
auto guessed_type = get_type_of_label(label, words);
if (!guessed_type.has_value()) {
throw std::runtime_error("Could not guess the type of " + label.name);
auto& info = file->label_db->lookup(label.name);
if (info.known) {
guessed_type = info.result_type;
}
}
if (!guessed_type.has_value()) {
throw std::runtime_error("(1) Could not guess the type of " + label.name);
}
if (guessed_type == TypeSpec("pair")) {
+2
View File
@@ -82,6 +82,7 @@ set(RUNTIME_SOURCE
mips2c/jak1_functions/tfrag.cpp
mips2c/jak1_functions/tie_methods.cpp
mips2c/jak1_functions/time_of_day.cpp
mips2c/jak2_functions/bones.cpp
mips2c/jak2_functions/collide_cache.cpp
mips2c/jak2_functions/collide_edge_grab.cpp
mips2c/jak2_functions/collide_func.cpp
@@ -89,6 +90,7 @@ set(RUNTIME_SOURCE
mips2c/jak2_functions/collide_mesh.cpp
mips2c/jak2_functions/debug.cpp
mips2c/jak2_functions/font.cpp
mips2c/jak2_functions/foreground.cpp
mips2c/jak2_functions/joint.cpp
mips2c/jak2_functions/sky.cpp
mips2c/jak2_functions/sparticle.cpp
@@ -278,15 +278,10 @@ void DirectRenderer::update_gl_prim(SharedRenderState* render_state) {
} else {
render_state->shaders[ShaderId::DIRECT_BASIC].activate();
}
if (state.fogging_enable) {
// ASSERT(false);
}
if (state.aa_enable) {
ASSERT(false);
}
if (state.use_uv) {
ASSERT(false);
}
if (state.ctxt) {
ASSERT(false);
}
@@ -580,6 +575,9 @@ void DirectRenderer::render_gif(const u8* data,
case GifTag::RegisterDescriptor::TEX0_1:
handle_tex0_1_packed(data + offset);
break;
case GifTag::RegisterDescriptor::UV:
handle_uv_packed(data + offset);
break;
default:
ASSERT_MSG(false, fmt::format("Register {} is not supported in packed mode yet\n",
reg_descriptor_name(reg_desc[reg])));
@@ -769,6 +767,15 @@ void DirectRenderer::handle_st_packed(const u8* data) {
memcpy(&m_prim_building.Q, data + 8, 4);
}
void DirectRenderer::handle_uv_packed(const u8* data) {
u32 u, v;
memcpy(&u, data, 4);
memcpy(&v, data + 4, 4);
m_prim_building.st_reg.x() = u;
m_prim_building.st_reg.y() = v;
m_prim_building.Q = 16.f;
}
void DirectRenderer::handle_rgbaq_packed(const u8* data) {
// TODO update Q from st.
m_prim_building.rgba_reg[0] = data[0];
@@ -81,6 +81,7 @@ class DirectRenderer : public BucketRenderer {
void handle_rgbaq(u64 val);
void handle_xyzf2(u64 val, SharedRenderState* render_state, ScopedProfilerNode& prof);
void handle_st_packed(const u8* data);
void handle_uv_packed(const u8* data);
void handle_rgbaq_packed(const u8* data);
void handle_xyzf2_packed(const u8* data,
SharedRenderState* render_state,
@@ -99,19 +99,28 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 0);
init_bucket_renderer<Tie3>("tie-l0-tfrag", BucketCategory::TIE, BucketId::TIE_L0_TFRAG, 0);
// 10
init_bucket_renderer<Merc2>("merc-l0-tfrag", BucketCategory::MERC, BucketId::MERC_L0_TFRAG);
init_bucket_renderer<TextureUploadHandler>("tex-l1-tfrag", BucketCategory::TEX,
BucketId::TEX_L1_TFRAG);
init_bucket_renderer<TFragment>("tfrag-l1-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L1_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 1);
// 20
init_bucket_renderer<Tie3>("tie-l1-tfrag", BucketCategory::TIE, BucketId::TIE_L1_TFRAG, 1);
init_bucket_renderer<Merc2>("merc-l1-tfrag", BucketCategory::MERC, BucketId::MERC_L1_TFRAG);
init_bucket_renderer<TextureUploadHandler>("tex-l2-tfrag", BucketCategory::TEX,
BucketId::TEX_L2_TFRAG);
// 30
init_bucket_renderer<TFragment>("tfrag-l2-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L2_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 2);
init_bucket_renderer<Tie3>("tie-l2-tfrag", BucketCategory::TIE, BucketId::TIE_L2_TFRAG, 2);
init_bucket_renderer<Merc2>("merc-l2-tfrag", BucketCategory::MERC, BucketId::MERC_L2_TFRAG);
// 40
init_bucket_renderer<TextureUploadHandler>("tex-l3-tfrag", BucketCategory::TEX,
BucketId::TEX_L3_TFRAG);
init_bucket_renderer<TFragment>("tfrag-l3-tfrag", BucketCategory::TFRAG, BucketId::TFRAG_L3_TFRAG,
std::vector{tfrag3::TFragmentTreeKind::NORMAL}, false, 3);
init_bucket_renderer<Tie3>("tie-l3-tfrag", BucketCategory::TIE, BucketId::TIE_L3_TFRAG, 3);
init_bucket_renderer<Merc2>("merc-l3-tfrag", BucketCategory::MERC, BucketId::MERC_L3_TFRAG);
// 50
// 60
// 70
@@ -123,6 +132,9 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
BucketId::TEX_L1_SHRUB);
init_bucket_renderer<Shrub>("shrub-l1-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L1_SHRUB);
// 90
init_bucket_renderer<TextureUploadHandler>("tex-l2-shrub", BucketCategory::TEX,
BucketId::TEX_L2_SHRUB);
init_bucket_renderer<Shrub>("shrub-l2-shrub", BucketCategory::SHRUB, BucketId::SHRUB_L2_SHRUB);
// 100
init_bucket_renderer<TextureUploadHandler>("tex-l3-shrub", BucketCategory::TEX,
BucketId::TEX_L3_SHRUB);
@@ -135,6 +147,8 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
BucketId::TFRAG_T_L0_ALPHA,
std::vector{tfrag3::TFragmentTreeKind::TRANS}, false, 0);
// 130
init_bucket_renderer<TextureUploadHandler>("tex-l1-alpha", BucketCategory::TEX,
BucketId::TEX_L1_ALPHA);
// 140
// 150
// 160
@@ -142,32 +156,42 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
// 180
init_bucket_renderer<TextureUploadHandler>("tex-lcom-tfrag", BucketCategory::TEX,
BucketId::TEX_LCOM_TFRAG);
init_bucket_renderer<Merc2>("merc-lcom-tfrag", BucketCategory::MERC, BucketId::MERC_LCOM_TFRAG);
// 190
init_bucket_renderer<TextureUploadHandler>("tex-lcom-shrub", BucketCategory::TEX,
BucketId::TEX_LCOM_SHRUB);
init_bucket_renderer<Merc2>("merc-lcom-shrub", BucketCategory::MERC, BucketId::MERC_LCOM_SHRUB);
init_bucket_renderer<TextureUploadHandler>("tex-l0-pris", BucketCategory::TEX,
BucketId::TEX_L0_PRIS);
init_bucket_renderer<Merc2>("merc-l0-pris", BucketCategory::MERC, BucketId::MERC_L0_PRIS);
// 200
init_bucket_renderer<TextureUploadHandler>("tex-l1-pris", BucketCategory::TEX,
BucketId::TEX_L1_PRIS);
init_bucket_renderer<Merc2>("merc-l1-pris", BucketCategory::MERC, BucketId::MERC_L1_PRIS);
init_bucket_renderer<TextureUploadHandler>("tex-l2-pris", BucketCategory::TEX,
BucketId::TEX_L2_PRIS);
init_bucket_renderer<Merc2>("merc-l2-pris", BucketCategory::MERC, BucketId::MERC_L2_PRIS);
init_bucket_renderer<TextureUploadHandler>("tex-l3-pris", BucketCategory::TEX,
BucketId::TEX_L3_PRIS);
// 210
// 220
init_bucket_renderer<TextureUploadHandler>("tex-lcom-pris", BucketCategory::TEX,
BucketId::TEX_LCOM_PRIS);
init_bucket_renderer<Merc2>("merc-lcom-pris", BucketCategory::MERC, BucketId::MERC_LCOM_PRIS);
// 230
// 240
// 250
init_bucket_renderer<TextureUploadHandler>("tex-l0-water", BucketCategory::TEX,
BucketId::TEX_L0_WATER);
init_bucket_renderer<Merc2>("merc-l0-water", BucketCategory::MERC, BucketId::MERC_L0_WATER);
init_bucket_renderer<TFragment>("tfrag-w-l0-alpha", BucketCategory::TFRAG,
BucketId::TFRAG_W_L0_WATER,
std::vector{tfrag3::TFragmentTreeKind::WATER}, false, 0);
// 260
init_bucket_renderer<TextureUploadHandler>("tex-l1-water", BucketCategory::TEX,
BucketId::TEX_L1_WATER);
init_bucket_renderer<Merc2>("merc-l1-water", BucketCategory::MERC, BucketId::MERC_L1_WATER);
// 270
init_bucket_renderer<TextureUploadHandler>("tex-l2-water", BucketCategory::TEX,
BucketId::TEX_L2_WATER);
@@ -176,6 +200,7 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
// 300
init_bucket_renderer<TextureUploadHandler>("tex-lcom-water", BucketCategory::TEX,
BucketId::TEX_LCOM_WATER);
init_bucket_renderer<Merc2>("merc-lcom-water", BucketCategory::MERC, BucketId::MERC_LCOM_WATER);
init_bucket_renderer<TextureUploadHandler>("tex-lcom-sky-post", BucketCategory::TEX,
BucketId::TEX_LCOM_SKY_POST);
// 310
@@ -189,6 +214,8 @@ void OpenGLRenderer::init_bucket_renderers_jak2() {
init_bucket_renderer<TextureUploadHandler>("tex-all-map", BucketCategory::TEX,
BucketId::TEX_ALL_MAP);
// 320
init_bucket_renderer<DirectRenderer>("progress", BucketCategory::OTHER, BucketId::PROGRESS,
0x8000);
init_bucket_renderer<DirectRenderer>("debug2", BucketCategory::OTHER, BucketId::DEBUG2, 0x8000);
init_bucket_renderer<DirectRenderer>("debug-no-zbuf2", BucketCategory::OTHER,
BucketId::DEBUG_NO_ZBUF2, 0x8000);
@@ -658,6 +685,7 @@ Fbo make_fbo(int w, int h, int msaa, bool make_zbuf_and_stencil) {
void OpenGLRenderer::setup_frame(const RenderOptions& settings) {
// glfw controls the window framebuffer, so we just update the size:
auto& window_fb = m_fbo_state.resources.window;
bool window_resized = window_fb.width != settings.window_framebuffer_width ||
window_fb.height != settings.window_framebuffer_height;
window_fb.valid = true;
+21
View File
@@ -87,37 +87,58 @@ enum class BucketId {
TEX_L0_TFRAG = 7,
TFRAG_L0_TFRAG = 8,
TIE_L0_TFRAG = 9,
MERC_L0_TFRAG = 14,
TEX_L1_TFRAG = 18,
TFRAG_L1_TFRAG = 19,
TIE_L1_TFRAG = 20,
MERC_L1_TFRAG = 25,
TEX_L2_TFRAG = 29,
TFRAG_L2_TFRAG = 30,
TIE_L2_TFRAG = 31,
MERC_L2_TFRAG = 36,
TEX_L3_TFRAG = 40,
TFRAG_L3_TFRAG = 41,
TIE_L3_TFRAG = 42,
MERC_L3_TFRAG = 47,
TEX_L0_SHRUB = 73,
SHRUB_L0_SHRUB = 74,
TEX_L1_SHRUB = 82,
SHRUB_L1_SHRUB = 83,
TEX_L2_SHRUB = 91,
SHRUB_L2_SHRUB = 92,
TEX_L3_SHRUB = 100,
SHRUB_L3_SHRUB = 101,
TEX_L0_ALPHA = 127,
TFRAG_T_L0_ALPHA = 128,
TEX_L1_ALPHA = 137,
TEX_LCOM_TFRAG = 187,
MERC_LCOM_TFRAG = 188,
TEX_LCOM_SHRUB = 191,
MERC_LCOM_SHRUB = 192, // ???
TEX_L0_PRIS = 196,
MERC_L0_PRIS = 197,
TEX_L1_PRIS = 200,
MERC_L1_PRIS = 201,
TEX_L2_PRIS = 204,
MERC_L2_PRIS = 205,
TEX_L3_PRIS = 208,
TEX_LCOM_PRIS = 220,
MERC_LCOM_PRIS = 221,
TEX_L0_WATER = 252,
MERC_L0_WATER = 253,
TFRAG_W_L0_WATER = 255,
TEX_L1_WATER = 261,
MERC_L1_WATER = 262,
TEX_L2_WATER = 270,
TEX_LCOM_WATER = 306,
MERC_LCOM_WATER = 307,
TEX_LCOM_SKY_POST = 309,
TEX_ALL_SPRITE = 312,
PARTICLES = 313,
TEX_ALL_WARP = 316,
DEBUG_NO_ZBUF1 = 318,
TEX_ALL_MAP = 319,
PROGRESS = 320,
DEBUG2 = 324,
DEBUG_NO_ZBUF2 = 325,
DEBUG3 = 326,
@@ -153,6 +153,12 @@ void Merc2::set_lights(const DmaTransfer& dma) {
memcpy(&m_current_lights, dma.data, sizeof(VuLights));
}
std::string Merc2::ShaderMercMat::to_string() const {
return fmt::format("tmat:\n{}\n{}\n{}\n{}\n", tmat[0].to_string_aligned(),
tmat[1].to_string_aligned(), tmat[2].to_string_aligned(),
tmat[3].to_string_aligned());
}
void Merc2::handle_matrix_dma(const DmaTransfer& dma) {
int slot = dma.vif0() & 0xff;
ASSERT(slot < MAX_SKEL_BONES);
@@ -167,8 +173,9 @@ void Merc2::handle_all_dma(DmaFollower& dma,
ScopedProfilerNode& prof) {
// process the first tag. this is just jumping to the merc-specific dma.
auto data0 = dma.read_and_advance();
ASSERT(data0.vif1() == 0);
ASSERT(data0.vif0() == 0);
ASSERT(data0.vif1() == 0 || data0.vifcode1().kind == VifCode::Kind::NOP);
ASSERT(data0.vif0() == 0 || data0.vifcode0().kind == VifCode::Kind::NOP ||
data0.vifcode0().kind == VifCode::Kind::MARK);
ASSERT(data0.size_bytes == 0);
if (dma.current_tag().kind == DmaTag::Kind::CALL) {
// renderer didn't run, let's just get out of here.
@@ -178,13 +185,13 @@ void Merc2::handle_all_dma(DmaFollower& dma,
ASSERT(dma.current_tag_offset() == render_state->next_bucket);
return;
}
ASSERT(data0.size_bytes == 0);
ASSERT(data0.vif0() == 0);
ASSERT(data0.vif1() == 0);
if (dma.current_tag_offset() == render_state->next_bucket) {
return;
}
// if we reach here, there's stuff to draw
// this handles merc-specific setup DMA
handle_setup_dma(dma);
handle_setup_dma(dma, render_state);
// handle each merc transfer
while (dma.current_tag_offset() != render_state->next_bucket) {
@@ -202,13 +209,11 @@ void set_uniform(GLuint uniform, const math::Vector4f& val) {
}
} // namespace
void Merc2::handle_setup_dma(DmaFollower& dma) {
void Merc2::handle_setup_dma(DmaFollower& dma, SharedRenderState* render_state) {
auto first = dma.read_and_advance();
// 10 quadword setup packet
ASSERT(first.size_bytes == 10 * 16);
// m_stats.str += fmt::format("Setup 0: {} {} {}", first.size_bytes / 16,
// first.vifcode0().print(), first.vifcode1().print());
// transferred vifcodes
{
@@ -245,6 +250,12 @@ void Merc2::handle_setup_dma(DmaFollower& dma) {
// 8 qw's of low memory data
memcpy(&m_low_memory, first.data + 16, sizeof(LowMemory));
// fmt::print("low\nhvdf: {}\nfog: {}\nmat:\n{}\n{}\n{}\n{}\n\n",
// m_low_memory.hvdf_offset.to_string_aligned(), m_low_memory.fog.to_string_aligned(),
// m_low_memory.perspective[0].to_string_aligned(),
// m_low_memory.perspective[1].to_string_aligned(),
// m_low_memory.perspective[2].to_string_aligned(),
// m_low_memory.perspective[3].to_string_aligned());
set_uniform(m_uniforms.hvdf_offset, m_low_memory.hvdf_offset);
set_uniform(m_uniforms.fog, m_low_memory.fog);
for (int i = 0; i < 4; i++) {
@@ -267,12 +278,22 @@ void Merc2::handle_setup_dma(DmaFollower& dma) {
// TODO: process low memory initialization
auto second = dma.read_and_advance();
ASSERT(second.size_bytes == 32); // setting up test register.
auto nothing = dma.read_and_advance();
ASSERT(nothing.size_bytes == 0);
ASSERT(nothing.vif0() == 0);
ASSERT(nothing.vif1() == 0);
if (render_state->version == GameVersion::Jak1) {
auto second = dma.read_and_advance();
ASSERT(second.size_bytes == 32); // setting up test register.
auto nothing = dma.read_and_advance();
ASSERT(nothing.size_bytes == 0);
ASSERT(nothing.vif0() == 0);
ASSERT(nothing.vif1() == 0);
} else {
auto second = dma.read_and_advance();
ASSERT(second.size_bytes == 48); // setting up test/zbuf register.
// todo z write mask stuff.
auto nothing = dma.read_and_advance();
ASSERT(nothing.size_bytes == 0);
ASSERT(nothing.vif0() == 0);
ASSERT(nothing.vif1() == 0);
}
}
namespace {
@@ -302,13 +323,34 @@ void Merc2::handle_merc_chain(DmaFollower& dma,
auto init = dma.read_and_advance();
if (init.vifcode0().kind == VifCode::Kind::FLUSHA) {
while (dma.current_tag_offset() != render_state->next_bucket) {
dma.read_and_advance();
}
return;
}
if (init.vifcode1().kind == VifCode::Kind::PC_PORT) {
// we got a PC PORT packet. this contains some extra data to set up the model
flush_pending_model(render_state, prof);
init_pc_model(init, render_state);
ASSERT(tag_is_nothing_cnt(dma));
ASSERT(tag_is_nothing_cnt(dma) || tag_is_nothing_next(dma));
init = dma.read_and_advance(); // dummy tag in pc port
init = dma.read_and_advance();
if (init.vifcode0().kind != VifCode::Kind::STROW) {
init = dma.read_and_advance();
}
if (init.vifcode0().kind != VifCode::Kind::STROW) {
init = dma.read_and_advance();
}
if (init.vifcode0().kind != VifCode::Kind::STROW) {
while (dma.current_tag_offset() != render_state->next_bucket) {
auto skip = dma.read_and_advance();
ASSERT(skip.vifcode0().kind == VifCode::Kind::NOP);
ASSERT(skip.vifcode1().kind == VifCode::Kind::NOP);
}
return;
}
}
// row stuff.
@@ -48,7 +48,7 @@ class Merc2 : public BucketRenderer {
void init_for_frame(SharedRenderState* render_state);
void init_pc_model(const DmaTransfer& setup, SharedRenderState* render_state);
void handle_all_dma(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof);
void handle_setup_dma(DmaFollower& dma);
void handle_setup_dma(DmaFollower& dma, SharedRenderState* render_state);
u32 alloc_lights(const VuLights& lights);
void set_lights(const DmaTransfer& dma);
void handle_matrix_dma(const DmaTransfer& dma);
@@ -69,6 +69,8 @@ class Merc2 : public BucketRenderer {
math::Vector4f tmat[4];
math::Vector4f nmat[3];
math::Vector4f pad;
std::string to_string() const;
};
static constexpr int MAX_SKEL_BONES = 128;
@@ -27,7 +27,7 @@ uniform vec4 fog_constants;
uniform mat4 perspective_matrix;
const float SCISSOR_ADJUST = 512.0/448.0;
const float SCISSOR_ADJUST = HEIGHT_SCALE * 512.0/448.0;
// output
out vec3 vtx_color;
+8 -1
View File
@@ -348,8 +348,15 @@ uint32_t link_control::jak2_work_v2() {
MsgErr("dkernel: heap overflow\n"); // game has ~% instead of \n :P
return 1;
}
} else { // not close enough, need to move the object
// added in jak 2, move the link block to the top of the heap so we can allocate on
// the level heap during linking without overwriting link data. this is used for level types
u32 link_block_size = *m_link_block_ptr.cast<u32>();
auto new_link_block = kmalloc(m_heap, link_block_size, KMALLOC_TOP, "link-block");
memmove(new_link_block.c(), m_link_block_ptr.c() - 4, link_block_size);
m_link_block_ptr = Ptr<uint8_t>(new_link_block.offset + 4); // basic offset
} else { // not close enough, need to move the object
// on the first run of this state...
if (m_segment_process == 0) {
m_original_object_location = m_object_data;
+676
View File
@@ -0,0 +1,676 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak2/kscheme.h"
using namespace jak2;
namespace Mips2C::jak2 {
void exec_mpg(ExecutionContext* c) {
// nop | mulax.xyzw ACC, vf05, vf01 0
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf01).vf.x());
// nop | madday.xyzw ACC, vf06, vf01 1
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf01].vf.y());
// nop | maddaz.xyzw ACC, vf07, vf01 2
c->acc.vf.madda(Mask::xyzw, c->vfs[vf07].vf, c->vfs[vf01].vf.z());
// nop | maddw.xyzw vf13, vf08, vf01 3
c->acc.vf.madd(Mask::xyzw, c->vfs[vf13].vf, c->vf_src(vf08).vf, c->vf_src(vf01).vf.w());
// nop | mulax.xyzw ACC, vf05, vf02 4
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf02).vf.x());
// nop | madday.xyzw ACC, vf06, vf02 5
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf02].vf.y());
// nop | maddaz.xyzw ACC, vf07, vf02 6
c->acc.vf.madda(Mask::xyzw, c->vfs[vf07].vf, c->vfs[vf02].vf.z());
// nop | maddw.xyzw vf14, vf08, vf02 7
c->acc.vf.madd(Mask::xyzw, c->vfs[vf14].vf, c->vf_src(vf08).vf, c->vf_src(vf02).vf.w());
// nop | mulax.xyzw ACC, vf05, vf03 8
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf03).vf.x());
// nop | madday.xyzw ACC, vf06, vf03 9
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf03].vf.y());
// nop | maddaz.xyzw ACC, vf07, vf03 10
c->acc.vf.madda(Mask::xyzw, c->vfs[vf07].vf, c->vfs[vf03].vf.z());
// nop | maddw.xyzw vf15, vf08, vf03 11
c->acc.vf.madd(Mask::xyzw, c->vfs[vf15].vf, c->vf_src(vf08).vf, c->vf_src(vf03).vf.w());
// nop | mulax.xyzw ACC, vf05, vf04 12
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf04).vf.x());
// nop | madday.xyzw ACC, vf06, vf04 13
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf04].vf.y());
// nop | maddaz.xyzw ACC, vf07, vf04 14
c->acc.vf.madda(Mask::xyzw, c->vfs[vf07].vf, c->vfs[vf04].vf.z());
// nop | maddw.xyzw vf16, vf08, vf04 15
c->acc.vf.madd(Mask::xyzw, c->vfs[vf16].vf, c->vf_src(vf08).vf, c->vf_src(vf04).vf.w());
// nop | opmula.xyz ACC, vf14, vf15 16
c->vopmula(vf14, vf15); // vu.acc.opmula(vu.vf14, vu.vf15);
// nop | opmsub.xyz vf09, vf15, vf14 17
c->vopmsub(vf09, vf15, vf14); // vu.acc.opmsub(vu.vf09, vu.vf15, vu.vf14);
// nop | opmula.xyz ACC, vf15, vf13 18
c->vopmula(vf15, vf13); // vu.acc.opmula(vu.vf15, vu.vf13);
// nop | opmsub.xyz vf10, vf13, vf15 19
c->vopmsub(vf10, vf13, vf15); // vu.acc.opmsub(vu.vf10, vu.vf13, vu.vf15);
// nop | opmula.xyz ACC, vf13, vf14 20
c->vopmula(vf13, vf14); // vu.acc.opmula(vu.vf13, vu.vf14);
// nop | mul.xyz vf12, vf13, vf09 21
c->vfs[vf12].vf.mul(Mask::xyz, c->vf_src(vf13).vf, c->vf_src(vf09).vf);
// nop | opmsub.xyz vf11, vf14, vf13 22
c->vopmsub(vf11, vf14, vf13); // vu.acc.opmsub(vu.vf11, vu.vf14, vu.vf13);
// nop | mulax.xyzw ACC, vf28, vf13 23
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf28).vf, c->vf_src(vf13).vf.x());
// nop | madday.xyzw ACC, vf29, vf13 24
c->acc.vf.madda(Mask::xyzw, c->vfs[vf29].vf, c->vfs[vf13].vf.y());
// nop | maddaz.xyzw ACC, vf30, vf13 25
c->acc.vf.madda(Mask::xyzw, c->vfs[vf30].vf, c->vfs[vf13].vf.z());
// nop | maddw.xyzw vf13, vf31, vf13 26
c->acc.vf.madd(Mask::xyzw, c->vfs[vf13].vf, c->vf_src(vf31).vf, c->vf_src(vf13).vf.w());
// nop | mulax.w ACC, vf00, vf12 27
c->acc.vf.mula(Mask::w, c->vf_src(vf00).vf, c->vf_src(vf12).vf.x());
// nop | madday.w ACC, vf00, vf12 28
c->acc.vf.madda(Mask::w, c->vfs[vf00].vf, c->vfs[vf12].vf.y());
// nop | maddz.w vf12, vf00, vf12 29
c->acc.vf.madd(Mask::w, c->vfs[vf12].vf, c->vf_src(vf00).vf, c->vf_src(vf12).vf.z());
// nop | mulax.xyzw ACC, vf28, vf14 30
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf28).vf, c->vf_src(vf14).vf.x());
// nop | madday.xyzw ACC, vf29, vf14 31
c->acc.vf.madda(Mask::xyzw, c->vfs[vf29].vf, c->vfs[vf14].vf.y());
// nop | maddaz.xyzw ACC, vf30, vf14 32
c->acc.vf.madda(Mask::xyzw, c->vfs[vf30].vf, c->vfs[vf14].vf.z());
// div Q, vf00.w, vf12.w | maddw.xyzw vf14, vf31, vf14 33
c->acc.vf.madd(Mask::xyzw, c->vfs[vf14].vf, c->vf_src(vf31).vf, c->vf_src(vf14).vf.w());
//vu.Q = vu.vf00.w() / vu.vf12.w();
c->vdiv(vf0, BC::w, vf12, BC::w);
// nop | mulax.xyzw ACC, vf28, vf15 34
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf28).vf, c->vf_src(vf15).vf.x());
// nop | madday.xyzw ACC, vf29, vf15 35
c->acc.vf.madda(Mask::xyzw, c->vfs[vf29].vf, c->vfs[vf15].vf.y());
// nop | maddaz.xyzw ACC, vf30, vf15 36
c->acc.vf.madda(Mask::xyzw, c->vfs[vf30].vf, c->vfs[vf15].vf.z());
// nop | maddw.xyzw vf15, vf31, vf15 37
c->acc.vf.madd(Mask::xyzw, c->vfs[vf15].vf, c->vf_src(vf31).vf, c->vf_src(vf15).vf.w());
// nop | mulax.xyzw ACC, vf28, vf16 38
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf28).vf, c->vf_src(vf16).vf.x());
// nop | madday.xyzw ACC, vf29, vf16 39
c->acc.vf.madda(Mask::xyzw, c->vfs[vf29].vf, c->vfs[vf16].vf.y());
// nop | maddaz.xyzw ACC, vf30, vf16 40
c->acc.vf.madda(Mask::xyzw, c->vfs[vf30].vf, c->vfs[vf16].vf.z());
// nop | maddw.xyzw vf16, vf31, vf16 41
c->acc.vf.madd(Mask::xyzw, c->vfs[vf16].vf, c->vf_src(vf31).vf, c->vf_src(vf16).vf.w());
// nop | mul.xyzw vf09, vf09, Q 42
c->vfs[vf09].vf.mul(Mask::xyzw, c->vf_src(vf09).vf, c->Q);
// nop | mul.xyzw vf10, vf10, Q 43
c->vfs[vf10].vf.mul(Mask::xyzw, c->vf_src(vf10).vf, c->Q);
// nop | mul.xyzw vf11, vf11, Q 44
c->vfs[vf11].vf.mul(Mask::xyzw, c->vf_src(vf11).vf, c->Q);
// nop | mulax.xyzw ACC, vf25, vf09 45
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf25).vf, c->vf_src(vf09).vf.x());
// nop | madday.xyzw ACC, vf26, vf09 46
c->acc.vf.madda(Mask::xyzw, c->vfs[vf26].vf, c->vfs[vf09].vf.y());
// nop | maddz.xyzw vf09, vf27, vf09 47
c->acc.vf.madd(Mask::xyzw, c->vfs[vf09].vf, c->vf_src(vf27).vf, c->vf_src(vf09).vf.z());
// nop | mulax.xyzw ACC, vf25, vf10 48
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf25).vf, c->vf_src(vf10).vf.x());
// nop | madday.xyzw ACC, vf26, vf10 49
c->acc.vf.madda(Mask::xyzw, c->vfs[vf26].vf, c->vfs[vf10].vf.y());
// nop | maddz.xyzw vf10, vf27, vf10 50
c->acc.vf.madd(Mask::xyzw, c->vfs[vf10].vf, c->vf_src(vf27).vf, c->vf_src(vf10).vf.z());
// nop | mulax.xyzw ACC, vf25, vf11 51
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf25).vf, c->vf_src(vf11).vf.x());
// nop | madday.xyzw ACC, vf26, vf11 :e 52
c->acc.vf.madda(Mask::xyzw, c->vfs[vf26].vf, c->vfs[vf11].vf.y());
// nop | maddz.xyzw vf11, vf27, vf11 53
c->acc.vf.madd(Mask::xyzw, c->vfs[vf11].vf, c->vf_src(vf27).vf, c->vf_src(vf11).vf.z());
}
}
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak2/kscheme.h"
using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace bones_mtx_calc {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 madr, sadr, qwc;
// hack, added this that should be loaded by the caller.
// lqc2 vf28, 0(v1) ;; [ 60] (set! vf28 (l.vf v1-13)) [v1: matrix ] -> []
c->lqc2(vf28, 0, t0);
// lqc2 vf29, 16(v1) ;; [ 61] (set! vf29 (l.vf (+ v1-13 16))) [v1: matrix ] -> []
c->lqc2(vf29, 16, t0);
// lqc2 vf30, 32(v1) ;; [ 62] (set! vf30 (l.vf (+ v1-13 32))) [v1: matrix ] -> []
c->lqc2(vf30, 32, t0);
// lqc2 vf31, 48(v1) ;; [ 63] (set! vf31 (l.vf (+ v1-13 48))) [v1: matrix ] -> []
c->lqc2(vf31, 48, t0);
// lqc2 vf25, 0(v1) ;; [ 64] (set! vf25 (l.vf v1-13)) [v1: matrix ] -> []
c->lqc2(vf25, 0, t0);
// lqc2 vf26, 16(v1) ;; [ 65] (set! vf26 (l.vf (+ v1-13 16))) [v1: matrix ] -> []
c->lqc2(vf26, 16, t0);
// lqc2 vf27, 32(v1) ;; [ 66] (set! vf27 (l.vf (+ v1-13 32))) [v1: matrix ] -> []
c->lqc2(vf27, 32, t0);
c->daddiu(sp, sp, -96); // daddiu sp, sp, -96
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s2, 16, sp); // sq s2, 16(sp)
c->sq(s3, 32, sp); // sq s3, 32(sp)
c->sq(s4, 48, sp); // sq s4, 48(sp)
c->sq(s5, 64, sp); // sq s5, 64(sp)
c->sq(gp, 80, sp); // sq gp, 80(sp)
c->lui(v1, 4096); // lui v1, 4096
c->lui(t0, 4096); // lui t0, 4096
c->ori(v1, v1, 54272); // ori v1, v1, 54272
c->ori(t0, t0, 53248); // ori t0, t0, 53248
c->lui(t2, 32767); // lui t2, 32767
c->daddiu(t1, a3, -16); // daddiu t1, a3, -16
c->ori(t2, t2, 65535); // ori t2, t2, 65535
get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672
c->addiu(t4, r0, 64); // addiu t4, r0, 64
c->addiu(t5, r0, 1280); // addiu t5, r0, 1280
bc = ((s64)c->sgpr64(t1)) >= 0; // bgez t1, L17
c->addiu(t3, r0, 16); // addiu t3, r0, 16
if (bc) {goto block_2;} // branch non-likely
c->mov64(t3, a3); // or t3, a3, r0
// nop // sll r0, r0, 0
c->dsll(t4, t3, 2); // dsll t4, t3, 2
c->dsll(a3, t3, 4); // dsll a3, t3, 4
c->dsll(t1, t3, 6); // dsll t1, t3, 6
// nop // sll r0, r0, 0
c->daddu(t5, t1, a3); // daddu t5, t1, a3
c->addiu(t1, r0, 0); // addiu t1, r0, 0
block_2:
c->addiu(a3, r0, 0); // addiu a3, r0, 0
c->addiu(t6, r0, 1); // addiu t6, r0, 1
c->and_(a1, a1, t2); // and a1, a1, t2
// nop // sll r0, r0, 0
c->daddiu(a1, a1, 12); // daddiu a1, a1, 12
c->mov64(a0, a0); // or a0, a0, r0
c->daddiu(a1, a1, -80); // daddiu a1, a1, -80
// nop // sll r0, r0, 0
/*
block_3:
c->lw(t6, 0, v1); // lw t6, 0(v1)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->andi(t6, t6, 256); // andi t6, t6, 256
// nop // sll r0, r0, 0
bc = c->sgpr64(t6) == 0; // beq t6, r0, L19
// nop // sll r0, r0, 0
if (bc) {goto block_5;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
//beq r0, r0, L18 // beq r0, r0, L18
// nop // sll r0, r0, 0
goto block_3; // branch always
*/
// block_5:
c->addiu(t6, r0, 80); // addiu t6, r0, 80
c->addiu(t7, r0, 264); // addiu t7, r0, 264
// c->sw(t6, 128, v1); // sw t6, 128(v1)
// c->sw(a1, 16, v1); // sw a1, 16(v1)
// c->sw(t4, 32, v1); // sw t4, 32(v1)
// c->sw(t7, 0, v1); // sw t7, 0(v1)
spad_to_dma_no_sadr_off_bones_interleave(cache.fake_scratchpad_data, c->sgpr64(a1), c->sgpr64(t6), c->sgpr64(t4));
c->daddu(a1, a1, t5); // daddu a1, a1, t5
/*
block_6:
c->lw(t4, 0, v1); // lw t4, 0(v1)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->andi(t4, t4, 256); // andi t4, t4, 256
// nop // sll r0, r0, 0
bc = c->sgpr64(t4) == 0; // beq t4, r0, L21
// nop // sll r0, r0, 0
if (bc) {goto block_8;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
//beq r0, r0, L20 // beq r0, r0, L20
// nop // sll r0, r0, 0
goto block_6; // branch always
*/
// block_8:
c->and_(a2, a2, t2); // and a2, a2, t2
// nop // sll r0, r0, 0
c->dsll(t2, t3, 2); // dsll t2, t3, 2
c->addiu(t4, r0, 256); // addiu t4, r0, 256
c->daddu(t2, t2, t3); // daddu t2, t2, t3
c->addiu(t6, r0, 1104); // addiu t6, r0, 1104
c->dsll(t5, t2, 4); // dsll t5, t2, 4
// c->sw(t6, 128, v1); // sw t6, 128(v1)
sadr = c->sgpr64(t6);
c->addiu(t8, r0, 0); // addiu t8, r0, 0
// c->sw(a2, 16, v1); // sw a2, 16(v1)
madr = c->sgpr64(a2);
c->daddu(a2, a2, t5); // daddu a2, a2, t5
// c->sw(t2, 32, v1); // sw t2, 32(v1)
qwc = c->sgpr64(t2);
c->addiu(t2, r0, 1); // addiu t2, r0, 1
// c->sw(t4, 0, v1); // sw t4, 0(v1)
spad_to_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc);
block_9:
/*
c->lw(t5, 0, v1); // lw t5, 0(v1)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->andi(t5, t5, 256); // andi t5, t5, 256
// nop // sll r0, r0, 0
bc = c->sgpr64(t5) == 0; // beq t5, r0, L23
// nop // sll r0, r0, 0
if (bc) {goto block_11;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
//beq r0, r0, L22 // beq r0, r0, L22
// nop // sll r0, r0, 0
goto block_9; // branch always
*/
// block_11:
c->dsll(t5, t8, 2); // dsll t5, t8, 2
c->daddu(t9, t5, at); // daddu t9, t5, at
// nop // sll r0, r0, 0
c->lwu(t5, 0, t9); // lwu t5, 0(t9)
c->mov64(t6, t3); // or t6, t3, r0
c->lwu(t7, 8, t9); // lwu t7, 8(t9)
c->mov64(ra, t3); // or ra, t3, r0
c->lwu(t3, 16, t9); // lwu t3, 16(t9)
// nop // sll r0, r0, 0
c->sw(ra, 44, at); // sw ra, 44(at)
bc = c->sgpr64(ra) == 0; // beq ra, r0, L36
c->sw(t8, 48, at); // sw t8, 48(at)
if (bc) {goto block_33;} // branch non-likely
c->daddiu(t1, t1, -16); // daddiu t1, t1, -16
c->addiu(t9, r0, 1280); // addiu t9, r0, 1280
bc = ((s64)c->sgpr64(t1)) >= 0; // bgez t1, L24
c->addiu(t8, r0, 16); // addiu t8, r0, 16
if (bc) {goto block_14;} // branch non-likely
c->daddiu(t8, t1, 16); // daddiu t8, t1, 16
c->addiu(t1, r0, 0); // addiu t1, r0, 0
c->dsll(t9, t8, 4); // dsll t9, t8, 4
c->dsll(ra, t8, 6); // dsll ra, t8, 6
bc = c->sgpr64(t8) == 0; // beq t8, r0, L25
c->daddu(t9, ra, t9); // daddu t9, ra, t9
if (bc) {goto block_15;} // branch non-likely
block_14:
c->dsll(t4, t8, 2); // dsll t4, t8, 2
c->dsll(ra, t2, 2); // dsll ra, t2, 2
c->daddu(gp, ra, at); // daddu gp, ra, at
// c->sw(a1, 16, v1); // sw a1, 16(v1)
madr = c->sgpr64(a1);
c->addiu(ra, r0, 264); // addiu ra, r0, 264
c->lwu(gp, 0, gp); // lwu gp, 0(gp)
c->andi(gp, gp, 16383); // andi gp, gp, 16383
// c->sw(t4, 32, v1); // sw t4, 32(v1)
qwc = c->sgpr64(t4);
c->daddu(a1, a1, t9); // daddu a1, a1, t9
// c->sw(gp, 128, v1); // sw gp, 128(v1)
sadr = c->sgpr64(gp);
c->addiu(t4, r0, 0); // addiu t4, r0, 0
// c->sw(ra, 0, v1); // sw ra, 0(v1)
spad_to_dma_no_sadr_off_bones_interleave(cache.fake_scratchpad_data, madr, sadr, qwc);
block_15:
// nop // sll r0, r0, 0
c->sw(t8, 40, at); // sw t8, 40(at)
// nop // sll r0, r0, 0
c->lqc2(vf1, 0, t5); // lqc2 vf1, 0(t5)
// nop // sll r0, r0, 0
c->lqc2(vf2, 16, t5); // lqc2 vf2, 16(t5)
// nop // sll r0, r0, 0
c->lqc2(vf3, 32, t5); // lqc2 vf3, 32(t5)
// nop // sll r0, r0, 0
c->lqc2(vf4, 48, t5); // lqc2 vf4, 48(t5)
// nop // sll r0, r0, 0
c->lqc2(vf5, 0, t7); // lqc2 vf5, 0(t7)
// nop // sll r0, r0, 0
c->lqc2(vf6, 16, t7); // lqc2 vf6, 16(t7)
// nop // sll r0, r0, 0
c->lqc2(vf7, 32, t7); // lqc2 vf7, 32(t7)
// nop // sll r0, r0, 0
c->lqc2(vf8, 48, t7); // lqc2 vf8, 48(t7)
// Unknown instr: vcallms 0
exec_mpg(c);
// nop // sll r0, r0, 0
block_16:
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->daddiu(t5, t5, 64); // daddiu t5, t5, 64
// nop // sll r0, r0, 0
c->daddiu(t7, t7, 80); // daddiu t7, t7, 80
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->lq(t8, 0, t5); // lq t8, 0(t5)
// nop // sll r0, r0, 0
c->lq(t9, 16, t5); // lq t9, 16(t5)
// nop // sll r0, r0, 0
c->lq(ra, 32, t5); // lq ra, 32(t5)
// nop // sll r0, r0, 0
c->lq(gp, 48, t5); // lq gp, 48(t5)
// nop // sll r0, r0, 0
c->lq(s5, 0, t7); // lq s5, 0(t7)
// nop // sll r0, r0, 0
c->lq(s4, 16, t7); // lq s4, 16(t7)
// nop // sll r0, r0, 0
c->lq(s3, 32, t7); // lq s3, 32(t7)
// nop // sll r0, r0, 0
c->lq(s2, 48, t7); // lq s2, 48(t7)
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf1, t8); // qmtc2.ni vf1, t8
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf2, t9); // qmtc2.ni vf2, t9
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf3, ra); // qmtc2.ni vf3, ra
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf4, gp); // qmtc2.ni vf4, gp
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf5, s5); // qmtc2.ni vf5, s5
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf6, s4); // qmtc2.ni vf6, s4
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf7, s3); // qmtc2.ni vf7, s3
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf8, s2); // qmtc2.ni vf8, s2
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t8, vf13); // qmfc2.i t8, vf13
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t9, vf14); // qmfc2.ni t9, vf14
// nop // sll r0, r0, 0
c->mov128_gpr_vf(ra, vf15); // qmfc2.ni ra, vf15
// nop // sll r0, r0, 0
c->mov128_gpr_vf(gp, vf16); // qmfc2.ni gp, vf16
// nop // sll r0, r0, 0
c->mov128_gpr_vf(s5, vf9); // qmfc2.ni s5, vf9
// nop // sll r0, r0, 0
c->mov128_gpr_vf(s4, vf10); // qmfc2.ni s4, vf10
// nop // sll r0, r0, 0
c->mov128_gpr_vf(s3, vf11); // qmfc2.ni s3, vf11
// Unknown instr: vcallms 0
exec_mpg(c);
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->sq(t8, 0, t3); // sq t8, 0(t3)
// nop // sll r0, r0, 0
c->sq(t9, 16, t3); // sq t9, 16(t3)
// nop // sll r0, r0, 0
c->sq(ra, 32, t3); // sq ra, 32(t3)
// nop // sll r0, r0, 0
c->sq(gp, 48, t3); // sq gp, 48(t3)
// nop // sll r0, r0, 0
c->sq(s5, 64, t3); // sq s5, 64(t3)
// nop // sll r0, r0, 0
c->sq(s4, 80, t3); // sq s4, 80(t3)
// nop // sll r0, r0, 0
c->sq(s3, 96, t3); // sq s3, 96(t3)
// nop // sll r0, r0, 0
c->sq(r0, 112, t3); // sq r0, 112(t3)
c->daddiu(t3, t3, 128); // daddiu t3, t3, 128
c->daddiu(t6, t6, -1); // daddiu t6, t6, -1
bc = ((s64)c->sgpr64(t6)) > 0; // bgtz t6, L26
// nop // sll r0, r0, 0
if (bc) {goto block_16;} // branch non-likely
// nop // sll r0, r0, 0
c->lw(t3, 40, at); // lw t3, 40(at)
bc = c->sgpr64(t3) == 0; // beq t3, r0, L29
// nop // sll r0, r0, 0
if (bc) {goto block_21;} // branch non-likely
/*
block_18:
c->lw(t4, 0, v1); // lw t4, 0(v1)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->andi(t4, t4, 256); // andi t4, t4, 256
// nop // sll r0, r0, 0
bc = c->sgpr64(t4) == 0; // beq t4, r0, L28
// nop // sll r0, r0, 0
if (bc) {goto block_20;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
//beq r0, r0, L27 // beq r0, r0, L27
// nop // sll r0, r0, 0
goto block_18; // branch always
*/
// block_20:
c->dsll(t5, t2, 2); // dsll t5, t2, 2
// nop // sll r0, r0, 0
c->addiu(t4, r0, 1); // addiu t4, r0, 1
c->daddu(t5, t5, at); // daddu t5, t5, at
// nop // sll r0, r0, 0
c->lwu(t6, 8, t5); // lwu t6, 8(t5)
c->dsll(t5, t3, 2); // dsll t5, t3, 2
c->andi(t6, t6, 16383); // andi t6, t6, 16383
c->daddu(t5, t5, t3); // daddu t5, t5, t3
// c->sw(t6, 128, v1); // sw t6, 128(v1)
sadr = c->sgpr64(t6);
c->dsll(t6, t5, 4); // dsll t6, t5, 4
// c->sw(a2, 16, v1); // sw a2, 16(v1)
madr = c->sgpr64(a2);
c->addiu(t7, r0, 256); // addiu t7, r0, 256
// c->sw(t5, 32, v1); // sw t5, 32(v1)
qwc = c->sgpr64(t5);
c->daddu(a2, a2, t6); // daddu a2, a2, t6
// c->sw(t7, 0, v1); // sw t7, 0(v1)
spad_to_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc);
block_21:
// nop // sll r0, r0, 0
c->lw(t5, 48, at); // lw t5, 48(at)
// nop // sll r0, r0, 0
c->lw(t6, 44, at); // lw t6, 44(at)
/*
block_22:
c->lw(t7, 0, t0); // lw t7, 0(t0)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->andi(t7, t7, 256); // andi t7, t7, 256
// nop // sll r0, r0, 0
bc = c->sgpr64(t7) == 0; // beq t7, r0, L31
// nop // sll r0, r0, 0
if (bc) {goto block_24;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
//beq r0, r0, L30 // beq r0, r0, L30
// nop // sll r0, r0, 0
goto block_22; // branch always
*/
// block_24:
bc = c->sgpr64(t6) == 0; // beq t6, r0, L32
// nop // sll r0, r0, 0
if (bc) {goto block_26;} // branch non-likely
c->dsll(t7, t5, 2); // dsll t7, t5, 2
get_fake_spad_addr2(t8, cache.fake_scratchpad_data, 0, c);// lui t8, 28672
c->daddu(t7, t7, t8); // daddu t7, t7, t8
c->lwu(t7, 16, t7); // lwu t7, 16(t7)
c->andi(t7, t7, 16383); // andi t7, t7, 16383
// c->sw(t7, 128, t0); // sw t7, 128(t0)
sadr = c->sgpr64(t7);
// c->sw(a0, 16, t0); // sw a0, 16(t0)
madr = c->sgpr64(a0);
c->dsll(t7, t6, 3); // dsll t7, t6, 3
// c->sw(t7, 32, t0); // sw t7, 32(t0)
qwc = c->sgpr64(t7);
c->addiu(t7, r0, 256); // addiu t7, r0, 256
// c->sw(t7, 0, t0); // sw t7, 0(t0)
spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc);
c->dsll(t6, t6, 7); // dsll t6, t6, 7
c->daddu(a0, a0, t6); // daddu a0, a0, t6
block_26:
bc = c->sgpr64(t3) == 0; // beq t3, r0, L35
// nop // sll r0, r0, 0
if (bc) {goto block_31;} // branch non-likely
bc = c->sgpr64(t4) != 0; // bne t4, r0, L35
// nop // sll r0, r0, 0
if (bc) {goto block_31;} // branch non-likely
/*
block_28:
c->lw(t6, 0, v1); // lw t6, 0(v1)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->andi(t6, t6, 256); // andi t6, t6, 256
// nop // sll r0, r0, 0
bc = c->sgpr64(t6) == 0; // beq t6, r0, L34
// nop // sll r0, r0, 0
if (bc) {goto block_30;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
//beq r0, r0, L33 // beq r0, r0, L33
// nop // sll r0, r0, 0
goto block_28; // branch always
*/
// block_30:
c->dsll(t6, t2, 2); // dsll t6, t2, 2
get_fake_spad_addr2(t7, cache.fake_scratchpad_data, 0, c);// lui t7, 28672
c->daddu(t6, t6, t7); // daddu t6, t6, t7
c->lwu(t6, 8, t6); // lwu t6, 8(t6)
c->andi(t6, t6, 16383); // andi t6, t6, 16383
// c->sw(t6, 128, v1); // sw t6, 128(v1)
sadr = c->sgpr64(t6);
// c->sw(a2, 16, v1); // sw a2, 16(v1)
madr = c->sgpr64(a2);
c->addiu(t6, r0, 5); // addiu t6, r0, 5
c->mult3(t6, t6, t3); // mult3 t6, t6, t3
// c->sw(t6, 32, v1); // sw t6, 32(v1)
qwc = c->sgpr64(t6);
c->addiu(t6, r0, 256); // addiu t6, r0, 256
// c->sw(t6, 0, v1); // sw t6, 0(v1)
spad_to_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc);
c->addiu(t6, r0, 80); // addiu t6, r0, 80
c->mult3(t6, t6, t3); // mult3 t6, t6, t3
c->daddu(a2, a2, t6); // daddu a2, a2, t6
block_31:
c->mov64(t8, t2); // or t8, t2, r0
bc = c->sgpr64(t1) != 0; // bne t1, r0, L22
c->mov64(t2, t5); // or t2, t5, r0
if (bc) {goto block_9;} // branch non-likely
bc = c->sgpr64(a3) == 0; // beq a3, r0, L22
c->addiu(a3, r0, 1); // addiu a3, r0, 1
if (bc) {goto block_9;} // branch non-likely
block_33:
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lq(gp, 80, sp); // lq gp, 80(sp)
c->lq(s5, 64, sp); // lq s5, 64(sp)
c->lq(s4, 48, sp); // lq s4, 48(sp)
c->lq(s3, 32, sp); // lq s3, 32(sp)
c->lq(s2, 16, sp); // lq s2, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 96); // daddiu sp, sp, 96
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("bones-mtx-calc", execute, 128);
}
} // namespace bones_mtx_calc
} // namespace Mips2C
+3 -2
View File
@@ -211,7 +211,7 @@ using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace method_14_collide_mesh {
u64 execute(void* ctxt) {
ASSERT(false); // this should be totally fine to remove, just trying to find what calls this
// ASSERT(false); // this should be totally fine to remove, just trying to find what calls this
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
// nop // sll r0, r0, 0
@@ -416,7 +416,7 @@ using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace method_15_collide_mesh {
u64 execute(void* ctxt) {
ASSERT(false); // this should be totally fine to remove, just trying to find what calls this
// ASSERT(false); // this should be totally fine to remove, just trying to find what calls this
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
// nop // sll r0, r0, 0
@@ -716,3 +716,4 @@ void link() {
} // namespace method_15_collide_mesh
} // namespace Mips2C
+613
View File
@@ -0,0 +1,613 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak2/kscheme.h"
using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace foreground_check_longest_edge_asm {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
void* math_camera; // *math-camera*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
bool cop1_bc = false;
float acc;
get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672
c->mov64(v0, s7); // or v0, s7, r0
c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7)
c->lwc1(f0, 84, a0); // lwc1 f0, 84(a0)
c->lwc1(f7, 2592, at); // lwc1 f7, 2592(at)
c->lwc1(f3, 2596, at); // lwc1 f3, 2596(at)
c->lwc1(f6, 2600, at); // lwc1 f6, 2600(at)
c->lwc1(f4, 152, a0); // lwc1 f4, 152(a0)
c->lwc1(f12, 0, v1); // lwc1 f12, 0(v1)
c->lwc1(f11, 64, v1); // lwc1 f11, 64(v1)
c->mtc1(f1, a1); // mtc1 f1, a1
c->mtc1(f9, r0); // mtc1 f9, r0
c->mtc1(f10, r0); // mtc1 f10, r0
c->mtc1(f2, r0); // mtc1 f2, r0
c->mtc1(f2, r0); // mtc1 f2, r0
c->mtc1(f5, r0); // mtc1 f5, r0
c->mtc1(f8, r0); // mtc1 f8, r0
c->lui(a0, 16256); // lui a0, 16256
c->mtc1(f5, a0); // mtc1 f5, a0
cop1_bc = c->fprs[f1] < c->fprs[f11]; // c.lt.s f1, f11
bc = cop1_bc; // bc1t L100
// nop // sll r0, r0, 0
if (bc) {goto block_37;} // branch non-likely
c->lwc1(f11, 12, v1); // lwc1 f11, 12(v1)
c->lwc1(f13, 16, v1); // lwc1 f13, 16(v1)
c->muls(f11, f11, f12); // mul.s f11, f11, f12
c->muls(f13, f13, f12); // mul.s f13, f13, f12
c->subs(f14, f6, f4); // sub.s f14, f6, f4
cop1_bc = c->fprs[f12] < c->fprs[f14]; // c.lt.s f12, f14
bc = !cop1_bc; // bc1f L84
c->lwc1(f12, 60, v1); // lwc1 f12, 60(v1)
if (bc) {goto block_3;} // branch non-likely
c->muls(f12, f14, f12); // mul.s f12, f14, f12
cop1_bc = c->fprs[f0] < c->fprs[f12]; // c.lt.s f0, f12
bc = cop1_bc; // bc1t L99
// nop // sll r0, r0, 0
if (bc) {goto block_36;} // branch non-likely
block_3:
c->subs(f14, f3, f4); // sub.s f14, f3, f4
cop1_bc = c->fprs[f13] < c->fprs[f14]; // c.lt.s f13, f14
bc = !cop1_bc; // bc1f L85
c->lwc1(f12, 56, v1); // lwc1 f12, 56(v1)
if (bc) {goto block_5;} // branch non-likely
//beq r0, r0, L86 // beq r0, r0, L86
c->muls(f10, f14, f12); // mul.s f10, f14, f12
goto block_7; // branch always
block_5:
c->adds(f14, f3, f4); // add.s f14, f3, f4
c->negs(f13, f13); // neg.s f13, f13
cop1_bc = c->fprs[f14] < c->fprs[f13]; // c.lt.s f14, f13
bc = !cop1_bc; // bc1f L86
c->negs(f13, f14); // neg.s f13, f14
if (bc) {goto block_7;} // branch non-likely
c->muls(f10, f13, f12); // mul.s f10, f13, f12
block_7:
cop1_bc = c->fprs[f0] < c->fprs[f10]; // c.lt.s f0, f10
bc = cop1_bc; // bc1t L99
// nop // sll r0, r0, 0
if (bc) {goto block_36;} // branch non-likely
c->subs(f12, f7, f4); // sub.s f12, f7, f4
cop1_bc = c->fprs[f11] < c->fprs[f12]; // c.lt.s f11, f12
bc = !cop1_bc; // bc1f L87
c->lwc1(f10, 52, v1); // lwc1 f10, 52(v1)
if (bc) {goto block_10;} // branch non-likely
//beq r0, r0, L88 // beq r0, r0, L88
c->muls(f9, f12, f10); // mul.s f9, f12, f10
goto block_12; // branch always
block_10:
c->adds(f12, f7, f4); // add.s f12, f7, f4
c->negs(f11, f11); // neg.s f11, f11
cop1_bc = c->fprs[f12] < c->fprs[f11]; // c.lt.s f12, f11
bc = !cop1_bc; // bc1f L88
c->negs(f11, f12); // neg.s f11, f12
if (bc) {goto block_12;} // branch non-likely
c->muls(f9, f11, f10); // mul.s f9, f11, f10
block_12:
cop1_bc = c->fprs[f0] < c->fprs[f9]; // c.lt.s f0, f9
bc = cop1_bc; // bc1t L99
// nop // sll r0, r0, 0
if (bc) {goto block_36;} // branch non-likely
c->abss(f14, f7); // abs.s f14, f7
c->movs(f12, f6); // mov.s f12, f6
acc = c->fprs[f14] * c->fprs[f14]; // Unknown instr: mula.s f14, f14
c->fprs[f15] = acc + c->fprs[f12] * c->fprs[f12]; // Unknown instr: madd.s f15, f12, f12
c->lwc1(f9, 76, v1); // lwc1 f9, 76(v1)
c->lwc1(f13, 80, v1); // lwc1 f13, 80(v1)
c->lwc1(f10, 84, v1); // lwc1 f10, 84(v1)
c->lwc1(f11, 88, v1); // lwc1 f11, 88(v1)
c->fprs[f16] = c->fprs[f5] / (std::sqrt(std::abs(c->fprs[f15]))); // Unknown instr: rsqrt.s f16, f5, f15
c->muls(f15, f14, f16); // mul.s f15, f14, f16
c->muls(f16, f12, f16); // mul.s f16, f12, f16
acc = c->fprs[f9] * c->fprs[f16]; // Unknown instr: mula.s f9, f16
c->fprs[f12] = acc - c->fprs[f13] * c->fprs[f15]; // Unknown instr: msub.s f12, f13, f15
acc = c->fprs[f10] * c->fprs[f16]; // Unknown instr: mula.s f10, f16
c->fprs[f14] = acc - c->fprs[f11] * c->fprs[f15];// Unknown instr: msub.s f14, f11, f15
acc = c->fprs[f9] * c->fprs[f15];// Unknown instr: mula.s f9, f15
c->fprs[f9] = acc + c->fprs[f13] * c->fprs[f16];// Unknown instr: madd.s f9, f13, f16
acc = c->fprs[f10] * c->fprs[f15];// Unknown instr: mula.s f10, f15
c->fprs[f10] = acc + c->fprs[f11] * c->fprs[f16];// Unknown instr: madd.s f10, f11, f16
cop1_bc = c->fprs[f8] < c->fprs[f12]; // c.lt.s f8, f12
bc = cop1_bc; // bc1t L89
// nop // sll r0, r0, 0
if (bc) {goto block_17;} // branch non-likely
cop1_bc = c->fprs[f8] < c->fprs[f14]; // c.lt.s f8, f14
bc = cop1_bc; // bc1t L90
// nop // sll r0, r0, 0
if (bc) {goto block_18;} // branch non-likely
cop1_bc = c->fprs[f8] < c->fprs[f9]; // c.lt.s f8, f9
bc = cop1_bc; // bc1t L91
// nop // sll r0, r0, 0
if (bc) {goto block_19;} // branch non-likely
//beq r0, r0, L93 // beq r0, r0, L93
// nop // sll r0, r0, 0
goto block_23; // branch always
block_17:
//beq r0, r0, L93 // beq r0, r0, L93
c->divs(f2, f1, f10); // div.s f2, f1, f10
goto block_23; // branch always
block_18:
c->negs(f2, f12); // neg.s f2, f12
c->divs(f2, f2, f9); // div.s f2, f2, f9
c->divs(f7, f14, f10); // div.s f7, f14, f10
c->adds(f2, f7, f2); // add.s f2, f7, f2
//beq r0, r0, L93 // beq r0, r0, L93
c->muls(f2, f2, f1); // mul.s f2, f2, f1
goto block_23; // branch always
block_19:
c->subs(f8, f7, f4); // sub.s f8, f7, f4
c->adds(f10, f7, f4); // add.s f10, f7, f4
c->negs(f11, f7); // neg.s f11, f7
cop1_bc = c->fprs[f7] < c->fprs[f8]; // c.lt.s f7, f8
bc = cop1_bc; // bc1t L92
// nop // sll r0, r0, 0
if (bc) {goto block_22;} // branch non-likely
cop1_bc = c->fprs[f10] < c->fprs[f11]; // c.lt.s f10, f11
bc = cop1_bc; // bc1t L92
// nop // sll r0, r0, 0
if (bc) {goto block_22;} // branch non-likely
//beq r0, r0, L93 // beq r0, r0, L93
// nop // sll r0, r0, 0
goto block_23; // branch always
block_22:
c->negs(f2, f12); // neg.s f2, f12
c->muls(f2, f1, f2); // mul.s f2, f1, f2
c->divs(f2, f2, f9); // div.s f2, f2, f9
block_23:
cop1_bc = c->fprs[f0] < c->fprs[f2]; // c.lt.s f0, f2
bc = cop1_bc; // bc1t L99
// nop // sll r0, r0, 0
if (bc) {goto block_36;} // branch non-likely
c->abss(f10, f3); // abs.s f10, f3
c->movs(f12, f6); // mov.s f12, f6
acc = c->fprs[10] * c->fprs[10]; // Unknown instr: mula.s f10, f10
c->fprs[9] = acc + c->fprs[12] * c->fprs[12]; // Unknown instr: madd.s f9, f12, f12
c->lwc1(f7, 96, v1); // lwc1 f7, 96(v1)
c->lwc1(f8, 100, v1); // lwc1 f8, 100(v1)
c->lwc1(f6, 104, v1); // lwc1 f6, 104(v1)
c->fprs[f5] = c->fprs[f5] / (std::sqrt(std::abs(c->fprs[f9]))); // Unknown instr: rsqrt.s f5, f5, f9
c->lwc1(f11, 108, v1); // lwc1 f11, 108(v1)
c->mtc1(f9, r0); // mtc1 f9, r0
c->muls(f13, f10, f5); // mul.s f13, f10, f5
c->muls(f14, f12, f5); // mul.s f14, f12, f5
acc = c->fprs[f7] * c->fprs[f14];// Unknown instr: mula.s f7, f14
c->fprs[f10] = acc - c->fprs[f8] * c->fprs[f13];// Unknown instr: msub.s f10, f8, f13
acc = c->fprs[f6] * c->fprs[f14];// Unknown instr: mula.s f6, f14
c->fprs[f12] = acc - c->fprs[f11] * c->fprs[f13];// Unknown instr: msub.s f12, f11, f13
acc = c->fprs[f7] * c->fprs[f13];// Unknown instr: mula.s f7, f13
c->fprs[f5] = acc + c->fprs[f8] * c->fprs[f14];// Unknown instr: madd.s f5, f8, f14
acc = c->fprs[f6] * c->fprs[f13];// Unknown instr: mula.s f6, f13
c->fprs[f6] = acc + c->fprs[f11] * c->fprs[f14];// Unknown instr: madd.s f6, f11, f14
cop1_bc = c->fprs[f9] < c->fprs[f10]; // c.lt.s f9, f10
bc = cop1_bc; // bc1t L94
// nop // sll r0, r0, 0
if (bc) {goto block_28;} // branch non-likely
cop1_bc = c->fprs[f9] < c->fprs[f12]; // c.lt.s f9, f12
bc = cop1_bc; // bc1t L95
// nop // sll r0, r0, 0
if (bc) {goto block_29;} // branch non-likely
cop1_bc = c->fprs[f9] < c->fprs[f5]; // c.lt.s f9, f5
bc = cop1_bc; // bc1t L96
// nop // sll r0, r0, 0
if (bc) {goto block_30;} // branch non-likely
//beq r0, r0, L98 // beq r0, r0, L98
// nop // sll r0, r0, 0
goto block_34; // branch always
block_28:
//beq r0, r0, L98 // beq r0, r0, L98
c->divs(f1, f1, f6); // div.s f1, f1, f6
goto block_34; // branch always
block_29:
c->negs(f3, f10); // neg.s f3, f10
c->divs(f3, f3, f5); // div.s f3, f3, f5
c->divs(f4, f12, f6); // div.s f4, f12, f6
c->adds(f3, f4, f3); // add.s f3, f4, f3
//beq r0, r0, L98 // beq r0, r0, L98
c->muls(f1, f3, f1); // mul.s f1, f3, f1
goto block_34; // branch always
block_30:
c->subs(f6, f3, f4); // sub.s f6, f3, f4
c->adds(f4, f3, f4); // add.s f4, f3, f4
c->negs(f7, f3); // neg.s f7, f3
cop1_bc = c->fprs[f3] < c->fprs[f6]; // c.lt.s f3, f6
bc = cop1_bc; // bc1t L97
// nop // sll r0, r0, 0
if (bc) {goto block_33;} // branch non-likely
cop1_bc = c->fprs[f4] < c->fprs[f7]; // c.lt.s f4, f7
bc = cop1_bc; // bc1t L97
// nop // sll r0, r0, 0
if (bc) {goto block_33;} // branch non-likely
//beq r0, r0, L98 // beq r0, r0, L98
// nop // sll r0, r0, 0
goto block_34; // branch always
block_33:
c->negs(f3, f10); // neg.s f3, f10
c->muls(f1, f1, f3); // mul.s f1, f1, f3
c->divs(f1, f1, f5); // div.s f1, f1, f5
block_34:
cop1_bc = c->fprs[f0] < c->fprs[f2]; // c.lt.s f0, f2
bc = cop1_bc; // bc1t L99
// nop // sll r0, r0, 0
if (bc) {goto block_36;} // branch non-likely
//beq r0, r0, L100 // beq r0, r0, L100
// nop // sll r0, r0, 0
goto block_37; // branch always
block_36:
c->daddiu(v0, s7, 4); // daddiu v0, s7, #t
block_37:
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
cache.math_camera = intern_from_c("*math-camera*").c();
gLinkedFunctionTable.reg("foreground-check-longest-edge-asm", execute, 128);
}
} // namespace foreground_check_longest_edge_asm
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak2/kscheme.h"
using ::jak2::intern_from_c;
namespace Mips2C::jak2 {
namespace foreground_merc {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
void* foreground; // *foreground*
void* merc_global_stats; // *merc-global-stats*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->daddiu(sp, sp, -128); // daddiu sp, sp, -128
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s0, 16, sp); // sq s0, 16(sp)
c->sq(s1, 32, sp); // sq s1, 32(sp)
c->sq(s2, 48, sp); // sq s2, 48(sp)
c->sq(s3, 64, sp); // sq s3, 64(sp)
c->sq(s4, 80, sp); // sq s4, 80(sp)
c->sq(s5, 96, sp); // sq s5, 96(sp)
c->sq(gp, 112, sp); // sq gp, 112(sp)
c->mov64(t7, a3); // or t7, a3, r0
c->mov64(v1, t0); // or v1, t0, r0
c->lui(t0, 4096); // lui t0, 4096
c->lui(t1, 18304); // lui t1, 18304
c->daddiu(t0, t0, 1); // daddiu t0, t0, 1
c->dsll32(t1, t1, 0); // dsll32 t1, t1, 0
c->lui(a3, 12288); // lui a3, 12288
c->lui(t8, 19201); // lui t8, 19201
c->pcpyld(t0, a3, t0); // pcpyld t0, a3, t0
c->lbu(a3, 78, a0); // lbu a3, 78(a0)
c->pcpyld(t1, t8, t1); // pcpyld t1, t8, t1
c->lui(t2, 28160); // lui t2, 28160
c->addiu(t8, r0, 8); // addiu t8, r0, 8
c->multu3(a3, a3, t8); // multu3 a3, a3, t8
c->lui(t3, 1280); // lui t3, 1280
c->lui(t4, 27648); // lui t4, 27648
c->dsll32(t2, t2, 0); // dsll32 t2, t2, 0
c->dsll32(t4, t4, 0); // dsll32 t4, t4, 0
c->daddu(t4, t4, t3); // daddu t4, t4, t3
c->daddu(t3, t2, t3); // daddu t3, t2, t3
c->daddiu(t3, t3, 1); // daddiu t3, t3, 1
c->daddu(a0, a3, a0); // daddu a0, a3, a0
c->pcpyld(t2, t2, r0); // pcpyld t2, t2, r0
c->lw(a0, 28, a0); // lw a0, 28(a0)
c->pcpyld(t3, t3, r0); // pcpyld t3, t3, r0
c->pcpyld(t4, t4, r0); // pcpyld t4, t4, r0
c->lui(t5, 12288); // lui t5, 12288
c->lui(t6, 4096); // lui t6, 4096
c->daddiu(t5, t5, 7); // daddiu t5, t5, 7
c->lui(t8, 5120); // lui t8, 5120
c->lui(a3, 27655); // lui a3, 27655
c->daddu(t7, t8, t7); // daddu t7, t8, t7
c->dsll32(a3, a3, 0); // dsll32 a3, a3, 0
c->dsll32(t8, t7, 0); // dsll32 t8, t7, 0
c->pcpyld(t5, a3, t5); // pcpyld t5, a3, t5
c->lwu(t7, 52, a0); // lwu t7, 52(a0)
c->pcpyld(t6, t8, t6); // pcpyld t6, t8, t6
c->daddiu(t8, a0, 156); // daddiu t8, a0, 156
bc = c->sgpr64(t7) == 0; // beq t7, r0, L117
c->load_symbol2(a3, cache.foreground); // lw a3, *foreground*(s7)
if (bc) {goto block_16;} // branch non-likely
c->daddiu(t9, a3, 2508); // daddiu t9, a3, 2508
block_2:
c->mov64(ra, a2); // or ra, a2, r0
c->lbu(a3, 6, t9); // lbu a3, 6(t9)
c->lbu(gp, 4, t9); // lbu gp, 4(t9)
bc = c->sgpr64(a3) != 0; // bne a3, r0, L117
c->load_symbol2(a3, cache.merc_global_stats); // lw a3, *merc-global-stats*(s7)
if (bc) {goto block_16;} // branch non-likely
c->daddu(a3, r0, a3); // daddu a3, r0, a3
bc = c->sgpr64(gp) != 0; // bne gp, r0, L117
c->lhu(s4, 2, a3); // lhu s4, 2(a3)
if (bc) {goto block_16;} // branch non-likely
c->lhu(s3, 18, t8); // lhu s3, 18(t8)
c->lwu(gp, 4, a3); // lwu gp, 4(a3)
c->lhu(s5, 22, t8); // lhu s5, 22(t8)
c->daddu(s4, s4, s3); // daddu s4, s4, s3
c->lwu(s3, 8, a3); // lwu s3, 8(a3)
c->lhu(s2, 24, t8); // lhu s2, 24(t8)
c->daddu(gp, gp, s5); // daddu gp, gp, s5
c->sh(s4, 2, a3); // sh s4, 2(a3)
c->sw(gp, 4, a3); // sw gp, 4(a3)
c->daddu(s5, s3, s2); // daddu s5, s3, s2
c->lwu(t2, 0, t8); // lwu t2, 0(t8)
c->lwu(gp, 4, t8); // lwu gp, 4(t8)
c->lui(s4, 12288); // lui s4, 12288
c->dsll32(t2, t2, 0); // dsll32 t2, t2, 0
c->sw(s5, 8, a3); // sw s5, 8(a3)
c->or_(t2, t2, s4); // or t2, t2, s4
c->lhu(s5, 18, t8); // lhu s5, 18(t8)
c->addiu(s4, r0, 0); // addiu s4, r0, 0
bc = c->sgpr64(s5) == 0; // beq s5, r0, L117
// nop // sll r0, r0, 0
if (bc) {goto block_16;} // branch non-likely
// nop // sll r0, r0, 0
block_6:
c->lbu(s0, 0, gp); // lbu s0, 0(gp)
// nop // sll r0, r0, 0
c->lbu(s2, 1, gp); // lbu s2, 1(gp)
c->xori(s1, r0, 49292); // xori s1, r0, 49292
c->lbu(s3, 2, gp); // lbu s3, 2(gp)
c->daddiu(v0, s0, 3); // daddiu v0, s0, 3
c->lw(a3, 44, a0); // lw a3, 44(a0)
c->srl(v0, v0, 2); // srl v0, v0, 2
c->sq(t0, 0, a2); // sq t0, 0(a2)
c->xor_(t2, t2, v0); // xor t2, t2, v0
c->sq(t2, 32, a2); // sq t2, 32(a2)
c->xor_(t2, t2, v0); // xor t2, t2, v0
c->sh(s1, 44, a2); // sh s1, 44(a2)
c->daddu(s1, s1, s0); // daddu s1, s1, s0
c->sb(s0, 46, a2); // sb s0, 46(a2)
c->dsll32(s0, v0, 4); // dsll32 s0, v0, 4
c->daddu(t3, t2, s0); // daddu t3, t2, s0
c->daddiu(s0, s2, 3); // daddiu s0, s2, 3
c->sw(a3, 12, a2); // sw a3, 12(a2)
c->srl(s0, s0, 2); // srl s0, s0, 2
c->sq(t1, 16, a2); // sq t1, 16(a2)
// pc hack
{
u16 use_pc_merc_bits = UINT16_MAX;
u16 ignore_alpha_bits = UINT16_MAX;
memcpy(g_ee_main_mem + c->sgpr64(a2) + 28, &use_pc_merc_bits, 2);
memcpy(g_ee_main_mem + c->sgpr64(a2) + 30, &ignore_alpha_bits, 2);
}
c->xor_(t3, t3, s0); // xor t3, t3, s0
c->sq(t3, 48, a2); // sq t3, 48(a2)
c->xor_(t3, t3, s0); // xor t3, t3, s0
c->sh(s1, 60, a2); // sh s1, 60(a2)
c->daddu(s1, s1, s2); // daddu s1, s1, s2
c->sb(s2, 62, a2); // sb s2, 62(a2)
c->dsll32(s2, s0, 4); // dsll32 s2, s0, 4
c->sw(a3, 16, a2); // sw a3, 16(a2)
c->daddu(t4, t3, s2); // daddu t4, t3, s2
c->xor_(t4, t4, s3); // xor t4, t4, s3
c->xori(a3, s1, 16384); // xori a3, s1, 16384
c->sq(t4, 64, a2); // sq t4, 64(a2)
c->xor_(t4, t4, s3); // xor t4, t4, s3
c->sb(s3, 78, a2); // sb s3, 78(a2)
c->dsll32(s3, s3, 4); // dsll32 s3, s3, 4
c->sh(a3, 76, a2); // sh a3, 76(a2)
c->daddu(t2, t4, s3); // daddu t2, t4, s3
c->lbu(s3, 3, gp); // lbu s3, 3(gp)
c->daddiu(gp, gp, 4); // daddiu gp, gp, 4
bc = c->sgpr64(s4) != 0; // bne s4, r0, L113
c->daddiu(a2, a2, 80); // daddiu a2, a2, 80
if (bc) {goto block_8;} // branch non-likely
c->sd(t6, 0, a2); // sd t6, 0(a2)
c->addiu(s2, r0, 8); // addiu s2, r0, 8
c->sd(t6, 8, a2); // sd t6, 8(a2)
c->lui(a3, 27656); // lui a3, 27656
c->sb(s2, 0, a2); // sb s2, 0(a2)
c->daddiu(a3, a3, 132); // daddiu a3, a3, 132
c->load_symbol2(s2, cache.foreground); // lw s2, *foreground*(s7)
c->daddiu(s1, s2, 2384); // daddiu s1, s2, 2384
c->sw(a3, 12, a2); // sw a3, 12(a2)
c->lq(a3, 0, s1); // lq a3, 0(s1)
c->lq(s2, 16, s1); // lq s2, 16(s1)
c->lq(s0, 32, s1); // lq s0, 32(s1)
c->lq(v0, 48, s1); // lq v0, 48(s1)
c->sq(a3, 16, a2); // sq a3, 16(a2)
c->sq(s2, 32, a2); // sq s2, 32(a2)
c->sq(s0, 48, a2); // sq s0, 48(a2)
c->sq(v0, 64, a2); // sq v0, 64(a2)
c->lq(a3, 64, s1); // lq a3, 64(s1)
c->lq(s2, 80, s1); // lq s2, 80(s1)
c->lq(s1, 96, s1); // lq s1, 96(s1)
c->lui(s0, 16261); // lui s0, 16261
c->daddiu(v0, s0, 4715); // daddiu v0, s0, 4715
c->daddiu(v0, s0, 619); // daddiu v0, s0, 619
c->lq(s0, 28, a0); // lq s0, 28(a0)
c->sq(a3, 80, a2); // sq a3, 80(a2)
c->lbu(a3, 5, t9); // lbu a3, 5(t9)
c->sq(s2, 96, a2); // sq s2, 96(a2)
c->sq(s1, 112, a2); // sq s1, 112(a2)
c->dsubu(a3, v0, a3); // dsubu a3, v0, a3
c->sq(s0, 128, a2); // sq s0, 128(a2)
c->sw(a3, 28, a2); // sw a3, 28(a2)
c->daddiu(a2, a2, 144); // daddiu a2, a2, 144
block_8:
bc = c->sgpr64(s3) == 0; // beq s3, r0, L115
c->addiu(s2, r0, 128); // addiu s2, r0, 128
if (bc) {goto block_11;} // branch non-likely
c->lbu(a3, 0, gp); // lbu a3, 0(gp)
// nop // sll r0, r0, 0
block_10:
c->multu3(s1, a3, s2); // multu3 s1, a3, s2
c->sq(t5, 0, a2); // sq t5, 0(a2)
c->lbu(s0, 1, gp); // lbu s0, 1(gp)
c->daddiu(gp, gp, 2); // daddiu gp, gp, 2
// HACK for PC PORT: stash the source matrix number in the unused bits of nop viftag.
c->sb(a3, 8, a2);
c->lbu(a3, 0, gp); // lbu a3, 0(gp)
c->daddiu(s3, s3, -1); // daddiu s3, s3, -1
c->sb(s0, 12, a2); // sb s0, 12(a2)
c->daddiu(a2, a2, 16); // daddiu a2, a2, 16
c->daddu(s1, s1, a1); // daddu s1, s1, a1
// nop // sll r0, r0, 0
bc = c->sgpr64(s3) != 0; // bne s3, r0, L114
c->sw(s1, -12, a2); // sw s1, -12(a2)
if (bc) {goto block_10;} // branch non-likely
block_11:
c->sq(t6, 0, a2); // sq t6, 0(a2)
c->daddiu(a2, a2, 16); // daddiu a2, a2, 16
bc = c->sgpr64(s4) != 0; // bne s4, r0, L116
c->daddiu(s4, s4, 1); // daddiu s4, s4, 1
if (bc) {goto block_13;} // branch non-likely
c->mov64(a3, v1); // or a3, v1, r0
c->sb(a3, -4, a2); // sb a3, -4(a2)
block_13:
bc = c->sgpr64(s4) != c->sgpr64(s5); // bne s4, s5, L112
// nop // sll r0, r0, 0
if (bc) {goto block_6;} // branch non-likely
get_fake_spad_addr2(s5, cache.fake_scratchpad_data, 0, c);// lui s5, 28672
c->lbu(a3, 26, t8); // lbu a3, 26(t8)
c->addiu(gp, r0, 48); // addiu gp, r0, 48
c->lw(s5, 52, s5); // lw s5, 52(s5)
c->mult3(a3, a3, gp); // mult3 a3, a3, gp
// nop // sll r0, r0, 0
c->daddu(a3, s5, a3); // daddu a3, s5, a3
// nop // sll r0, r0, 0
c->lw(s4, 0, a3); // lw s4, 0(a3)
// nop // sll r0, r0, 0
c->lw(gp, 4, a3); // lw gp, 4(a3)
c->movz(s4, ra, s4); // movz s4, ra, s4
c->sq(r0, 0, a2); // sq r0, 0(a2)
c->lui(s5, 8192); // lui s5, 8192
c->sw(s4, 0, a3); // sw s4, 0(a3)
c->mov64(s4, a2); // or s4, a2, r0
c->sw(s5, 0, a2); // sw s5, 0(a2)
c->daddiu(a2, a2, 16); // daddiu a2, a2, 16
bc = c->sgpr64(gp) == 0; // beq gp, r0, L117
c->sw(s4, 4, a3); // sw s4, 4(a3)
if (bc) {goto block_16;} // branch non-likely
// nop // sll r0, r0, 0
c->sw(ra, 4, gp); // sw ra, 4(gp)
block_16:
c->daddiu(t8, t8, 32); // daddiu t8, t8, 32
c->daddiu(t9, t9, 8); // daddiu t9, t9, 8
c->daddiu(t7, t7, -1); // daddiu t7, t7, -1
bc = c->sgpr64(t7) != 0; // bne t7, r0, L111
// nop // sll r0, r0, 0
if (bc) {goto block_2;} // branch non-likely
c->mov64(v0, a2); // or v0, a2, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lq(gp, 112, sp); // lq gp, 112(sp)
c->lq(s5, 96, sp); // lq s5, 96(sp)
c->lq(s4, 80, sp); // lq s4, 80(sp)
c->lq(s3, 64, sp); // lq s3, 64(sp)
c->lq(s2, 48, sp); // lq s2, 48(sp)
c->lq(s1, 32, sp); // lq s1, 32(sp)
c->lq(s0, 16, sp); // lq s0, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 128); // daddiu sp, sp, 128
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c("*fake-scratchpad-data*").c();
cache.foreground = intern_from_c("*foreground*").c();
cache.merc_global_stats = intern_from_c("*merc-global-stats*").c();
gLinkedFunctionTable.reg("foreground-merc", execute, 256);
}
} // namespace foreground_merc
} // namespace Mips2C
+2 -2
View File
@@ -1573,7 +1573,7 @@ inline void spad_to_dma_no_sadr_off_bones_interleave(void* spad_sym_addr,
u32 sadr,
u32 qwc) {
u32 spad_addr_goal;
memcpy(&spad_addr_goal, spad_sym_addr, 4);
memcpy(&spad_addr_goal, align4_ptr(spad_sym_addr), 4);
ASSERT((madr & 0xf) == 0);
ASSERT((sadr & 0xf) == 0);
@@ -1612,7 +1612,7 @@ inline void spad_from_dma(void* spad_sym_addr, u32 madr, u32 sadr, u32 qwc) {
inline void spad_from_dma_no_sadr_off(void* spad_sym_addr, u32 madr, u32 sadr, u32 qwc) {
u32 spad_addr_goal;
memcpy(&spad_addr_goal, spad_sym_addr, 4);
memcpy(&spad_addr_goal, align4_ptr(spad_sym_addr), 4);
ASSERT((madr & 0xf) == 0);
ASSERT((sadr & 0xf) == 0);
ASSERT(sadr < 0x4000);
+6 -1
View File
@@ -192,6 +192,9 @@ namespace method_10_collide_cache_prim { extern void link(); }
namespace method_17_collide_cache { extern void link(); }
namespace method_9_collide_puss_work { extern void link(); }
namespace method_10_collide_puss_work { extern void link(); }
namespace bones_mtx_calc { extern void link(); }
namespace foreground_check_longest_edge_asm { extern void link(); }
namespace foreground_merc { extern void link(); }
}
// clang-format on
@@ -319,7 +322,9 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
jak2::method_11_collide_shape_prim_sphere::link,
jak2::method_11_collide_shape_prim_group::link, jak2::method_9_collide_cache_prim::link,
jak2::method_10_collide_cache_prim::link, jak2::method_17_collide_cache::link,
jak2::method_9_collide_puss_work::link, jak2::method_10_collide_puss_work::link}}},
jak2::method_9_collide_puss_work::link, jak2::method_10_collide_puss_work::link}},
{"bones", {jak2::bones_mtx_calc::link}},
{"foreground", {jak2::foreground_check_longest_edge_asm::link, jak2::foreground_merc::link}}},
};
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {
+3
View File
@@ -498,6 +498,9 @@
(.xor.vf vf18 vf18 vf18)
(.xor.vf vf23 vf23 vf23)
(.xor.vf vf19 vf19 vf19)
(.xor.vf vf3 vf3 vf3)
(.xor.vf vf4 vf4 vf4)
(.xor.vf vf5 vf5 vf5)
(init-vf0-vector)
(.lvf vf23 (&-> src vector 0 quad))
+755 -7
View File
@@ -5,11 +5,39 @@
;; name in dgo: joint-exploder
;; dgos: GAME, COMMON
;; TODO - for vehicle-h
;; DECOMP BEGINS
(deftype joint-exploder-tuning (structure)
((explosion uint64 :offset-assert 0)
(duration time-frame :offset-assert 8)
(gravity float :offset-assert 16)
(rot-speed float :offset-assert 20)
(bounds-inflate float :offset-assert 24)
(max-probe-width float :offset-assert 28)
(max-probe-height float :offset-assert 32)
(max-probe-depth float :offset-assert 36)
(fountain-rand-transv-lo vector :inline :offset-assert 48)
(fountain-rand-transv-hi vector :inline :offset-assert 64)
(away-from-focal-pt vector :inline :offset 48)
(away-from-rand-transv-xz-lo float :offset 64)
(away-from-rand-transv-xz-hi float :offset 68)
(away-from-rand-transv-y-lo float :offset 72)
(away-from-rand-transv-y-hi float :offset 76)
(hit-xz-reaction float :offset 80)
(hit-y-reaction float :offset 84)
)
:method-count-assert 9
:size-assert #x58
:flag-assert #x900000058
(:methods
(new (symbol type uint) _type_ 0)
)
)
(deftype joint-exploder-static-joint-params (structure)
((joint-index int16 :offset-assert 0)
(parent-joint-index int16 :offset-assert 2)
((joint-index int16 :offset-assert 0)
(parent-joint-index int16 :offset-assert 2)
)
:method-count-assert 9
:size-assert #x4
@@ -17,14 +45,734 @@
)
(deftype joint-exploder-static-params (basic)
((joints (array joint-exploder-static-joint-params) :offset-assert 4) ;; guessed by decompiler
(collide-spec uint32 :offset-assert 8)
(art-level basic :offset-assert 12)
((joints (array joint-exploder-static-joint-params) :offset-assert 4)
(collide-spec uint32 :offset-assert 8)
(art-level basic :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; DECOMP BEGINS
(deftype joint-exploder-joint (structure)
((next int16 :offset-assert 0)
(prev int16 :offset-assert 2)
(joint-index int16 :offset-assert 4)
(mat matrix :inline :offset-assert 16)
(rmat matrix :inline :offset-assert 80)
(update-rmat matrix :inline :offset-assert 144)
(transv vector :inline :offset-assert 208)
(prev-pos vector :inline :offset-assert 224)
)
:method-count-assert 9
:size-assert #xf0
:flag-assert #x9000000f0
)
(deftype joint-exploder-joints (basic)
((num-joints int32 :offset-assert 4)
(joint joint-exploder-joint :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
(:methods
(new (symbol type joint-exploder-static-params) _type_ 0)
)
)
(deftype joint-exploder-list (structure)
((head int32 :offset-assert 0)
(pre-moved? symbol :offset-assert 4)
(bbox-valid? symbol :offset-assert 8)
(probeless? basic :offset-assert 12)
(bbox bounding-box :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
(deftype joint-exploder (process-drawable)
((die-if-below-y float :offset-assert 200)
(die-if-beyond-xz-dist-sqrd float :offset-assert 204)
(joints joint-exploder-joints :offset-assert 208)
(static-params joint-exploder-static-params :offset-assert 212)
(anim art-joint-anim :offset-assert 216)
(scale-vector vector :inline :offset-assert 224)
(tuning joint-exploder-tuning :inline :offset-assert 240)
(lists joint-exploder-list 5 :inline :offset-assert 336)
)
:heap-base #x1c0
:method-count-assert 30
:size-assert #x240
:flag-assert #x1e01c00240
(:methods
(add-joint-to-list (_type_ joint-exploder-list int) int 20)
(update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none 21)
(do-collision-response (_type_ joint-exploder-list) none 22)
(init-joint-list (_type_) none 23)
(remove-from-list-and-reset (_type_ joint-exploder-list int) int 24)
(final-adjust (_type_ joint-exploder-list int) int 25)
(integrate-and-kill (_type_ joint-exploder-list) none 26)
(remove-joint-from-list (_type_ joint-exploder-list int) int 27)
(adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28)
(adjust-bbox-for-limits (_type_ joint-exploder-list) none 29)
)
)
(defmethod asize-of joint-exploder-joints ((obj joint-exploder-joints))
(the-as int (+ (-> obj type size) (* 240 (-> obj num-joints))))
)
(defmethod new joint-exploder-joints ((allocation symbol) (type-to-make type) (arg0 joint-exploder-static-params))
(let* ((gp-0 (-> arg0 joints length))
(v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* 240 gp-0)))))
)
(set! (-> v0-0 num-joints) gp-0)
v0-0
)
)
(defun joint-exploder-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control))
(let ((s4-0 (-> arg0 process)))
(let ((s3-0 (-> (the-as joint-exploder s4-0) joints)))
(countdown (s2-0 (-> s3-0 num-joints))
(let* ((v1-3 (-> s3-0 joint s2-0))
(a0-5 (-> arg1 data (-> v1-3 joint-index) bone transform))
)
(matrix*! a0-5 (-> v1-3 rmat) (-> v1-3 mat))
)
)
)
(let ((s4-1 (&-> s4-0 stack 96)))
(countdown (s3-1 (-> arg1 length))
(let ((a2-2 (-> arg1 data s3-1 bone transform)))
(scale-matrix! a2-2 (the-as vector s4-1) a2-2)
)
)
)
)
(let ((s4-2 (new-stack-matrix0))
(f30-0 (-> arg0 bounds w))
)
(matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform))
(set! (-> arg0 bounds w) 1.0)
(vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2)
(set! (-> arg0 bounds w) f30-0)
)
0
(none)
)
(defmethod remove-from-list-and-reset joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(let ((v0-0 (remove-joint-from-list obj arg0 arg1)))
(let* ((v1-1 (-> obj joints))
(v1-2 (-> v1-1 joint arg1))
)
(set! (-> v1-2 mat quad 0) (the-as uint128 0))
(set! (-> v1-2 mat vector 1 quad) (the-as uint128 0))
(set! (-> v1-2 mat vector 2 quad) (the-as uint128 0))
(set! (-> v1-2 mat trans quad) (-> obj root trans quad))
)
v0-0
)
)
(defmethod remove-joint-from-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(let* ((v1-0 (-> obj joints))
(a2-1 (-> v1-0 joint arg1))
(a0-4 (-> a2-1 prev))
(v0-0 (-> a2-1 next))
)
(cond
((>= a0-4 0)
(set! (-> v1-0 joint a0-4 next) v0-0)
(if (>= v0-0 0)
(set! (-> v1-0 joint v0-0 prev) a0-4)
)
)
(else
(set! (-> arg0 head) v0-0)
(cond
((>= v0-0 0)
(let ((v1-2 (-> v1-0 joint v0-0)))
(set! (-> v1-2 prev) -1)
)
)
(else
(set! (-> arg0 bbox-valid?) #f)
)
)
)
)
v0-0
)
)
(defmethod add-joint-to-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(let* ((v1-0 (-> obj joints))
(a3-0 (-> v1-0 joint arg1))
(a0-4 (-> arg0 head))
)
(set! (-> arg0 head) arg1)
(set! (-> a3-0 prev) -1)
(set! (-> a3-0 next) a0-4)
(when (>= a0-4 0)
(set! (-> v1-0 joint a0-4 prev) arg1)
arg1
)
)
)
(defmethod update-bbox-for-joint joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint))
(let ((a1-1 (-> arg1 mat trans)))
(cond
((-> arg0 bbox-valid?)
(add-point! (-> arg0 bbox) a1-1)
)
(else
(set! (-> arg0 bbox-valid?) #t)
(set! (-> arg0 bbox min quad) (-> a1-1 quad))
(set! (-> arg0 bbox max quad) (-> a1-1 quad))
)
)
)
(add-point! (-> arg0 bbox) (-> arg1 prev-pos))
(none)
)
(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(local-vars
(sv-16 int)
(sv-32 int)
(sv-48 joint-exploder-joint)
(sv-64 int)
(sv-80 joint-exploder-joint)
(sv-96 int)
(sv-112 joint-exploder-joint)
)
(let ((s5-0 (the-as joint-exploder-list #f)))
(let ((v1-0 1))
(until (= v1-0 5)
(let ((a0-4 (-> obj lists v1-0)))
(when (< (-> a0-4 head) 0)
(set! s5-0 a0-4)
(goto cfg-6)
)
)
(+! v1-0 1)
)
)
(label cfg-6)
(cond
(s5-0
(set! (-> s5-0 pre-moved?) #t)
(set! (-> s5-0 bbox-valid?) #f)
)
(else
(set! s5-0 (the-as joint-exploder-list (-> obj lists)))
)
)
(set! (-> arg0 bbox-valid?) #f)
(let ((s2-0 (-> obj joints)))
(set! sv-32 (-> arg0 head))
(let ((s1-0 0)
(s0-0 0)
)
(let ((v1-7 arg1))
(cond
((zero? v1-7)
(let ((f30-0 (* 0.5 (+ (-> arg0 bbox min x) (-> arg0 bbox max x)))))
(while (>= sv-32 0)
(set! sv-48 (-> s2-0 joint sv-32))
(cond
((>= (-> sv-48 mat trans x) f30-0)
(set! sv-16 (remove-joint-from-list obj arg0 sv-32))
(add-joint-to-list obj s5-0 sv-32)
(set! sv-32 sv-16)
(update-bbox-for-joint obj s5-0 sv-48)
(+! s0-0 1)
)
(else
(update-bbox-for-joint obj arg0 sv-48)
(set! sv-32 (-> sv-48 next))
(+! s1-0 1)
)
)
)
)
)
((= v1-7 1)
(let ((f30-1 (* 0.5 (+ (-> arg0 bbox min y) (-> arg0 bbox max y)))))
(while (>= sv-32 0)
(set! sv-80 (-> s2-0 joint sv-32))
(cond
((>= (-> sv-80 mat trans y) f30-1)
(set! sv-64 (remove-joint-from-list obj arg0 sv-32))
(add-joint-to-list obj s5-0 sv-32)
(set! sv-32 sv-64)
(update-bbox-for-joint obj s5-0 sv-80)
(+! s0-0 1)
)
(else
(update-bbox-for-joint obj arg0 sv-80)
(set! sv-32 (-> sv-80 next))
(+! s1-0 1)
)
)
)
)
)
((= v1-7 2)
(let ((f30-2 (* 0.5 (+ (-> arg0 bbox min z) (-> arg0 bbox max z)))))
(while (>= sv-32 0)
(set! sv-112 (-> s2-0 joint sv-32))
(cond
((>= (-> sv-112 mat trans z) f30-2)
(set! sv-96 (remove-joint-from-list obj arg0 sv-32))
(add-joint-to-list obj s5-0 sv-32)
(set! sv-32 sv-96)
(update-bbox-for-joint obj s5-0 sv-112)
(+! s0-0 1)
)
(else
(update-bbox-for-joint obj arg0 sv-112)
(set! sv-32 (-> sv-112 next))
(+! s1-0 1)
)
)
)
)
)
)
)
(cond
((zero? s0-0)
(final-adjust obj arg0 arg1)
)
((zero? s1-0)
(if (not (-> s5-0 probeless?))
(final-adjust obj s5-0 arg1)
)
)
)
)
)
s5-0
)
)
(defmethod final-adjust joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint))
(set! (-> arg0 bbox-valid?) #f)
(let ((s3-0 (-> obj joints))
(s2-0 (-> arg0 head))
)
(while (>= s2-0 0)
(set! sv-80 (-> s3-0 joint s2-0))
(let ((s1-0 (new 'stack-no-clear 'matrix))
(s0-0 (-> arg0 bbox-valid?))
)
(set! (-> s1-0 vector 0 quad) (-> arg0 bbox min quad))
(set! (-> s1-0 vector 1 quad) (-> arg0 bbox max quad))
(update-bbox-for-joint obj arg0 sv-80)
(let* ((v1-7 arg1)
(v1-8 (cond
((zero? v1-7)
(< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x)))
)
((= v1-7 1)
(< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y)))
)
((= v1-7 2)
(< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z)))
)
)
)
)
(when v1-8
(set! sv-48 (remove-joint-from-list obj arg0 s2-0))
(set! sv-64 (-> obj lists))
(add-joint-to-list obj (the-as joint-exploder-list sv-64) s2-0)
(set! s2-0 sv-48)
(update-bbox-for-joint obj (the-as joint-exploder-list sv-64) sv-80)
(set! (-> arg0 bbox-valid?) s0-0)
(set! (-> arg0 bbox min quad) (-> s1-0 vector 0 quad))
(set! (-> arg0 bbox max quad) (-> s1-0 vector 1 quad))
)
)
)
)
)
(the-as int #f)
)
(defmethod adjust-bbox-for-limits joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?)))
(let ((a2-0 -1))
(cond
((< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x)))
(set! a2-0 0)
)
((< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y)))
(set! a2-0 1)
)
((< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z)))
(set! a2-0 2)
)
)
(when (>= a2-0 0)
(let ((a1-2 (adjust-bbox-for-limits-along-axis obj arg0 a2-0)))
(if (not (-> a1-2 probeless?))
(adjust-bbox-for-limits obj a1-2)
)
)
(adjust-bbox-for-limits obj arg0)
)
)
)
0
(none)
)
(defmethod integrate-and-kill joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(with-pp
(set! (-> arg0 bbox-valid?) #f)
(set! (-> arg0 pre-moved?) #t)
(let ((s4-0 (-> obj joints))
(f30-0 (* (-> obj tuning gravity) (-> pp clock seconds-per-frame)))
(s3-0 (-> arg0 head))
)
(while (>= s3-0 0)
(let* ((s2-0 (-> s4-0 joint s3-0))
(s1-0 (-> s2-0 mat trans))
)
(set! (-> s2-0 prev-pos quad) (-> s1-0 quad))
(+! (-> s2-0 transv y) f30-0)
(vector-v+! s1-0 s1-0 (-> s2-0 transv))
(matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat))
(cond
((or (< (-> s1-0 y) (-> obj die-if-below-y))
(< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans)))
)
(set! s3-0 (remove-from-list-and-reset obj arg0 s3-0))
)
(else
(update-bbox-for-joint obj arg0 s2-0)
(set! s3-0 (-> s2-0 next))
)
)
)
)
)
0
(none)
)
)
(defmethod do-collision-response joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
(set! (-> s5-0 collide-with) (the-as collide-spec (-> obj static-params collide-spec)))
(set! (-> s5-0 ignore-process0) obj)
(set! (-> s5-0 ignore-process1) #f)
(set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> s5-0 action-mask) (collide-action solid))
(mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32)
(fill-using-bounding-box *collide-cache* s5-0)
)
(let ((s5-1 (-> obj joints))
(v1-6 (-> arg0 head))
)
(while (>= v1-6 0)
(let ((s4-1 (-> s5-1 joint v1-6)))
(let ((s3-0 (-> s4-1 mat trans))
(s2-0 (new 'stack-no-clear 'collide-query))
)
(vector-! (-> s2-0 move-dist) s3-0 (-> s4-1 prev-pos))
(set! (-> s2-0 start-pos quad) (-> s4-1 prev-pos quad))
(let ((v1-11 s2-0))
(set! (-> v1-11 radius) 40.96)
(set! (-> v1-11 collide-with) (the-as collide-spec (-> obj static-params collide-spec)))
(set! (-> v1-11 ignore-process0) #f)
(set! (-> v1-11 ignore-process1) #f)
(set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-11 action-mask) (collide-action solid))
)
(when (>= (probe-using-line-sphere *collide-cache* s2-0) 0.0)
(set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad))
(let* ((v1-16 (-> s4-1 transv))
(f28-0 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z)))))
)
(vector-reflect! (-> s4-1 transv) (-> s4-1 transv) (-> s2-0 best-other-tri normal))
(let ((f30-0 (-> s4-1 transv y)))
(set! (-> s4-1 transv y) 0.0)
(vector-normalize! (-> s4-1 transv) (* f28-0 (-> obj tuning hit-xz-reaction)))
(set! (-> s4-1 transv y) (* f30-0 (-> obj tuning hit-y-reaction)))
)
)
(+! (-> s3-0 y) (* 40.96 (-> s2-0 best-other-tri normal y)))
(set! (-> s3-0 w) 1.0)
(matrix-lerp! (-> s4-1 update-rmat) (-> s4-1 update-rmat) *identity-matrix* 0.5)
)
)
(set! v1-6 (-> s4-1 next))
)
)
)
0
(none)
)
(defstate joint-exploder-shatter (joint-exploder)
:enter (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(none)
)
:trans (behavior ()
(let* ((f0-1 (the float (- (-> self clock frame-counter) (-> self state-time))))
(f1-1 (- 1.0 (/ f0-1 (the float (-> self tuning duration)))))
(f0-3 (- 1.0 (/ f0-1 (* 0.75 (the float (-> self tuning duration))))))
)
(if (< f0-3 0.0)
(set! f0-3 0.0)
)
(set-vector! (-> self scale-vector) f1-1 f0-3 f1-1 1.0)
)
(dotimes (v1-11 5)
(set! (-> self lists v1-11 pre-moved?) #f)
)
(dotimes (gp-0 5)
(let ((s5-0 (-> self lists gp-0)))
(when (>= (-> s5-0 head) 0)
(when (not (-> s5-0 pre-moved?))
(integrate-and-kill self s5-0)
(if (nonzero? gp-0)
(adjust-bbox-for-limits self s5-0)
)
)
)
)
)
(let ((gp-1 (new 'stack-no-clear 'bounding-box)))
(let ((v1-29 (-> self root trans)))
(set! (-> gp-1 min quad) (-> v1-29 quad))
(set! (-> gp-1 max quad) (-> v1-29 quad))
)
(dotimes (s5-1 5)
(let ((s4-0 (-> self lists s5-1)))
(if (-> s4-0 bbox-valid?)
(add-box! gp-1 (-> s4-0 bbox))
)
(if (nonzero? s5-1)
(do-collision-response self s4-0)
)
)
)
(let ((s5-2 (-> self draw bounds)))
(vector-average! s5-2 (-> gp-1 min) (-> gp-1 max))
(set! (-> s5-2 w) (+ (vector-vector-distance s5-2 (-> gp-1 max)) (-> self tuning bounds-inflate)))
)
)
0
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(until (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self tuning duration))
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior joint-exploder) ja-post)
)
(defmethod init-joint-list joint-exploder ((obj joint-exploder))
(let ((gp-0 (-> obj joints)))
(dotimes (s4-0 (-> gp-0 num-joints))
(let ((v1-2 (-> obj static-params joints s4-0))
(s3-0 (-> gp-0 joint s4-0))
)
(let ((a0-6 (-> v1-2 parent-joint-index)))
(set! (-> s3-0 prev) (+ s4-0 -1))
(set! (-> s3-0 next) (+ s4-0 1))
(set! (-> s3-0 joint-index) (-> v1-2 joint-index))
(cond
((>= a0-6 0)
(if (zero? a0-6)
(set! a0-6 (-> v1-2 joint-index))
)
(let* ((a3-0 (-> (the-as process-drawable (-> obj parent 0)) node-list data a0-6 bone transform))
(a2-0 (-> s3-0 mat))
(v1-9 (-> a3-0 quad 0))
(a0-8 (-> a3-0 quad 1))
(a1-4 (-> a3-0 quad 2))
(a3-1 (-> a3-0 trans quad))
)
(set! (-> a2-0 quad 0) v1-9)
(set! (-> a2-0 quad 1) a0-8)
(set! (-> a2-0 quad 2) a1-4)
(set! (-> a2-0 trans quad) a3-1)
)
(matrix-identity! (-> s3-0 rmat))
)
(else
(let* ((a3-2 (-> obj node-list data (-> v1-2 joint-index) bone transform))
(a2-1 (-> s3-0 mat))
(v1-15 (-> a3-2 quad 0))
(a0-11 (-> a3-2 quad 1))
(a1-5 (-> a3-2 quad 2))
(a3-3 (-> a3-2 trans quad))
)
(set! (-> a2-1 quad 0) v1-15)
(set! (-> a2-1 quad 1) a0-11)
(set! (-> a2-1 quad 2) a1-5)
(set! (-> a2-1 trans quad) a3-3)
)
(matrix-identity! (-> s3-0 rmat))
)
)
)
(case (-> obj tuning explosion)
((1)
(vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> obj tuning fountain-rand-transv-lo))
(vector-normalize!
(-> s3-0 transv)
(rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y))
)
(+! (-> s3-0 transv y)
(rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w))
)
(set! (-> s3-0 transv w) 1.0)
)
(else
(let ((s0-0 (-> obj tuning fountain-rand-transv-lo))
(s1-1 (-> obj tuning fountain-rand-transv-hi))
)
(set-vector!
(-> s3-0 transv)
(rand-vu-float-range (-> s0-0 x) (-> s1-1 x))
(rand-vu-float-range (-> s0-0 y) (-> s1-1 y))
(rand-vu-float-range (-> s0-0 z) (-> s1-1 z))
1.0
)
)
)
)
(let* ((v1-21 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 transv) 1.0))
(s2-4 (vector-cross! (new 'stack-no-clear 'vector) v1-21 *up-vector*))
(s1-2 (new 'stack-no-clear 'quaternion))
)
(vector-normalize! s2-4 1.0)
(quaternion-vector-angle! s1-2 s2-4 (* 182.04445 (-> obj tuning rot-speed)))
(quaternion->matrix (-> s3-0 update-rmat) s1-2)
)
)
)
(when (nonzero? (-> gp-0 num-joints))
(let ((v1-32 (-> gp-0 joint (+ (-> gp-0 num-joints) -1))))
(set! (-> v1-32 next) -1)
)
(let ((v1-33 (-> obj lists 1)))
(set! (-> v1-33 head) 0)
(let ((s5-1 (-> v1-33 bbox)))
(let ((v1-34 (-> gp-0 joint 0 mat trans)))
(set! (-> s5-1 min quad) (-> v1-34 quad))
(set! (-> s5-1 max quad) (-> v1-34 quad))
)
(dotimes (s4-1 (-> gp-0 num-joints))
(add-point! s5-1 (the-as vector (+ (the-as uint (-> gp-0 joint 0 mat trans)) (* 240 s4-1))))
)
)
)
)
)
0
(none)
)
(defmethod relocate joint-exploder ((obj joint-exploder) (arg0 int))
(if (nonzero? (-> obj joints))
(&+! (-> obj joints) arg0)
)
(the-as joint-exploder ((method-of-type process-drawable relocate) obj arg0))
)
(defbehavior joint-exploder-init-by-other joint-exploder ((arg0 skeleton-group) (arg1 int) (arg2 joint-exploder-tuning) (arg3 joint-exploder-static-params))
(set! (-> self static-params) arg3)
(set! (-> self die-if-beyond-xz-dist-sqrd) 10485760000.0)
(mem-copy! (the-as pointer (-> self tuning)) (the-as pointer arg2) 88)
(set! (-> self joints) (new 'process 'joint-exploder-joints arg3))
(dotimes (v1-2 5)
(let ((a0-6 (-> self lists v1-2)))
(set! (-> a0-6 head) -1)
(set! (-> a0-6 bbox-valid?) #f)
(set! (-> a0-6 pre-moved?) #f)
(set! (-> a0-6 probeless?) #f)
)
)
(let ((v1-5 (-> self lists)))
(set! (-> v1-5 0 probeless?) (the-as basic #t))
)
(set! (-> self root) (new 'process 'trsqv))
(set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad))
(quaternion-copy! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat))
(set! (-> self root scale quad) (-> (the-as process-drawable (-> self parent 0)) root scale quad))
(when (-> arg3 art-level)
(let ((a1-6 (entity-actor-from-level-name (the-as level (-> arg3 art-level)))))
(if a1-6
(process-entity-set! self a1-6)
)
)
)
(initialize-skeleton self arg0 (the-as pair 0))
(logior! (-> self skel status) (joint-control-status sync-math))
(set! (-> self anim) (the-as art-joint-anim (-> self draw art-group data arg1)))
(ja-channel-set! 1)
(ja :group! (-> self anim) :num! min)
(ja-post)
(init-joint-list self)
(set! (-> self die-if-below-y) (+ -102400.0 (-> self root trans y)))
(set! (-> self skel postbind-function) joint-exploder-joint-callback)
(go joint-exploder-shatter)
(none)
)
(defmethod new joint-exploder-tuning ((allocation symbol) (type-to-make type) (arg0 uint))
(let ((t9-0 (method-of-type structure new))
(v1-1 type-to-make)
)
(-> type-to-make size)
(let ((v0-0 (the-as joint-exploder-tuning (t9-0 allocation v1-1))))
(set! (-> v0-0 explosion) (the-as uint arg0))
(set! (-> v0-0 duration) (seconds 2))
(set! (-> v0-0 gravity) -286720.0)
(set! (-> v0-0 rot-speed) 8.4)
(set! (-> v0-0 bounds-inflate) 16384.0)
(set! (-> v0-0 max-probe-width) 20480.0)
(set! (-> v0-0 max-probe-height) 24576.0)
(set! (-> v0-0 max-probe-depth) 20480.0)
(set! (-> v0-0 hit-xz-reaction) 0.75)
(set! (-> v0-0 hit-y-reaction) 0.7)
(cond
((zero? arg0)
(set-vector! (-> v0-0 fountain-rand-transv-lo) -81920.0 20480.0 -81920.0 1.0)
(set-vector! (-> v0-0 fountain-rand-transv-hi) 81920.0 61440.0 81920.0 1.0)
)
((= arg0 1)
(vector-reset! (-> v0-0 fountain-rand-transv-lo))
(set! (-> v0-0 fountain-rand-transv-hi x) 49152.0)
(set! (-> v0-0 fountain-rand-transv-hi y) 163840.0)
(set! (-> v0-0 fountain-rand-transv-hi z) 20480.0)
(set! (-> v0-0 fountain-rand-transv-hi w) 61440.0)
)
)
(the-as joint-exploder-tuning v0-0)
)
)
)
@@ -707,7 +707,7 @@
(when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as))
(let ((a0-37 (-> v1-58 process)))
(if (not (or (= a0-37 (-> obj ignore-processes 0)) (= a0-37 (-> obj ignore-processes 1))))
((method-of-object (-> v1-58 root-prim) add-fg-prim-using-line-sphere))
(add-fg-prim-using-line-sphere (-> v1-58 root-prim) obj arg0)
)
)
)
@@ -721,7 +721,7 @@
;; definition for method 11 of type collide-shape-prim
;; WARN: Return type mismatch object vs none.
(defmethod add-fg-prim-using-line-sphere collide-shape-prim ()
(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache) (arg1 object))
(format
0
"ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%"
@@ -264,6 +264,7 @@
)
)
;; these two are unknown.
(defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh)
(defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh)
@@ -407,7 +407,7 @@
(new (symbol type collide-shape uint int) _type_ 0)
(debug-draw (_type_) none 9)
(add-fg-prim-using-box (_type_ collide-cache) none 10)
(add-fg-prim-using-line-sphere () none 11)
(add-fg-prim-using-line-sphere (_type_ collide-cache object) none 11)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13)
(collide-shape-prim-method-14 () none 14)
@@ -7,3 +7,6 @@
;; DECOMP BEGINS
(defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int))
(the (pointer process) #f)
)
+2 -2
View File
@@ -1591,8 +1591,8 @@
(logtest? (-> s2-2 prim-core action) arg3)
(nonzero? (-> s2-2 prim-core collide-with))
)
(set! (-> (the-as region-prim-area #x70000000) pos quad) (-> s2-2 prim-core world-sphere quad))
(if (and (within-area? arg1 (the-as region-prim-area (+ #x70000000 0)))
(set! (-> (scratchpad-object region-prim-area) pos quad) (-> s2-2 prim-core world-sphere quad))
(if (and (within-area? arg1 (scratchpad-object region-prim-area))
(begin
(set! (-> arg0 flags) (logior (water-flags over-water) (-> arg0 flags)))
(>= (-> arg0 trans y) (- (-> s2-2 prim-core world-sphere y) (-> s2-2 prim-core world-sphere w)))
File diff suppressed because it is too large Load Diff
+11 -9
View File
@@ -349,7 +349,7 @@
(art-group art-group :offset-assert 12)
(jgeo art-joint-geo :offset-assert 16)
(mgeo merc-ctrl :offset-assert 20)
(dma-add-func function :offset-assert 24)
(dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24)
(skeleton skeleton :offset-assert 28)
(lod-set lod-set :inline :offset-assert 32)
(max-lod int8 :offset 80)
@@ -407,18 +407,19 @@
(if (number? elt-name)
elt-name
(let ((ag-info (hash-table-try-ref *art-info* (symbol->string ag-name))))
(if (not (car ag-info))
-1
(let ((elt-info (hash-table-try-ref (cdr ag-info) (symbol->string elt-name))))
(if (not (car elt-info))
-1
(cadr (cdr elt-info)))
)
(if (not (car ag-info))
(error (symbol->string ag-name))
(let ((elt-info (hash-table-try-ref (cdr ag-info) (symbol->string elt-name))))
(if (not (car elt-info))
(error (symbol->string ag-name))
(cadr (cdr elt-info)))
)
)
)
)
)
)
(defmacro defskelgroup (name ag-name joint-geom joint-anim lods
&key (shadow 0)
&key bounds
@@ -472,3 +473,4 @@
(import "goal_src/jak2/engine/data/art-elts.gc")
+491 -12
View File
@@ -270,11 +270,456 @@
(define *instance-mem-usage* (new 'debug 'memory-usage-block))
)
;;hack
;; todo find-instance-by-name-level
;; todo: hack
(defun find-instance-by-name ((a0-0 string))
(the prototype-bucket #f))
;; todo prototypes-game-visible-set!
;; todo find-instance-by-index
;; todo prototype-bucket-type
;; todo prototype-bucket-recalc-fields
;; todo print-prototype-list
;; todo draw-instance-info
;; todo set-shadow-by-name
;; todo get-shadow-by-name
;; todo teleport-camera-by-name
(defun dma-add-process-drawable ((pd process-drawable) (dc draw-control) (flag symbol) (dma-buf dma-buffer))
"Draw a normal process-drawable. Set up lighting/shadow settings, then pass on to foreground renderer."
(local-vars
(a0-82 int)
(a0-84 int)
(a3-11 uint128)
(sv-16 process-drawable)
(tod time-of-day-context)
(shadow-mask uint)
(lev-idx-for-mood uint)
(my-origin vector)
(lev-mood mood-context)
(light-result-bucket light-hash-bucket)
(index-ptr pointer)
(index-index int)
)
(with-pp
(rlet ((acc :class vf)
(Q :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf15 :class vf)
(vf16 :class vf)
(vf17 :class vf)
(vf18 :class vf)
(vf19 :class vf)
(vf2 :class vf)
(vf20 :class vf)
(vf21 :class vf)
(vf22 :class vf)
(vf23 :class vf)
(vf24 :class vf)
(vf25 :class vf)
(vf26 :class vf)
(vf27 :class vf)
(vf28 :class vf)
(vf29 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(set! sv-16 pd)
(reset! (-> *perf-stats* data (perf-stat-bucket foreground)))
;; skip drawing when in menu mode.
(when (-> *blit-displays-work* menu-mode)
(if (not (logtest? (-> dc status) (draw-control-status hud)))
(return #f)
)
)
;; clear previous on-screen flag, we don't know if we're on-screen yet.
(logclear! (-> dc status) (draw-control-status on-screen))
;; only if we should draw...
(when (not (logtest? (-> dc status) (draw-control-status no-draw no-draw-temp uninited)))
(let ((fg-bounds (-> (scratchpad-object foreground-work) bounds))
(fg-lights (-> (scratchpad-object foreground-work) lights))
)
(set! tod *time-of-day-context*)
(.lvf vf16 (&-> dc origin quad))
(.svf (&-> fg-bounds quad) vf16)
;; sphere cull.
(when (sphere-in-view-frustum? fg-bounds)
(cond
((logtest? (-> dc global-effect) (draw-control-global-effect title-light))
;; magic special case for title light.
(when (not (-> tod title-updated))
(set! (-> tod title-updated) #t)
(let ((s1-0 (-> *math-camera* inv-camera-rot))
(a1-3 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
)
(set-vector! a1-3 0.612 0.5 -0.612 0.0)
(set-vector! s2-0 -0.696 0.174 0.696 0.0)
(vector-matrix*! (the-as vector (-> tod title-light-group)) a1-3 s1-0)
(vector-matrix*! (the-as vector (-> tod title-light-group dir1)) s2-0 s1-0)
)
)
(vu-lights<-light-group! fg-lights (-> tod title-light-group))
)
(else
;; terrible lighting and shadow stuff
(set! shadow-mask (-> dc shadow-mask))
(let ((shadow-mask-not (lognot shadow-mask)))
(set! lev-idx-for-mood (-> dc level-index))
(let ((light-idx (-> dc light-index))
(lg (new 'stack-no-clear 'light-group))
)
(if (and (>= lev-idx-for-mood (the-as uint 6)) (< light-idx (the-as uint 20)))
(+! light-idx 20)
)
(let ((v1-40 (the-as
mood-context
(+ (the-as uint (-> *level* level0 mood-context)) (* (the-as uint 5232) lev-idx-for-mood))
)
)
)
(cond
((< light-idx (the-as uint 8))
(quad-copy! (the-as pointer lg) (the-as pointer (-> v1-40 light-group light-idx)) 12)
)
((< light-idx (the-as uint 18))
(quad-copy! (the-as pointer lg) (the-as pointer (-> v1-40 light-group (+ light-idx -10))) 12)
)
((< light-idx (the-as uint 28))
(quad-copy! (the-as pointer lg) (the-as pointer (-> tod light-group (+ light-idx -20))) 12)
)
((< light-idx (the-as uint 38))
(quad-copy! (the-as pointer lg) (the-as pointer (-> tod light-group (+ light-idx -30))) 12)
)
)
)
(when (not (or (>= lev-idx-for-mood (the-as uint 6)) (zero? shadow-mask)))
(let ((packed-shadow-vals (-> dc shadow-values)))
(set! light-idx (the uint 0))
(while (< light-idx 4)
(when (nonzero? (-> lg lights light-idx mask))
(when (not (logtest? (-> lg lights light-idx mask) shadow-mask-not))
(let ((light-pal-idx (-> lg lights light-idx palette-index)))
(set! (-> lg lights light-idx extra x)
(* 0.0625
(the float (logand (ash packed-shadow-vals (* -4 light-pal-idx)) 15))
(-> lg lights light-idx extra x)
)
)
)
)
)
(+! light-idx 1)
)
)
)
(when (or (and (>= light-idx (the-as uint 10)) (< light-idx (the-as uint 18)))
(and (>= light-idx (the-as uint 30)) (< light-idx (the-as uint 38)))
)
(dotimes (fg-light-lev-idx (-> *level* length))
(let ((lev (-> *level* level fg-light-lev-idx)))
(when (= (-> lev status) 'active)
(let ((light-hash (-> lev light-hash)))
(set! my-origin (-> dc origin))
(set! lev-mood (-> lev mood-context))
(when (nonzero? light-hash)
(let ((light-lookup-result (light-hash-get-bucket-index light-hash (-> dc origin))))
(when (!= light-lookup-result -1)
(set! light-result-bucket (-> light-hash bucket-array light-lookup-result))
(set! index-ptr (the pointer (+ (+ (-> light-result-bucket index) 0) (the-as uint (-> light-hash index-array)))))
(set! index-index 0)
(while (< index-index (the-as int (-> light-result-bucket count)))
(let* ((light-sphere (-> light-hash light-sphere-array (-> (the-as (pointer uint8) (&+ index-ptr index-index)))))
(palette-idx (-> light-sphere palette-index))
(interp (if (= palette-idx -1)
1.0
(-> lev-mood times palette-idx w)
)
)
)
(if (!= (* (-> light-sphere brightness) interp) 0.0)
(add-light-sphere-to-light-group lg light-sphere my-origin lev-mood)
)
)
(set! index-index (+ index-index 1))
)
)
)
)
)
)
)
)
)
;; convert to vu format
(vu-lights<-light-group! fg-lights lg)
;; adjust shadow angle
(when (and (nonzero? (-> dc shadow-ctrl))
(-> dc shadow-ctrl)
(not (logtest? (-> dc shadow-ctrl settings flags) (shadow-flags disable-draw)))
(zero? (logand (-> dc shadow-ctrl settings flags) (shadow-flags shdf07)))
)
(let ((target-shadow-dir (new 'stack-no-clear 'vector))
(current-shadow-dir (-> dc shadow-ctrl settings shadow-dir))
(shadow-dir-w (-> dc shadow-ctrl settings shadow-dir w))
)
(.lvf vf1 (&-> lg dir0 direction quad))
(.lvf vf2 (&-> lg dir1 direction quad))
(.lvf vf3 (&-> lg dir2 direction quad))
(.lvf vf4 (&-> lg dir0 extra quad))
(.lvf vf5 (&-> lg dir1 extra quad))
(.lvf vf6 (&-> lg dir2 extra quad))
(.mul.x.vf acc vf1 vf4)
(.add.mul.x.vf acc vf2 vf5 acc)
(.add.mul.x.vf vf1 vf3 vf6 acc)
(.svf (&-> target-shadow-dir quad) vf1)
(vector-normalize! target-shadow-dir -1.0)
(when (< (- (-> target-shadow-dir y)) 0.9063)
(let* ((f0-16 0.4226)
(f1-6 (-> target-shadow-dir x))
(f1-8 (* f1-6 f1-6))
(f2-0 (-> target-shadow-dir z))
(f0-17 (/ f0-16 (sqrtf (+ f1-8 (* f2-0 f2-0)))))
)
(set! (-> target-shadow-dir x) (* (-> target-shadow-dir x) f0-17))
(set! (-> target-shadow-dir y) -0.9063)
(set! (-> target-shadow-dir z) (* (-> target-shadow-dir z) f0-17))
)
)
(when (not (paused?))
(vector-seek! current-shadow-dir target-shadow-dir (* 0.2 (-> pp clock seconds-per-frame)))
(vector-normalize! current-shadow-dir 1.0)
)
(set! (-> dc shadow-ctrl settings shadow-dir w) shadow-dir-w)
)
)
)
)
)
)
;; apply mult and emissive lighting.
(.lvf vf28 (&-> dc color-mult quad))
(.lvf vf29 (&-> dc color-emissive quad))
(.lvf vf2 (&-> fg-lights color 0 quad))
(.lvf vf3 (&-> fg-lights color 1 quad))
(.lvf vf4 (&-> fg-lights color 2 quad))
(.lvf vf5 (&-> fg-lights ambient quad))
(.mul.vf vf5 vf5 vf28)
(.mul.vf vf2 vf2 vf28)
(.mul.vf vf3 vf3 vf28)
(.mul.vf vf4 vf4 vf28)
(.add.vf vf5 vf5 vf29)
(.svf (&-> fg-lights color 0 quad) vf2)
(.svf (&-> fg-lights color 1 quad) vf3)
(.svf (&-> fg-lights color 2 quad) vf4)
(.svf (&-> fg-lights ambient quad) vf5)
;; load math camera registers for distance calcs
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane 0 quad))
(.lvf vf17 (&-> at-0 plane 1 quad))
(.lvf vf18 (&-> at-0 plane 2 quad))
(.lvf vf19 (&-> at-0 plane 3 quad))
(.lvf vf20 (&-> at-0 guard-plane 0 quad))
(.lvf vf21 (&-> at-0 guard-plane 1 quad))
(.lvf vf22 (&-> at-0 guard-plane 2 quad))
(.lvf vf23 (&-> at-0 guard-plane 3 quad))
(.lvf vf24 (&-> at-0 camera-rot quad 0))
(.lvf vf25 (&-> at-0 camera-rot quad 1))
(.lvf vf26 (&-> at-0 camera-rot quad 2))
(.lvf vf27 (&-> at-0 camera-rot trans quad))
)
;; do distance math
(let ((fg-dist (-> (scratchpad-object foreground-work) distance)))
(.lvf vf15 (&-> fg-bounds quad))
(.mul.w.vf acc vf27 vf0)
(.add.mul.x.vf acc vf24 vf15 acc)
(.add.mul.y.vf acc vf25 vf15 acc)
(.add.mul.z.vf vf15 vf26 vf15 acc :mask #b111)
(.mul.vf vf28 vf15 vf15)
(.max.w.vf vf29 vf0 vf0)
(.add.y.vf acc vf28 vf28)
(.add.mul.z.vf vf28 vf29 vf28 acc :mask #b1)
(.sqrt.vf Q vf28 :ftf #b0)
(.sub.w.vf vf28 vf0 vf15 :mask #b1000)
(.wait.vf)
(.add.vf vf15 vf28 Q :mask #b1000)
(.svf (&-> fg-dist quad) vf15)
;; pick lods
(when (< 0.0 (+ (-> fg-dist z) (-> dc bounds w)))
(let ((lod-idx 0))
(let ((dist-w (-> fg-dist w)))
(set! (-> dc distance) dist-w)
(when (nonzero? (-> dc lod-set max-lod))
(cond
((>= (-> dc force-lod) 0)
(set! lod-idx (-> dc force-lod))
(if (< (-> dc lod-set lod (-> dc lod-set max-lod) dist) dist-w)
(return #f)
)
)
(else
(while (and (< lod-idx (the-as int (-> dc lod-set max-lod))) (< (-> dc lod-set lod lod-idx dist) dist-w))
(+! lod-idx 1)
)
)
)
)
(if (and (< (-> dc lod-set lod lod-idx dist) dist-w) (< (-> dc force-lod) 0))
(return #f)
)
;; predict texture use and set masks.
(let ((src-lev (-> *level* level (-> dc level-index)))
(corrected-dist (* dist-w (-> *math-camera* fov-correction-factor)))
(tex-use (-> dc mgeo header texture-usage-group))
)
(dotimes (use-fg-idx 7)
(let ((use-idx (+ use-fg-idx 11)))
(if (not (logtest? (-> dc status) (draw-control-status no-closest-distance)))
(set! (-> src-lev closest-object-array use-idx) (fmin (-> src-lev closest-object-array use-idx) dist-w))
)
)
(let ((tex-lod (cond
((>= corrected-dist (-> tex-use data use-fg-idx data 0 dist))
0
)
((>= corrected-dist (-> tex-use data use-fg-idx data 1 dist))
1
)
(else
2
)
)
)
(a2-23 (+ use-fg-idx 11))
)
(let ((a3-10 (-> src-lev texture-mask a2-23 mask quad))
(t0-3 (-> (the-as (pointer uint128) (+ (the-as uint tex-use) (* 48 use-fg-idx) (* tex-lod 16))) 0))
)
(.por a3-11 a3-10 t0-3)
)
(set! (-> src-lev texture-mask a2-23 mask quad) a3-11)
)
)
)
;; see if we need special scissor mode.
(if (or (guard-band-cull fg-bounds) (< dist-w (* 1.2 (-> *math-camera* d))))
(logior! (-> dc status) (draw-control-status close-to-screen))
(logclear! (-> dc status) (draw-control-status close-to-screen))
)
;; if we got this far, we're on-screen.
(logior! (-> dc status) (draw-control-status on-screen))
(if (logtest? (-> dc status) (draw-control-status no-draw-bounds no-draw-bounds2))
(return #f)
)
(set! (-> pp clock) (-> sv-16 clock))
;; draw!
(if (or (= lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status lod-set)))
(foreground-draw dc dma-buf dist-w)
)
)
;; trick to do joint math twice if we're changing lods.
(when (and (< lod-idx (-> dc cur-lod)) (logtest? (-> dc status) (draw-control-status math-skel)))
(let ((v1-159 *matrix-engine*))
(set! (-> v1-159 (-> v1-159 length)) (process->handle sv-16))
(+! (-> v1-159 length) 1)
)
)
(lod-set! dc lod-idx)
)
(logior! (-> dc status) (draw-control-status lod-set))
)
)
)
)
)
(read! (-> *perf-stats* data (perf-stat-bucket foreground)))
(none)
)
)
)
(define *hud-lights* (new 'global 'vu-lights))
(set-vector! (-> *hud-lights* direction 0) 1.0 0.0 0.0 1.0)
(set-vector! (-> *hud-lights* direction 1) 0.0 1.0 0.0 1.0)
(set-vector! (-> *hud-lights* direction 2) 0.0 0.0 1.0 1.0)
(set-vector! (-> *hud-lights* color 0) 0.0 0.0 0.0 1.0)
(set-vector! (-> *hud-lights* color 1) 0.0 0.0 0.0 1.0)
(set-vector! (-> *hud-lights* color 2) 0.5 0.5 0.5 1.0)
(set-vector! (-> *hud-lights* ambient) 0.5 0.5 0.5 1.0)
;; todo dma-add-process-drawable-hud
(defun add-process-drawable ((arg0 process-drawable) (arg1 draw-control) (arg2 symbol) (arg3 dma-buffer))
"Call the dma-add-func callback on a draw-control to draw it."
((-> arg1 dma-add-func) arg0 arg1 arg2 arg3)
(none)
)
(defun foreground-engine-execute ((arg0 engine) (arg1 display-frame))
"Run the foreground drawing engine."
(when (> (length arg0) 0)
(let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf base)))
(with-profiler 'foreground *profile-foreground-color*
(let ((s4-1 (-> arg1 global-buf)))
; (let ((v1-29 (-> s4-1 base)))
; (.sync.l)
; (.cache dxwbin v1-29 0)
; (.sync.l)
; (.cache dxwbin v1-29 1)
; )
; (.sync.l)
; 0
;; prepare for foreground functions
(foreground-init)
;; add dma for each foreground object
(execute-connections arg0 s4-1)
;; stitch together buckets/finalize renderers.
(foreground-wrapup)
)
)
(let ((v1-49 *dma-mem-usage*))
(when (nonzero? v1-49)
(set! (-> v1-49 length) (max 36 (-> v1-49 length)))
(set! (-> v1-49 data 35 name) "pris-fragment")
(+! (-> v1-49 data 35 count) 1)
(+! (-> v1-49 data 35 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint gp-0))
)
(set! (-> v1-49 data 35 total) (-> v1-49 data 35 used))
)
)
)
)
0
(none)
)
(defun main-debug-hook ()
"Execute the debug engine, collision renderer, and draw-instance-info."
(when (not (or (= *master-mode* 'menu) (= *master-mode* 'progress)))
(let ((a0-3 *col-rend*))
(if (-> a0-3 draw?)
@@ -289,6 +734,40 @@
(define *debug-hook* (cons main-debug-hook '()))
(define *add-sphere* #f)
(define *generic-effect-mode* 0)
(defun foreground-initialize-engines ()
(let ((v1-0 *shadow-globals*))
(dotimes (a0-0 2)
(let ((a1-2 (-> v1-0 bucket a0-0)))
(set! (-> a1-2 first) (the-as uint 0))
(set! (-> a1-2 next) (the-as uint 0))
(set! (-> a1-2 shadow-color) (if (zero? a0-0)
(the-as uint #x80f0f0f0)
(the-as uint (-> *setting-control* user-current spotlight-color))
)
)
(set! (-> a1-2 constants) (the-as basic 0))
)
)
)
(none)
)
(defun foreground-execute-cpu-vu0-engines ()
(let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf)))
(bones-init gp-0)
(bones-mtx-calc-execute)
;;(generic-merc-execute-all gp-0)
;;(shadow-execute-all gp-0)
)
;;(lightning-draw-all)
(none)
)
(defun real-main-draw-hook ()
(local-vars (a0-96 int) (a0-98 int))
(with-pp
@@ -334,7 +813,7 @@
; )
;; set up foreground buckets
; (foreground-initialize-engines)
(foreground-initialize-engines)
;; update time of day and wind effects.
(let ((gp-2 (-> pp clock)))
@@ -375,15 +854,15 @@
; )
;; run the foreground system
; (foreground-engine-execute *foreground-draw-engine* (-> *display* frames (-> *display* on-screen)))
; (let ((gp-6 (-> pp clock)))
; (if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3))
; (set! (-> pp clock) (-> *display* bg-clock))
; (set! (-> pp clock) (-> *display* real-clock))
; )
; (foreground-execute-cpu-vu0-engines)
; (set! (-> pp clock) gp-6)
; )
(foreground-engine-execute *foreground-draw-engine* (-> *display* frames (-> *display* on-screen)))
(let ((gp-6 (-> pp clock)))
(if (= (-> *time-of-day-context* mode) (time-of-day-palette-id unk3))
(set! (-> pp clock) (-> *display* bg-clock))
(set! (-> pp clock) (-> *display* real-clock))
)
(foreground-execute-cpu-vu0-engines)
(set! (-> pp clock) gp-6)
)
;; ??
; (when *add-sphere*
@@ -950,7 +1429,7 @@
;; post-draw buffer setup
(tfrag-vu1-init-buffers)
(tie-vu1-init-buffers)
; (merc-vu1-init-buffers)
(merc-vu1-init-buffers)
; (emerc-vu1-init-buffers)
; (generic-vu1-init-buffers)
+1 -1
View File
@@ -320,7 +320,7 @@
(prev-state state :offset-assert 124)
(id uint32 :offset-assert 128)
(count uint32 :offset-assert 132)
(penetrate-using uint64 :offset-assert 136)
(penetrate-using penetrate :offset-assert 136)
(damage float :offset-assert 144)
(shield-damage float :offset-assert 148)
(knock uint8 :offset-assert 152)
+1 -1
View File
@@ -1712,7 +1712,7 @@
)
(when (< (mod (-> *display* real-clock frame-counter) 300) 270)
(with-dma-buffer-add-bucket ((s5-3 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id bucket-320)
(bucket-id progress)
)
(hud-sprite-method-9 (-> self icon) s5-3 (-> self level))
)
+3 -3
View File
@@ -478,15 +478,15 @@
)
; ;; Run blerc to modify foreground models
; (with-profiler 'merc *profile-merc-color*
(with-profiler 'merc *profile-merc-color*
; (blerc-execute)
; (blerc-init)
; )
)
; ;; Run other merc effects that modify vertices
; (texscroll-execute)
; (ripple-execute)
; (region-execute)
(region-execute)
;; final call to update joints before drawing.
(with-profiler 'joints *profile-joints-color*
+33 -32
View File
@@ -9,8 +9,8 @@
(defenum bone-calc-flags
:type uint16
:bitfield #t
(bncfl00 0)
(bncfl01 1) ;; use identity matrix in bone matrix calc instead of cam rot (effectively screen-space bones?)
(write-ripple-data 0)
(no-cam-rot 1)
(bncfl02 2)
(bncfl03 3)
(bncfl04 4)
@@ -30,9 +30,9 @@
;; DECOMP BEGINS
(deftype bone-buffer (structure)
((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0)
(bone bone 16 :inline :offset-assert 1024)
(_pad uint8 2048 :offset-assert 2304)
((joint matrix 16 :inline :offset-assert 0)
(bone bone 16 :inline :offset-assert 1024)
(output pris-mtx 16 :inline :offset-assert 2304)
)
:method-count-assert 9
:size-assert #x1100
@@ -40,11 +40,11 @@
)
(deftype bone-layout (structure)
((data uint16 8 :offset-assert 0)
(joint joint 2 :offset 0)
(bone bone 2 :offset 8)
(output uint32 2 :offset 16)
(unused uint32 2 :offset 24)
((data uint16 8 :offset-assert 0)
(joint (inline-array matrix) 2 :offset 0)
(bone (inline-array bone) 2 :offset 8)
(output (inline-array pris-mtx) 2 :offset 16)
(unused uint32 2 :offset 24)
)
:method-count-assert 9
:size-assert #x20
@@ -52,15 +52,15 @@
)
(deftype bone-regs (structure)
((dma-buf basic :offset-assert 0)
(wait-count uint32 :offset-assert 4)
(in-count uint32 :offset-assert 8)
(sp-size uint32 :offset-assert 12)
(sp-bufnum uint32 :offset-assert 16)
(joint-ptr (inline-array joint) :offset-assert 20)
(bone-ptr (inline-array bone) :offset-assert 24)
(num-bones uint32 :offset-assert 28)
(mtxs uint32 :offset-assert 32)
((dma-buf basic :offset-assert 0)
(wait-count uint32 :offset-assert 4)
(in-count uint32 :offset-assert 8)
(sp-size uint32 :offset-assert 12)
(sp-bufnum uint32 :offset-assert 16)
(joint-ptr (inline-array joint) :offset-assert 20)
(bone-ptr (inline-array bone) :offset-assert 24)
(num-bones uint32 :offset-assert 28)
(mtxs (inline-array pris-mtx) :offset-assert 32)
)
:method-count-assert 9
:size-assert #x24
@@ -95,19 +95,20 @@
)
(deftype bone-calculation (structure)
((flags bone-calc-flags :offset-assert 0)
(num-bones uint16 :offset-assert 2)
(matrix-area (inline-array matrix) :offset-assert 4)
(joints (inline-array joint) :offset-assert 8)
(bones (inline-array bone) :offset-assert 12)
(ripple-scale float :offset-assert 16)
(ripple-y-scale float :offset-assert 20)
(ripple-normal-scale float :offset-assert 24)
(ripple-area (inline-array vector) :offset-assert 28)
(next bone-calculation :offset-assert 32)
(dummy-1 uint32 :offset-assert 36)
(dummy-2 uint32 :offset-assert 40)
(dummy-3 uint32 :offset-assert 44)
((flags bone-calc-flags :offset-assert 0)
(num-bones uint16 :offset-assert 2)
(matrix-area (inline-array pris-mtx) :offset-assert 4)
(joints (inline-array joint) :offset-assert 8)
(bones (inline-array bone) :offset-assert 12)
(ripple-scale float :offset-assert 16)
(ripple-y-scale float :offset-assert 20)
(ripple-normal-scale float :offset-assert 24)
(ripple-area (inline-array vector) :offset-assert 28)
(ripple-vec vector :inline :offset 16)
(next bone-calculation :offset-assert 32)
(dummy-1 uint32 :offset-assert 36)
(dummy-2 uint32 :offset-assert 40)
(dummy-3 uint32 :offset-assert 44)
)
:method-count-assert 9
:size-assert #x30
@@ -7,3 +7,306 @@
;; DECOMP BEGINS
;; todo check bad reference.
;; bones, joints, cspace, matrix, joint-anim-frames...
;; The "joints" define the structure of the skeleton, just storing a bind pose, and parent info. These don't change,
;; and are loaded as part of the skeleton. The actual joint objects are stored in the art-joint-geo.
;; The "do-joint-math" method of process-drawable is responsible for computing the joint-anim-frame and the bones.
;; The "cspace" system is used to compute bones from joint-anim-frames.
;; The "joint-anim-frame" is a list of transformqs for the relative transform between bones.
;; The "bones" are the world space transform of each 'bone'
;; The "do-joint-math" function does:
;; - call the generate-frame-function callback to generate a joint-anim-frame (does the joint anim decompress/blending)
;; - call the prebind-function which can modify the relative transforms (eg: joint-mods)
;; - walk the tree of joints, computing bones using the cspace
;; - call the postbind-function, for other effects.
;; The "bones" system creates matrices for foreground renderers from bones/joints.
;; The inputs are bones/joints, and the output is pris-mtx, which is a 4x4 "t-mtx" for transforming, and a 3x3 (stored in 3 vec4's)
;; n-mtx for rotating normals.
;; all matrices are calculated at once, and shared between merc/emerc/gmerc/shadow
;; this is done by a linked list of "bone calculations", which is stashed in the dma buffer.
;; list node for pending bone calculations. These are terminated by 0's.
(deftype bone-calculation-list (structure)
((first bone-calculation :offset-assert 0)
(next bone-calculation :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; head of bone calculation list
(define *bone-calculation-list* (new 'global 'bone-calculation-list))
(defun bone-list-init ()
"Reset bone calculation list to have nothing in it."
(let ((v1-0 *bone-calculation-list*))
(set! (-> v1-0 first) (the-as bone-calculation 0))
(set! (-> v1-0 next) (the-as bone-calculation 0))
)
0
0
(none)
)
;; clear list.
(bone-list-init)
;; VU0 microprogram for bone calculations.
(define bones-vu0-block (new 'static 'vu-function :length 54 :qlength 27))
(defun bones-set-sqwc ()
"Set the sqwc register so the DMA transfer of joints skips the metadata and just transfers the bind-pose."
(set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x4))
(none)
)
(defun bones-reset-sqwc ()
"Reset sqwc so DMA works normally again (see bones-set-sqwc)"
(set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x1))
(none)
)
(defun bones-init ((arg0 dma-buffer))
"Initialize scratchpad/vu0 for BONE MATH."
(let ((v1-1 (-> (scratchpad-object bone-memory) work)))
(+ #x70000000 0)
;; scratchpad layout of double-buffered bone calculation.
;; "joints", which are stripped of their metadata qw and are 4qw matrices
(set! (-> v1-1 layout joint 0) (-> (scratchpad-object bone-memory) buffer 0 joint))
(set! (-> v1-1 layout joint 1) (-> (scratchpad-object bone-memory) buffer 1 joint))
;; "bones", which are 5 qw transform + scale separately
(set! (-> v1-1 layout bone 0) (-> (scratchpad-object bone-memory) buffer 0 bone))
(set! (-> v1-1 layout bone 1) (-> (scratchpad-object bone-memory) buffer 1 bone))
;; "output" pris-mtx.
(set! (-> v1-1 layout output 0) (-> (scratchpad-object bone-memory) buffer 0 output))
(set! (-> v1-1 layout output 1) (-> (scratchpad-object bone-memory) buffer 1 output))
)
;; upload the bones vu0 block.
(unless PC_PORT
(let ((gp-0 *vu0-dma-list*))
(let ((v1-2 gp-0))
(set! (-> v1-2 base) (-> v1-2 data))
(set! (-> v1-2 end) (&-> v1-2 data-buffer (-> v1-2 allocated-length)))
)
(dma-buffer-add-vu-function gp-0 bones-vu0-block 0)
(let* ((v1-3 gp-0)
(a0-20 (the-as object (-> v1-3 base)))
)
(set! (-> (the-as dma-packet a0-20) dma) (new 'static 'dma-tag :id (dma-tag-id end)))
(set! (-> (the-as (pointer uint64) a0-20) 1) (the-as uint 0))
(set! (-> v1-3 base) (&+ (the-as pointer a0-20) 16))
)
(.sync.l)
(dma-buffer-send-chain (the-as dma-bank-source #x10008000) gp-0)
)
)
0
(none)
)
;; note that the original game doesn't quite use a normal calling convention here, so we cheat and pass an extra arg.
;; see the C++ code for more details.
(def-mips2c bones-mtx-calc (function (inline-array pris-mtx) (inline-array joint) (inline-array bone) uint object none))
(defun bones-mtx-calc-execute ()
"Execute all bone matrix calculations."
(rlet ((vf1 :class vf)
(vf25 :class vf)
(vf26 :class vf)
(vf27 :class vf)
(vf28 :class vf)
(vf29 :class vf)
(vf30 :class vf)
(vf31 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(vf8 :class vf)
)
(with-profiler 'bones *profile-bones-color*
(reset! (-> *perf-stats* data (perf-stat-bucket bones)))
;; set up layout in scratchpad (again)
(let ((v1-24 (-> (scratchpad-object bone-memory) work)))
(set! (-> v1-24 layout joint 0) (-> (scratchpad-object bone-memory) buffer 0 joint))
(set! (-> v1-24 layout joint 1) (-> (scratchpad-object bone-memory) buffer 1 joint))
(set! (-> v1-24 layout bone 0) (-> (scratchpad-object bone-memory) buffer 0 bone))
(set! (-> v1-24 layout bone 1) (-> (scratchpad-object bone-memory) buffer 1 bone))
(set! (-> v1-24 layout output 0) (-> (scratchpad-object bone-memory) buffer 0 output))
(set! (-> v1-24 layout output 1) (-> (scratchpad-object bone-memory) buffer 1 output))
)
;; set sqwc to upload joints. This will skip the 1 qw of metadata and just grab the joint matrix.
;; (set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x4))
;; loop over bone calculations:
(let* ((v1-26 *bone-calculation-list*)
(gp-1 *identity-matrix*)
(s5-1 (-> *math-camera* camera-rot))
(s4-1 (-> v1-26 first))
)
(while (nonzero? s4-1) ;; loop
;; pick correct matrix. The pris-mtx includes camera rotation, so all that's needed in the final
;; renderers is perspective. (unless you set no-cam-rot)
(let ((v1-29 (if (logtest? (-> s4-1 flags) (bone-calc-flags no-cam-rot))
gp-1
s5-1
)
)
)
(.lvf vf28 (&-> v1-29 quad 0))
(.lvf vf29 (&-> v1-29 quad 1))
(.lvf vf30 (&-> v1-29 quad 2))
(.lvf vf31 (&-> v1-29 trans quad))
(.lvf vf25 (&-> v1-29 quad 0))
(.lvf vf26 (&-> v1-29 quad 1))
(.lvf vf27 (&-> v1-29 quad 2))
;; calculate!
(bones-mtx-calc
(-> s4-1 matrix-area)
(-> s4-1 joints)
(-> s4-1 bones)
(-> s4-1 num-bones)
v1-29 ;; hack, to pass matrix to bones-mtx-calc in a better way.
)
)
;; there is an optional post-processing step for ripple.
(when (logtest? (-> s4-1 flags) (bone-calc-flags write-ripple-data))
(let* ((a2-1 s4-1)
(v1-34 (-> a2-1 num-bones))
(a0-26 (the-as pris-mtx (-> a2-1 matrix-area)))
(a1-11 (the-as pris-mtx (-> a2-1 ripple-area)))
)
(.lvf vf1 (&-> a2-1 ripple-vec quad))
(label cfg-15)
(.lvf vf5 (&-> a0-26 t-mtx quad 1))
(.lvf vf6 (&-> a0-26 t-mtx trans quad))
(.lvf vf7 (&-> a0-26 n-mtx quad 0))
(.lvf vf8 (&-> a0-26 n-mtx quad 2))
(.mul.x.vf vf4 vf5 vf1)
(.mul.y.vf vf5 vf5 vf1)
(let ((a3-1 (-> a0-26 t-mtx quad 0)))
(.mul.z.vf vf7 vf7 vf1)
(let ((a2-2 (-> a0-26 t-mtx quad 2)))
(.mul.z.vf vf8 vf8 vf1)
(set! (-> a1-11 t-mtx quad 0) a3-1)
(let ((a3-2 (-> a0-26 n-mtx quad 1)))
(.sub.vf vf6 vf6 vf4)
(set! (-> a1-11 t-mtx quad 2) a2-2)
(.svf (&-> a1-11 t-mtx quad 1) vf5)
(set! (-> a1-11 n-mtx quad 1) a3-2)
)
)
)
(+! v1-34 -1)
(.svf (&-> a1-11 n-mtx quad 0) vf7)
;; (.addiu a0-26 a0-26 128)
(&+! a0-26 128)
(.svf (&-> a1-11 t-mtx trans quad) vf6)
;; (.addiu a1-11 a1-11 128)
(&+! a1-11 128)
(b! (nonzero? v1-34) cfg-15 :delay (.svf (&-> (the (inline-array vector) a1-11) -2 quad) vf8))
)
0
)
(set! s4-1 (-> s4-1 next))
)
)
;; reset sqwc
;; (set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x1))
;; clear bone list
(bone-list-init)
(read! (-> *perf-stats* data (perf-stat-bucket bones)))
)
0
(none)
)
)
(defun-debug dump-qword ((arg0 qword))
(let ((v1-0 arg0))
(format
0
"~8,'0X: ~8,'0X ~8,'0X ~8,'0X ~8,'0X~%"
v1-0
(-> v1-0 data 0)
(-> v1-0 data 1)
(-> v1-0 data 2)
(-> v1-0 data 3)
)
)
0
(none)
)
(defun-debug dump-mem ((arg0 pointer) (arg1 int))
(dotimes (s4-0 arg1)
(format
0
"~8,'0X: ~8,'0X ~8,'0X ~8,'0X ~8,'0X"
(&+ arg0 (* (* s4-0 4) 4))
(-> (the-as (pointer uint32) (&+ arg0 (* (* s4-0 4) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 1) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 2) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 3) 4))))
)
(format
0
" ~F ~F ~F ~F ~%"
(-> (the-as (pointer uint32) (&+ arg0 (* (* s4-0 4) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 1) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 2) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 3) 4))))
)
)
0
(none)
)
(defun-debug bones-debug ()
0
(none)
)
(defun-debug dump-bone-mem ()
(format 0 "== joints 0 ===========~%")
(dump-mem (the-as pointer (+ 80 #x70000000)) 64)
(format 0 "== bones 0 ============~%")
(dump-mem (the-as pointer (+ 1104 #x70000000)) 80)
(format 0 "== output 0 ===========~%")
(dump-mem (the-as pointer (+ 2384 #x70000000)) 128)
(format 0 "~%~%~%")
(format 0 "== joints 1 ===========~%")
(dump-mem (the-as pointer (+ 4432 #x70000000)) 64)
(format 0 "== bones 1 ============~%")
(dump-mem (the-as pointer (+ 5456 #x70000000)) 80)
(format 0 "== output 1 ===========~%")
(dump-mem (the-as pointer (+ 6736 #x70000000)) 128)
(format 0 "========================~%~%")
0
(none)
)
@@ -6,6 +6,7 @@
;; dgos: ENGINE, GAME
(define-extern *foreground-draw-engine* engine)
(define-extern vu-lights<-light-group! (function vu-lights light-group none))
;; DECOMP BEGINS
@@ -13,7 +14,7 @@
((first uint32 :offset-assert 0)
(next uint32 :offset-assert 4)
(state generic-bucket-state :inline :offset-assert 8)
(vu1-bucket int32 :offset-assert 16)
(vu1-bucket bucket-id :offset-assert 16)
)
:pack-me
:method-count-assert 9
@@ -24,7 +25,7 @@
(deftype merc-chain (structure)
((first dma-packet :offset-assert 0)
(patch dma-packet :offset-assert 4)
(vu1-bucket int32 :offset-assert 8)
(vu1-bucket bucket-id :offset-assert 8)
)
:pack-me
:method-count-assert 9
@@ -66,11 +67,11 @@
(mercneric-used uint32 :offset-assert 12)
(use-isometric uint32 :offset-assert 16)
(base-start dma-packet :offset-assert 20)
(joint-ptr uint32 :offset-assert 24)
(bone-ptr uint32 :offset-assert 28)
(joint-ptr (inline-array joint) :offset-assert 24)
(bone-ptr (inline-array bone) :offset-assert 28)
(num-bones uint32 :offset-assert 32)
(mtxs uint32 :offset-assert 36)
(dma-buf basic :offset-assert 40)
(mtxs (inline-array pris-mtx) :offset-assert 36)
(dma-buf dma-buffer :offset-assert 40)
(default-texture-index uint32 :offset-assert 44)
(mercneric-chain mercneric-chain :offset-assert 48)
(level-buckets foreground-level-buckets :offset-assert 52)
@@ -82,7 +83,7 @@
(deftype foreground-work (structure)
((regs foreground-regs :inline :offset-assert 0)
(draw-index-map uint16 7 :offset 64)
(draw-index-map uint8 7 :offset 64)
(grid foreground-bucket-grid :inline :offset-assert 80)
(bounds sphere :inline :offset-assert 2464)
(lights vu-lights :inline :offset-assert 2480)
@@ -115,6 +116,7 @@
(deftype merc-effect-bucket-info (structure)
((color-fade rgba :offset-assert 0)
(alpha uint8 :offset 3)
(merc-path uint8 :offset-assert 4)
(ignore-alpha uint8 :offset-assert 5)
(disable-draw uint8 :offset-assert 6)
File diff suppressed because it is too large Load Diff
@@ -7,3 +7,9 @@
;; DECOMP BEGINS
(defun ripple-make-request ((arg0 ripple-wave) (arg1 merc-effect))
(none))
(defun ripple-find-height ((arg0 process-drawable) (arg1 int) (arg2 vector))
-100000000.0
)
@@ -15,6 +15,8 @@
(shdf03)
(shdf04) ;; unused
(disable-draw)
(shdf06)
(shdf07)
)
;; DECOMP BEGINS
@@ -30,6 +32,7 @@
(fade-start float :offset-assert 68)
(dummy-2 int32 :offset-assert 72)
(shadow-type int32 :offset-assert 76)
(flag-vector vector :inline :offset 64) ;; added
)
:method-count-assert 9
:size-assert #x50
+9 -6
View File
@@ -23,9 +23,11 @@
;; Note that the data is transposed to be faster for use in the VU code.
;; the w components are unused for lighting information - you can put whatever you want in them...
(deftype vu-lights (structure)
((direction vector 3 :inline :offset-assert 0)
(color vector 3 :inline :offset-assert 48)
(ambient vector :inline :offset-assert 96)
((direction vector 3 :inline :offset-assert 0)
(color vector 3 :inline :offset-assert 48)
(ambient vector :inline :offset-assert 96)
(fade-int uint32 :offset 44)
(fade-flags uint32 :offset 28)
)
:method-count-assert 9
:size-assert #x70
@@ -69,9 +71,10 @@
;; hash bucket for fast "which light am I in?" checks.
(deftype light-hash-bucket (structure)
((index uint16 :offset-assert 0)
(count uint16 :offset-assert 2)
((index uint16 :offset-assert 0)
(count uint16 :offset-assert 2)
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -85,7 +88,7 @@
(base-trans vector :inline :offset-assert 16)
(axis-scale vector :inline :offset-assert 32)
(dimension-array vector4w :inline :offset-assert 48)
(bucket-array pointer :offset-assert 64)
(bucket-array (inline-array light-hash-bucket) :offset-assert 64)
(index-array pointer :offset-assert 68)
(light-sphere-array (inline-array light-sphere) :offset-assert 72)
)
+49
View File
@@ -7,3 +7,52 @@
;; DECOMP BEGINS
(define *light-hash-work* (new 'static 'light-hash-work :ones (new 'static 'vector4w :x 1 :y 1 :z 1)))
(defun light-slerp ((arg0 light) (arg1 light) (arg2 light) (arg3 float))
(let ((s3-0 (fmax 0.0 (fmin 1.0 arg3))))
(vector-lerp! (-> arg0 color) (-> arg1 color) (-> arg2 color) s3-0)
(vector-deg-slerp (-> arg0 direction) (-> arg1 direction) (-> arg2 direction) s3-0)
(let ((f0-2 (-> arg1 extra x))
(f1-2 (-> arg2 extra x))
)
(set! (-> arg0 extra x) (+ f0-2 (* s3-0 (- f1-2 f0-2))))
)
)
arg0
)
(defun light-group-slerp ((arg0 light-group) (arg1 light-group) (arg2 light-group) (arg3 float))
(dotimes (s2-0 4)
(light-slerp (-> arg0 lights s2-0) (-> arg1 lights s2-0) (-> arg2 lights s2-0) arg3)
)
arg0
)
(defun light-group-process! ((arg0 vu-lights) (arg1 light-group) (arg2 vector) (arg3 vector))
(rotate-y<-vector+vector arg3 arg2)
(vu-lights<-light-group! arg0 arg1)
(none)
)
(define *default-lights* (new 'global 'vu-lights))
(defun vu-lights-default! ((arg0 vu-lights))
(set-vector! (-> arg0 ambient) 0.3 0.3 0.3 1.0)
(set-vector! (-> arg0 color 0) 1.0 1.0 1.0 1.0)
(set-vector! (-> arg0 color 1) 0.2 0.2 0.2 1.0)
(set-vector! (-> arg0 color 2) 0.0 0.0 0.0 1.0)
(set-vector! (-> arg0 direction 0) 1.0 0.0 0.0 1.0)
(set-vector! (-> arg0 direction 1) 0.0 1.0 0.0 1.0)
(set-vector! (-> arg0 direction 2) 0.0 0.0 1.0 1.0)
arg0
)
;; stub
(defun light-hash-get-bucket-index ((arg0 light-hash) (arg1 vector))
-1
)
(defun add-light-sphere-to-light-group (arg0 arg1 arg2 arg3)
(the object #f)
)
+15 -2
View File
@@ -12,6 +12,19 @@
(define-extern merc-blend-shape (function process-drawable object))
(define-extern merc-eye-anim (function process-drawable none))
(defenum effect-bits
:type uint8
:bitfield #t
(texscroll 0)
(no-fade-out 1)
(ripple 2)
(emerc 3) ;; envmap??
(ignore-tod-for-envmap-tint 4) ;; color thing
(force-mercneric 5) ;; some mercneric-only effect
(cross-fade 6)
(ignore-alpha 7)
)
;; DECOMP BEGINS
(deftype ripple-merc-query (inline-array-class)
@@ -151,7 +164,7 @@
(deftype mei-envmap-tint (structure)
((fade0 float :offset-assert 0)
(fade1 float :offset-assert 4)
(tint uint32 :offset-assert 8)
(tint rgba :offset-assert 8)
(dummy int32 :offset-assert 12)
)
:method-count-assert 9
@@ -206,7 +219,7 @@
(blend-data merc-blend-data :offset-assert 8)
(blend-ctrl merc-blend-ctrl :offset-assert 12)
(merc-effect-version uint8 :offset-assert 16)
(effect-bits uint8 :offset-assert 17)
(effect-bits effect-bits :offset-assert 17)
(frag-count uint16 :offset-assert 18)
(blend-frag-count uint16 :offset-assert 20)
(tri-count uint16 :offset-assert 22)
+1 -1
View File
@@ -7,4 +7,4 @@
;; DECOMP BEGINS
(define merc-vu1-block (new 'static 'vu-function :length #x7e5 :qlength #x3f3))
(define merc-vu1-block (new 'static 'vu-function :length 0 :qlength 0))
+6 -5
View File
@@ -564,12 +564,13 @@
)
)
(set! (-> (the-as (pointer gs-reg64) a0-8) 1) (gs-reg64 test-1))
(set! (-> (the-as (pointer gs-test) a0-8) 2) (if arg2
(the-as gs-test #x1000130)
(the-as gs-test (the-as uint #x101000130))
)
(set! (-> (the-as (pointer gs-zbuf) a0-8) 2)
(if arg2
(new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24))
(new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)
)
)
(set! (-> (the-as (pointer gs-test) a0-8) 3) (new 'static 'gs-test :atst (gs-atest not-equal) :aref #x4))
(set! (-> (the-as (pointer gs-reg64) a0-8) 3) (gs-reg64 zbuf-1))
(set! (-> v1-14 base) (&+ a0-8 32))
)
(let ((v1-15 (the-as object (-> dma-buf base))))
+49 -44
View File
@@ -20,6 +20,7 @@
;; - using geometry of level 1
;; - while the tfrag tpage is in VRAM
;; <what renderer>-<what level>-<what tpage>
(defenum bucket-id
:type int32
:bitfield #f
@@ -47,7 +48,7 @@
(etie-s-l0-tfrag 13) ;; tie
(merc-l0-tfrag 14) ;; merc
(emerc-l0-tfrag 15) ;; emerc
(bucket-16 16) ;; mercneric
(gmerc-l0-tfrag 16) ;; mercneric
(tie-v-l0-tfrag 17) ;; tie
(tex-l1-tfrag 18) ;; tex
@@ -59,7 +60,7 @@
(etie-s-l1-tfrag 24) ;; tie
(merc-l1-tfrag 25) ;; merc
(emerc-l1-tfrag 26) ;; emerc
(bucket-27 27) ;; mercneric
(gmerc-l1-tfrag 27) ;; mercneric
(tie-v-l1-tfrag 28) ;; tie
(tex-l2-tfrag 29) ;; tex
@@ -71,7 +72,7 @@
(etie-s-l2-tfrag 35) ;; tie
(merc-l2-tfrag 36) ;; merc
(emerc-l2-tfrag 37) ;; emerc
(bucket-38 38) ;; mercneric
(gmerc-l2-tfrag 38) ;; mercneric
(tie-v-l2-tfrag 39) ;; tie
(tex-l3-tfrag 40) ;; tex
@@ -83,7 +84,7 @@
(etie-s-l3-tfrag 46) ;; tie
(merc-l3-tfrag 47) ;; merc
(emerc-l3-tfrag 48) ;; emerc
(bucket-49 49) ;; mercneric
(gmerc-l3-tfrag 49) ;; mercneric
(tie-v-l3-tfrag 50) ;; tie
(tex-l4-tfrag 51) ;; tex
@@ -95,7 +96,7 @@
(etie-s-l4-tfrag 57) ;; tie
(merc-l4-tfrag 58) ;; merc
(emerc-l4-tfrag 59) ;; emerc
(bucket-60 60) ;; mercneric
(gmerc-l4-tfrag 60) ;; mercneric
(tie-v-l4-tfrag 61) ;; tie
(tex-l5-tfrag 62) ;; tex
@@ -107,7 +108,7 @@
(etie-s-l5-tfrag 68) ;; tie
(merc-l5-tfrag 69) ;; merc
(emerc-l5-tfrag 70) ;; emerc
(bucket-71 71) ;; mercneric
(gmerc-l5-tfrag 71) ;; mercneric
(tie-v-l5-tfrag 72) ;; tie
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -122,7 +123,7 @@
(shrub-nt-l0-shrub 78) ;; shrub
(merc-l0-shrub 79) ;; merc
(emerc-l0-shrub 80) ;; emerc
(bucket-81 81) ;; mercneric
(gmerc-l0-shrub 81) ;; mercneric
(tex-l1-shrub 82) ;; tex
(shrub-l1-shrub 83) ;; shrub
@@ -132,17 +133,17 @@
(shrub-nt-l1-shrub 87) ;; shrub
(merc-l1-shrub 88) ;; merc
(emerc-l1-shrub 89) ;; emerc
(bucket-90 90) ;; mercneric
(gmerc-l1-shrub 90) ;; mercneric
(tex-l2-shrub 91) ;; tex
(shrub-l2-shrub 92) ;; shrub
(shrub-n-l2-shrub 93) ;; shrub
(billboard-l2-shrub 94) ;; shrub
(billboard-l2-shrub 94) ;; shrub
(shrub-v-l2-shrub 95) ;; shrub
(shrub-nt-l2-shrub 96) ;; shrub
(merc-l2-shrub 97) ;; merc
(emerc-l2-shrub 98) ;; emerc
(bucket-99 99) ;; mercneric
(gmerc-l2-shrub 99) ;; mercneric
(tex-l3-shrub 100) ;; tex
(shrub-l3-shrub 101) ;; shrub
@@ -152,7 +153,7 @@
(shrub-nt-l3-shrub 105) ;; shrub
(merc-l3-shrub 106) ;; merc
(emerc-l3-shrub 107) ;; emerc
(bucket-108 108) ;; mercneric
(gmerc-l3-shrub 108) ;; mercneric
(tex-l4-shrub 109) ;; tex
(shrub-l4-shrub 110) ;; shrub
@@ -162,7 +163,7 @@
(shrub-nt-l4-shrub 114) ;; shrub
(merc-l4-shrub 115) ;; merc
(emerc-l4-shrub 116) ;; emerc
(bucket-117 117) ;; mercneric
(gmerc-l4-shrub 117) ;; mercneric
(tex-l5-shrub 118) ;; tex
(shrub-l5-shrub 119) ;; shrub
@@ -172,7 +173,7 @@
(shrub-nt-l5-shrub 123) ;; shrub
(merc-l5-shrub 124) ;; merc
(emerc-l5-shrub 125) ;; emerc
(bucket-126 126) ;; mercneric
(gmerc-l5-shrub 126) ;; mercneric
(tex-l0-alpha 127) ;; tex
(tfrag-t-l0-alpha 128) ;; tfrag
@@ -180,7 +181,7 @@
(etie-t-l0-alpha 130) ;; tie
(merc-l0-alpha 131) ;; merc
(emerc-l0-alpha 132) ;; emerc
(bucket-133 133) ;; mercneric
(gmerc-l0-alpha 133) ;; mercneric
(tfrag-st-l0-alpha 134) ;; tfrag
(tie-st-l0-alpha 135) ;; tie
(etie-st-l0-alpha 136) ;; tie
@@ -191,7 +192,7 @@
(etie-t-l1-alpha 140) ;; tie
(merc-l1-alpha 141) ;; merc
(emerc-l1-alpha 142) ;; emerc
(bucket-143 143) ;; mercneric
(gmerc-l1-alpha 143) ;; mercneric
(tfrag-st-l1-alpha 144) ;; tfrag
(tie-st-l1-alpha 145) ;; tie
(etie-st-l1-alpha 146) ;; tie
@@ -202,7 +203,7 @@
(etie-t-l2-alpha 150) ;; tie
(merc-l2-alpha 151) ;; merc
(emerc-l2-alpha 152) ;; emerc
(bucket-153 153) ;; mercneric
(gmerc-l2-alpha 153) ;; mercneric
(tfrag-st-l2-alpha 154) ;; tfrag
(tie-st-l2-alpha 155) ;; tie
(etie-st-l2-alpha 156) ;; tie
@@ -213,7 +214,7 @@
(etie-t-l3-alpha 160) ;; tie
(merc-l3-alpha 161) ;; merc
(emerc-l3-alpha 162) ;; emerc
(bucket-163 163) ;; mercneric
(gmerc-l3-alpha 163) ;; mercneric
(tfrag-st-l3-alpha 164) ;; tfrag
(tie-st-l3-alpha 165) ;; tie
(etie-st-l3-alpha 166) ;; tie
@@ -224,7 +225,7 @@
(etie-t-l4-alpha 170) ;; tie
(merc-l4-alpha 171) ;; merc
(emerc-l4-alpha 172) ;; emerc
(bucket-173 173) ;; mercneric
(gmerc-l4-alpha 173) ;; mercneric
(tfrag-st-l4-alpha 174) ;; tfrag
(tie-st-l4-alpha 175) ;; tie
(etie-st-l4-alpha 176) ;; tie
@@ -235,7 +236,7 @@
(etie-t-l5-alpha 180) ;; tie
(merc-l5-alpha 181) ;; merc
(emerc-l5-alpha 182) ;; emerc
(bucket-183 183) ;; mercneric
(gmerc-l5-alpha 183) ;; mercneric
(tfrag-st-l5-alpha 184) ;; tfrag
(tie-st-l5-alpha 185) ;; tie
(etie-st-l5-alpha 186) ;; tie
@@ -243,88 +244,88 @@
(tex-lcom-tfrag 187) ;; tex
(merc-lcom-tfrag 188) ;; merc
(emerc-lcom-tfrag 189) ;; emerc
(bucket-190 190) ;; mercneric
(gmerc-lcom-tfrag 190) ;; mercneric
(tex-lcom-shrub 191) ;; tex
(merc-lcom-shrub 192) ;; merc
(emerc-lcom-shrub 193) ;; emerc
(bucket-194 194) ;; mercneric
(gmerc-lcom-shrub 194) ;; mercneric
(bucket-195 195) ;; shadow
(tex-l0-pris 196) ;; tex
(merc-l0-pris 197) ;; merc
(emerc-l0-pris 198) ;; emerc
(bucket-199 199) ;; mercneric
(gmerc-l0-pris 199) ;; mercneric
(tex-l1-pris 200) ;; tex
(merc-l1-pris 201) ;; merc
(emerc-l1-pris 202) ;; emerc
(bucket-203 203) ;; mercneric
(gmerc-l1-pris 203) ;; mercneric
(tex-l2-pris 204) ;; tex
(merc-l2-pris 205) ;; merc
(emerc-l2-pris 206) ;; emerc
(bucket-207 207) ;; mercneric
(gmerc-l2-pris 207) ;; mercneric
(tex-l3-pris 208) ;; tex
(merc-l3-pris 209) ;; merc
(emerc-l3-pris 210) ;; emerc
(bucket-211 211) ;; mercneric
(gmerc-l3-pris 211) ;; mercneric
(tex-l4-pris 212) ;; tex
(merc-l4-pris 213) ;; merc
(emerc-l4-pris 214) ;; emerc
(bucket-215 215) ;; mercneric
(gmerc-l4-pris 215) ;; mercneric
(tex-l5-pris 216) ;; tex
(merc-l5-pris 217) ;; merc
(emerc-l5-pris 218) ;; emerc
(bucket-219 219) ;; mercneric
(gmerc-l5-pris 219) ;; mercneric
(tex-lcom-pris 220) ;; tex
(merc-lcom-pris 221) ;; merc
(emerc-lcom-pris 222) ;; emerc
(bucket-223 223) ;; mercneric
(gmerc-lcom-pris 223) ;; mercneric
(tex-l0-pris2 224) ;; tex
(merc-l0-pris2 225) ;; merc
(emerc-l0-pris2 226) ;; emerc
(bucket-227 227) ;; mercneric
(gmerc-l0-pris2 227) ;; mercneric
(tex-l1-pris2 228) ;; tex
(merc-l1-pris2 229) ;; merc
(emerc-l1-pris2 230) ;; emerc
(bucket-231 231) ;; mercneric
(gmerc-l1-pris2 231) ;; mercneric
(tex-l2-pris2 232) ;; tex
(merc-l2-pris2 233) ;; merc
(emerc-l2-pris2 234) ;; emerc
(bucket-235 235) ;; mercneric
(gmerc-l2-pris2 235) ;; mercneric
(tex-l3-pris2 236) ;; tex
(merc-l3-pris2 237) ;; merc
(emerc-l3-pris2 238) ;; emerc
(bucket-239 239) ;; mercneric
(gmerc-l3-pris2 239) ;; mercneric
(tex-l4-pris2 240) ;; tex
(merc-l4-pris2 241) ;; merc
(emerc-l4-pris2 242) ;; emerc
(bucket-243 243) ;; mercneric
(gmerc-l4-pris2 243) ;; mercneric
(tex-l5-pris2 244) ;; tex
(merc-l5-pris2 245) ;; merc
(emerc-l5-pris2 246) ;; emerc
(bucket-247 247) ;; mercneric
(gmerc-l5-pris2 247) ;; mercneric
(tex-lcom-pris2 248) ;; tex
(merc-lcom-pris2 249) ;; merc
(emerc-lcom-pris2 250) ;; emerc
(bucket-251 251) ;; mercneric
(gmerc-lcom-pris2 251) ;; mercneric
(tex-l0-water 252) ;; tex
(merc-l0-water 253) ;; merc
(bucket-254 254) ;; mercneric
(gmerc-l0-water 254) ;; mercneric
(tfrag-w-l0-water 255) ;; tfrag
(tie-w-l0-water 256)
(etie-w-l0-water 257)
@@ -334,7 +335,7 @@
(tex-l1-water 261) ;; tex
(merc-l1-water 262) ;; merc
(bucket-263 263) ;; mercneric
(gmerc-l1-water 263) ;; mercneric
(tfrag-w-l1-water 264) ;; tfrag
(tie-w-l1-water 265)
(etie-w-l1-water 266)
@@ -344,7 +345,7 @@
(tex-l2-water 270) ;; tex
(merc-l2-water 271) ;; merc
(bucket-272 272) ;; mercneric
(gmerc-l2-water 272) ;; mercneric
(tfrag-w-l2-water 273) ;; tfrag
(tie-w-l2-water 274)
(etie-w-l2-water 275)
@@ -354,7 +355,7 @@
(tex-l3-water 279) ;; tex
(merc-l3-water 280) ;; merc
(bucket-281 281) ;; mercneric
(gmerc-l3-water 281) ;; mercneric
(tfrag-w-l3-water 282) ;; tfrag
(tie-w-l3-water 283)
(etie-w-l3-water 284)
@@ -364,7 +365,7 @@
(tex-l4-water 288) ;; tex
(merc-l4-water 289) ;; merc
(bucket-290 290) ;; mercneric
(gmerc-l4-water 290) ;; mercneric
(tfrag-w-l4-water 291) ;; tfrag
(tie-w-l4-water 292)
(etie-w-l4-water 293)
@@ -374,7 +375,7 @@
(tex-l5-water 297) ;; tex
(merc-l5-water 298) ;; merc
(bucket-299 299) ;; mercneric
(gmerc-l5-water 299) ;; mercneric
(tfrag-w-l5-water 300) ;; tfrag
(tie-w-l5-water 301)
(etie-w-l5-water 302)
@@ -384,7 +385,7 @@
(tex-lcom-water 306) ;; tex
(merc-lcom-water 307) ;; merc
(bucket-308 308) ;; mercneric
(gmerc-lcom-water 308) ;; mercneric
(tex-lcom-sky-post 309)
@@ -396,11 +397,11 @@
(bucket-314 314) ;; shadow
(bucket-315 315) ;; effects
(tex-all-warp 316) ;; tex
(bucket-317 317) ;; mercneric
(gmerc-warp 317) ;; mercneric
(debug-no-zbuf1 318) ;; debug, no zbuf
(tex-all-map 319) ;; tex
(bucket-320 320) ;; hud
(progress 320) ;; hud | progress
(screen-filter 321) ;; hud letterbox, no zbuf
(bucket-322 322) ;; hud
(bucket-323 323) ;; hud
@@ -409,6 +410,10 @@
(debug3 326)
)
(defenum bucket-id-16
:type int16
:copy-entries bucket-id
)
;; bit mask to select a renderer
(defenum vu1-renderer-mask
:type uint64
+2 -1
View File
@@ -28,7 +28,8 @@
(suspend)
)
(set! *display-profile* #t)
(set! *stats-profile-bars* #t))
;;(set! *stats-profile-bars* #t)
)
)
)
+4
View File
@@ -364,6 +364,10 @@
(.xor.vf vf18 vf18 vf18)
(.xor.vf vf23 vf23 vf23)
(.xor.vf vf19 vf19 vf19)
(.xor.vf vf3 vf3 vf3)
(.xor.vf vf4 vf4 vf4)
(.xor.vf vf5 vf5 vf5)
(init-vf0-vector)
(nop!)
(nop!)
+3
View File
@@ -7,3 +7,6 @@
;; DECOMP BEGINS
(defun nav-mesh-connect-from-ent ((arg0 entity-nav-mesh))
(none)
)
@@ -453,7 +453,7 @@
)
)
)
(draw-bone-lines (-> obj process))
; (draw-bone-lines (-> obj process))
0
(none)
)
@@ -578,6 +578,7 @@
)
)
:code (behavior ((arg0 string))
(format 0 "ART ERROR: ~A for ~A~%" arg0 self)
(if (-> self entity)
(logior! (-> self entity extra perm status) (entity-perm-status bit-1))
)
@@ -713,7 +714,7 @@
)
(set! (-> s2-0 level-index) (the-as uint (-> s3-0 index)))
)
(set! (-> s2-0 dma-add-func) nothing)
(set! (-> s2-0 dma-add-func) (the-as (function process-drawable draw-control symbol object none) nothing))
(set! (-> arg2 0) (the-as cspace-array (setup-cspace-and-add s2-0 (the-as art-joint-geo sv-16) 'process)))
(set! (-> s2-0 dma-add-func) dma-add-process-drawable)
(set! (-> s2-0 shadow-mask) (res-lump-value (-> arg0 entity) 'shadow-mask uint :time -1000000000.0))
@@ -1524,14 +1524,13 @@
(set! (-> v1-19 id) (the-as uint arg3))
(set! (-> v1-19 mode) 'ice)
(set! (-> v1-19 damage) 15.0)
(set! (-> v1-19 penetrate-using) (the-as uint (if (and (logtest? (focus-status dark) (-> self focus-status))
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) 32)
)
#xd0001
#x50001
)
)
(set! (-> v1-19 penetrate-using) (if (and (logtest? (focus-status dark) (-> self focus-status))
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) 32)
)
(penetrate touch dark-skin dark-bomb dark-giant)
(penetrate touch dark-skin dark-bomb)
)
)
(set! (-> a1-6 param 1) (the-as uint v1-19))
)
+1 -1
View File
@@ -159,7 +159,7 @@
(define-extern target-death (state symbol target))
(define-extern *float-mods* surface)
(define-extern target-send-attack (function process symbol touching-shapes-entry int int uint symbol :behavior target))
(define-extern target-send-attack (function process symbol touching-shapes-entry int int penetrate symbol :behavior target))
(define-extern target-powerup-effect (function symbol none :behavior target))
(define-extern target-load-wait (state target))
(define-extern target-board-start (state object target))
+12 -13
View File
@@ -214,13 +214,13 @@
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 711]
(defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 uint))
(defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 penetrate))
(local-vars
(sv-96 symbol)
(sv-100 touching-prims-entry)
(sv-128 touching-prims-entry)
(sv-176 touching-prims-entry)
(sv-224 uint)
(sv-224 penetrate)
(sv-240 int)
(sv-256 symbol)
(sv-272 symbol)
@@ -279,12 +279,11 @@
(set! (-> self control send-attack-time) (-> self clock frame-counter))
(send-event self 'hit arg1 arg0 arg2)
(set! arg0 (the process (and (and (logtest? (focus-status dark) (-> self focus-status))
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) 2)
)
arg0
)
)
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) 2)
)
arg0
) )
)
(when (the-as object arg0)
(when (and s4-0 (not s3-1) (-> self control danger-mode) (zero? (logand (-> s4-0 mask) (process-mask dark-effect))))
@@ -960,7 +959,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> (the-as fact-info-target (-> self fact-override)) shield-attack-id))
0
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
(set! (-> self control penetrate-using) s4-3)
@@ -981,7 +980,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> self darkjak attack-id))
0
(the-as uint #x10001)
(penetrate touch dark-skin)
)
)
(else
@@ -1432,7 +1431,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> (the-as fact-info-target (-> self fact-override)) shield-attack-id))
0
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
)
@@ -1453,7 +1452,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
(else
@@ -1527,7 +1526,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
(zero? (logand (-> self focus-status) (focus-status dead hit)))
)
+2 -2
View File
@@ -2098,7 +2098,7 @@
(the-as touching-shapes-entry (-> event param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
(set! (-> self gun combo-window-start) (-> self clock frame-counter))
(let ((v0-2 (the-as object (-> self state name))))
@@ -2354,7 +2354,7 @@
(the-as touching-shapes-entry (-> event param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
)
+15
View File
@@ -7,3 +7,18 @@
;; DECOMP BEGINS
;; stubs
(defmethod bigmap-method-14 bigmap ((obj bigmap))
(none)
)
(defmethod bigmap-method-15 bigmap ()
(none)
)
(defmethod initialize bigmap ((obj bigmap))
(format 0 "in init~%")
(none))
(define *bigmap* (new 'global 'bigmap))
+8
View File
@@ -6,3 +6,11 @@
;; dgos: ENGINE, GAME
;; DECOMP BEGINS
(defun hide-hud ((arg0 symbol))
(none)
)
(defun hud-hidden? ()
#t
)
@@ -88,7 +88,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-2
(the-as (pointer dma-tag) a3-1)
)
@@ -302,7 +302,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -326,7 +326,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -364,7 +364,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -388,7 +388,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -426,7 +426,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -450,7 +450,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -488,7 +488,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -512,7 +512,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -550,7 +550,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -574,7 +574,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -1331,7 +1331,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-1)
)
@@ -2425,7 +2425,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-9
(the-as (pointer dma-tag) a3-35)
)
@@ -2459,7 +2459,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-10
(the-as (pointer dma-tag) a3-36)
)
@@ -2496,7 +2496,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-12
(the-as (pointer dma-tag) a3-39)
)
@@ -2526,7 +2526,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-14
(the-as (pointer dma-tag) a3-41)
)
@@ -2558,7 +2558,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-16
(the-as (pointer dma-tag) a3-43)
)
@@ -3130,7 +3130,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s4-1
(the-as (pointer dma-tag) a3-1)
)
@@ -4469,7 +4469,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s4-0
(the-as (pointer dma-tag) a3-1)
)
@@ -4657,7 +4657,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-1
(the-as (pointer dma-tag) a3-1)
)
@@ -4710,7 +4710,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-1)
)
@@ -6832,7 +6832,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
sv-192
(the-as (pointer dma-tag) a3-6)
)
@@ -6947,7 +6947,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
sv-272
(the-as (pointer dma-tag) a3-13)
)
+1 -1
View File
@@ -1297,7 +1297,7 @@
;; WARN: Failed store: (s.w! (+ v1-8 12) 0) at op 20
(defun end-scan ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id bucket-320)
(bucket-id progress)
)
(hud-box-method-13 arg0 s5-0 arg1)
)
+42 -42
View File
@@ -336,48 +336,48 @@
(defun profile-mercneric-test ((arg0 bucket-id))
"Is this a mercneric bucket?"
(or (= arg0 (bucket-id bucket-16))
(= arg0 (bucket-id bucket-27))
(= arg0 (bucket-id bucket-38))
(= arg0 (bucket-id bucket-49))
(= arg0 (bucket-id bucket-60))
(= arg0 (bucket-id bucket-71))
(= arg0 (bucket-id bucket-81))
(= arg0 (bucket-id bucket-90))
(= arg0 (bucket-id bucket-99))
(= arg0 (bucket-id bucket-108))
(= arg0 (bucket-id bucket-117))
(= arg0 (bucket-id bucket-126))
(= arg0 (bucket-id bucket-133))
(= arg0 (bucket-id bucket-143))
(= arg0 (bucket-id bucket-153))
(= arg0 (bucket-id bucket-163))
(= arg0 (bucket-id bucket-173))
(= arg0 (bucket-id bucket-183))
(= arg0 (bucket-id bucket-190))
(= arg0 (bucket-id bucket-194))
(= arg0 (bucket-id bucket-199))
(= arg0 (bucket-id bucket-203))
(= arg0 (bucket-id bucket-207))
(= arg0 (bucket-id bucket-211))
(= arg0 (bucket-id bucket-215))
(= arg0 (bucket-id bucket-219))
(= arg0 (bucket-id bucket-223))
(= arg0 (bucket-id bucket-227))
(= arg0 (bucket-id bucket-231))
(= arg0 (bucket-id bucket-235))
(= arg0 (bucket-id bucket-239))
(= arg0 (bucket-id bucket-243))
(= arg0 (bucket-id bucket-247))
(= arg0 (bucket-id bucket-251))
(= arg0 (bucket-id bucket-254))
(= arg0 (bucket-id bucket-263))
(= arg0 (bucket-id bucket-272))
(= arg0 (bucket-id bucket-281))
(= arg0 (bucket-id bucket-290))
(= arg0 (bucket-id bucket-299))
(= arg0 (bucket-id bucket-308))
(= arg0 (bucket-id bucket-317))
(or (= arg0 (bucket-id gmerc-l0-tfrag))
(= arg0 (bucket-id gmerc-l1-tfrag))
(= arg0 (bucket-id gmerc-l2-tfrag))
(= arg0 (bucket-id gmerc-l3-tfrag))
(= arg0 (bucket-id gmerc-l4-tfrag))
(= arg0 (bucket-id gmerc-l5-tfrag))
(= arg0 (bucket-id gmerc-l0-shrub))
(= arg0 (bucket-id gmerc-l1-shrub))
(= arg0 (bucket-id gmerc-l2-shrub))
(= arg0 (bucket-id gmerc-l3-shrub))
(= arg0 (bucket-id gmerc-l4-shrub))
(= arg0 (bucket-id gmerc-l5-shrub))
(= arg0 (bucket-id gmerc-l0-alpha))
(= arg0 (bucket-id gmerc-l1-alpha))
(= arg0 (bucket-id gmerc-l2-alpha))
(= arg0 (bucket-id gmerc-l3-alpha))
(= arg0 (bucket-id gmerc-l4-alpha))
(= arg0 (bucket-id gmerc-l5-alpha))
(= arg0 (bucket-id gmerc-lcom-tfrag))
(= arg0 (bucket-id gmerc-lcom-shrub))
(= arg0 (bucket-id gmerc-l0-pris))
(= arg0 (bucket-id gmerc-l1-pris))
(= arg0 (bucket-id gmerc-l2-pris))
(= arg0 (bucket-id gmerc-l3-pris))
(= arg0 (bucket-id gmerc-l4-pris))
(= arg0 (bucket-id gmerc-l5-pris))
(= arg0 (bucket-id gmerc-lcom-pris))
(= arg0 (bucket-id gmerc-l0-pris2))
(= arg0 (bucket-id gmerc-l1-pris2))
(= arg0 (bucket-id gmerc-l2-pris2))
(= arg0 (bucket-id gmerc-l3-pris2))
(= arg0 (bucket-id gmerc-l4-pris2))
(= arg0 (bucket-id gmerc-l5-pris2))
(= arg0 (bucket-id gmerc-lcom-pris2))
(= arg0 (bucket-id gmerc-l0-water))
(= arg0 (bucket-id gmerc-l1-water))
(= arg0 (bucket-id gmerc-l2-water))
(= arg0 (bucket-id gmerc-l3-water))
(= arg0 (bucket-id gmerc-l4-water))
(= arg0 (bucket-id gmerc-l5-water))
(= arg0 (bucket-id gmerc-lcom-water))
(= arg0 (bucket-id gmerc-warp))
)
)
+64 -113
View File
@@ -628,6 +628,10 @@
"battle.gc"
"elec-gate.gc"
"cty-guard-turret-button.gc"
"enemy/guards/crimson-guard-level.gc"
"enemy/guards/guard-conversation.gc"
"enemy/guards/transport-level.gc"
)
(cgo "ENGINE.CGO" "engine.gd")
@@ -682,6 +686,8 @@
(copy-gos
"fort-entry-gate-ag"
"crimson-guard-ag"
"com-airlock-outer-ag"
)
;;;;;;;;;;;;;;;;;;;;;
@@ -804,7 +810,6 @@
(copy-gos
"citizen-fat-ag"
"citizen-norm-ag"
"crimson-guard-ag"
"citizen-chick-ag"
"hellcat-ag"
"carc-ag"
@@ -854,7 +859,6 @@
(copy-textures 1565 1577 1601 1614 1642)
(copy-gos
"com-airlock-outer-ag"
"ctyindb-vis"
)
@@ -994,7 +998,6 @@
;; (copy-gos
;; "fodder-ag"
;; "liftcat-ag"
;; "com-airlock-outer-ag"
;; "atoll-windmill-ag"
;; "turbine-ag"
;; "slider-ag"
@@ -1029,7 +1032,6 @@
;; "krew-lowres-ag"
;; "cboss-tractor-ag"
;; "krew-clone-ag"
;; "com-airlock-outer-ag"
;; "cboss-bomb-ag"
;; "cboss-elevator-ag"
;; "casboss-vis"
@@ -1054,7 +1056,6 @@
;; (copy-gos
;; "daxter-highres-ag"
;; "jak-highres-ag"
;; "com-airlock-outer-ag"
;; "air-train-ag"
;; "cpad-elevator-ag"
;; "particleman-ag"
@@ -1070,9 +1071,7 @@
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "levels/common/enemy/guards/crimson-guard-level.gc"
;; "levels/common/enemy/guards/guard-conversation.gc"
;; "levels/common/enemy/guards/transport-level.gc"
;;
;; "levels/landing_pad/roboguard-level.gc"
;; "levels/landing_pad/castle-texture.gc"
;; "levels/landing_pad/castle-obs.gc"
@@ -1084,7 +1083,6 @@
;; (copy-gos
;; "roboguard-ag"
;; "crimson-guard-ag"
;; "com-airlock-outer-ag"
;; "cas-rot-bridge-ag"
;; "cas-electric-fence-ag"
;; "cas-rot-blade-ag"
@@ -1151,7 +1149,6 @@
;; (copy-textures 2444 2445 2645 2644 2744 2791 2441)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "com-airlock-inner-ag"
;; "farm-chilirots-ag"
;; "farm-cabbage-ag"
@@ -1225,7 +1222,6 @@
;; (copy-textures 955 957 956 958 1019 1638)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "ctygenb-vis"
;; )
@@ -1284,7 +1280,6 @@
;; (copy-textures 1565 1577 1601 1614 1642)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "ctyindb-vis"
;; )
@@ -1368,7 +1363,6 @@
;; "crimson-guard-highres-ag"
;; "consite-bomb-elevator-ag"
;; "crimson-guard-lowres-ag"
;; "com-airlock-outer-ag"
;; "consite-silo-doors-ag"
;; "precursor-stone-ag"
;; "bomb-trigger-ag"
@@ -1416,7 +1410,6 @@
;; (copy-gos
;; "ctypal-baron-statue-broken-ag"
;; "com-airlock-outer-ag"
;; "com-airlock-inner-ag"
;; "water-anim-ctypal-ag"
;; "palace-door-ag"
@@ -1447,26 +1440,24 @@
;; "ctyport-vis"
;; )
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; CTB
;; ;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;
;; CTB
;;;;;;;;;;;;;;;;;;;;;
;; (cgo "CTB.DGO" "ctb.gd")
(cgo "CTB.DGO" "ctb.gd")
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "levels/city/slums/ctyslumb-part.gc"
;; )
(goal-src-sequence
""
:deps ("$OUT/obj/los-control.o")
"levels/city/slums/ctyslumb-part.gc"
)
;; (copy-textures 977 1308 978 1022 1647)
(copy-textures 977 1308 978 1022 1647)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "com-airlock-inner-ag"
;; "fort-entry-gate-ag"
;; "ctyslumb-vis"
;; )
(copy-gos
"com-airlock-inner-ag"
"ctyslumb-vis"
)
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; CTC
@@ -1483,7 +1474,6 @@
;; (copy-textures 1268 1303 1269 1023 1648)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "door-ag"
;; "ctyslumc-vis"
;; )
@@ -1680,9 +1670,6 @@
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "levels/common/enemy/guards/crimson-guard-level.gc"
;; "levels/common/enemy/guards/guard-conversation.gc"
;; "levels/common/enemy/guards/transport-level.gc"
;; "levels/dig/dig-digger.gc"
;; "levels/dig/dig-obs.gc"
;; "levels/dig/dig1-obs.gc"
@@ -1880,7 +1867,6 @@
;; "fort-robotank-top-ag"
;; "fort-elec-switch-ag"
;; "fort-roboscreen-ag"
;; "fort-entry-gate-ag"
;; "fort-robotank-sight-ag"
;; "fordumpa-vis"
;; )
@@ -1894,9 +1880,6 @@
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "levels/common/enemy/guards/crimson-guard-level.gc"
;; "levels/common/enemy/guards/guard-conversation.gc"
;; "levels/common/enemy/guards/transport-level.gc"
;; "levels/fortress/ammo_dump/fordumpb-obs.gc"
;; "levels/fortress/ammo_dump/fordumpb-part.gc"
;; "levels/fortress/fortress-obs.gc"
@@ -1916,54 +1899,49 @@
;; "fordumpb-vis"
;; )
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; FEA
;; ;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;
;; FEA
;;;;;;;;;;;;;;;;;;;;;
;; (cgo "FEA.DGO" "fea.gd")
(cgo "FEA.DGO" "fea.gd")
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "levels/common/enemy/guards/crimson-guard-level.gc"
;; "levels/common/enemy/guards/guard-conversation.gc"
;; "levels/common/enemy/guards/transport-level.gc"
;; "levels/fortress/exit/forexita-part.gc"
;; "levels/fortress/exit/forexita-obs.gc"
;; )
(goal-src-sequence
""
:deps ("$OUT/obj/los-control.o")
"levels/fortress/exit/forexita-part.gc"
"levels/fortress/exit/forexita-obs.gc"
)
;; (copy-textures 1580 1583 1581)
(copy-textures 1580 1583 1581)
;; (copy-gos
;; "jak-pole+0-ag"
;; "crimson-guard-ag"
;; "fort-lift-plat-ag"
;; "forexita-vis"
;; )
(copy-gos
"jak-pole+0-ag"
"fort-lift-plat-ag"
"forexita-vis"
)
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; FEB
;; ;;;;;;;;;;;;;;;;;;;;;
;; (cgo "FEB.DGO" "feb.gd")
(cgo "FEB.DGO" "feb.gd")
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "engine/target/target-tube.gc"
;; "levels/fortress/fortress-obs.gc"
;; "levels/fortress/exit/forexitb-part.gc"
;; )
(goal-src-sequence
""
:deps ("$OUT/obj/los-control.o")
"engine/target/target-tube.gc"
"levels/fortress/fortress-obs.gc"
"levels/fortress/exit/forexitb-part.gc"
)
;; (copy-textures 1584 1587 1585 1586 1712)
(copy-textures 1584 1587 1585 1586 1712)
;; (copy-gos
;; "jak-tube+0-ag"
;; "water-anim-fortress-ag"
;; "fort-trap-door-ag"
;; "fort-entry-gate-ag"
;; "forexitb-vis"
;; )
(copy-gos
"jak-tube+0-ag"
"water-anim-fortress-ag"
"fort-trap-door-ag"
"forexitb-vis"
)
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; FOB
@@ -1978,7 +1956,6 @@
;; "daxter-highres-ag"
;; "youngsamos-highres-ag"
;; "jak-highres-ag"
;; "crimson-guard-ag"
;; "crimson-guard-hover-ag"
;; "transport-ag"
;; "life-seed-ag"
@@ -1995,9 +1972,6 @@
""
:deps ("$OUT/obj/los-control.o")
"levels/common/enemy/spyder.gc"
"levels/common/enemy/guards/crimson-guard-level.gc"
"levels/common/enemy/guards/guard-conversation.gc"
"levels/common/enemy/guards/transport-level.gc"
"levels/common/enemy/hover/hover-formation-h.gc"
"levels/common/enemy/hover/hover-nav-control-h.gc"
"levels/common/enemy/hover/hover-enemy-h.gc"
@@ -2061,7 +2035,6 @@
;; "fort-robotank-top-ag"
;; "fort-roboscreen-ag"
;; "fort-missile-ag"
;; "fort-entry-gate-ag"
;; "fort-robotank-sight-ag"
;; "fort-dump-bomb-a-ag"
;; "particleman-ag"
@@ -2106,9 +2079,6 @@
;; "levels/common/enemy/hover/wasp.gc"
;; "levels/common/enemy/hover/crimson-guard-hover.gc"
;; "levels/common/enemy/hover/flamer.gc"
;; "levels/common/enemy/guards/crimson-guard-level.gc"
;; "levels/common/enemy/guards/guard-conversation.gc"
;; "levels/common/enemy/guards/transport-level.gc"
;; "levels/fortress/rescue/forresca-part.gc"
;; "levels/fortress/rescue/forresca-obs.gc"
;; )
@@ -2116,9 +2086,7 @@
;; (copy-textures 3190 3192 3191)
;; (copy-gos
;; "crimson-guard-ag"
;; "crimson-guard-hover-ag"
;; "fort-entry-gate-ag"
;; "cty-guard-turret-button-ag"
;; "fort-led-ag"
;; "forresca-vis"
@@ -2145,7 +2113,6 @@
;; (copy-gos
;; "spydroid-ag"
;; "fort-turret-ag"
;; "fort-entry-gate-ag"
;; "cty-guard-turret-button-ag"
;; "fort-elec-belt-ag"
;; "forrescb-vis"
@@ -2205,7 +2172,6 @@
;; "gun-dummy-b-ag"
;; "gun-cit-c-ag"
;; "gun-dummy-big-ag"
;; "fort-entry-gate-ag"
;; "hip-door-a-ag"
;; "yellow-barrel-ag"
;; "dark-barrel-ag"
@@ -2467,21 +2433,21 @@
;; "lcitylow"
;; )
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; LDJAKBRN
;; ;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;
;; LDJAKBRN
;;;;;;;;;;;;;;;;;;;;;
;; (cgo "LDJAKBRN.DGO" "ldjakbrn.gd")
(cgo "LDJAKBRN.DGO" "ldjakbrn.gd")
;; (copy-textures 2662 2657 3094)
(copy-textures 2662 2657 3094)
;; (copy-gos
;; "jak-highres-prison-ag"
;; "baron-highres-ag"
;; "prsn-daxter-plat-ag"
;; "jak-clothes-ag"
;; "ldjakbrn"
;; )
(copy-gos
"jak-highres-prison-ag"
"baron-highres-ag"
"prsn-daxter-plat-ag"
"jak-clothes-ag"
"ldjakbrn"
)
;; ;;;;;;;;;;;;;;;;;;;;;
;; ;; LERBRNGD
@@ -3195,7 +3161,6 @@
;; (copy-gos
;; "grunt-ag"
;; "citizen-norm-ag"
;; "crimson-guard-ag"
;; "predator-ag"
;; "flitter-ag"
;; "cara-ag"
@@ -3216,7 +3181,6 @@
;; (copy-gos
;; "roboguard-ag"
;; "citizen-norm-ag"
;; "crimson-guard-ag"
;; "citizen-chick-ag"
;; "hellcat-ag"
;; "carc-ag"
@@ -3339,7 +3303,6 @@
;; (copy-textures 1254 1256 1255 1253 1257 3470 1275)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "plat-buried-ag"
;; "plat-return-ag"
;; "water-anim-mountain-ag"
@@ -3638,7 +3601,6 @@
;; (copy-gos
;; "jak-pole+0-ag"
;; "pal-gun-turret-ag"
;; "com-airlock-outer-ag"
;; "pal-electric-fan-ag"
;; "pal-cable-nut-ag"
;; "pal-flip-step-ag"
@@ -3658,9 +3620,6 @@
;; (goal-src-sequence
;; ""
;; :deps ("$OUT/obj/los-control.o")
;; "levels/common/enemy/guards/crimson-guard-level.gc"
;; "levels/common/enemy/guards/guard-conversation.gc"
;; "levels/common/enemy/guards/transport-level.gc"
;; "levels/common/entities/sew-gunturret.gc"
;; "levels/palace/explore/palent-part.gc"
;; "levels/palace/pal-obs.gc"
@@ -3670,10 +3629,8 @@
;; (copy-gos
;; "jak-pole+0-ag"
;; "crimson-guard-ag"
;; "palent-turret-ag"
;; "pal-breakable-window-ag"
;; "com-airlock-outer-ag"
;; "pal-grind-ring-ag"
;; "pal-grind-ring-center-ag"
;; "pal-throne-door-ag"
@@ -3749,7 +3706,6 @@
;; (copy-textures 2360 2363 2361 2362 2521 2746)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "pal-prong-ag"
;; "pal-flip-step-ag"
;; "pal-lowrez-throne-ag"
@@ -3772,7 +3728,6 @@
;; (copy-textures 2371 2372 2692)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "com-airlock-inner-ag"
;; "com-elevator-ag"
;; "palshaft-vis"
@@ -3835,7 +3790,6 @@
;; "mech-ag"
;; "fodder-ag"
;; "ruins-bridge-ag"
;; "com-airlock-outer-ag"
;; "shield-gunner-ag"
;; "precipice-b-ag"
;; "ruins-precipice-ag"
@@ -3922,7 +3876,6 @@
;; (copy-textures 1133 1135 1134 3383)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "com-airlock-inner-ag"
;; "sew-elevator-ag"
;; "sewerb-vis"
@@ -4243,7 +4196,6 @@
;; (copy-textures 1372 1373 1458)
;; (copy-gos
;; "com-airlock-outer-ag"
;; "com-airlock-inner-ag"
;; "sew-elevator-ag"
;; "sewescb-vis"
@@ -4456,7 +4408,6 @@
;; "crocadog-highres-ag"
;; "kor-highres-ag"
;; "kid-highres-ag"
;; "com-airlock-outer-ag"
;; "tomb-mar-door-ag"
;; "com-elevator-ag"
;; "tombd-vis"
File diff suppressed because it is too large Load Diff
+55 -5
View File
@@ -366,6 +366,42 @@
:bounds (static-spherem 0 5 0 14)
)
; ;; failed to figure out what this is:
; (let ((a0-10 (new 'static 'skeleton-group
; :name "skel-com-airlock-outer"
; :extra #f
; :info #f
; :art-group-name "com-airlock-outer"
; :bounds (new 'static 'vector :y 20480.0 :w 57344.0)
; :version #x7
; )
; )
; )
; (set! (-> a0-10 jgeo) 0)
; (set! (-> a0-10 janim) 2)
; (set! (-> a0-10 mgeo 0) 1)
; (set! (-> a0-10 lod-dist 0) 4095996000.0)
; (add-to-loading-level a0-10)
; )
; ;; failed to figure out what this is:
; (let ((a0-11 (new 'static 'skeleton-group
; :name "skel-com-airlock-inner"
; :extra #f
; :info #f
; :art-group-name "com-airlock-inner"
; :bounds (new 'static 'vector :y 20480.0 :w 57344.0)
; :version #x7
; )
; )
; )
; (set! (-> a0-11 jgeo) 0)
; (set! (-> a0-11 janim) 2)
; (set! (-> a0-11 mgeo 0) 1)
; (set! (-> a0-11 lod-dist 0) 4095996000.0)
; (add-to-loading-level a0-11)
; )
(defstate close (com-airlock)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
@@ -827,6 +863,7 @@
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! com-airlock-outer ((obj com-airlock-outer) (arg0 entity-actor))
(stack-size-set! (-> obj main-thread) 1024)
(let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
@@ -891,6 +928,7 @@
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! com-airlock-inner ((obj com-airlock-inner) (arg0 entity-actor))
(stack-size-set! (-> obj main-thread) 1024)
(let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
@@ -952,11 +990,22 @@
(none)
)
(defskelgroup skel-fort-entry-gate fort-entry-gate fort-entry-gate-lod0-jg fort-entry-gate-idle-ja
((fort-entry-gate-lod0-mg (meters 999999)))
:bounds (static-spherem 0 3 0 10)
)
(let ((a0-20 (new 'static 'skeleton-group
:name "skel-fort-entry-gate"
:extra #f
:info #f
:art-group-name "fort-entry-gate"
:bounds (new 'static 'vector :y 12288.0 :w 40960.0)
:version #x7
)
)
)
(set! (-> a0-20 jgeo) 0)
(set! (-> a0-20 janim) 2)
(set! (-> a0-20 mgeo 0) 1)
(set! (-> a0-20 lod-dist 0) 4095996000.0)
(add-to-loading-level a0-20)
)
(deftype fort-entry-gate (com-airlock)
()
:heap-base #x100
@@ -968,6 +1017,7 @@
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! fort-entry-gate ((obj fort-entry-gate) (arg0 entity-actor))
(stack-size-set! (-> obj main-thread) 1024) ;; added
(let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
File diff suppressed because it is too large Load Diff
@@ -7,3 +7,413 @@
;; DECOMP BEGINS
;; definition of type fort-lift-plat
(deftype fort-lift-plat (plat)
((sound-time time-frame :offset-assert 328)
(last-val float :offset-assert 336)
)
:heap-base #xe0
:method-count-assert 38
:size-assert #x154
:flag-assert #x2600e00154
(:methods
(plat-anim-active () _type_ :state 37)
)
)
;; definition for method 3 of type fort-lift-plat
(defmethod inspect fort-lift-plat ((obj fort-lift-plat))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type plat inspect)))
(t9-0 obj)
)
(format #t "~2Tsound-time: ~D~%" (-> obj sound-time))
(format #t "~2Tlast-val: ~f~%" (-> obj last-val))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(let ((a0-2 (new 'static 'skeleton-group
:name "skel-fort-lift-plat"
:extra #f
:info #f
:art-group-name "fort-lift-plat"
:bounds (new 'static 'vector :y -8192.0 :z -32768.0 :w 61440.0)
:version #x7
)
)
)
(set! (-> a0-2 jgeo) 0)
(set! (-> a0-2 janim) 3)
(set! (-> a0-2 mgeo 0) 1)
(set! (-> a0-2 lod-dist 0) 4095996000.0)
(add-to-loading-level a0-2)
)
;; definition for method 30 of type fort-lift-plat
(defmethod get-art-group fort-lift-plat ((obj fort-lift-plat))
"@returns The associated [[art-group]]"
(art-group-get-by-name *level* "skel-fort-lift-plat" (the-as (pointer uint32) #f))
)
;; definition for method 32 of type fort-lift-plat
;; INFO: this function exists in multiple non-identical object files
;; WARN: Return type mismatch int vs none.
;; multiply defined
; (defmethod base-plat-method-32 fort-lift-plat ((obj fort-lift-plat))
; 0
; (none)
; )
;; failed to figure out what this is:
(defstate plat-idle (fort-lift-plat)
:virtual #t
:event (the-as (function process int symbol event-message-block object :behavior fort-lift-plat) #f)
)
;; failed to figure out what this is:
(defstate plat-anim-active (fort-lift-plat)
:virtual #t
:event (the-as (function process int symbol event-message-block object :behavior fort-lift-plat) #f)
:enter (behavior ()
(get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp)
(set! (-> self last-val) 0.0)
(set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0))
(none)
)
:trans (the-as (function none :behavior fort-lift-plat) plat-trans)
:code (behavior ()
(until #f
(let ((f30-0 (* (get-current-phase-no-mod (-> self sync)) (the float (+ (-> (ja-group) frames num-frames) -1)))))
(ja-no-eval :group! (ja-group) :num! (loop!) :frame-num f30-0)
(let ((f0-3 (* 0.5 (the float (+ (-> (ja-group) frames num-frames) -1)))))
(if (and (>= f30-0 f0-3) (< (-> self last-val) f0-3))
(sound-stop (-> self sound-id))
)
)
(set! (-> self last-val) f30-0)
)
(suspend)
)
#f
(none)
)
:post (behavior ()
(when (< (-> self sound-time) (-> self clock frame-counter))
(sound-stop (-> self sound-id))
(set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0))
)
(sound-play "fort-lift-plat" :id (-> self sound-id) :position (-> self root-override trans))
(plat-post)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-path-active (fort-lift-plat)
:virtual #t
:event (the-as (function process int symbol event-message-block object :behavior fort-lift-plat) #f)
:enter (behavior ()
(let ((t9-0 (-> (method-of-type plat plat-path-active) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self last-val) 0.0)
(set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0))
(none)
)
:trans (behavior ()
(set! (-> self path-pos) (get-norm! (-> self sync) 0))
(get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp)
(let ((f0-2 0.9999))
(if (and (>= (-> self path-pos) f0-2) (< (-> self last-val) f0-2))
(sound-stop (-> self sound-id))
)
)
(set! (-> self last-val) (-> self path-pos))
(plat-trans)
(none)
)
:code (the-as (function none :behavior fort-lift-plat) sleep-code)
:post (behavior ()
(when (< (-> self sound-time) (-> self clock frame-counter))
(sound-stop (-> self sound-id))
(set! (-> self sound-time) (get-timeframe-offset! (-> self sync) 0))
)
(sound-play "fort-lift-plat" :id (-> self sound-id) :position (-> self root-override trans))
(plat-post)
(none)
)
)
;; definition for method 27 of type fort-lift-plat
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod execute-effects fort-lift-plat ((obj fort-lift-plat))
"Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound"
(if (nonzero? (-> obj part))
(spawn-with-cspace (-> obj part) (-> obj node-list data 6))
)
(when (nonzero? (-> obj sound))
(set! (-> obj sound trans quad) (-> obj root-override trans quad))
(update! (-> obj sound))
)
(none)
)
;; definition for method 31 of type fort-lift-plat
;; WARN: Return type mismatch collide-shape-moving vs none.
(defmethod base-plat-method-31 fort-lift-plat ((obj fort-lift-plat))
"TODO - collision stuff"
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) cshape-reaction-default)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0)))
(set! (-> s5-0 total-prims) (the-as uint 6))
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 -16384.0 -49152.0 98304.0)
(set! (-> s5-0 root-prim) s4-0)
)
(pusher-init s5-0)
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-15 prim-core action) (collide-action solid rideable))
(set! (-> v1-15 transform-index) 7)
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 49152.0)
)
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-17 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-17 prim-core action) (collide-action solid))
(set! (-> v1-17 transform-index) 4)
(set-vector! (-> v1-17 local-sphere) -36864.0 0.0 -16384.0 32768.0)
)
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-19 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-19 prim-core action) (collide-action solid))
(set! (-> v1-19 transform-index) 4)
(set-vector! (-> v1-19 local-sphere) 36864.0 0.0 -16384.0 32768.0)
)
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 3) (the-as uint 0))))
(set! (-> v1-21 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-21 prim-core action) (collide-action solid))
(set! (-> v1-21 transform-index) 3)
(set-vector! (-> v1-21 local-sphere) -28672.0 -28672.0 -20480.0 24576.0)
)
(let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 4) (the-as uint 0))))
(set! (-> v1-23 prim-core collide-as) (collide-spec obstacle camera-blocker pusher))
(set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-23 prim-core action) (collide-action solid))
(set! (-> v1-23 transform-index) 3)
(set-vector! (-> v1-23 local-sphere) 28672.0 -28672.0 -20480.0 24576.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-26 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with))
)
(set! (-> obj root-override) s5-0)
)
(none)
)
;; definition for method 32 of type fort-lift-plat
;; INFO: this function exists in multiple non-identical object files
;; WARN: Return type mismatch sparticle-launch-control vs none.
(defmethod base-plat-method-32 fort-lift-plat ((obj fort-lift-plat))
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 618) obj))
(none)
)
;; definition for method 33 of type fort-lift-plat
;; WARN: Return type mismatch sound-id vs none.
(defmethod base-plat-method-33 fort-lift-plat ((obj fort-lift-plat))
(set! (-> obj root-override pause-adjust-distance) 327680.0)
(set! (-> obj sound-id) (new-sound-id))
(none)
)
;; definition for method 10 of type fort-lift-plat
(defmethod deactivate fort-lift-plat ((obj fort-lift-plat))
(sound-stop (-> obj sound-id))
((method-of-type plat deactivate) obj)
(none)
)
;; definition for method 36 of type fort-lift-plat
(defmethod plat-path-sync fort-lift-plat ((obj fort-lift-plat))
"If the `sync` period is greater than `0` then transition the state to [[plat::35]]
otherwise, [[plat::34]]
@see [[sync-eased]]"
(cond
((logtest? (-> obj path flags) (path-control-flag not-found))
(go (method-of-object obj plat-idle))
)
((logtest? (actor-option user18) (-> obj fact options))
(set! (-> obj path-pos) (res-lump-float (-> obj entity) 'initial-spline-pos))
(get-point-at-percent-along-path! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp)
(go (method-of-object obj plat-anim-active))
)
((> (-> obj sync period) 0)
(let ((a0-5 (-> obj skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4)))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity)
)
(go (method-of-object obj plat-path-active))
)
(else
(go (method-of-object obj plat-idle))
)
)
)
;; definition of type fort-claw
(deftype fort-claw (process-drawable)
((path-u float :offset-assert 200)
(path-dest float :offset-assert 204)
)
:heap-base #x50
:method-count-assert 22
:size-assert #xd0
:flag-assert #x16005000d0
(:methods
(idle () _type_ :state 20)
(pause () _type_ :state 21)
)
)
;; definition for method 3 of type fort-claw
(defmethod inspect fort-claw ((obj fort-claw))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~2Tpath-u: ~f~%" (-> obj path-u))
(format #t "~2Tpath-dest: ~f~%" (-> obj path-dest))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(let ((a0-18 (new 'static 'skeleton-group
:name "skel-fort-claw"
:extra #f
:info #f
:art-group-name "fort-claw"
:bounds (new 'static 'vector :y -106496.0 :z -16384.0 :w 143360.0)
:max-lod 1
:version #x7
)
)
)
(set! (-> a0-18 jgeo) 0)
(set! (-> a0-18 janim) 3)
(set! (-> a0-18 mgeo 0) 1)
(set! (-> a0-18 lod-dist 0) 81920.0)
(set! (-> a0-18 mgeo 1) 2)
(set! (-> a0-18 lod-dist 1) 4095996000.0)
(add-to-loading-level a0-18)
)
;; failed to figure out what this is:
(defstate idle (fort-claw)
:virtual #t
:code (the-as (function none :behavior fort-claw) sleep-code)
:post (behavior ()
(let ((f30-0 (seek (-> self path-u) (-> self path-dest) (* 0.04 (-> self clock seconds-per-frame)))))
(set! (-> self path-u) f30-0)
(let ((f0-4 (-> self path-dest)))
(when (= f30-0 f0-4)
(set! (-> self path-dest) (- 1.0 f0-4))
(go-virtual pause)
)
)
(get-point-at-percent-along-path! (-> self path) (-> self root trans) (ease-value-in-out f30-0 0.2) 'interp)
)
(ja-post)
(none)
)
)
;; failed to figure out what this is:
(defstate pause (fort-claw)
:virtual #t
:enter (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(none)
)
:trans (behavior ()
(if (>= (- (-> self clock frame-counter) (-> self state-time)) (seconds 2))
(go-virtual idle)
)
(none)
)
:code (the-as (function none :behavior fort-claw) sleep-code)
)
;; definition for method 11 of type fort-claw
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! fort-claw ((obj fort-claw) (arg0 entity-actor))
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-fort-claw" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f))
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> obj path-u) 0.0)
(set! (-> obj path-dest) 1.0)
(let ((a0-8 (-> obj skel root-channel 0)))
(set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3)))
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity)
)
(ja-post)
(go (method-of-object obj idle))
(none)
)
;; failed to figure out what this is:
(set-subtask-hook!
*game-info*
2
3
(lambda () (with-pp
(until #f
(sound-play "fortress-alarm")
(let ((gp-1 (-> pp clock frame-counter)))
(until (>= (- (-> pp clock frame-counter) gp-1) (seconds 1))
(suspend)
)
)
)
(the-as object #f)
)
)
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -7,3 +7,256 @@
;; DECOMP BEGINS
;; definition of type fort-trap-door
(deftype fort-trap-door (process-drawable)
((root-override collide-shape-moving :offset 128)
(notify-actor entity-actor :offset-assert 200)
)
:heap-base #x50
:method-count-assert 22
:size-assert #xcc
:flag-assert #x16005000cc
(:methods
(idle () _type_ :state 20)
(die () _type_ :state 21)
)
)
;; definition for method 3 of type fort-trap-door
(defmethod inspect fort-trap-door ((obj fort-trap-door))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-fort-trap-door fort-trap-door 0 2 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 5))
;; failed to figure out what this is:
(defskelgroup skel-fort-trap-door-explode fort-trap-door 3 5
((4 (meters 999999)))
:bounds (static-spherem 0 0 0 15)
)
;; definition for symbol *fort-trap-door-exploder-params*, type joint-exploder-static-params
(define *fort-trap-door-exploder-params*
(new 'static 'joint-exploder-static-params
:joints (new 'static 'boxed-array :type joint-exploder-static-joint-params
(new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1)
(new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1)
)
:collide-spec #x1
)
)
;; failed to figure out what this is:
(defstate idle (fort-trap-door)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as
object
(case event-type
(('attack)
(when (logtest? (-> (the-as attack-info (-> event param 1)) penetrate-using) (penetrate flop))
(go-virtual die)
#f
)
)
)
)
)
:code (the-as (function none :behavior fort-trap-door) sleep-code)
)
;; failed to figure out what this is:
(defstate die (fort-trap-door)
:virtual #t
:enter (behavior ()
(let ((v1-1 (-> self root-override root-prim)))
(set! (-> v1-1 prim-core collide-as) (collide-spec))
(set! (-> v1-1 prim-core collide-with) (collide-spec))
)
0
(sound-play "trapdoor")
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) (process->ppointer self))
(set! (-> a1-1 num-params) 0)
(set! (-> a1-1 message) 'trigger)
(let ((t9-2 send-event-function)
(v1-6 (-> self notify-actor))
)
(t9-2
(if v1-6
(-> v1-6 extra process)
)
a1-1
)
)
)
(none)
)
:code (behavior ()
((lambda ()
(with-pp
(sound-play "wcrate-break")
(let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 1))))
(let* ((s5-1 *target*)
(a0-4 (if (type? s5-1 process-focusable)
s5-1
)
)
)
(when a0-4
(set! (-> gp-1 fountain-rand-transv-lo quad) (-> (get-trans a0-4 0) quad))
(set! (-> gp-1 fountain-rand-transv-lo y) (+ -16384.0 (-> gp-1 fountain-rand-transv-lo y)))
)
)
(set! (-> gp-1 fountain-rand-transv-hi x) 24576.0)
(set! (-> gp-1 fountain-rand-transv-hi y) 81920.0)
(set! (-> gp-1 fountain-rand-transv-hi z) 12288.0)
(set! (-> gp-1 fountain-rand-transv-hi w) 32768.0)
(process-spawn
joint-exploder
(art-group-get-by-name *level* "skel-fort-trap-door-explode" (the-as (pointer uint32) #f))
5
gp-1
*fort-trap-door-exploder-params*
:to pp
)
)
)
)
)
(suspend)
(ja-channel-set! 0)
(let ((gp-0 (-> self clock frame-counter)))
(until (>= (- (-> self clock frame-counter) gp-0) (seconds 1))
(suspend)
)
)
(send-event self 'death-end)
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
(none)
)
:post (the-as (function none :behavior fort-trap-door) ja-post)
)
;; definition for method 11 of type fort-trap-door
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! fort-trap-door ((obj fort-trap-door) (arg0 entity-actor))
(let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-2 prim-core action) (collide-action solid))
(set! (-> v1-2 transform-index) 0)
(set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) v1-2)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-5 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with))
)
(set! (-> obj root-override) (the-as collide-shape-moving s4-0))
)
(set! (-> (the-as collide-shape-moving (-> obj root-override)) penetrated-by) (penetrate flop))
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-fort-trap-door" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0))
(let ((a0-14 (-> obj skel root-channel 0)))
(set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2)))
(set! (-> a0-14 frame-num) 0.0)
(joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity)
)
(transform-post)
(go (method-of-object obj idle))
(none)
)
;; definition of type water-anim-fortress
(deftype water-anim-fortress (water-anim)
()
:heap-base #x80
:method-count-assert 29
:size-assert #x100
:flag-assert #x1d00800100
)
;; definition for method 3 of type water-anim-fortress
(defmethod inspect water-anim-fortress ((obj water-anim-fortress))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type water-anim inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; definition for symbol ripple-for-water-anim-fortress, type ripple-wave-set
(define ripple-for-water-anim-fortress (new 'static 'ripple-wave-set
:count 3
:converted #f
:normal-scale 1.0
:wave (new 'static 'inline-array ripple-wave 4
(new 'static 'ripple-wave :scale 40.0 :xdiv 1 :speed 1.5)
(new 'static 'ripple-wave :scale 40.0 :xdiv -1 :zdiv 1 :speed 1.5)
(new 'static 'ripple-wave :scale 20.0 :xdiv 5 :zdiv 3 :speed 0.75)
(new 'static 'ripple-wave)
)
)
)
;; definition for method 24 of type water-anim-fortress
;; WARN: Return type mismatch ripple-wave-set vs none.
(defmethod art-init! water-anim-fortress ((obj water-anim-fortress))
"Initialize a [[water-anim]]'s [[skeleton-group]], joints and ambience."
(let ((t9-0 (method-of-type water-anim art-init!)))
(t9-0 obj)
)
(let ((v1-2 (new 'process 'ripple-control)))
(set! (-> obj draw ripple) v1-2)
(set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75)
(set! (-> v1-2 global-scale) 3072.0)
(set! (-> v1-2 close-fade-dist) 163840.0)
(set! (-> v1-2 far-fade-dist) 245760.0)
(set! (-> v1-2 waveform) ripple-for-water-anim-fortress)
)
(none)
)
@@ -5,5 +5,888 @@
;; name in dgo: prison-obs
;; dgos: PRI
(declare-type prsn-hang-cell process-drawable)
(define-extern prsn-hang-cell-init-by-other (function float none :behavior prsn-hang-cell))
;; DECOMP BEGINS
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(set! (-> *lightning-spec-id-table* 19) (new 'static 'lightning-spec
:name "lightning-darkjak-prison"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 0.2
:texture (new 'static 'texture-id :index #x84 :page #xc)
:reduction 0.42
:num-points 12
:box-size 1638.4
:merge-factor 0.6
:merge-count 2
:radius 819.2
:duration 30.0
:sound (static-sound-spec "stretched-zap")
)
)
;; failed to figure out what this is:
(set! (-> *lightning-spec-id-table* 20) (new 'static 'lightning-spec
:name "lightning-darkjak-prison-shock"
:flags (lightning-spec-flags lsf0)
:rand-func #x2
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 0.2
:texture (new 'static 'texture-id :index #x84 :page #xc)
:reduction 0.42
:num-points 32
:box-size 4096.0
:merge-factor 0.6
:merge-count 2
:radius 819.2
:duration 30.0
:duration-rand 150.0
:sound #f
)
)
;; definition for symbol *prsn-torture-lightning-joints*, type (array int32)
(define *prsn-torture-lightning-joints* (new 'static 'boxed-array :type int32 14 16 18 20))
;; definition for symbol *prsn-chair-shackle-lightning-joints*, type (array int32)
(define *prsn-chair-shackle-lightning-joints* (new 'static 'boxed-array :type int32 4 5 6 7))
;; definition for function dark-lightning-handler
;; INFO: Used lq/sq
;; WARN: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 195]
(defbehavior dark-lightning-handler process-drawable ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (sv-112 sparticle-launcher) (sv-160 vector) (sv-164 vector) (sv-176 lightning-spec))
(let ((s3-0 (new 'static 'vector4w :x -1))
(s4-0 (new 'static 'vector4w :x -1))
(s5-0 (command-get-process "jak-highres-prison" *target*))
)
(the-as
object
(cond
((= arg2 'lightning-claw)
(let ((s1-0 (command-get-process "prsn-chair-shackle" *target*))
(gp-1 (new 'stack-no-clear 'matrix))
(s2-0 *prsn-torture-lightning-joints*)
(s3-1
(rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (the-as int (-> s3-0 x)))
)
)
*prsn-chair-shackle-lightning-joints*
(let ((v1-7 (rand-vu-int-range-exclude
0
(+ (-> *prsn-chair-shackle-lightning-joints* length) -1)
(the-as int (-> s4-0 x))
)
)
)
(when s1-0
(set! (-> s4-0 x) v1-7)
(vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13))
(vector<-cspace! (-> gp-1 vector 1) (-> self node-list data (-> s2-0 s3-1)))
(vector<-cspace! (-> gp-1 vector 2) (-> self node-list data (+ (-> s2-0 s3-1) 1)))
(vector<-cspace! (-> gp-1 trans) (-> (the-as process-drawable s5-0) node-list data 8))
(dotimes (s5-1 3)
(process-spawn
lightning-tracker
:init lightning-tracker-init
(-> *lightning-spec-id-table* 19)
(the int (* 300.0 (rand-vu-float-range 1.0 2.0)))
lightning-probe-callback
#f
(+ (the-as uint gp-1) (* s5-1 16))
(+ (the-as uint gp-1) (* (+ s5-1 1) 16))
:to self
)
)
#f
)
)
)
)
((= arg2 'lightning-needle)
(let ((gp-2 (command-get-process "prsn-chair-shackle" *target*)))
*prsn-chair-shackle-lightning-joints*
(let ((v1-38 (rand-vu-int-range-exclude
0
(+ (-> *prsn-chair-shackle-lightning-joints* length) -1)
(the-as int (-> s4-0 x))
)
)
)
(when gp-2
(set! (-> s4-0 x) v1-38)
(let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8)))
(s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s5-0) node-list data 5)))
(s3-3 (get-process *default-dead-pool* lightning-tracker #x4000))
)
(when s3-3
(let ((t9-17 (method-of-type lightning-tracker activate)))
(t9-17
(the-as lightning-tracker s3-3)
self
(symbol->string (-> lightning-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((s2-2 run-function-in-process)
(s1-2 s3-3)
(s0-1 lightning-tracker-init)
)
(set! sv-176 (-> *lightning-spec-id-table* 19))
(let ((a3-4 (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))
(t0-1 lightning-probe-callback)
)
((the-as (function object object object object object object object object none) s2-2)
s1-2
s0-1
sv-176
a3-4
t0-1
gp-2
s4-2
s5-2
)
)
)
(-> s3-3 ppointer)
)
)
)
)
)
)
((= arg2 'lightning-shackle)
(let ((gp-3 (command-get-process "prsn-chair-shackle" *target*))
(s2-3 *prsn-torture-lightning-joints*)
(s5-3 *prsn-chair-shackle-lightning-joints*)
)
(when gp-3
(when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel)))
(let* ((v1-52 (-> s2-3 length))
(s1-3 (-> s5-3 length))
(s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (the-as int (-> s3-0 x))))
(s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (the-as int (-> s4-0 x))))
)
(set! sv-112 (-> *part-id-table* 179))
(set! (-> s3-0 x) s0-2)
(set! (-> s4-0 x) s1-4)
(set! sv-160 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s2-3 s0-2))))
(set! sv-164 (vector<-cspace!
(new 'stack-no-clear 'vector)
(-> (the-as process-drawable gp-3) node-list data (-> s5-3 s1-4))
)
)
)
(let ((s4-3 (process-spawn
lightning-tracker
:init lightning-tracker-init
(-> *lightning-spec-id-table* 19)
(the int (* 300.0 (rand-vu-float-range 1.0 2.0)))
lightning-probe-callback
self
sv-160
sv-164
:to gp-3
)
)
)
(when (and sv-112 s4-3)
(let ((v1-74 (get-field-spec-by-id sv-112 (sp-field-id spt-timer))))
(if v1-74
(set! (-> v1-74 initial-valuef) (the-as float (-> (the-as lightning-tracker (-> s4-3 0)) duration)))
)
)
(let ((t9-30 sp-launch-particles-var)
(a0-35 *sp-particle-system-2d*)
(a1-37 sv-112)
(a2-19 *launch-matrix*)
)
(set! (-> a2-19 trans quad) (-> sv-160 quad))
(t9-30 a0-35 a1-37 a2-19 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-31 sp-launch-particles-var)
(a0-36 *sp-particle-system-2d*)
(a1-38 sv-112)
(a2-20 *launch-matrix*)
)
(set! (-> a2-20 trans quad) (-> sv-164 quad))
(t9-31 a0-36 a1-38 a2-20 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
)
)
)
)
)
)
)
)
)
;; definition of type prsn-hang-cell
(deftype prsn-hang-cell (process-drawable)
((path-u float :offset-assert 200)
(path-du float :offset-assert 204)
)
:heap-base #x50
:method-count-assert 21
:size-assert #xd0
:flag-assert #x15005000d0
(:methods
(idle () _type_ :state 20)
)
)
;; definition for method 3 of type prsn-hang-cell
(defmethod inspect prsn-hang-cell ((obj prsn-hang-cell))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~2Tpath-u: ~f~%" (-> obj path-u))
(format #t "~2Tpath-du: ~f~%" (-> obj path-du))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-prsn-hang-cell prsn-hang-cell 0 2
((1 (meters 999999)))
:bounds (static-spherem 0 -9.5 0 10)
)
;; failed to figure out what this is:
(defstate idle (prsn-hang-cell)
:virtual #t
:code (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(let* ((f0-2 (* (/ 1.0 (-> self path-du)) (-> self path-u)))
(f0-3 (- f0-2 (* (the float (the int (/ f0-2 1.0))) 1.0)))
)
(ja-no-eval :group! (ja-group) :num! (loop!) :frame-num f0-3)
)
(until #f
(suspend)
(ja :num! (loop!))
)
#f
(none)
)
:post (behavior ()
(seek! (-> self path-u) 1.0 (* (-> self path-du) (-> self clock seconds-per-frame)))
(when (>= (-> self path-u) 1.0)
(set! (-> self path-u) 0.0)
(set! (-> self state-time) (-> self clock frame-counter))
)
(get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp)
(ja-post)
(none)
)
)
;; definition for method 11 of type prsn-hang-cell
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! prsn-hang-cell ((obj prsn-hang-cell) (arg0 entity-actor))
(with-pp
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-hang-cell" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f))
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> obj path-du) 0.01)
(let ((f0-2 (* 300.0 (/ 1.0 (-> obj path-du))))
(f1-3 (the float (-> pp clock frame-counter)))
)
(set! (-> obj path-u) (/ (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2)) f0-2))
)
(let* ((f30-0 (-> obj path-u))
(f28-0 8.0)
(f26-0 (/ 1.0 f28-0))
)
(dotimes (s5-2 (+ (the int f28-0) -1))
(+! f30-0 f26-0)
(process-spawn
prsn-hang-cell
(if (>= f30-0 1.0)
(+ -1.0 f30-0)
f30-0
)
:to obj
)
)
)
(go (method-of-object obj idle))
(none)
)
)
;; definition for function prsn-hang-cell-init-by-other
;; WARN: Return type mismatch object vs none.
(defbehavior prsn-hang-cell-init-by-other prsn-hang-cell ((arg0 float))
(set! (-> self root) (new 'process 'trsqv))
(initialize-skeleton
self
(the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-hang-cell" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self path) (new 'process 'path-control self 'path 0.0 (the-as entity #f) #f))
(logior! (-> self path flags) (path-control-flag display draw-line draw-point draw-text))
(set! (-> self path-u) arg0)
(set! (-> self path-du) 0.01)
(set! (-> self draw light-index) (the-as uint 10))
(go-virtual idle)
(none)
)
;; failed to figure out what this is:
(defskelgroup skel-warp-gate-b warp-gate-b 0 2
((1 (meters 999999)))
:bounds (static-spherem 0 3 0 4)
:origin-joint-index 3
)
;; definition of type warp-gate-b
(deftype warp-gate-b (warp-gate)
()
:heap-base #x80
:method-count-assert 26
:size-assert #x100
:flag-assert #x1a00800100
)
;; definition for method 3 of type warp-gate-b
(defmethod inspect warp-gate-b ((obj warp-gate-b))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type warp-gate inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; definition for method 23 of type warp-gate-b
;; WARN: Return type mismatch draw-control vs none.
(defmethod init-skel-and-collide warp-gate-b ((obj warp-gate-b))
(let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 penetrated-by) (penetrate))
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-2 prim-core action) (collide-action solid))
(set! (-> v1-2 transform-index) 3)
(set-vector! (-> v1-2 local-sphere) 0.0 -12288.0 0.0 16384.0)
(set! (-> s5-0 total-prims) (the-as uint 1))
(set! (-> s5-0 root-prim) v1-2)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-5 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with))
)
(set! (-> obj root-override) s5-0)
)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-warp-gate-b" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(none)
)
;; definition of type prsn-cell-door
(deftype prsn-cell-door (process-drawable)
((frame float :offset-assert 200)
(desired float :offset-assert 204)
)
:heap-base #x50
:method-count-assert 21
:size-assert #xd0
:flag-assert #x15005000d0
(:methods
(idle () _type_ :state 20)
)
)
;; definition for method 3 of type prsn-cell-door
(defmethod inspect prsn-cell-door ((obj prsn-cell-door))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~2Tframe: ~f~%" (-> obj frame))
(format #t "~2Tdesired: ~f~%" (-> obj desired))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-prsn-cell-door prsn-cell-door 0 2
((1 (meters 999999)))
:bounds (static-spherem -2.5 3.25 0 4.25)
:origin-joint-index 3
)
;; failed to figure out what this is:
(defstate idle (prsn-cell-door)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('open)
(set! (-> self desired) 1.0)
(format #t "open~%")
)
(('close)
(set! (-> self desired) 0.0)
(format #t "close~%")
)
)
)
:code (behavior ()
(until #f
(cond
((< (-> self frame) (-> self desired))
(+! (-> self frame) (* 0.075 (-> self clock seconds-per-frame)))
)
((< (-> self desired) (-> self frame))
(set! (-> self frame) (- (-> self frame) (* 0.075 (-> self clock seconds-per-frame))))
)
)
(set! (-> self frame) (fmax 0.0 (fmin 1.0 (-> self frame))))
(ja :num-func num-func-identity :frame-num (ja-aframe (-> self frame) 0))
(suspend)
)
#f
(none)
)
:post (the-as (function none :behavior prsn-cell-door) transform-post)
)
;; definition for method 11 of type prsn-cell-door
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! prsn-cell-door ((obj prsn-cell-door) (arg0 entity-actor))
(let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-2 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-2 prim-core action) (collide-action solid))
(set! (-> v1-2 transform-index) 3)
(set-vector! (-> v1-2 local-sphere) -10240.0 13312.0 0.0 17408.0)
(set! (-> s4-0 total-prims) (the-as uint 1))
(set! (-> s4-0 root-prim) v1-2)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-5 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with))
)
(set! (-> obj root) s4-0)
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-cell-door" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> obj frame) 0.0)
(set! (-> obj desired) 0.0)
(set! (-> obj draw light-index) (the-as uint 10))
(go (method-of-object obj idle))
(none)
)
;; definition of type prsn-vent-fan
(deftype prsn-vent-fan (process-drawable)
()
:heap-base #x50
:method-count-assert 21
:size-assert #xc8
:flag-assert #x15005000c8
(:methods
(idle () _type_ :state 20)
)
)
;; definition for method 3 of type prsn-vent-fan
(defmethod inspect prsn-vent-fan ((obj prsn-vent-fan))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-prsn-vent-fan prsn-vent-fan 0 3
((1 (meters 999999)))
:bounds (static-spherem -2.5 3.25 0 4.25)
:origin-joint-index 3
)
;; failed to figure out what this is:
(defstate idle (prsn-vent-fan)
:virtual #t
:code (behavior ()
(until #f
(ja-no-eval :group! (ja-group)
:num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
(none)
)
:post (the-as (function none :behavior prsn-vent-fan) ja-post)
)
;; definition for method 11 of type prsn-vent-fan
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! prsn-vent-fan ((obj prsn-vent-fan) (arg0 entity-actor))
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-vent-fan" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> obj draw light-index) (the-as uint 10))
(go (method-of-object obj idle))
(none)
)
;; definition of type prsn-torture
(deftype prsn-torture (process-drawable)
()
:heap-base #x50
:method-count-assert 21
:size-assert #xc8
:flag-assert #x15005000c8
(:methods
(idle () _type_ :state 20)
)
)
;; definition for method 3 of type prsn-torture
(defmethod inspect prsn-torture ((obj prsn-torture))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defstate idle (prsn-torture)
:virtual #t
:event dark-lightning-handler
:code (behavior ()
(until #f
(ja-no-eval :group! (ja-group)
:num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
(none)
)
:post (behavior ()
(transform-post)
(none)
)
)
;; definition for method 11 of type prsn-torture
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! prsn-torture ((obj prsn-torture) (arg0 entity-actor))
(let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player))))
(set! (-> s4-0 penetrated-by) (penetrate))
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0)))
(set! (-> s4-0 total-prims) (the-as uint 10))
(set! (-> s3-0 prim-core collide-as) (collide-spec pusher))
(set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 transform-index) 2)
(set-vector! (-> s3-0 local-sphere) 0.0 -14336.0 0.0 32768.0)
(set! (-> s4-0 root-prim) s3-0)
)
(pusher-init s4-0)
(let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 20) (the-as uint 0))))
(set! (-> v1-11 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-11 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-11 prim-core action) (collide-action solid))
(set! (-> v1-11 transform-index) 3)
(set-vector! (-> v1-11 local-sphere) 0.0 -10240.0 0.0 16384.0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 13) (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-13 prim-core action) (collide-action solid))
(set! (-> v1-13 transform-index) 10)
(set-vector! (-> v1-13 local-sphere) 0.0 -4096.0 0.0 10240.0)
)
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 12) (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-15 prim-core action) (collide-action solid))
(set! (-> v1-15 transform-index) 11)
(set-vector! (-> v1-15 local-sphere) 0.0 -5120.0 0.0 8192.0)
)
(let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 16) (the-as uint 0))))
(set! (-> v1-17 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-17 prim-core action) (collide-action solid))
(set! (-> v1-17 transform-index) 24)
(set-vector! (-> v1-17 local-sphere) 0.0 4096.0 0.0 10240.0)
)
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 15) (the-as uint 0))))
(set! (-> v1-19 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-19 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-19 prim-core action) (collide-action solid))
(set! (-> v1-19 transform-index) 25)
(set-vector! (-> v1-19 local-sphere) 0.0 -2662.4 0.0 6144.0)
)
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 14) (the-as uint 0))))
(set! (-> v1-21 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-21 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-21 prim-core action) (collide-action solid))
(set! (-> v1-21 transform-index) 27)
(set-vector! (-> v1-21 local-sphere) 0.0 -819.2 0.0 4096.0)
)
(let ((v1-23 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 19) (the-as uint 0))))
(set! (-> v1-23 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-23 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-23 prim-core action) (collide-action solid))
(set! (-> v1-23 transform-index) 51)
(set-vector! (-> v1-23 local-sphere) 0.0 4096.0 0.0 10240.0)
)
(let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 18) (the-as uint 0))))
(set! (-> v1-25 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-25 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-25 prim-core action) (collide-action solid))
(set! (-> v1-25 transform-index) 52)
(set-vector! (-> v1-25 local-sphere) 0.0 2457.6 0.0 6144.0)
)
(let ((v1-27 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 17) (the-as uint 0))))
(set! (-> v1-27 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-27 prim-core collide-with) (collide-spec jak player-list))
(set! (-> v1-27 prim-core action) (collide-action solid))
(set! (-> v1-27 transform-index) 54)
(set-vector! (-> v1-27 local-sphere) 0.0 819.2 0.0 4096.0)
)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(let ((v1-30 (-> s4-0 root-prim)))
(set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as))
(set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with))
)
(set! (-> obj root) s4-0)
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-torture" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> obj draw light-index) (the-as uint 10))
(go (method-of-object obj idle))
(none)
)
;; failed to figure out what this is:
(scene-method-16
(new 'static 'scene
:name "fortress-save-friends-res"
:extra #f
:info #f
:mask-to-clear #x1282000
:entity "scene-stage-49"
:art-group "scenecamera"
:anim "fortress-save-friends-res"
:parts 43
:command-list '((0 (kill "prsn-cell-door-3") (task-close! "fortress-save-friends-resolution") (fadein (frame-time-30 10)))
(75 (send-event "prsn-cell-door-2" 'open))
(75 (send-event "prsn-cell-door-1" 'open))
(75 (send-event "prsn-cell-door-4" 'open))
(1143 (apply <lambda at L2>))
(1189 (apply <lambda at L1>))
(2427 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))
(2445 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))
(2463 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))
(2485 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))
(2507 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))
(2549 (send-event "warp-gate-b-1" 'effect) (sound-play "warpgate-mov"))
(2550 (fadeout (frame-time-30 20)))
)
:cut-list '(47
76
130
189
253
448
496
522
555
624
768
893
954
977
1089
1143
1189
1328
1407
1463
1603
1718
1857
1983
2146
2206
2307
2390
)
:wait-ground-time (seconds 1)
:draw-target #f
:abort #t
:actor (new 'static 'boxed-array :type scene-actor
(new 'static 'scene-actor
:name "scenecamera"
:level #f
:art-group "skel-scenecamera"
:prefix ""
:draw-frames '((min max))
:scissor-frames '()
:camera 4
:shadow-flags -1
:shadow-volume-joint #f
)
(new 'static 'scene-actor
:name "sidekick-highres"
:level 'prison
:art-group "skel-sidekick-highres"
:prefix ""
:draw-frames '((min 2507))
:scissor-frames '()
:light-index #xa
:flags #x1
:shadow-flags -1
:shadow-volume-joint #f
)
(new 'static 'scene-actor
:name "jak-highres"
:level 'lprsncst
:art-group "skel-jak-highres"
:prefix ""
:draw-frames '((min 2427))
:scissor-frames '()
:light-index #xa
:flags #x1
:shadow-flags -1
:shadow-volume-joint #f
)
(new 'static 'scene-actor
:name "tess-highres"
:level 'lprsncst
:art-group "skel-tess-highres"
:prefix ""
:draw-frames '((min 2445))
:scissor-frames '()
:light-index #xa
:flags #x1
:shadow-flags -1
:shadow-volume-joint #f
)
(new 'static 'scene-actor
:name "samos-highres"
:level 'lprsncst
:art-group "skel-samos-highres"
:prefix ""
:draw-frames '((min 2146) (2206 2485))
:scissor-frames '()
:light-index #xa
:flags #x1
:shadow-flags -1
:shadow-volume-joint #f
)
(new 'static 'scene-actor
:name "youngsamos-highres"
:level 'lprsncst
:art-group "skel-youngsamos-highres"
:prefix ""
:draw-frames '((min 2146) (2206 2463))
:scissor-frames '()
:light-index #xa
:flags #x1
:shadow-flags -1
:shadow-volume-joint #f
)
(new 'static 'scene-actor
:name "prsn-cell-door"
:level 'prison
:art-group "skel-prsn-cell-door"
:prefix ""
:draw-frames '((min max))
:scissor-frames '()
:light-index #xa
:flags #x1
:shadow-flags -1
:shadow-volume-joint #f
)
)
:load-point-obj "prison-start"
:end-point-obj "vinroom-warp"
:borrow '((prison 0 lprsncst special))
:sfx-volume -1.0
:ambient-volume -1.0
:music-volume -1.0
:blackout-end #t
:peaceful #t
:music-delay 1500.0
:save #t
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -117,7 +117,7 @@ int main(int argc, char** argv) {
lg::info("OpenGOAL Compiler {}.{}", versions::GOAL_VERSION_MAJOR, versions::GOAL_VERSION_MINOR);
// Init REPL
ReplStatus status = ReplStatus::WANT_RELOAD;
ReplStatus status = ReplStatus::OK;
std::function<bool()> shutdown_callback = [&]() { return status == ReplStatus::WANT_EXIT; };
ReplServer repl_server(shutdown_callback, nrepl_port);
bool repl_server_ok = repl_server.init_server();
+20 -9
View File
@@ -858,9 +858,17 @@ bool setup_stack_bonus_ops(const AllocationInput& input,
int my_slot) {
auto& var = cache->vars.at(var_idx);
// loop over all possible instruction that might use this var
// bool successful = false;
// while (!successful) {
// we may retry, so don't add bonus ops until the end (
struct BonusToAdd {
StackOp::Op op;
int instr_idx = -1;
};
std::vector<BonusToAdd> bonus_ops;
loop_top:
bonus_ops.clear();
for (int instr_idx = var.first_live(); instr_idx <= var.last_live(); instr_idx++) {
// check out the instruction
auto& op = input.instructions.at(instr_idx);
@@ -945,19 +953,22 @@ loop_top:
bonus.store = is_written;
if (bonus.load || bonus.store) {
cache->stack_ops.at(instr_idx).ops.push_back(bonus);
if (bonus.load) {
cache->stats.num_spill_ops++;
}
if (bonus.store) {
cache->stats.num_spill_ops++;
}
bonus_ops.push_back(BonusToAdd{bonus, instr_idx});
}
}
// }
cache->stats.num_spilled_vars++;
for (auto& op : bonus_ops) {
if (op.op.load) {
cache->stats.num_spill_ops++;
}
if (op.op.store) {
cache->stats.num_spill_ops++;
}
cache->stack_ops.at(op.instr_idx).ops.push_back(op.op);
}
return true;
}
+934
View File
@@ -0,0 +1,934 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type joint-exploder-tuning
(deftype joint-exploder-tuning (structure)
((explosion uint64 :offset-assert 0)
(duration time-frame :offset-assert 8)
(gravity float :offset-assert 16)
(rot-speed float :offset-assert 20)
(bounds-inflate float :offset-assert 24)
(max-probe-width float :offset-assert 28)
(max-probe-height float :offset-assert 32)
(max-probe-depth float :offset-assert 36)
(fountain-rand-transv-lo vector :inline :offset-assert 48)
(fountain-rand-transv-hi vector :inline :offset-assert 64)
(away-from-focal-pt vector :inline :offset 48)
(away-from-rand-transv-xz-lo float :offset 64)
(away-from-rand-transv-xz-hi float :offset 68)
(away-from-rand-transv-y-lo float :offset 72)
(away-from-rand-transv-y-hi float :offset 76)
(hit-xz-reaction float :offset 80)
(hit-y-reaction float :offset 84)
)
:method-count-assert 9
:size-assert #x58
:flag-assert #x900000058
(:methods
(new (symbol type uint) _type_ 0)
)
)
;; definition for method 3 of type joint-exploder-tuning
(defmethod inspect joint-exploder-tuning ((obj joint-exploder-tuning))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'joint-exploder-tuning)
(format #t "~1Texplosion: ~D~%" (-> obj explosion))
(format #t "~1Tduration: ~D~%" (-> obj duration))
(format #t "~1Tgravity: ~f~%" (-> obj gravity))
(format #t "~1Trot-speed: ~f~%" (-> obj rot-speed))
(format #t "~1Tbounds-inflate: ~f~%" (-> obj bounds-inflate))
(format #t "~1Tmax-probe-width: ~f~%" (-> obj max-probe-width))
(format #t "~1Tmax-probe-height: ~f~%" (-> obj max-probe-height))
(format #t "~1Tmax-probe-depth: ~f~%" (-> obj max-probe-depth))
(format #t "~1Tfountain-rand-transv-lo: #<vector @ #x~X>~%" (-> obj fountain-rand-transv-lo))
(format #t "~1Tfountain-rand-transv-hi: #<vector @ #x~X>~%" (-> obj fountain-rand-transv-hi))
(format #t "~1Taway-from-focal-pt: #<vector @ #x~X>~%" (-> obj fountain-rand-transv-lo))
(format #t "~1Taway-from-rand-transv-xz-lo: ~f~%" (-> obj fountain-rand-transv-hi x))
(format #t "~1Taway-from-rand-transv-xz-hi: ~f~%" (-> obj fountain-rand-transv-hi y))
(format #t "~1Taway-from-rand-transv-y-lo: ~f~%" (-> obj fountain-rand-transv-hi z))
(format #t "~1Taway-from-rand-transv-y-hi: ~f~%" (-> obj fountain-rand-transv-hi w))
(format #t "~1Thit-xz-reaction: ~f~%" (-> obj hit-xz-reaction))
(format #t "~1Thit-y-reaction: ~f~%" (-> obj hit-y-reaction))
(label cfg-4)
obj
)
;; definition of type joint-exploder-static-joint-params
(deftype joint-exploder-static-joint-params (structure)
((joint-index int16 :offset-assert 0)
(parent-joint-index int16 :offset-assert 2)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type joint-exploder-static-joint-params
(defmethod inspect joint-exploder-static-joint-params ((obj joint-exploder-static-joint-params))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'joint-exploder-static-joint-params)
(format #t "~1Tjoint-index: ~D~%" (-> obj joint-index))
(format #t "~1Tparent-joint-index: ~D~%" (-> obj parent-joint-index))
(label cfg-4)
obj
)
;; definition of type joint-exploder-static-params
(deftype joint-exploder-static-params (basic)
((joints (array joint-exploder-static-joint-params) :offset-assert 4)
(collide-spec uint32 :offset-assert 8)
(art-level basic :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type joint-exploder-static-params
(defmethod inspect joint-exploder-static-params ((obj joint-exploder-static-params))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tjoints: ~A~%" (-> obj joints))
(format #t "~1Tcollide-spec: ~D~%" (-> obj collide-spec))
(format #t "~1Tart-level: ~A~%" (-> obj art-level))
(label cfg-4)
obj
)
;; definition of type joint-exploder-joint
(deftype joint-exploder-joint (structure)
((next int16 :offset-assert 0)
(prev int16 :offset-assert 2)
(joint-index int16 :offset-assert 4)
(mat matrix :inline :offset-assert 16)
(rmat matrix :inline :offset-assert 80)
(update-rmat matrix :inline :offset-assert 144)
(transv vector :inline :offset-assert 208)
(prev-pos vector :inline :offset-assert 224)
)
:method-count-assert 9
:size-assert #xf0
:flag-assert #x9000000f0
)
;; definition for method 3 of type joint-exploder-joint
(defmethod inspect joint-exploder-joint ((obj joint-exploder-joint))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'joint-exploder-joint)
(format #t "~1Tnext: ~D~%" (-> obj next))
(format #t "~1Tprev: ~D~%" (-> obj prev))
(format #t "~1Tjoint-index: ~D~%" (-> obj joint-index))
(format #t "~1Tmat: #<matrix @ #x~X>~%" (-> obj mat))
(format #t "~1Trmat: #<matrix @ #x~X>~%" (-> obj rmat))
(format #t "~1Tupdate-rmat: #<matrix @ #x~X>~%" (-> obj update-rmat))
(format #t "~1Ttransv: #<vector @ #x~X>~%" (-> obj transv))
(format #t "~1Tprev-pos: #<vector @ #x~X>~%" (-> obj prev-pos))
(label cfg-4)
obj
)
;; definition of type joint-exploder-joints
(deftype joint-exploder-joints (basic)
((num-joints int32 :offset-assert 4)
(joint joint-exploder-joint :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
(:methods
(new (symbol type joint-exploder-static-params) _type_ 0)
)
)
;; definition for method 3 of type joint-exploder-joints
(defmethod inspect joint-exploder-joints ((obj joint-exploder-joints))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tnum-joints: ~D~%" (-> obj num-joints))
(format #t "~1Tjoint[0] @ #x~X~%" (-> obj joint))
(label cfg-4)
obj
)
;; definition of type joint-exploder-list
(deftype joint-exploder-list (structure)
((head int32 :offset-assert 0)
(pre-moved? symbol :offset-assert 4)
(bbox-valid? symbol :offset-assert 8)
(probeless? basic :offset-assert 12)
(bbox bounding-box :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type joint-exploder-list
(defmethod inspect joint-exploder-list ((obj joint-exploder-list))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'joint-exploder-list)
(format #t "~1Thead: ~D~%" (-> obj head))
(format #t "~1Tpre-moved?: ~A~%" (-> obj pre-moved?))
(format #t "~1Tbbox-valid?: ~A~%" (-> obj bbox-valid?))
(format #t "~1Tprobeless?: ~A~%" (-> obj probeless?))
(format #t "~1Tbbox: #<bounding-box @ #x~X>~%" (-> obj bbox))
(label cfg-4)
obj
)
;; definition of type joint-exploder
(deftype joint-exploder (process-drawable)
((die-if-below-y float :offset-assert 200)
(die-if-beyond-xz-dist-sqrd float :offset-assert 204)
(joints joint-exploder-joints :offset-assert 208)
(static-params joint-exploder-static-params :offset-assert 212)
(anim art-joint-anim :offset-assert 216)
(scale-vector vector :inline :offset-assert 224)
(tuning joint-exploder-tuning :inline :offset-assert 240)
(lists joint-exploder-list 5 :inline :offset-assert 336)
)
:heap-base #x1c0
:method-count-assert 30
:size-assert #x240
:flag-assert #x1e01c00240
(:methods
(add-joint-to-list (_type_ joint-exploder-list int) int 20)
(update-bbox-for-joint (_type_ joint-exploder-list joint-exploder-joint) none 21)
(do-collision-response (_type_ joint-exploder-list) none 22)
(init-joint-list (_type_) none 23)
(remove-from-list-and-reset (_type_ joint-exploder-list int) int 24)
(final-adjust (_type_ joint-exploder-list int) int 25)
(integrate-and-kill (_type_ joint-exploder-list) none 26)
(remove-joint-from-list (_type_ joint-exploder-list int) int 27)
(adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28)
(adjust-bbox-for-limits (_type_ joint-exploder-list) none 29)
)
)
;; definition for method 3 of type joint-exploder
(defmethod inspect joint-exploder ((obj joint-exploder))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~2Tdie-if-below-y: ~f~%" (-> obj die-if-below-y))
(format #t "~2Tdie-if-beyond-xz-dist-sqrd: ~f~%" (-> obj die-if-beyond-xz-dist-sqrd))
(format #t "~2Tjoints: ~A~%" (-> obj joints))
(format #t "~2Tstatic-params: ~A~%" (-> obj static-params))
(format #t "~2Tanim: ~A~%" (-> obj anim))
(format #t "~2Tscale-vector: #<vector @ #x~X>~%" (-> obj scale-vector))
(format #t "~2Ttuning: #<joint-exploder-tuning @ #x~X>~%" (-> obj tuning))
(format #t "~2Tlists[5] @ #x~X~%" (-> obj lists))
(label cfg-4)
obj
)
;; definition for method 5 of type joint-exploder-joints
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of joint-exploder-joints ((obj joint-exploder-joints))
(the-as int (+ (-> obj type size) (* 240 (-> obj num-joints))))
)
;; definition for method 0 of type joint-exploder-joints
(defmethod new joint-exploder-joints ((allocation symbol) (type-to-make type) (arg0 joint-exploder-static-params))
(let* ((gp-0 (-> arg0 joints length))
(v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* 240 gp-0)))))
)
(set! (-> v0-0 num-joints) gp-0)
v0-0
)
)
;; definition for function joint-exploder-joint-callback
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun joint-exploder-joint-callback ((arg0 draw-control) (arg1 cspace-array) (arg2 joint-control))
(let ((s4-0 (-> arg0 process)))
(let ((s3-0 (-> (the-as joint-exploder s4-0) joints)))
(countdown (s2-0 (-> s3-0 num-joints))
(let* ((v1-3 (-> s3-0 joint s2-0))
(a0-5 (-> arg1 data (-> v1-3 joint-index) bone transform))
)
(matrix*! a0-5 (-> v1-3 rmat) (-> v1-3 mat))
)
)
)
(let ((s4-1 (&-> s4-0 stack 96)))
(countdown (s3-1 (-> arg1 length))
(let ((a2-2 (-> arg1 data s3-1 bone transform)))
(scale-matrix! a2-2 (the-as vector s4-1) a2-2)
)
)
)
)
(let ((s4-2 (new-stack-matrix0))
(f30-0 (-> arg0 bounds w))
)
(matrix-4x4-inverse! s4-2 (-> arg1 data 0 bone transform))
(set! (-> arg0 bounds w) 1.0)
(vector-matrix*! (-> arg0 bounds) (-> arg0 bounds) s4-2)
(set! (-> arg0 bounds w) f30-0)
)
0
(none)
)
;; definition for method 24 of type joint-exploder
;; INFO: Used lq/sq
(defmethod remove-from-list-and-reset joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(let ((v0-0 (remove-joint-from-list obj arg0 arg1)))
(let* ((v1-1 (-> obj joints))
(v1-2 (-> v1-1 joint arg1))
)
(set! (-> v1-2 mat quad 0) (the-as uint128 0))
(set! (-> v1-2 mat vector 1 quad) (the-as uint128 0))
(set! (-> v1-2 mat vector 2 quad) (the-as uint128 0))
(set! (-> v1-2 mat trans quad) (-> obj root trans quad))
)
v0-0
)
)
;; definition for method 27 of type joint-exploder
(defmethod remove-joint-from-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(let* ((v1-0 (-> obj joints))
(a2-1 (-> v1-0 joint arg1))
(a0-4 (-> a2-1 prev))
(v0-0 (-> a2-1 next))
)
(cond
((>= a0-4 0)
(set! (-> v1-0 joint a0-4 next) v0-0)
(if (>= v0-0 0)
(set! (-> v1-0 joint v0-0 prev) a0-4)
)
)
(else
(set! (-> arg0 head) v0-0)
(cond
((>= v0-0 0)
(let ((v1-2 (-> v1-0 joint v0-0)))
(set! (-> v1-2 prev) -1)
)
)
(else
(set! (-> arg0 bbox-valid?) #f)
)
)
)
)
v0-0
)
)
;; definition for method 20 of type joint-exploder
(defmethod add-joint-to-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(let* ((v1-0 (-> obj joints))
(a3-0 (-> v1-0 joint arg1))
(a0-4 (-> arg0 head))
)
(set! (-> arg0 head) arg1)
(set! (-> a3-0 prev) -1)
(set! (-> a3-0 next) a0-4)
(when (>= a0-4 0)
(set! (-> v1-0 joint a0-4 prev) arg1)
arg1
)
)
)
;; definition for method 21 of type joint-exploder
;; INFO: Used lq/sq
(defmethod update-bbox-for-joint joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint))
(let ((a1-1 (-> arg1 mat trans)))
(cond
((-> arg0 bbox-valid?)
(add-point! (-> arg0 bbox) a1-1)
)
(else
(set! (-> arg0 bbox-valid?) #t)
(set! (-> arg0 bbox min quad) (-> a1-1 quad))
(set! (-> arg0 bbox max quad) (-> a1-1 quad))
)
)
)
(add-point! (-> arg0 bbox) (-> arg1 prev-pos))
(none)
)
;; definition for method 28 of type joint-exploder
;; INFO: Used lq/sq
(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(local-vars
(sv-16 int)
(sv-32 int)
(sv-48 joint-exploder-joint)
(sv-64 int)
(sv-80 joint-exploder-joint)
(sv-96 int)
(sv-112 joint-exploder-joint)
)
(let ((s5-0 (the-as joint-exploder-list #f)))
(let ((v1-0 1))
(until (= v1-0 5)
(let ((a0-4 (-> obj lists v1-0)))
(when (< (-> a0-4 head) 0)
(set! s5-0 a0-4)
(goto cfg-6)
)
)
(+! v1-0 1)
)
)
(label cfg-6)
(cond
(s5-0
(set! (-> s5-0 pre-moved?) #t)
(set! (-> s5-0 bbox-valid?) #f)
)
(else
(set! s5-0 (the-as joint-exploder-list (-> obj lists)))
)
)
(set! (-> arg0 bbox-valid?) #f)
(let ((s2-0 (-> obj joints)))
(set! sv-32 (-> arg0 head))
(let ((s1-0 0)
(s0-0 0)
)
(let ((v1-7 arg1))
(cond
((zero? v1-7)
(let ((f30-0 (* 0.5 (+ (-> arg0 bbox min x) (-> arg0 bbox max x)))))
(while (>= sv-32 0)
(set! sv-48 (-> s2-0 joint sv-32))
(cond
((>= (-> sv-48 mat trans x) f30-0)
(set! sv-16 (remove-joint-from-list obj arg0 sv-32))
(add-joint-to-list obj s5-0 sv-32)
(set! sv-32 sv-16)
(update-bbox-for-joint obj s5-0 sv-48)
(+! s0-0 1)
)
(else
(update-bbox-for-joint obj arg0 sv-48)
(set! sv-32 (-> sv-48 next))
(+! s1-0 1)
)
)
)
)
)
((= v1-7 1)
(let ((f30-1 (* 0.5 (+ (-> arg0 bbox min y) (-> arg0 bbox max y)))))
(while (>= sv-32 0)
(set! sv-80 (-> s2-0 joint sv-32))
(cond
((>= (-> sv-80 mat trans y) f30-1)
(set! sv-64 (remove-joint-from-list obj arg0 sv-32))
(add-joint-to-list obj s5-0 sv-32)
(set! sv-32 sv-64)
(update-bbox-for-joint obj s5-0 sv-80)
(+! s0-0 1)
)
(else
(update-bbox-for-joint obj arg0 sv-80)
(set! sv-32 (-> sv-80 next))
(+! s1-0 1)
)
)
)
)
)
((= v1-7 2)
(let ((f30-2 (* 0.5 (+ (-> arg0 bbox min z) (-> arg0 bbox max z)))))
(while (>= sv-32 0)
(set! sv-112 (-> s2-0 joint sv-32))
(cond
((>= (-> sv-112 mat trans z) f30-2)
(set! sv-96 (remove-joint-from-list obj arg0 sv-32))
(add-joint-to-list obj s5-0 sv-32)
(set! sv-32 sv-96)
(update-bbox-for-joint obj s5-0 sv-112)
(+! s0-0 1)
)
(else
(update-bbox-for-joint obj arg0 sv-112)
(set! sv-32 (-> sv-112 next))
(+! s1-0 1)
)
)
)
)
)
)
)
(cond
((zero? s0-0)
(final-adjust obj arg0 arg1)
)
((zero? s1-0)
(if (not (-> s5-0 probeless?))
(final-adjust obj s5-0 arg1)
)
)
)
)
)
s5-0
)
)
;; definition for method 25 of type joint-exploder
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs int.
(defmethod final-adjust joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int))
(local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint))
(set! (-> arg0 bbox-valid?) #f)
(let ((s3-0 (-> obj joints))
(s2-0 (-> arg0 head))
)
(while (>= s2-0 0)
(set! sv-80 (-> s3-0 joint s2-0))
(let ((s1-0 (new 'stack-no-clear 'matrix))
(s0-0 (-> arg0 bbox-valid?))
)
(set! (-> s1-0 vector 0 quad) (-> arg0 bbox min quad))
(set! (-> s1-0 vector 1 quad) (-> arg0 bbox max quad))
(update-bbox-for-joint obj arg0 sv-80)
(let* ((v1-7 arg1)
(v1-8 (cond
((zero? v1-7)
(< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x)))
)
((= v1-7 1)
(< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y)))
)
((= v1-7 2)
(< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z)))
)
)
)
)
(when v1-8
(set! sv-48 (remove-joint-from-list obj arg0 s2-0))
(set! sv-64 (-> obj lists))
(add-joint-to-list obj (the-as joint-exploder-list sv-64) s2-0)
(set! s2-0 sv-48)
(update-bbox-for-joint obj (the-as joint-exploder-list sv-64) sv-80)
(set! (-> arg0 bbox-valid?) s0-0)
(set! (-> arg0 bbox min quad) (-> s1-0 vector 0 quad))
(set! (-> arg0 bbox max quad) (-> s1-0 vector 1 quad))
)
)
)
)
)
(the-as int #f)
)
;; definition for method 29 of type joint-exploder
;; WARN: Return type mismatch int vs none.
(defmethod adjust-bbox-for-limits joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?)))
(let ((a2-0 -1))
(cond
((< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x)))
(set! a2-0 0)
)
((< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y)))
(set! a2-0 1)
)
((< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z)))
(set! a2-0 2)
)
)
(when (>= a2-0 0)
(let ((a1-2 (adjust-bbox-for-limits-along-axis obj arg0 a2-0)))
(if (not (-> a1-2 probeless?))
(adjust-bbox-for-limits obj a1-2)
)
)
(adjust-bbox-for-limits obj arg0)
)
)
)
0
(none)
)
;; definition for method 26 of type joint-exploder
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod integrate-and-kill joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(with-pp
(set! (-> arg0 bbox-valid?) #f)
(set! (-> arg0 pre-moved?) #t)
(let ((s4-0 (-> obj joints))
(f30-0 (* (-> obj tuning gravity) (-> pp clock seconds-per-frame)))
(s3-0 (-> arg0 head))
)
(while (>= s3-0 0)
(let* ((s2-0 (-> s4-0 joint s3-0))
(s1-0 (-> s2-0 mat trans))
)
(set! (-> s2-0 prev-pos quad) (-> s1-0 quad))
(+! (-> s2-0 transv y) f30-0)
(vector-v+! s1-0 s1-0 (-> s2-0 transv))
(matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat))
(cond
((or (< (-> s1-0 y) (-> obj die-if-below-y))
(< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans)))
)
(set! s3-0 (remove-from-list-and-reset obj arg0 s3-0))
)
(else
(update-bbox-for-joint obj arg0 s2-0)
(set! s3-0 (-> s2-0 next))
)
)
)
)
)
0
(none)
)
)
;; definition for method 22 of type joint-exploder
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod do-collision-response joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list))
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
(set! (-> s5-0 collide-with) (the-as collide-spec (-> obj static-params collide-spec)))
(set! (-> s5-0 ignore-process0) obj)
(set! (-> s5-0 ignore-process1) #f)
(set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> s5-0 action-mask) (collide-action solid))
(mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32)
(fill-using-bounding-box *collide-cache* s5-0)
)
(let ((s5-1 (-> obj joints))
(v1-6 (-> arg0 head))
)
(while (>= v1-6 0)
(let ((s4-1 (-> s5-1 joint v1-6)))
(let ((s3-0 (-> s4-1 mat trans))
(s2-0 (new 'stack-no-clear 'collide-query))
)
(vector-! (-> s2-0 move-dist) s3-0 (-> s4-1 prev-pos))
(set! (-> s2-0 start-pos quad) (-> s4-1 prev-pos quad))
(let ((v1-11 s2-0))
(set! (-> v1-11 radius) 40.96)
(set! (-> v1-11 collide-with) (the-as collide-spec (-> obj static-params collide-spec)))
(set! (-> v1-11 ignore-process0) #f)
(set! (-> v1-11 ignore-process1) #f)
(set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-11 action-mask) (collide-action solid))
)
(when (>= (probe-using-line-sphere *collide-cache* s2-0) 0.0)
(set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad))
(let* ((v1-16 (-> s4-1 transv))
(f28-0 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z)))))
)
(vector-reflect! (-> s4-1 transv) (-> s4-1 transv) (-> s2-0 best-other-tri normal))
(let ((f30-0 (-> s4-1 transv y)))
(set! (-> s4-1 transv y) 0.0)
(vector-normalize! (-> s4-1 transv) (* f28-0 (-> obj tuning hit-xz-reaction)))
(set! (-> s4-1 transv y) (* f30-0 (-> obj tuning hit-y-reaction)))
)
)
(+! (-> s3-0 y) (* 40.96 (-> s2-0 best-other-tri normal y)))
(set! (-> s3-0 w) 1.0)
(matrix-lerp! (-> s4-1 update-rmat) (-> s4-1 update-rmat) *identity-matrix* 0.5)
)
)
(set! v1-6 (-> s4-1 next))
)
)
)
0
(none)
)
;; failed to figure out what this is:
(defstate joint-exploder-shatter (joint-exploder)
:enter (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(none)
)
:trans (behavior ()
(let* ((f0-1 (the float (- (-> self clock frame-counter) (-> self state-time))))
(f1-1 (- 1.0 (/ f0-1 (the float (-> self tuning duration)))))
(f0-3 (- 1.0 (/ f0-1 (* 0.75 (the float (-> self tuning duration))))))
)
(if (< f0-3 0.0)
(set! f0-3 0.0)
)
(set-vector! (-> self scale-vector) f1-1 f0-3 f1-1 1.0)
)
(dotimes (v1-11 5)
(set! (-> self lists v1-11 pre-moved?) #f)
)
(dotimes (gp-0 5)
(let ((s5-0 (-> self lists gp-0)))
(when (>= (-> s5-0 head) 0)
(when (not (-> s5-0 pre-moved?))
(integrate-and-kill self s5-0)
(if (nonzero? gp-0)
(adjust-bbox-for-limits self s5-0)
)
)
)
)
)
(let ((gp-1 (new 'stack-no-clear 'bounding-box)))
(let ((v1-29 (-> self root trans)))
(set! (-> gp-1 min quad) (-> v1-29 quad))
(set! (-> gp-1 max quad) (-> v1-29 quad))
)
(dotimes (s5-1 5)
(let ((s4-0 (-> self lists s5-1)))
(if (-> s4-0 bbox-valid?)
(add-box! gp-1 (-> s4-0 bbox))
)
(if (nonzero? s5-1)
(do-collision-response self s4-0)
)
)
)
(let ((s5-2 (-> self draw bounds)))
(vector-average! s5-2 (-> gp-1 min) (-> gp-1 max))
(set! (-> s5-2 w) (+ (vector-vector-distance s5-2 (-> gp-1 max)) (-> self tuning bounds-inflate)))
)
)
0
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> self clock frame-counter))
(until (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self tuning duration))
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior joint-exploder) ja-post)
)
;; definition for method 23 of type joint-exploder
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod init-joint-list joint-exploder ((obj joint-exploder))
(let ((gp-0 (-> obj joints)))
(dotimes (s4-0 (-> gp-0 num-joints))
(let ((v1-2 (-> obj static-params joints s4-0))
(s3-0 (-> gp-0 joint s4-0))
)
(let ((a0-6 (-> v1-2 parent-joint-index)))
(set! (-> s3-0 prev) (+ s4-0 -1))
(set! (-> s3-0 next) (+ s4-0 1))
(set! (-> s3-0 joint-index) (-> v1-2 joint-index))
(cond
((>= a0-6 0)
(if (zero? a0-6)
(set! a0-6 (-> v1-2 joint-index))
)
(let* ((a3-0 (-> (the-as process-drawable (-> obj parent 0)) node-list data a0-6 bone transform))
(a2-0 (-> s3-0 mat))
(v1-9 (-> a3-0 quad 0))
(a0-8 (-> a3-0 quad 1))
(a1-4 (-> a3-0 quad 2))
(a3-1 (-> a3-0 trans quad))
)
(set! (-> a2-0 quad 0) v1-9)
(set! (-> a2-0 quad 1) a0-8)
(set! (-> a2-0 quad 2) a1-4)
(set! (-> a2-0 trans quad) a3-1)
)
(matrix-identity! (-> s3-0 rmat))
)
(else
(let* ((a3-2 (-> obj node-list data (-> v1-2 joint-index) bone transform))
(a2-1 (-> s3-0 mat))
(v1-15 (-> a3-2 quad 0))
(a0-11 (-> a3-2 quad 1))
(a1-5 (-> a3-2 quad 2))
(a3-3 (-> a3-2 trans quad))
)
(set! (-> a2-1 quad 0) v1-15)
(set! (-> a2-1 quad 1) a0-11)
(set! (-> a2-1 quad 2) a1-5)
(set! (-> a2-1 trans quad) a3-3)
)
(matrix-identity! (-> s3-0 rmat))
)
)
)
(case (-> obj tuning explosion)
((1)
(vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> obj tuning fountain-rand-transv-lo))
(vector-normalize!
(-> s3-0 transv)
(rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y))
)
(+! (-> s3-0 transv y)
(rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w))
)
(set! (-> s3-0 transv w) 1.0)
)
(else
(let ((s0-0 (-> obj tuning fountain-rand-transv-lo))
(s1-1 (-> obj tuning fountain-rand-transv-hi))
)
(set-vector!
(-> s3-0 transv)
(rand-vu-float-range (-> s0-0 x) (-> s1-1 x))
(rand-vu-float-range (-> s0-0 y) (-> s1-1 y))
(rand-vu-float-range (-> s0-0 z) (-> s1-1 z))
1.0
)
)
)
)
(let* ((v1-21 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 transv) 1.0))
(s2-4 (vector-cross! (new 'stack-no-clear 'vector) v1-21 *up-vector*))
(s1-2 (new 'stack-no-clear 'quaternion))
)
(vector-normalize! s2-4 1.0)
(quaternion-vector-angle! s1-2 s2-4 (* 182.04445 (-> obj tuning rot-speed)))
(quaternion->matrix (-> s3-0 update-rmat) s1-2)
)
)
)
(when (nonzero? (-> gp-0 num-joints))
(let ((v1-32 (-> gp-0 joint (+ (-> gp-0 num-joints) -1))))
(set! (-> v1-32 next) -1)
)
(let ((v1-33 (-> obj lists 1)))
(set! (-> v1-33 head) 0)
(let ((s5-1 (-> v1-33 bbox)))
(let ((v1-34 (-> gp-0 joint 0 mat trans)))
(set! (-> s5-1 min quad) (-> v1-34 quad))
(set! (-> s5-1 max quad) (-> v1-34 quad))
)
(dotimes (s4-1 (-> gp-0 num-joints))
(add-point! s5-1 (the-as vector (+ (the-as uint (-> gp-0 joint 0 mat trans)) (* 240 s4-1))))
)
)
)
)
)
0
(none)
)
;; definition for method 7 of type joint-exploder
;; WARN: Return type mismatch process-drawable vs joint-exploder.
(defmethod relocate joint-exploder ((obj joint-exploder) (arg0 int))
(if (nonzero? (-> obj joints))
(&+! (-> obj joints) arg0)
)
(the-as joint-exploder ((method-of-type process-drawable relocate) obj arg0))
)
;; definition for function joint-exploder-init-by-other
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs none.
(defbehavior joint-exploder-init-by-other joint-exploder ((arg0 skeleton-group) (arg1 int) (arg2 joint-exploder-tuning) (arg3 joint-exploder-static-params))
(set! (-> self static-params) arg3)
(set! (-> self die-if-beyond-xz-dist-sqrd) 10485760000.0)
(mem-copy! (the-as pointer (-> self tuning)) (the-as pointer arg2) 88)
(set! (-> self joints) (new 'process 'joint-exploder-joints arg3))
(dotimes (v1-2 5)
(let ((a0-6 (-> self lists v1-2)))
(set! (-> a0-6 head) -1)
(set! (-> a0-6 bbox-valid?) #f)
(set! (-> a0-6 pre-moved?) #f)
(set! (-> a0-6 probeless?) #f)
)
)
(let ((v1-5 (-> self lists)))
(set! (-> v1-5 0 probeless?) (the-as basic #t))
)
(set! (-> self root) (new 'process 'trsqv))
(set! (-> self root trans quad) (-> (the-as process-drawable (-> self parent 0)) root trans quad))
(quaternion-copy! (-> self root quat) (-> (the-as process-drawable (-> self parent 0)) root quat))
(set! (-> self root scale quad) (-> (the-as process-drawable (-> self parent 0)) root scale quad))
(when (-> arg3 art-level)
(let ((a1-6 (entity-actor-from-level-name (the-as level (-> arg3 art-level)))))
(if a1-6
(process-entity-set! self a1-6)
)
)
)
(initialize-skeleton self arg0 (the-as pair 0))
(logior! (-> self skel status) (joint-control-status sync-math))
(set! (-> self anim) (the-as art-joint-anim (-> self draw art-group data arg1)))
(ja-channel-set! 1)
(ja :group! (-> self anim) :num! min)
(ja-post)
(init-joint-list self)
(set! (-> self die-if-below-y) (+ -102400.0 (-> self root trans y)))
(set! (-> self skel postbind-function) joint-exploder-joint-callback)
(go joint-exploder-shatter)
(none)
)
;; definition for method 0 of type joint-exploder-tuning
;; WARN: Return type mismatch structure vs joint-exploder-tuning.
(defmethod new joint-exploder-tuning ((allocation symbol) (type-to-make type) (arg0 uint))
(let ((t9-0 (method-of-type structure new))
(v1-1 type-to-make)
)
(-> type-to-make size)
(let ((v0-0 (the-as joint-exploder-tuning (t9-0 allocation v1-1))))
(set! (-> v0-0 explosion) arg0)
(set! (-> v0-0 duration) (seconds 2))
(set! (-> v0-0 gravity) -286720.0)
(set! (-> v0-0 rot-speed) 8.4)
(set! (-> v0-0 bounds-inflate) 16384.0)
(set! (-> v0-0 max-probe-width) 20480.0)
(set! (-> v0-0 max-probe-height) 24576.0)
(set! (-> v0-0 max-probe-depth) 20480.0)
(set! (-> v0-0 hit-xz-reaction) 0.75)
(set! (-> v0-0 hit-y-reaction) 0.7)
(cond
((zero? arg0)
(set-vector! (-> v0-0 fountain-rand-transv-lo) -81920.0 20480.0 -81920.0 1.0)
(set-vector! (-> v0-0 fountain-rand-transv-hi) 81920.0 61440.0 81920.0 1.0)
)
((= arg0 1)
(vector-reset! (-> v0-0 fountain-rand-transv-lo))
(set! (-> v0-0 fountain-rand-transv-hi x) 49152.0)
(set! (-> v0-0 fountain-rand-transv-hi y) 163840.0)
(set! (-> v0-0 fountain-rand-transv-hi z) 20480.0)
(set! (-> v0-0 fountain-rand-transv-hi w) 61440.0)
)
)
(the-as joint-exploder-tuning v0-0)
)
)
)
+1 -132
View File
@@ -133,138 +133,7 @@
)
;; definition for method 11 of type collide-mesh
;; INFO: Used lq/sq
(defmethod should-push-away-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float))
(local-vars
(v1-0 uint128)
(a0-1 uint128)
(a1-2 uint128)
(a1-3 uint128)
(a1-4 uint128)
(a1-7 pat-surface)
(a2-1 uint128)
(a2-2 uint128)
(a2-4 float)
(a2-5 float)
(a2-7 float)
(f0-0 float)
(f2-1 float)
(f3-0 float)
(f4-0 float)
)
(rlet ((Q :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf10 :class vf)
(vf11 :class vf)
(vf12 :class vf)
(vf13 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(vf8 :class vf)
(vf9 :class vf)
)
(init-vf0-vector)
(let ((s4-0 (new 'stack-no-clear 'spat-work)))
(nop!)
(let ((s3-0 arg0))
(.lvf vf3 (&-> arg2 quad))
(nop!)
(let ((s2-0 (-> obj num-tris)))
(.sub.w.vf vf12 vf3 vf3)
(nop!)
(.add.w.vf vf13 vf3 vf3)
(nop!)
(.ftoi.vf vf12 vf12)
(nop!)
(.ftoi.vf vf13 vf13)
(nop!)
(.mov v1-0 vf12)
(.svf (&-> s4-0 sphere-bbox4w min quad) vf12)
(.mov a0-1 vf13)
(.svf (&-> s4-0 sphere-bbox4w max quad) vf13)
(until (>= a2-7 f4-0)
(until (> f0-0 f2-1)
(until (>= f3-0 f2-1)
(label cfg-1)
(b! (zero? s2-0) cfg-10 :delay (set! a2-1 (-> s3-0 bbox4w min quad)))
(+! s2-0 -1)
(let ((a1-1 (-> s3-0 bbox4w max quad)))
(.pcgtw a2-2 a2-1 a0-1)
(nop!)
(.pcgtw a1-2 v1-0 a1-1)
)
(nop!)
(.por a1-3 a2-2 a1-2)
(nop!)
(.ppach a1-4 (the-as uint128 0) a1-3)
(nop!)
(let ((a1-5 (shl (the-as int a1-4) 16)))
(nop!)
(b! (nonzero? a1-5) cfg-1 :likely-delay (set! s3-0 (+ s3-0 96)))
)
(closest-pt-in-triangle (-> s4-0 intersect) arg2 (the-as matrix (-> s3-0 vertex)) (-> s3-0 normal))
(.lvf vf2 (&-> s4-0 intersect quad))
(.lvf vf3 (&-> arg2 quad))
(.lvf vf1 (&-> s3-0 normal quad))
(set! v1-0 (-> s4-0 sphere-bbox4w min quad))
(set! a0-1 (-> s4-0 sphere-bbox4w max quad))
(.sub.vf vf4 vf3 vf2)
(set! a1-7 (-> s3-0 pat))
(.mul.vf vf5 vf4 vf1)
(.lvf vf7 (&-> s3-0 vertex 0 quad))
(.mul.vf vf6 vf4 vf4)
(.lvf vf8 (&-> s3-0 vertex 1 quad))
(.mov.vf vf1 vf0 :mask #b1000)
(.lvf vf9 (&-> s3-0 vertex 2 quad))
(.add.x.vf vf5 vf5 vf5 :mask #b10)
(&+! s3-0 96)
(.add.y.vf vf6 vf6 vf6 :mask #b1)
(set! f3-0 arg3)
(.add.z.vf vf5 vf5 vf5 :mask #b10)
(.add.z.vf vf6 vf6 vf6 :mask #b1)
(.sqrt.vf Q vf6 :ftf #b0)
(.mov a2-4 vf5)
(set! f0-0 0.0)
(.wait.vf)
(let ((f1-0 (-> arg2 w)))
(.add.vf vf6 vf0 Q :mask #b1)
(.mov.vf vf10 vf6)
(b! (< (the-as int a2-4) 0) cfg-6 :likely-delay (.sub.vf vf10 vf0 vf10))
(label cfg-6)
(.mov a2-5 vf10)
(set! f2-1 (- a2-5 f1-0))
)
(.div.vf Q vf0 vf6 :fsf #b11 :ftf #b0)
)
)
(.wait.vf)
(nop!)
(.mul.vf vf11 vf4 Q)
(set! f4-0 0.707)
(.mul.vf vf5 vf11 vf1)
(.add.y.vf vf5 vf5 vf5 :mask #b1)
(.add.z.vf vf5 vf5 vf5 :mask #b1)
(.mov a2-7 vf5)
)
)
)
)
(set! arg3 f2-1)
(.svf (&-> arg1 vertex 0 quad) vf7)
(.svf (&-> arg1 vertex 1 quad) vf8)
(.svf (&-> arg1 vertex 2 quad) vf9)
(.svf (&-> arg1 intersect quad) vf2)
(.svf (&-> arg1 normal quad) vf1)
(b! #t cfg-1 :delay (set! (-> arg1 pat) a1-7))
(label cfg-10)
arg3
)
)
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for method 14 of type collide-mesh
;; ERROR: function was not converted to expressions. Cannot decompile.
+1 -1
View File
@@ -234,7 +234,7 @@
(new (symbol type collide-shape uint int) _type_ 0)
(debug-draw (_type_) none 9)
(add-fg-prim-using-box (_type_ collide-cache) none 10)
(add-fg-prim-using-line-sphere () none 11)
(add-fg-prim-using-line-sphere (_type_ collide-cache object) none 11)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 12)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 13)
(collide-shape-prim-method-14 () none 14)
+40 -40
View File
@@ -563,46 +563,46 @@
;; definition of type draw-control
(deftype draw-control (basic)
((process process-drawable :offset-assert 4)
(status draw-control-status :offset-assert 8)
(data-format draw-control-data-format :offset-assert 10)
(global-effect draw-control-global-effect :offset-assert 11)
(art-group art-group :offset-assert 12)
(jgeo art-joint-geo :offset-assert 16)
(mgeo merc-ctrl :offset-assert 20)
(dma-add-func function :offset-assert 24)
(skeleton skeleton :offset-assert 28)
(lod-set lod-set :inline :offset-assert 32)
(max-lod int8 :offset 80)
(force-lod int8 :offset-assert 81)
(cur-lod int8 :offset-assert 82)
(desired-lod int8 :offset-assert 83)
(ripple ripple-control :offset-assert 84)
(longest-edge meters :offset-assert 88)
(longest-edge? uint32 :offset 88)
(light-index uint8 :offset-assert 92)
(shadow-mask uint8 :offset-assert 93)
(level-index uint8 :offset-assert 94)
(death-draw-overlap uint8 :offset-assert 95)
(death-timer uint8 :offset-assert 96)
(death-timer-org uint8 :offset-assert 97)
(death-vertex-skip uint16 :offset-assert 98)
(death-effect uint32 :offset-assert 100)
(shadow shadow-geo :offset-assert 104)
(shadow-ctrl shadow-control :offset-assert 108)
(distance meters :offset-assert 112)
(origin vector :inline :offset-assert 128)
(bounds vector :inline :offset-assert 144)
(radius meters :offset 156)
(color-mult rgbaf :inline :offset-assert 160)
(color-emissive rgbaf :inline :offset-assert 176)
(effect-mask uint64 :offset-assert 192)
(seg-mask uint64 :offset-assert 200)
(origin-joint-index uint8 :offset-assert 208)
(shadow-joint-index uint8 :offset-assert 209)
(force-fade uint8 :offset-assert 210)
(default-texture-page uint8 :offset-assert 211)
(shadow-values uint32 :offset-assert 212)
((process process-drawable :offset-assert 4)
(status draw-control-status :offset-assert 8)
(data-format draw-control-data-format :offset-assert 10)
(global-effect draw-control-global-effect :offset-assert 11)
(art-group art-group :offset-assert 12)
(jgeo art-joint-geo :offset-assert 16)
(mgeo merc-ctrl :offset-assert 20)
(dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24)
(skeleton skeleton :offset-assert 28)
(lod-set lod-set :inline :offset-assert 32)
(max-lod int8 :offset 80)
(force-lod int8 :offset-assert 81)
(cur-lod int8 :offset-assert 82)
(desired-lod int8 :offset-assert 83)
(ripple ripple-control :offset-assert 84)
(longest-edge meters :offset-assert 88)
(longest-edge? uint32 :offset 88)
(light-index uint8 :offset-assert 92)
(shadow-mask uint8 :offset-assert 93)
(level-index uint8 :offset-assert 94)
(death-draw-overlap uint8 :offset-assert 95)
(death-timer uint8 :offset-assert 96)
(death-timer-org uint8 :offset-assert 97)
(death-vertex-skip uint16 :offset-assert 98)
(death-effect uint32 :offset-assert 100)
(shadow shadow-geo :offset-assert 104)
(shadow-ctrl shadow-control :offset-assert 108)
(distance meters :offset-assert 112)
(origin vector :inline :offset-assert 128)
(bounds vector :inline :offset-assert 144)
(radius meters :offset 156)
(color-mult rgbaf :inline :offset-assert 160)
(color-emissive rgbaf :inline :offset-assert 176)
(effect-mask uint64 :offset-assert 192)
(seg-mask uint64 :offset-assert 200)
(origin-joint-index uint8 :offset-assert 208)
(shadow-joint-index uint8 :offset-assert 209)
(force-fade uint8 :offset-assert 210)
(default-texture-page uint8 :offset-assert 211)
(shadow-values uint32 :offset-assert 212)
)
:method-count-assert 15
:size-assert #xd8
+1 -1
View File
@@ -295,7 +295,7 @@
(prev-state state :offset-assert 124)
(id uint32 :offset-assert 128)
(count uint32 :offset-assert 132)
(penetrate-using uint64 :offset-assert 136)
(penetrate-using penetrate :offset-assert 136)
(damage float :offset-assert 144)
(shield-damage float :offset-assert 148)
(knock uint8 :offset-assert 152)
+1 -1
View File
@@ -1946,7 +1946,7 @@
)
(when (< (mod (-> *display* real-clock frame-counter) 300) 270)
(with-dma-buffer-add-bucket ((s5-3 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id bucket-320)
(bucket-id progress)
)
(hud-sprite-method-9 (-> self icon) s5-3 (-> self level))
)
+32 -31
View File
@@ -3,9 +3,9 @@
;; definition of type bone-buffer
(deftype bone-buffer (structure)
((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0)
(bone bone 16 :inline :offset-assert 1024)
(_pad uint8 2048 :offset-assert 2304)
((joint matrix 16 :inline :offset-assert 0)
(bone bone 16 :inline :offset-assert 1024)
(output pris-mtx 16 :inline :offset-assert 2304)
)
:method-count-assert 9
:size-assert #x1100
@@ -21,18 +21,18 @@
(format #t "[~8x] ~A~%" obj 'bone-buffer)
(format #t "~1Tjoint[16] @ #x~X~%" (-> obj joint))
(format #t "~1Tbone[16] @ #x~X~%" (-> obj bone))
(format #t "~1Toutput[16] @ #x~X~%" (-> obj _pad))
(format #t "~1Toutput[16] @ #x~X~%" (-> obj output))
(label cfg-4)
obj
)
;; definition of type bone-layout
(deftype bone-layout (structure)
((data uint16 8 :offset-assert 0)
(joint joint 2 :offset 0)
(bone bone 2 :offset 8)
(output uint32 2 :offset 16)
(unused uint32 2 :offset 24)
((data uint16 8 :offset-assert 0)
(joint (inline-array matrix) 2 :offset 0)
(bone (inline-array bone) 2 :offset 8)
(output (inline-array pris-mtx) 2 :offset 16)
(unused uint32 2 :offset 24)
)
:method-count-assert 9
:size-assert #x20
@@ -57,15 +57,15 @@
;; definition of type bone-regs
(deftype bone-regs (structure)
((dma-buf basic :offset-assert 0)
(wait-count uint32 :offset-assert 4)
(in-count uint32 :offset-assert 8)
(sp-size uint32 :offset-assert 12)
(sp-bufnum uint32 :offset-assert 16)
(joint-ptr (inline-array joint) :offset-assert 20)
(bone-ptr (inline-array bone) :offset-assert 24)
(num-bones uint32 :offset-assert 28)
(mtxs uint32 :offset-assert 32)
((dma-buf basic :offset-assert 0)
(wait-count uint32 :offset-assert 4)
(in-count uint32 :offset-assert 8)
(sp-size uint32 :offset-assert 12)
(sp-bufnum uint32 :offset-assert 16)
(joint-ptr (inline-array joint) :offset-assert 20)
(bone-ptr (inline-array bone) :offset-assert 24)
(num-bones uint32 :offset-assert 28)
(mtxs (inline-array pris-mtx) :offset-assert 32)
)
:method-count-assert 9
:size-assert #x24
@@ -163,19 +163,20 @@
;; definition of type bone-calculation
(deftype bone-calculation (structure)
((flags bone-calc-flags :offset-assert 0)
(num-bones uint16 :offset-assert 2)
(matrix-area (inline-array matrix) :offset-assert 4)
(joints (inline-array joint) :offset-assert 8)
(bones (inline-array bone) :offset-assert 12)
(ripple-scale float :offset-assert 16)
(ripple-y-scale float :offset-assert 20)
(ripple-normal-scale float :offset-assert 24)
(ripple-area (inline-array vector) :offset-assert 28)
(next bone-calculation :offset-assert 32)
(dummy-1 uint32 :offset-assert 36)
(dummy-2 uint32 :offset-assert 40)
(dummy-3 uint32 :offset-assert 44)
((flags bone-calc-flags :offset-assert 0)
(num-bones uint16 :offset-assert 2)
(matrix-area (inline-array pris-mtx) :offset-assert 4)
(joints (inline-array joint) :offset-assert 8)
(bones (inline-array bone) :offset-assert 12)
(ripple-scale float :offset-assert 16)
(ripple-y-scale float :offset-assert 20)
(ripple-normal-scale float :offset-assert 24)
(ripple-area (inline-array vector) :offset-assert 28)
(ripple-vec vector :inline :offset 16)
(next bone-calculation :offset-assert 32)
(dummy-1 uint32 :offset-assert 36)
(dummy-2 uint32 :offset-assert 40)
(dummy-3 uint32 :offset-assert 44)
)
:method-count-assert 9
:size-assert #x30
+341
View File
@@ -0,0 +1,341 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type bone-calculation-list
(deftype bone-calculation-list (structure)
((first bone-calculation :offset-assert 0)
(next bone-calculation :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type bone-calculation-list
(defmethod inspect bone-calculation-list ((obj bone-calculation-list))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'bone-calculation-list)
(format #t "~1Tfirst: #<bone-calculation @ #x~X>~%" (-> obj first))
(format #t "~1Tnext: #<bone-calculation @ #x~X>~%" (-> obj next))
(label cfg-4)
obj
)
;; definition for symbol *bone-calculation-list*, type bone-calculation-list
(define *bone-calculation-list* (new 'global 'bone-calculation-list))
;; definition for function bone-list-init
;; WARN: Return type mismatch int vs none.
(defun bone-list-init ()
(let ((v1-0 *bone-calculation-list*))
(set! (-> v1-0 first) (the-as bone-calculation 0))
(set! (-> v1-0 next) (the-as bone-calculation 0))
)
0
0
(none)
)
;; failed to figure out what this is:
(bone-list-init)
;; definition for symbol bones-vu0-block, type vu-function
(define bones-vu0-block (new 'static 'vu-function :length 54 :qlength 27))
;; definition for function bones-set-sqwc
;; WARN: Return type mismatch int vs none.
(defun bones-set-sqwc ()
(set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x4))
(none)
)
;; definition for function bones-reset-sqwc
;; WARN: Return type mismatch int vs none.
(defun bones-reset-sqwc ()
(set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x1))
(none)
)
;; definition for function bones-init
;; WARN: Return type mismatch int vs none.
(defun bones-init ((arg0 dma-buffer))
(let ((v1-1 (-> (the-as bone-memory #x70000000) work)))
(+ #x70000000 0)
(set! (-> v1-1 layout joint 0) (the-as (inline-array matrix) (-> (the-as bone-memory #x70000000) buffer)))
(set! (-> v1-1 layout joint 1) (the-as (inline-array matrix) (-> (the-as bone-memory #x70000000) buffer 1)))
(set! (-> v1-1 layout bone 0) (-> (the-as bone-memory #x70000000) buffer 0 bone))
(set! (-> v1-1 layout bone 1) (-> (the-as bone-memory #x70000000) buffer 1 bone))
(set! (-> v1-1 layout output 0) (-> (the-as bone-memory #x70000000) buffer 0 output))
(set! (-> v1-1 layout output 1) (-> (the-as bone-memory #x70000000) buffer 1 output))
)
(let ((gp-0 *vu0-dma-list*))
(let ((v1-2 gp-0))
(set! (-> v1-2 base) (-> v1-2 data))
(set! (-> v1-2 end) (&-> v1-2 data-buffer (-> v1-2 allocated-length)))
)
(dma-buffer-add-vu-function gp-0 bones-vu0-block 0)
(let* ((v1-3 gp-0)
(a0-20 (the-as object (-> v1-3 base)))
)
(set! (-> (the-as dma-packet a0-20) dma) (new 'static 'dma-tag :id (dma-tag-id end)))
(set! (-> (the-as (pointer uint64) a0-20) 1) (the-as uint 0))
(set! (-> v1-3 base) (&+ (the-as pointer a0-20) 16))
)
(.sync.l)
(dma-buffer-send-chain (the-as dma-bank-source #x10008000) gp-0)
)
0
(none)
)
;; definition for function bones-mtx-calc
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function bones-mtx-calc-execute
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
;; ERROR: Function may read a register that is not set: t0
;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 128]
;; ERROR: Unsupported inline assembly instruction kind - [addiu a1, a1, 128]
(defun bones-mtx-calc-execute ()
(local-vars (v1-30 float) (a0-29 int) (a0-31 int) (t0-0 none))
(rlet ((vf1 :class vf)
(vf25 :class vf)
(vf26 :class vf)
(vf27 :class vf)
(vf28 :class vf)
(vf29 :class vf)
(vf30 :class vf)
(vf31 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(vf8 :class vf)
)
(when *debug-segment*
(let ((gp-0 (-> *display* frames (-> *display* on-screen) profile-array data 0))
(v1-7 'bones)
(s5-0 *profile-bones-color*)
)
(when (and *dproc* *debug-segment*)
(let ((s4-0 (-> gp-0 data (-> gp-0 count))))
(let ((s3-0 (-> gp-0 base-time)))
(set! (-> s4-0 name) v1-7)
(set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0))))
)
(set! (-> s4-0 depth) (the-as uint (-> gp-0 depth)))
(set! (-> s4-0 color) s5-0)
(set! (-> gp-0 segment (-> gp-0 depth)) s4-0)
)
(+! (-> gp-0 count) 1)
(+! (-> gp-0 depth) 1)
(set! (-> gp-0 max-depth) (max (-> gp-0 max-depth) (-> gp-0 depth)))
)
)
0
)
(let* ((v1-21 (-> *perf-stats* data 48))
(a0-8 (-> v1-21 ctrl))
)
(+! (-> v1-21 count) 1)
(b! (zero? a0-8) cfg-9 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 0)
(.mtpc pcr1 0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-8)
)
(.sync.l)
(.sync.p)
(label cfg-9)
0
(let ((v1-24 (-> (the-as bone-memory #x70000000) work)))
(+ #x70000000 0)
(set! (-> v1-24 layout joint 0) (the-as (inline-array matrix) (-> (the-as bone-memory #x70000000) buffer)))
(set! (-> v1-24 layout joint 1) (the-as (inline-array matrix) (-> (the-as bone-memory #x70000000) buffer 1)))
(set! (-> v1-24 layout bone 0) (-> (the-as bone-memory #x70000000) buffer 0 bone))
(set! (-> v1-24 layout bone 1) (-> (the-as bone-memory #x70000000) buffer 1 bone))
(set! (-> v1-24 layout output 0) (-> (the-as bone-memory #x70000000) buffer 0 output))
(set! (-> v1-24 layout output 1) (-> (the-as bone-memory #x70000000) buffer 1 output))
)
(set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x4))
(let* ((v1-26 *bone-calculation-list*)
(gp-1 *identity-matrix*)
(s5-1 (-> *math-camera* camera-rot))
(s4-1 (-> v1-26 first))
)
(while (nonzero? s4-1)
(let ((v1-29 (if (logtest? (-> s4-1 flags) (bone-calc-flags no-cam-rot))
gp-1
s5-1
)
)
)
(.lvf vf28 (&-> v1-29 quad 0))
(.lvf vf29 (&-> v1-29 quad 1))
(.lvf vf30 (&-> v1-29 quad 2))
(.lvf vf31 (&-> v1-29 trans quad))
(.lvf vf25 (&-> v1-29 quad 0))
(.lvf vf26 (&-> v1-29 quad 1))
(.lvf vf27 (&-> v1-29 quad 2))
)
(.mov v1-30 vf27)
(bones-mtx-calc
(-> s4-1 matrix-area)
(-> s4-1 joints)
(-> s4-1 bones)
(-> s4-1 num-bones)
(the-as object t0-0)
)
(when (logtest? (-> s4-1 flags) (bone-calc-flags write-ripple-data))
(let* ((a2-1 s4-1)
(v1-34 (-> a2-1 num-bones))
(a0-26 (the-as pris-mtx (-> a2-1 matrix-area)))
(a1-11 (the-as pris-mtx (-> a2-1 ripple-area)))
)
(.lvf vf1 (&-> a2-1 ripple-vec quad))
(label cfg-15)
(.lvf vf5 (&-> a0-26 t-mtx quad 1))
(.lvf vf6 (&-> a0-26 t-mtx trans quad))
(.lvf vf7 (&-> a0-26 n-mtx quad 0))
(.lvf vf8 (&-> a0-26 n-mtx quad 2))
(.mul.x.vf vf4 vf5 vf1)
(.mul.y.vf vf5 vf5 vf1)
(let ((a3-1 (-> a0-26 t-mtx quad 0)))
(.mul.z.vf vf7 vf7 vf1)
(let ((a2-2 (-> a0-26 t-mtx quad 2)))
(.mul.z.vf vf8 vf8 vf1)
(set! (-> a1-11 t-mtx quad 0) a3-1)
(let ((a3-2 (-> a0-26 n-mtx quad 1)))
(.sub.vf vf6 vf6 vf4)
(set! (-> a1-11 t-mtx quad 2) a2-2)
(.svf (&-> a1-11 t-mtx quad 1) vf5)
(set! (-> a1-11 n-mtx quad 1) a3-2)
)
)
)
(+! v1-34 -1)
(.svf (&-> a1-11 n-mtx quad 0) vf7)
(.addiu a0-26 a0-26 128)
(.svf (&-> a1-11 t-mtx trans quad) vf6)
(.addiu a1-11 a1-11 128)
(b! (nonzero? v1-34) cfg-15 :delay (s.vf! (+ a1-11 -32) vf8))
)
0
)
(set! s4-1 (-> s4-1 next))
)
)
(set! (-> (the-as dma-bank-control #x1000e000) sqwc) (new 'static 'dma-sqwc :sqwc #x1 :tqwc #x1))
(bone-list-init)
(let ((v1-39 (-> *perf-stats* data 48)))
(b! (zero? (-> v1-39 ctrl)) cfg-21 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mfpc a0-29 pcr0)
(+! (-> v1-39 accum0) a0-29)
(.mfpc a0-31 pcr1)
(+! (-> v1-39 accum1) a0-31)
)
(label cfg-21)
0
(when *debug-segment*
(let ((gp-2 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
(when (and *dproc* *debug-segment*)
(let* ((v1-52 (+ (-> gp-2 depth) -1))
(s5-2 (-> gp-2 segment v1-52))
(s4-2 (-> gp-2 base-time))
)
(when (>= v1-52 0)
(set! (-> s5-2 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-2))))
(+! (-> gp-2 depth) -1)
)
)
)
)
0
)
0
(none)
)
)
;; definition (debug) for function dump-qword
;; WARN: Return type mismatch int vs none.
(defun-debug dump-qword ((arg0 qword))
(let ((v1-0 arg0))
(format
0
"~8,'0X: ~8,'0X ~8,'0X ~8,'0X ~8,'0X~%"
v1-0
(-> v1-0 data 0)
(-> v1-0 data 1)
(-> v1-0 data 2)
(-> v1-0 data 3)
)
)
0
(none)
)
;; definition (debug) for function dump-mem
;; WARN: Return type mismatch int vs none.
(defun-debug dump-mem ((arg0 pointer) (arg1 int))
(dotimes (s4-0 arg1)
(format
0
"~8,'0X: ~8,'0X ~8,'0X ~8,'0X ~8,'0X"
(&+ arg0 (* (* s4-0 4) 4))
(-> (the-as (pointer uint32) (&+ arg0 (* (* s4-0 4) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 1) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 2) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 3) 4))))
)
(format
0
" ~F ~F ~F ~F ~%"
(-> (the-as (pointer uint32) (&+ arg0 (* (* s4-0 4) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 1) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 2) 4))))
(-> (the-as (pointer uint32) (&+ arg0 (* (+ (* s4-0 4) 3) 4))))
)
)
0
(none)
)
;; definition (debug) for function bones-debug
;; WARN: Return type mismatch int vs none.
(defun-debug bones-debug ()
0
(none)
)
;; definition (debug) for function dump-bone-mem
;; WARN: Return type mismatch int vs none.
(defun-debug dump-bone-mem ()
(format 0 "== joints 0 ===========~%")
(dump-mem (the-as pointer (+ 80 #x70000000)) 64)
(format 0 "== bones 0 ============~%")
(dump-mem (the-as pointer (+ 1104 #x70000000)) 80)
(format 0 "== output 0 ===========~%")
(dump-mem (the-as pointer (+ 2384 #x70000000)) 128)
(format 0 "~%~%~%")
(format 0 "== joints 1 ===========~%")
(dump-mem (the-as pointer (+ 4432 #x70000000)) 64)
(format 0 "== bones 1 ============~%")
(dump-mem (the-as pointer (+ 5456 #x70000000)) 80)
(format 0 "== output 1 ===========~%")
(dump-mem (the-as pointer (+ 6736 #x70000000)) 128)
(format 0 "========================~%~%")
0
(none)
)
+8 -7
View File
@@ -6,7 +6,7 @@
((first uint32 :offset-assert 0)
(next uint32 :offset-assert 4)
(state generic-bucket-state :inline :offset-assert 8)
(vu1-bucket int32 :offset-assert 16)
(vu1-bucket bucket-id :offset-assert 16)
)
:pack-me
:method-count-assert 9
@@ -33,7 +33,7 @@
(deftype merc-chain (structure)
((first dma-packet :offset-assert 0)
(patch dma-packet :offset-assert 4)
(vu1-bucket int32 :offset-assert 8)
(vu1-bucket bucket-id :offset-assert 8)
)
:pack-me
:method-count-assert 9
@@ -132,11 +132,11 @@
(mercneric-used uint32 :offset-assert 12)
(use-isometric uint32 :offset-assert 16)
(base-start dma-packet :offset-assert 20)
(joint-ptr uint32 :offset-assert 24)
(bone-ptr uint32 :offset-assert 28)
(joint-ptr (inline-array joint) :offset-assert 24)
(bone-ptr (inline-array bone) :offset-assert 28)
(num-bones uint32 :offset-assert 32)
(mtxs uint32 :offset-assert 36)
(dma-buf basic :offset-assert 40)
(mtxs (inline-array pris-mtx) :offset-assert 36)
(dma-buf dma-buffer :offset-assert 40)
(default-texture-index uint32 :offset-assert 44)
(mercneric-chain mercneric-chain :offset-assert 48)
(level-buckets foreground-level-buckets :offset-assert 52)
@@ -174,7 +174,7 @@
;; definition of type foreground-work
(deftype foreground-work (structure)
((regs foreground-regs :inline :offset-assert 0)
(draw-index-map uint16 7 :offset 64)
(draw-index-map uint8 7 :offset 64)
(grid foreground-bucket-grid :inline :offset-assert 80)
(bounds sphere :inline :offset-assert 2464)
(lights vu-lights :inline :offset-assert 2480)
@@ -242,6 +242,7 @@
;; definition of type merc-effect-bucket-info
(deftype merc-effect-bucket-info (structure)
((color-fade rgba :offset-assert 0)
(alpha uint8 :offset 3)
(merc-path uint8 :offset-assert 4)
(ignore-alpha uint8 :offset-assert 5)
(disable-draw uint8 :offset-assert 6)
+16 -13
View File
@@ -3,9 +3,11 @@
;; definition of type vu-lights
(deftype vu-lights (structure)
((direction vector 3 :inline :offset-assert 0)
(color vector 3 :inline :offset-assert 48)
(ambient vector :inline :offset-assert 96)
((direction vector 3 :inline :offset-assert 0)
(color vector 3 :inline :offset-assert 48)
(ambient vector :inline :offset-assert 96)
(fade-int uint32 :offset 44)
(fade-flags uint32 :offset 28)
)
:method-count-assert 9
:size-assert #x70
@@ -107,6 +109,7 @@
((index uint16 :offset-assert 0)
(count uint16 :offset-assert 2)
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -127,16 +130,16 @@
;; definition of type light-hash
(deftype light-hash (basic)
((num-lights uint16 :offset-assert 4)
(num-indices uint16 :offset-assert 6)
(num-buckets uint16 :offset-assert 8)
(bucket-step uint8 2 :offset-assert 10)
(base-trans vector :inline :offset-assert 16)
(axis-scale vector :inline :offset-assert 32)
(dimension-array vector4w :inline :offset-assert 48)
(bucket-array pointer :offset-assert 64)
(index-array pointer :offset-assert 68)
(light-sphere-array (inline-array light-sphere) :offset-assert 72)
((num-lights uint16 :offset-assert 4)
(num-indices uint16 :offset-assert 6)
(num-buckets uint16 :offset-assert 8)
(bucket-step uint8 2 :offset-assert 10)
(base-trans vector :inline :offset-assert 16)
(axis-scale vector :inline :offset-assert 32)
(dimension-array vector4w :inline :offset-assert 48)
(bucket-array (inline-array light-hash-bucket) :offset-assert 64)
(index-array pointer :offset-assert 68)
(light-sphere-array (inline-array light-sphere) :offset-assert 72)
)
:method-count-assert 9
:size-assert #x4c
+5 -5
View File
@@ -291,10 +291,10 @@
;; definition of type mei-envmap-tint
(deftype mei-envmap-tint (structure)
((fade0 float :offset-assert 0)
(fade1 float :offset-assert 4)
(tint uint32 :offset-assert 8)
(dummy int32 :offset-assert 12)
((fade0 float :offset-assert 0)
(fade1 float :offset-assert 4)
(tint rgba :offset-assert 8)
(dummy int32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
@@ -412,7 +412,7 @@
(blend-data merc-blend-data :offset-assert 8)
(blend-ctrl merc-blend-ctrl :offset-assert 12)
(merc-effect-version uint8 :offset-assert 16)
(effect-bits uint8 :offset-assert 17)
(effect-bits effect-bits :offset-assert 17)
(frag-count uint16 :offset-assert 18)
(blend-frag-count uint16 :offset-assert 20)
(tri-count uint16 :offset-assert 22)
+14 -14
View File
@@ -213,7 +213,6 @@
)
;; definition for method 3 of type merc-fragment-control
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect merc-fragment-control ((obj merc-fragment-control))
(format #t "[~8x] ~A~%" obj 'merc-fragment-control)
(format #t "~Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count))
@@ -270,7 +269,6 @@
)
;; definition for method 3 of type merc-ctrl
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect merc-ctrl ((obj merc-ctrl))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tname: ~A~%" (-> obj name))
@@ -614,21 +612,23 @@
(let* ((v1-14 dma-buf)
(a0-8 (-> v1-14 base))
)
(set! (-> (the-as (pointer gs-test) a0-8) 0) (new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
)
(set! (-> (the-as (pointer gs-test) a0-8) 0)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:zte #x1
:ztst (gs-ztest greater-equal)
)
)
(set! (-> (the-as (pointer gs-reg64) a0-8) 1) (gs-reg64 test-1))
(set! (-> (the-as (pointer gs-test) a0-8) 2) (if arg2
(the-as gs-test #x1000130)
(the-as gs-test (the-as uint #x101000130))
)
(set! (-> (the-as (pointer gs-zbuf) a0-8) 2)
(if arg2
(new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24))
(new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)
)
)
(set! (-> (the-as (pointer gs-test) a0-8) 3) (new 'static 'gs-test :atst (gs-atest not-equal) :aref #x4))
(set! (-> (the-as (pointer gs-reg64) a0-8) 3) (gs-reg64 zbuf-1))
(set! (-> v1-14 base) (&+ a0-8 32))
)
(let ((v1-15 (the-as object (-> dma-buf base))))
@@ -716,7 +716,7 @@
)
(set! (-> s2-0 level-index) (the-as uint (-> s3-0 index)))
)
(set! (-> s2-0 dma-add-func) nothing)
(set! (-> s2-0 dma-add-func) (the-as (function process-drawable draw-control symbol object none) nothing))
(set! (-> arg2 0) (setup-cspace-and-add s2-0 (the-as art-joint-geo sv-16) 'process))
(set! (-> s2-0 dma-add-func) dma-add-process-drawable)
(set! (-> s2-0 shadow-mask) (res-lump-value (-> arg0 entity) 'shadow-mask uint :time -1000000000.0))
+7 -8
View File
@@ -1527,14 +1527,13 @@
(set! (-> v1-19 id) (the-as uint arg3))
(set! (-> v1-19 mode) 'ice)
(set! (-> v1-19 damage) 15.0)
(set! (-> v1-19 penetrate-using) (the-as uint (if (and (logtest? (focus-status dark) (-> self focus-status))
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) 32)
)
#xd0001
#x50001
)
)
(set! (-> v1-19 penetrate-using) (if (and (logtest? (focus-status dark) (-> self focus-status))
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) 32)
)
(penetrate touch dark-skin dark-bomb dark-giant)
(penetrate touch dark-skin dark-bomb)
)
)
(set! (-> a1-6 param 1) (the-as uint v1-19))
)
+7 -7
View File
@@ -219,13 +219,13 @@
;; WARN: Stack slot offset 96 signed mismatch
;; WARN: Stack slot offset 96 signed mismatch
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 711]
(defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 uint))
(defbehavior target-send-attack target ((arg0 process) (arg1 symbol) (arg2 touching-shapes-entry) (arg3 int) (arg4 int) (arg5 penetrate))
(local-vars
(sv-96 symbol)
(sv-100 touching-prims-entry)
(sv-128 touching-prims-entry)
(sv-176 touching-prims-entry)
(sv-224 uint)
(sv-224 penetrate)
(sv-240 int)
(sv-256 symbol)
(sv-272 symbol)
@@ -966,7 +966,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> (the-as fact-info-target (-> self fact-override)) shield-attack-id))
0
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
(set! (-> self control penetrate-using) s4-3)
@@ -987,7 +987,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> self darkjak attack-id))
0
(the-as uint #x10001)
(penetrate touch dark-skin)
)
)
(else
@@ -1441,7 +1441,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> (the-as fact-info-target (-> self fact-override)) shield-attack-id))
0
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
)
@@ -1462,7 +1462,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
(else
@@ -1538,7 +1538,7 @@
(the-as touching-shapes-entry (-> arg3 param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
(zero? (logand (-> self focus-status) (focus-status dead hit)))
)
+2 -2
View File
@@ -2122,7 +2122,7 @@
(the-as touching-shapes-entry (-> event param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
(set! (-> self gun combo-window-start) (-> self clock frame-counter))
(let ((v0-2 (the-as object (-> self state name))))
@@ -2380,7 +2380,7 @@
(the-as touching-shapes-entry (-> event param 0))
(the-as int (-> self control target-attack-id))
(the-as int (-> self control attack-count))
(the-as uint (-> self control penetrate-using))
(-> self control penetrate-using)
)
)
)
+23 -23
View File
@@ -86,7 +86,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-2
(the-as (pointer dma-tag) a3-1)
)
@@ -309,7 +309,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -335,7 +335,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -375,7 +375,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -401,7 +401,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -441,7 +441,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -467,7 +467,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -507,7 +507,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -533,7 +533,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -573,7 +573,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-0)
)
@@ -599,7 +599,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-0)
)
@@ -1379,7 +1379,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-0
(the-as (pointer dma-tag) a3-1)
)
@@ -2580,7 +2580,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-9
(the-as (pointer dma-tag) a3-35)
)
@@ -2614,7 +2614,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-10
(the-as (pointer dma-tag) a3-36)
)
@@ -2651,7 +2651,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-12
(the-as (pointer dma-tag) a3-39)
)
@@ -2681,7 +2681,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-14
(the-as (pointer dma-tag) a3-41)
)
@@ -2713,7 +2713,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s2-16
(the-as (pointer dma-tag) a3-43)
)
@@ -3305,7 +3305,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s4-1
(the-as (pointer dma-tag) a3-1)
)
@@ -5050,7 +5050,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s4-0
(the-as (pointer dma-tag) a3-1)
)
@@ -5259,7 +5259,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
gp-1
(the-as (pointer dma-tag) a3-1)
)
@@ -5313,7 +5313,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
s5-1
(the-as (pointer dma-tag) a3-1)
)
@@ -7587,7 +7587,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
sv-192
(the-as (pointer dma-tag) a3-6)
)
@@ -7702,7 +7702,7 @@
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id bucket-320)
(bucket-id progress)
sv-272
(the-as (pointer dma-tag) a3-13)
)
+1 -1
View File
@@ -1400,7 +1400,7 @@
;; WARN: Failed store: (s.w! (+ v1-8 12) 0) at op 20
(defun end-scan ((arg0 hud-box) (arg1 float))
(with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id bucket-320)
(bucket-id progress)
)
(hud-box-method-13 arg0 s5-0 arg1)
)
+42 -42
View File
@@ -355,48 +355,48 @@
;; definition for function profile-mercneric-test
(defun profile-mercneric-test ((arg0 bucket-id))
(or (= arg0 (bucket-id bucket-16))
(= arg0 (bucket-id bucket-27))
(= arg0 (bucket-id bucket-38))
(= arg0 (bucket-id bucket-49))
(= arg0 (bucket-id bucket-60))
(= arg0 (bucket-id bucket-71))
(= arg0 (bucket-id bucket-81))
(= arg0 (bucket-id bucket-90))
(= arg0 (bucket-id bucket-99))
(= arg0 (bucket-id bucket-108))
(= arg0 (bucket-id bucket-117))
(= arg0 (bucket-id bucket-126))
(= arg0 (bucket-id bucket-133))
(= arg0 (bucket-id bucket-143))
(= arg0 (bucket-id bucket-153))
(= arg0 (bucket-id bucket-163))
(= arg0 (bucket-id bucket-173))
(= arg0 (bucket-id bucket-183))
(= arg0 (bucket-id bucket-190))
(= arg0 (bucket-id bucket-194))
(= arg0 (bucket-id bucket-199))
(= arg0 (bucket-id bucket-203))
(= arg0 (bucket-id bucket-207))
(= arg0 (bucket-id bucket-211))
(= arg0 (bucket-id bucket-215))
(= arg0 (bucket-id bucket-219))
(= arg0 (bucket-id bucket-223))
(= arg0 (bucket-id bucket-227))
(= arg0 (bucket-id bucket-231))
(= arg0 (bucket-id bucket-235))
(= arg0 (bucket-id bucket-239))
(= arg0 (bucket-id bucket-243))
(= arg0 (bucket-id bucket-247))
(= arg0 (bucket-id bucket-251))
(= arg0 (bucket-id bucket-254))
(= arg0 (bucket-id bucket-263))
(= arg0 (bucket-id bucket-272))
(= arg0 (bucket-id bucket-281))
(= arg0 (bucket-id bucket-290))
(= arg0 (bucket-id bucket-299))
(= arg0 (bucket-id bucket-308))
(= arg0 (bucket-id bucket-317))
(or (= arg0 (bucket-id gmerc-l0-tfrag))
(= arg0 (bucket-id gmerc-l1-tfrag))
(= arg0 (bucket-id gmerc-l2-tfrag))
(= arg0 (bucket-id gmerc-l3-tfrag))
(= arg0 (bucket-id gmerc-l4-tfrag))
(= arg0 (bucket-id gmerc-l5-tfrag))
(= arg0 (bucket-id gmerc-l0-shrub))
(= arg0 (bucket-id gmerc-l1-shrub))
(= arg0 (bucket-id gmerc-l2-shrub))
(= arg0 (bucket-id gmerc-l3-shrub))
(= arg0 (bucket-id gmerc-l4-shrub))
(= arg0 (bucket-id gmerc-l5-shrub))
(= arg0 (bucket-id gmerc-l0-alpha))
(= arg0 (bucket-id gmerc-l1-alpha))
(= arg0 (bucket-id gmerc-l2-alpha))
(= arg0 (bucket-id gmerc-l3-alpha))
(= arg0 (bucket-id gmerc-l4-alpha))
(= arg0 (bucket-id gmerc-l5-alpha))
(= arg0 (bucket-id gmerc-lcom-tfrag))
(= arg0 (bucket-id gmerc-lcom-shrub))
(= arg0 (bucket-id gmerc-l0-pris))
(= arg0 (bucket-id gmerc-l1-pris))
(= arg0 (bucket-id gmerc-l2-pris))
(= arg0 (bucket-id gmerc-l3-pris))
(= arg0 (bucket-id gmerc-l4-pris))
(= arg0 (bucket-id gmerc-l5-pris))
(= arg0 (bucket-id gmerc-lcom-pris))
(= arg0 (bucket-id gmerc-l0-pris2))
(= arg0 (bucket-id gmerc-l1-pris2))
(= arg0 (bucket-id gmerc-l2-pris2))
(= arg0 (bucket-id gmerc-l3-pris2))
(= arg0 (bucket-id gmerc-l4-pris2))
(= arg0 (bucket-id gmerc-l5-pris2))
(= arg0 (bucket-id gmerc-lcom-pris2))
(= arg0 (bucket-id gmerc-l0-water))
(= arg0 (bucket-id gmerc-l1-water))
(= arg0 (bucket-id gmerc-l2-water))
(= arg0 (bucket-id gmerc-l3-water))
(= arg0 (bucket-id gmerc-l4-water))
(= arg0 (bucket-id gmerc-l5-water))
(= arg0 (bucket-id gmerc-lcom-water))
(= arg0 (bucket-id gmerc-warp))
)
)
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More