Merge remote-tracking branch 'origin/master' into v/customize-saves-and-settings-loc

This commit is contained in:
Tyler Wilding 2024-04-28 15:03:46 -04:00
commit 598a96818f
No known key found for this signature in database
GPG Key ID: BF7B068C2FEFD7EF
842 changed files with 624391 additions and 10823 deletions

View File

@ -134,6 +134,8 @@ fs::path get_user_features_dir(GameVersion game_version) {
return path;
}
fs::path g_iso_data_directory = "";
/*!
* Get the path to the current executable.
*/
@ -238,6 +240,28 @@ fs::path get_jak_project_dir() {
return g_file_path_info.path_to_data_folder;
}
fs::path get_iso_dir_for_game(GameVersion game_version) {
if (!g_iso_data_directory.empty()) {
return g_iso_data_directory;
}
// Find the location based on the game version
std::string expected_subdir = "jak1";
if (game_version == GameVersion::Jak2) {
expected_subdir = "jak2";
} else if (game_version == GameVersion::Jak3) {
expected_subdir = "jak3";
}
const auto temp_dir = get_jak_project_dir() / "iso_data" / expected_subdir;
if (fs::exists(temp_dir)) {
g_iso_data_directory = temp_dir;
}
return g_iso_data_directory;
}
void set_iso_data_dir(const fs::path& directory) {
g_iso_data_directory = directory;
}
std::string get_file_path(const std::vector<std::string>& input) {
// TODO - clean this behaviour up, it causes unexpected behaviour when working with files
// the project path should be explicitly provided by whatever if needed
@ -788,4 +812,9 @@ std::pair<int, std::string> get_majority_file_line_endings_and_count(
return {lf_count + crlf_count, "\n"};
}
bool is_dir_in_dir(const fs::path& parent, const fs::path& child) {
// Check if the parent path is a prefix of the child path
return child.has_parent_path() && child.parent_path().lexically_relative(parent) == fs::path(".");
}
} // namespace file_util

View File

@ -35,6 +35,8 @@ fs::path get_user_screenshots_dir(GameVersion game_version);
fs::path get_user_misc_dir(GameVersion game_version);
fs::path get_user_features_dir(GameVersion game_version);
fs::path get_jak_project_dir();
fs::path get_iso_dir_for_game(GameVersion game_version);
void set_iso_data_dir(const fs::path& directory);
bool create_dir_if_needed(const fs::path& path);
bool create_dir_if_needed_for_file(const std::string& path);
@ -77,4 +79,5 @@ std::string make_screenshot_filepath(const GameVersion game_version, const std::
std::string get_majority_file_line_endings(const std::string& file_contents);
std::pair<int, std::string> get_majority_file_line_endings_and_count(
const std::string& file_contents);
bool is_dir_in_dir(const fs::path& parent, const fs::path& child);
} // namespace file_util

View File

@ -6586,6 +6586,10 @@ bool try_vector_reset_inline(const Env& env,
RegisterAccess orig;
store = repop_passthrough_arg(store, stack, env, &orig, &got_orig);
if (!store) {
return false;
}
// create the actual form
Form* new_thing = pool.form<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>("vector-reset!")),

View File

@ -760,6 +760,10 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* cons
break;
}
if (entries_matched == m_entry_matchers.size()) {
break;
}
if (m_entry_matchers.at(entries_matched)
.do_match(let_body->entries().at(0), maps_out, env)) {
entries_matched++;

View File

@ -332,7 +332,7 @@ class ObjectFileDB {
void for_each_function_def_order(Func f) {
for_each_obj([&](ObjectFileData& data) {
for (int i = 0; i < int(data.linked_data.segments); i++) {
int fn = 0;
[[maybe_unused]] int fn = 0;
for (size_t j = data.linked_data.functions_by_seg.at(i).size(); j-- > 0;) {
f(data.linked_data.functions_by_seg.at(i).at(j), i, data);
fn++;
@ -355,7 +355,7 @@ class ObjectFileDB {
template <typename Func>
void for_each_function_in_seg(int seg, Func f) {
for_each_obj([&](ObjectFileData& data) {
int fn = 0;
[[maybe_unused]] int fn = 0;
if (data.linked_data.segments == 3) {
for (size_t j = data.linked_data.functions_by_seg.at(seg).size(); j-- > 0;) {
f(data.linked_data.functions_by_seg.at(seg).at(j), data);

File diff suppressed because it is too large Load Diff

View File

@ -615,5 +615,248 @@
"wvehicle": [[6, "(function collide-shape-prim none)"]],
"pilot-states": [
[15, "(function surface surface surface int object :behavior target)"]
],
"was-squad-control": [[16, "(function object object)"]],
"des-cactus": [[13, "(function collide-shape-prim none)"]],
"desertg-obs": [
[4, "(function collide-shape-prim none)"],
[7, "(function collide-shape-prim none)"]
],
"desertf-obs": [[7, "(function none)"]],
"temple-obs2": [
[43, "(function symbol)"],
[46, "(function object :behavior tpl-watcher)"]
],
"temple-scenes": [
[0, "(function none)"],
[1, "(function none)"],
[2, "(function none)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"]
],
"des-beast-2": [
[1, "(function cspace transformq none)"],
[2, "(function cspace transformq none)"],
[23, "(function projectile none)"]
],
"scorpion-gun": [
[33, "(function cspace transformq none)"],
[34, "(function cspace transformq none)"]
],
"hover-formation": [
[10, "(function form-search-info float)"],
[11, "(function int int form-search-info uint)"],
[14, "(function vector object)"],
[15, "(function int int (pointer object) int)"]
],
"robo-hover": [
[14, "(function robo-hover cspace float float vector vector int object)"]
],
"tower-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"]
],
"forest-kill-plants": [
[5, "(function engine-pers connection-pers object object symbol)"],
[7, "(function engine-pers connection-pers object object symbol)"]
],
"forest-tasks": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"],
[10, "(function none :behavior scene-player)"],
[11, "(function none :behavior scene-player)"],
[12, "(function none :behavior scene-player)"],
[13, "(function none :behavior scene-player)"],
[14, "(function none :behavior scene-player)"],
[15, "(function none :behavior scene-player)"],
[16, "(function none :behavior scene-player)"],
[17, "(function none :behavior scene-player)"],
[18, "(function none :behavior scene-player)"],
[19, "(function none :behavior scene-player)"],
[20, "(function none :behavior scene-player)"],
[21, "(function none :behavior scene-player)"]
],
"neo-wasp": [[15, "(function neo-wasp cspace transformq float float none)"]],
"for-turret": [
[1, "(function cspace transformq none)"],
[2, "(function cspace transformq none)"],
[3, "(function cspace transformq none)"],
[4, "(function cspace transformq none)"]
],
"volcano-obs": [[38, "(function cspace transformq none)"]],
"spiky-frog": [[9, "(function cspace transformq none)"]],
"volcano-scenes": [
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"]
],
"mantis": [
[8, "(function mantis vector float int vector vector)"],
[15, "(function mantis collide-shape-moving vector symbol)"]
],
"wcar-faccar": [[9, "(function handle object :behavior process)"]],
"wasstadb-obs": [[5, "(function object)"]],
"arena-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"]
],
"traffic-engine": [
[24, "(function traffic-find-segment-struct nav-segment none)"]
],
"desert-scenes": [
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"],
[10, "(function none :behavior scene-player)"],
[11, "(function none :behavior scene-player)"],
[12, "(function none :behavior scene-player)"],
[13, "(function none :behavior scene-player)"],
[14, "(function none :behavior scene-player)"],
[15, "(function none :behavior scene-player)"],
[16, "(function none :behavior scene-player)"],
[17, "(function none :behavior scene-player)"],
[18, "(function none :behavior scene-player)"],
[19, "(function none :behavior scene-player)"],
[20, "(function none :behavior scene-player)"],
[21, "(function none :behavior scene-player)"],
[22, "(function none :behavior scene-player)"],
[23, "(function none :behavior scene-player)"],
[24, "(function none :behavior scene-player)"],
[25, "(function none :behavior scene-player)"],
[26, "(function none :behavior scene-player)"],
[27, "(function none :behavior scene-player)"],
[28, "(function none :behavior scene-player)"],
[29, "(function none :behavior scene-player)"],
[30, "(function none :behavior scene-player)"],
[31, "(function none :behavior scene-player)"],
[32, "(function none :behavior scene-player)"],
[33, "(function none :behavior scene-player)"],
[34, "(function none :behavior scene-player)"],
[35, "(function none :behavior scene-player)"],
[36, "(function symbol :behavior scene-player)"]
],
"throne-scenes": [[0, "(function none :behavior scene-player)"]],
"terraformer-setup": [[38, "(function object :behavior manipy)"]],
"mined-scenes": [
[6, "(function none :behavior scene-player)"],
[7, "(function process-drawable vector none :behavior scene-player)"],
[8, "(function process-drawable vector none :behavior scene-player)"]
],
"wasteland-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"],
[10, "(function none :behavior scene-player)"]
],
"wasdoors-scenes": [[2, "(function none :behavior scene-player)"]],
"wasdef-manager": [
[7, "(function process-tree object)"],
[8, "(function process-tree object)"],
[9, "(function process-tree object)"]
],
"des-burning-bush": [[37, "(function symbol)"]],
"mh-wasp": [
[9, "(function mh-wasp cspace float float vector vector int none)"]
],
"mh-bat": [
[1, "(function cspace transformq none)"],
[21, "(function object :behavior mh-bat)"],
[26, "(function object :behavior mh-bat)"],
[30, "(function object :behavior mh-bat)"],
[34, "(function object :behavior mh-bat)"],
[39, "(function object :behavior mh-bat)"]
],
"factoryc-obs2": [
[67, "(function (pointer joint-exploder) :behavior fac-break-floor)"]
],
"factory-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"],
[10, "(function process-drawable none :behavior scene-player)"],
[11, "(function none :behavior scene-player)"],
[12, "(function none :behavior scene-player)"],
[13, "(function none :behavior scene-player)"],
[14, "(function none :behavior scene-player)"],
[15, "(function none :behavior scene-player)"]
],
"factory-boss-setup": [[37, "(function object :behavior manipy)"]],
"factory-boss-scenes": [
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"]
],
"bot": [[25, "(function gui-connection symbol :behavior bot)"]],
"oasis-defense": [
[4, "(function collide-shape-prim none)"],
[11, "(function collide-shape-prim none)"]
],
"ash-oasis-course": [
[0, "(function ashelin-oasis object)"],
[1, "(function ashelin-oasis object)"],
[2, "(function asht-wait-spot ashelin-oasis object)"],
[3, "(function ashelin-oasis symbol)"]
],
"comb-obs": [
[16, "(function collide-shape-prim none)"],
[33, "(function collide-shape-prim none)"],
[49, "(function collide-shape-prim none)"]
],
"comb-sentry": [[19, "(function collide-shape-prim none)"]],
"comb-field": [[5, "(function symbol)"]],
"comb-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"]
],
"railx-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"],
[10, "(function none :behavior scene-player)"],
[11, "(function none :behavior scene-player)"]
]
}

View File

@ -15,7 +15,17 @@
"lightjak-shield": "jakb-ag",
"freeze-screen": "collectables-ag",
"red-3-sphere": "gun-ag",
"gun-dark-3-sphere": "gun-ag"
"gun-dark-3-sphere": "gun-ag",
"marauder": "marauder-male-ag",
"glider-ring": "des-glider-ring-ag",
"flut-racer": "flut-wild-ag",
"was-pre-heart": "neo-satellite-heart-ag",
"was-pre-beam": "neo-satellite-game-ring-ag",
"was-pre-bubble": "neo-satellite-ps-symbols-ag",
"maker": "dm-robot-ag",
"mh-wasp": "neo-wasp-ag",
"factory-boss": "errol-lowres-ag",
"fac-robotank-turret": "fac-robotank-ag"
},
// remap names for types in an entire file (higher priority)

View File

@ -107,11 +107,8 @@
// jak 3
"(method 10 manipulator)",
"(method 46 ff-squad-control)",
"(anon-function 65 temple-obs)",
"(method 33 task-manager-nest-cocoons)",
"(method 33 rub-tower)",
"(method 261 crimson-guard)",
"(anon-function 25 volcanox-obs)",
"memcpy"
],
@ -219,7 +216,14 @@
"borrow-city-expansion",
"add-want-level",
"level-find-borrow-slot",
"(method 18 level)"
"(method 18 level)",
"(method 11 tow-tentacle)",
"city-sound-expand-want-list",
"(method 12 cty-borrow-manager)",
"(method 16 cty-borrow-manager)",
"mark-permanent-holds",
"update-sound-info",
"insert-into-sound-list"
],
// If format is used with the wrong number of arguments,
@ -414,7 +418,35 @@
"(method 118 vehicle)": [3, 4, 7, 8, 9, 10, 17, 26, 30, 31, 33],
"(method 25 squad-control)": [0, 4, 5, 7],
"target-pilot-post": [0, 29],
"(method 36 was-squad-control)": [0, 8, 11, 12, 14, 16]
"(method 36 was-squad-control)": [0, 8, 14, 16],
"(anon-function 6 nst-tasks)": [4, 9, 10, 16, 23, 30],
"(method 33 task-manager-nest-cocoons)": [3, 7, 13, 28],
"(method 90 wvehicle)": [29, 37, 38, 44],
"(anon-function 2 artifact-race)": [40, 55, 56, 57, 65, 66],
"(anon-function 27 course-race)": [6],
"(anon-function 65 temple-obs)": [5, 6],
"(anon-function 5 target-turret)": [0, 1, 2, 3],
"dp-bipedal-consider-attacks": [15, 19],
"(anon-function 25 volcanox-obs)": [3, 5, 6],
"(method 36 task-manager-arena-fight-base)": [11],
"(method 28 hud-wasgun)": [0, 1, 2, 4],
"(method 15 hud-wasgun)": [8, 28, 29, 30, 54],
"(method 15 vehicle-controller)": [0, 3, 5, 6, 7, 10],
"(method 51 hvehicle)": [5],
"(method 159 hvehicle)": [0, 1, 10, 19, 21, 23, 26],
"(method 18 vehicle-controller)": [0, 1, 74, 75],
"glider-too-low?": [2, 19, 21],
"(method 39 task-manager-desert-glide)": [0, 3, 4, 9],
"(method 36 task-manager-desert-glide)": [20, 50, 60],
"(method 37 task-manager-desert-glide)": [11, 12, 23, 29, 31],
"(method 34 task-manager-desert-glide)": [3],
"(anon-function 20 target-flut)": [0, 38, 39],
"(anon-function 14 flut-racer)": [7, 17, 19],
"(method 28 conveyor)": [22],
"generic-merc-execute-all": [7, 15],
"check-enemy": [0, 1],
"(method 91 h-warf)": [0],
"(method 51 h-warf)": [5]
},
// Sometimes the game might use format strings that are fetched dynamically,
@ -448,7 +480,67 @@
[68, 1],
[101, 1],
[130, 1]
]
],
"(method 32 task-manager-desert-turtle-training)": [[59, 1]],
"(method 24 race-manager)": [[97, 1]],
"(method 25 race-manager)": [
[97, 1],
[126, 1]
],
"(method 15 hud-race-final-stats)": [[131, 0]],
"(method 15 hud-wasbbv-goal-time)": [[74, 0]],
"(method 32 task-manager-lightjak-training)": [[53, 0]],
"(method 18 hover-training-manager)": [[69, 0]],
"(method 37 task-manager-arena-training)": [[67, 1]],
"(method 15 hud-arena-final-stats)": [
[103, 0],
[147, 0]
],
"(method 35 task-manager-arena-fight-base)": [[53, 0]],
"(method 32 task-manager-arena-gun-training)": [[53, 0]],
"(method 26 task-manager-arena-fight-2)": [
[72, 0],
[186, 0]
],
"(method 37 task-manager-wascity-gungame)": [
[48, 0],
[78, 0],
[119, 0],
[157, 0],
[195, 0],
[227, 0],
[268, 0],
[306, 0],
[338, 0],
[379, 0],
[411, 0],
[446, 0]
],
"(method 30 was-pre-game)": [
[184, 0],
[276, 0]
],
"(method 32 task-manager-throne-gun-training)": [[53, 0]],
"(method 17 hud-spider-killed)": [[71, 0]],
"(trans idle des-burning-bush)": [
[226, 1],
[257, 0]
],
"(method 37 des-burning-bush)": [
[278, 0],
[336, 0]
],
"(method 38 des-burning-bush)": [
[109, 0],
[153, 0],
[196, 0]
],
"(method 15 freeze-time-hud)": [[108, 0]],
"(method 17 freeze-time-hud)": [[97, 0]],
"(method 15 hud-wasbbv-score)": [[61, 0]],
"(method 15 hud-wasbbv-goal)": [[64, 0]],
"(method 32 task-manager-dark-punch-training)": [[53, 0]],
"(method 32 task-manager-lightjak-training-shield)": [[53, 0]]
},
"mips2c_functions_by_name": [

View File

@ -36,60 +36,60 @@
// // desert
// "DGO/DESA.DGO",
"DGO/DESB.DGO",
// "DGO/DESBATTL.DGO",
"DGO/DESBATTL.DGO",
// "DGO/DESBCST.DGO",
// "DGO/DESBOSS1.DGO",
// "DGO/DESBOSS2.DGO",
"DGO/DESBOSS1.DGO",
"DGO/DESBOSS2.DGO",
// "DGO/DESC.DGO",
// "DGO/DESCHASE.DGO",
// "DGO/DESD.DGO",
"DGO/DESCHASE.DGO",
"DGO/DESD.DGO",
// "DGO/DESE.DGO",
// "DGO/DESERROL.DGO",
// "DGO/DESF.DGO",
// "DGO/DESG.DGO",
"DGO/DESF.DGO",
"DGO/DESG.DGO",
// "DGO/DESH.DGO",
// "DGO/DESHOVER.DGO",
"DGO/DESHOVER.DGO",
// "DGO/DESHUNT.DGO",
"DGO/DESINTER.DGO",
// "DGO/DESJUMP.DGO",
// "DGO/DESLIZ.DGO",
// "DGO/DESOASIS.DGO",
// "DGO/DESRACE1.DGO",
// "DGO/DESRACE2.DGO",
// "DGO/DESRALLY.DGO",
// "DGO/DESRESC.DGO",
"DGO/DESLIZ.DGO",
"DGO/DESOASIS.DGO",
"DGO/DESRACE1.DGO",
"DGO/DESRACE2.DGO",
"DGO/DESRALLY.DGO",
"DGO/DESRESC.DGO",
// "DGO/DESRESCC.DGO",
// "DGO/DESRESCG.DGO",
// "DGO/DESTRACK.DGO",
// "DGO/DESW.DGO",
"DGO/DESTRACK.DGO",
"DGO/DESW.DGO",
"DGO/DST.DGO",
// "DGO/OASISCST.DGO",
"DGO/OASISCST.DGO",
// "DGO/WARPCAST.DGO", // air train
// // nest
// "DGO/NSA.DGO",
// "DGO/NSB.DGO",
// // temple
// "DGO/TEMA.DGO",
// "DGO/TEMB.DGO",
// "DGO/TEMC.DGO",
// "DGO/TEMD.DGO",
// "DGO/TEMP.DGO",
// "DGO/TEMPLEE.DGO",
// "DGO/TEMX.DGO",
// // hang
// "DGO/HGA.DGO",
// "DGO/HGB.DGO",
// // volcano
// "DGO/VOCA.DGO",
// "DGO/VOCX.DGO",
// nest
"DGO/NSA.DGO",
"DGO/NSB.DGO",
// temple
"DGO/TEMA.DGO",
"DGO/TEMB.DGO",
"DGO/TEMC.DGO",
"DGO/TEMD.DGO",
"DGO/TEMP.DGO",
"DGO/TEMPLEE.DGO",
"DGO/TEMX.DGO",
// hang
"DGO/HGA.DGO",
"DGO/HGB.DGO",
// volcano
"DGO/VOCA.DGO",
"DGO/VOCX.DGO",
// mine
"DGO/MIA.DGO",
"DGO/MIB.DGO",
"DGO/MIC.DGO",
"DGO/MINED.DGO",
"DGO/MINEE.DGO",
// // city
// "DGO/CWI.DGO", // ctywide
// city
"DGO/CWI.DGO", // ctywide
// "DGO/CFA.DGO", // ctyfarm
// "DGO/CFB.DGO",
// "DGO/CGB.DGO", // ctygen
@ -137,43 +137,43 @@
// "DGO/SEM.DGO",
// "DGO/SEN.DGO",
// "DGO/SEO.DGO",
// // mhcity
// "DGO/MHCA.DGO",
// "DGO/MHCB.DGO",
// "DGO/MHCTYCST.DGO",
// // forest
// mhcity
"DGO/MHCA.DGO",
"DGO/MHCB.DGO",
"DGO/MHCTYCST.DGO",
// forest
"DGO/FRSTA.DGO",
"DGO/FRSTB.DGO",
"DGO/FRSTX.DGO",
// // factory
// "DGO/FACTORYA.DGO",
// "DGO/FACB.DGO",
// "DGO/FACC.DGO",
// "DGO/FACD.DGO",
// // tower
// "DGO/TOWB.DGO",
// "DGO/TOWERA.DGO",
// "DGO/TOWERC.DGO",
// "DGO/TOWERCST.DGO",
// // stadium
// "DGO/STA.DGO",
// "DGO/STAA.DGO",
// "DGO/STB.DGO",
// factory
"DGO/FACTORYA.DGO",
"DGO/FACB.DGO",
"DGO/FACC.DGO",
"DGO/FACD.DGO",
// tower
"DGO/TOWB.DGO",
"DGO/TOWERA.DGO",
"DGO/TOWERC.DGO",
"DGO/TOWERCST.DGO",
// stadium
"DGO/STA.DGO",
"DGO/STAA.DGO",
"DGO/STB.DGO",
// // rubble
// "DGO/RUBA.DGO",
// "DGO/RUBA2.DGO",
// "DGO/RUBB.DGO",
// "DGO/RUBC.DGO",
// "DGO/RBCT.DGO",
// // comb
// "DGO/COMBA.DGO",
// comb
"DGO/COMBA.DGO",
// "DGO/COMBB.DGO",
// "DGO/COMBC.DGO",
// "DGO/COMBD.DGO",
// "DGO/COMBE.DGO",
// "DGO/COMBN.DGO",
// "DGO/COMBX.DGO",
// "DGO/RAILA.DGO",
"DGO/COMBX.DGO",
"DGO/RAILA.DGO",
// "DGO/RAILB.DGO",
// "DGO/RAILB2.DGO",
// "DGO/RAILC.DGO",
@ -181,7 +181,7 @@
// "DGO/RAILD.DGO",
// "DGO/RAILE.DGO",
// "DGO/RAILF.DGO",
// "DGO/RAILX.DGO",
"DGO/RAILX.DGO",
// // precursor
// "DGO/PRECA.DGO",
// "DGO/PRECB.DGO",
@ -206,24 +206,24 @@
// "DGO/MUSEUM4B.DGO",
// test
"DGO/HALFPIPE.DGO",
// // borrow
// borrow
// "DGO/LASHELIN.DGO",
// "DGO/LBBRING1.DGO",
// "DGO/LBBRING2.DGO",
// "DGO/LBBRING3.DGO",
// "DGO/LBBRING4.DGO",
// "DGO/LBBRING5.DGO",
// "DGO/LBBRING6.DGO",
// "DGO/LBBSDRP1.DGO",
// "DGO/LBBSDRP2.DGO",
// "DGO/LBBSDRP3.DGO",
// "DGO/LBBSPID.DGO",
// "DGO/LBBSPIRT.DGO",
// "DGO/LBBSPRT2.DGO",
// "DGO/LBBSPRT3.DGO",
// "DGO/LBBTCHA1.DGO",
// "DGO/LBBTCHA2.DGO",
// "DGO/LBBTCHA3.DGO",
"DGO/LBBRING1.DGO",
"DGO/LBBRING2.DGO",
"DGO/LBBRING3.DGO",
"DGO/LBBRING4.DGO",
"DGO/LBBRING5.DGO",
"DGO/LBBRING6.DGO",
"DGO/LBBSDRP1.DGO",
"DGO/LBBSDRP2.DGO",
"DGO/LBBSDRP3.DGO",
"DGO/LBBSPID.DGO",
"DGO/LBBSPIRT.DGO",
"DGO/LBBSPRT2.DGO",
"DGO/LBBSPRT3.DGO",
"DGO/LBBTCHA1.DGO",
"DGO/LBBTCHA2.DGO",
"DGO/LBBTCHA3.DGO",
// "DGO/LBIPED.DGO",
// "DGO/LBLOWCST.DGO",
// "DGO/LBLOWTKG.DGO",
@ -232,7 +232,7 @@
// "DGO/LCITYSML.DGO",
// "DGO/LCTYASS.DGO",
// "DGO/LCTYBLOW.DGO",
// "DGO/LCTYDEST.DGO",
"DGO/LCTYDEST.DGO",
// "DGO/LCTYHIJK.DGO",
// "DGO/LCTYPALT.DGO",
// "DGO/LCTYPATK.DGO",
@ -246,15 +246,15 @@
// "DGO/LDESGCST.DGO",
// "DGO/LDMPCKGN.DGO",
// "DGO/LERROL.DGO",
// "DGO/LFACB.DGO",
// "DGO/LFACCAR.DGO",
// "DGO/LFACCITY.DGO",
// "DGO/LFACO.DGO",
// "DGO/LFACRM1.DGO",
// "DGO/LFACRM2.DGO",
// "DGO/LFACTORY.DGO",
// "DGO/LFORM.DGO",
// "DGO/LFORP.DGO",
"DGO/LFACB.DGO",
"DGO/LFACCAR.DGO",
"DGO/LFACCITY.DGO",
"DGO/LFACO.DGO",
"DGO/LFACRM1.DGO",
"DGO/LFACRM2.DGO",
"DGO/LFACTORY.DGO",
"DGO/LFORM.DGO",
"DGO/LFORP.DGO",
// "DGO/LFORRING.DGO",
// "DGO/LFREEOUT.DGO",
// "DGO/LGUNNORM.DGO",
@ -272,14 +272,14 @@
// "DGO/LJKFEET.DGO",
// "DGO/LJNDKLEV.DGO",
// "DGO/LKEIRA.DGO",
// "DGO/LKLEEVER.DGO",
"DGO/LKLEEVER.DGO",
"DGO/LMECH.DGO",
// "DGO/LMHCA.DGO",
// "DGO/LMHCB.DGO",
// "DGO/LNSTCST.DGO",
// "DGO/LNSTOA.DGO",
// "DGO/LNSTOBB.DGO",
// "DGO/LNSTOBC.DGO",
"DGO/LNSTCST.DGO",
"DGO/LNSTOA.DGO",
"DGO/LNSTOBB.DGO",
"DGO/LNSTOBC.DGO",
// "DGO/LONINSIM.DGO",
// "DGO/LOUTRO.DGO",
// "DGO/LOUTRO2.DGO",
@ -300,13 +300,13 @@
// "DGO/LTORN.DGO",
// "DGO/LTORNJNX.DGO",
// "DGO/LTORNSAM.DGO",
// "DGO/LTOWA.DGO",
// "DGO/LTOWB.DGO",
"DGO/LTOWA.DGO",
"DGO/LTOWB.DGO",
// "DGO/LTOWCITY.DGO",
// "DGO/LTRTWHLS.DGO",
// "DGO/LVINCST.DGO",
// "DGO/LWASBBV.DGO",
// "DGO/LWASSIG.DGO",
"DGO/LWASBBV.DGO",
"DGO/LWASSIG.DGO",
// "DGO/LWLANDM.DGO",
"DGO/LWSTDPCK.DGO"
],

View File

@ -961,5 +961,594 @@
"part-tester": [
["L49", "uint64", true],
["L44", "uint64", true]
],
"des-beast": [
["L214", "attack-info"],
["L190", "attack-info"],
["L189", "attack-info"]
],
"sig-rider": [["L46", "attack-info"]],
"nst-eggs-h": [["L1", "(inline-array talker-speech-class)", 54]],
"nst-obs": [
["L739", "uint64", true],
["L733", "uint64", true],
["L741", "uint64", true],
["L742", "uint64", true],
["L740", "uint64", true],
["L735", "uint64", true],
["L738", "uint64", true],
["L736", "uint64", true],
["L734", "uint64", true],
["L737", "uint64", true],
["L632", "uint64", true],
["L638", "uint64", true],
["L633", "uint64", true],
["L640", "uint64", true],
["L631", "uint64", true],
["L643", "uint64", true],
["L634", "uint64", true],
["L644", "uint64", true],
["L637", "uint64", true],
["L639", "uint64", true],
["L635", "uint64", true],
["L641", "uint64", true],
["L636", "uint64", true],
["L642", "uint64", true]
],
"nst-gas": [["L110", "resetter-params"]],
"egg-spider": [["L231", "attack-info"]],
"wcar-marauder": [
["L68", "vector"],
["L67", "vector"],
["L66", "vector"],
["L65", "vector"],
["L64", "vector"],
["L63", "vector"],
["L62", "vector"],
["L61", "vector"],
["L69", "vector"]
],
"wcar-marauder-b": [
["L55", "vehicle-damage-info"],
["L53", "vehicle-setup-info"],
["L30", "vector"],
["L29", "vector"],
["L28", "vector"],
["L27", "vector"],
["L26", "vector"],
["L25", "vector"],
["L24", "vector"],
["L23", "vector"],
["L22", "vector"]
],
"wasdoors-init": [
["L41", "vector"],
["L40", "vector"]
],
"des-cactus": [
["L130", "vector"],
["L129", "vector"],
["L128", "vector"]
],
"desertg-obs": [
["L45", "attack-info"],
["L44", "attack-info"]
],
"desertf-obs": [["L99", "(inline-array vector)", 2]],
"desert-dust-storm": [["L89", "vector"]],
"artifact-race": [
["L162", "(inline-array talker-speech-class)", 16],
["L160", "vector"],
["L159", "vector"],
["L158", "vector"],
["L157", "vector"]
],
"turtle-training": [
["L154", "vector"],
["L153", "vector"],
["L152", "vector"]
],
"course-race": [
["L232", "(inline-array vector)", 2],
["L288", "vector"],
["L287", "vector"],
["L286", "vector"]
],
"flyingsaw": [["L36", "attack-info"]],
"temple-obs": [
["L595", "uint64", true],
["L606", "uint64", true],
["L596", "uint64", true],
["L603", "uint64", true],
["L605", "uint64", true],
["L597", "uint64", true],
["L601", "uint64", true],
["L599", "uint64", true],
["L604", "uint64", true],
["L600", "uint64", true],
["L602", "uint64", true],
["L598", "uint64", true],
["L470", "uint64", true],
["L474", "uint64", true],
["L483", "uint64", true],
["L485", "uint64", true],
["L482", "uint64", true],
["L480", "uint64", true],
["L471", "uint64", true],
["L406", "attack-info"],
["L475", "uint64", true],
["L476", "uint64", true],
["L484", "uint64", true],
["L472", "uint64", true],
["L395", "attack-info"],
["L479", "uint64", true],
["L478", "uint64", true],
["L481", "uint64", true],
["L477", "uint64", true],
["L473", "uint64", true]
],
"temple-obs2": [
["L514", "uint64", true],
["L516", "uint64", true],
["L517", "uint64", true],
["L522", "uint64", true],
["L521", "uint64", true],
["L519", "uint64", true],
["L515", "uint64", true],
["L513", "uint64", true],
["L520", "uint64", true],
["L518", "uint64", true],
["L428", "uint64", true],
["L429", "uint64", true],
["L433", "uint64", true],
["L432", "uint64", true],
["L427", "uint64", true],
["L431", "uint64", true],
["L430", "uint64", true],
["L338", "attack-info"],
["L434", "uint64", true],
["L378", "attack-info"],
["L426", "uint64", true]
],
"temple-mood": [["L14", "vector"]],
"tomb-baby-spider": [["L73", "attack-info"]],
"templex-mood": [["L8", "vector"]],
"scorpion-gun": [
["L460", "(inline-array talker-speech-class)", 59],
["L447", "vector"]
],
"mh-flyer": [["L159", "attack-info"]],
"target-turret-shot": [["L22", "attack-info"]],
"target-turret": [
["L405", "attack-info"],
["L397", "attack-info"],
["L395", "attack-info"],
["L389", "target-turret-info"]
],
"flamer-hover": [
["L86", "vector"],
["L85", "vector"],
["L84", "vector"],
["L92", "(pointer uint64)", 3],
["L91", "(pointer int32)", 4]
],
"robo-hover": [
["L174", "vector"],
["L173", "vector"],
["L172", "vector"]
],
"forest-mood": [["L14", "(inline-array vector4)", 3]],
"forest-tasks": [["L904", "vector"]],
"mh-plant": [["L111", "attack-info"]],
"forest-ring-chase": [["L343", "vector"]],
"dp-bipedal": [
["L638", "uint64", true],
["L636", "uint64", true],
["L639", "uint64", true],
["L637", "uint64", true],
["L581", "uint64", true],
["L580", "uint64", true],
["L576", "uint64", true],
["L579", "uint64", true],
["L577", "uint64", true],
["L468", "vector"],
["L467", "vector"],
["L578", "uint64", true],
["L575", "uint64", true]
],
"neo-wasp": [
["L181", "vector"],
["L180", "vector"],
["L179", "vector"]
],
"neo-spawner": [["L174", "vector"]],
"for-turret": [["L256", "target-turret-info"]],
"flitter": [
["L154", "vector"],
["L153", "vector"]
],
"target-indax": [["L379", "attack-info"]],
"volcano-obs": [
["L218", "attack-info"],
["L252", "attack-info"],
["L232", "attack-info"]
],
"flamer-lava": [
["L196", "vector"],
["L195", "vector"],
["L194", "vector"],
["L202", "(pointer int64)", 3],
["L201", "(pointer int32)", 4]
],
"dm-mine-spider": [["L175", "attack-info"]],
"spyder": [
["L186", "(inline-array ik-limb-setup)", 4],
["L176", "vector"],
["L175", "vector"],
["L188", "(pointer int64)", 3],
["L187", "(pointer int32)", 4]
],
"rapid-gunner": [
["L124", "vector"],
["L123", "vector"]
],
"kanga-lizard": [["L276", "(inline-array talker-speech-class)", 33]],
"stadium-obs": [
["L212", "uint64", true],
["L210", "uint64", true],
["L209", "uint64", true],
["L211", "uint64", true],
["L208", "uint64", true],
["L173", "uint64", true],
["L174", "uint64", true],
["L175", "uint64", true],
["L176", "uint64", true]
],
"wcar-faccar": [
["L51", "vector"],
["L50", "vector"],
["L49", "vector"],
["L48", "vector"],
["L47", "vector"],
["L46", "vector"],
["L45", "vector"],
["L44", "vector"],
["L43", "vector"]
],
"wasstadb-obs": [
["L261", "(pointer uint64)", 2],
["L252", "vector"]
],
"wasstadc-obs": [
["L984", "uint64", true],
["L1104", "uint64", true],
["L1107", "uint64", true],
["L1108", "uint64", true],
["L1105", "uint64", true],
["L1103", "uint64", true],
["L1101", "uint64", true],
["L1100", "uint64", true],
["L1097", "uint64", true],
["L1102", "uint64", true],
["L1098", "uint64", true],
["L1099", "uint64", true],
["L1106", "uint64", true],
["L982", "uint64", true],
["L987", "uint64", true],
["L981", "uint64", true],
["L980", "uint64", true],
["L988", "uint64", true],
["L979", "uint64", true],
["L986", "uint64", true],
["L983", "uint64", true],
["L985", "uint64", true],
["L978", "vector"],
["L851", "vector"],
["L843", "vector"],
["L825", "vector"],
["L823", "vector"],
["L822", "vector"],
["L821", "vector"],
["L820", "vector"],
["L819", "vector"],
["L810", "vector"],
["L809", "vector"]
],
"wascity-turret-shot": [["L49", "attack-info"]],
"dm-flyer": [["L80", "attack-info"]],
"maker-projectile": [["L51", "attack-info"]],
"wascity-turret": [
["L284", "vector"],
["L283", "vector"],
["L339", "(inline-array talker-speech-class)", 4],
["L290", "target-turret-info"]
],
"hvehicle": [
["L200", "attack-info"],
["L204", "attack-info"]
],
"glider-manager": [
["L276", "(inline-array glider-ring-info)", 80],
["L275", "(pointer handle)", 128],
["L216", "(inline-array glider-thermal-info)", 16]
],
"was-pre-game": [
["L723", "uint64", true],
["L719", "uint64", true],
["L724", "uint64", true],
["L721", "uint64", true],
["L722", "uint64", true],
["L718", "uint64", true],
["L720", "uint64", true],
["L636", "uint64", true],
["L627", "uint64", true],
["L632", "uint64", true],
["L621", "uint64", true],
["L619", "uint64", true],
["L623", "uint64", true],
["L630", "uint64", true],
["L629", "uint64", true],
["L620", "uint64", true],
["L633", "uint64", true],
["L635", "uint64", true],
["L626", "uint64", true],
["L628", "uint64", true],
["L631", "uint64", true],
["L622", "uint64", true],
["L625", "uint64", true],
["L624", "uint64", true],
["L634", "uint64", true]
],
"was-leaper-race": [["L204", "(inline-array talker-speech-class)", 21]],
"desert-lizard-h": [["L1", "(inline-array talker-speech-class)", 50]],
"desert-lizard-task": [
["L203", "resetter-params"],
["L201", "resetter-params"],
["L199", "resetter-params"]
],
"desert-scenes": [["L4037", "sphere"]],
"deswalk-obs": [
["L388", "attack-info"],
["L424", "attack-info"],
["L428", "attack-info"],
["L427", "attack-info"],
["L474", "attack-info"],
["L473", "attack-info"]
],
"terraformer-setup": [
["L732", "uint64", true],
["L745", "uint64", true],
["L739", "uint64", true],
["L731", "uint64", true],
["L734", "uint64", true],
["L736", "uint64", true],
["L742", "uint64", true],
["L733", "uint64", true],
["L738", "uint64", true],
["L735", "uint64", true],
["L737", "uint64", true],
["L744", "uint64", true],
["L740", "uint64", true],
["L741", "uint64", true],
["L743", "uint64", true],
["L600", "uint64", true],
["L597", "uint64", true],
["L599", "uint64", true],
["L596", "uint64", true],
["L595", "uint64", true],
["L504", "attack-info"],
["L601", "uint64", true],
["L522", "vector"],
["L594", "uint64", true],
["L598", "uint64", true],
["L593", "uint64", true]
],
"terraformer-head": [
["L500", "attack-info"],
["L502", "vector"],
["L508", "vector"],
["L507", "vector"],
["L509", "vector"]
],
"ocean-texture": [
["L55", "vector4w"],
["L56", "vector"]
],
"wasteland-scenes": [
["L307", "sphere"],
["L442", "sphere"],
["L530", "sphere"],
["L742", "sphere"],
["L966", "sphere"],
["L975", "sphere"],
["L1221", "sphere"],
["L1234", "sphere"],
["L1662", "sphere"],
["L1910", "sphere"]
],
"wasdoors-scenes": [["L649", "vector"]],
"wasdef-manager": [
["L750", "uint64", true],
["L751", "uint64", true],
["L748", "uint64", true],
["L749", "uint64", true],
["L576", "(inline-array talker-speech-class)", 33],
["L612", "uint64", true],
["L615", "uint64", true],
["L626", "uint64", true],
["L619", "uint64", true],
["L616", "uint64", true],
["L622", "uint64", true],
["L623", "uint64", true],
["L620", "uint64", true],
["L625", "uint64", true],
["L627", "uint64", true],
["L614", "uint64", true],
["L618", "uint64", true],
["L472", "vector4w"],
["L617", "uint64", true],
["L624", "uint64", true],
["L613", "uint64", true],
["L621", "uint64", true]
],
"des-bush": [
["L873", "uint64", true],
["L878", "uint64", true],
["L872", "uint64", true],
["L880", "uint64", true],
["L879", "uint64", true],
["L877", "uint64", true],
["L875", "uint64", true],
["L876", "uint64", true],
["L874", "uint64", true],
["L585", "uint64", true],
["L587", "uint64", true],
["L586", "uint64", true],
["L588", "uint64", true],
["L584", "uint64", true],
["L591", "uint64", true],
["L590", "uint64", true],
["L592", "uint64", true],
["L589", "uint64", true],
["L583", "uint64", true]
],
"des-burning-bush": [
["L182", "vector"],
["L219", "vector"]
],
"mh-wasp": [
["L128", "vector"],
["L127", "vector"],
["L126", "vector"]
],
"mh-centipede": [
["L740", "uint64", true],
["L741", "uint64", true],
["L731", "uint64", true],
["L732", "uint64", true],
["L737", "uint64", true],
["L733", "uint64", true],
["L735", "uint64", true],
["L734", "uint64", true],
["L739", "uint64", true],
["L736", "uint64", true],
["L738", "uint64", true],
["L571", "(inline-array talker-speech-class)", 36],
["L615", "uint64", true],
["L614", "uint64", true],
["L613", "uint64", true],
["L617", "uint64", true],
["L616", "uint64", true],
["L611", "uint64", true],
["L618", "uint64", true],
["L610", "uint64", true],
["L482", "attack-info"],
["L481", "attack-info"],
["L612", "uint64", true]
],
"mh-bat": [["L124", "(pointer int32)", 4]],
"factoryc-obs": [
["L202", "(inline-array vector)", 2],
["L256", "attack-info"],
["L252", "vector"],
["L247", "attack-info"]
],
"factoryc-obs2": [["L229", "attack-info"]],
"factory-boss-setup": [["L345", "(inline-array vector)", 2]],
"missile-bot": [
["L186", "attack-info"],
["L205", "vector"],
["L204", "vector"],
["L203", "vector"],
["L202", "vector"],
["L201", "vector"]
],
"factoryc-manager": [
["L46", "attack-info"],
["L47", "vector"],
["L50", "attack-info"],
["L48", "attack-info"]
],
"generic-merc": [["L175", "(inline-array invinitdata)", 8]],
"bot": [
["L391", "attack-info"],
["L390", "attack-info"]
],
"oasis-defense": [
["L196", "attack-info"],
["L195", "vector"]
],
"ash-oasis-course": [["L124", "uint64", true]],
"destroy-dark-eco": [["L197", "vector"]],
"comb-obs": [
["L136", "attack-info"],
["L139", "vector"],
["L138", "vector"]
],
"comb-sentry": [
["L93", "vector"],
["L91", "vector"],
["L87", "(inline-array vector)", 1],
["L88", "(inline-array vector)", 3]
],
"comb-field": [["L43", "vector"]],
"h-sled": [
["L175", "vector"],
["L174", "vector"],
["L173", "vector"],
["L172", "vector"],
["L171", "vector"],
["L170", "vector"],
["L169", "vector"],
["L167", "vector"],
["L166", "vector"],
["L177", "(inline-array vector)", 2],
["L176", "(inline-array vector)", 2],
["L162", "(inline-array vector)", 8]
],
"comb-travel": [
["L122", "vector"],
["L121", "vector"],
["L129", "vector"],
["L128", "vector"],
["L127", "vector"],
["L126", "vector"],
["L125", "vector"],
["L124", "vector"]
],
"warf-projectile": [["L163", "attack-info"]],
"h-warf": [["L187", "attack-info"]],
"fac-gunturret": [
["L91", "fac-gun-tower-turret-params"],
["L94", "attack-info"]
],
"fac-robotank-turret": [
["L178", "uint64", true],
["L177", "uint64", true],
["L135", "uint64", true],
["L138", "uint64", true],
["L137", "uint64", true],
["L136", "uint64", true],
["L139", "uint64", true]
],
"fac-tower": [["L137", "attack-info"]],
"fac-robotank": [
["L255", "uint64", true],
["L256", "uint64", true],
["L253", "uint64", true],
["L257", "uint64", true],
["L252", "uint64", true],
["L254", "uint64", true],
["L176", "uint64", true],
["L175", "uint64", true]
],
"factory-manager": [
["L306", "vector"],
["L305", "vector"],
["L304", "vector"],
["L303", "vector"],
["L302", "vector"],
["L345", "vector"],
["L346", "vector"]
]
}

View File

@ -3,5 +3,7 @@
"(method 29 target)": 2048,
"(method 11 part-spawner)": 64,
"(method 11 elevator)": 1024,
"scene-player-init": 1024
"scene-player-init": 1024,
"task-manager-init-by-other": 2048,
"race-manager-init-by-other": 1024
}

View File

@ -225,7 +225,7 @@
],
"board-turn-around?": [[48, "vector"]],
"target-board-green-eco-attack": [
[16, "bounding-box"],
[16, "vector"],
[32, ["array", "collide-shape", 384]]
],
"(enter target-board-jump)": [[48, "vector"]],
@ -502,7 +502,7 @@
[128, "vector"],
[1696, "vector"]
],
"(method 26 gun-red-shot)": [[16, "bounding-box"]],
"(method 26 gun-red-shot)": [[16, "vector"]],
"gun-dark-reaction": [[112, "vector"]],
"gun-fire-red-1": [
[16, "vector"],
@ -613,7 +613,7 @@
"(method 50 collide-shape)": [[32, "vector"]],
"(method 45 collide-shape)": [[16, "do-push-aways-work"]],
"(method 18 collide-shape-prim-mesh)": [[16, "collide-tri-result"]],
"(method 15 collide-shape-prim-sphere)": [[16, "collide-tri-result"]],
"(method 15 collide-shape-prim-sphere)": [[16, "collide-query"]],
"cshape-reaction-update-state": [
[16, "vector"],
[32, "vector"]
@ -642,7 +642,7 @@
"(method 33 spatial-hash)": [[16, ["inline-array", "vector", 2]]],
"(method 24 grid-hash)": [[16, "vector"]],
"(method 14 collide-cache)": [[16, "bounding-box"]],
"(method 16 collide-cache)": [[16, "collide-cache-tri"]],
"(method 16 collide-cache)": [[16, "collide-puls-work"]],
"(method 20 collide-cache)": [[16, "matrix"]],
"col-rend-draw": [[16, "matrix"]],
"(method 11 collide-mesh)": [[16, "spat-work"]],
@ -968,11 +968,11 @@
],
"(method 162 sew-laser-turret)": [
[32, ["array", "collide-shape", 384]],
[16, "bounding-box"]
[16, "vector"]
],
"(trans alert sew-laser-turret)": [
[32, ["array", "collide-shape", 384]],
[16, "bounding-box"]
[16, "vector"]
],
"(method 161 sew-laser-turret)": [[64, "rgbaf"]],
"(method 159 sew-laser-turret)": [[32, "vector"]],
@ -1127,7 +1127,7 @@
[640, "matrix"]
],
"(code target-pilot-get-off)": [[96, "matrix"]],
"target-pilot-trans": [[16, "matrix"]],
"target-pilot-trans": [[16, ["inline-array", "vector", 10]]],
"(method 34 was-squad-control)": [
[16, "cquery-with-vec"],
[576, ["inline-array", "vector", 2]],
@ -1175,5 +1175,768 @@
[64, ["inline-array", "quaternion", 2]]
],
"(method 17 turret-control)": [[16, "turret-control-stack-var0"]],
"(method 9 turret-control)": [[16, "turret-control-stack-var1"]]
"(method 9 turret-control)": [
[16, "turret-control-stack-var1"],
[272, "collide-query"]
],
"(code idle des-beast)": [[16, "vector"]],
"des-beast-gun-swivel-callback": [
[16, "vector"],
[80, "vector"]
],
"(trans idle beast-rider)": [[16, "vector"]],
"(method 31 beast-grenade)": [
[16, "light-trail-tracker-spawn-params"],
[48, "vector"]
],
"des-beast-gun-callback": [
[32, "vector"],
[80, "vector"]
],
"(method 84 des-beast)": [[176, "vector"]],
"(method 167 des-beast)": [[32, ["array", "collide-shape", 64]]],
"(method 164 des-beast)": [
[48, "vector"],
[176, "vector"]
],
"sig-pilot-trans": [[16, "matrix"]],
"update-nst-lights": [
[32, "vector"],
[48, "vector"]
],
"(code notice nst-cocoon-a)": [
[16, "vector"],
[32, "vector"]
],
"(code die nst-metalhead-eggs)": [[16, "vector"]],
"birth-func-find-ground": [
[16, "collide-query"],
[560, "vector"]
],
"spt-func-check-hit-ground": [[16, "vector"]],
"part-nest-bat1-path": [[80, "vector"]],
"part-nest-bat2-path": [[80, "vector"]],
"part-nest-bat3-path": [[80, "vector"]],
"part-nest-bat4-path": [[80, "vector"]],
"part-nest-bat5-path": [[80, "vector"]],
"part-nest-bat6-path": [[80, "vector"]],
"part-nest-bat7-path": [[80, "vector"]],
"part-nest-bat8-path": [[80, "vector"]],
"part-nest-bat9-path": [[80, "vector"]],
"part-nest-bat10-path": [[80, "vector"]],
"(method 160 egg-spider)": [[16, "vector"]],
"(method 194 egg-spider)": [
[32, "vector"],
[80, "vector"]
],
"(trans jump-on-vehicle egg-spider)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "vector"]
],
"(trans on-vehicle egg-spider)": [
[16, "vector"],
[32, "vector"]
],
"(trans idle spider-manager)": [
[160, "enemy-init-by-other-params"],
[48, "vector"],
[16, "vector"]
],
"(method 24 spider-manager)": [[16, "cquery-with-vec"]],
"(method 25 spider-manager)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "nav-poly"],
[112, "vector"],
[128, "vector"]
],
"check-drop-level-egg-spider-dirt-rubble": [[16, "vector"]],
"vehicle-draw-laser": [[32, "vector"]],
"vehicle-draw-beam": [[32, "vector"]],
"(method 30 v-marauder)": [[16, "vector"]],
"(method 79 v-marauder)": [[16, ["inline-array", "quaternion", 3]]],
"(method 90 v-marauder)": [
[16, "wcar-marauder-stack-var0"],
[48, ["inline-array", "vector", 1]],
[144, "wcar-marauder-stack-var0"],
[160, "wcar-marauder-stack-var0"],
[192, "wcar-marauder-stack-var0"]
],
"(method 79 v-marauder-b)": [[16, ["inline-array", "quaternion", 3]]],
"wasdoors-point-inside?": [[16, ["inline-array", "vector", 3]]],
"tizard-tilt-jmod-func": [[16, "quaternion"]],
"(method 34 tizard)": [
[16, "collide-query"],
[560, ["inline-array", "sphere", 2]]
],
"(method 90 wvehicle)": [[16, "wvehicle-physics-work"]],
"(method 30 des-plant)": [
[16, "vector"],
[32, ["inline-array", "quaternion", 10]]
],
"(event idle des-cactus-obstacle)": [[96, "vector"]],
"(code idle was-artifact)": [[64, "vector"]],
"(method 23 was-artifact)": [[16, "cquery-with-vec"]],
"(method 25 was-artifact)": [[16, "matrix"]],
"(code active task-manager-desert-artifact-race)": [
[144, "matrix"],
[96, ["inline-array", "task-arrow-params", 1]]
],
"(method 20 race-manager)": [[16, ["inline-array", "vector", 5]]],
"(method 9 racer-state)": [
[16, "matrix3"],
[48, "race-mesh-slice-query"],
[160, ["inline-array", "vector", 1]]
],
"(method 12 race-state)": [[16, ["array", "float", 10]]],
"(method 15 race-state)": [[16, "matrix"]],
"(method 17 race-state)": [[16, "race-manager-stack-var0"]],
"(method 19 race-state)": [[96, "matrix"]],
"(method 21 race-manager)": [[16, "race-manager-stack-var1"]],
"(method 15 hud-race-timer)": [[16, ["array", "time-frame", 5]]],
"(method 182 wvehicle)": [[16, ["inline-array", "vector", 1]]],
"(method 177 wvehicle)": [[16, "wvehicle-race-stack-var0"]],
"(method 185 wvehicle)": [[16, ["inline-array", "vector", 1]]],
"(method 181 wvehicle)": [
[16, "wvehicle-physics-work"],
[1552, "wvehicle-physics-work"]
],
"(method 180 wvehicle)": [[16, ["array", "int8", 16]]],
"kleever-pilot-trans": [[16, "kleever-rider-stack-var0"]],
"wland-driver-pilot-trans": [[16, "kleever-rider-stack-var0"]],
"(method 33 task-manager-race)": [[16, "course-race-stack-var0"]],
"(method 22 tpl-elec-swing-pole)": [
[16, "vector"],
[32, "vector"]
],
"(trans go-door tpl-token)": [
[96, ["inline-array", "vector", 16]],
[352, ["inline-array", "vector", 16]],
[688, "vector"]
],
"(method 164 des-beast-2)": [[32, "vector"]],
"(post hostile des-beast-2)": [
[112, ["inline-array", "vector", 16]],
[96, "vector"],
[464, "vector"],
[480, "vector"],
[560, ["inline-array", "vector", 2]]
],
"(method 31 beast-grenade-2)": [[16, "light-trail-tracker-spawn-params"]],
"(anon-function 2 des-beast-2)": [[16, "matrix"]],
"(anon-function 1 des-beast-2)": [[16, "matrix"]],
"(method 26 scorpion-gun-shot)": [[32, "vector"]],
"(post active scorpion-gun-manager)": [
[16, ["inline-array", "vector", 1]],
[32, ["inline-array", "vector", 2]]
],
"control-post": [[16, "quaternion"]],
"(code cam-scorpion-gun)": [[16, "event-message-block"]],
"(method 157 mh-flyer)": [
[16, "vector"],
[32, "vector"]
],
"mh-flyer-fly-post": [
[576, "vector"],
[640, ["inline-array", "vector", 2]]
],
"(method 31 mh-flyer-shot)": [[16, "light-trail-tracker-spawn-params"]],
"(enter impact mh-flyer-shot)": [[16, "explosion-init-params"]],
"scorpion-gun-manager-handler": [[16, "vector"]],
"(post firing scorpion-gun)": [
[16, "scorpion-gun-stack-var0"],
[272, "matrix"]
],
"aim-post": [
[640, "vector"],
[672, "vector"],
[688, "vector"],
[704, "vector"],
[720, "collide-query"],
[1264, "vector"],
[1280, ["array", "rgba", 1]],
[16, "event-message-block"],
[96, "vector"]
],
"(method 25 turret-shot)": [[32, "vector"]],
"(method 57 target-turret)": [[112, "vector"]],
"(method 11 hover-formation)": [[16, "vector"]],
"test-gen-perms": [[16, "gen-perms-context"]],
"gen-perms": [[16, ["array", "int32", 32]]],
"(method 14 hover-formation-control)": [[256, "vector"]],
"(method 11 hover-formation-control)": [[16, ["inline-array", "vector", 16]]],
"(method 11 hover-nav-control)": [[80, "vector"]],
"(method 25 hover-nav-control)": [[80, "vector"]],
"(method 37 nav-network)": [[16, "bounding-box"]],
"(method 27 nav-network)": [[16, "vector"]],
"(method 33 nav-network)": [[16, "vector"]],
"(method 34 nav-network)": [[48, "vector"]],
"(method 16 hover-nav-control)": [[16, "vector"]],
"(method 15 hover-nav-control)": [[16, "vector"]],
"(method 12 hover-nav-control)": [
[32, "vector"],
[48, "vector"]
],
"(method 169 hover-enemy)": [
[16, "vector"],
[32, "vector"],
[48, "collide-query"]
],
"(enter ambush hover-enemy)": [
[16, "vector"],
[32, "vector"]
],
"(method 176 hover-enemy)": [[16, "vector"]],
"(method 169 flamer-hover)": [
[16, "vector"],
[32, "vector"]
],
"(method 30 hover-nav-control)": [
[16, "vector"],
[64, "vector"],
[80, ["array", "float", 16]],
[32, "vector"],
[144, ["inline-array", "vector", 4]],
[208, ["inline-array", "vector", 4]]
],
"(event ambush-attack robo-hover)": [[16, "projectile-init-by-other-params"]],
"(anon-function 14 robo-hover)": [[112, "vector"]],
"(method 26 tow-spawner)": [
[16, "enemy-init-by-other-params"],
[80, "vector"],
[96, "vector"]
],
"(trans active tow-spawner)": [[16, ["inline-array", "vector", 1]]],
"(method 11 for-tower)": [[16, "vector"]],
"for-log-callback": [[16, "vector"]],
"spt-forest-check-ground-lie-flat": [
[16, "quaternion"],
[32, "matrix"]
],
"spt-check-water-lie-flat": [
[112, "vector"],
[128, "vector"]
],
"spt-func-birth-on-stop": [
[16, "vector"],
[32, "vector"]
],
"spt-func-for-ground-dirt-bounce1": [[16, "vector"]],
"spt-func-for-ground-dirt-bounce2": [[16, "vector"]],
"(code active task-manager-forest-plants)": [[176, "vector"]],
"(method 26 task-manager-forest-plants)": [
[96, "light-trail-tracker-spawn-params"]
],
"(post knocked-recover dp-bipedal)": [
[560, "vector"],
[576, "vector"]
],
"(enter shield-idle dp-bipedal)": [[16, "shield-sphere-spawn-params"]],
"(trans hostile dp-bipedal)": [[16, ["inline-array", "vector", 1]]],
"dp-bipedal-attack-close-post": [[16, ["inline-array", "vector", 1]]],
"dp-bipedal-formation-post": [[16, "vector"]],
"region-check-has-los": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"(post idle dp-bipedal-spawner)": [
[48, "enemy-init-by-other-params"],
[16, ["array", "collide-shape", 1]]
],
"trajectory-prediction": [[16, ["inline-array", "vector", 6]]],
"(method 206 dp-bipedal)": [[16, ["inline-array", "vector", 1]]],
"(method 209 dp-bipedal)": [[48, "vector"]],
"(method 208 dp-bipedal)": [[576, "vector"]],
"(post idle neo-wasp-spawner)": [[16, "enemy-init-by-other-params"]],
"(event attack neo-wasp)": [[16, "projectile-init-by-other-params"]],
"(anon-function 15 neo-wasp)": [
[32, "matrix"],
[112, "quaternion"],
[128, "vector"]
],
"(method 35 neo-spawner)": [[16, "enemy-init-by-other-params"]],
"(enter die neo-spawner)": [[192, "vector"]],
"(method 25 for-turret-shot)": [[32, "vector"]],
"(method 57 for-turret)": [
[96, "vector"],
[16, "matrix"]
],
"(method 15 hud-for-turret-health)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[112, "vector"],
[256, "vector"],
[272, "vector"],
[288, "vector"]
],
"(method 52 for-turret)": [
[32, "vector"],
[64, "vector"]
],
"(enter closed dm-spines)": [[16, ["inline-array", "vector", 2]]],
"check-drop-level-flitter-dirt-rubble": [[16, "vector"]],
"(method 11 chain-physics)": [
[144, "vector"],
[128, "vector"],
[160, "vector"],
[176, "vector"],
[192, "vector"],
[256, "vector"],
[208, "vector"],
[224, "vector"]
],
"(method 31 vol-balance-plat)": [
[32, "vector"],
[96, "vector"],
[112, "vector"]
],
"(method 47 vol-stone-lid)": [[16, "vector"]],
"(method 49 vol-stone-lid)": [[128, ["inline-array", "vector", 2]]],
"(code notice spiky-frog)": [[16, "vector"]],
"(method 121 flamer-lava)": [[16, "vector"]],
"(method 200 flamer-lava)": [[64, "vector"]],
"(method 204 flamer-lava)": [
[16, "vector"],
[32, "vector"]
],
"spt-func-birth-on-pop": [
[16, "vector"],
[32, "vector"]
],
"(code ambush mantis)": [[16, "vector"]],
"(code hop-away mantis)": [
[16, "vector"],
[32, "vector"]
],
"(method 74 mantis)": [[1104, ["inline-array", "sphere", 6]]],
"(method 160 mantis)": [[16, "vector"]],
"(code shatter mhcity-dark-eco-door-broken)": [[16, "vector"]],
"(trans idle dm-mine-spider-spawner)": [[32, "enemy-init-by-other-params"]],
"(method 32 dm-mine-spider-spawner)": [[16, "cquery-with-vec"]],
"(method 33 dm-mine-spider-spawner)": [
[16, "vector"],
[32, "vector"]
],
"(method 160 dm-mine-spider)": [[16, "vector"]],
"(method 192 dm-mine-spider)": [[32, "vector"]],
"check-drop-level-dm-mine-spider-dirt-rubble": [[16, "vector"]],
"(method 160 spyder)": [[16, "vector"]],
"(method 197 spyder)": [
[640, "vector"],
[624, "vector"]
],
"(method 79 v-faccar)": [[16, ["inline-array", "quaternion", 1]]],
"part-wasstada-bird2-path": [[80, "vector"]],
"(code ambush marauder)": [
[32, "vector"],
[80, "vector"]
],
"(code save marauder)": [[16, "vector"]],
"(code hostile marauder)": [[16, "vector"]],
"(trans hostile marauder)": [[32, "vector"]],
"(method 197 marauder)": [
[64, "vector"],
[192, "vector"]
],
"(method 40 wstd-fight-plat-box)": [
[16, ["inline-array", "vector", 4]],
[128, "vector"]
],
"(method 38 wstd-fight-plat-box)": [[16, "vector"]],
"(method 39 wstd-fight-plat-box)": [
[32, ["array", "collide-shape", 64]],
[16, "vector"],
[288, "vector"]
],
"(enter go-down task-manager-arena-fight)": [[16, "vector"]],
"(method 36 task-manager-arena-fight-base)": [[16, "vector"]],
"(method 32 task-manager-arena-fight-base)": [
[16, "marauder-init-by-other-params"]
],
"(enter go-down task-manager-arena-fight-2)": [[16, "vector"]],
"(method 15 hud-wasgun)": [[48, "vector"]],
"(method 25 wascity-turret-shot)": [[32, "vector"]],
"(method 31 dm-flyer-shot)": [[16, "light-trail-tracker-spawn-params"]],
"(method 31 maker-grenade)": [[32, "light-trail-tracker-spawn-params"]],
"spawn-skeet-enum": [[16, "vector"]],
"def-launch-circle": [
[16, "vector"],
[32, "vector"]
],
"(method 26 task-manager-wascity-gungame)": [[144, "vector"]],
"(method 56 wascity-turret)": [[32, "vector"]],
"(method 44 wascity-turret)": [
[176, "vector"],
[144, "vector"]
],
"(method 62 wascity-turret)": [
[16, "matrix"],
[80, "vector"],
[752, "vector"],
[624, "vector"],
[656, "vector"],
[704, "vector"],
[880, "vector"]
],
"(method 57 wascity-turret)": [[128, "vector"]],
"wascity-turret-add-radar": [[32, "vector"]],
"(method 21 traffic-manager)": [[16, ["array", "int8", 29]]],
"(method 13 xz-height-map)": [[16, ["inline-array", "vector", 2]]],
"(method 10 xz-height-map)": [[16, ["inline-array", "bounding-box", 2]]],
"(method 20 vehicle-controller)": [[16, ["inline-array", "vector", 2]]],
"(method 16 vehicle-controller)": [[16, ["inline-array", "vector", 2]]],
"(method 51 hvehicle)": [[16, "vehicle-physics-work"]],
"(method 90 hvehicle)": [[16, "vehicle-physics-work"]],
"(method 157 hvehicle)": [[16, "matrix"]],
"(method 94 hvehicle)": [[16, "matrix"]],
"(method 91 hvehicle)": [[16, "vehicle-controls"]],
"(method 54 hvehicle)": [[16, "rigid-body-move-work"]],
"(method 30 hvehicle)": [[16, ["inline-array", "vector", 2]]],
"(method 18 vehicle-controller)": [
[32, "vehicle-physics-work"],
[288, ["array", "collide-shape", 10]]
],
"(method 158 hvehicle)": [[16, ["inline-array", "vector", 2]]],
"(method 20 traffic-engine)": [[16, "traffic-find-segment-struct"]],
"(method 31 hvehicle)": [
[960, ["inline-array", "vector", 4]],
[1056, "vector"],
[1072, ["inline-array", "vehicle-attach-point", 4]]
],
"(method 97 hvehicle)": [[16, "collide-query"]],
"(method 78 hvehicle)": [[16, "hvehicle-effects-stack-var0"]],
"(post idle glider-ring)": [[128, "vector"]],
"glider-ring-standard-event-handler": [[16, ["inline-array", "vector", 2]]],
"glider-ring-init-by-other": [
[48, "light-trail-tracker-spawn-params"],
[16, "vector"]
],
"(method 49 h-glider)": [[16, "vector"]],
"(method 36 task-manager-desert-glide)": [[224, "vector"]],
"(method 26 task-manager-desert-glide)": [
[96, ["array", "symbol", 10]],
[144, "vector"]
],
"(method 31 h-glider)": [[48, "vehicle-physics-work"]],
"sparticle-shadow-update": [
[16, "vector"],
[32, "matrix"],
[96, "vector"]
],
"(method 27 was-pre-game)": [[16, "vector"]],
"(method 31 was-pre-game)": [
[80, "vector"],
[96, "vector"],
[112, "vector"],
[128, "vector"]
],
"(post attack was-pre-beam)": [[16, "vector"]],
"(post idle was-pre-beam)": [[16, "vector"]],
"(method 187 flut-racer)": [
[96, ["array", "collide-shape", 384]],
[80, "vector"]
],
"ring-hit-logic": [[112, "vector"]],
"(method 30 task-manager-wascity-leaper-race)": [
[96, ["array", "symbol", 10]]
],
"(code active task-manager-wascity-leaper-race)": [
[32, ["array", "symbol", 10]]
],
"(enter fail task-manager-wascity-leaper-race)": [
[16, ["array", "symbol", 10]]
],
"(method 26 task-manager-desert-catch-lizards)": [
[224, ["array", "collide-shape", 32]]
],
"(method 33 task-manager-desert-catch-lizards)": [
[32, ["inline-array", "vector", 2]]
],
"(method 165 desert-lizard)": [
[32, "vector"],
[48, "vector"],
[64, ["inline-array", "vector", 1]]
],
"(post idle desert-lizard-spawner)": [[48, "enemy-init-by-other-params"]],
"(anon-function 33 desert-scenes)": [[16, "vector"]],
"(method 19 dm-tentacle-ragdoll)": [
[16, "vector"],
[32, "vector"]
],
"foot-impact": [[16, "vector"]],
"launch-mine": [
[16, "vector"],
[48, "enemy-init-by-other-params"]
],
"(method 10 terraformer-foot-mark-pt-array)": [
[592, ["inline-array", "vector", 4]],
[1216, "bounding-box"]
],
"(enter run-script terraformer-head)": [[16, "vector"]],
"(enter swing-laser terraformer-head)": [[16, "vector"]],
"terraformer-head-launch-critter": [
[16, "vector"],
[32, "enemy-init-by-other-params"],
[160, "matrix"]
],
"terraformer-head-always": [
[272, "vector"],
[256, "vector"]
],
"(method 12 ocean)": [[16, "vector"]],
"(method 18 ocean)": [
[16, "vector"],
[32, "vector4"],
[48, "vector"]
],
"(method 28 ocean)": [[16, "vector"]],
"(method 33 ocean)": [[16, "vector"]],
"(method 34 ocean)": [[16, "vector"]],
"(method 35 ocean)": [[16, "vector"]],
"(method 36 ocean)": [
[16, "vector"],
[32, "vector"]
],
"(method 46 ocean)": [[16, "vector"]],
"(method 59 ocean)": [[16, "vector"]],
"(method 60 ocean)": [
[16, "vector"],
[32, "vector"]
],
"(method 61 ocean)": [
[16, "vector"],
[32, "vector"]
],
"(method 62 ocean)": [
[16, "vector"],
[32, "vector"]
],
"(method 63 ocean)": [
[16, "vector"],
[32, "vector"]
],
"(method 67 ocean)": [[16, "vector"]],
"(post flying maker)": [[48, "vector"]],
"(post standup maker)": [
[16, "vector"],
[32, "vector"]
],
"(method 36 maker)": [
[64, "vector"],
[336, "vector"]
],
"(method 41 maker)": [[560, "vector"]],
"maker-init-by-other": [[32, "light-trail-tracker-spawn-params"]],
"(trans active task-manager-bbush-spirit-chase)": [
[80, "vector"],
[96, "vector"],
[128, "vector"]
],
"(trans idle desert-chase-ring)": [[16, "vector"]],
"(trans active task-manager-bbush-spirit-drop)": [
[80, "vector"],
[96, "vector"],
[128, "vector"]
],
"(code active task-manager-desert-bbush-get-to)": [
[160, "vector"],
[176, "matrix"]
],
"(trans menu des-burning-bush)": [
[16, "vector"],
[32, "vector"]
],
"(trans talking des-burning-bush)": [[16, "des-burning-bush-stack-var0"]],
"(method 37 des-burning-bush)": [[16, "bbush-menu-state"]],
"(method 38 des-burning-bush)": [[112, "des-burning-bush-stack-var1"]],
"trail-effect-init-by-other": [[16, "light-trail-tracker-spawn-params"]],
"(trans active task-manager-bbush-timer-chase)": [[80, "vector"]],
"(event attack mh-wasp)": [[16, "projectile-init-by-other-params"]],
"(anon-function 9 mh-wasp)": [[112, "vector"]],
"check-mh-centipede-explosion-level": [[16, "vector"]],
"spt-func-ground-dirt-bounce2": [[16, "vector"]],
"spt-func-ground-dirt-bounce1": [[16, "vector"]],
"(method 42 mh-centipede)": [
[144, "vector"],
[160, "vector"],
[176, "vector"],
[16, "projectile-init-by-other-params"]
],
"(method 38 mh-centipede)": [[16, "matrix"]],
"(method 39 mh-centipede)": [[16, "matrix"]],
"(method 40 mh-centipede)": [
[16, "matrix"],
[816, "vector"],
[832, "vector"]
],
"(trans die mh-centipede)": [[96, "vector"]],
"(method 10 mh-centipede-crater-pt-array)": [
[592, ["inline-array", "vector", 4]],
[1216, "bounding-box"]
],
"(method 161 mh-bat)": [
[16, "vector"],
[32, "vector"]
],
"mh-bat-fly-post": [
[16, "vector"],
[32, "vector"]
],
"(post idle fac-fire-torch)": [[16, "matrix"]],
"fac-robopod-add-hoverbot": [[32, "enemy-init-by-other-params"]],
"(enter impact factory-boss-shockwave-bomb)": [[176, "vector"]],
"(method 9 factory-boss-lightning-gate)": [
[16, "vector"],
[32, "vector"]
],
"(method 59 missile-bot)": [[80, "vector"]],
"factory-boss-launch-critter": [
[32, "enemy-init-by-other-params"],
[160, "matrix"]
],
"factory-boss-launch-critter-handler": [
[96, "vector"],
[112, "vector"],
[128, "matrix"]
],
"factory-boss-always": [
[224, "vector"],
[16, "vector"],
[240, "vector"],
[80, "matrix"]
],
"(method 201 bot)": [[16, "enemy-best-focus"]],
"(method 202 bot)": [[16, "connection-pers"]],
"(method 25 ashelin-shot)": [[32, "vector"]],
"(method 248 ashelin)": [
[16, "nav-avoid-spheres-params"],
[112, "clamp-travel-vector-to-mesh-return-info"]
],
"(code active task-manager-desert-oasis-defense)": [
[112, "mystery-traffic-object-spawn-params0"]
],
"(method 32 task-manager-desert-oasis-defense)": [
[16, "mystery-traffic-object-spawn-params0"]
],
"(method 33 task-manager-desert-oasis-defense)": [
[16, "marauder-init-by-other-params"]
],
"(method 26 task-manager-desert-oasis-defense)": [
[96, "wvehicle-ai-drop-off-params"]
],
"(trans active dark-eco-orb)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "collide-query"],
[624, "vector"],
[640, "vector"],
[656, "vector"],
[672, "vector"]
],
"(method 26 task-manager-destroy-darkeco)": [[16, ["array", "symbol", 10]]],
"(trans idle grind-electricity)": [
[16, "vector"],
[32, "vector"]
],
"dark-eco-tower-init-by-other": [
[16, "vector"],
[16, "vector"],
[32, "vector"],
[48, "puffer-init-by-other-params"]
],
"spawn-shock-effect": [
[80, "collide-query"],
[16, "matrix"],
[624, "vector"]
],
"(method 34 comb-block)": [[16, "vector"]],
"(method 11 comb-pillar)": [[16, ["inline-array", "vector", 1]]],
"(method 25 comb-sentry-shot)": [[32, "vector"]],
"(method 32 comb-sentry)": [
[16, "matrix"],
[80, ["inline-array", "vector", 5]]
],
"(method 38 comb-sentry)": [[16, "comb-sentry-stack-var0"]],
"(method 39 comb-sentry)": [[16, "comb-sentry-stack-var1"]],
"sled-shot-reaction": [[16, ["inline-array", "vector", 1]]],
"(method 33 h-sled)": [[16, ["inline-array", "vector", 2]]],
"(method 90 h-sled)": [[16, "h-sled-physics-work"]],
"(method 93 h-sled)": [[16, "matrix"]],
"(method 38 h-sled)": [
[16, "matrix"],
[64, ["inline-array", "vector", 2]]
],
"(method 31 h-sled)": [
[1056, "matrix"],
[1104, "matrix"],
[1168, "matrix"],
[16, "h-sled-physics-work"]
],
"(method 97 h-sled)": [
[16, "collide-query"],
[560, ["inline-array", "vector", 1]],
[624, "vector"]
],
"(method 152 h-sled)": [[16, "comb-sentry-stack-var0"]],
"(method 25 sled-shot)": [[32, "vector"]],
"sled-find-mesh-dir": [[16, "h-sled-stack-var0"]],
"(method 78 h-sled)": [[16, "h-sled-stack-var1"]],
"(method 25 ffight-shot)": [[32, "vector"]],
"(enter impact ftank-shot)": [[16, "traffic-danger-info"]],
"(method 25 ftank-shot)": [[32, "vector"]],
"(method 25 fturret-shot)": [[32, "vector"]],
"(method 25 gun-warf-shot)": [[32, "vector"]],
"(enter impact warf-projectile)": [[16, "warf-explosion-sphere-init-params"]],
"(method 43 warf-projectile)": [[16, ["array", "collide-shape", 384]]],
"(method 91 h-warf)": [
[112, "projectile-init-by-other-params"],
[80, "vector"],
[96, "vector"],
[864, "vector"]
],
"(method 31 h-warf)": [[48, "vehicle-physics-work"]],
"(method 51 h-warf)": [[16, "rigid-body-impact"]],
"(method 54 h-warf)": [[16, "vehicle-physics-work"]],
"(method 78 h-warf)": [[16, "h-warf-stack-var0"]],
"(method 164 h-warf)": [[16, "vector"]],
"(code hostile fac-gunturret)": [[16, "vector"]],
"fac-robotank-turret-init-by-other": [[16, "vector"]],
"(method 31 fac-robotank-turret)": [[16, "collide-query"]],
"(method 33 fac-robotank-turret)": [
[16, ["inline-array", "vector", 2]],
[48, ["inline-array", "vector", 2]]
],
"robotank-turret-handler": [
[16, "vector"],
[32, "quaternion"]
],
"draw-2d-hud": [
[16, ["inline-array", "vector4w", 4]],
[80, "vector4w"]
],
"(method 36 fac-gun-tower)": [
[16, "vector"],
[32, ["array", "collide-shape", 384]]
],
"(method 35 fac-gun-tower)": [[32, "vector"]],
"fac-robotank-init-by-other": [[32, "vector"]],
"(trans flying factory-fighter)": [[16, "vector"]],
"(method 16 factory-manager)": [
[48, "vector"],
[64, "vector"],
[80, "vector"],
[128, "vector"]
],
"factory-fighter-init-by-other": [[16, "light-trail-tracker-spawn-params"]],
"(code explode factory-fighter)": [[112, "vector"]]
}

File diff suppressed because it is too large Load Diff

View File

@ -2011,5 +2011,68 @@
"vars": {
"v0-0": ["v0-0", "saberfish-find-behavior"]
}
},
"(method 23 spider-manager)": {
"vars": {
"s3-0": ["dist", "float"]
}
},
"(method 121 sewer-frog)": {
"vars": {
"v1-10": ["name", "sound-name"]
}
},
"(trans target-board-ride-edge)": {
"vars": {
"a0-44": ["name", "sound-name"]
}
},
"(method 9 menu-create-game-option)": {
"vars": {
"a0-26": ["name", "sound-name"]
}
},
"(code active task-manager-forest-plants)": {
"vars": {
"s5-8": ["hand", "handle"]
}
},
"(method 31 dm-mine-spider-spawner)": {
"vars": {
"s3-0": ["s3-0", "float"]
}
},
"(method 26 task-manager-wascity-gungame)": {
"vars": {
"s4-1": ["sname", "sound-name"]
}
},
"terraformer-head-always": {
"vars": {
"s4-2": ["sname", "sound-name"]
}
},
"launch-mine": {
"vars": {
"v0-1": ["hand", "handle"]
}
},
"(method 42 mh-centipede)": {
"vars": {
"s0-0": ["sname", "sound-name"]
}
},
"check-enemy": {
"args": ["turret", "radius", "pfoc"]
},
"(method 202 bot)": {
"vars": {
"s4-0": ["cspec", "collide-spec"]
}
},
"(enter impact warf-projectile)": {
"vars": {
"s4-0": ["sname", "sound-name"]
}
}
}

View File

@ -267,6 +267,11 @@ std::tuple<uint64_t, int> calculate_extraction_hash(const fs::path& extracted_is
int filec = 0;
for (auto const& dir_entry : fs::recursive_directory_iterator(extracted_iso_path)) {
if (dir_entry.is_regular_file()) {
// skip the `buildinfo.json` file, we make that -- not relevant!
if (dir_entry.path().filename() == "buildinfo.json") {
lg::warn("skipping buildinfo.json, that is a file our tools generate");
continue;
}
auto buffer = file_util::read_binary_file(dir_entry.path().string());
auto hash = XXH64(buffer.data(), buffer.size(), 0);
combined_hash ^= hash;

View File

@ -102,7 +102,10 @@ std::tuple<std::optional<ISOMetadata>, ExtractorErrorCode> validate(
};
}
void decompile(const fs::path& iso_data_path, const std::string& data_subfolder) {
// TODO - remove code duplication, most of this is copying what happens in decompiler's `main.cpp`
void decompile(const fs::path& iso_data_path,
const std::string& data_subfolder,
const std::string& config_override) {
using namespace decompiler;
// Determine which config to use from the database
@ -111,7 +114,7 @@ void decompile(const fs::path& iso_data_path, const std::string& data_subfolder)
Config config = read_config_file(file_util::get_jak_project_dir() / "decompiler" / "config" /
version_info.game_name /
fmt::format("{}_config.jsonc", version_info.game_name),
version_info.decomp_config_version);
version_info.decomp_config_version, config_override);
std::vector<fs::path> dgos, objs, tex_strs, art_strs;
@ -220,6 +223,8 @@ ExtractorErrorCode compile(const fs::path& iso_data_path, const std::string& dat
Compiler compiler(game_name_to_version(version_info.game_name));
compiler.make_system().set_constant("*iso-data*", absolute(iso_data_path).string());
compiler.make_system().set_constant("*use-iso-data-path*", true);
file_util::set_iso_data_dir(absolute(iso_data_path));
lg::info("set iso_data_dir to {}", absolute(iso_data_path).string());
int flags = 0;
for (const auto& flag : version_info.flags) {
@ -257,6 +262,7 @@ int main(int argc, char** argv) {
fs::path input_file_path;
fs::path project_path_override;
fs::path extraction_path;
bool flag_runall = false;
bool flag_extract = false;
bool flag_fail_on_validation = false;
@ -265,16 +271,22 @@ int main(int argc, char** argv) {
bool flag_play = false;
bool flag_folder = false;
std::string game_name = "jak1";
std::string decomp_config_override = "{}";
lg::initialize();
CLI::App app{"OpenGOAL Level Extraction Tool"};
CLI::App app{"OpenGOAL Extractor (ISO Tools + Decompiler + Compiler)"};
app.add_option("game-files-path", input_file_path,
"The path to the folder with the ISO extracted or the ISO itself")
->required();
app.add_option("--proj-path", project_path_override,
"Explicitly set the location of the 'data/' folder");
app.add_option("--extract-path", extraction_path,
"Explicitly set the location for where the ISO should be extracted");
app.add_option("-g,--game", game_name, "Specify the game name, defaults to 'jak1'");
app.add_option(
"--decomp-config-override", decomp_config_override,
"JSON provided will be merged with the decompiler config, use to override options");
app.add_flag("-a,--all", flag_runall, "Run all steps, from extraction to playing the game");
app.add_flag("-e,--extract", flag_extract, "Extract the ISO");
app.add_flag("-v,--validate", flag_fail_on_validation,
@ -282,7 +294,7 @@ int main(int argc, char** argv) {
app.add_flag("-d,--decompile", flag_decompile, "Decompile the game data");
app.add_flag("-c,--compile", flag_compile, "Compile the game");
app.add_flag("-p,--play", flag_play, "Play the game");
app.add_flag("-f,--folder", flag_folder, "Extract from folder");
app.add_flag("-f,--folder", flag_folder, "Take ISO input from a folder");
define_common_cli_arguments(app);
app.validate_positionals();
CLI11_PARSE(app, argc, argv);
@ -347,6 +359,10 @@ int main(int argc, char** argv) {
if (flag_extract) {
// we extract to a temporary location because we don't know what we're extracting yet!
fs::path temp_iso_extract_location = file_util::get_jak_project_dir() / "iso_data" / "_temp";
if (!extraction_path.empty()) {
temp_iso_extract_location = extraction_path / "_temp";
}
lg::info("Extracting ISO to temporary dir at: {}", temp_iso_extract_location.string());
if (input_file_path != temp_iso_extract_location) {
// in case input is also output, don't just wipe everything (weird)
fs::remove_all(temp_iso_extract_location);
@ -379,14 +395,25 @@ int main(int argc, char** argv) {
// We know the version since we just extracted it, so the user didn't need to provide this
// explicitly
data_subfolder = data_subfolders.at(version_info->game_name);
iso_data_path = file_util::get_jak_project_dir() / "iso_data" / data_subfolder;
if (fs::exists(iso_data_path)) {
if (!extraction_path.empty()) {
iso_data_path = extraction_path / data_subfolder;
} else {
iso_data_path = file_util::get_jak_project_dir() / "iso_data" / data_subfolder;
}
if (fs::exists(iso_data_path) && iso_data_path != temp_iso_extract_location) {
fs::remove_all(iso_data_path);
}
// std::filesystem doesn't have a rename for dirs...
fs::copy(temp_iso_extract_location, iso_data_path, fs::copy_options::recursive);
fs::remove_all(temp_iso_extract_location);
// NOTE - potential disaster here, don't do either if the directories are the same location
// or don't copy if the temp location is _inside_ the destination directory
if (!file_util::is_dir_in_dir(iso_data_path, temp_iso_extract_location)) {
fs::copy(temp_iso_extract_location, iso_data_path, fs::copy_options::recursive);
}
if (iso_data_path != temp_iso_extract_location) {
// in case input is also output, don't just wipe everything (weird)
fs::remove_all(temp_iso_extract_location);
}
}
} else if (fs::is_directory(input_file_path)) {
if (!flag_folder) {
@ -418,12 +445,16 @@ int main(int argc, char** argv) {
} else {
// If we did not extract, we have no clue what game the user is trying to decompile / compile
// this is why the user has to specify this!
iso_data_path = file_util::get_jak_project_dir() / "iso_data" / data_subfolder;
if (flag_folder) {
iso_data_path = input_file_path;
} else {
iso_data_path = file_util::get_jak_project_dir() / "iso_data" / data_subfolder;
}
}
if (flag_decompile) {
try {
decompile(iso_data_path, data_subfolder);
decompile(iso_data_path, data_subfolder, decomp_config_override);
} catch (std::exception& e) {
lg::error("Error during decompile: {}", e.what());
return static_cast<int>(ExtractorErrorCode::DECOMPILATION_GENERIC_ERROR);

View File

@ -690,7 +690,7 @@ goos::Object decompile_sound_spec(const TypeSpec& type,
the_macro.push_back(pretty_print::to_symbol(fmt::format(":num {}", num)));
}
if (group != 1) {
the_macro.push_back(pretty_print::to_symbol(fmt::format(":group {}", num)));
the_macro.push_back(pretty_print::to_symbol(fmt::format(":group {}", group)));
}
if ((mask & 1) || volume != 1024) {
implicit_mask |= 1 << 0;
@ -976,14 +976,9 @@ const std::unordered_map<
{"lightning-probe-vars",
{{"probe-dirs", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}}},
{"continue-point",
{{"want", ArrayFieldDecompMeta(TypeSpec("level-buffer-state-small"),
8,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{{"want", ArrayFieldDecompMeta(TypeSpec("level-buffer-state-small"), 8)}}},
{"task-manager-info",
{{"sphere-array",
ArrayFieldDecompMeta(TypeSpec("sphere"),
16,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{{"sphere-array", ArrayFieldDecompMeta(TypeSpec("sphere"), 16)}}},
{"sparticle-launcher",
{{"init-specs", ArrayFieldDecompMeta(TypeSpec("sp-field-init-spec"), 16)}}},
{"sparticle-launch-group",
@ -991,27 +986,51 @@ const std::unordered_map<
{"simple-sprite-system",
{{"data", ArrayFieldDecompMeta(TypeSpec("sprite-glow-data"), 64)}}},
{"actor-hash-bucket",
{{"data", ArrayFieldDecompMeta(TypeSpec("actor-cshape-ptr"),
16,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{{"data", ArrayFieldDecompMeta(TypeSpec("actor-cshape-ptr"), 16)}}},
{"nav-mesh",
{{"poly-array", ArrayFieldDecompMeta(TypeSpec("nav-poly"), 64)},
{"nav-control-array", ArrayFieldDecompMeta(TypeSpec("nav-control"), 288)}}},
{"enemy-info",
{{"idle-anim-script",
ArrayFieldDecompMeta(TypeSpec("idle-control-frame"),
32,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{{"idle-anim-script", ArrayFieldDecompMeta(TypeSpec("idle-control-frame"), 32)}}},
{"nav-enemy-info",
{{"idle-anim-script",
ArrayFieldDecompMeta(TypeSpec("idle-control-frame"),
32,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{{"idle-anim-script", ArrayFieldDecompMeta(TypeSpec("idle-control-frame"), 32)}}},
{"vehicle-rider-info",
{{"attach-point-array",
ArrayFieldDecompMeta(TypeSpec("vehicle-attach-point"),
32,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{{"grab-rail-array", ArrayFieldDecompMeta(TypeSpec("vehicle-grab-rail-info"), 48)},
{"attach-point-array", ArrayFieldDecompMeta(TypeSpec("vehicle-attach-point"), 32)}}},
{"desbeast-path", {{"node", ArrayFieldDecompMeta(TypeSpec("desbeast-node"), 32)}}},
{"race-info",
{{"turbo-pad-array", ArrayFieldDecompMeta(TypeSpec("race-turbo-pad"), 32)},
{"racer-array", ArrayFieldDecompMeta(TypeSpec("race-racer-info"), 16)},
{"decision-point-array",
ArrayFieldDecompMeta(TypeSpec("race-decision-point"), 16)}}},
{"flyingsaw-graph", {{"node", ArrayFieldDecompMeta(TypeSpec("flyingsaw-node"), 48)}}},
{"nav-network-info",
{{"adjacency", ArrayFieldDecompMeta(TypeSpec("nav-network-adjacency"), 16)}}},
{"forest-path-points-static",
{{"points", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}}},
{"xz-height-map",
{{"data", ArrayFieldDecompMeta(TypeSpec("int8"),
1,
ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}},
{"was-pre-game-game",
{{"wave", ArrayFieldDecompMeta(TypeSpec("was-pre-game-wave"), 32)}}},
{"lizard-graph",
{{"point", ArrayFieldDecompMeta(TypeSpec("vector"), 16)},
{"edge", ArrayFieldDecompMeta(TypeSpec("lizard-graph-edge"), 16)}}},
{"terraformer-graph",
{{"node", ArrayFieldDecompMeta(TypeSpec("terraformer-node"), 32)},
{"edge", ArrayFieldDecompMeta(TypeSpec("terraformer-edge"), 16)}}},
{"bombbot-path", {{"node", ArrayFieldDecompMeta(TypeSpec("bombbot-node"), 32)}}},
{"ai-task-pool",
{{"tasks", ArrayFieldDecompMeta(TypeSpec("uint32"),
4,
ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}},
{"bot-course", {{"spots", ArrayFieldDecompMeta(TypeSpec("bot-spot"), 32)}}},
{"ashelin-course",
{{"spots", ArrayFieldDecompMeta(TypeSpec("bot-spot"), 32)},
{"speeches", ArrayFieldDecompMeta(TypeSpec("bot-speech-info"), 16)},
{"dirs", ArrayFieldDecompMeta(TypeSpec("vector"), 16)},
{"speech-tunings", ArrayFieldDecompMeta(TypeSpec("bot-speech-tuning"), 16)}}},
}}};
goos::Object decompile_structure(const TypeSpec& type,

View File

@ -31,6 +31,7 @@ set(RUNTIME_SOURCE
graphics/gfx.cpp
graphics/jak2_texture_remap.cpp
graphics/jak3_texture_remap.cpp
graphics/screenshot.cpp
graphics/opengl_renderer/background/background_common.cpp
graphics/opengl_renderer/background/Shrub.cpp
graphics/opengl_renderer/background/TFragment.cpp
@ -209,6 +210,10 @@ set(RUNTIME_SOURCE
mips2c/jak3_functions/nav_engine.cpp
mips2c/jak3_functions/merc_blend_shape.cpp
mips2c/jak3_functions/wvehicle_part.cpp
mips2c/jak3_functions/ripple.cpp
mips2c/jak3_functions/ocean.cpp
mips2c/jak3_functions/ocean_vu0.cpp
mips2c/jak3_functions/generic_merc.cpp
mips2c/mips2c_table.cpp
overlord/common/dma.cpp
overlord/common/fake_iso.cpp

View File

@ -12,7 +12,6 @@ enum class Language {
Italian = 4,
Japanese = 5,
UK_English = 6,
// uk english?
Portuguese = 9
};

View File

@ -141,6 +141,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<TextureUploadHandler>("tex-lcom-sky-pre", BucketCategory::TEX,
BucketId::TEX_LCOM_SKY_PRE, texture_animator);
init_bucket_renderer<OceanMidAndFar>("ocean-mid-far", BucketCategory::OCEAN,
BucketId::OCEAN_MID_FAR);
// 10
for (int i = 0; i < LEVEL_MAX; i++) {
#define GET_BUCKET_ID_FOR_LIST(bkt1, bkt2, idx) ((int)(bkt1) + ((int)(bkt2) - (int)(bkt1)) * (idx))
@ -166,6 +169,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<Merc2BucketRenderer>(
fmt::format("merc-l{}-tfrag", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_TFRAG, BucketId::MERC_L1_TFRAG, i), m_merc2);
init_bucket_renderer<Generic2BucketRenderer>(
fmt::format("gmerc-l{}-tfrag", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_TFRAG, BucketId::GMERC_L1_TFRAG, i), m_generic2,
Generic2::Mode::NORMAL);
init_bucket_renderer<TextureUploadHandler>(
fmt::format("tex-l{}-shrub", i), BucketCategory::TEX,
@ -177,6 +184,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<Merc2BucketRenderer>(
fmt::format("merc-l{}-shrub", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_SHRUB, BucketId::MERC_L1_SHRUB, i), m_merc2);
init_bucket_renderer<Generic2BucketRenderer>(
fmt::format("gmerc-l{}-shrub", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_SHRUB, BucketId::GMERC_L1_SHRUB, i), m_generic2,
Generic2::Mode::NORMAL);
// 230
init_bucket_renderer<TextureUploadHandler>(
@ -198,6 +209,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<Merc2BucketRenderer>(
fmt::format("merc-l{}-alpha", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_ALPHA, BucketId::MERC_L1_ALPHA, i), m_merc2);
init_bucket_renderer<Generic2BucketRenderer>(
fmt::format("gmerc-l{}-alpha", i), BucketCategory::GENERIC,
GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_ALPHA, BucketId::GMERC_L1_ALPHA, i), m_generic2,
Generic2::Mode::NORMAL);
init_bucket_renderer<Tie3AnotherCategory>(
fmt::format("tie-w-l{}-water", i), BucketCategory::TIE,
GET_BUCKET_ID_FOR_LIST(BucketId::TIE_L0_WATER, BucketId::TIE_L1_WATER, i), tie,
@ -213,6 +228,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
BucketId::TEX_LCOM_TFRAG, texture_animator);
init_bucket_renderer<Merc2BucketRenderer>("merc-lcom-tfrag", BucketCategory::MERC,
BucketId::MERC_LCOM_TFRAG, m_merc2);
init_bucket_renderer<Generic2BucketRenderer>("gmerc-lcom-tfrag", BucketCategory::GENERIC,
BucketId::GMERC_LCOM_TFRAG, m_generic2,
Generic2::Mode::NORMAL);
// 345
init_bucket_renderer<TextureUploadHandler>("tex-lcom-shrub", BucketCategory::TEX,
BucketId::TEX_LCOM_SHRUB, texture_animator);
@ -233,10 +251,18 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<Merc2BucketRenderer>(
fmt::format("merc-l{}-pris", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_PRIS, BucketId::MERC_L1_PRIS, i), m_merc2);
init_bucket_renderer<Generic2BucketRenderer>(
fmt::format("gmerc-l{}-pris", i), BucketCategory::GENERIC,
GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_PRIS, BucketId::GMERC_L1_PRIS, i), m_generic2,
Generic2::Mode::NORMAL);
init_bucket_renderer<Merc2BucketRenderer>(
fmt::format("merc-l{}-pris2", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_PRIS2, BucketId::MERC_L1_PRIS2, i), m_merc2);
init_bucket_renderer<Generic2BucketRenderer>(
fmt::format("gmerc-l{}-pris2", i), BucketCategory::GENERIC,
GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_PRIS, BucketId::GMERC_L1_PRIS, i), m_generic2,
Generic2::Mode::NORMAL);
}
// 401
@ -244,10 +270,14 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
BucketId::TEX_LCOM_PRIS, texture_animator);
init_bucket_renderer<Merc2BucketRenderer>("merc-lcom-pris", BucketCategory::MERC,
BucketId::MERC_LCOM_PRIS, m_merc2);
init_bucket_renderer<Generic2BucketRenderer>("gmerc-lcom-pris", BucketCategory::GENERIC,
BucketId::GMERC_LCOM_PRIS, m_generic2,
Generic2::Mode::NORMAL);
// 461
init_bucket_renderer<TextureUploadHandler>("tex-lcom-sky-post", BucketCategory::TEX,
BucketId::TEX_LCOM_SKY_POST, texture_animator);
init_bucket_renderer<OceanNear>("ocean-near", BucketCategory::OCEAN, BucketId::OCEAN_NEAR);
// 463
for (int i = 0; i < LEVEL_MAX; i++) {
@ -260,6 +290,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<Merc2BucketRenderer>(
fmt::format("merc-l{}-water", i), BucketCategory::MERC,
GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_WATER, BucketId::MERC_L1_WATER, i), m_merc2);
init_bucket_renderer<Generic2BucketRenderer>(
fmt::format("gmerc-l{}-water", i), BucketCategory::GENERIC,
GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_WATER, BucketId::GMERC_L1_WATER, i), m_generic2,
Generic2::Mode::NORMAL);
// 466
init_bucket_renderer<TFragment>(
fmt::format("tfrag-l{}-water", i), BucketCategory::TFRAG,
@ -283,6 +317,8 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
// 575
init_bucket_renderer<TextureUploadHandler>("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP,
texture_animator);
init_bucket_renderer<Warp>("generic-warp", BucketCategory::GENERIC, BucketId::GENERIC_WARP,
m_generic2);
init_bucket_renderer<TextureUploadHandler>("debug-no-zbuf1", BucketCategory::OTHER,
BucketId::DEBUG_NO_ZBUF1, m_texture_animator, true);

View File

@ -926,7 +926,7 @@ enum class BucketId {
GMERC2_LCOM_PRIS2 = 460,
TEX_LCOM_SKY_POST = 461,
BUCKET462 = 462,
OCEAN_NEAR = 462,
TEX_L0_WATER = 463,
MERC_L0_WATER = 464,

View File

@ -7,6 +7,7 @@
#include "game/graphics/display.h"
#include "game/graphics/gfx.h"
#include "game/graphics/screenshot.h"
#include "game/system/hid/sdl_util.h"
#include "fmt/core.h"
@ -114,10 +115,11 @@ void OpenGlDebugGui::draw(const DmaStats& dma_stats) {
if (ImGui::BeginMenu("Tools")) {
if (ImGui::BeginMenu("Screenshot")) {
ImGui::MenuItem("Screenshot Next Frame!", nullptr, &m_want_screenshot);
ImGui::InputText("File", m_screenshot_save_name, 50);
ImGui::InputInt("Width", &screenshot_width);
ImGui::InputInt("Height", &screenshot_height);
ImGui::InputInt("MSAA", &screenshot_samples);
ImGui::InputText("File", g_screen_shot_settings->name,
sizeof(g_screen_shot_settings->name));
ImGui::InputInt("Width", &g_screen_shot_settings->width);
ImGui::InputInt("Height", &g_screen_shot_settings->height);
ImGui::InputInt("MSAA", &g_screen_shot_settings->msaa);
ImGui::Checkbox("Quick-Screenshot on F2", &screenshot_hotkey_enabled);
ImGui::EndMenu();
}

View File

@ -50,7 +50,6 @@ class OpenGlDebugGui {
bool should_draw_subtitle_editor() const { return master_enable && m_subtitle_editor; }
bool should_draw_filters_menu() const { return master_enable && m_filters_menu; }
bool should_draw_loader_menu() const { return master_enable && m_draw_loader; }
const char* screenshot_name() const { return m_screenshot_save_name; }
bool should_advance_frame() { return m_frame_timer.should_advance_frame(); }
bool should_gl_finish() const { return m_frame_timer.do_gl_finish; }
@ -68,9 +67,6 @@ class OpenGlDebugGui {
bool dump_events = false;
bool want_reboot_in_debug = false;
int screenshot_width = 1920;
int screenshot_height = 1080;
int screenshot_samples = 16;
bool screenshot_hotkey_enabled = true;
bool master_enable = false;
@ -84,6 +80,5 @@ class OpenGlDebugGui {
bool m_subtitle_editor = false;
bool m_filters_menu = false;
bool m_want_screenshot = false;
char m_screenshot_save_name[256] = "screenshot";
float target_fps_input = 60.f;
};

View File

@ -250,7 +250,7 @@ void Generic2::setup_opengl_tex(u16 unit,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
if (render_state->version == GameVersion::Jak2 && tbp_to_lookup == 1216) {
if (render_state->version >= GameVersion::Jak2 && tbp_to_lookup == 1216) {
glUniform1ui(m_ogl.warp_sample_mode, 1);
// warp shader uses region clamp, which isn't supported by DrawMode.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);

View File

@ -30,6 +30,7 @@ void OceanMidAndFar::render(DmaFollower& dma,
render_jak1(dma, render_state, prof);
break;
case GameVersion::Jak2:
case GameVersion::Jak3:
render_jak2(dma, render_state, prof);
break;
}
@ -174,6 +175,7 @@ void OceanMidAndFar::handle_ocean_mid(DmaFollower& dma,
m_mid_renderer.run(dma, render_state, prof);
break;
case GameVersion::Jak2:
case GameVersion::Jak3:
m_mid_renderer.run_jak2(dma, render_state, prof);
}
} else {

View File

@ -38,6 +38,7 @@ void OceanNear::render(DmaFollower& dma,
render_jak1(dma, render_state, prof);
break;
case GameVersion::Jak2:
case GameVersion::Jak3:
render_jak2(dma, render_state, prof);
break;
}

View File

@ -68,6 +68,7 @@ void OceanTexture::init_textures(TexturePool& pool, GameVersion version) {
m_tex0_gpu = pool.give_texture_and_load_to_vram(in, OCEAN_TEX_TBP_JAK1);
break;
case GameVersion::Jak2:
case GameVersion::Jak3:
m_tex0_gpu = pool.give_texture_and_load_to_vram(in, OCEAN_TEX_TBP_JAK2);
break;
}

View File

@ -23,6 +23,7 @@
#include "game/graphics/gfx.h"
#include "game/graphics/opengl_renderer/OpenGLRenderer.h"
#include "game/graphics/opengl_renderer/debug_gui.h"
#include "game/graphics/screenshot.h"
#include "game/graphics/texture/TexturePool.h"
#include "game/runtime.h"
#include "game/sce/libscf.h"
@ -399,18 +400,20 @@ void render_game_frame(int game_width,
options.quick_screenshot = true;
options.screenshot_path = file_util::make_screenshot_filepath(g_game_version);
}
if (g_gfx_data->debug_gui.get_screenshot_flag()) {
// note : it's important we call get_screenshot_flag first because it modifies state
if (g_gfx_data->debug_gui.get_screenshot_flag() || g_want_screenshot) {
g_want_screenshot = false;
options.save_screenshot = true;
options.internal_res_screenshot = true;
options.game_res_w = g_gfx_data->debug_gui.screenshot_width;
options.game_res_h = g_gfx_data->debug_gui.screenshot_height;
options.game_res_w = g_screen_shot_settings->width;
options.game_res_h = g_screen_shot_settings->height;
options.window_framebuffer_width = options.game_res_w;
options.window_framebuffer_height = options.game_res_h;
options.draw_region_width = options.game_res_w;
options.draw_region_height = options.game_res_h;
options.msaa_samples = g_gfx_data->debug_gui.screenshot_samples;
options.screenshot_path = file_util::make_screenshot_filepath(
g_game_version, g_gfx_data->debug_gui.screenshot_name());
options.msaa_samples = g_screen_shot_settings->msaa;
options.screenshot_path =
file_util::make_screenshot_filepath(g_game_version, get_screen_shot_name());
}
options.draw_small_profiler_window =

View File

@ -0,0 +1,20 @@
#include "game/graphics/screenshot.h"
/*!
* @file screenshot.cpp
* This file contains a basic interface for the screen shot system to make it easier to share with
* the GOAL kernel.
*/
ScreenShotSettings s_default_screen_shot_settings = {1920, 1080, 8, "screenshot"};
bool g_want_screenshot = false;
ScreenShotSettings* g_screen_shot_settings = &s_default_screen_shot_settings;
void register_screen_shot_settings(ScreenShotSettings* settings) {
g_screen_shot_settings = settings;
}
const char* const get_screen_shot_name() {
return g_screen_shot_settings->name;
}

View File

@ -0,0 +1,27 @@
#pragma once
#include <memory>
#include "common/common_types.h"
#include "game/kernel/common/kscheme.h"
/*!
* @file screenshot.h
* This file contains a basic interface for the screen shot system to make it easier to share with
* the GOAL kernel.
*/
// this must match the structure in capture-pc.gc (if present)
struct ScreenShotSettings {
s32 width;
s32 height;
s32 msaa;
char name[244];
};
extern ScreenShotSettings* g_screen_shot_settings;
extern bool g_want_screenshot;
void register_screen_shot_settings(ScreenShotSettings* settings);
const char* const get_screen_shot_name();

View File

@ -13,6 +13,7 @@
#include "game/external/discord.h"
#include "game/graphics/display.h"
#include "game/graphics/gfx.h"
#include "game/graphics/screenshot.h"
#include "game/kernel/common/Ptr.h"
#include "game/kernel/common/kernel_types.h"
#include "game/kernel/common/kprint.h"
@ -879,6 +880,14 @@ u32 pc_is_imgui_visible() {
return bool_to_symbol(Gfx::g_debug_settings.show_imgui);
}
void pc_screen_shot() {
g_want_screenshot = true;
}
void pc_register_screen_shot_settings(u32 ptr) {
register_screen_shot_settings(Ptr<ScreenShotSettings>(ptr).c());
}
/// Initializes all functions that are common across all game versions
/// These functions have the same implementation and do not use any game specific functions (other
/// than the one to create a function in the first place)
@ -980,4 +989,7 @@ void init_common_pc_port_functions(
// debugging tools
make_func_symbol_func("pc-filter-debug-string?", (void*)pc_filter_debug_string);
make_func_symbol_func("pc-screen-shot", (void*)pc_screen_shot);
make_func_symbol_func("pc-register-screen-shot-settings",
(void*)pc_register_screen_shot_settings);
}

View File

@ -679,7 +679,7 @@ s32 pc_sr_mode_get_practice_entries_amount() {
void pc_sr_mode_get_practice_entry_name(s32 entry_index, u32 name_str_ptr) {
std::string name = "";
if (!g_speedrun_practice_entries.size() <= entry_index) {
if (entry_index < g_speedrun_practice_entries.size()) {
name = g_speedrun_practice_entries.at(entry_index).name;
}
strcpy(Ptr<String>(name_str_ptr).c()->data(), name.c_str());
@ -687,7 +687,7 @@ void pc_sr_mode_get_practice_entry_name(s32 entry_index, u32 name_str_ptr) {
void pc_sr_mode_get_practice_entry_continue_point(s32 entry_index, u32 name_str_ptr) {
std::string name = "";
if (!g_speedrun_practice_entries.size() <= entry_index) {
if (entry_index < g_speedrun_practice_entries.size()) {
name = g_speedrun_practice_entries.at(entry_index).continue_point_name;
}
strcpy(Ptr<String>(name_str_ptr).c()->data(), name.c_str());
@ -864,7 +864,7 @@ s32 pc_sr_mode_get_custom_category_amount() {
void pc_sr_mode_get_custom_category_name(s32 entry_index, u32 name_str_ptr) {
std::string name = "";
if (!g_speedrun_custom_categories.size() <= entry_index) {
if (entry_index < g_speedrun_custom_categories.size()) {
name = g_speedrun_custom_categories.at(entry_index).name;
}
strcpy(Ptr<String>(name_str_ptr).c()->data(), name.c_str());
@ -872,7 +872,7 @@ void pc_sr_mode_get_custom_category_name(s32 entry_index, u32 name_str_ptr) {
void pc_sr_mode_get_custom_category_continue_point(s32 entry_index, u32 name_str_ptr) {
std::string name = "";
if (!g_speedrun_custom_categories.size() <= entry_index) {
if (entry_index < g_speedrun_custom_categories.size()) {
name = g_speedrun_custom_categories.at(entry_index).continue_point_name;
}
strcpy(Ptr<String>(name_str_ptr).c()->data(), name.c_str());

View File

@ -175,8 +175,10 @@ u64 execute(void* ctxt) {
c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7)
c->lqc2(vf26, 812, v1); // lqc2 vf26, 812(v1)
c->lqc2(vf27, 812, v1); // lqc2 vf27, 812(v1)
c->vadd_bc(DEST::xy, BC::w, vf26, vf26, vf0); // vaddw.xy vf26, vf26, vf0
c->vadd_bc(DEST::x, BC::w, vf26, vf26, vf0); // vaddw.x vf26, vf26, vf0
// shadow hack begin
// c->vadd_bc(DEST::xy, BC::w, vf26, vf26, vf0); // vaddw.xy vf26, vf26, vf0
// c->vadd_bc(DEST::x, BC::w, vf26, vf26, vf0); // vaddw.x vf26, vf26, vf0
// shadow hack end
c->lw(v1, 68, a2); // lw v1, 68(a2)
c->lqc2(vf25, 44, a2); // lqc2 vf25, 44(a2)
c->lqc2(vf23, 12, a2); // lqc2 vf23, 12(a2)
@ -187,12 +189,29 @@ u64 execute(void* ctxt) {
c->lqc2(vf31, 48, v1); // lqc2 vf31, 48(v1)
c->load_symbol2(v1, cache.video_params); // lw v1, *video-params*(s7)
c->mov64(v1, v1); // or v1, v1, r0
// shadow hack begin
c->lw(t0, 16, v1); // lw t0, 16(v1)
// multiply shadow offset by font scale and screen x scale
c->vfs[vf26].f[0] += c->gprs[t0].f[0] * 2;
c->vfs[vf26].f[1] += 1;
// shadow hack end
c->lqc2(vf1, 32, v1); // lqc2 vf1, 32(v1)
c->vdiv(vf0, BC::w, vf25, BC::w); // vdiv Q, vf0.w, vf25.w
c->lqc2(vf2, 16, v1); // lqc2 vf2, 16(v1)
c->vmul(DEST::x, vf25, vf25, vf1); // vmul.x vf25, vf25, vf1
c->vmul(DEST::x, vf23, vf23, vf1); // vmul.x vf23, vf23, vf1
c->vmul(DEST::x, vf24, vf24, vf1); // vmul.x vf24, vf24, vf1
// pc-hack
c->lw(v1, 64, a2); // lw v1, 64(a2)
if (!(c->gprs[v1].du32[0] & (1 << 6))) {
// pc-hack flag
c->vmul(DEST::x, vf24, vf24, vf1); // vmul.x vf24, vf24, vf1
}
if (!(c->gprs[v1].du32[0] & (1 << 5))) {
// small font, readjust shadow
c->vfs[vf26].f[0] -= (c->gprs[t0].f[0] * 2) - (c->vfs[vf25].f[3] * c->gprs[t0].f[0] * 2);
c->vfs[vf26].f[1] -= 1 - (c->vfs[vf25].f[3] * 1);
}
// pc-hack end
c->vwaitq(); // vwaitq
c->vmulq(DEST::xy, vf25, vf25); // vmulq.xy vf25, vf25, Q
c->vmulq(DEST::xy, vf23, vf23); // vmulq.xy vf23, vf23, Q
@ -2739,10 +2758,16 @@ block_59:
block_60:
c->vsub(DEST::xyzw, vf23, vf23, vf24); // vsub.xyzw vf23, vf23, vf24
c->load_symbol2(v1, cache.video_params); // lw v1, *video-params*(s7)
c->mov64(v1, v1); // or v1, v1, r0
c->lqc2(vf1, 16, v1); // lqc2 vf1, 16(v1)
c->vmul(DEST::x, vf23, vf23, vf1); // vmul.x vf23, vf23, vf1
// pc-hack
c->lw(v1, 64, a1); // lw v1, 64(a1)
if (!(c->gprs[v1].du32[0] & 1 << 6)) {
// pc-hack flag
c->load_symbol2(v1, cache.video_params); // lw v1, *video-params*(s7)
c->mov64(v1, v1); // or v1, v1, r0
c->lqc2(vf1, 16, v1); // lqc2 vf1, 16(v1)
c->vmul(DEST::x, vf23, vf23, vf1); // vmul.x vf23, vf23, vf1
}
// pc-hack end
c->lqc2(vf1, 44, a1); // lqc2 vf1, 44(a1)
c->vmul_bc(DEST::x, BC::w, vf23, vf23, vf1); // vmulw.x vf23, vf23, vf1
c->mov128_gpr_vf(v0, vf23); // qmfc2.i v0, vf23
@ -2761,7 +2786,8 @@ void link() {
cache.font12_table = intern_from_c(-1, 0, "*font12-table*").c();
cache.font24_table = intern_from_c(-1, 0, "*font24-table*").c();
cache.video_params = intern_from_c(-1, 0, "*video-params*").c();
gLinkedFunctionTable.reg("get-string-length", execute, 512);
// gLinkedFunctionTable.reg("get-string-length", execute, 512);
gLinkedFunctionTable.reg("get-string-length-asm", execute, 512);
}
} // namespace get_string_length

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,381 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
ExecutionContext ocean_regs_vfs;
namespace init_ocean_far_regs {
struct Cache {
void* math_camera; // *math-camera*
void* sky_work; // *sky-work*
void* time_of_day_context; // *time-of-day-context*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7)
c->load_symbol2(a0, cache.sky_work); // lw a0, *sky-work*(s7)
c->daddiu(a0, a0, 1088); // daddiu a0, a0, 1088
c->lwc1(f0, 908, v1); // lwc1 f0, 908(v1)
c->swc1(f0, 0, a0); // swc1 f0, 0(a0)
c->lwc1(f0, 128, v1); // lwc1 f0, 128(v1)
c->swc1(f0, 4, a0); // swc1 f0, 4(a0)
c->lwc1(f0, 124, v1); // lwc1 f0, 124(v1)
c->swc1(f0, 8, a0); // swc1 f0, 8(a0)
c->lui(a1, 16256); // lui a1, 16256
c->mtc1(f0, a1); // mtc1 f0, a1
c->swc1(f0, 12, a0); // swc1 f0, 12(a0)
c->load_symbol2(a0, cache.time_of_day_context); // lw a0, *time-of-day-context*(s7)
c->lwu(a0, 2656, a0); // lwu a0, 2656(a0)
bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L123
// nop // sll r0, r0, 0
if (bc) {goto block_2;} // branch non-likely
c->lqc2(vf31, 1228, v1); // lqc2 vf31, 1228(v1)
c->lqc2(vf30, 1244, v1); // lqc2 vf30, 1244(v1)
c->lqc2(vf29, 1260, v1); // lqc2 vf29, 1260(v1)
c->lqc2(vf28, 1276, v1); // lqc2 vf28, 1276(v1)
c->mov128_gpr_vf(a0, vf28); // qmfc2.i a0, vf28
//beq r0, r0, L124 // beq r0, r0, L124
// nop // sll r0, r0, 0
goto block_3; // branch always
block_2:
c->lqc2(vf31, 572, v1); // lqc2 vf31, 572(v1)
c->lqc2(vf30, 588, v1); // lqc2 vf30, 588(v1)
c->lqc2(vf29, 604, v1); // lqc2 vf29, 604(v1)
c->lqc2(vf28, 620, v1); // lqc2 vf28, 620(v1)
c->mov128_gpr_vf(a0, vf28); // qmfc2.i a0, vf28
block_3:
c->lqc2(vf26, 796, v1); // lqc2 vf26, 796(v1)
c->lqc2(vf14, 780, v1); // lqc2 vf14, 780(v1)
c->lqc2(vf25, 812, v1); // lqc2 vf25, 812(v1)
c->load_symbol2(v1, cache.sky_work); // lw v1, *sky-work*(s7)
c->lqc2(vf13, 1088, v1); // lqc2 vf13, 1088(v1)
c->load_symbol2(v1, cache.sky_work); // lw v1, *sky-work*(s7)
c->lqc2(vf27, 1072, v1); // lqc2 vf27, 1072(v1)
c->mov128_gpr_vf(v1, vf27); // qmfc2.i v1, vf27
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
ocean_regs_vfs.copy_vfs_from_other(c);
return c->gprs[v0].du64[0];
}
void link() {
cache.math_camera = intern_from_c(-1, 0, "*math-camera*").c();
cache.sky_work = intern_from_c(-1, 0, "*sky-work*").c();
cache.time_of_day_context = intern_from_c(-1, 0, "*time-of-day-context*").c();
gLinkedFunctionTable.reg("init-ocean-far-regs", execute, 128);
}
} // namespace init_ocean_far_regs
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "sky.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace draw_large_polygon_ocean {
struct Cache {
void* clip_polygon_against_negative_hyperplane; // clip-polygon-against-negative-hyperplane
void* clip_polygon_against_positive_hyperplane; // clip-polygon-against-positive-hyperplane
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
[[maybe_unused]] u32 call_addr = 0;
// nop // sll r0, r0, 0
c->daddiu(sp, sp, -8); // daddiu sp, sp, -8
c->mov64(t6, s7); // or t6, s7, r0
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->load_symbol2(t9, cache.clip_polygon_against_positive_hyperplane);// lw t9, clip-polygon-against-positive-hyperplane(s7)
c->mov64(a2, t4); // or a2, t4, r0
c->mov64(a3, t5); // or a3, t5, r0
call_addr = c->gprs[t9].du32[0]; // function call:
c->daddu(t2, a2, r0); // daddu t2, a2, r0
// c->jalr(call_addr); // jalr ra, t9
clip_polygon_against_positive_hyperplane::execute(ctxt);
bc = c->sgpr64(t0) == 0; // beq t0, r0, L121
// nop // sll r0, r0, 0
if (bc) {goto block_11;} // branch non-likely
c->mov64(a2, t5); // or a2, t5, r0
c->mov64(a3, t4); // or a3, t4, r0
call_addr = c->gprs[t9].du32[0]; // function call:
c->daddiu(t2, a2, 4); // daddiu t2, a2, 4
// c->jalr(call_addr); // jalr ra, t9
clip_polygon_against_positive_hyperplane::execute(ctxt);
bc = c->sgpr64(t0) == 0; // beq t0, r0, L121
c->load_symbol2(t9, cache.clip_polygon_against_negative_hyperplane);// lw t9, clip-polygon-against-negative-hyperplane(s7)
if (bc) {goto block_11;} // branch non-likely
c->mov64(a2, t4); // or a2, t4, r0
c->mov64(a3, t5); // or a3, t5, r0
call_addr = c->gprs[t9].du32[0]; // function call:
c->daddu(t2, a2, r0); // daddu t2, a2, r0
// c->jalr(call_addr); // jalr ra, t9
clip_polygon_against_negative_hyperplane::execute(ctxt);
bc = c->sgpr64(t0) == 0; // beq t0, r0, L121
// nop // sll r0, r0, 0
if (bc) {goto block_11;} // branch non-likely
c->mov64(a2, t5); // or a2, t5, r0
c->mov64(a3, t4); // or a3, t4, r0
call_addr = c->gprs[t9].du32[0]; // function call:
c->daddiu(t2, a2, 4); // daddiu t2, a2, 4
// c->jalr(call_addr); // jalr ra, t9
clip_polygon_against_negative_hyperplane::execute(ctxt);
bc = c->sgpr64(t0) == 0; // beq t0, r0, L121
c->lw(a3, 4, a1); // lw a3, 4(a1)
if (bc) {goto block_11;} // branch non-likely
bc = c->sgpr64(t6) == c->sgpr64(s7); // beq t6, s7, L119
c->mov64(a2, t4); // or a2, t4, r0
if (bc) {goto block_8;} // branch non-likely
c->sqc2(vf27, 0, a3); // sqc2 vf27, 0(a3)
c->daddiu(a3, a3, 16); // daddiu a3, a3, 16
c->sw(t0, -16, a3); // sw t0, -16(a3)
// nop // sll r0, r0, 0
block_6:
c->lqc2(vf1, 0, a2); // lqc2 vf1, 0(a2)
// nop // sll r0, r0, 0
c->lqc2(vf2, 16, a2); // lqc2 vf2, 16(a2)
// nop // sll r0, r0, 0
c->lqc2(vf3, 32, a2); // lqc2 vf3, 32(a2)
c->vdiv(vf0, BC::w, vf1, BC::w); // vdiv Q, vf0.w, vf1.w
c->vmul(DEST::xyzw, vf1, vf1, vf26); // vmul.xyzw vf1, vf1, vf26
// nop // sll r0, r0, 0
c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3
// nop // sll r0, r0, 0
c->vwaitq(); // vwaitq
// nop // sll r0, r0, 0
c->vmulq(DEST::xyz, vf1, vf1); // vmulq.xyz vf1, vf1, Q
c->sqc2(vf3, 16, a3); // sqc2 vf3, 16(a3)
c->vmulq(DEST::xyzw, vf2, vf2); // vmulq.xyzw vf2, vf2, Q
c->daddiu(a2, a2, 48); // daddiu a2, a2, 48
c->vadd(DEST::xyzw, vf1, vf1, vf25); // vadd.xyzw vf1, vf1, vf25
c->daddiu(a3, a3, 48); // daddiu a3, a3, 48
c->vmax_bc(DEST::z, BC::z, vf1, vf1, vf0); // vmaxz.z vf1, vf1, vf0
// nop // sll r0, r0, 0
c->vmini_bc(DEST::w, BC::z, vf1, vf1, vf13); // vminiz.w vf1, vf1, vf13
// nop // sll r0, r0, 0
c->vmax_bc(DEST::w, BC::y, vf1, vf1, vf13); // vmaxy.w vf1, vf1, vf13
// nop // sll r0, r0, 0
c->sqc2(vf2, -48, a3); // sqc2 vf2, -48(a3)
c->daddiu(t0, t0, -1); // daddiu t0, t0, -1
c->vftoi4(DEST::xyzw, vf1, vf1); // vftoi4.xyzw vf1, vf1
// nop // sll r0, r0, 0
bc = c->sgpr64(t0) != 0; // bne t0, r0, L118
c->sqc2(vf1, -16, a3); // sqc2 vf1, -16(a3)
if (bc) {goto block_6;} // branch non-likely
c->sw(a3, 4, a1); // sw a3, 4(a1)
// nop // sll r0, r0, 0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->daddiu(v0, s7, 4); // daddiu v0, s7, 4
//jr ra // jr ra
c->daddiu(sp, sp, 8); // daddiu sp, sp, 8
goto end_of_function; // return
block_8:
c->sqc2(vf27, 0, a3); // sqc2 vf27, 0(a3)
c->daddiu(a3, a3, 16); // daddiu a3, a3, 16
c->sw(t0, -16, a3); // sw t0, -16(a3)
// nop // sll r0, r0, 0
c->sqc2(vf15, 0, a2); // sqc2 vf15, 0(a2)
// nop // sll r0, r0, 0
c->sqc2(vf15, 192, a2); // sqc2 vf15, 192(a2)
// nop // sll r0, r0, 0
c->sqc2(vf16, 48, a2); // sqc2 vf16, 48(a2)
// nop // sll r0, r0, 0
c->sqc2(vf17, 96, a2); // sqc2 vf17, 96(a2)
// nop // sll r0, r0, 0
c->sqc2(vf18, 144, a2); // sqc2 vf18, 144(a2)
// nop // sll r0, r0, 0
block_9:
c->lqc2(vf1, 0, a2); // lqc2 vf1, 0(a2)
// nop // sll r0, r0, 0
c->lqc2(vf3, 32, a2); // lqc2 vf3, 32(a2)
// nop // sll r0, r0, 0
c->lqc2(vf2, 16, a2); // lqc2 vf2, 16(a2)
c->vdiv(vf13, BC::x, vf1, BC::w); // vdiv Q, vf13.x, vf1.w
c->vftoi0(DEST::xyzw, vf3, vf3); // vftoi0.xyzw vf3, vf3
// nop // sll r0, r0, 0
c->vwaitq(); // vwaitq
// nop // sll r0, r0, 0
c->vmulq(DEST::xyz, vf1, vf1); // vmulq.xyz vf1, vf1, Q
c->sqc2(vf3, 16, a3); // sqc2 vf3, 16(a3)
c->vmulq(DEST::xyzw, vf2, vf2); // vmulq.xyzw vf2, vf2, Q
c->daddiu(a2, a2, 48); // daddiu a2, a2, 48
c->vadd(DEST::xyzw, vf1, vf1, vf25); // vadd.xyzw vf1, vf1, vf25
c->daddiu(a3, a3, 48); // daddiu a3, a3, 48
c->vmax_bc(DEST::z, BC::z, vf1, vf1, vf0); // vmaxz.z vf1, vf1, vf0
// nop // sll r0, r0, 0
c->vmini_bc(DEST::w, BC::z, vf1, vf1, vf13); // vminiz.w vf1, vf1, vf13
// nop // sll r0, r0, 0
c->vmax_bc(DEST::w, BC::y, vf1, vf1, vf13); // vmaxy.w vf1, vf1, vf13
// nop // sll r0, r0, 0
c->sqc2(vf2, -48, a3); // sqc2 vf2, -48(a3)
c->daddiu(t0, t0, -1); // daddiu t0, t0, -1
c->vftoi4(DEST::xyzw, vf1, vf1); // vftoi4.xyzw vf1, vf1
// nop // sll r0, r0, 0
bc = c->sgpr64(t0) != 0; // bne t0, r0, L120
c->sqc2(vf1, -16, a3); // sqc2 vf1, -16(a3)
if (bc) {goto block_9;} // branch non-likely
c->sw(a3, 4, a1); // sw a3, 4(a1)
// nop // sll r0, r0, 0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->daddiu(v0, s7, 4); // daddiu v0, s7, 4
//jr ra // jr ra
c->daddiu(sp, sp, 8); // daddiu sp, sp, 8
goto end_of_function; // return
block_11:
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->mov64(v0, s7); // or v0, s7, r0
//jr ra // jr ra
c->daddiu(sp, sp, 8); // daddiu sp, sp, 8
goto end_of_function; // return
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.clip_polygon_against_negative_hyperplane = intern_from_c(-1, 0, "clip-polygon-against-negative-hyperplane").c();
cache.clip_polygon_against_positive_hyperplane = intern_from_c(-1, 0, "clip-polygon-against-positive-hyperplane").c();
gLinkedFunctionTable.reg("draw-large-polygon-ocean", execute, 128);
}
} // namespace draw_large_polygon_ocean
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace render_ocean_quad {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
void* draw_large_polygon_ocean; // draw-large-polygon-ocean
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->copy_vfs_from_other(&ocean_regs_vfs);
c->mov64(v1, a0); // or v1, a0, r0
get_fake_spad_addr2(t4, cache.fake_scratchpad_data, 0, c);// lui t4, 28672
c->ori(t4, t4, 12288); // ori t4, t4, 12288
get_fake_spad_addr2(t5, cache.fake_scratchpad_data, 0, c);// lui t5, 28672
c->ori(t5, t5, 14336); // ori t5, t5, 14336
c->mov64(a3, t4); // or a3, t4, r0
// nop // sll r0, r0, 0
c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0)
c->addiu(t0, r0, 4); // addiu t0, r0, 4
c->lqc2(vf2, 16, a0); // lqc2 vf2, 16(a0)
// nop // sll r0, r0, 0
c->lqc2(vf3, 32, a0); // lqc2 vf3, 32(a0)
c->vmula_bc(DEST::xyzw, BC::x, vf31, vf1); // vmulax.xyzw acc, vf31, vf1
c->lqc2(vf4, 48, a0); // lqc2 vf4, 48(a0)
c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf1); // vmadday.xyzw acc, vf30, vf1
c->lqc2(vf5, 64, a0); // lqc2 vf5, 64(a0)
c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf1); // vmaddaz.xyzw acc, vf29, vf1
c->lqc2(vf6, 80, a0); // lqc2 vf6, 80(a0)
c->vmadd_bc(DEST::xyzw, BC::w, vf15, vf28, vf1); // vmaddw.xyzw vf15, vf28, vf1
c->lqc2(vf7, 96, a0); // lqc2 vf7, 96(a0)
// nop // sll r0, r0, 0
c->lqc2(vf8, 112, a0); // lqc2 vf8, 112(a0)
c->vmula_bc(DEST::xyzw, BC::x, vf31, vf4); // vmulax.xyzw acc, vf31, vf4
c->lqc2(vf9, 128, a0); // lqc2 vf9, 128(a0)
c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf4); // vmadday.xyzw acc, vf30, vf4
c->lqc2(vf10, 144, a0); // lqc2 vf10, 144(a0)
c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf4); // vmaddaz.xyzw acc, vf29, vf4
c->lqc2(vf11, 160, a0); // lqc2 vf11, 160(a0)
c->vmadd_bc(DEST::xyzw, BC::w, vf16, vf28, vf4); // vmaddw.xyzw vf16, vf28, vf4
c->lqc2(vf12, 176, a0); // lqc2 vf12, 176(a0)
c->vmul(DEST::xyzw, vf1, vf15, vf14); // vmul.xyzw vf1, vf15, vf14
c->sqc2(vf2, 16, a3); // sqc2 vf2, 16(a3)
c->vmula_bc(DEST::xyzw, BC::x, vf31, vf7); // vmulax.xyzw acc, vf31, vf7
c->sqc2(vf3, 32, a3); // sqc2 vf3, 32(a3)
c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf7); // vmadday.xyzw acc, vf30, vf7
c->sqc2(vf5, 64, a3); // sqc2 vf5, 64(a3)
c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf7); // vmaddaz.xyzw acc, vf29, vf7
c->sqc2(vf6, 80, a3); // sqc2 vf6, 80(a3)
c->vmadd_bc(DEST::xyzw, BC::w, vf17, vf28, vf7); // vmaddw.xyzw vf17, vf28, vf7
c->sqc2(vf8, 112, a3); // sqc2 vf8, 112(a3)
c->vmul(DEST::xyzw, vf4, vf16, vf14); // vmul.xyzw vf4, vf16, vf14
c->sqc2(vf9, 128, a3); // sqc2 vf9, 128(a3)
c->vmula_bc(DEST::xyzw, BC::x, vf31, vf10); // vmulax.xyzw acc, vf31, vf10
c->sqc2(vf11, 160, a3); // sqc2 vf11, 160(a3)
c->vmadda_bc(DEST::xyzw, BC::y, vf30, vf10); // vmadday.xyzw acc, vf30, vf10
c->sqc2(vf12, 176, a3); // sqc2 vf12, 176(a3)
c->vmadda_bc(DEST::xyzw, BC::z, vf29, vf10); // vmaddaz.xyzw acc, vf29, vf10
c->sqc2(vf2, 208, a3); // sqc2 vf2, 208(a3)
c->vmadd_bc(DEST::xyzw, BC::w, vf18, vf28, vf10); // vmaddw.xyzw vf18, vf28, vf10
c->sqc2(vf3, 224, a3); // sqc2 vf3, 224(a3)
c->vmul(DEST::xyzw, vf7, vf17, vf14); // vmul.xyzw vf7, vf17, vf14
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->sqc2(vf1, 0, a3); // sqc2 vf1, 0(a3)
c->vmul(DEST::xyzw, vf10, vf18, vf14); // vmul.xyzw vf10, vf18, vf14
c->sqc2(vf1, 192, a3); // sqc2 vf1, 192(a3)
// nop // sll r0, r0, 0
c->sqc2(vf4, 48, a3); // sqc2 vf4, 48(a3)
// nop // sll r0, r0, 0
c->sqc2(vf7, 96, a3); // sqc2 vf7, 96(a3)
// nop // sll r0, r0, 0
c->sqc2(vf10, 144, a3); // sqc2 vf10, 144(a3)
c->load_symbol2(t9, cache.draw_large_polygon_ocean);// lw t9, draw-large-polygon-ocean(s7)
// Unknown instr: jr t9
return draw_large_polygon_ocean::execute(c);
// nop // sll r0, r0, 0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
cache.draw_large_polygon_ocean = intern_from_c(-1, 0, "draw-large-polygon-ocean").c();
gLinkedFunctionTable.reg("render-ocean-quad", execute, 256);
}
} // namespace render_ocean_quad
} // namespace Mips2C
// add render_ocean_quad::link to the link callback table for the object file.
// FWD DEC:
namespace render_ocean_quad { extern void link(); }

View File

@ -0,0 +1,861 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_14_ocean {
struct Cache {
void* ocean_wave_frames; // *ocean-wave-frames*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->mtc1(f0, a2); // mtc1 f0, a2
c->cvtws(f0, f0); // cvt.w.s f0, f0
c->mfc1(t1, f0); // mfc1 t1, f0
c->dsll(v1, t1, 10); // dsll v1, t1, 10
c->daddu(v1, r0, v1); // daddu v1, r0, v1
c->load_symbol2(t0, cache.ocean_wave_frames); // lw t0, *ocean-wave-frames*(s7)
c->daddu(v1, v1, t0); // daddu v1, v1, t0
c->daddiu(t0, t1, 1); // daddiu t0, t1, 1
c->andi(t0, t0, 63); // andi t0, t0, 63
c->dsll(t0, t0, 10); // dsll t0, t0, 10
c->daddu(t0, r0, t0); // daddu t0, r0, t0
c->load_symbol2(t2, cache.ocean_wave_frames); // lw t2, *ocean-wave-frames*(s7)
c->daddu(t0, t0, t2); // daddu t0, t0, t2
c->mtc1(f0, a2); // mtc1 f0, a2
c->mtc1(f1, t1); // mtc1 f1, t1
c->cvtsw(f1, f1); // cvt.s.w f1, f1
c->subs(f0, f0, f1); // sub.s f0, f0, f1
c->swc1(f0, 148, a0); // swc1 f0, 148(a0)
c->lui(a2, 16256); // lui a2, 16256
c->mtc1(f0, a2); // mtc1 f0, a2
c->lwc1(f1, 148, a0); // lwc1 f1, 148(a0)
c->subs(f0, f0, f1); // sub.s f0, f0, f1
c->swc1(f0, 144, a0); // swc1 f0, 144(a0)
c->lwc1(f0, 144, a0); // lwc1 f0, 144(a0)
c->mtc1(f1, a3); // mtc1 f1, a3
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 144, a0); // swc1 f0, 144(a0)
c->lwc1(f0, 148, a0); // lwc1 f0, 148(a0)
c->mtc1(f1, a3); // mtc1 f1, a3
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 148, a0); // swc1 f0, 148(a0)
c->addiu(a2, r0, 32); // addiu a2, r0, 32
c->lqc2(vf1, 144, a0); // lqc2 vf1, 144(a0)
// nop // sll r0, r0, 0
c->lw(a0, 0, v1); // lw a0, 0(v1)
// nop // sll r0, r0, 0
c->lw(a3, 0, t0); // lw a3, 0(t0)
block_1:
c->pextlb(t1, a0, r0); // pextlb t1, a0, r0
c->lw(a0, 4, v1); // lw a0, 4(v1)
c->pextlb(t2, a3, r0); // pextlb t2, a3, r0
c->lw(a3, 4, t0); // lw a3, 4(t0)
c->pextlb(t3, a0, r0); // pextlb t3, a0, r0
c->lw(a0, 8, v1); // lw a0, 8(v1)
c->pextlb(t4, a3, r0); // pextlb t4, a3, r0
c->lw(a3, 8, t0); // lw a3, 8(t0)
c->pextlh(t5, t1, r0); // pextlh t5, t1, r0
c->lw(t1, 12, v1); // lw t1, 12(v1)
c->pextlh(t6, t2, r0); // pextlh t6, t2, r0
c->lw(t2, 12, t0); // lw t2, 12(t0)
c->pextlh(t3, t3, r0); // pextlh t3, t3, r0
c->mov128_vf_gpr(vf2, t5); // qmtc2.i vf2, t5
c->pextlh(t4, t4, r0); // pextlh t4, t4, r0
c->mov128_vf_gpr(vf10, t6); // qmtc2.i vf10, t6
c->pextlb(a0, a0, r0); // pextlb a0, a0, r0
c->mov128_vf_gpr(vf3, t3); // qmtc2.i vf3, t3
c->pextlb(a3, a3, r0); // pextlb a3, a3, r0
c->mov128_vf_gpr(vf11, t4); // qmtc2.i vf11, t4
c->pextlb(t4, t1, r0); // pextlb t4, t1, r0
c->vitof15(DEST::xyzw, vf2, vf2); // vitof15.xyzw vf2, vf2
c->pextlb(t3, t2, r0); // pextlb t3, t2, r0
c->vitof15(DEST::xyzw, vf10, vf10); // vitof15.xyzw vf10, vf10
c->pextlh(a0, a0, r0); // pextlh a0, a0, r0
c->vitof15(DEST::xyzw, vf3, vf3); // vitof15.xyzw vf3, vf3
c->pextlh(t1, a3, r0); // pextlh t1, a3, r0
c->vitof15(DEST::xyzw, vf11, vf11); // vitof15.xyzw vf11, vf11
c->pextlh(t2, t4, r0); // pextlh t2, t4, r0
c->lw(t5, 16, v1); // lw t5, 16(v1)
c->pextlh(t3, t3, r0); // pextlh t3, t3, r0
c->lw(t6, 16, t0); // lw t6, 16(t0)
c->vmula_bc(DEST::xyzw, BC::x, vf2, vf1); // vmulax.xyzw acc, vf2, vf1
c->lw(t4, 20, v1); // lw t4, 20(v1)
c->vmadd_bc(DEST::xyzw, BC::y, vf2, vf10, vf1); // vmaddy.xyzw vf2, vf10, vf1
c->lw(a3, 20, t0); // lw a3, 20(t0)
c->vmula_bc(DEST::xyzw, BC::x, vf3, vf1); // vmulax.xyzw acc, vf3, vf1
c->mov128_vf_gpr(vf4, a0); // qmtc2.i vf4, a0
c->vmadd_bc(DEST::xyzw, BC::y, vf3, vf11, vf1); // vmaddy.xyzw vf3, vf11, vf1
c->mov128_vf_gpr(vf12, t1); // qmtc2.i vf12, t1
c->pextlb(a0, t5, r0); // pextlb a0, t5, r0
c->mov128_vf_gpr(vf5, t2); // qmtc2.i vf5, t2
c->pextlb(t1, t6, r0); // pextlb t1, t6, r0
c->mov128_vf_gpr(vf13, t3); // qmtc2.i vf13, t3
c->pextlb(t2, t4, r0); // pextlb t2, t4, r0
c->vitof15(DEST::xyzw, vf4, vf4); // vitof15.xyzw vf4, vf4
c->pextlb(a3, a3, r0); // pextlb a3, a3, r0
c->vitof15(DEST::xyzw, vf12, vf12); // vitof15.xyzw vf12, vf12
c->pextlh(a0, a0, r0); // pextlh a0, a0, r0
c->vitof15(DEST::xyzw, vf5, vf5); // vitof15.xyzw vf5, vf5
c->pextlh(t1, t1, r0); // pextlh t1, t1, r0
c->vitof15(DEST::xyzw, vf13, vf13); // vitof15.xyzw vf13, vf13
c->pextlh(t2, t2, r0); // pextlh t2, t2, r0
c->lw(t5, 24, v1); // lw t5, 24(v1)
c->pextlh(t3, a3, r0); // pextlh t3, a3, r0
c->lw(t6, 24, t0); // lw t6, 24(t0)
c->vmula_bc(DEST::xyzw, BC::x, vf4, vf1); // vmulax.xyzw acc, vf4, vf1
c->lw(t4, 28, v1); // lw t4, 28(v1)
c->vmadd_bc(DEST::xyzw, BC::y, vf4, vf12, vf1); // vmaddy.xyzw vf4, vf12, vf1
c->lw(a3, 28, t0); // lw a3, 28(t0)
c->vmula_bc(DEST::xyzw, BC::x, vf5, vf1); // vmulax.xyzw acc, vf5, vf1
c->mov128_vf_gpr(vf6, a0); // qmtc2.i vf6, a0
c->vmadd_bc(DEST::xyzw, BC::y, vf5, vf13, vf1); // vmaddy.xyzw vf5, vf13, vf1
c->mov128_vf_gpr(vf14, t1); // qmtc2.i vf14, t1
c->pextlb(a0, t5, r0); // pextlb a0, t5, r0
c->mov128_vf_gpr(vf7, t2); // qmtc2.i vf7, t2
c->pextlb(t1, t6, r0); // pextlb t1, t6, r0
c->mov128_vf_gpr(vf15, t3); // qmtc2.i vf15, t3
c->pextlb(t2, t4, r0); // pextlb t2, t4, r0
c->vitof15(DEST::xyzw, vf6, vf6); // vitof15.xyzw vf6, vf6
c->pextlb(a3, a3, r0); // pextlb a3, a3, r0
c->vitof15(DEST::xyzw, vf14, vf14); // vitof15.xyzw vf14, vf14
c->pextlh(a0, a0, r0); // pextlh a0, a0, r0
c->vitof15(DEST::xyzw, vf7, vf7); // vitof15.xyzw vf7, vf7
c->pextlh(t1, t1, r0); // pextlh t1, t1, r0
c->vitof15(DEST::xyzw, vf15, vf15); // vitof15.xyzw vf15, vf15
c->pextlh(t2, t2, r0); // pextlh t2, t2, r0
c->sqc2(vf2, 0, a1); // sqc2 vf2, 0(a1)
c->pextlh(a3, a3, r0); // pextlh a3, a3, r0
c->sqc2(vf3, 16, a1); // sqc2 vf3, 16(a1)
c->vmula_bc(DEST::xyzw, BC::x, vf6, vf1); // vmulax.xyzw acc, vf6, vf1
c->sqc2(vf4, 32, a1); // sqc2 vf4, 32(a1)
c->vmadd_bc(DEST::xyzw, BC::y, vf6, vf14, vf1); // vmaddy.xyzw vf6, vf14, vf1
c->sqc2(vf5, 48, a1); // sqc2 vf5, 48(a1)
c->vmula_bc(DEST::xyzw, BC::x, vf7, vf1); // vmulax.xyzw acc, vf7, vf1
c->mov128_vf_gpr(vf8, a0); // qmtc2.i vf8, a0
c->vmadd_bc(DEST::xyzw, BC::y, vf7, vf15, vf1); // vmaddy.xyzw vf7, vf15, vf1
c->mov128_vf_gpr(vf16, t1); // qmtc2.i vf16, t1
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf9, t2); // qmtc2.i vf9, t2
// nop // sll r0, r0, 0
c->mov128_vf_gpr(vf17, a3); // qmtc2.i vf17, a3
// nop // sll r0, r0, 0
c->vitof15(DEST::xyzw, vf8, vf8); // vitof15.xyzw vf8, vf8
c->daddiu(a1, a1, 128); // daddiu a1, a1, 128
c->vitof15(DEST::xyzw, vf16, vf16); // vitof15.xyzw vf16, vf16
c->lw(a0, 32, v1); // lw a0, 32(v1)
c->vitof15(DEST::xyzw, vf9, vf9); // vitof15.xyzw vf9, vf9
c->lw(a3, 32, t0); // lw a3, 32(t0)
c->vitof15(DEST::xyzw, vf17, vf17); // vitof15.xyzw vf17, vf17
c->vmula_bc(DEST::xyzw, BC::x, vf8, vf1); // vmulax.xyzw acc, vf8, vf1
c->sqc2(vf6, -64, a1); // sqc2 vf6, -64(a1)
c->vmadd_bc(DEST::xyzw, BC::y, vf8, vf16, vf1); // vmaddy.xyzw vf8, vf16, vf1
c->sqc2(vf7, -48, a1); // sqc2 vf7, -48(a1)
c->vmula_bc(DEST::xyzw, BC::x, vf9, vf1); // vmulax.xyzw acc, vf9, vf1
c->daddiu(a2, a2, -1); // daddiu a2, a2, -1
c->vmadd_bc(DEST::xyzw, BC::y, vf9, vf17, vf1); // vmaddy.xyzw vf9, vf17, vf1
c->daddiu(v1, v1, 32); // daddiu v1, v1, 32
// nop // sll r0, r0, 0
c->daddiu(t0, t0, 32); // daddiu t0, t0, 32
// nop // sll r0, r0, 0
c->sqc2(vf8, -32, a1); // sqc2 vf8, -32(a1)
bc = ((s64)c->sgpr64(a2)) > 0; // bgtz a2, L16
c->sqc2(vf9, -16, a1); // sqc2 vf9, -16(a1)
if (bc) {goto block_1;} // branch non-likely
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.ocean_wave_frames = intern_from_c(-1, 0, "*ocean-wave-frames*").c();
gLinkedFunctionTable.reg("(method 14 ocean)", execute, 256);
}
} // namespace method_14_ocean
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_15_ocean {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
// nop // sll r0, r0, 0
c->mov64(v1, a1); // or v1, a1, r0
c->mov64(a0, a2); // or a0, a2, r0
c->addiu(a1, r0, 64); // addiu a1, r0, 64
// nop // sll r0, r0, 0
block_1:
c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1)
// nop // sll r0, r0, 0
c->lqc2(vf2, 16, v1); // lqc2 vf2, 16(v1)
// nop // sll r0, r0, 0
c->lqc2(vf3, 32, v1); // lqc2 vf3, 32(v1)
// nop // sll r0, r0, 0
c->lqc2(vf4, 48, v1); // lqc2 vf4, 48(v1)
// nop // sll r0, r0, 0
c->lqc2(vf5, 0, a0); // lqc2 vf5, 0(a0)
// nop // sll r0, r0, 0
c->lqc2(vf6, 16, a0); // lqc2 vf6, 16(a0)
// nop // sll r0, r0, 0
c->lqc2(vf7, 32, a0); // lqc2 vf7, 32(a0)
// nop // sll r0, r0, 0
c->lqc2(vf8, 48, a0); // lqc2 vf8, 48(a0)
// nop // sll r0, r0, 0
c->vadd(DEST::xyzw, vf1, vf1, vf5); // vadd.xyzw vf1, vf1, vf5
// nop // sll r0, r0, 0
c->vadd(DEST::xyzw, vf2, vf2, vf6); // vadd.xyzw vf2, vf2, vf6
// nop // sll r0, r0, 0
c->vadd(DEST::xyzw, vf3, vf3, vf7); // vadd.xyzw vf3, vf3, vf7
// nop // sll r0, r0, 0
c->vadd(DEST::xyzw, vf4, vf4, vf8); // vadd.xyzw vf4, vf4, vf8
// nop // sll r0, r0, 0
c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1)
// nop // sll r0, r0, 0
c->sqc2(vf2, 16, v1); // sqc2 vf2, 16(v1)
c->daddiu(a1, a1, -1); // daddiu a1, a1, -1
c->sqc2(vf3, 32, v1); // sqc2 vf3, 32(v1)
c->daddiu(v1, v1, 64); // daddiu v1, v1, 64
bc = ((s64)c->sgpr64(a1)) > 0; // bgtz a1, L14
c->sqc2(vf4, -16, v1); // sqc2 vf4, -16(v1)
if (bc) {goto block_1;} // branch non-likely
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//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() {
gLinkedFunctionTable.reg("(method 15 ocean)", execute, 128);
}
} // namespace method_15_ocean
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_16_ocean {
struct Cache {
void* level; // *level*
void* time_of_day_context; // *time-of-day-context*
void* ocean_vu0_block; // ocean-vu0-block
void* sewerb; // sewerb
void* upload_vu0_program; // upload-vu0-program
void* vu_lights_light_group; // vu-lights<-light-group!
void* ocean_generate_verts_vector;
} cache;
void vcallms0(ExecutionContext* c) {
// nop | mulay.x ACC, vf12, vf02 0
c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf02).vf.y());
// nop | mulax.z ACC, vf12, vf03 1
c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.x());
// nop | msubx.xz vf24, vf12, vf02 2
// ASSERT(false);
c->acc.vf.msub(Mask::xz, c->vfs[vf24].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.x());
// nop | mulaz.x ACC, vf12, vf02 3
c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf02).vf.z());
// nop | mulay.z ACC, vf12, vf03 4
c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.y());
// nop | msuby.xz vf25, vf12, vf02 5
// ASSERT(false);
c->acc.vf.msub(Mask::xz, c->vfs[vf25].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.y());
// nop | mulaw.x ACC, vf12, vf02 6
c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf02).vf.w());
// nop | mulaz.z ACC, vf12, vf03 7
c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.z());
// nop | msubz.xz vf26, vf12, vf02 8
// ASSERT(false);
c->acc.vf.msub(Mask::xz, c->vfs[vf26].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.z());
// nop | mulax.x ACC, vf12, vf04 9
c->acc.vf.mula(Mask::x, c->vf_src(vf12).vf, c->vf_src(vf04).vf.x());
// nop | mulaw.z ACC, vf12, vf03 10
c->acc.vf.mula(Mask::z, c->vf_src(vf12).vf, c->vf_src(vf03).vf.w());
// nop | msubw.xz vf27, vf12, vf02 11
// ASSERT(false);
c->acc.vf.msub(Mask::xz, c->vfs[vf27].vf, c->vf_src(vf12).vf, c->vf_src(vf02).vf.w());
// nop | mul.xz vf28, vf24, vf24 12
c->vfs[vf28].vf.mul(Mask::xz, c->vf_src(vf24).vf, c->vf_src(vf24).vf);
// nop | mul.xz vf29, vf25, vf25 13
c->vfs[vf29].vf.mul(Mask::xz, c->vf_src(vf25).vf, c->vf_src(vf25).vf);
// nop | mul.xz vf30, vf26, vf26 14
c->vfs[vf30].vf.mul(Mask::xz, c->vf_src(vf26).vf, c->vf_src(vf26).vf);
// nop | mul.xz vf31, vf27, vf27 15
c->vfs[vf31].vf.mul(Mask::xz, c->vf_src(vf27).vf, c->vf_src(vf27).vf);
// nop | subx.y vf24, vf01, vf28 16
c->vfs[vf24].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf28).vf.x());
// nop | subx.y vf25, vf01, vf29 17
c->vfs[vf25].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf29).vf.x());
// nop | subx.y vf26, vf01, vf30 18
c->vfs[vf26].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf30).vf.x());
// nop | subx.y vf27, vf01, vf31 19
c->vfs[vf27].vf.sub(Mask::y, c->vf_src(vf01).vf, c->vf_src(vf31).vf.x());
// nop | subz.y vf24, vf24, vf28 20
c->vfs[vf24].vf.sub(Mask::y, c->vf_src(vf24).vf, c->vf_src(vf28).vf.z());
// nop | subz.y vf25, vf25, vf29 21
c->vfs[vf25].vf.sub(Mask::y, c->vf_src(vf25).vf, c->vf_src(vf29).vf.z());
// nop | subz.y vf26, vf26, vf30 22
c->vfs[vf26].vf.sub(Mask::y, c->vf_src(vf26).vf, c->vf_src(vf30).vf.z());
// nop | subz.y vf27, vf27, vf31 23
c->vfs[vf27].vf.sub(Mask::y, c->vf_src(vf27).vf, c->vf_src(vf31).vf.z());
// nop | mulx.w vf24, vf01, vf02 24
c->vfs[vf24].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.x());
// nop | muly.w vf25, vf01, vf02 25
c->vfs[vf25].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.y());
// nop | mulz.w vf26, vf01, vf02 26
c->vfs[vf26].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.z());
// nop | mulw.w vf27, vf01, vf02 27
c->vfs[vf27].vf.mul(Mask::w, c->vf_src(vf01).vf, c->vf_src(vf02).vf.w());
// nop | mulax.xyzw ACC, vf05, vf24 28
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf24).vf.x());
// nop | madday.xyzw ACC, vf06, vf24 29
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf24].vf.y());
// nop | maddz.xyz vf16, vf07, vf24 30
c->acc.vf.madd(Mask::xyz, c->vfs[vf16].vf, c->vf_src(vf07).vf, c->vf_src(vf24).vf.z());
// nop | mulax.xyzw ACC, vf05, vf25 31
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf25).vf.x());
// nop | madday.xyzw ACC, vf06, vf25 32
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf25].vf.y());
// nop | maddz.xyz vf17, vf07, vf25 33
c->acc.vf.madd(Mask::xyz, c->vfs[vf17].vf, c->vf_src(vf07).vf, c->vf_src(vf25).vf.z());
// nop | mulax.xyzw ACC, vf05, vf26 34
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf26).vf.x());
// nop | madday.xyzw ACC, vf06, vf26 35
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf26].vf.y());
// nop | maddz.xyz vf18, vf07, vf26 36
c->acc.vf.madd(Mask::xyz, c->vfs[vf18].vf, c->vf_src(vf07).vf, c->vf_src(vf26).vf.z());
// nop | mulax.xyzw ACC, vf05, vf27 37
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf05).vf, c->vf_src(vf27).vf.x());
// nop | madday.xyzw ACC, vf06, vf27 38
c->acc.vf.madda(Mask::xyzw, c->vfs[vf06].vf, c->vfs[vf27].vf.y());
// nop | maddz.xyz vf19, vf07, vf27 39
c->acc.vf.madd(Mask::xyz, c->vfs[vf19].vf, c->vf_src(vf07).vf, c->vf_src(vf27).vf.z());
// nop | maxx.xyz vf16, vf16, vf00 40
c->vfs[vf16].vf.max(Mask::xyz, c->vf_src(vf16).vf, c->vf_src(vf00).vf.x());
// nop | maxx.xyz vf17, vf17, vf00 41
c->vfs[vf17].vf.max(Mask::xyz, c->vf_src(vf17).vf, c->vf_src(vf00).vf.x());
// nop | maxx.xyz vf18, vf18, vf00 42
c->vfs[vf18].vf.max(Mask::xyz, c->vf_src(vf18).vf, c->vf_src(vf00).vf.x());
// nop | maxx.xyz vf19, vf19, vf00 43
c->vfs[vf19].vf.max(Mask::xyz, c->vf_src(vf19).vf, c->vf_src(vf00).vf.x());
// nop | mula.xyzw ACC, vf01, vf11 44
// vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11);
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf);
// nop | maddax.xyzw ACC, vf08, vf16 45
c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf16].vf.x());
// nop | madday.xyzw ACC, vf09, vf16 46
c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf16].vf.y());
// nop | maddz.xyzw vf20, vf10, vf16 47
c->acc.vf.madd(Mask::xyzw, c->vfs[vf20].vf, c->vf_src(vf10).vf, c->vf_src(vf16).vf.z());
// nop | mula.xyzw ACC, vf01, vf11 48
// vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11);
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf);
// nop | maddax.xyzw ACC, vf08, vf17 49
c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf17].vf.x());
// nop | madday.xyzw ACC, vf09, vf17 50
c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf17].vf.y());
// nop | maddz.xyzw vf21, vf10, vf17 51
c->acc.vf.madd(Mask::xyzw, c->vfs[vf21].vf, c->vf_src(vf10).vf, c->vf_src(vf17).vf.z());
// nop | mula.xyzw ACC, vf01, vf11 52
// vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11);
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf);
// nop | maddax.xyzw ACC, vf08, vf18 53
c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf18].vf.x());
// nop | madday.xyzw ACC, vf09, vf18 54
c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf18].vf.y());
// nop | maddz.xyzw vf22, vf10, vf18 55
c->acc.vf.madd(Mask::xyzw, c->vfs[vf22].vf, c->vf_src(vf10).vf, c->vf_src(vf18).vf.z());
// nop | mula.xyzw ACC, vf01, vf11 56
// vu.acc.mula(Mask::xyzw, vu.vf01, vu.vf11);
c->acc.vf.mula(Mask::xyzw, c->vf_src(vf01).vf, c->vf_src(vf11).vf);
// nop | maddax.xyzw ACC, vf08, vf19 57
c->acc.vf.madda(Mask::xyzw, c->vfs[vf08].vf, c->vfs[vf19].vf.x());
// nop | madday.xyzw ACC, vf09, vf19 58
c->acc.vf.madda(Mask::xyzw, c->vfs[vf09].vf, c->vfs[vf19].vf.y());
// nop | maddz.xyzw vf23, vf10, vf19 59
c->acc.vf.madd(Mask::xyzw, c->vfs[vf23].vf, c->vf_src(vf10).vf, c->vf_src(vf19).vf.z());
// nop | miniy.xyzw vf20, vf20, vf12 60
c->vfs[vf20].vf.mini(Mask::xyzw, c->vf_src(vf20).vf, c->vf_src(vf12).vf.y());
// nop | miniy.xyzw vf21, vf21, vf12 61
c->vfs[vf21].vf.mini(Mask::xyzw, c->vf_src(vf21).vf, c->vf_src(vf12).vf.y());
// nop | miniy.xyzw vf22, vf22, vf12 :e 62
c->vfs[vf22].vf.mini(Mask::xyzw, c->vf_src(vf22).vf, c->vf_src(vf12).vf.y());
// nop | miniy.xyzw vf23, vf23, vf12 63
c->vfs[vf23].vf.mini(Mask::xyzw, c->vf_src(vf23).vf, c->vf_src(vf12).vf.y());
}
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
bool cop1_bc = false;
c->daddiu(sp, sp, -80); // daddiu sp, sp, -80
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sd(fp, 8, sp); // sd fp, 8(sp)
c->mov64(fp, t9); // or fp, t9, r0
c->sq(s4, 32, sp); // sq s4, 32(sp)
c->sq(s5, 48, sp); // sq s5, 48(sp)
c->sq(gp, 64, sp); // sq gp, 64(sp)
c->mov64(s4, a0); // or s4, a0, r0
c->mov64(s5, a1); // or s5, a1, r0
c->mov64(gp, a2); // or gp, a2, r0
c->load_symbol2(t9, cache.upload_vu0_program); // lw t9, upload-vu0-program(s7)
c->load_symbol2(a0, cache.ocean_vu0_block); // lw a0, ocean-vu0-block(s7)
c->daddiu(a1, s4, 8296); // daddiu a1, s4, 8296
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->load_symbol2(a0, cache.level); // lw a0, *level*(s7)
c->lwu(v1, -4, a0); // lwu v1, -4(a0)
c->lwu(t9, 52, v1); // lwu t9, 52(v1)
c->load_symbol_addr(a1, cache.sewerb); // daddiu a1, s7, sewerb
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L2
// nop // sll r0, r0, 0
if (bc) {goto block_2;} // branch non-likely
c->load_symbol2(t9, cache.vu_lights_light_group);// lw t9, vu-lights<-light-group!(s7)
c->daddiu(a0, s4, 8144); // daddiu a0, s4, 8144
c->daddiu(a1, v1, 796); // daddiu a1, v1, 796
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
//beq r0, r0, L3 // beq r0, r0, L3
// nop // sll r0, r0, 0
goto block_3; // branch always
block_2:
c->load_symbol2(t9, cache.vu_lights_light_group);// lw t9, vu-lights<-light-group!(s7)
c->daddiu(a0, s4, 8144); // daddiu a0, s4, 8144
c->load_symbol2(v1, cache.time_of_day_context); // lw v1, *time-of-day-context*(s7)
c->daddiu(a1, v1, 156); // daddiu a1, v1, 156
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
block_3:
c->daddiu(v1, sp, 16); // daddiu v1, sp, 16
c->mov64(a2, v1); // or a2, v1, r0
c->daddiu(a0, s4, 8192); // daddiu a0, s4, 8192
c->daddiu(a1, s4, 8208); // daddiu a1, s4, 8208
c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1)
c->vadd(DEST::xyz, vf6, vf4, vf5); // vadd.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2)
c->mov64(a2, v1); // or a2, v1, r0
c->mov64(a0, v1); // or a0, v1, r0
c->daddiu(a1, s4, 8224); // daddiu a1, s4, 8224
c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1)
c->vadd(DEST::xyz, vf6, vf4, vf5); // vadd.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2)
c->mov64(a2, v1); // or a2, v1, r0
c->mov64(a0, v1); // or a0, v1, r0
c->daddiu(a1, s4, 8240); // daddiu a1, s4, 8240
c->vmove(DEST::w, vf6, vf0); // vmove.w vf6, vf0
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1)
c->vadd(DEST::xyz, vf6, vf4, vf5); // vadd.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2)
c->lui(a0, 16288); // lui a0, 16288
c->mtc1(f0, a0); // mtc1 f0, a0
c->lwc1(f1, 0, v1); // lwc1 f1, 0(v1)
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = cop1_bc; // bc1t L4
c->daddiu(a0, s7, 4); // daddiu a0, s7, 4
if (bc) {goto block_5;} // branch non-likely
c->mov64(a0, s7); // or a0, s7, r0
block_5:
if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(a0))) {// bnel s7, a0, L6
c->mov64(a0, a0); // or a0, a0, r0
goto block_13;
}
c->lui(a0, 16288); // lui a0, 16288
c->mtc1(f0, a0); // mtc1 f0, a0
c->lwc1(f1, 4, v1); // lwc1 f1, 4(v1)
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = cop1_bc; // bc1t L5
c->daddiu(a0, s7, 4); // daddiu a0, s7, 4
if (bc) {goto block_9;} // branch non-likely
c->mov64(a0, s7); // or a0, s7, r0
block_9:
if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(a0))) {// bnel s7, a0, L6
c->mov64(a0, a0); // or a0, a0, r0
goto block_13;
}
c->lui(a0, 16288); // lui a0, 16288
c->mtc1(f0, a0); // mtc1 f0, a0
c->lwc1(f1, 8, v1); // lwc1 f1, 8(v1)
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = cop1_bc; // bc1t L6
c->daddiu(a0, s7, 4); // daddiu a0, s7, 4
if (bc) {goto block_13;} // branch non-likely
c->mov64(a0, s7); // or a0, s7, r0
block_13:
bc = c->sgpr64(s7) == c->sgpr64(a0); // beq s7, a0, L10
c->mov64(a0, s7); // or a0, s7, r0
if (bc) {goto block_20;} // branch non-likely
c->mtc1(f0, r0); // mtc1 f0, r0
c->mtc1(f0, r0); // mtc1 f0, r0
c->lwc1(f0, 4, v1); // lwc1 f0, 4(v1)
c->lwc1(f1, 0, v1); // lwc1 f1, 0(v1)
cop1_bc = c->fprs[f0] < c->fprs[f1]; // c.lt.s f0, f1
bc = !cop1_bc; // bc1f L7
// nop // sll r0, r0, 0
if (bc) {goto block_16;} // branch non-likely
c->lwc1(f0, 0, v1); // lwc1 f0, 0(v1)
c->lwc1(f1, 8240, s4); // lwc1 f1, 8240(s4)
c->mfc1(a0, f1); // mfc1 a0, f1
//beq r0, r0, L8 // beq r0, r0, L8
// nop // sll r0, r0, 0
goto block_17; // branch always
block_16:
c->lwc1(f0, 4, v1); // lwc1 f0, 4(v1)
c->lwc1(f1, 8244, s4); // lwc1 f1, 8244(s4)
c->mfc1(a0, f1); // mfc1 a0, f1
block_17:
c->lwc1(f2, 8, v1); // lwc1 f2, 8(v1)
cop1_bc = c->fprs[f0] < c->fprs[f2]; // c.lt.s f0, f2
bc = !cop1_bc; // bc1f L9
c->mov64(a0, s7); // or a0, s7, r0
if (bc) {goto block_19;} // branch non-likely
c->lwc1(f0, 8, v1); // lwc1 f0, 8(v1)
c->lwc1(f1, 8248, s4); // lwc1 f1, 8248(s4)
c->mfc1(v1, f1); // mfc1 v1, f1
block_19:
c->lui(v1, 16288); // lui v1, 16288
c->mtc1(f2, v1); // mtc1 f2, v1
c->subs(f2, f2, f1); // sub.s f2, f2, f1
c->subs(f0, f0, f1); // sub.s f0, f0, f1
c->divs(f0, f2, f0); // div.s f0, f2, f0
c->daddiu(v1, s4, 8192); // daddiu v1, s4, 8192
c->daddiu(a0, s4, 8192); // daddiu a0, s4, 8192
c->movs(f1, f0); // mov.s f1, f0
c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0)
c->mfc1(a0, f1); // mfc1 a0, f1
c->mov128_vf_gpr(vf2, a0); // qmtc2.i vf2, a0
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1)
c->daddiu(v1, s4, 8208); // daddiu v1, s4, 8208
c->daddiu(a0, s4, 8208); // daddiu a0, s4, 8208
c->movs(f1, f0); // mov.s f1, f0
c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0)
c->mfc1(a0, f1); // mfc1 a0, f1
c->mov128_vf_gpr(vf2, a0); // qmtc2.i vf2, a0
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, v1); // sqc2 vf1, 0(v1)
c->daddiu(a0, s4, 8224); // daddiu a0, s4, 8224
c->daddiu(v1, s4, 8224); // daddiu v1, s4, 8224
c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1)
c->mfc1(v1, f0); // mfc1 v1, f0
c->mov128_vf_gpr(vf2, v1); // qmtc2.i vf2, v1
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, a0); // sqc2 vf1, 0(a0)
block_20:
// daddiu v1, fp, L18 // daddiu v1, fp, L18
c->load_symbol2(v1, cache.ocean_generate_verts_vector); // HACK
c->daddiu(a2, s4, 8192); // daddiu a2, s4, 8192
c->daddiu(a0, s4, 8192); // daddiu a0, s4, 8192
c->mov64(a1, v1); // or a1, v1, r0
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1)
c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0
c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2)
c->daddiu(a2, s4, 8208); // daddiu a2, s4, 8208
c->daddiu(a0, s4, 8208); // daddiu a0, s4, 8208
c->mov64(a1, v1); // or a1, v1, r0
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1)
c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0
c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2)
c->daddiu(a2, s4, 8224); // daddiu a2, s4, 8224
c->daddiu(a0, s4, 8224); // daddiu a0, s4, 8224
c->mov64(a1, v1); // or a1, v1, r0
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, a1); // lqc2 vf5, 0(a1)
c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0
c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a2); // sqc2 vf6, 0(a2)
c->daddiu(a1, s4, 8240); // daddiu a1, s4, 8240
c->daddiu(a0, s4, 8240); // daddiu a0, s4, 8240
c->lqc2(vf4, 0, a0); // lqc2 vf4, 0(a0)
c->lqc2(vf5, 0, v1); // lqc2 vf5, 0(v1)
c->vadd_bc(DEST::w, BC::x, vf6, vf0, vf0); // vaddx.w vf6, vf0, vf0
c->vmul(DEST::xyz, vf6, vf4, vf5); // vmul.xyz vf6, vf4, vf5
c->sqc2(vf6, 0, a1); // sqc2 vf6, 0(a1)
c->lui(v1, 17152); // lui v1, 17152
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 8204, s4); // swc1 f0, 8204(s4)
c->lui(v1, 17152); // lui v1, 17152
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 8220, s4); // swc1 f0, 8220(s4)
c->lui(v1, 17152); // lui v1, 17152
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 8236, s4); // swc1 f0, 8236(s4)
c->mtc1(f0, r0); // mtc1 f0, r0
c->swc1(f0, 8252, s4); // swc1 f0, 8252(s4)
c->mfc1(v1, f0); // mfc1 v1, f0
c->vmax_bc(DEST::xyzw, BC::w, vf1, vf0, vf0); // vmaxw.xyzw vf1, vf0, vf0
c->lqc2(vf12, 8096, s4); // lqc2 vf12, 8096(s4)
c->lqc2(vf5, 8144, s4); // lqc2 vf5, 8144(s4)
c->lqc2(vf6, 8160, s4); // lqc2 vf6, 8160(s4)
c->lqc2(vf7, 8176, s4); // lqc2 vf7, 8176(s4)
c->lqc2(vf8, 8192, s4); // lqc2 vf8, 8192(s4)
c->lqc2(vf9, 8208, s4); // lqc2 vf9, 8208(s4)
c->lqc2(vf10, 8224, s4); // lqc2 vf10, 8224(s4)
c->lqc2(vf11, 8240, s4); // lqc2 vf11, 8240(s4)
c->addiu(v1, r0, 31); // addiu v1, r0, 31
c->mov64(a0, gp); // or a0, gp, r0
c->daddiu(a1, gp, 128); // daddiu a1, gp, 128
// nop // sll r0, r0, 0
block_21:
c->lqc2(vf2, 0, gp); // lqc2 vf2, 0(gp)
c->addiu(t2, r0, 6); // addiu t2, r0, 6
c->lqc2(vf3, 16, gp); // lqc2 vf3, 16(gp)
c->daddiu(t5, gp, 16); // daddiu t5, gp, 16
c->lqc2(vf4, 0, a1); // lqc2 vf4, 0(a1)
c->daddiu(a1, a1, 16); // daddiu a1, a1, 16
// Unknown instr: vcallms 0
vcallms0(c);
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t1, vf20); // qmfc2.i t1, vf20
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t0, vf21); // qmfc2.i t0, vf21
// nop // sll r0, r0, 0
c->mov128_gpr_vf(a3, vf22); // qmfc2.i a3, vf22
// nop // sll r0, r0, 0
c->mov128_gpr_vf(a2, vf23); // qmfc2.i a2, vf23
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t6, vf24); // qmfc2.i t6, vf24
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t7, vf25); // qmfc2.i t7, vf25
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t3, vf26); // qmfc2.i t3, vf26
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t4, vf27); // qmfc2.i t4, vf27
// nop // sll r0, r0, 0
c->lqc2(vf2, 0, t5); // lqc2 vf2, 0(t5)
// nop // sll r0, r0, 0
c->lqc2(vf3, 16, t5); // lqc2 vf3, 16(t5)
c->daddiu(gp, t5, 16); // daddiu gp, t5, 16
c->lqc2(vf4, 0, a1); // lqc2 vf4, 0(a1)
c->daddiu(a1, a1, 16); // daddiu a1, a1, 16
block_22:
// Unknown instr: vcallms 0
vcallms0(c);
// nop // sll r0, r0, 0
c->pextlw(t5, t7, t6); // pextlw t5, t7, t6
// nop // sll r0, r0, 0
c->pextuw(t6, t7, t6); // pextuw t6, t7, t6
// nop // sll r0, r0, 0
c->pextlw(t7, t4, t3); // pextlw t7, t4, t3
// nop // sll r0, r0, 0
c->pextuw(t4, t4, t3); // pextuw t4, t4, t3
// nop // sll r0, r0, 0
c->pcpyld(t3, t7, t5); // pcpyld t3, t7, t5
c->sq(t1, 0, s5); // sq t1, 0(s5)
c->pcpyud(t1, t5, t7); // pcpyud t1, t5, t7
c->sq(t0, 32, s5); // sq t0, 32(s5)
c->pcpyld(t0, t4, t6); // pcpyld t0, t4, t6
c->sq(a3, 64, s5); // sq a3, 64(s5)
c->pcpyud(a3, t6, t4); // pcpyud a3, t6, t4
c->sq(a2, 96, s5); // sq a2, 96(s5)
c->sq(t3, 16, s5); // sq t3, 16(s5)
// nop // sll r0, r0, 0
c->sq(t1, 48, s5); // sq t1, 48(s5)
// nop // sll r0, r0, 0
c->sq(t0, 80, s5); // sq t0, 80(s5)
// nop // sll r0, r0, 0
c->sq(a3, 112, s5); // sq a3, 112(s5)
c->daddiu(s5, s5, 128); // daddiu s5, s5, 128
c->mov128_gpr_vf(t1, vf20); // qmfc2.i t1, vf20
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t0, vf21); // qmfc2.i t0, vf21
// nop // sll r0, r0, 0
c->mov128_gpr_vf(a3, vf22); // qmfc2.i a3, vf22
// nop // sll r0, r0, 0
c->mov128_gpr_vf(a2, vf23); // qmfc2.i a2, vf23
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t6, vf24); // qmfc2.i t6, vf24
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t7, vf25); // qmfc2.i t7, vf25
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t3, vf26); // qmfc2.i t3, vf26
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t4, vf27); // qmfc2.i t4, vf27
c->daddiu(t2, t2, -1); // daddiu t2, t2, -1
c->lqc2(vf2, 0, gp); // lqc2 vf2, 0(gp)
c->daddiu(a1, a1, 16); // daddiu a1, a1, 16
c->lqc2(vf3, 16, gp); // lqc2 vf3, 16(gp)
c->daddiu(gp, gp, 16); // daddiu gp, gp, 16
bc = ((s64)c->sgpr64(t2)) > 0; // bgtz t2, L12
c->lqc2(vf4, -16, a1); // lqc2 vf4, -16(a1)
if (bc) {goto block_22;} // branch non-likely
c->lqc2(vf3, -128, gp); // lqc2 vf3, -128(gp)
// nop // sll r0, r0, 0
// Unknown instr: vcallms 0
vcallms0(c);
// nop // sll r0, r0, 0
c->pextlw(t2, t7, t6); // pextlw t2, t7, t6
// nop // sll r0, r0, 0
c->pextuw(t5, t7, t6); // pextuw t5, t7, t6
// nop // sll r0, r0, 0
c->pextlw(t6, t4, t3); // pextlw t6, t4, t3
// nop // sll r0, r0, 0
c->pextuw(t4, t4, t3); // pextuw t4, t4, t3
// nop // sll r0, r0, 0
c->pcpyld(t3, t6, t2); // pcpyld t3, t6, t2
c->sq(t1, 0, s5); // sq t1, 0(s5)
c->pcpyud(t1, t2, t6); // pcpyud t1, t2, t6
c->sq(t0, 32, s5); // sq t0, 32(s5)
c->pcpyld(t0, t4, t5); // pcpyld t0, t4, t5
c->sq(a3, 64, s5); // sq a3, 64(s5)
c->pcpyud(a3, t5, t4); // pcpyud a3, t5, t4
c->sq(a2, 96, s5); // sq a2, 96(s5)
c->sq(t3, 16, s5); // sq t3, 16(s5)
// nop // sll r0, r0, 0
c->sq(t1, 48, s5); // sq t1, 48(s5)
// nop // sll r0, r0, 0
c->sq(t0, 80, s5); // sq t0, 80(s5)
// nop // sll r0, r0, 0
c->sq(a3, 112, s5); // sq a3, 112(s5)
c->daddiu(a2, s5, 128); // daddiu a2, s5, 128
c->mov128_gpr_vf(t2, vf20); // qmfc2.i t2, vf20
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t1, vf21); // qmfc2.i t1, vf21
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t0, vf22); // qmfc2.i t0, vf22
// nop // sll r0, r0, 0
c->mov128_gpr_vf(a3, vf23); // qmfc2.i a3, vf23
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t4, vf24); // qmfc2.i t4, vf24
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t7, vf25); // qmfc2.i t7, vf25
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t5, vf26); // qmfc2.i t5, vf26
// nop // sll r0, r0, 0
c->mov128_gpr_vf(t6, vf27); // qmfc2.i t6, vf27
c->daddiu(v1, v1, -1); // daddiu v1, v1, -1
c->pextlw(t3, t7, t4); // pextlw t3, t7, t4
// nop // sll r0, r0, 0
c->pextuw(t4, t7, t4); // pextuw t4, t7, t4
// nop // sll r0, r0, 0
c->pextlw(t7, t6, t5); // pextlw t7, t6, t5
// nop // sll r0, r0, 0
c->pextuw(t6, t6, t5); // pextuw t6, t6, t5
// nop // sll r0, r0, 0
c->pcpyld(t5, t7, t3); // pcpyld t5, t7, t3
c->sq(t2, 0, a2); // sq t2, 0(a2)
c->pcpyud(t2, t3, t7); // pcpyud t2, t3, t7
c->sq(t1, 32, a2); // sq t1, 32(a2)
c->pcpyld(t1, t6, t4); // pcpyld t1, t6, t4
c->sq(t0, 64, a2); // sq t0, 64(a2)
c->pcpyud(t0, t4, t6); // pcpyud t0, t4, t6
c->sq(a3, 96, a2); // sq a3, 96(a2)
c->sq(t5, 16, a2); // sq t5, 16(a2)
// nop // sll r0, r0, 0
c->sq(t2, 48, a2); // sq t2, 48(a2)
// nop // sll r0, r0, 0
c->sq(t1, 80, a2); // sq t1, 80(a2)
// nop // sll r0, r0, 0
c->sq(t0, 112, a2); // sq t0, 112(a2)
c->daddiu(s5, a2, 128); // daddiu s5, a2, 128
bc = ((s64)c->sgpr64(v1)) > 0; // bgtz v1, L11
// nop // sll r0, r0, 0
if (bc) {goto block_21;} // branch non-likely
bc = c->sgpr64(v1) == 0; // beq v1, r0, L11
c->mov64(a1, a0); // or a1, a0, r0
if (bc) {goto block_21;} // branch non-likely
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->ld(fp, 8, sp); // ld fp, 8(sp)
c->lq(gp, 64, sp); // lq gp, 64(sp)
c->lq(s5, 48, sp); // lq s5, 48(sp)
c->lq(s4, 32, sp); // lq s4, 32(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 80); // daddiu sp, sp, 80
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.level = intern_from_c(-1, 0, "*level*").c();
cache.time_of_day_context = intern_from_c(-1, 0, "*time-of-day-context*").c();
cache.ocean_vu0_block = intern_from_c(-1, 0, "ocean-vu0-block").c();
cache.sewerb = intern_from_c(-1, 0, "sewerb").c();
cache.upload_vu0_program = intern_from_c(-1, 0, "upload-vu0-program").c();
cache.vu_lights_light_group = intern_from_c(-1, 0, "vu-lights<-light-group!").c();
cache.ocean_generate_verts_vector = intern_from_c(-1, 0, "*ocean-generate-verts-vector*").c();
gLinkedFunctionTable.reg("(method 16 ocean)", execute, 128);
}
} // namespace method_16_ocean
} // namespace Mips2C

View File

@ -0,0 +1,601 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
struct RippleVu0 {
Vf data_mem[256];
void sq(const Vf& reg, u16 addr) {
ASSERT(addr < 256);
data_mem[addr] = reg;
}
Vf lq(u16 addr) {
ASSERT(addr < 256);
return data_mem[addr];
}
} gRippleVu0;
namespace ripple_execute_init {
struct Cache {
void* cos_poly_vec; // *cos-poly-vec*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->load_symbol2(v1, cache.cos_poly_vec); // lw v1, *cos-poly-vec*(s7)
c->lqc2(vf7, 0, v1); // lqc2 vf7, 0(v1)
c->lui(v1, 15561); // lui v1, 15561
c->ori(v1, v1, 4058); // ori v1, v1, 4058
c->mtc1(f0, v1); // mtc1 f0, v1
c->mfc1(v1, f0); // mfc1 v1, f0
c->mov128_vf_gpr(vf6, v1); // qmtc2.i vf6, v1
c->mov128_gpr_vf(v1, vf6); // qmfc2.i v1, vf6
c->addiu(v1, r0, 128); // addiu v1, r0, 128
u16 vi2 = c->gpr_src(v1).du16[0]; // ctc2.i vi2, v1
c->gprs[v1].du64[0] = vi2; // cfc2.i v1, vi2
c->lui(v1, 16256); // lui v1, 16256
c->mtc1(f0, v1); // mtc1 f0, v1
c->mfc1(v1, f0); // mfc1 v1, f0
c->mov128_vf_gpr(vf9, v1); // qmtc2.i vf9, v1
c->mov128_gpr_vf(v1, vf9); // qmfc2.i v1, vf9
u16 vi1 = 0; // viaddi vi1, vi0, 0
c->addiu(v1, r0, 128); // addiu v1, r0, 128
c->vmove(DEST::xyzw, vf5, vf6); // vmove.xyzw vf5, vf6
block_1:
c->vmul(DEST::xyzw, vf1, vf5, vf5); // vmul.xyzw vf1, vf5, vf5
c->vadda_bc(DEST::xyzw, BC::w, vf0, vf0); // vaddaw.xyzw acc, vf0, vf0
c->vadd(DEST::x, vf5, vf5, vf6); // vadd.x vf5, vf5, vf6
c->vsub_bc(DEST::y, BC::x, vf9, vf0, vf9); // vsubx.y vf9, vf0, vf9
c->vmul(DEST::xyzw, vf2, vf1, vf1); // vmul.xyzw vf2, vf1, vf1
c->vmadda_bc(DEST::xyzw, BC::x, vf1, vf7); // vmaddax.xyzw acc, vf1, vf7
c->vmul(DEST::xyzw, vf3, vf2, vf1); // vmul.xyzw vf3, vf2, vf1
c->vmadda_bc(DEST::xyzw, BC::y, vf2, vf7); // vmadday.xyzw acc, vf2, vf7
c->vmul(DEST::xyzw, vf4, vf2, vf2); // vmul.xyzw vf4, vf2, vf2
c->vmadda_bc(DEST::xyzw, BC::z, vf3, vf7); // vmaddaz.xyzw acc, vf3, vf7
c->daddiu(v1, v1, -1); // daddiu v1, v1, -1
c->vmadd_bc(DEST::xyzw, BC::w, vf8, vf4, vf7); // vmaddw.xyzw vf8, vf4, vf7
c->vadd_bc(DEST::y, BC::x, vf9, vf9, vf8); // vaddx.y vf9, vf9, vf8
c->vsub(DEST::xyzw, vf10, vf0, vf9); // vsub.xyzw vf10, vf0, vf9
gRippleVu0.sq(c->vfs[vf9].vf, vi1++); // vsqi.xyzw vf9, vi1
c->vmove(DEST::xyzw, vf9, vf8); // vmove.xyzw vf9, vf8
bc = c->sgpr64(v1) != 0; // bne v1, r0, L40
gRippleVu0.sq(c->vfs[vf10].vf, vi2++); // vsqi.xyzw vf10, vi2
if (bc) {goto block_1;} // branch non-likely
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//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.cos_poly_vec = intern_from_c(-1, 0, "*cos-poly-vec*").c();
gLinkedFunctionTable.reg("ripple-execute-init", execute, 32);
}
} // namespace ripple_execute_init
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace ripple_create_wave_table {
struct Cache {
void* display; // *display*
void* fake_scratchpad_data; // *fake-scratchpad-data*
void* setting_control; // *setting-control*
void* atan; // atan
void* cos; // cos
void* ntsc; // ntsc
void* pal; // pal
void* ripple_update_waveform_offs; // ripple-update-waveform-offs
void* sin; // sin
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u16 vi1, vi2;
u32 call_addr = 0;
c->daddiu(sp, sp, -80); // daddiu sp, sp, -80
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s4, 16, sp); // sq s4, 16(sp)
c->sq(s5, 32, sp); // sq s5, 32(sp)
c->sq(gp, 48, sp); // sq gp, 48(sp)
c->swc1(f28, 64, sp); // swc1 f28, 64(sp)
c->swc1(f30, 68, sp); // swc1 f30, 68(sp)
c->mov64(gp, a0); // or gp, a0, r0
c->lwu(v1, 4, gp); // lwu v1, 4(gp)
bc = c->sgpr64(s7) != c->sgpr64(v1); // bne s7, v1, L31
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_9;} // branch non-likely
c->addiu(s5, r0, 0); // addiu s5, r0, 0
//beq r0, r0, L30 // beq r0, r0, L30
// nop // sll r0, r0, 0
goto block_7; // branch always
block_2:
c->addiu(v1, r0, 28); // addiu v1, r0, 28
c->mult3(v1, v1, s5); // mult3 v1, v1, s5
c->daddiu(v1, v1, 12); // daddiu v1, v1, 12
c->daddu(s4, v1, gp); // daddu s4, v1, gp
c->load_symbol2(t9, cache.atan); // lw t9, atan(s7)
c->lh(v1, 10, s4); // lh v1, 10(s4)
c->mtc1(f0, v1); // mtc1 f0, v1
c->cvtsw(f0, f0); // cvt.s.w f0, f0
c->mfc1(a0, f0); // mfc1 a0, f0
c->lh(v1, 8, s4); // lh v1, 8(s4)
c->mtc1(f0, v1); // mtc1 f0, v1
c->cvtsw(f0, f0); // cvt.s.w f0, f0
c->mfc1(a1, f0); // mfc1 a1, f0
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mtc1(f28, v0); // mtc1 f28, v0
c->lui(v1, 16768); // lui v1, 16768
c->mtc1(f0, v1); // mtc1 f0, v1
c->lh(v1, 8, s4); // lh v1, 8(s4)
c->lh(a0, 8, s4); // lh a0, 8(s4)
c->mult3(v1, v1, a0); // mult3 v1, v1, a0
c->lh(a0, 10, s4); // lh a0, 10(s4)
c->lh(a1, 10, s4); // lh a1, 10(s4)
c->mult3(a0, a0, a1); // mult3 a0, a0, a1
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->mtc1(f1, v1); // mtc1 f1, v1
c->cvtsw(f1, f1); // cvt.s.w f1, f1
c->sqrts(f1, f1); // sqrt.s f1, f1
c->divs(f30, f0, f1); // div.s f30, f0, f1
c->load_symbol2(t9, cache.cos); // lw t9, cos(s7)
c->mfc1(a0, f28); // mfc1 a0, f28
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mtc1(f0, v0); // mtc1 f0, v0
c->lui(v1, 18304); // lui v1, 18304
c->mtc1(f1, v1); // mtc1 f1, v1
c->divs(f1, f1, f30); // div.s f1, f1, f30
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 16, s4); // swc1 f0, 16(s4)
c->load_symbol2(t9, cache.sin); // lw t9, sin(s7)
c->mfc1(a0, f28); // mfc1 a0, f28
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mtc1(f0, v0); // mtc1 f0, v0
c->lui(v1, 18304); // lui v1, 18304
c->mtc1(f1, v1); // mtc1 f1, v1
c->divs(f1, f1, f30); // div.s f1, f1, f30
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 20, s4); // swc1 f0, 20(s4)
c->load_symbol2(v1, cache.setting_control); // lw v1, *setting-control*(s7)
c->lwu(v1, 64, v1); // lwu v1, 64(v1)
c->load_symbol_addr(a0, cache.ntsc); // daddiu a0, s7, ntsc
bc = c->sgpr64(v1) != c->sgpr64(a0); // bne v1, a0, L28
c->mov64(a0, s7); // or a0, s7, r0
if (bc) {goto block_4;} // branch non-likely
c->lui(v1, 15496); // lui v1, 15496
c->ori(v1, v1, 34953); // ori v1, v1, 34953
c->mtc1(f0, v1); // mtc1 f0, v1
c->lui(v1, -14464); // lui v1, -14464
c->mtc1(f1, v1); // mtc1 f1, v1
c->divs(f1, f1, f30); // div.s f1, f1, f30
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->lwc1(f1, 12, s4); // lwc1 f1, 12(s4)
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 24, s4); // swc1 f0, 24(s4)
c->mfc1(v1, f0); // mfc1 v1, f0
//beq r0, r0, L29 // beq r0, r0, L29
// nop // sll r0, r0, 0
goto block_6; // branch always
block_4:
c->load_symbol_addr(a0, cache.pal); // daddiu a0, s7, pal
bc = c->sgpr64(v1) != c->sgpr64(a0); // bne v1, a0, L29
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_6;} // branch non-likely
c->lui(v1, 15523); // lui v1, 15523
c->ori(v1, v1, 55050); // ori v1, v1, 55050
c->mtc1(f0, v1); // mtc1 f0, v1
c->lui(v1, -14464); // lui v1, -14464
c->mtc1(f1, v1); // mtc1 f1, v1
c->divs(f1, f1, f30); // div.s f1, f1, f30
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->lwc1(f1, 12, s4); // lwc1 f1, 12(s4)
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 24, s4); // swc1 f0, 24(s4)
c->mfc1(v1, f0); // mfc1 v1, f0
block_6:
c->daddiu(s5, s5, 1); // daddiu s5, s5, 1
block_7:
c->lw(v1, 0, gp); // lw v1, 0(gp)
c->slt(v1, s5, v1); // slt v1, s5, v1
bc = c->sgpr64(v1) != 0; // bne v1, r0, L27
// nop // sll r0, r0, 0
if (bc) {goto block_2;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->daddiu(v1, s7, 4); // daddiu v1, s7, #t
c->sw(v1, 4, gp); // sw v1, 4(gp)
block_9:
c->load_symbol2(t9, cache.ripple_update_waveform_offs);// lw t9, ripple-update-waveform-offs(s7)
c->mov64(a0, gp); // or a0, gp, r0
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lwu(a1, 72, v1); // lwu a1, 72(v1)
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672
c->addiu(a0, r0, 64); // addiu a0, r0, 64
c->mov64(a1, v1); // or a1, v1, r0
block_10:
c->daddiu(a0, a0, -1); // daddiu a0, a0, -1
c->sq(r0, 0, a1); // sq r0, 0(a1)
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
bc = c->sgpr64(a0) != 0; // bne a0, r0, L32
c->daddiu(a1, a1, 16); // daddiu a1, a1, 16
if (bc) {goto block_10;} // branch non-likely
c->addiu(a0, r0, 0); // addiu a0, r0, 0
//beq r0, r0, L36 // beq r0, r0, L36
// nop // sll r0, r0, 0
goto block_17; // branch always
block_12:
c->addiu(a1, r0, 28); // addiu a1, r0, 28
c->mult3(a1, a1, a0); // mult3 a1, a1, a0
c->daddiu(a1, a1, 12); // daddiu a1, a1, 12
c->daddu(a1, a1, gp); // daddu a1, a1, gp
c->lui(a2, 18048); // lui a2, 18048
c->mtc1(f0, a2); // mtc1 f0, a2
c->lui(a2, 15232); // lui a2, 15232
c->mtc1(f1, a2); // mtc1 f1, a2
c->lwc1(f2, 4, a1); // lwc1 f2, 4(a1)
c->muls(f1, f1, f2); // mul.s f1, f1, f2
c->adds(f0, f0, f1); // add.s f0, f0, f1
c->lui(a2, 15232); // lui a2, 15232
c->mtc1(f1, a2); // mtc1 f1, a2
c->lwc1(f2, 16, a1); // lwc1 f2, 16(a1)
c->muls(f1, f1, f2); // mul.s f1, f1, f2
c->lui(a2, 15232); // lui a2, 15232
c->mtc1(f2, a2); // mtc1 f2, a2
c->lwc1(f3, 20, a1); // lwc1 f3, 20(a1)
c->muls(f2, f2, f3); // mul.s f2, f2, f3
c->lwc1(f3, 0, a1); // lwc1 f3, 0(a1)
c->addiu(a1, r0, 255); // addiu a1, r0, 255
c->mfc1(a2, f0); // mfc1 a2, f0
c->mov128_vf_gpr(vf1, a2); // qmtc2.i vf1, a2
c->mfc1(a2, f1); // mfc1 a2, f1
c->mov128_vf_gpr(vf2, a2); // qmtc2.i vf2, a2
c->mfc1(a2, f2); // mfc1 a2, f2
c->mov128_vf_gpr(vf3, a2); // qmtc2.i vf3, a2
c->mfc1(a2, f3); // mfc1 a2, f3
c->mov128_vf_gpr(vf4, a2); // qmtc2.i vf4, a2
vi1 = c->gpr_src(a1).du16[0]; // ctc2.i vi1, a1
c->mov64(a1, v1); // or a1, v1, r0
c->addiu(a2, r0, 16); // addiu a2, r0, 16
c->vmove(DEST::xyzw, vf6, vf0); // vmove.xyzw vf6, vf0
block_13:
c->addiu(a3, r0, 16); // addiu a3, r0, 16
c->vmove(DEST::xyzw, vf5, vf0); // vmove.xyzw vf5, vf0
block_14:
c->lw(at, 0, a1); // lw at, 0(a1)
c->vadda_bc(DEST::xyzw, BC::x, vf1, vf0); // vaddax.xyzw acc, vf1, vf0
c->vmadda(DEST::xyzw, vf2, vf5); // vmadda.xyzw acc, vf2, vf5
c->vmadd(DEST::xyzw, vf7, vf3, vf6); // vmadd.xyzw vf7, vf3, vf6
c->mov128_vf_gpr(vf10, at); // qmtc2.i vf10, at
c->vadd_bc(DEST::xyzw, BC::w, vf5, vf5, vf0); // vaddw.xyzw vf5, vf5, vf0
c->vftoi0(DEST::xyzw, vf8, vf7); // vftoi0.xyzw vf8, vf7
vi2 = c->vfs[vf8].vf.x_as_u16(); // vmtirx vi2, vf8
c->vitof0(DEST::xyzw, vf8, vf8); // vitof0.xyzw vf8, vf8
vi2 &= vi1; // viand vi2, vi2, vi1
c->vfs[vf9].vf = gRippleVu0.lq(vi2++); // vlqi.xyzw vf9, vi2
c->vsub(DEST::xyzw, vf7, vf7, vf8); // vsub.xyzw vf7, vf7, vf8
c->vadda_bc(DEST::xyzw, BC::x, vf0, vf9); // vaddax.xyzw acc, vf0, vf9
c->vmadd_bc(DEST::xyzw, BC::y, vf9, vf7, vf9); // vmaddy.xyzw vf9, vf7, vf9
c->vadda_bc(DEST::xyzw, BC::x, vf10, vf0); // vaddax.xyzw acc, vf10, vf0
c->vmadd(DEST::xyzw, vf10, vf9, vf4); // vmadd.xyzw vf10, vf9, vf4
c->mov128_gpr_vf(at, vf10); // qmfc2.i at, vf10
c->sw(at, 0, a1); // sw at, 0(a1)
c->daddiu(a3, a3, -1); // daddiu a3, a3, -1
bc = c->sgpr64(a3) != 0; // bne a3, r0, L35
c->daddiu(a1, a1, 4); // daddiu a1, a1, 4
if (bc) {goto block_14;} // branch non-likely
c->daddiu(a2, a2, -1); // daddiu a2, a2, -1
bc = c->sgpr64(a2) != 0; // bne a2, r0, L34
c->vadd_bc(DEST::xyzw, BC::w, vf6, vf6, vf0); // vaddw.xyzw vf6, vf6, vf0
if (bc) {goto block_13;} // branch non-likely
c->mov128_gpr_vf(a1, vf6); // qmfc2.i a1, vf6
c->daddiu(a0, a0, 1); // daddiu a0, a0, 1
block_17:
c->lw(a1, 0, gp); // lw a1, 0(gp)
c->slt(a1, a0, a1); // slt a1, a0, a1
bc = c->sgpr64(a1) != 0; // bne a1, r0, L33
// nop // sll r0, r0, 0
if (bc) {goto block_12;} // branch non-likely
c->mov64(a0, s7); // or a0, s7, r0
c->mov64(a0, s7); // or a0, s7, r0
c->lui(a0, 17152); // lui a0, 17152
c->mtc1(f0, a0); // mtc1 f0, a0
c->lui(a0, 17279); // lui a0, 17279
c->mtc1(f1, a0); // mtc1 f1, a0
c->lwc1(f2, 8, gp); // lwc1 f2, 8(gp)
c->mfc1(a0, f2); // mfc1 a0, f2
c->mov128_vf_gpr(vf16, a0); // qmtc2.i vf16, a0
c->mfc1(a0, f0); // mfc1 a0, f0
c->mov128_vf_gpr(vf14, a0); // qmtc2.i vf14, a0
c->mfc1(a0, f1); // mfc1 a0, f1
c->mov128_vf_gpr(vf15, a0); // qmtc2.i vf15, a0
c->vmax_bc(DEST::xyzw, BC::x, vf16, vf0, vf16); // vmaxx.xyzw vf16, vf0, vf16
c->vmini_bc(DEST::w, BC::x, vf16, vf0, vf0); // vminix.w vf16, vf0, vf0
c->mov64(v1, v1); // or v1, v1, r0
c->addiu(v0, r0, 15); // addiu v0, r0, 15
block_19:
c->addiu(a0, r0, 15); // addiu a0, r0, 15
block_20:
c->addiu(a2, r0, 4); // addiu a2, r0, 4
c->addiu(at, r0, -60); // addiu at, r0, -60
c->movz(a2, at, a0); // movz a2, at, a0
c->addiu(a1, r0, 64); // addiu a1, r0, 64
c->addiu(at, r0, -960); // addiu at, r0, -960
c->daddu(a2, a2, v1); // daddu a2, a2, v1
c->movz(a1, at, v0); // movz a1, at, v0
c->lw(at, 0, v1); // lw at, 0(v1)
c->lw(a2, 0, a2); // lw a2, 0(a2)
c->daddu(a1, a1, v1); // daddu a1, a1, v1
c->lw(a1, 0, a1); // lw a1, 0(a1)
c->mov128_vf_gpr(vf11, at); // qmtc2.i vf11, at
c->mov128_vf_gpr(vf12, a2); // qmtc2.i vf12, a2
c->mov128_vf_gpr(vf13, a1); // qmtc2.i vf13, a1
c->vadd_bc(DEST::xyzw, BC::x, vf11, vf0, vf11); // vaddx.xyzw vf11, vf0, vf11
c->vsub_bc(DEST::y, BC::x, vf11, vf11, vf12); // vsubx.y vf11, vf11, vf12
c->vsub_bc(DEST::z, BC::x, vf11, vf11, vf13); // vsubx.z vf11, vf11, vf13
c->vmul(DEST::yzw, vf11, vf11, vf16); // vmul.yzw vf11, vf11, vf16
c->vadd_bc(DEST::xyzw, BC::x, vf11, vf11, vf14); // vaddx.xyzw vf11, vf11, vf14
c->vmax_bc(DEST::xyzw, BC::x, vf11, vf11, vf0); // vmaxx.xyzw vf11, vf11, vf0
c->vmini_bc(DEST::xyzw, BC::x, vf11, vf11, vf15); // vminix.xyzw vf11, vf11, vf15
c->vftoi0(DEST::xyzw, vf11, vf11); // vftoi0.xyzw vf11, vf11
c->mov128_gpr_vf(at, vf11); // qmfc2.i at, vf11
c->ppach(at, at, at); // ppach at, at, at
c->ppacb(at, at, at); // ppacb at, at, at
c->sw(at, 1024, v1); // sw at, 1024(v1)
c->daddiu(v1, v1, 4); // daddiu v1, v1, 4
bc = c->sgpr64(a0) != 0; // bne a0, r0, L38
c->daddiu(a0, a0, -1); // daddiu a0, a0, -1
if (bc) {goto block_20;} // branch non-likely
bc = c->sgpr64(v0) != 0; // bne v0, r0, L37
c->daddiu(v0, v0, -1); // daddiu v0, v0, -1
if (bc) {goto block_19;} // branch non-likely
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lwc1(f30, 68, sp); // lwc1 f30, 68(sp)
c->lwc1(f28, 64, sp); // lwc1 f28, 64(sp)
c->lq(gp, 48, sp); // lq gp, 48(sp)
c->lq(s5, 32, sp); // lq s5, 32(sp)
c->lq(s4, 16, sp); // lq s4, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 80); // daddiu sp, sp, 80
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.display = intern_from_c(-1, 0, "*display*").c();
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
cache.setting_control = intern_from_c(-1, 0, "*setting-control*").c();
cache.atan = intern_from_c(-1, 0, "atan").c();
cache.cos = intern_from_c(-1, 0, "cos").c();
cache.ntsc = intern_from_c(-1, 0, "ntsc").c();
cache.pal = intern_from_c(-1, 0, "pal").c();
cache.ripple_update_waveform_offs = intern_from_c(-1, 0, "ripple-update-waveform-offs").c();
cache.sin = intern_from_c(-1, 0, "sin").c();
gLinkedFunctionTable.reg("ripple-create-wave-table", execute, 128);
}
} // namespace ripple_create_wave_table
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace ripple_apply_wave_table {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672
c->daddiu(v1, v1, 1024); // daddiu v1, v1, 1024
c->lwu(a1, 4, a0); // lwu a1, 4(a0)
c->lwu(t2, 0, a0); // lwu t2, 0(a0)
c->lwu(a2, 8, a0); // lwu a2, 8(a0)
c->lwu(a3, 12, a0); // lwu a3, 12(a0)
c->lhu(a0, 18, a0); // lhu a0, 18(a0)
c->addiu(t0, r0, 0); // addiu t0, r0, 0
//beq r0, r0, L25 // beq r0, r0, L25
// nop // sll r0, r0, 0
goto block_4; // branch always
block_1:
c->lbu(t1, 0, a3); // lbu t1, 0(a3)
c->lbu(t3, 0, a1); // lbu t3, 0(a1)
c->daddiu(t3, t3, 3); // daddiu t3, t3, 3
c->dsrl(t3, t3, 2); // dsrl t3, t3, 2
c->dsll(t3, t3, 4); // dsll t3, t3, 4
c->daddu(t2, t2, t3); // daddu t2, t2, t3
c->mov64(t4, t2); // or t4, t2, r0
c->mov64(t3, t1); // or t3, t1, r0
c->mov64(t5, t4); // or t5, t4, r0
c->mov64(t4, a2); // or t4, a2, r0
block_2:
c->lb(t6, 0, t4); // lb t6, 0(t4)
c->lb(t7, 1, t4); // lb t7, 1(t4)
c->andi(t6, t6, 15); // andi t6, t6, 15
c->andi(t7, t7, 15); // andi t7, t7, 15
c->sll(t7, t7, 4); // sll t7, t7, 4
c->daddu(t6, t6, t7); // daddu t6, t6, t7
c->sll(t6, t6, 2); // sll t6, t6, 2
c->daddu(t8, t6, v1); // daddu t8, t6, v1
c->lb(t6, 0, t8); // lb t6, 0(t8)
c->lb(t7, 1, t8); // lb t7, 1(t8)
c->lb(t8, 2, t8); // lb t8, 2(t8)
c->sb(t6, 7, t5); // sb t6, 7(t5)
c->sb(t7, 2, t5); // sb t7, 2(t5)
c->sb(t8, 10, t5); // sb t8, 10(t5)
c->daddiu(t3, t3, -1); // daddiu t3, t3, -1
c->daddiu(t4, t4, 2); // daddiu t4, t4, 2
bc = c->sgpr64(t3) != 0; // bne t3, r0, L24
c->daddiu(t5, t5, 12); // daddiu t5, t5, 12
if (bc) {goto block_2;} // branch non-likely
c->lbu(t3, 2, a1); // lbu t3, 2(a1)
c->lbu(t4, 1, a1); // lbu t4, 1(a1)
c->daddiu(t4, t4, 3); // daddiu t4, t4, 3
c->dsrl(t4, t4, 2); // dsrl t4, t4, 2
c->daddu(t3, t3, t4); // daddu t3, t3, t4
c->dsll(t3, t3, 4); // dsll t3, t3, 4
c->daddu(t2, t2, t3); // daddu t2, t2, t3
c->lbu(t3, 3, a1); // lbu t3, 3(a1)
c->dsll(t3, t3, 1); // dsll t3, t3, 1
c->daddiu(t3, t3, 4); // daddiu t3, t3, 4
c->daddu(a1, a1, t3); // daddu a1, a1, t3
c->dsll(t1, t1, 1); // dsll t1, t1, 1
c->daddiu(t1, t1, 15); // daddiu t1, t1, 15
c->andi(t1, t1, 65520); // andi t1, t1, 65520
c->daddu(a2, a2, t1); // daddu a2, a2, t1
c->daddiu(a3, a3, 2); // daddiu a3, a3, 2
c->mov64(t1, a3); // or t1, a3, r0
c->daddiu(t0, t0, 1); // daddiu t0, t0, 1
block_4:
c->slt(t1, t0, a0); // slt t1, t0, a0
bc = c->sgpr64(t1) != 0; // bne t1, r0, L23
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v0, s7); // or v0, s7, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("ripple-apply-wave-table", execute, 128);
}
} // namespace ripple_apply_wave_table
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace ripple_matrix_scale {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->lhu(v1, 2, a0); // lhu v1, 2(a0)
c->lw(a1, 4, a0); // lw a1, 4(a0)
c->lw(a2, 28, a0); // lw a2, 28(a0)
c->lqc2(vf1, 16, a0); // lqc2 vf1, 16(a0)
block_1:
c->lqc2(vf5, 16, a1); // lqc2 vf5, 16(a1)
c->lqc2(vf6, 48, a1); // lqc2 vf6, 48(a1)
c->lqc2(vf7, 64, a1); // lqc2 vf7, 64(a1)
c->lqc2(vf8, 96, a1); // lqc2 vf8, 96(a1)
c->vmul_bc(DEST::xyzw, BC::x, vf4, vf5, vf1); // vmulx.xyzw vf4, vf5, vf1
c->vmul_bc(DEST::xyzw, BC::y, vf5, vf5, vf1); // vmuly.xyzw vf5, vf5, vf1
c->lq(a3, 0, a1); // lq a3, 0(a1)
c->vmul_bc(DEST::xyzw, BC::z, vf7, vf7, vf1); // vmulz.xyzw vf7, vf7, vf1
c->lq(a0, 32, a1); // lq a0, 32(a1)
c->vmul_bc(DEST::xyzw, BC::z, vf8, vf8, vf1); // vmulz.xyzw vf8, vf8, vf1
c->sq(a3, 0, a2); // sq a3, 0(a2)
c->lq(a3, 80, a1); // lq a3, 80(a1)
c->vsub(DEST::xyzw, vf6, vf6, vf4); // vsub.xyzw vf6, vf6, vf4
c->sq(a0, 32, a2); // sq a0, 32(a2)
c->sqc2(vf5, 16, a2); // sqc2 vf5, 16(a2)
c->sq(a3, 80, a2); // sq a3, 80(a2)
c->daddiu(v1, v1, -1); // daddiu v1, v1, -1
c->sqc2(vf7, 64, a2); // sqc2 vf7, 64(a2)
c->addiu(a1, a1, 128); // addiu a1, a1, 128
c->sqc2(vf6, 48, a2); // sqc2 vf6, 48(a2)
c->addiu(a2, a2, 128); // addiu a2, a2, 128
bc = c->sgpr64(v1) != 0; // bne v1, r0, L13
c->sqc2(vf8, -32, a2); // sqc2 vf8, -32(a2)
if (bc) {goto block_1;} // branch non-likely
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//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() {
gLinkedFunctionTable.reg("ripple-matrix-scale", execute, 128);
}
} // namespace ripple_matrix_scale
} // namespace Mips2C

View File

@ -347,6 +347,24 @@ namespace blerc_execute { extern void link(); }
namespace setup_blerc_chains_for_one_fragment { extern void link(); }
namespace sparticle_motion_blur_dirt { extern void link(); }
namespace foreground_draw_hud { extern void link(); }
namespace ripple_matrix_scale { extern void link(); }
namespace ripple_apply_wave_table { extern void link(); }
namespace ripple_create_wave_table { extern void link(); }
namespace ripple_execute_init { extern void link(); }
namespace method_14_ocean { extern void link(); }
namespace method_15_ocean { extern void link(); }
namespace method_16_ocean { extern void link(); }
namespace init_ocean_far_regs { extern void link(); }
namespace draw_large_polygon_ocean { extern void link(); }
namespace render_ocean_quad { extern void link(); }
namespace generic_merc_do_chain { extern void link(); }
namespace generic_merc_execute_asm { extern void link(); }
namespace generic_merc_death { extern void link(); }
namespace generic_merc_query { extern void link(); }
namespace generic_translucent { extern void link(); }
namespace high_speed_reject { extern void link(); }
namespace mercneric_convert { extern void link(); }
namespace generic_merc_init_asm { extern void link(); }
}
// clang-format on
@ -583,6 +601,19 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
{"merc-blend-shape",
{jak3::blerc_execute::link, jak3::setup_blerc_chains_for_one_fragment::link}},
{"wvehicle-part", {jak3::sparticle_motion_blur_dirt::link}},
{"ripple",
{jak3::ripple_matrix_scale::link, jak3::ripple_apply_wave_table::link,
jak3::ripple_create_wave_table::link, jak3::ripple_execute_init::link}},
{"ocean-vu0",
{jak3::method_14_ocean::link, jak3::method_15_ocean::link, jak3::method_16_ocean::link}},
{"ocean",
{jak3::init_ocean_far_regs::link, jak3::draw_large_polygon_ocean::link,
jak3::render_ocean_quad::link}},
{"generic-merc",
{jak3::generic_merc_do_chain::link, jak3::generic_merc_execute_asm::link,
jak3::generic_merc_death::link, jak3::generic_merc_query::link,
jak3::generic_translucent::link, jak3::high_speed_reject::link,
jak3::mercneric_convert::link, jak3::generic_merc_init_asm::link}},
}};
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {

View File

@ -393,6 +393,9 @@
(define-extern pc-set-gfx-hack (function pc-gfx-hack symbol none))
(define-extern pc-get-unix-timestamp (function int))
(define-extern pc-filter-debug-string? (function string float symbol))
(define-extern pc-screen-shot (function none))
(declare-type screen-shot-settings structure)
(define-extern pc-register-screen-shot-settings (function screen-shot-settings none))
(defenum pc-prof-event
(begin 0)
@ -407,7 +410,6 @@
)
(defconstant *user* (get-user))
(define-extern pc-filter-debug-string? (function string float symbol))
(define-extern pc-rand (function int))
;; Constants generated within the C++ runtime

View File

@ -254,11 +254,6 @@
)
)
(defun bcd->dec ((bcd uint))
"Convert a number encoded in BCD to its decimal equivalent"
(+ (* (shr (logand bcd #xf0) 4) 10) (logand bcd #x0f))
)
(defun real-movie? ()
"are we in an actual cutscene and should letterbox the view?"
(and (nonzero? movie?) (movie?)))

View File

@ -470,6 +470,11 @@
`(symbol-member? (-> *pc-settings* display-mode) '(fullscreen borderless)))
(defun bcd->dec ((bcd uint))
"Convert a number encoded in BCD to its decimal equivalent"
(+ (* (shr (logand bcd #xf0) 4) 10) (logand bcd #x0f)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; cheats
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -337,6 +337,7 @@
"prototype.o"
"main-collide.o"
"video.o"
"capture-pc.o" ;; added
"pckernel-common.o" ;; added
"pckernel.o" ;; added
"subtitle2-h.o" ;; added

View File

@ -1770,18 +1770,17 @@
(tick! (-> arg0 bg-clock))
(set! (-> arg0 bg-clock frame-counter) (the-as time-frame (mod (-> arg0 bg-clock frame-counter) #x69780)))
(tick! (-> arg0 part-clock))
;; og:preserve-this screenshot stuff
; (when (and (nonzero? *screen-shot-work*) (!= (-> *screen-shot-work* count) -1))
; (let ((v1-43 (-> *screen-shot-work* size)))
; (if (!= (-> *screen-shot-work* count) (* v1-43 v1-43))
; (store-image *screen-shot-work*)
; )
; )
; (+! (-> *screen-shot-work* count) -1)
; (if (= (-> *screen-shot-work* count) -1)
; (set! (-> *screen-shot-work* size) -1)
; )
; )
(when (and (nonzero? *screen-shot-work*) (!= (-> *screen-shot-work* count) -1))
(let ((v1-43 (-> *screen-shot-work* size)))
(if (!= (-> *screen-shot-work* count) (* v1-43 v1-43))
(store-image *screen-shot-work*)
)
)
(+! (-> *screen-shot-work* count) -1)
(if (= (-> *screen-shot-work* count) -1)
(set! (-> *screen-shot-work* size) -1)
)
)
(let ((s5-1 (-> arg0 frames arg1)))
(if *sync-dma*
@ -2038,12 +2037,12 @@
;; screenshot/pause stuff.
(determine-pause-mode)
; (when (and (nonzero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1) (!= (-> *screen-shot-work* size) -1))
; (let ((v1-77 (-> *screen-shot-work* size)))
; (set! (-> *screen-shot-work* count) (* v1-77 v1-77))
; )
; (set-master-mode 'pause)
; )
(when (and (nonzero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1) (!= (-> *screen-shot-work* size) -1))
(let ((v1-77 (-> *screen-shot-work* size)))
(set! (-> *screen-shot-work* count) (* v1-77 v1-77))
)
(set-master-mode 'pause)
)
;; prepare engine for the next frame
(display-frame-start arg0 frame-to-render next-dog)

View File

@ -2270,14 +2270,14 @@
(not (logtest? (-> sv-48 perm status) (entity-perm-status bit-9 bit-10)))
(not (logtest? (-> sv-48 kill-mask) sv-32))
(or (-> s4-1 vis-info 0) (< (vector-vector-distance (-> sv-48 trans) sv-16) (-> sv-48 vis-dist)))
;; og:preserve-this PC port note: added this extra check to fix level types being used after deloaded because of bad entity placement
(#if PC_PORT
(or (not (type-type? (-> sv-48 entity type) entity-actor)) (and (valid? (-> (the-as entity-actor (-> sv-48 entity)) etype) type "entity-type-check etype" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol) symbol "entity-type-check symbol" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value) type "entity-type-check value" #f *stdcon*)
(= (-> (the-as entity-actor (-> sv-48 entity)) etype) (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value))
))
#f)
;; og:preserve-this PC port note: added this extra check to fix level types being used after deloaded because of bad entity placement
(#if PC_PORT
(or (not (type-type? (-> sv-48 entity type) entity-actor)) (and (valid? (-> (the-as entity-actor (-> sv-48 entity)) etype) type "entity-type-check etype" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol) symbol "entity-type-check symbol" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value) type "entity-type-check value" #f *stdcon*)
(= (-> (the-as entity-actor (-> sv-48 entity)) etype) (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value))
))
#f)
)
(when (not (or (-> sv-48 process) (logtest? (-> sv-48 perm status) (entity-perm-status bit-0 dead)) s0-0))
(birth! (-> sv-48 entity))

View File

@ -944,11 +944,6 @@
(if (< (-> *game-info* letterbox-time) (-> *display* base-clock frame-counter))
(set! (-> *game-info* letterbox-time) (-> *display* base-clock frame-counter))
)
(if (and (= (-> *setting-control* user-current aspect-ratio) 'aspect4x3)
(or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1))
)
(letterbox)
)
(if (#if (not PC_PORT)
(and (= (-> *setting-control* user-current aspect-ratio) 'aspect4x3)
(or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1))
@ -1121,7 +1116,7 @@
)
(#when PC_PORT
(update *pc-settings*)
(if (and *display-sha* *debug-segment*)
(if (and *display-sha* *debug-segment* (not-screen-shot?))
(draw-build-revision)))
)
)

View File

@ -776,7 +776,8 @@ the sprite renderer draw 2D or 3D sprites
)
;; run the distorters
(when (or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1))
;; og:preserve-this the distorters messed with the framebuffer on PS2 when taking screenshots, but it's OK for us
(when #t ;; (not-screenshot?)
(sprite-init-distorter dma-buff)
(sprite-draw-distorters dma-buff)
)

View File

@ -1870,7 +1870,6 @@ into 7 sections, which might explain the weird sizes in the center.
)
(gp-1 (-> this heap))
)
(start-debug "about to allocate level heap with size #x~X (~f MB)~%" s5-1 (/ (the float s5-1) 1024.))
(set! (-> gp-1 base) (kmalloc global s5-1 (kmalloc-flags) "heap"))
(set! (-> gp-1 current) (-> gp-1 base))
(set! (-> gp-1 top-base) (&+ (-> gp-1 base) s5-1))

View File

@ -7,15 +7,15 @@
;; DECOMP BEGINS
(defmethod check-ready-and-maybe-show hud ((obj hud) (arg0 symbol))
(defmethod check-ready-and-maybe-show ((this hud) (arg0 symbol))
"Is this element ready to be shown? If arg0 is set, show it now."
(case (get-status *gui-control* (-> obj gui-id))
(case (get-status *gui-control* (-> this gui-id))
(((gui-status ready) (gui-status active))
(if arg0
(set-action!
*gui-control*
(gui-action play)
(-> obj gui-id)
(-> this gui-id)
(gui-channel none)
(gui-action none)
(the-as string #f)
@ -32,21 +32,18 @@
)
(deftype hud-sprite-work (structure)
((adgif-tmpl dma-gif-packet :inline :offset-assert 0)
(sprite-tmpl dma-gif-packet :inline :offset-assert 32)
(draw-tmpl dma-gif-packet :inline :offset-assert 64)
(box-tmpl dma-gif-packet :inline :offset-assert 96)
(box2-tmpl dma-gif-packet :inline :offset-assert 128)
(mask-tmpl dma-gif-packet :inline :offset-assert 160)
(line-tmpl dma-gif-packet :inline :offset-assert 192)
(scan-tmpl dma-gif-packet :inline :offset-assert 224)
(line-color gs-rgbaq :offset-assert 256)
(scan-colors vector4w 32 :inline :offset 272)
(scanline uint32 :offset 784)
((adgif-tmpl dma-gif-packet :inline)
(sprite-tmpl dma-gif-packet :inline)
(draw-tmpl dma-gif-packet :inline)
(box-tmpl dma-gif-packet :inline)
(box2-tmpl dma-gif-packet :inline)
(mask-tmpl dma-gif-packet :inline)
(line-tmpl dma-gif-packet :inline)
(scan-tmpl dma-gif-packet :inline)
(line-color gs-rgbaq)
(scan-colors vector4w 32 :inline :offset 272)
(scanline uint32 :offset 784)
)
:method-count-assert 9
:size-assert #x314
:flag-assert #x900000314
)
@ -245,7 +242,7 @@
)
)
(defmethod draw-scan-and-line hud-box ((obj hud-box) (arg0 dma-buffer) (arg1 float))
(defmethod draw-scan-and-line ((this hud-box) (arg0 dma-buffer) (arg1 float))
(let ((v1-0 *hud-sprite-work*)
(f0-0 (-> *video-params* relative-x-scale))
)
@ -255,10 +252,10 @@
(set! (-> v1-0 scan-colors a3-5 w) a2-1)
)
)
(let* ((a2-8 (* (+ (the int (* (+ -256.0 (-> obj min x)) f0-0)) 256 1792) 16))
(a3-10 (* (+ (the int (* (+ -256.0 (-> obj max x)) f0-0)) 256 1792) 16))
(t0-9 (* (+ (the int (-> obj min y)) 1840) 16))
(t2-0 (the int (- (-> obj max y) (-> obj min y))))
(let* ((a2-8 (* (+ (the int (* (+ -256.0 (-> this min x)) f0-0)) 256 1792) 16))
(a3-10 (* (+ (the int (* (+ -256.0 (-> this max x)) f0-0)) 256 1792) 16))
(t0-9 (* (+ (the int (-> this min y)) 1840) 16))
(t2-0 (the int (- (-> this max y) (-> this min y))))
(t1-0 (/ t2-0 4))
)
(dma-buffer-add-gs-set arg0
@ -271,7 +268,7 @@
(set! (-> t3-6 1) (-> v1-0 scan-tmpl quad 1))
)
(&+! (-> arg0 base) 32)
(let ((a0-2 (+ (the int (-> obj min y)) 1840)))
(let ((a0-2 (+ (the int (-> this min y)) 1840)))
(dotimes (t3-9 32)
(let ((t4-8 (the-as (inline-array vector4w) (-> arg0 base)))
(t5-13 (* (+ a0-2 (mod (+ (-> v1-0 scanline) (* t3-9 2)) (the-as uint t2-0))) 16))
@ -304,7 +301,7 @@
0
)
(defmethod draw hud-sprite ((obj hud-sprite) (arg0 dma-buffer) (arg1 level))
(defmethod draw ((this hud-sprite) (arg0 dma-buffer) (arg1 level))
(local-vars
(v1-5 uint128)
(a1-14 int)
@ -317,13 +314,13 @@
(t6-0 int)
)
(let ((s4-0 *hud-sprite-work*)
(s3-0 (-> obj tex))
(s3-0 (-> this tex))
(f28-0 0.0)
(f30-0 1.0)
)
(when (!= (-> obj angle) 0.0)
(set! f28-0 (sin (-> obj angle)))
(set! f30-0 (cos (-> obj angle)))
(when (!= (-> this angle) 0.0)
(set! f28-0 (sin (-> this angle)))
(set! f30-0 (cos (-> this angle)))
)
(when s3-0
(let ((v1-4 (-> arg1 texture-mask 8 mask quad))
@ -339,12 +336,12 @@
)
(&+! (-> arg0 base) 112)
(let ((v1-9 (the-as (inline-array structure) (-> arg0 base)))
(t0-0 (the int (* f30-0 (the float (-> s3-0 w)) (-> obj scale-x) (-> *video-params* relative-x-scale))))
(a2-1 (the int (* -1.0 (-> obj scale-x) (the float (-> s3-0 w)) f28-0)))
(t4-0 (the int (* f28-0 (the float (-> s3-0 h)) (-> obj scale-y) (-> *video-params* relative-x-scale))))
(t2-0 (the int (* f30-0 (the float (-> s3-0 h)) (-> obj scale-y))))
(a0-15 (if (nonzero? (-> obj pos z))
(-> obj pos z)
(t0-0 (the int (* f30-0 (the float (-> s3-0 w)) (-> this scale-x) (-> *video-params* relative-x-scale))))
(a2-1 (the int (* -1.0 (-> this scale-x) (the float (-> s3-0 w)) f28-0)))
(t4-0 (the int (* f28-0 (the float (-> s3-0 h)) (-> this scale-y) (-> *video-params* relative-x-scale))))
(t2-0 (the int (* f30-0 (the float (-> s3-0 h)) (-> this scale-y))))
(a0-15 (if (nonzero? (-> this pos z))
(-> this pos z)
#xffffff
)
)
@ -358,9 +355,9 @@
0
0
(cond
((logtest? (-> obj flags) 4)
(set! t1-0 (+ (-> obj pos x) 1792))
(set! t3-0 (+ (-> obj pos y) 1840))
((logtest? (-> this flags) 4)
(set! t1-0 (+ (-> this pos x) 1792))
(set! t3-0 (+ (-> this pos y) 1840))
(set! a1-14 (- t1-0 t0-0))
(set! a3-0 (- t3-0 a2-1))
(set! t5-0 (+ (- t1-0 t0-0) t4-0))
@ -368,19 +365,19 @@
(set! t0-2 (+ t1-0 t4-0))
(set! a2-3 (+ t3-0 t2-0))
)
((logtest? (-> obj flags) 8)
(set! a1-14 (+ (- 1792 (the int (* 0.5 (the float (+ t0-0 t4-0))))) (-> obj pos x)))
(set! a3-0 (+ (- 1840 (the int (* 0.5 (the float (+ a2-1 t2-0))))) (-> obj pos y)))
(set! t1-0 (+ (the int (* 0.5 (the float (+ t0-0 t4-0)))) 1792 (-> obj pos x)))
(set! t3-0 (+ (- 1840 (the int (* 0.5 (the float (+ a2-1 t2-0))))) (-> obj pos y)))
(set! t5-0 (+ (- 1792 (the int (* 0.5 (the float (+ t0-0 t4-0))))) (-> obj pos x)))
(set! t6-0 (+ (the int (* 0.5 (the float (+ a2-1 t2-0)))) 1840 (-> obj pos y)))
(set! t0-2 (+ (the int (* 0.5 (the float (+ t0-0 t4-0)))) 1792 (-> obj pos x)))
(set! a2-3 (+ (the int (* 0.5 (the float (+ a2-1 t2-0)))) 1840 (-> obj pos y)))
((logtest? (-> this flags) 8)
(set! a1-14 (+ (- 1792 (the int (* 0.5 (the float (+ t0-0 t4-0))))) (-> this pos x)))
(set! a3-0 (+ (- 1840 (the int (* 0.5 (the float (+ a2-1 t2-0))))) (-> this pos y)))
(set! t1-0 (+ (the int (* 0.5 (the float (+ t0-0 t4-0)))) 1792 (-> this pos x)))
(set! t3-0 (+ (- 1840 (the int (* 0.5 (the float (+ a2-1 t2-0))))) (-> this pos y)))
(set! t5-0 (+ (- 1792 (the int (* 0.5 (the float (+ t0-0 t4-0))))) (-> this pos x)))
(set! t6-0 (+ (the int (* 0.5 (the float (+ a2-1 t2-0)))) 1840 (-> this pos y)))
(set! t0-2 (+ (the int (* 0.5 (the float (+ t0-0 t4-0)))) 1792 (-> this pos x)))
(set! a2-3 (+ (the int (* 0.5 (the float (+ a2-1 t2-0)))) 1840 (-> this pos y)))
)
(else
(set! a1-14 (+ (-> obj pos x) 1792))
(set! a3-0 (+ (-> obj pos y) 1840))
(set! a1-14 (+ (-> this pos x) 1792))
(set! a3-0 (+ (-> this pos y) 1840))
(set! t1-0 (+ a1-14 t0-0))
(set! t3-0 (+ a3-0 a2-1))
(set! t5-0 (+ a1-14 t4-0))
@ -391,16 +388,16 @@
)
(set! (-> (the-as (inline-array vector) v1-9) 0 quad) (-> s4-0 draw-tmpl dma-vif quad))
(set! (-> (the-as (inline-array vector) v1-9) 1 quad) (-> s4-0 draw-tmpl quad 1))
(set! (-> (the-as (inline-array vector) v1-9) 2 quad) (-> obj color quad))
(set! (-> (the-as (inline-array vector) v1-9) 5 quad) (-> obj color quad))
(set! (-> (the-as (inline-array vector) v1-9) 8 quad) (-> obj color quad))
(set! (-> (the-as (inline-array vector) v1-9) 11 quad) (-> obj color quad))
(let ((f0-49 (if (logtest? (-> obj flags) 1)
(set! (-> (the-as (inline-array vector) v1-9) 2 quad) (-> this color quad))
(set! (-> (the-as (inline-array vector) v1-9) 5 quad) (-> this color quad))
(set! (-> (the-as (inline-array vector) v1-9) 8 quad) (-> this color quad))
(set! (-> (the-as (inline-array vector) v1-9) 11 quad) (-> this color quad))
(let ((f0-49 (if (logtest? (-> this flags) 1)
1.0
0.0
)
)
(f1-25 (if (logtest? (-> obj flags) 2)
(f1-25 (if (logtest? (-> this flags) 2)
1.0
0.0
)
@ -424,17 +421,17 @@
)
(defmethod draw-box-prim-only hud-box ((obj hud-box) (arg0 dma-buffer))
(defmethod draw-box-prim-only ((this hud-box) (arg0 dma-buffer))
(let ((t1-0 *hud-sprite-work*)
(v1-0 (the-as (inline-array vector4w) (-> arg0 base)))
(a2-2 (* (+ (the int (-> obj min x)) 1792) 16))
(t0-0 (* (+ (the int (-> obj max x)) 1792) 16))
(a3-4 (* (+ (the int (-> obj min y)) 1840) 16))
(a2-2 (* (+ (the int (-> this min x)) 1792) 16))
(t0-0 (* (+ (the int (-> this max x)) 1792) 16))
(a3-4 (* (+ (the int (-> this min y)) 1840) 16))
)
(let ((t2-2 (* (+ (the int (-> obj max y)) 1840) 16)))
(let ((t2-2 (* (+ (the int (-> this max y)) 1840) 16)))
(set! (-> v1-0 0 quad) (-> t1-0 box-tmpl dma-vif quad))
(set! (-> v1-0 1 quad) (-> t1-0 box-tmpl quad 1))
(set! (-> v1-0 2 quad) (-> obj color quad))
(set! (-> v1-0 2 quad) (-> this color quad))
(set-vector! (-> v1-0 3) a2-2 a3-4 #xffffff 0)
(set-vector! (-> v1-0 4) t0-0 a3-4 #xffffff 0)
(set-vector! (-> v1-0 5) t0-0 t2-2 #xffffff 0)
@ -447,21 +444,21 @@
(none)
)
(defmethod draw-box-alpha-1 hud-box ((obj hud-box) (arg0 dma-buffer))
(defmethod draw-box-alpha-1 ((this hud-box) (arg0 dma-buffer))
(dma-buffer-add-gs-set arg0
(test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)))
(alpha-1 (new 'static 'gs-alpha :a #x1 :d #x2))
)
(let ((t0-0 *hud-sprite-work*)
(v1-3 (the-as (inline-array vector4w) (-> arg0 base)))
(a2-8 (* (+ (the int (-> obj min x)) 1792) 16))
(a3-11 (* (+ (the int (-> obj max x)) 1792) 16))
(t2-0 (* (+ (the int (-> obj min y)) 1840) 16))
(t1-4 (* (+ (the int (-> obj max y)) 1840) 16))
(a2-8 (* (+ (the int (-> this min x)) 1792) 16))
(a3-11 (* (+ (the int (-> this max x)) 1792) 16))
(t2-0 (* (+ (the int (-> this min y)) 1840) 16))
(t1-4 (* (+ (the int (-> this max y)) 1840) 16))
)
(set! (-> v1-3 0 quad) (-> t0-0 box2-tmpl dma-vif quad))
(set! (-> v1-3 1 quad) (-> t0-0 box2-tmpl quad 1))
(set! (-> v1-3 2 quad) (-> obj color quad))
(set! (-> v1-3 2 quad) (-> this color quad))
(set-vector! (-> v1-3 3) a2-8 t2-0 #xffffff 0)
(set-vector! (-> v1-3 4) a3-11 t2-0 #xffffff 0)
(set-vector! (-> v1-3 5) a2-8 t1-4 #xffffff 0)
@ -472,21 +469,21 @@
(none)
)
(defmethod draw-box-alpha-2 hud-box ((obj hud-box) (arg0 dma-buffer))
(defmethod draw-box-alpha-2 ((this hud-box) (arg0 dma-buffer))
(dma-buffer-add-gs-set arg0
(test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)))
(alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1))
)
(let ((t0-0 *hud-sprite-work*)
(v1-3 (the-as (inline-array vector4w) (-> arg0 base)))
(a2-8 (* (+ (the int (-> obj min x)) 1792) 16))
(a3-11 (* (+ (the int (-> obj max x)) 1792) 16))
(t2-0 (* (+ (the int (-> obj min y)) 1840) 16))
(t1-4 (* (+ (the int (-> obj max y)) 1840) 16))
(a2-8 (* (+ (the int (-> this min x)) 1792) 16))
(a3-11 (* (+ (the int (-> this max x)) 1792) 16))
(t2-0 (* (+ (the int (-> this min y)) 1840) 16))
(t1-4 (* (+ (the int (-> this max y)) 1840) 16))
)
(set! (-> v1-3 0 quad) (-> t0-0 box2-tmpl dma-vif quad))
(set! (-> v1-3 1 quad) (-> t0-0 box2-tmpl quad 1))
(set! (-> v1-3 2 quad) (-> obj color quad))
(set! (-> v1-3 2 quad) (-> this color quad))
(set-vector! (-> v1-3 3) a2-8 t2-0 #xffffff 0)
(set-vector! (-> v1-3 4) a3-11 t2-0 #xffffff 0)
(set-vector! (-> v1-3 5) a2-8 t1-4 #xffffff 0)
@ -497,21 +494,21 @@
(none)
)
(defmethod draw-box-alpha-3 hud-box ((obj hud-box) (arg0 dma-buffer))
(defmethod draw-box-alpha-3 ((this hud-box) (arg0 dma-buffer))
(dma-buffer-add-gs-set arg0
(test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)))
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
)
(let ((t0-0 *hud-sprite-work*)
(v1-3 (the-as (inline-array vector4w) (-> arg0 base)))
(a2-8 (* (+ (the int (-> obj min x)) 1792) 16))
(a3-11 (* (+ (the int (-> obj max x)) 1792) 16))
(t2-0 (* (+ (the int (-> obj min y)) 1840) 16))
(t1-4 (* (+ (the int (-> obj max y)) 1840) 16))
(a2-8 (* (+ (the int (-> this min x)) 1792) 16))
(a3-11 (* (+ (the int (-> this max x)) 1792) 16))
(t2-0 (* (+ (the int (-> this min y)) 1840) 16))
(t1-4 (* (+ (the int (-> this max y)) 1840) 16))
)
(set! (-> v1-3 0 quad) (-> t0-0 box2-tmpl dma-vif quad))
(set! (-> v1-3 1 quad) (-> t0-0 box2-tmpl quad 1))
(set! (-> v1-3 2 quad) (-> obj color quad))
(set! (-> v1-3 2 quad) (-> this color quad))
(set-vector! (-> v1-3 3) a2-8 t2-0 #xffffff 0)
(set-vector! (-> v1-3 4) a3-11 t2-0 #xffffff 0)
(set-vector! (-> v1-3 5) a2-8 t1-4 #xffffff 0)
@ -522,12 +519,12 @@
(none)
)
(defmethod setup-scissor hud-box ((obj hud-box) (arg0 dma-buffer))
(defmethod setup-scissor ((this hud-box) (arg0 dma-buffer))
(dma-buffer-add-gs-set arg0 (scissor-1 (new 'static 'gs-scissor
:scax0 (the int (-> obj min x))
:scay0 (the int (-> obj min y))
:scax1 (the int (-> obj max x))
:scay1 (the int (-> obj max y))
:scax0 (the int (-> this min x))
:scay0 (the int (-> this min y))
:scax1 (the int (-> this max x))
:scay1 (the int (-> this max y))
)
)
)
@ -535,30 +532,30 @@
(none)
)
(defmethod restore-scissor hud-box ((obj hud-box) (arg0 dma-buffer))
(defmethod restore-scissor ((this hud-box) (arg0 dma-buffer))
(dma-buffer-add-gs-set arg0 (scissor-1 (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f)))
0
(none)
)
;; WARN: Return type mismatch process vs hud.
(defmethod relocate hud ((obj hud) (arg0 int))
(defmethod relocate ((this hud) (offset int))
(dotimes (v1-0 14)
(if (-> obj strings v1-0 text)
(&+! (-> obj strings v1-0 text) arg0)
(if (-> this strings v1-0 text)
(&+! (-> this strings v1-0 text) offset)
)
)
(the-as hud ((method-of-type process relocate) obj arg0))
(the-as hud ((method-of-type process relocate) this offset))
)
(defmethod draw hud ((obj hud))
(when (not (hidden? obj))
(defmethod draw ((this hud))
(when (not (hidden? this))
(with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id progress)
)
(dotimes (s3-0 30)
(if (and (-> obj sprites s3-0 tex) (!= (-> obj sprites s3-0 scale-x) 0.0))
(draw (-> obj sprites s3-0) s4-0 (-> obj level))
(if (and (-> this sprites s3-0 tex) (!= (-> this sprites s3-0 scale-x) 0.0))
(draw (-> this sprites s3-0) s4-0 (-> this level))
)
)
(let ((s3-1
@ -566,37 +563,37 @@
)
)
(dotimes (s2-0 14)
(when (and (-> obj strings s2-0 text) (nonzero? (-> obj strings s2-0 pos 0)))
(when (and (-> this strings s2-0 text) (nonzero? (-> this strings s2-0 pos 0)))
(set-vector!
(-> s3-1 origin)
(the float (-> obj strings s2-0 pos 0))
(the float (-> obj strings s2-0 pos 1))
(the float (-> obj strings s2-0 pos 2))
(the float (-> this strings s2-0 pos 0))
(the float (-> this strings s2-0 pos 1))
(the float (-> this strings s2-0 pos 2))
1.0
)
(set! (-> s3-1 scale) (-> obj strings s2-0 scale))
(set! (-> s3-1 flags) (-> obj strings s2-0 flags))
(set! (-> s3-1 color) (-> obj strings s2-0 color))
(draw-string (-> obj strings s2-0 text) s4-0 s3-1)
(set! (-> s3-1 scale) (-> this strings s2-0 scale))
(set! (-> s3-1 flags) (-> this strings s2-0 flags))
(set! (-> s3-1 color) (-> this strings s2-0 color))
(draw-string (-> this strings s2-0 text) s4-0 s3-1)
)
)
)
)
(dotimes (v1-55 2)
(when (-> obj icons v1-55 icon)
(when (-> this icons v1-55 icon)
(set-vector!
(-> obj icons v1-55 icon 0 root scale)
(* (-> obj icons v1-55 scale-x) (-> *video-params* relative-x-scale))
(-> obj icons v1-55 scale-y)
(* (-> obj icons v1-55 scale-x) (-> *video-params* relative-x-scale))
(-> this icons v1-55 icon 0 root scale)
(* (-> this icons v1-55 scale-x) (-> *video-params* relative-x-scale))
(-> this icons v1-55 scale-y)
(* (-> this icons v1-55 scale-x) (-> *video-params* relative-x-scale))
1.0
)
(if (-> *blit-displays-work* horizontal-flip-flag)
(set! (-> obj icons v1-55 icon 0 root trans x) (the float (- 256 (-> obj icons v1-55 pos 0))))
(set! (-> obj icons v1-55 icon 0 root trans x) (the float (+ (-> obj icons v1-55 pos 0) -256)))
(set! (-> this icons v1-55 icon 0 root trans x) (the float (- 256 (-> this icons v1-55 pos 0))))
(set! (-> this icons v1-55 icon 0 root trans x) (the float (+ (-> this icons v1-55 pos 0) -256)))
)
(set! (-> obj icons v1-55 icon 0 root trans y) (the float (* (+ (-> obj icons v1-55 pos 1) -208) 2)))
(set! (-> obj icons v1-55 icon 0 root trans z) (the float (-> obj icons v1-55 pos 2)))
(set! (-> this icons v1-55 icon 0 root trans y) (the float (* (+ (-> this icons v1-55 pos 1) -208) 2)))
(set! (-> this icons v1-55 icon 0 root trans z) (the float (-> this icons v1-55 pos 2)))
)
)
)
@ -604,18 +601,18 @@
(none)
)
(defmethod update-value-callback hud ((obj hud) (arg0 int) (arg1 int))
(defmethod update-value-callback ((this hud) (arg0 int) (arg1 int))
0
(none)
)
(defmethod update-values hud ((obj hud))
(defmethod update-values ((this hud))
(with-pp
(let ((s5-0 #f))
(let ((v1-0 #f))
(dotimes (a0-1 8)
(when (!= (-> obj values a0-1 current) (-> obj values a0-1 target))
(if (= (-> obj values a0-1 current) -1)
(when (!= (-> this values a0-1 current) (-> this values a0-1 target))
(if (= (-> this values a0-1 current) -1)
(set! v1-0 #t)
(set! s5-0 #t)
)
@ -625,17 +622,17 @@
(when v1-0
(dotimes (s4-0 8)
(cond
((and (logtest? (-> obj values s4-0 flags) 1) (!= (-> obj values s4-0 current) -1))
(set! (-> obj values s4-0 counter)
((and (logtest? (-> this values s4-0 flags) 1) (!= (-> this values s4-0 current) -1))
(set! (-> this values s4-0 counter)
(the-as uint (seekl
(the-as int (-> obj values s4-0 counter))
(the-as int (-> this values s4-0 counter))
0
(the-as int (- (current-time) (-> pp clock old-frame-counter)))
)
)
)
(when (and (zero? (-> obj values s4-0 counter)) (!= (-> obj values s4-0 current) (-> obj values s4-0 target)))
(let ((v1-27 (abs (- (-> obj values s4-0 current) (-> obj values s4-0 target))))
(when (and (zero? (-> this values s4-0 counter)) (!= (-> this values s4-0 current) (-> this values s4-0 target)))
(let ((v1-27 (abs (- (-> this values s4-0 current) (-> this values s4-0 target))))
(s3-0 1)
)
(cond
@ -646,29 +643,29 @@
(set! s3-0 10)
)
)
(update-value-callback obj s4-0 (if (< (-> obj values s4-0 current) (-> obj values s4-0 target))
s3-0
(- s3-0)
)
(update-value-callback this s4-0 (if (< (-> this values s4-0 current) (-> this values s4-0 target))
s3-0
(- s3-0)
)
)
(seekl! (-> obj values s4-0 current) (-> obj values s4-0 target) s3-0)
(seekl! (-> this values s4-0 current) (-> this values s4-0 target) s3-0)
)
(set! (-> obj values s4-0 counter) (the-as uint 30))
(set! (-> this values s4-0 counter) (the-as uint 30))
)
)
(else
(set! (-> obj values s4-0 current) (-> obj values s4-0 target))
(set! (-> this values s4-0 current) (-> this values s4-0 target))
)
)
)
)
)
(if (and (not *progress-process*)
(>= (- (current-time) (-> obj last-hide-time)) (seconds 0.05))
(time-elapsed? (-> this last-hide-time) (seconds 0.05))
(>= (- (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1))
(>= (- (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) (seconds 0.1))
(or (not *target*) (not (focus-test? *target* grabbed)) (logtest? (-> obj flags) (hud-flags show)))
(not (logtest? (-> obj flags) (hud-flags disable)))
(or (not *target*) (not (focus-test? *target* grabbed)) (logtest? (-> this flags) (hud-flags show)))
(not (logtest? (-> this flags) (hud-flags disable)))
(not (or (= *master-mode* 'progress) (= *master-mode* 'menu)))
(or s5-0
(cond
@ -683,9 +680,9 @@
(cpad-hold? 0 l3)
)
)
(logtest? (-> obj flags) (hud-flags show))
(logtest? (-> this flags) (hud-flags show))
)
(check-ready-and-maybe-show obj #t)
(check-ready-and-maybe-show this #t)
)
(go hud-arriving)
)
@ -695,38 +692,38 @@
)
)
(defmethod init-callback hud ((obj hud))
(defmethod init-callback ((this hud))
0
(none)
)
(defmethod event-callback hud ((obj hud) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(defmethod event-callback ((this hud) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
#f
)
(defmethod hud-method-19 hud ((obj hud))
(defmethod hud-method-19 ((this hud))
0
(none)
)
(defmethod hud-method-20 hud ((obj hud))
(defmethod hud-method-20 ((this hud))
0
(none)
)
(defmethod hud-method-21 hud ((obj hud))
(defmethod hud-method-21 ((this hud))
0
(none)
)
(defmethod hud-method-22 hud ((obj hud))
(defmethod hud-method-22 ((this hud))
0
(none)
)
;; WARN: Return type mismatch object vs symbol.
(defmethod hidden? hud ((obj hud))
(the-as symbol (and (-> obj next-state) (= (-> obj next-state name) 'hud-hidden)))
(defmethod hidden? ((this hud))
(the-as symbol (and (-> this next-state) (= (-> this next-state name) 'hud-hidden)))
)
;; WARN: Return type mismatch (pointer process) vs (pointer manipy).
@ -748,19 +745,19 @@
)
)
(defmethod alloc-string-if-needed hud ((obj hud) (arg0 int))
(defmethod alloc-string-if-needed ((this hud) (arg0 int))
;; og:preserve-this jp patch here (32 -> 64)
(if (not (-> obj strings arg0 text))
(set! (-> obj strings arg0 text) (new 'process 'string 64 (the-as string #f)))
(if (not (-> this strings arg0 text))
(set! (-> this strings arg0 text) (new 'process 'string 64 (the-as string #f)))
)
0
(none)
)
(defstate hud-hidden (hud)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-1 object))
(case event-type
(case message
(('show)
(if (and (not *progress-process*)
(!= (-> self last-hide-time) (current-time))
@ -775,7 +772,7 @@
v0-1
)
(('force-hide)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(set! v0-1 (logclear (-> self flags) (hud-flags show)))
(set! (-> self flags) (the-as hud-flags v0-1))
v0-1
@ -795,7 +792,7 @@
v0-1
)
(('hide-and-die)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(logior! (-> self flags) (hud-flags should-die))
(set! v0-1 (logclear (-> self flags) (hud-flags show)))
(set! (-> self flags) (the-as hud-flags v0-1))
@ -818,7 +815,7 @@
v0-1
)
(else
(event-callback self proc arg1 event-type event)
(event-callback self proc argc message block)
)
)
)
@ -840,30 +837,28 @@
(set! gp-0 (-> gp-0 0 brother))
)
)
(none)
)
:code (the-as (function none :behavior hud) sleep-code)
:code sleep-code
:post (behavior ()
(if (logtest? (-> self flags) (hud-flags should-die))
(deactivate self)
)
(update-values self)
(none)
)
)
(defstate hud-arriving (hud)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-1 object))
(case event-type
(case message
(('hide-quick)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(set! (-> self offset) 1.0)
(update-values self)
(go hud-hidden)
)
(('force-hide)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(logclear! (-> self flags) (hud-flags show))
(go hud-leaving 0.1)
)
@ -877,11 +872,11 @@
)
)
(('hide)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(go hud-leaving 0.1)
)
(('hide-and-die)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(logior! (-> self flags) (hud-flags should-die))
(logclear! (-> self flags) (hud-flags show))
(go hud-leaving 0.1)
@ -911,19 +906,18 @@
v0-1
)
(else
(event-callback self proc arg1 event-type event)
(event-callback self proc argc message block)
)
)
)
:enter (behavior ()
(set! (-> self trigger-time) (current-time))
(set-time! (-> self trigger-time))
(let ((gp-0 (-> self child)))
(while gp-0
(send-event (ppointer->process gp-0) 'draw #t)
(set! gp-0 (-> gp-0 0 brother))
)
)
(none)
)
:code (behavior ()
(until #f
@ -935,7 +929,7 @@
)
(when (= (get-status *gui-control* (-> self gui-id)) (gui-status pending))
(set! (-> self event-hook) #f)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(set! (-> self offset) 1.0)
(update-values self)
(go hud-hidden)
@ -943,7 +937,6 @@
(suspend)
)
#f
(none)
)
:post (behavior ()
(update-values self)
@ -954,27 +947,25 @@
)
(draw self)
)
(none)
)
)
(defstate hud-in (hud)
:event (-> hud-arriving event)
:code (behavior ()
(set! (-> self trigger-time) (current-time))
(while (and (< (- (current-time) (-> self trigger-time)) (seconds 2)) (check-ready-and-maybe-show self #f))
(set-time! (-> self trigger-time))
(while (and (not (time-elapsed? (-> self trigger-time) (seconds 2))) (check-ready-and-maybe-show self #f))
(set! (-> self offset) 0.0)
(suspend)
)
(when (= (get-status *gui-control* (-> self gui-id)) (gui-status pending))
(set! (-> self event-hook) #f)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(set! (-> self offset) 1.0)
(update-values self)
(go hud-hidden)
)
(go hud-leaving 0.05)
(none)
)
:post (-> hud-arriving post)
)
@ -988,7 +979,7 @@
)
(when (= (get-status *gui-control* (-> self gui-id)) (gui-status pending))
(set! (-> self event-hook) #f)
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(set! (-> self offset) 1.0)
(update-values self)
(go hud-hidden)
@ -999,7 +990,6 @@
(suspend)
)
#f
(none)
)
:post (-> hud-arriving post)
)
@ -1009,7 +999,7 @@
(set! (-> self mask) (process-mask menu))
(set! (-> self clock) (-> *display* real-clock))
(set! (-> self flags) (hud-flags))
(set! (-> self last-hide-time) (current-time))
(set-time! (-> self last-hide-time))
(set! (-> self offset) 1.0)
(dotimes (v1-9 14)
(set! (-> self strings v1-9 text) #f)

View File

@ -1384,7 +1384,7 @@
(set! sv-220 (new 'stack-no-clear 'matrix))
(set! sv-224 (new 'stack-no-clear 'matrix))
(set! sv-228 (new 'stack-no-clear 'matrix))
(set! (-> sv-216 quad) (-> (matrix-world->local #f #f) vector 2 quad))
(set! (-> sv-216 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) vector 2 quad))
(set! (-> sv-216 y) 0.0)
(vector-normalize! sv-216 1.0)
(vector-z-quaternion! (the-as vector sv-220) (-> (the-as process-drawable sv-16) root quat))
@ -1635,7 +1635,7 @@
(set! sv-228 (new 'stack-no-clear 'matrix))
(set! sv-232 (new 'stack-no-clear 'matrix))
(when sv-212
(set! (-> sv-220 quad) (-> (matrix-world->local #f #f) vector 2 quad))
(set! (-> sv-220 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) vector 2 quad))
(set! (-> sv-220 y) 0.0)
(vector-normalize! sv-220 1.0)
(vector-z-quaternion! (the-as vector sv-224) (-> (the-as process-drawable sv-16) root quat))
@ -1784,7 +1784,7 @@
(set! sv-228 (new 'stack-no-clear 'matrix))
(set! sv-232 (new 'stack-no-clear 'matrix))
(when sv-212
(set! (-> sv-220 quad) (-> (matrix-world->local #f #f) vector 2 quad))
(set! (-> sv-220 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) vector 2 quad))
(set! (-> sv-220 y) 0.0)
(vector-normalize! sv-220 1.0)
(vector-z-quaternion! (the-as vector sv-224) (-> (the-as process-drawable sv-16) root quat))
@ -1914,7 +1914,7 @@
(set! (-> (the-as (pointer uint128) s3-1) 1) (-> this draw2-tmpl quad 1))
(let ((s2-0 (new-stack-vector0)))
(let ((s1-0 (new-stack-vector0)))
(set! (-> s1-0 quad) (-> (matrix-local->world #f #f) vector 2 quad))
(set! (-> s1-0 quad) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-local->world #f #f)) (matrix-local->world #f #f)) vector 2 quad))
(set! (-> s1-0 y) 0.0)
(vector-normalize! s1-0 1.0)
(let ((v1-16 (-> arg0 mat)))
@ -2126,7 +2126,7 @@
(set! sv-52 v1-29)
)
(set! sv-56 (target-pos 0))
(set! (-> sv-52 quad 0) (-> (matrix-world->local #f #f) vector 2 quad))
(set! (-> sv-52 quad 0) (-> (#if PC_PORT (if (-> *pc-settings* minimap-force-north) *matrix-minimap-north* (matrix-world->local #f #f)) (matrix-world->local #f #f)) vector 2 quad))
(set! (-> sv-52 vector 0 y) 0.0)
(vector-normalize! (the-as vector sv-52) 1.0)
(cond
@ -2472,8 +2472,8 @@
)
(let* ((a3-1 (+ (* (the-as uint 320) (-> arg1 class icon-xy x)) 8))
(t0-1 (+ (* (the-as uint 320) (-> arg1 class icon-xy y)) 8))
(a1-61 (+ a3-1 312))
(a2-14 (+ t0-1 312))
(a1-61 (+ a3-1 300)) ;; og:preserve-this fix icon misalign
(a2-14 (+ t0-1 300)) ;; og:preserve-this fix icon misalign
)
(set! (-> (the-as (pointer uint128) v1-115)) (-> this sprite-tmpl dma-vif quad))
(set! (-> (the-as (pointer uint128) v1-115) 1) (-> this sprite-tmpl quad 1))

View File

@ -5,6 +5,10 @@
;; name in dgo: capture-h
;; dgos: ENGINE, GAME
(defmacro not-screen-shot? ()
"return #f if we are screen shotting"
`(or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1)))
;; DECOMP BEGINS
(declare-file (debug))

View File

@ -232,6 +232,9 @@
(define-extern pc-set-gfx-hack (function pc-gfx-hack symbol none))
(define-extern pc-get-unix-timestamp (function int))
(define-extern pc-filter-debug-string? (function string float symbol))
(define-extern pc-screen-shot (function none))
(declare-type screen-shot-settings structure)
(define-extern pc-register-screen-shot-settings (function screen-shot-settings none))
(define-extern pc-treat-pad0-as-pad1 (function symbol none))
(define-extern pc-is-imgui-visible? (function symbol))
(define-extern pc-rand (function int))

View File

@ -0,0 +1,58 @@
;;-*-Lisp-*-
(in-package goal)
#|
this file has code for setting up the screen shot system for the PC port (replaces PS2 version)
These settings can also be configured through the imgui toolbar.
|#
;; this file is debug only
(declare-file (debug))
(deftype screen-shot-settings (structure)
((width int32)
(height int32)
(msaa int32)
(name uint8 244)
)
(:methods
(new (symbol type int int int) _type_)
)
)
(defmethod new screen-shot-settings ((allocation symbol) (type-to-make type) (width int) (height int) (msaa int))
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(copyn-charp<-string (-> obj name) "screenshot" 244)
(set! (-> obj width) width)
(set! (-> obj height) height)
(set! (-> obj msaa) msaa)
(pc-register-screen-shot-settings obj)
obj
)
)
(define *screen-shot-settings* (new 'debug 'screen-shot-settings 1920 1080 16))
(defun-debug screen-shot ()
(screen-shot-scale 1 "image")
(true! *disable-mouse*)
(clear *temp-string*)
(format *temp-string* "screenshot")
(let ((date (new 'stack-no-clear 'scf-time)))
(scf-get-time date)
(format *temp-string* "-~4,'0d-~2,'0d-~2,'0d_~2,'0d~2,'0d~2,'0d" (+ 2000 (bcd->dec (-> date year))) (bcd->dec (-> date month)) (bcd->dec (-> date day)) (bcd->dec (-> date hour)) (bcd->dec (-> date minute)) (bcd->dec (-> date second)))
)
(format *temp-string* "_~D" (-> *display* real-frame-clock frame-counter))
(copyn-charp<-string (-> *screen-shot-settings* name) *temp-string* 244)
(none))
(defun store-image ((arg0 screen-shot-work))
(pc-screen-shot) ;; send a screen shot command, this will make the graphics engine save a screenshot at the end of the frame. USE IMGUI BAR FOR SETTINGS!!!!
0)

View File

@ -802,6 +802,22 @@
(set-size! *pc-settings* (/ (the int (car size)) 8) (/ (the int (cadr size)) 8) #t)
)
(defun dm-screen-shot-preset-pick-func ((args pair) (msg debug-menu-msg))
(let ((w (/ (the int (car args)) 8))
(h (/ (the int (cadr args)) 8))
(m (/ (the int (caddr args)) 8))
)
(when (= msg (debug-menu-msg press))
(set! (-> *screen-shot-settings* width) w)
(set! (-> *screen-shot-settings* height) h)
(set! (-> *screen-shot-settings* msaa) m)
)
(and (= (-> *screen-shot-settings* width) w)
(= (-> *screen-shot-settings* height) h)
(= (-> *screen-shot-settings* msaa) m))))
(define *screen-shot-capture-profile* #f)
(when (-> *debug-menu-context* root-menu)
;; (debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-load-menu *debug-menu-context*))
(debug-menu-append-item (-> *debug-menu-context* root-menu) (debug-menu-make-part-menu *debug-menu-context*))
@ -945,6 +961,21 @@
(flag "GAME_TERRITORY_SCEI" (the binteger GAME_TERRITORY_SCEI) dm-territory-pick-func)
(flag "GAME_TERRITORY_SCEK" (the binteger GAME_TERRITORY_SCEK) dm-territory-pick-func)
)
(menu "Minimap"
(flag "Non-PS2 coordinates" #f ,(dm-lambda-boolean-flag (-> *pc-settings* smooth-minimap?)))
(flag "Always face north" #f ,(dm-lambda-boolean-flag (-> *pc-settings* minimap-force-north)))
)
(menu "Screen shot"
(flag "Hud enable" #f ,(dm-lambda-boolean-flag (-> *screen-shot-work* hud-enable)))
(flag "Capture profile" *screen-shot-capture-profile* dm-boolean-toggle-pick-func)
(menu "Presets"
(flag "1080p (default)" (1920 1080 16) dm-screen-shot-preset-pick-func)
(flag "2K" (2160 1440 16) dm-screen-shot-preset-pick-func)
(flag "4K" (3840 2160 16) dm-screen-shot-preset-pick-func)
(flag "Maximum (anamorphic 16K)" (16384 16384 16) dm-screen-shot-preset-pick-func)
)
(function "Capture now" #f ,(lambda () (screen-shot) (if *screen-shot-capture-profile* (set! *display-profile* #t))))
)
(flag "V-sync" #f ,(dm-lambda-boolean-flag (-> *pc-settings* vsync?)))
(flag "PS2 actor vis" #f ,(dm-lambda-boolean-flag (-> *pc-settings* ps2-actor-vis?)))
(flag "Display actor counts" *display-actor-counts* dm-boolean-toggle-pick-func)

View File

@ -90,6 +90,7 @@
(fast-airlock? symbol)
(fast-elevator? symbol)
(fast-progress? symbol)
(minimap-force-north symbol)
(stats statistics)
@ -112,6 +113,7 @@
)
(define *pc-settings* (the pc-settings-jak2 #f))
(define *matrix-minimap-north* (quaternion->matrix (new 'static 'matrix) (quaternion-vector-angle! (new 'static 'quaternion) *y-vector* (degrees 180))))
;; jak 2 discord rpc structure
@ -143,6 +145,7 @@
(true! (-> obj fast-elevator?))
(false! (-> obj fast-progress?))
(true! (-> obj smooth-minimap?))
(false! (-> obj minimap-force-north))
(false! (-> obj hires-clouds?))
(set! (-> obj speedrunner-mode-custom-bind) 0)

View File

@ -746,6 +746,7 @@
(("fast-elevator?") (set! (-> obj fast-elevator?) (file-stream-read-symbol file)))
(("fast-progress?") (set! (-> obj fast-progress?) (file-stream-read-symbol file)))
(("smooth-minimap?") (set! (-> obj smooth-minimap?) (file-stream-read-symbol file)))
(("minimap-force-north") (set! (-> obj minimap-force-north) (file-stream-read-symbol file)))
(("hires-clouds?") (set! (-> obj hires-clouds?) (file-stream-read-symbol file)))
(("text-language") (set! (-> obj text-language) (the-as pc-language (file-stream-read-int file))))
(("controller-led-status?") (set! (-> obj controller-led-status?) (file-stream-read-symbol file)))
@ -797,6 +798,7 @@
(format file " (fast-elevator? ~A)~%" (-> obj fast-elevator?))
(format file " (fast-progress? ~A)~%" (-> obj fast-progress?))
(format file " (smooth-minimap? ~A)~%" (-> obj smooth-minimap?))
(format file " (minimap-force-north ~A)~%" (-> obj minimap-force-north))
(format file " (hires-clouds? ~A)~%" (-> obj hires-clouds?))
(format file " (text-language ~D)~%" (-> obj text-language))
(format file " (controller-led-status? ~A)~%" (-> obj controller-led-status?))

View File

@ -348,6 +348,7 @@
"prototype.o"
"main-collide.o"
"video.o"
"capture-pc.o" ;; added
"pckernel-common.o" ;; added
"pckernel.o" ;; added
"main.o"

View File

@ -223,7 +223,7 @@
(entity entity)
(directed? symbol)
(no-initial-move-to-ground? symbol)
(art-level level)
(art-level symbol)
)
)
@ -349,8 +349,8 @@
(go-best-state (_type_) object)
(go-die (_type_) object)
(event-handler (_type_ process int symbol event-message-block) object :behavior enemy)
(enemy-touch-handler (_type_ process event-message-block) none)
(send-attack-on-jump-or-knocked (_type_ process event-message-block) none)
(enemy-touch-handler (_type_ process event-message-block) object)
(send-attack-on-jump-or-knocked (_type_ process event-message-block) object)
(knocked-anim (_type_ enemy-knocked-info) symbol)
(knocked-land-anim (_type_ enemy-knocked-info) symbol)
(knocked-anim-handler (_type_ int enemy-knocked-info) symbol)
@ -361,7 +361,7 @@
(init-jump-info! (_type_ enemy-jump-info) none)
(setup-jump! (_type_ enemy-jump-info) none)
(move-to-gspot! (_type_) float)
(on-ground? (_type_) symbol)
(on-ground? (_type_ enemy-jump-info) symbol)
(jump-in-air-anim (_type_ enemy-jump-info) symbol)
(jump-land-anim (_type_ enemy-jump-info) symbol)
(jump-wind-up-anim (_type_ enemy-jump-info) symbol)
@ -415,7 +415,7 @@
(play-damage-sound (_type_ int) sound-id)
(check-victory (_type_) none)
(go-gun-dark-2-stretch (_type_) object)
(have-less-than-10-joints? (_type_) object)
(have-more-than-10-joints? (_type_) object)
(enemy-method-150 (_type_) symbol)
(should-move-to-ground? (_type_) symbol)
(enemy-method-152 (_type_) float)

View File

@ -460,7 +460,7 @@
(go (method-of-object this hostile))
)
(defmethod have-less-than-10-joints? ((this enemy))
(defmethod have-more-than-10-joints? ((this enemy))
(and (nonzero? (-> this node-list)) (-> this node-list) (< 10 (-> this node-list length)))
)
@ -1178,7 +1178,7 @@
)
)
(when (-> arg1 art-level)
(let ((v1-5 (level-get *level* (the-as symbol (-> arg1 art-level)))))
(let ((v1-5 (level-get *level* (-> arg1 art-level))))
(if v1-5
(set! (-> self level) v1-5)
)
@ -2135,7 +2135,6 @@
(find-offending-process-focusable arg0 arg1)
)
;; WARN: Return type mismatch object vs none.
(defmethod enemy-touch-handler ((this enemy) (arg0 process) (arg1 event-message-block))
(let* ((s4-0 (-> arg1 param 0))
(s2-0 arg0)
@ -2189,10 +2188,9 @@
)
)
)
(none)
)
;; WARN: Return type mismatch symbol vs none.
;; WARN: Return type mismatch symbol vs object.
(defmethod send-attack-on-jump-or-knocked ((this enemy) (arg0 process) (arg1 event-message-block))
(let ((s4-0 (-> arg1 param 0)))
(when s4-0
@ -2226,7 +2224,6 @@
)
)
)
(none)
)
(defbehavior enemy-event-handler enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@ -2337,11 +2334,11 @@
(none)
)
(defmethod on-ground? ((this enemy))
(defmethod on-ground? ((this enemy) (arg0 enemy-jump-info))
(let ((gp-0 (-> this root)))
(when (< (-> gp-0 transv y) 0.0)
(let ((a1-0 (new 'stack-no-clear 'collide-query)))
(find-ground (-> this root) a1-0 (-> this gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))
(let ((a1-1 (new 'stack-no-clear 'collide-query)))
(find-ground (-> this root) a1-1 (-> this gnd-collide-with) 8192.0 81920.0 1024.0 (the-as process #f))
)
(>= (+ 409.6 (-> gp-0 gspot-pos y)) (-> gp-0 trans y))
)

View File

@ -37,16 +37,35 @@
;; +++traffic-h:traffic-type
(defenum traffic-type
:type uint8
(tt17 17)
(tt18 18)
(tt19 19)
(tt20 20)
(tt21 21)
(tt22 22)
(tt23 23)
(tt25 25)
(tt27 27)
(tt28 28)
(civilian-male 0)
(civilian-female 1)
(civilian-fat 2)
(civilian-pilot 3)
(guard-pilot 4)
(citizen-task 5)
(guard-a 6)
(guard-b 7)
(metalhead-grunt 8)
(metalhead-flitter 9)
(metalhead-predator 10)
(wlander-male 11)
(wlander-female 12)
(formation 13)
(roboguard 14)
(spydroid 15)
(flying-turret 16)
(civilian-bike-a 17)
(civilian-bike-b 18)
(civilian-bike-c 19)
(civilian-car-a 20)
(civilian-car-b 21)
(civilian-car-c 22)
(vehicle-task 23)
(guard-bike 24)
(guard-car 25)
(guard-transport 26)
(kg-pickup 27)
(bike-d 28)
(invalid #xffffffff)
)
;; ---traffic-h:traffic-type
@ -84,6 +103,7 @@
(v-marauder-b 23)
(test-car 25)
(wbike-test 26)
(vt27 27)
(evan-test-bike 29)
)
;; ---vehicle-type
@ -147,13 +167,13 @@
(deftype traffic-info (structure)
((ctywide-level basic)
(vehicle-level basic)
(race-vehicle-level basic)
(traffic-object-levels level 29)
((ctywide-level level)
(vehicle-level level)
(race-vehicle-level level)
(traffic-object-levels symbol 29)
(vehicle-levels symbol 44)
(traffic-object-type-from-vehicle-type traffic-type 44)
(restore-speech-callback basic)
(restore-speech-callback (function none))
)
)
@ -174,13 +194,13 @@
(set! (-> v1-5 vehicle-levels a0-12) #f)
(set! (-> v1-5 traffic-object-type-from-vehicle-type a0-12) (traffic-type invalid))
)
(set! (-> v1-5 traffic-object-type-from-vehicle-type 0) (traffic-type tt17))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 1) (traffic-type tt18))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 2) (traffic-type tt19))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 3) (traffic-type tt20))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 4) (traffic-type tt21))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 5) (traffic-type tt22))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 6) (traffic-type tt28))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 7) (traffic-type tt25))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 11) (traffic-type tt27))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 0) (traffic-type civilian-bike-a))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 1) (traffic-type civilian-bike-b))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 2) (traffic-type civilian-bike-c))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 3) (traffic-type civilian-car-a))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 4) (traffic-type civilian-car-b))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 5) (traffic-type civilian-car-c))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 6) (traffic-type bike-d))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 7) (traffic-type guard-car))
(set! (-> v1-5 traffic-object-type-from-vehicle-type 11) (traffic-type kg-pickup))
)

View File

@ -240,7 +240,7 @@ This is used to make jak look toward an enemy, for example."
"Set up this joint-mod to modify the given joint of the given process. Will attach automatically if attached flag is set."
(set! (-> this flags) flags)
(set! (-> this node-index) (the-as int bone-idx))
(set! (-> this proc) (the-as (pointer process-drawable) (process->ppointer proc)))
(set! (-> this proc) (process->ppointer proc))
(if (logtest? flags (joint-mod-base-flags attached))
(attach-callback this)
)

View File

@ -76,8 +76,8 @@ This can represent a sphere, a triangle mesh, or a group of other primitives wit
(prim-type prim-type :overlay-at (-> prim-core prim-type))
)
(:methods
(resolve-moving-sphere-tri (_type_ collide-tri-result collide-prim-core vector float collide-action) float)
(resolve-moving-sphere-sphere (_type_ collide-tri-result collide-prim-core vector float collide-action) float)
(resolve-moving-sphere-tri (_type_ collide-query sphere vector float collide-action) float)
(resolve-moving-sphere-sphere (_type_ collide-query sphere vector float collide-action) float)
)
)

View File

@ -790,14 +790,14 @@
(vf4 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (new 'stack-no-clear 'collide-cache-tri)))
(let ((s5-0 (new 'stack-no-clear 'collide-puls-work)))
(.lvf vf4 (&-> arg0 exit-planes 0 quad))
(.lvf vf3 (&-> arg0 start-pos quad))
(.lvf vf2 (&-> arg0 move-dist quad))
(set! (-> s5-0 vertex 0 x) (the-as float (-> arg0 ignore-pat)))
(set! (-> s5-0 ignore-pat) (-> arg0 ignore-pat))
(.mul.w.vf vf3 vf0 vf4 :mask #b1000)
(.svf (&-> s5-0 vertex 2 quad) vf2)
(.svf (&-> s5-0 vertex 1 quad) vf3)
(.svf (&-> s5-0 move-dist quad) vf2)
(.svf (&-> s5-0 bsphere quad) vf3)
(let ((s4-0 (the-as object (-> this prims)))
(f30-0 -100000000.0)
)
@ -809,9 +809,9 @@
((>= (-> (the-as collide-cache-prim s4-0) prim-core prim-type) 0)
(let ((f0-0 ((method-of-type collide-cache-prim resolve-moving-sphere-tri)
(the-as collide-cache-prim s4-0)
(the-as collide-tri-result arg0)
(the-as collide-prim-core (-> s5-0 vertex 1))
(-> s5-0 vertex 2)
arg0
(-> s5-0 bsphere)
(-> s5-0 move-dist)
f30-0
(collide-action solid)
)
@ -829,9 +829,9 @@
)
(let ((f0-1 ((method-of-type collide-cache-prim resolve-moving-sphere-sphere)
(the-as collide-cache-prim s4-0)
(the-as collide-tri-result arg0)
(the-as collide-prim-core (-> s5-0 vertex 1))
(-> s5-0 vertex 2)
arg0
(-> s5-0 bsphere)
(-> s5-0 move-dist)
f30-0
(collide-action solid)
)

View File

@ -22,7 +22,7 @@
(set! (-> *edge-grab-info* found-edge?) #f)
(mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320)
(let ((s5-0 *collide-edge-work*))
(set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this)))
(set! (-> s5-0 process) (process->ppointer this))
(set! (-> s5-0 num-verts) (the-as uint 0))
(set! (-> s5-0 num-edges) (the-as uint 0))
(set! (-> s5-0 num-tris) (the-as uint 0))

View File

@ -169,7 +169,7 @@
(set! *actor-list-length* 0)
(if (logtest? s5-0 (collide-spec hit-by-others-list))
(set! *actor-list-length*
(fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> s4-0 prim-core)) *actor-list* 256)
(fill-actor-list-for-box *actor-hash* (the-as vector (-> s4-0 prim-core)) *actor-list* 256)
)
)
(when (logtest? s5-0 (collide-spec player-list))

View File

@ -417,11 +417,11 @@
(vf4 :class vf)
(vf5 :class vf)
)
(let* ((gp-0 (new 'stack-no-clear 'collide-tri-result))
(let* ((gp-0 (new 'stack-no-clear 'collide-query))
(f0-1 (resolve-moving-sphere-tri
arg1
gp-0
(-> this prim-core)
(the-as sphere (-> this prim-core))
(-> arg0 move-dist)
(-> arg0 best-dist)
(-> this prim-core action)
@ -442,13 +442,13 @@
(b! (= v1-5 #f) cfg-5 :likely-delay (set! a2-2 (the-as collide-shape-prim #f)))
(b! (logtest? (-> a0-3 penetrate-using) (-> v1-5 penetrated-by)) cfg-6 :delay (nop!))
(label cfg-5)
(.lvf vf3 (&-> gp-0 vertex 0 quad))
(.lvf vf4 (&-> gp-0 vertex 1 quad))
(.lvf vf5 (&-> gp-0 vertex 2 quad))
(.lvf vf1 (&-> gp-0 intersect quad))
(.lvf vf2 (&-> gp-0 normal quad))
(let ((a0-6 (-> gp-0 pat))
(a1-4 (-> gp-0 collide-ptr))
(.lvf vf3 (&-> gp-0 best-other-tri vertex 0 quad))
(.lvf vf4 (&-> gp-0 best-other-tri vertex 1 quad))
(.lvf vf5 (&-> gp-0 best-other-tri vertex 2 quad))
(.lvf vf1 (&-> gp-0 best-other-tri intersect quad))
(.lvf vf2 (&-> gp-0 best-other-tri normal quad))
(let ((a0-6 (-> gp-0 best-other-tri pat))
(a1-4 (-> gp-0 best-other-tri collide-ptr))
)
(set! (-> arg0 best-dist) f0-1)
(.svf (&-> arg0 best-other-tri vertex 0 quad) vf3)
@ -464,14 +464,7 @@
(label cfg-6)
(b! (not v1-5) cfg-8 :delay (empty-form))
)
(add-touching-prims
*touching-list*
this
a2-2
f0-1
(the-as collide-tri-result #f)
(the-as collide-tri-result (-> gp-0 vertex))
)
(add-touching-prims *touching-list* this a2-2 f0-1 (the-as collide-tri-result #f) (-> gp-0 best-other-tri))
)
)
)
@ -515,11 +508,11 @@
(vf4 :class vf)
(vf5 :class vf)
)
(let* ((gp-0 (new 'stack-no-clear 'collide-tri-result))
(let* ((gp-0 (new 'stack-no-clear 'collide-query))
(f0-1 (resolve-moving-sphere-sphere
arg1
gp-0
(-> this prim-core)
(the-as sphere (-> this prim-core))
(-> arg0 move-dist)
(-> arg0 best-dist)
(-> arg1 prim-core action)
@ -539,13 +532,13 @@
(b! (zero? a1-2) cfg-4 :delay (nop!))
(b! (logtest? (-> v1-4 penetrate-using) (-> a0-4 penetrated-by)) cfg-4 :delay (nop!))
)
(.lvf vf3 (&-> gp-0 vertex 0 quad))
(.lvf vf4 (&-> gp-0 vertex 1 quad))
(.lvf vf5 (&-> gp-0 vertex 2 quad))
(.lvf vf1 (&-> gp-0 intersect quad))
(.lvf vf2 (&-> gp-0 normal quad))
(let ((v1-7 (-> gp-0 pat))
(a0-6 (-> gp-0 collide-ptr))
(.lvf vf3 (&-> gp-0 best-other-tri vertex 0 quad))
(.lvf vf4 (&-> gp-0 best-other-tri vertex 1 quad))
(.lvf vf5 (&-> gp-0 best-other-tri vertex 2 quad))
(.lvf vf1 (&-> gp-0 best-other-tri intersect quad))
(.lvf vf2 (&-> gp-0 best-other-tri normal quad))
(let ((v1-7 (-> gp-0 best-other-tri pat))
(a0-6 (-> gp-0 best-other-tri collide-ptr))
)
(set! (-> arg0 best-dist) f0-1)
(.svf (&-> arg0 best-other-tri vertex 0 quad) vf3)
@ -559,14 +552,7 @@
(set! (-> arg0 best-other-prim) a2-2)
(set! (-> arg0 best-my-prim) this)
(label cfg-4)
(add-touching-prims
*touching-list*
this
a2-2
f0-1
(the-as collide-tri-result #f)
(the-as collide-tri-result (-> gp-0 vertex))
)
(add-touching-prims *touching-list* this a2-2 f0-1 (the-as collide-tri-result #f) (-> gp-0 best-other-tri))
)
)
(label cfg-5)
@ -2386,7 +2372,7 @@
(set! *actor-list-length* 0)
(if (logtest? s4-0 (collide-spec hit-by-others-list))
(set! *actor-list-length*
(fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> this root-prim prim-core)) *actor-list* 256)
(fill-actor-list-for-box *actor-hash* (the-as vector (-> this root-prim prim-core)) *actor-list* 256)
)
)
(when (logtest? s4-0 (collide-spec player-list))
@ -2567,7 +2553,7 @@
(set! *actor-list-length* 0)
(b! (not (logtest? (the-as collide-spec s2-0) 512)) cfg-2 :delay (empty-form))
(set! *actor-list-length*
(fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> s3-0 prim-core)) *actor-list* 256)
(fill-actor-list-for-box *actor-hash* (the-as vector (-> s3-0 prim-core)) *actor-list* 256)
)
(label cfg-2)
(b! (not (logtest? (the-as collide-spec s2-0) 1024)) cfg-11 :delay (empty-form))

View File

@ -106,7 +106,8 @@
(let* ((s2-1 (get-trans (the-as process-focusable s3-0) 3))
(f30-0 (- (vector-vector-distance (-> gp-0 point) s2-1) (-> s2-1 w)))
)
(when (nonzero? (-> s0-0 root-prim prim-core collide-as))
(when (#if PC_PORT (and (nonzero? (-> s0-0 root-prim prim-core collide-as)) (or (not (-> *pc-settings* fix-projectile-focus)) (logtest? (collide-action solid) (-> s0-0 root-prim prim-core action))))
(nonzero? (-> s0-0 root-prim prim-core collide-as)))
(let ((s0-1 (search-info-flag)))
0.0
(set! sv-736 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s2-1 (-> gp-0 point)) 1.0))

View File

@ -1060,15 +1060,15 @@
(set! (-> this pre-open-frame) 35.0)
(set! (-> this lock-frame) 45.0)
(set! (-> this open-frame) 45.0)
(set! (-> this sound-pre-open) (static-sound-spec "airlock-slider" :group 1))
(set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e" :group 1))
(set! (-> this sound-open) (static-sound-spec "airlock-seal" :group 1))
(set! (-> this sound-open-loop) (static-sound-spec "airlock-open" :group 1))
(set! (-> this sound-open-stop) (static-sound-spec "airlock-hit" :group 1))
(set! (-> this sound-close-loop) (static-sound-spec "airlock-open" :group 1))
(set! (-> this sound-close-stop) (static-sound-spec "airlock-hit" :group 1))
(set! (-> this sound-post-close) (static-sound-spec "airlock-slider" :group 1))
(set! (-> this sound-post-close-stop) (static-sound-spec "airlock-slide-e" :group 1))
(set! (-> this sound-pre-open) (static-sound-spec "airlock-slider" :group 0))
(set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e" :group 0))
(set! (-> this sound-open) (static-sound-spec "airlock-seal" :group 0))
(set! (-> this sound-open-loop) (static-sound-spec "airlock-open" :group 0))
(set! (-> this sound-open-stop) (static-sound-spec "airlock-hit" :group 0))
(set! (-> this sound-close-loop) (static-sound-spec "airlock-open" :group 0))
(set! (-> this sound-close-stop) (static-sound-spec "airlock-hit" :group 0))
(set! (-> this sound-post-close) (static-sound-spec "airlock-slider" :group 0))
(set! (-> this sound-post-close-stop) (static-sound-spec "airlock-slide-e" :group 0))
(go (method-of-object this close) #t)
)
@ -1128,16 +1128,16 @@
)
)
(set! (-> this pre-open-speed) 0.9)
(set! (-> this sound-gear) (static-sound-spec "airlock-gear" :group 1))
(set! (-> this sound-pre-open) (static-sound-spec "airlock-slider" :group 1))
(set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e" :group 1))
(set! (-> this sound-lock-loop) (static-sound-spec "airlock-turn" :group 1))
(set! (-> this sound-lock-stop) (static-sound-spec "airlock-unlock" :group 1))
(set! (-> this sound-open) (static-sound-spec "airlock-seal" :group 1))
(set! (-> this sound-open-loop) (static-sound-spec "airlock-open" :group 1))
(set! (-> this sound-open-stop) (static-sound-spec "airlock-hit" :group 1))
(set! (-> this sound-close-loop) (static-sound-spec "airlock-open" :group 1))
(set! (-> this sound-close-stop) (static-sound-spec "airlock-hit" :group 1))
(set! (-> this sound-gear) (static-sound-spec "airlock-gear" :group 0))
(set! (-> this sound-pre-open) (static-sound-spec "airlock-slider" :group 0))
(set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e" :group 0))
(set! (-> this sound-lock-loop) (static-sound-spec "airlock-turn" :group 0))
(set! (-> this sound-lock-stop) (static-sound-spec "airlock-unlock" :group 0))
(set! (-> this sound-open) (static-sound-spec "airlock-seal" :group 0))
(set! (-> this sound-open-loop) (static-sound-spec "airlock-open" :group 0))
(set! (-> this sound-open-stop) (static-sound-spec "airlock-hit" :group 0))
(set! (-> this sound-close-loop) (static-sound-spec "airlock-open" :group 0))
(set! (-> this sound-close-stop) (static-sound-spec "airlock-hit" :group 0))
(go (method-of-object this close) #t)
)
@ -1189,8 +1189,8 @@
(the-as pair 0)
)
(init-airlock! this)
(set! (-> this sound-open) (static-sound-spec "hqdoor-open" :group 1))
(set! (-> this sound-close) (static-sound-spec "hqdoor-close" :group 1))
(set! (-> this sound-open) (static-sound-spec "hqdoor-open" :group 0))
(set! (-> this sound-close) (static-sound-spec "hqdoor-close" :group 0))
(go (method-of-object this close) #t)
)
@ -1242,8 +1242,8 @@
(the-as pair 0)
)
(init-airlock! this)
(set! (-> this sound-open) (static-sound-spec "vindoor-open" :group 1))
(set! (-> this sound-close-loop) (static-sound-spec "vindoor-close" :group 1))
(set! (-> this sound-open) (static-sound-spec "vindoor-open" :group 0))
(set! (-> this sound-close-loop) (static-sound-spec "vindoor-close" :group 0))
(set! (-> this door-radius) 8192.0)
(go (method-of-object this close) #t)
)
@ -1299,15 +1299,15 @@
)
(the-as pair 0)
)
(set! (-> this sound-pre-open) (static-sound-spec "airlock-slider" :group 1))
(set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e" :group 1))
(set! (-> this sound-open) (static-sound-spec "airlock-seal" :group 1))
(set! (-> this sound-open-loop) (static-sound-spec "airlock-open" :group 1))
(set! (-> this sound-open-stop) (static-sound-spec "airlock-hit" :group 1))
(set! (-> this sound-close-loop) (static-sound-spec "airlock-open" :group 1))
(set! (-> this sound-close-stop) (static-sound-spec "airlock-hit" :group 1))
(set! (-> this sound-post-close) (static-sound-spec "airlock-slider" :group 1))
(set! (-> this sound-post-close-stop) (static-sound-spec "airlock-slide-e" :group 1))
(set! (-> this sound-pre-open) (static-sound-spec "airlock-slider" :group 0))
(set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e" :group 0))
(set! (-> this sound-open) (static-sound-spec "airlock-seal" :group 0))
(set! (-> this sound-open-loop) (static-sound-spec "airlock-open" :group 0))
(set! (-> this sound-open-stop) (static-sound-spec "airlock-hit" :group 0))
(set! (-> this sound-close-loop) (static-sound-spec "airlock-open" :group 0))
(set! (-> this sound-close-stop) (static-sound-spec "airlock-hit" :group 0))
(set! (-> this sound-post-close) (static-sound-spec "airlock-slider" :group 0))
(set! (-> this sound-post-close-stop) (static-sound-spec "airlock-slide-e" :group 0))
(go (method-of-object this close) #t)
)
@ -1359,10 +1359,10 @@
(the-as pair 0)
)
(init-airlock! this)
(set! (-> this sound-open-loop) (static-sound-spec "wood-door-open" :group 1))
(set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit" :group 1))
(set! (-> this sound-close-loop) (static-sound-spec "wood-door-close" :group 1))
(set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit" :group 1))
(set! (-> this sound-open-loop) (static-sound-spec "wood-door-open" :group 0))
(set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit" :group 0))
(set! (-> this sound-close-loop) (static-sound-spec "wood-door-close" :group 0))
(set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit" :group 0))
(set! (-> this door-radius) 8192.0)
(go (method-of-object this close) #t)
)

View File

@ -249,25 +249,25 @@
(set! s5-0 (-> *part-group-id-table* 164))
(set! (-> this collect-effect) (-> *part-group-id-table* 170))
(set! (-> this collect-effect2) (-> *part-group-id-table* 165))
(set! s4-0 (static-sound-spec "yel-eco-idle" :group 1 :fo-max 15))
(set! s4-0 (static-sound-spec "yel-eco-idle" :group 0 :fo-max 15))
)
(((pickup-type eco-red))
(set! s5-0 (-> *part-group-id-table* 158))
(set! (-> this collect-effect) (-> *part-group-id-table* 171))
(set! (-> this collect-effect2) (-> *part-group-id-table* 159))
(set! s4-0 (static-sound-spec "red-eco-idle" :group 1 :fo-max 15))
(set! s4-0 (static-sound-spec "red-eco-idle" :group 0 :fo-max 15))
)
(((pickup-type eco-blue))
(set! s5-0 (-> *part-group-id-table* 154))
(set! (-> this collect-effect) (-> *part-group-id-table* 169))
(set! (-> this collect-effect2) (-> *part-group-id-table* 155))
(set! s4-0 (static-sound-spec "blue-eco-idle" :group 1 :fo-max 15))
(set! s4-0 (static-sound-spec "blue-eco-idle" :group 0 :fo-max 15))
)
(((pickup-type eco-green))
(set! s5-0 (-> *part-group-id-table* 129))
(set! (-> this collect-effect) (-> *part-group-id-table* 141))
(set! (-> this collect-effect2) (-> *part-group-id-table* 124))
(set! s4-0 (static-sound-spec "green-eco-idle" :group 1 :fo-max 15))
(set! s4-0 (static-sound-spec "green-eco-idle" :group 0 :fo-max 15))
)
(((pickup-type health))
(initialize-skeleton
@ -281,7 +281,7 @@
)
(set! (-> this collect-effect) (-> *part-group-id-table* 141))
(set! (-> this collect-effect2) (-> *part-group-id-table* 124))
(set! s4-0 (static-sound-spec "green-eco-idle" :group 1 :fo-max 15))
(set! s4-0 (static-sound-spec "green-eco-idle" :group 0 :fo-max 15))
)
(((pickup-type eco-pill-green))
(set! s5-0 (-> *part-group-id-table* 125))

View File

@ -448,7 +448,7 @@
(logclear! (-> self root status) (collide-status on-surface on-ground touch-surface))
(let ((s5-1 2))
(logior! (-> self focus-status) (focus-status in-air))
(until (on-ground? self)
(until (on-ground? self gp-0)
(+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter)))
(jump-anim-handler self s5-1 gp-0)
(in-jump-handler self s5-1 gp-0)

View File

@ -53,7 +53,8 @@
;; DECOMP BEGINS
(deftype manipy (process-drawable)
((root collide-shape :override)
((self manipy :override)
(root collide-shape :override)
(new-trans-hook (function none))
(cur-trans-hook (function none))
(cur-event-hook (function none))

View File

@ -164,12 +164,11 @@
)
(update-anim-data (-> self skel))
(do-joint-math (-> self draw) (-> self node-list) (-> self skel))
;; not-yet-implemented
;; (let ((a0-22 (-> self skel effect)))
;; (if a0-22
;; (effect-control-method-9 a0-22)
;; )
;; )
(let ((a0-22 (-> self skel effect)))
(if a0-22
(effect-control-method-9 a0-22)
)
)
(if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
(merc-blend-shape self)
)
@ -3656,11 +3655,7 @@
(dotimes (s3-0 (-> this actor-group s4-0 length))
(set! sv-32 "#f")
(set! (-> this particle-launchers (-> this particle-launchers length))
(entity-lookup-part-group
(the-as entity-actor (-> this actor-group s4-0 data s3-0 actor))
(& sv-32)
'art-name
)
(entity-lookup-part-group (-> this actor-group s4-0 data s3-0 actor) (& sv-32) 'art-name)
)
(+! (-> this particle-launchers length) 1)
)

View File

@ -11,6 +11,7 @@
:bitfield #t
(pcf0 0)
(pcf1 1)
(pcf2 2)
)
;; ---particle-curve-flags

View File

@ -7,3 +7,391 @@
;; DECOMP BEGINS
(deftype rigid-body-platform-constants (rigid-body-object-constants)
((drag-factor float)
(buoyancy-factor float)
(max-buoyancy-depth meters)
(player-weight meters)
(player-bonk-factor float)
(player-dive-factor float)
(player-force-distance meters)
(player-force-clamp meters)
(player-force-timeout time-frame)
(explosion-force meters)
(control-point-count int32)
(platform symbol)
(sound-name string)
)
)
(deftype rigid-body-control-point (structure)
((local-pos vector :inline)
(world-pos vector :inline)
(velocity vector :inline)
)
)
(deftype rigid-body-control-point-inline-array (inline-array-class)
((data rigid-body-control-point :inline :dynamic)
)
)
(set! (-> rigid-body-control-point-inline-array heap-base) (the-as uint 48))
(deftype rigid-body-platform (rigid-body-object)
((info rigid-body-platform-constants :override)
(control-point-array rigid-body-control-point-inline-array)
(float-height-offset float)
(player-bonk-timeout time-frame)
(water-anim entity-actor)
)
(:methods
(get-lava-height (_type_ vector) float)
(rigid-body-platform-method-57 (_type_ (inline-array vector)) none)
(rigid-body-platform-method-58 (_type_) none)
(rigid-body-platform-method-59 (_type_ vector) none)
)
)
(defmethod relocate ((this rigid-body-platform) (offset int))
(if (nonzero? (-> this control-point-array))
(&+! (-> this control-point-array) offset)
)
(call-parent-method this offset)
)
(defmethod get-lava-height ((this rigid-body-platform) (arg0 vector))
(let ((v1-0 (-> this water-anim)))
0.0
(cond
(v1-0
(let ((a0-1 v1-0))
(if (if a0-1
(-> a0-1 extra process)
)
(-> v1-0 extra trans y)
(-> v1-0 extra trans y)
)
)
)
(else
(get-height *ocean* arg0 #t)
)
)
)
)
(defmethod rigid-body-platform-method-57 ((this rigid-body-platform) (arg0 (inline-array vector)))
(set! (-> arg0 1 w) (+ (get-lava-height this (-> arg0 1)) (-> this float-height-offset)))
(let* ((s4-0 (new 'stack-no-clear 'vector))
(f0-3 (- (-> arg0 1 w) (-> arg0 1 y)))
(f30-0 (/ f0-3 (-> this info max-buoyancy-depth)))
)
(when (< 0.0 f0-3)
(vector-float*!
s4-0
*y-vector*
(* (-> this rbody info mass)
(fmin 1.0 f30-0)
(/ (-> this info extra gravity) (the float (-> this info control-point-count)))
(-> this info buoyancy-factor)
)
)
(apply-impact! (-> this rbody) (-> arg0 1) s4-0)
(vector-float*! s4-0 (-> arg0 2) (* -1.0 (-> this info drag-factor) (fmin 1.0 f30-0)))
(apply-impact! (-> this rbody) (-> arg0 1) s4-0)
)
)
0
0
(none)
)
(defmethod rigid-body-object-method-53 ((this rigid-body-platform) (arg0 float))
(when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force))
(if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))
(logclear! (-> this flags) (rigid-body-object-flag player-impulse-force))
)
(rigid-body-control-method-21
(-> this rbody)
(-> this player-force-position)
(-> this player-force)
(-> this info player-force-distance)
)
)
0
(none)
)
(defmethod rigid-body-platform-method-58 ((this rigid-body-platform))
(let ((a1-0 (new 'stack-no-clear 'vector)))
(vector-float*! a1-0 *y-vector* (* -1.0 (-> this info extra gravity) (-> this rbody info mass)))
(add-force! (-> this rbody) a1-0)
)
0
(none)
)
(defmethod rigid-body-platform-method-59 ((this rigid-body-platform) (arg0 vector))
(let ((v1-0 (new 'stack-no-clear 'vector)))
(vector-! v1-0 arg0 (-> this rbody position))
(set! (-> v1-0 y) 0.0)
(let* ((f0-1 (vector-length v1-0))
(f1-1 (* 10.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-1)))))
)
(when (< 0.0 f1-1)
(vector-float*! v1-0 v1-0 (/ f1-1 f0-1))
(add-force! (-> this rbody) v1-0)
)
)
)
0
(none)
)
(defmethod apply-gravity! ((this rigid-body-platform) (arg0 float))
(let ((s4-0 (-> this rbody matrix)))
(dotimes (s3-0 (-> this info control-point-count))
(let ((s2-0 (-> this control-point-array data s3-0)))
(vector-matrix*! (-> s2-0 world-pos) (-> s2-0 local-pos) s4-0)
(rigid-body-control-method-23 (-> this rbody) (-> s2-0 world-pos) (-> s2-0 velocity))
(rigid-body-platform-method-57 this (the-as (inline-array vector) s2-0))
)
)
)
(rigid-body-platform-method-58 this)
(rigid-body-object-method-53 this arg0)
0
(none)
)
(defmethod rigid-body-object-method-32 ((this rigid-body-platform))
(if (-> this info platform)
(detect-riders! (-> this root))
)
(let ((t9-1 (method-of-type rigid-body-object rigid-body-object-method-32)))
(t9-1 this)
)
(logclear! (-> this flags) (rigid-body-object-flag player-contact-force))
0
(none)
)
(defmethod attack-handler ((this rigid-body-platform)
(arg0 process-drawable)
(arg1 attack-info)
(arg2 touching-shapes-entry)
(arg3 penetrate)
)
((method-of-type rigid-body-object attack-handler) this arg0 arg1 arg2 arg3)
#f
)
(defmethod rbody-event-handler ((this rigid-body-platform) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('edge-grabbed)
(let ((v1-1 (the-as object (-> arg3 param 0))))
(when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)))
(logior! (-> this flags) (rigid-body-object-flag player-contact-force))
(set! (-> this player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad))
(vector-reset! (-> this player-force))
(set! (-> this player-force y) (* -1.0 (-> this info player-weight)))
)
)
)
(('ridden)
(let ((v1-7 (the-as object (-> arg3 param 0))))
(when (the-as uint v1-7)
(let* ((s5-1 (handle->process (-> (the-as collide-rider v1-7) rider-handle)))
(v1-11 (if (type? s5-1 process-focusable)
s5-1
)
)
)
(when (and v1-11
(logtest? (-> v1-11 mask) (process-mask target))
(not (logtest? (-> (the-as process-focusable v1-11) focus-status) (focus-status on-water under-water)))
)
(when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)))
(logior! (-> this flags) (rigid-body-object-flag player-contact-force))
(set! (-> this player-force-position quad) (-> (the-as process-focusable v1-11) root trans quad))
(vector-reset! (-> this player-force))
(let* ((a1-5 (-> this player-force-position))
(f30-0 0.0)
(f28-0 1.0)
(f26-0 1.0)
(f0-4 (+ (- -4096.0 (-> a1-5 y)) (get-lava-height this a1-5)))
(f1-2 12288.0)
(f0-8 (fmax f30-0 (fmin f28-0 (- f26-0 (* f0-4 (/ 1.0 f1-2))))))
)
(set! (-> this player-force y) (* -1.0 (-> this info player-weight) f0-8))
)
)
)
)
)
)
)
(('bonk)
(when (time-elapsed? (-> this player-bonk-timeout) (-> this info player-force-timeout))
(set-time! (-> this player-bonk-timeout))
(let* ((s4-0 arg0)
(v1-31 (if (type? s4-0 process-drawable)
s4-0
)
)
)
(when v1-31
(logior! (-> this flags) (rigid-body-object-flag player-impulse-force))
(set! (-> this player-force-position quad) (-> (the-as process-focusable v1-31) root trans quad))
(let ((f0-14 (fmin
(* 0.00012207031
(the-as float (-> arg3 param 1))
(-> this info player-bonk-factor)
(-> this info player-weight)
)
(-> this info player-force-clamp)
)
)
)
(vector-reset! (-> this player-force))
(set! (-> this player-force y) (- f0-14))
)
)
)
)
)
(else
((method-of-type rigid-body-object rbody-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(defmethod rbody-post ((this rigid-body-platform))
(if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))
(sound-play-by-name (string->sound-name (-> this info sound-name)) (new-sound-id) 1024 0 0 (sound-group) #t)
)
(rigid-body-object-method-32 this)
(quaternion-copy! (-> this root quat) (the-as quaternion (-> this rbody rot)))
(rigid-body-control-method-25 (-> this rbody) (-> this root trans))
(rider-post)
(none)
)
(defmethod alloc-rbody-control! ((this rigid-body-platform) (arg0 rigid-body-object-constants))
(set! (-> this info) (the-as rigid-body-platform-constants arg0))
(set! (-> this rbody) (new 'process 'rigid-body-control this))
(set! (-> this control-point-array)
(new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count))
)
(update-transforms (-> this root))
(init!
(-> this rbody)
(-> this info info)
(-> this root trans)
(-> this root quat)
(the-as (function rigid-body-object float) (method-of-object this apply-gravity!))
)
(set-time! (-> this player-bonk-timeout))
(set! (-> this player-force quad) (-> *null-vector* quad))
(set! (-> this root max-iteration-count) (the-as uint 4))
(set! (-> this max-time-step) (-> arg0 extra max-time-step))
(set! (-> this water-anim) (entity-actor-lookup (-> this entity) 'water-actor 0))
0
(none)
)
(defmethod init-collision! ((this rigid-body-platform))
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum 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-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s4-0 prim-core collide-as) (collide-spec pusher))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list))
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0)
(set! (-> s5-0 total-prims) (the-as uint 1))
(set! (-> s5-0 root-prim) s4-0)
)
(pusher-init s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-15 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
0
(none)
)
(define *rigid-body-platform-constants* (new 'static 'rigid-body-platform-constants
:info (new 'static 'rigid-body-info
:mass 2.0
:inv-mass 0.5
:linear-damping 1.0
:angular-damping 1.0
:bounce-factor 0.5
:friction-factor 0.1
:cm-offset-joint (new 'static 'vector :w 1.0)
:inertial-tensor-box (new 'static 'array meters 3 (meters 4) (meters 4) (meters 4))
)
:extra (new 'static 'rigid-body-object-extra-info
:max-time-step 0.033333335
:gravity (meters 80)
:idle-distance (meters 50)
:attack-force-scale 1.0
)
:name '*rigid-body-platform-constants*
:drag-factor 0.8
:buoyancy-factor 1.5
:max-buoyancy-depth (meters 1.5)
:player-weight (meters 6.6)
:player-bonk-factor 1.0
:player-dive-factor 1.0
:player-force-distance (meters 1000)
:player-force-clamp (meters 1000000)
:player-force-timeout (seconds 0.1)
:explosion-force (meters 1000)
:control-point-count 1
:platform #t
:sound-name #f
)
)
(defmethod init-rbody-control! ((this rigid-body-platform))
(set! (-> this float-height-offset) 0.0)
(alloc-rbody-control! this *rigid-body-platform-constants*)
(let ((s5-0 (-> this info control-point-count)))
(dotimes (s4-0 s5-0)
(let ((s3-0 (-> this control-point-array data s4-0)))
(let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0)))))
(set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0)))
(set! (-> s3-0 local-pos y) -10240.0)
(set! (-> s3-0 local-pos z) (* 12288.0 (cos f30-0)))
)
(set! (-> s3-0 local-pos w) 1.0)
)
)
)
0
(none)
)
;; WARN: Return type mismatch int vs object.
(defmethod init-from-entity! ((this rigid-body-platform) (arg0 entity-actor))
(logior! (-> this mask) (process-mask platform))
(init-collision! this)
(process-drawable-from-entity! this arg0)
(init-rbody-control! this)
(go-idle this)
0
)

View File

@ -18,7 +18,7 @@
(pickup-handle handle)
)
(:methods
(init! (_type_ entity-actor int) object)
(init! (_type_ entity-actor pickup-type) object)
)
(:states
vent-blocked
@ -28,7 +28,7 @@
)
(defmethod init! ((this vent) (arg0 entity-actor) (arg1 int))
(defmethod init! ((this vent) (arg0 entity-actor) (arg1 pickup-type))
(stack-size-set! (-> this main-thread) 128)
(logior! (-> this mask) (process-mask actor-pause))
(let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
@ -49,7 +49,7 @@
(set! (-> this root trans quad) (-> arg0 extra trans quad))
(update-transforms (-> this root))
(set! (-> this root pause-adjust-distance) 409600.0)
(set! (-> this fact) (new 'process 'fact-info this (the-as pickup-type arg1) (-> *FACT-bank* eco-full-inc)))
(set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc)))
(set! (-> this block-func) (the-as (function vent symbol) true-func))
(case (-> this fact pickup-type)
(((pickup-type eco-blue))
@ -265,7 +265,7 @@
(defmethod init-from-entity! ((this ecovent) (arg0 entity-actor))
(init! this arg0 5)
(init! this arg0 (pickup-type eco-green))
)
(deftype light-eco-vent (process-drawable)

View File

@ -745,7 +745,7 @@
(set! (-> this center quad) (-> this root trans quad))
(+! (-> this center y) 13516.8)
(set! (-> this sound)
(new 'process 'ambient-sound (static-sound-spec "warpgate" :group 1 :fo-max 30) (-> this root trans) 0.0)
(new 'process 'ambient-sound (static-sound-spec "warpgate" :group 0 :fo-max 30) (-> this root trans) 0.0)
)
(set! (-> this distance) (res-lump-float (-> this entity) 'distance :default 20480.0))
(none)

View File

@ -309,9 +309,7 @@
(init-vf0-vector)
(set! *actor-list-length* 0)
(if #t
(set! *actor-list-length*
(fill-actor-list-for-box *actor-hash* (the-as bounding-box (-> this collide-bounds)) *actor-list* 256)
)
(set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> this collide-bounds) *actor-list* 256))
)
(when #t
(let ((a0-2 (-> *collide-player-list* alive-list next0)))

View File

@ -936,14 +936,24 @@
(defun collision-edit ((arg0 process))
(stop-collision-edit)
(when (not arg0)
(let ((v1-2 (process-spawn collision-editor-edited-proc :name "collision-editor-edited-proc")))
(set! arg0 (if v1-2
(the-as process (-> v1-2 0 self))
)
(let ((gp-1 (get-process *default-dead-pool* collision-editor-edited-proc #x4000 1)))
(set! arg0 (ppointer->process (when gp-1
(let ((t9-2 (method-of-type collision-editor-edited-proc activate)))
(t9-2
(the-as collision-editor-edited-proc gp-1)
*default-pool*
"collision-editor-edited-proc"
(the-as pointer #x70004000)
)
)
(run-now-in-process gp-1 collision-editor-edited-proc-init-by-other)
(-> gp-1 ppointer)
)
)
)
)
)
(let ((gp-2 (process->handle (the-as process-tree arg0))))
(let ((gp-2 (process->handle arg0)))
(process-spawn collision-editor gp-2 :name "collision-editor")
)
)

View File

@ -493,7 +493,8 @@
(set! (-> *debug-text-3d-trk* allocated-length) 512)
(dotimes (gp-0 (-> *debug-text-3d-trk* allocated-length))
(set! (-> *debug-text-3ds* gp-0 str) (new 'debug 'string 80 (the-as string #f)))
;; og:preserve-this allocate larger strings for 3d text
(set! (-> *debug-text-3ds* gp-0 str) (new 'debug 'string (#if PC_BIG_MEMORY 255 80) (the-as string #f)))
)
)

View File

@ -67,7 +67,8 @@
(set! (-> gp-0 joypad-func) #f)
(set! (-> gp-0 joypad-item) #f)
(set! (-> gp-0 font)
(new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning))
;; og:preserve-this pc flag
(new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning pc-hack))
)
(set! (-> gp-0 joypad-number) 0)
gp-0
@ -935,11 +936,12 @@
(with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf))
(bucket-id debug-menu)
)
;; og:preserve-this fixed for widescreen
(draw-sprite2d-xy
s0-0
arg1
(correct-x-int arg1)
arg2
(-> arg0 pix-width)
(correct-x-int (-> arg0 pix-width))
(-> arg0 pix-height)
(new 'static 'rgba :a #x40)
#x3fffff

View File

@ -1190,7 +1190,10 @@
(cond
((>= (-> arg1 force-lod) 0)
(set! s4-1 (-> arg1 force-lod))
(if (< (-> arg1 lod-set lod (-> arg1 lod-set max-lod) dist) f30-0)
;; og:preserve-this force high lods
(if (#if (not PC_PORT)
(< (-> arg1 lod-set lod (-> arg1 lod-set max-lod) dist) f30-0)
(and (-> *pc-settings* ps2-lod-dist?) (< (-> arg1 lod-set lod (-> arg1 lod-set max-lod) dist) f30-0)))
(return #f)
)
)
@ -1201,7 +1204,19 @@
)
)
)
(if (and (< (-> arg1 lod-set lod s4-1 dist) f30-0) (< (-> arg1 force-lod) 0))
;; og:preserve-this lod hacks!
(with-pc
(when (not (-> *pc-settings* ps2-lod-dist?))
(set! s4-1 (minmax (-> *pc-settings* lod-force-actor) 0 (-> arg1 lod-set max-lod)))
(when (> (-> arg1 force-lod) -1)
(set! s4-1 (-> arg1 force-lod))
)
)
)
(if (#if (not PC_PORT)
(and (< (-> arg1 lod-set lod s4-1 dist) f30-0) (< (-> arg1 force-lod) 0))
(and (-> *pc-settings* ps2-lod-dist?) (< (-> arg1 lod-set lod s4-1 dist) f30-0) (< (-> arg1 force-lod) 0))
)
(return #f)
)
(let ((v1-49 (-> *level* level (-> arg1 level-index)))
@ -1246,8 +1261,16 @@
(return #f)
)
(set! (-> pp clock) (-> sv-16 clock))
(if (or (= s4-1 (-> arg1 cur-lod)) (logtest? (-> arg1 status) (draw-control-status lod-set)))
(foreground-draw arg1 arg3 f30-0)
;; og:preserve-this PC port note: we ALWAYS disable the envmap hack when a process-drawable has warp effect enabled
(when (or (= s4-1 (-> arg1 cur-lod)) (logtest? (-> arg1 status) (draw-control-status lod-set)))
(protect ((-> *pc-settings* force-envmap?))
(when (not (movie?))
(dotimes (eff-i (-> arg1 mgeo header effect-count))
(if (and (zero? (logand (ash 1 eff-i) (-> arg1 effect-mask)))
(logtest? (effect-bits cross-fade) (-> arg1 mgeo effect eff-i effect-bits)))
(false! (-> *pc-settings* force-envmap?)))))
(foreground-draw arg1 arg3 f30-0)
)
)
)
(when (and (< s4-1 (-> arg1 cur-lod)) (logtest? (-> arg1 status) (draw-control-status math-skel)))
@ -1431,7 +1454,7 @@
(let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf)))
(bones-init gp-0)
(bones-mtx-calc-execute)
;; (generic-merc-execute-all gp-0)
(generic-merc-execute-all gp-0)
;; (shadow-execute-all gp-0)
)
(lightning-draw-all)
@ -1524,19 +1547,19 @@
; ;; draw ocean
; (let ((gp-5 (-> 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))
; )
; (with-profiler 'ocean *profile-ocean-color*
; (draw! *ocean*)
; (if *ocean-map*
; (update-map *ocean*)
; )
; )
; (set! (-> pp clock) gp-5)
; )
(let ((gp-5 (-> 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))
)
(with-profiler 'ocean *profile-ocean-color*
(draw! *ocean*)
(if *ocean-map*
(update-map *ocean*)
)
)
(set! (-> pp clock) gp-5)
)
;; draw foreground
(foreground-engine-execute *foreground-draw-engine*)
@ -2153,10 +2176,12 @@
(set! s3-0 (the uint (+ #x10000 s3-0)))
)
;; track previous frame's run time. This is used to disable some extra effects if the game
;; is close to lagging. We disable this.
; (set! (-> arg0 frames s4-0 run-time) s3-0)
(set! (-> arg0 frames s4-0 run-time) 0)
;; store the amount of ticks that the frame took.
;; og:preserve-this
;; PC PORT NOTE : the originaly game reads this field in places to check if frames are taking too long and avoid doing potentially laggy things.
;; those numbers are hardcoded for 60fps, they would be a pain to adjust, and the effects in the pc port are negligible.
;; so, we just pretend frames rendered in planck time.
(set! (-> arg0 frames s4-0 run-time) (#if PC_PORT 0 (the int s3-0)))
;; disable their vsync logic:
; (set! f30-1 (cond

View File

@ -176,7 +176,7 @@ that gets accessed by the accompanying process."
)
(deftype actor-reference (structure)
((actor entity)
((actor entity-actor)
(id uint32)
)
:pack-me

View File

@ -20,12 +20,12 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref bubbles-path :method-count 0)
:ptype (type-ref bubbles-path :method-count 22)
:pool '*16k-dead-pool*
:heap-size #x8000
)
(new 'static 'entity-info
:ptype (type-ref desert-chase-ring :method-count 0)
:ptype (type-ref desert-chase-ring :method-count 24)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@ -50,7 +50,7 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref tpl-bouncer :method-count 0)
:ptype (type-ref tpl-bouncer :method-count 28)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@ -70,7 +70,7 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref kleever-catch-lizards :method-count 0)
:ptype (type-ref kleever-catch-lizards :method-count 21)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@ -85,12 +85,12 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref nav-graph :method-count 0)
:ptype (type-ref nav-graph :method-count 45)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref tizard :method-count 0)
:ptype (type-ref tizard :method-count 36)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@ -100,7 +100,7 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mh-centipede :method-count 0)
:ptype (type-ref mh-centipede :method-count 43)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@ -110,22 +110,22 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref curve-bubbles-Shape :method-count 0)
:ptype (type-ref curve-bubbles-Shape :method-count 15)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-tower-door :method-count 0)
:ptype (type-ref mhcity-tower-door :method-count 21)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-grunt-egg-d :method-count 0)
:ptype (type-ref mhcity-grunt-egg-d :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-grunt-egg-c :method-count 0)
:ptype (type-ref mhcity-grunt-egg-c :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@ -135,67 +135,67 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-grunt-egg-b :method-count 0)
:ptype (type-ref mhcity-grunt-egg-b :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-grund-egg-a :method-count 0)
:ptype (type-ref mhcity-grund-egg-a :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-de-tower-undervines :method-count 0)
:ptype (type-ref mhcity-de-tower-undervines :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-vine-wriggler-big :method-count 0)
:ptype (type-ref mhcity-vine-wriggler-big :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-vine-wriggler :method-count 0)
:ptype (type-ref mhcity-vine-wriggler :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-twitch-blade :method-count 0)
:ptype (type-ref mhcity-twitch-blade :method-count 21)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-claw-finger-small :method-count 0)
:ptype (type-ref mhcity-claw-finger-small :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-vein-writhing-small :method-count 0)
:ptype (type-ref mhcity-vein-writhing-small :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-vein-writhing-large :method-count 0)
:ptype (type-ref mhcity-vein-writhing-large :method-count 32)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-dark-eco-nodule :method-count 0)
:ptype (type-ref mhcity-dark-eco-nodule :method-count 22)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-dark-eco-door :method-count 0)
:ptype (type-ref mhcity-dark-eco-door :method-count 33)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-puffer-large :method-count 0)
:ptype (type-ref mhcity-puffer-large :method-count 35)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref mhcity-puffer :method-count 0)
:ptype (type-ref mhcity-puffer :method-count 35)
:pool '*16k-dead-pool*
:heap-size #x4000
)

View File

@ -492,6 +492,25 @@
(-> arg0 level task-mask)
)
(defmethod inspect ((this entity))
(call-parent-method this)
(format #t "~Ttrans: ~`vector`P~%" (-> this trans))
(format #t "~Taid: ~A~%" (-> this aid))
this
)
(defmethod inspect ((this entity-actor))
(call-parent-method this)
(format #t "~Tetype: ~A~%" (-> this etype))
(format #t "~Ttask: ~d~%" (-> this task))
(format #t "~Tkill-mask: #x~X : (" (-> this kill-mask))
(bit-enum->string task-mask (-> this kill-mask) #t)
(format #t ")~%")
(format #t "~Tvis-id: ~d~%" (-> this vis-id))
(format #t "~Tquat: ~`vector`P~%" (-> this quat))
this
)
(defmethod print ((this process))
(cond
((and (-> this top-thread) (!= (-> this status) 'dead))
@ -1714,7 +1733,7 @@
(set! sv-16 0)
(while (< sv-16 (-> s0-0 length))
(if (not (-> s0-0 data sv-16 actor))
(set! (-> s0-0 data sv-16 actor) (entity-by-aid (-> s0-0 data sv-16 id)))
(set! (-> s0-0 data sv-16 actor) (the-as entity-actor (entity-by-aid (-> s0-0 data sv-16 id))))
)
(set! sv-16 (+ sv-16 1))
)

View File

@ -190,6 +190,30 @@ This is updated from the entity system used in Crash 2, which had most of these
(the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size)))
)
(defmethod inspect ((this res-lump))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Textra: ~A~%" (-> this extra))
(format #t "~Tallocated-length: ~D~%" (-> this allocated-length))
(format #t "~Tlength: ~D~%" (-> this length))
(format #t "~Tdata-base: #x~X~%" (-> this data-base))
(format #t "~Tdata-top: #x~X~%" (-> this data-top))
(format #t "~Tdata-size: #x~X~%" (-> this data-size))
(format #t "~Ttag[~D]: @ #x~X~%" (-> this allocated-length) (-> this tag))
(dotimes (i (-> this length))
(format #t "~T [~D] " i)
(print (-> (-> this tag) i))
(format #t " @ #x~X" (get-tag-index-data this i))
(cond
((res-ref? (-> this tag i))
(format #t " = ~A~%" (deref basic (get-tag-index-data this i)))
)
(else
(format #t "~%")
)
)
)
this
)
;; WARN: Return type mismatch int vs res-tag-pair.
(defmethod lookup-tag-idx ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float))

View File

@ -255,25 +255,28 @@
)
(defmethod play-effects-from-res-lump ((this effect-control) (arg0 float) (arg1 float) (arg2 float))
(let ((s2-0 (-> this name)))
(while (= (-> s2-0 0 name) 'effect-name)
(let ((f0-0 (-> s2-0 0 key-frame)))
(when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2))
(let* ((a0-1 this)
(t9-0 (method-of-object a0-1 do-effect))
(v1-7 (-> this res))
(a1-1 (-> s2-0 0))
)
(t9-0
a0-1
(the-as string (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset)))))
f0-0
-1
;; og:preserve-this added check
(when (-> this name)
(let ((s2-0 (-> this name)))
(while (= (-> s2-0 0 name) 'effect-name)
(let ((f0-0 (-> s2-0 0 key-frame)))
(when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2))
(let* ((a0-1 this)
(t9-0 (method-of-object a0-1 do-effect))
(v1-7 (-> this res))
(a1-1 (-> s2-0 0))
)
(t9-0
a0-1
(the-as string (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset)))))
f0-0
-1
)
)
)
)
(set! s2-0 (&-> s2-0 1))
)
(set! s2-0 (&-> s2-0 1))
)
)
0
@ -302,18 +305,19 @@
(return #f)
)
((string= s3-0 "script")
(let ((gp-1 (get-property-struct
(-> this res)
'effect-script
'exact
arg1
(the-as structure #f)
(the-as (pointer res-tag) #f)
*res-static-buf*
)
(let ((gp-1 (the-as pair (get-property-struct
(-> this res)
'effect-script
'exact
arg1
(the-as structure #f)
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
)
(script-eval (the-as pair gp-1))
(script-eval gp-1)
)
(return #f)
)

View File

@ -112,7 +112,9 @@
This handles drawing, collision, animation, navigation, particles, sounds, physics, etc.
The actual child classes will add most of the functionality, and this just serves as a common
container for references to the `-control` objects for this object."
((root trsqv)
((self process-drawable :override)
(ppointer (pointer process-drawable) :override)
(root trsqv)
(node-list cspace-array)
(draw draw-control)
(skel joint-control)

View File

@ -2998,6 +2998,8 @@
(else
(case *kernel-boot-message*
(('play 'preview)
(#when PC_PORT
(pc-settings-save))
(auto-save-command 'auto-save 0 0 *default-pool* #f)
)
)

View File

@ -95,40 +95,40 @@
;; +++main-h:bot-marks-controls
(defenum bot-marks-controls
:type int64
; (all-off 0)
; (course-spots 1)
; (task-spots 2)
; (all-on 3)
; (bmc04 4)
; (bmc05 5)
; (bmc06 6)
; (bmc07 7)
; (bmc08 8)
; (bmc09 9)
; (bmc10 10)
; (bmc11 11)
; (bmc12 12)
; (bmc13 13)
; (bmc14 14)
; (bmc15 15)
; (bmc16 16)
(all-off 0)
(course-spots 1)
(task-spots 2)
(all-on 3)
(bmc04 4)
(bmc05 5)
(bmc06 6)
(bmc07 7)
(bmc08 8)
(bmc09 9)
(bmc10 10)
(bmc11 11)
(bmc12 12)
(bmc13 13)
(bmc14 14)
(bmc15 15)
(bmc16 16)
)
;; ---main-h:bot-marks-controls
;; +++main-h:race-marks-controls
(defenum race-marks-controls
:type int64
; (all-off 0)
; (path0-red 1)
; (path1-green 2)
; (path2-blue 4)
; (path3-yellow 8)
; (path4-cyan 16)
; (path5-violet 32)
; (path6-orange 64)
; (path7-black 128)
; (all-paths-on 255)
; (rmc2040 2040)
(all-off 0)
(path0-red 1)
(path1-green 2)
(path2-blue 4)
(path3-yellow 8)
(path4-cyan 16)
(path5-violet 32)
(path6-orange 64)
(path7-black 128)
(all-paths-on 255)
(rmc2040 2040)
)
;; ---main-h:race-marks-controls

View File

@ -25,18 +25,43 @@
(defun letterbox ((arg0 bucket-id) (arg1 float))
"Draw letterbox"
(with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
arg0
)
(draw-sprite2d-xy-absolute s4-0 0 0 512 (the int (* 46.0 arg1)) (new 'static 'rgba :a #x80) #x3fffff)
(draw-sprite2d-xy-absolute
s4-0
0
(- 416 (the int (* 46.0 arg1)))
512
(+ (the int (* 46.0 arg1)) 1)
(new 'static 'rgba :a #x80)
#x3fffff
(with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf))
arg0)
(#cond
((not PC_PORT)
(draw-sprite2d-xy-absolute dma-buf 0 0 512 (the int (* 46.0 arg1)) (new 'static 'rgba :a #x80) #x3fffff)
(draw-sprite2d-xy-absolute dma-buf 0 (- 416 (the int (* 46.0 arg1))) 512 (+ (the int (* 46.0 arg1)) 1) (new 'static 'rgba :a #x80) #x3fffff)
)
(#t
(if (-> *pc-settings* use-vis?)
;; original game mode. dont do anything.
(begin
(draw-sprite2d-xy-absolute dma-buf 0 0 512 (the int (* 46.0 arg1)) (new 'static 'rgba :a #x80) #x3fffff)
(draw-sprite2d-xy-absolute dma-buf 0 (- 416 (the int (* 46.0 arg1))) 512 (+ (the int (* 46.0 arg1)) 1) (new 'static 'rgba :a #x80) #x3fffff))
;; native mode. force 16x9 letterboxing always.
(begin
(cond
((< (-> *pc-settings* aspect-ratio) ASPECT_16X9)
;; too tall. needs vertical letterboxing.
(let ((lbx-h (the int (* 208.0 (- 1.0 (/ (-> *pc-settings* aspect-ratio) ASPECT_16X9))))))
(set! lbx-h (the int (* arg1 lbx-h)))
;(format 0 "using new letterbox! size: ~D~%" lbx-h)
(draw-sprite2d-xy dma-buf 0 0 512 lbx-h (new 'static 'rgba :a #x80) #x3fffff)
(draw-sprite2d-xy dma-buf 0 (- 416 lbx-h) 512 lbx-h (new 'static 'rgba :a #x80) #x3fffff)
)
)
((> (-> *pc-settings* aspect-ratio) ASPECT_16X9)
;; too wide. needs horizontal letterboxing.
(let ((lbx-w (the int (* 256.0 (- 1.0 (/ ASPECT_16X9 (-> *pc-settings* aspect-ratio)))))))
;(format 0 "using new pillarbox! size: ~D~%" lbx-w)
(draw-sprite2d-xy dma-buf 0 0 lbx-w 416 (new 'static 'rgba :a #x80) #x3fffff)
(draw-sprite2d-xy dma-buf (- 512 lbx-w) 0 lbx-w 416 (new 'static 'rgba :a #x80) #x3fffff)
)
)
)
)
)
)
)
)
0
@ -1665,7 +1690,7 @@
;; run the pc port hooks and code
(#when PC_PORT
(update *pc-settings*)
(if (and *display-sha* *debug-segment*)
(if (and *display-sha* *debug-segment* (not-screen-shot?))
(draw-build-revision)))
)
)

View File

@ -47,10 +47,12 @@
(define-extern *editable* (pointer editable-player))
;; temporarily forward declared as symbols
(declare-type mission-squad-control basic)
(declare-type cty-attack-controller mission-squad-control)
(define-extern *cty-faction-manager* symbol)
(define-extern *cty-attack-controller* symbol)
(define-extern *cty-attack-controller* cty-attack-controller)
(set! *cty-faction-manager* #f)
(set! *cty-attack-controller* #f)
(set! *cty-attack-controller* (the cty-attack-controller #f))
(define-extern cty-attack-reset (function symbol symbol symbol none))
(define-extern setup-city-task-faction (function object))
@ -73,6 +75,7 @@
(declare-type task-manager process)
(declare-type game-task-node-info basic)
(declare-type traffic-engine basic)
(define-extern task-manager-init-by-other (function game-task-node-info symbol object :behavior task-manager))
;; DECOMP BEGINS
@ -1538,4 +1541,4 @@
)
(define *traffic-engine* #f)
(define *traffic-engine* (the-as traffic-engine #f))

View File

@ -147,21 +147,18 @@
(set! (-> *game-info* dark-crystal) 0.0)
)
)
;; og:preserve-this not-yet-implemented check
(if (nonzero? *minimap*)
(let ((s5-0 (-> *minimap* engine alive-list)))
(while s5-0
(let ((s4-0 s5-0))
(if (and (logtest? (-> s4-0 flags) (minimap-flag task-graph))
(or (not (game-task-node-info-method-12 (-> *game-info* sub-task-list (-> s4-0 node))))
(not (minimap-class-node-method-9 (-> s4-0 class)))
)
)
(logior! (-> s4-0 flags) (minimap-flag fade-out))
)
)
(set! s5-0 (-> s5-0 next))
(let ((s5-0 (-> *minimap* engine alive-list)))
(while s5-0
(let ((s4-0 s5-0))
(if (and (logtest? (-> s4-0 flags) (minimap-flag task-graph))
(or (not (game-task-node-info-method-12 (-> *game-info* sub-task-list (-> s4-0 node))))
(not (minimap-class-node-method-9 (-> s4-0 class)))
)
)
(logior! (-> s4-0 flags) (minimap-flag fade-out))
)
)
(set! s5-0 (-> s5-0 next))
)
)
(let ((v1-43 (-> *game-info* task-node-exclusive)))
@ -271,34 +268,31 @@
(set! sv-176 (-> s1-0 when-open s0-0))
(case (-> sv-176 actor)
(((game-task-actor minimap))
;; og:preserve-this not-yet-implemented check
(when (and (nonzero? *minimap*) (nonzero? *minimap-class-list*))
(if (not (minimap-class-node-method-9 (-> *minimap-class-list* (-> sv-176 icon))))
(goto cfg-75)
)
(let ((v1-89 (add-icon! *minimap* *dproc* (-> sv-176 icon) (the-as int (-> sv-176 icon)) (the-as vector #f) s2-0)))
(when v1-89
(logior! (-> v1-89 flags) (minimap-flag task-graph))
(cond
((and (logtest? (minimap-flag ctywide) (-> v1-89 class flags))
(logtest? (minimap-flag transport) (-> v1-89 class flags))
)
(let ((v1-91 (add-icon! *minimap* *dproc* (the-as uint 21) 21 (the-as vector #f) s2-0)))
(if v1-91
(logior! (-> v1-91 flags) (minimap-flag task-graph))
)
(if (not (minimap-class-node-method-9 (-> *minimap-class-list* (-> sv-176 icon))))
(goto cfg-75)
)
(let ((v1-89 (add-icon! *minimap* *dproc* (-> sv-176 icon) (the-as int (-> sv-176 icon)) (the-as vector #f) s2-0)))
(when v1-89
(logior! (-> v1-89 flags) (minimap-flag task-graph))
(cond
((and (logtest? (minimap-flag ctywide) (-> v1-89 class flags))
(logtest? (minimap-flag transport) (-> v1-89 class flags))
)
)
((and (logtest? (minimap-flag wasall waswide desert) (-> v1-89 class flags))
(logtest? (minimap-flag transport) (-> v1-89 class flags))
)
(let ((v1-96 (add-icon! *minimap* *dproc* (the-as uint 18) 18 (the-as vector #f) s2-0)))
(if v1-96
(logior! (-> v1-96 flags) (minimap-flag task-graph))
)
(let ((v1-91 (add-icon! *minimap* *dproc* (the-as uint 21) 21 (the-as vector #f) s2-0)))
(if v1-91
(logior! (-> v1-91 flags) (minimap-flag task-graph))
)
)
)
((and (logtest? (minimap-flag wasall waswide desert) (-> v1-89 class flags))
(logtest? (minimap-flag transport) (-> v1-89 class flags))
)
)
)
(let ((v1-96 (add-icon! *minimap* *dproc* (the-as uint 18) 18 (the-as vector #f) s2-0)))
(if v1-96
(logior! (-> v1-96 flags) (minimap-flag task-graph))
)
)
)
)
)
)
@ -2864,7 +2858,7 @@
)
(defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol))
(stack-size-set! (-> self main-thread) 1024)
(stack-size-set! (-> self main-thread) 2048)
(add-connection *task-manager-engine* self nothing self arg0 #f)
(set! (-> self node-info) arg0)
(set! (-> self lev-name) arg1)

View File

@ -20,6 +20,10 @@
;; ERROR: Failed load: (set! a2-4 (l.wu (+ a2-3 2224))) at op 19
(defun draw-string ((arg0 string) (arg1 dma-buffer) (arg2 font-context))
(local-vars (v0-2 uint))
(#when PC_PORT
;; debug font scaling.
(unless (logtest? (-> arg2 flags) (font-flags large pc-hack))
(*! (-> arg2 scale) (get-debug-font-scale-factor))))
(let ((v1-1 (the int (* 128.0 (-> arg2 alpha)))))
(-> arg2 origin quad)
(dotimes (a0-2 45)
@ -42,7 +46,23 @@
(the-as draw-string-result v0-2)
)
(def-mips2c get-string-length (function string font-context draw-string-result))
; (def-mips2c get-string-length (function string font-context draw-string-result))
(def-mips2c get-string-length-asm (function string font-context draw-string-result))
(#when PC_PORT
;; og:preserve-this get-string-length is an asm function, but for PC port we use a trampoline in order to inject hacks more easily
(defun get-string-length ((text string) (ctx font-context))
"return the length of a string, in gs framebuffer units"
(let ((orig-scale (-> ctx scale))
(result (begin (#when PC_PORT ;; debug font scaling.
(unless (logtest? (-> ctx flags) (font-flags large pc-hack))
(*! (-> ctx scale) (get-debug-font-scale-factor))))
(get-string-length-asm text ctx))))
(set! (-> ctx scale) orig-scale)
result)
)
)
(defun draw-string-xy ((arg0 string) (arg1 dma-buffer) (arg2 int) (arg3 int) (arg4 font-color) (arg5 font-flags))
(let ((s4-0 (new 'stack 'font-context *font-default-matrix* arg2 arg3 0.0 arg4 arg5)))

View File

@ -11,3 +11,187 @@
;; DECOMP BEGINS
(deftype ripple-request (structure)
((waveform ripple-wave)
(effect merc-effect)
)
:pack-me
)
(deftype ripple-globals (structure)
((count int32)
(requests ripple-request 16 :inline)
)
)
(define *ripple-globals* (new 'global 'ripple-globals))
(defun ripple-make-request ((arg0 ripple-wave) (arg1 merc-effect))
(let ((v1-1 (-> *ripple-globals* count))
(a2-1 (-> *ripple-globals* requests))
(a3-0 0)
)
(when (< v1-1 16)
(dotimes (t0-1 v1-1)
(if (= arg1 (-> a2-1 t0-1 effect))
(set! a3-0 1)
)
)
(when (zero? a3-0)
(set! (-> a2-1 v1-1 effect) arg1)
(set! (-> a2-1 v1-1 waveform) arg0)
(+! (-> *ripple-globals* count) 1)
)
)
)
0
(none)
)
(defun ripple-update-waveform-offs ((arg0 ripple-wave-set) (arg1 clock))
(let ((f0-1 (the float (- (-> arg1 integral-frame-counter) (the-as int (-> arg0 frame-save))))))
(when (!= f0-1 0.0)
(dotimes (v1-3 (-> arg0 count))
(let ((a2-4 (-> arg0 wave v1-3)))
(+! (-> a2-4 offs) (* f0-1 (-> a2-4 delta)))
(set! (-> a2-4 offs) (the float (logand (the int (-> a2-4 offs)) #xffff)))
)
)
(set! (-> arg0 frame-save) (the-as uint (-> arg1 integral-frame-counter)))
)
)
0
(none)
)
(def-mips2c ripple-execute-init (function none))
(def-mips2c ripple-create-wave-table (function ripple-wave-set int))
(def-mips2c ripple-apply-wave-table (function merc-effect symbol))
(defun ripple-execute ()
(when (-> *ripple-globals* count)
(ripple-execute-init)
(let ((gp-0 0)
(s5-0 (-> *ripple-globals* count))
(s4-0 (-> *ripple-globals* requests))
)
(while (!= gp-0 s5-0)
(when (-> s4-0 gp-0 waveform)
(let ((s3-0 gp-0)
(s2-0 (-> s4-0 gp-0 waveform))
)
(ripple-create-wave-table (the-as ripple-wave-set s2-0))
(while (!= s3-0 s5-0)
(when (= s2-0 (-> s4-0 s3-0 waveform))
(ripple-apply-wave-table (-> s4-0 s3-0 effect))
(set! (-> s4-0 s3-0 waveform) #f)
)
(+! s3-0 1)
)
)
)
(+! gp-0 1)
)
)
(set! (-> *ripple-globals* count) 0)
0
)
0
(none)
)
(def-mips2c ripple-matrix-scale (function merc-effect none))
;; WARN: Return type mismatch symbol vs none.
(defun-debug ripple-add-debug-sphere ((arg0 process-drawable) (arg1 vector) (arg2 float) (arg3 float))
(let ((f30-0 (- (quaternion-y-angle (-> arg0 root quat))))
(s5-0 (new-stack-vector0))
)
(let ((f28-0 (+ (-> arg1 x) (* arg2 (-> arg1 z))))
(f26-0 (+ (-> arg1 y) (* arg3 (-> arg1 z))))
)
(set! (-> s5-0 x) (- (* f28-0 (cos f30-0)) (* f26-0 (sin f30-0))))
(set! (-> s5-0 y) 0.0)
(set! (-> s5-0 z) (+ (* f26-0 (cos f30-0)) (* f28-0 (sin f30-0))))
)
(set! (-> s5-0 w) 0.0)
(vector+! s5-0 s5-0 (-> arg0 root trans))
(add-debug-sphere #t (bucket-id debug) s5-0 (meters 0.5) (new 'static 'rgba :r #xff :g #xff :a #x80))
)
(none)
)
(defun ripple-slow-add-sine-waves ((arg0 ripple-wave-set) (arg1 float) (arg2 float))
(let ((f30-0 0.0))
(dotimes (s3-0 (-> arg0 count))
(let* ((v1-3 (-> arg0 wave s3-0))
(f0-2 (+ (-> v1-3 offs) (* arg1 (-> v1-3 xmul)) (* arg2 (-> v1-3 zmul))))
)
(+! f30-0 (* (-> v1-3 scale) (cos f0-2)))
)
)
(fmax -127.0 (fmin 127.0 f30-0))
)
)
(defun ripple-find-height ((arg0 process-drawable) (arg1 int) (arg2 vector))
(local-vars (sv-16 draw-control) (sv-32 float) (sv-48 float))
(let ((f30-0 (-> arg0 root trans y)))
(set! sv-16 (-> arg0 draw))
(if (or (zero? sv-16) (not (-> sv-16 ripple)))
(return f30-0)
)
(let ((v1-11 (-> sv-16 lod-set lod (-> sv-16 cur-lod) geo effect)))
(if (not (logtest? (-> v1-11 0 effect-bits) (effect-bits ripple)))
(return f30-0)
)
(let* ((v1-12 (-> v1-11 0 extra-info))
(s4-0 (the-as mei-ripple (+ (the-as uint v1-12) (* (-> v1-12 ripple-offset) 16))))
(gp-0 (-> sv-16 ripple))
(s5-0 (-> gp-0 waveform))
)
(if (not (-> gp-0 waveform))
(return f30-0)
)
(if (not (-> s5-0 converted))
(return f30-0)
)
(let* ((f28-0 (- (-> arg2 x) (-> arg0 root trans x)))
(f26-0 (- (-> arg2 z) (-> arg0 root trans z)))
(f22-0 (+ (quaternion-y-angle (-> arg0 root quat)) (-> s4-0 angle)))
(f24-0 (cos f22-0))
(f1-3 (sin f22-0))
(f0-4 (- (* f28-0 f24-0) (* f26-0 f1-3)))
(f1-5 (+ (* f26-0 f24-0) (* f28-0 f1-3)))
(f2-3 (/ 1.0 (-> s4-0 grid-size)))
(f28-1 (* f2-3 (- f0-4 (-> s4-0 x-base))))
(f26-1 (* f2-3 (- f1-5 (-> s4-0 z-base))))
)
(ripple-update-waveform-offs s5-0 (-> *display* bg-clock))
(let* ((f22-1 (the float (the int f28-1)))
(f24-1 (the float (the int f26-1)))
(f20-0 (ripple-slow-add-sine-waves s5-0 f22-1 f24-1))
)
(set! sv-32 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) f24-1))
(set! sv-48 (ripple-slow-add-sine-waves s5-0 f22-1 (+ 1.0 f24-1)))
(let* ((f1-6 (ripple-slow-add-sine-waves s5-0 (+ 1.0 f22-1) (+ 1.0 f24-1)))
(f0-22 (+ f20-0 (* (- f28-1 f22-1) (- sv-32 f20-0))))
(f1-9 (+ sv-48 (* (- f28-1 f22-1) (- f1-6 sv-48))))
(f1-12 (+ f0-22 (* (- f26-1 f24-1) (- f1-9 f0-22))))
(f0-23 (-> gp-0 faded-scale))
)
(if (< f0-23 0.0)
(set! f0-23 (-> gp-0 global-scale))
)
(+ f30-0 (* 0.0078125 f1-12 f0-23))
)
)
)
)
)
)
)

View File

@ -7,3 +7,158 @@
;; DECOMP BEGINS
(define mercneric-vu0-block (new 'static 'vu-function #|:length #xbe :origin #x118 :qlength 95|#))
(deftype invinitdata (structure)
((count uint8)
(init-data uint8)
(init-addr uint16)
)
:pack-me
)
(define *inv-init-table* (new 'static 'inline-array invinitdata 8
(new 'static 'invinitdata :count #x48 :init-addr #x1)
(new 'static 'invinitdata :count #x43 :init-data #xc :init-addr #x11)
(new 'static 'invinitdata :count #x3d :init-data #x18 :init-addr #x21)
(new 'static 'invinitdata :count #x38 :init-data #x22 :init-addr #xe0)
(new 'static 'invinitdata :count #x38 :init-data #x24 :init-addr #xe1)
(new 'static 'invinitdata :count #x33 :init-data #x30 :init-addr #xf1)
(new 'static 'invinitdata :count #x2e :init-data #x3a :init-addr #x190)
(new 'static 'invinitdata :count #x2d :init-data #x3c :init-addr #x191)
)
)
(def-mips2c generic-merc-init-asm (function none))
;; ERROR: function was not converted to expressions. Cannot decompile.
;; ERROR: function was not converted to expressions. Cannot decompile.
;; ERROR: function has no type analysis. Cannot decompile.
(def-mips2c mercneric-convert function)
(def-mips2c high-speed-reject function)
(def-mips2c generic-translucent (function gsf-buffer none))
(def-mips2c generic-merc-query function)
(def-mips2c generic-merc-death function)
(def-mips2c generic-merc-execute-asm function)
(def-mips2c generic-merc-do-chain (function mercneric-chain dma-buffer pointer))
(defun generic-merc-execute-all ((arg0 dma-buffer))
(local-vars (a0-24 int) (a0-26 int))
(let ((s4-0 (-> *foreground* foreground-grid))
(gp-0 (-> *display* frames (-> *display* on-screen) global-buf base))
)
(when *debug-segment*
(let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0))
(v1-14 'generic)
(s2-0 *profile-generic-color*)
)
(when (and *dproc* *debug-segment*)
(let ((s1-0 (-> s3-0 data (-> s3-0 count))))
(let ((s0-0 (-> s3-0 base-time)))
(set! (-> s1-0 name) v1-14)
(set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0))))
)
(set! (-> s1-0 depth) (the-as uint (-> s3-0 depth)))
(set! (-> s1-0 color) s2-0)
(set! (-> s3-0 segment (-> s3-0 depth)) s1-0)
)
(set! (-> s3-0 count) (min 1023 (+ (-> s3-0 count) 1)))
(+! (-> s3-0 depth) 1)
(set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth)))
)
)
0
)
(let* ((v1-28 (-> *perf-stats* data 38))
(a0-12 (-> v1-28 ctrl))
)
(+! (-> v1-28 count) 1)
(b! (zero? a0-12) cfg-9 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mtpc pcr0 0)
(.mtpc pcr1 0)
(.sync.l)
(.sync.p)
(.mtc0 Perf a0-12)
)
(.sync.l)
(.sync.p)
(label cfg-9)
0
;; og:preserve-this
(set! (-> (scratchpad-object generic-work) saves to-vu0-waits) (the-as uint 0))
(set! (-> (scratchpad-object generic-work) saves to-spr-waits) (the-as uint 0))
(set! (-> (scratchpad-object generic-work) saves from-spr-waits) (the-as uint 0))
(flush-cache 0)
(generic-initialize-without-sync (-> *math-camera* perspective) *default-lights*)
(generic-merc-init-asm)
(set! (-> (scratchpad-object generic-work) in-buf merc shadow write-limit)
(the-as int (&+ (-> arg0 end) -262144))
)
(dotimes (s3-1 11)
(dotimes (s2-1 7)
(generic-merc-do-chain (-> s4-0 level-buckets s3-1 data s2-1 mercneric) arg0)
)
)
(generic-merc-do-chain (-> s4-0 warp-chain) arg0)
(let ((v1-43 (-> *perf-stats* data 38)))
(b! (zero? (-> v1-43 ctrl)) cfg-17 :delay (nop!))
(.mtc0 Perf 0)
(.sync.l)
(.sync.p)
(.mfpc a0-24 pcr0)
(+! (-> v1-43 accum0) a0-24)
(.mfpc a0-26 pcr1)
(+! (-> v1-43 accum1) a0-26)
)
(label cfg-17)
0
(update-wait-stats
(-> *perf-stats* data 38)
;; og:preserve-this
(-> (scratchpad-object generic-work) saves to-vu0-waits)
(-> (scratchpad-object generic-work) saves to-spr-waits)
(-> (scratchpad-object generic-work) saves from-spr-waits)
)
(when *debug-segment*
(let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
(when (and *dproc* *debug-segment*)
(let* ((v1-61 (+ (-> s5-1 depth) -1))
(s4-1 (-> s5-1 segment v1-61))
(s3-2 (-> s5-1 base-time))
)
(when (>= v1-61 0)
(set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-2))))
(+! (-> s5-1 depth) -1)
)
)
)
)
0
)
(let ((v1-66 *dma-mem-usage*))
(when (nonzero? v1-66)
(set! (-> v1-66 length) (max 91 (-> v1-66 length)))
(set! (-> v1-66 data 90 name) "pris-generic")
(+! (-> v1-66 data 90 count) 1)
(+! (-> v1-66 data 90 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint gp-0))
)
(set! (-> v1-66 data 90 total) (-> v1-66 data 90 used))
)
)
)
(none)
)

View File

@ -186,7 +186,8 @@
(let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s4-3 (-> s3-0 base))
)
(fx-copy-buf s3-0)
;; this is like the normal one, but runs fx-copy-buf first, copying the framebuffer.
; (fx-copy-buf s3-0)
(generic-init-buf s3-0 arg1)
(let ((v1-14 (the-as object (-> s3-0 base))))
(set! (-> (the-as dma-packet v1-14) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s5-0 next)))

View File

@ -34,6 +34,10 @@
(('pal)
(set! (-> this time-factor) 6.0)
)
;; og:preserve-this custom mode for high fps
(('custom)
(set! (-> this time-factor) (/ 300.0 (-> *pc-settings* target-fps)))
)
(else
(set! (-> this time-factor) 5.0)
)

View File

@ -39,3 +39,8 @@
:screen-pages-high 13
)
)
;; og:preserve-this added
(defmacro correct-x-int (pos)
`(the int (* (-> *video-params* relative-x-scale) (the float ,pos)))
)

View File

@ -66,33 +66,32 @@ Without this corrector, the fogginess of the world would change as the FOV chang
(set! (-> arg0 y-ratio) (* 0.75 (-> arg0 x-ratio)))
(set! (-> arg0 y-ratio) (* 0.5625 (-> arg0 x-ratio)))
)
;; TODO pckernel
;; og:preserve-this
;; (with-pc
;; (cond
;; ((-> *pc-settings* use-vis?)
;; ;; using game vis, cannot allow seeing more of the view
;; ;; crops excess aspect ratio at the top and bottom
;; ;(set! (-> arg0 y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> arg0 x-ratio)))
;; )
;; ((real-movie?)
;; ;; this mess is just so that we can force the original 16x9 cropping during cutscenes.
;; (if (<= (-> *pc-settings* aspect-ratio) ASPECT_16X9)
;; (set! (-> arg0 y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> arg0 x-ratio)))
;; (begin
;; (set! (-> arg0 y-ratio) (* (1/ ASPECT_16X9) (-> arg0 x-ratio)))
;; (*! (-> arg0 x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_16X9))
;; )
;; )
;; )
;; (else
;; ;; not using game vis, allow *extended* aspect ratios
;; ;; there is no vertical cropping, and you can see more of the sides
;; (set! (-> arg0 y-ratio) (* (1/ ASPECT_4X3) (-> arg0 x-ratio))) ;; same cropping as 4x3
;; (*! (-> arg0 x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_4X3)) ;; extend fov! shows more on the sides.
;; )
;; )
;; )
(with-pc
(cond
((-> *pc-settings* use-vis?)
;; using game vis, cannot allow seeing more of the view
;; crops excess aspect ratio at the top and bottom
;(set! (-> arg0 y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> arg0 x-ratio)))
)
((real-movie?)
;; this mess is just so that we can force the original 16x9 cropping during cutscenes.
(if (<= (-> *pc-settings* aspect-ratio) ASPECT_16X9)
(set! (-> arg0 y-ratio) (* (1/ (-> *pc-settings* aspect-ratio)) (-> arg0 x-ratio)))
(begin
(set! (-> arg0 y-ratio) (* (1/ ASPECT_16X9) (-> arg0 x-ratio)))
(*! (-> arg0 x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_16X9))
)
)
)
(else
;; not using game vis, allow *extended* aspect ratios
;; there is no vertical cropping, and you can see more of the sides
(set! (-> arg0 y-ratio) (* (1/ ASPECT_4X3) (-> arg0 x-ratio))) ;; same cropping as 4x3
(*! (-> arg0 x-ratio) (/ (-> *pc-settings* aspect-ratio) ASPECT_4X3)) ;; extend fov! shows more on the sides.
)
)
)
(let ((f1-3 (-> arg0 x-ratio))
(f0-7 (-> arg0 y-ratio))
(v1-6 (-> arg0 cull-info))

View File

@ -164,6 +164,7 @@
(target-brightness float)
(speed float)
)
:pack-me
)

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