[decomp] progress (#780)

* cleanup `main`

* whitespace

* start `progress` decomp pt1

* fill in more stuff

* Update label_types.jsonc

* run cheats

* clang

* make most of `progress` decompile

* `progress` pt 2

* [decompiler] support dynamic format strings

* Make `progress-draw` decompile and almost all `progress`

* make clang shut up

* fix unhandled format string

* fix `progress-draw`

* Update DecompilerTypeSystem.cpp

* fix?

* fixes

* fix a few functions

* make `language-enum`

* warn on weird floats

* fix minor pad bug

* dump stuff in `progress`

* make `progress-screen` enum

* progress progress

* update refs and fix stupid bug

* trying to get it to work

* it works!?

* disable sound functions

* fixes

* final touches

* tests

* tests

* add process allocations

* use the right register for windows

* another try for windows, counting is hard

* one more try

* use process allocations

Co-authored-by: water <awaterford111445@gmail.com>
This commit is contained in:
ManDude
2021-09-07 01:35:03 +01:00
committed by GitHub
parent c53f778ab0
commit 89ccb8cbc7
109 changed files with 25065 additions and 8487 deletions
+1
View File
@@ -26,3 +26,4 @@ ee-results.json
# game stuff
game_config/*
imgui.ini
+7 -1
View File
@@ -11,6 +11,7 @@
#include "PrettyPrinter.h"
#include "Reader.h"
#include "third-party/fmt/core.h"
#include "common/log/log.h"
namespace pretty_print {
@@ -29,7 +30,12 @@ const std::unordered_map<u32, std::string> const_floats = {{0x40490fda, "PI"},
goos::Object float_representation(float value) {
u32 int_value;
memcpy(&int_value, &value, 4);
if (const_floats.find(int_value) != const_floats.end()) {
u8 exp = (int_value >> 23) & 0xff;
u32 mant = int_value & 0x7fffff;
if ((exp == 0 && mant != 0) || exp == 0xff) {
lg::warn("PS2-incompatible float (0x{:08X}) detected! Writing as the-as cast.", int_value);
return pretty_print::build_list("the-as", "float", fmt::format("#x{:x}", int_value));
} else if (const_floats.find(int_value) != const_floats.end()) {
return pretty_print::to_symbol(const_floats.at(int_value));
} else if (banned_floats.find(int_value) == banned_floats.end()) {
return goos::Object::make_float(value);
+1 -1
View File
@@ -108,7 +108,7 @@ void initialize() {
// VIRTUAL_TERMINAL_PROCESSING enables support for ANSI colors in the stdout text, used by the
// logging tool.
// ENABLE_QUICK_EDIT_MODE enables various mouse-related stdin functions, such as right-click for
// QUICK_EDIT_MODE enables various mouse-related stdin functions, such as right-click for
// copy-paste, scroll wheel to - shocker - scroll, etc.
// Get handle to stdout
+12 -3
View File
@@ -1243,10 +1243,18 @@ TypeState CallOp::propagate_types_internal(const TypeState& input,
// we're calling a varags function, which is format. We can determine the argument count
// by looking at the format string, if we can get it.
auto arg_type = input.get(Register(Reg::GPR, Reg::A1));
if (arg_type.is_constant_string() || arg_type.is_format_string()) {
auto can_determine_argc = arg_type.can_be_format_string();
auto dynamic_string = false;
if (!can_determine_argc && arg_type.typespec() == TypeSpec("string")) {
// dynamic string. use manual lookup table.
dynamic_string = true;
}
if (can_determine_argc || dynamic_string) {
int arg_count = -1;
if (arg_type.is_constant_string()) {
if (dynamic_string) {
arg_count = dts.get_dynamic_format_arg_count(env.func->guessed_name.to_string(), m_my_idx);
} else if (arg_type.is_constant_string()) {
auto& str = arg_type.get_string();
arg_count = dts.get_format_arg_count(str);
} else {
@@ -1286,7 +1294,8 @@ TypeState CallOp::propagate_types_internal(const TypeState& input,
return end_types;
} else {
throw std::runtime_error("Failed to get string for _varags_ call, got " + arg_type.print());
throw std::runtime_error("Failed to get appropriate string for _varags_ call, got " +
arg_type.print());
}
}
// set the call type!
+6 -5
View File
@@ -1934,9 +1934,9 @@ void SimpleExpressionElement::update_from_stack_int_to_float(const Env& env,
}
result->push_back(pool.alloc_element<CastElement>(TypeSpec("float"), arg, true));
} else {
throw std::runtime_error(fmt::format("Used int to float on a {} from {}: {} (op {})",
type.print(), var.to_form(env).print(),
arg->to_string(env), m_my_idx));
throw std::runtime_error(fmt::format("At op {}, used int to float on a {} from {}: {}",
m_my_idx, type.print(), var.to_form(env).print(),
arg->to_string(env)));
}
}
@@ -4947,7 +4947,8 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool,
// pop the value and the original
auto popped = pop_to_forms({old_value, source}, env, pool, stack, true);
if (!is_symbol_true(popped.at(0))) {
lg::warn("Failed to ConditionalMoveFalseElement::push_to_stack");
lg::warn("{}: Failed to ConditionalMoveFalseElement::push_to_stack",
env.func->guessed_name.to_string());
stack.push_value_to_reg(source, popped.at(1), true, TypeSpec("symbol"));
stack.push_form_element(this, true);
return;
@@ -5302,7 +5303,7 @@ void LabelDerefElement::update_from_stack(const Env& env,
auto as_label = make_label_load(m_lid, env, pool, m_size, m_load_kind);
if (!as_label) {
throw std::runtime_error(
fmt::format("Unable to figure out label load for {}\n", env.file->labels.at(m_lid).name));
fmt::format("Unable to figure out label load for {}", env.file->labels.at(m_lid).name));
}
result->push_back(as_label);
}
+2
View File
@@ -163,6 +163,8 @@ ObjectFileDB::ObjectFileDB(const std::vector<std::string>& _dgos,
}
dts.bad_format_strings = config.bad_format_strings;
dts.format_ops_with_dynamic_string_by_func_name =
config.hacks.format_ops_with_dynamic_string_by_func_name;
}
void ObjectFileDB::load_map_file(const std::string& map_data) {
+4 -1
View File
@@ -173,6 +173,9 @@ Config read_config_file(const std::string& path_to_config_file) {
config.hacks.blocks_ending_in_asm_branch_by_func_name =
hacks_json.at("blocks_ending_in_asm_branch")
.get<std::unordered_map<std::string, std::unordered_set<int>>>();
config.hacks.format_ops_with_dynamic_string_by_func_name =
hacks_json.at("dynamic_format_arg_counts")
.get<std::unordered_map<std::string, std::vector<std::vector<int>>>>();
for (auto& entry : hacks_json.at("cond_with_else_max_lengths")) {
auto func_name = entry.at(0).get<std::string>();
@@ -187,4 +190,4 @@ Config read_config_file(const std::string& path_to_config_file) {
return config;
}
} // namespace decompiler
} // namespace decompiler
+2
View File
@@ -73,6 +73,8 @@ struct DecompileHacks {
std::unordered_map<std::string, CondWithElseLengthHack> cond_with_else_len_by_func_name;
std::unordered_set<std::string> reject_cond_to_value;
std::unordered_map<std::string, std::unordered_set<int>> blocks_ending_in_asm_branch_by_func_name;
std::unordered_map<std::string, std::vector<std::vector<int>>>
format_ops_with_dynamic_string_by_func_name;
};
struct Config {
File diff suppressed because it is too large Load Diff
@@ -10,7 +10,7 @@
"hud": [[15, "(function basic int basic event-message-block object)"]],
"main": [[4, "(function none)"]],
"main": [[4, "(function none :behavior process)"]],
"process-drawable": [[29, "(function string symbol)"]],
@@ -504,5 +504,40 @@
"blerc-execute":[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33],
"(method 11 fact-info-target)":[42],
"(code format-card auto-save)":[3, 4, 5, 6, 7, 8]
},
// Sometimes the game might use format strings that are fetched dynamically,
// for example using the game text lookup method
// Add information about those format instructions here.
// e.g. "function-name":[[op, argc], [op, argc], ...]
// where "op" is the op number for the call to format.
"dynamic_format_arg_counts": {
"(method 35 progress)":[
[44, 1],
[92, 1]
],
"(method 49 progress)":[
[35, 1]
],
"(method 37 progress)":[
[41, 1]
],
"(method 38 progress)":[
[106, 1]
],
"(method 39 progress)":[
[41, 1]
],
"(method 41 progress)":[
[73, 1]
],
"(method 42 progress)":[
[41, 1]
],
"(method 43 progress)":[
[51, 1],
[94, 1]
],
"":[]
}
}
@@ -375,7 +375,7 @@
"anim-tester": [
["L509", "(inline-array list-field)", 12]
],
"default-menu": [
["L6251", "float", true],
["L6252", "float", true],
@@ -402,13 +402,13 @@
["L6271", "uint64", true]
// ["L6268", "(array int)", true, 1] // printed as a float
],
// "default-menu": [
// ["L519", "pair", true],
// ["L1550", "pair", true],
// ["L1552", "pair", true]
// ],
// "generic-vu1": [
// ["L12", "gif-tag64", true],
// ["L15", "gif-tag64", true],
@@ -443,6 +443,80 @@
["L71", "vector"]
],
"progress": [
["L667", "uint64", true],
["L586", "float", true],
["L587", "float", true],
["L588", "float", true],
["L589", "float", true],
["L590", "float", true],
["L591", "float", true],
["L592", "float", true],
["L593", "float", true],
["L594", "float", true],
["L595", "float", true],
["L596", "float", true],
["L597", "float", true],
["L598", "float", true],
["L599", "float", true],
["L600", "float", true],
["L601", "float", true],
["L602", "float", true],
["L603", "float", true],
["L604", "float", true],
["L605", "float", true],
["L606", "float", true],
["L607", "float", true],
["L608", "float", true],
["L609", "float", true],
["L610", "float", true],
["L611", "float", true],
["L612", "float", true],
["L613", "float", true],
["L614", "float", true],
["L615", "float", true],
["L617", "float", true],
["L616", "float", true],
["L618", "float", true],
["L619", "float", true],
["L620", "float", true],
["L621", "float", true],
["L622", "float", true],
["L623", "float", true],
["L624", "float", true],
["L625", "float", true],
["L626", "float", true],
["L627", "float", true],
["L628", "float", true],
["L629", "float", true],
["L630", "float", true],
["L631", "float", true],
["L632", "float", true],
["L633", "float", true],
["L634", "float", true],
["L635", "float", true],
["L583", "vector"],
["L581", "vector"],
["L579", "vector"],
["L577", "vector"],
["L573", "vector"],
["L575", "vector"],
["L636", "uint64", true],
["L637", "uint64", true],
["L638", "uint64", true],
["L639", "uint64", true],
["L640", "uint64", true],
["L641", "uint64", true],
["L642", "uint64", true],
["L643", "uint64", true],
["L644", "uint64", true],
["L645", "uint64", true],
["L646", "uint64", true],
["L647", "uint64", true],
["L648", "uint64", true],
["L649", "uint64", true]
],
"target-part": [
["L336", "float", true],
["L337", "float", true],
@@ -456,6 +530,10 @@
["L150", "attack-info"]
],
"generic-obs": [
["L455", "quaternion"]
],
"blocking-plane": [
["L18", "vector"],
["L19", "vector"],
@@ -1,4 +1,9 @@
{
"run-function-in-process": [
[16, ["array", "uint64", 6]],
[64, "catch-frame"]
],
"matrixp*!": [[16, "matrix"]],
"vector3s-matrix*!": [[16, "vector"]],
@@ -551,11 +556,11 @@
[16, "event-message-block"],
[96, "event-message-block"]
],
"(method 43 farmer)": [
[16, "vector"]
],
"yakow-post": [
[16, "vector"],
[32, "vector"],
@@ -564,7 +569,7 @@
[80, "vector"],
[96, "vector"]
],
"anim-tester-save-object-seqs": [
[16, "file-stream"]
],
@@ -581,13 +586,13 @@
"anim-tester-add-newobj": [[16, "event-message-block"]],
"anim-tester-start": [[16, "event-message-block"]],
"anim-tester-add-sequence": [[16, "event-message-block"]],
"(anon-function 28 task-control)": [[16, "event-message-block"]],
"instance-tfragment-add-debug-sphere": [
[16, "vector"]
],
"(method 10 game-save)": [[16, "file-stream"]],
"cam-state-from-entity": [[16, "curve"]],
@@ -727,7 +732,7 @@
[32, "quaternion"],
[48, "vector"]
],
"ocean-make-trans-camera-masks": [
[16, "vector"],
[32, "vector"]
@@ -828,11 +833,11 @@
"(method 43 mayor)": [
[16, "vector"]
],
"(method 10 tippy)": [
[16, "vector"]
],
"compute-and-draw-shadow": [
[16, "vector"],
[32, "vector"],
@@ -944,8 +949,8 @@
"draw-string-xy": [
[16, "font-context"]
],
],
"(method 50 nav-enemy)": [
[16, "vector"]
],
@@ -1145,6 +1150,23 @@
[16, "vector"]
],
"(method 33 progress)": [[16, "event-message-block"]],
"hide-progress-screen": [[16, "event-message-block"]],
"progress-init-by-other": [[16, "quaternion"]],
"(post progress-debug)": [[16, "font-context"]],
"(post progress-normal)": [[16, "font-context"]],
"(code progress-normal)": [[16, "event-message-block"]],
"fuel-cell-progress-hud-orbit-callback": [
[16, "vector"],
[32, "vector"]
],
"(method 24 progress)": [[16, "font-context"]],
"(method 25 progress)": [[16, "font-context"]],
"(method 26 progress)": [[16, "font-context"]],
"(method 17 progress)": [[16, "font-context"]],
"(method 28 progress)": [[16, "font-context"]],
"(method 27 progress)": [[16, "font-context"]],
"(method 11 fact-info-target)": [
[16, "event-message-block"]
],
@@ -90,6 +90,8 @@
[17, "s5", "pointer"]
],
"run-function-in-process": [[40, "a0", "dead-pool-heap"]],
// GSTRING
"name=": [
[26, "a1", "symbol"],
@@ -1571,14 +1573,16 @@
[[12, 20], "a0", "dma-packet"],
[[45, 52], "a0", "dma-packet"],
[[69, 76], "a0", "dma-packet"],
[[80, 87], "v1", "dma-packet"]
[[80, 87], "v1", "dma-packet"],
[65, "a3", "int"]
],
"sprite-add-3d-chunk": [
[[11, 19], "a0", "dma-packet"],
[[44, 51], "a0", "dma-packet"],
[[68, 75], "a0", "dma-packet"],
[[79, 87], "v1", "dma-packet"]
[[79, 87], "v1", "dma-packet"],
[65, "a3", "int"]
],
"sprite-add-shadow-chunk": [
@@ -1902,7 +1906,7 @@
[70, "s4", "twist-joint"],
[82, "s4", "twist-joint"]
],
"(code teetertotter-launch)": [
[11, "v1", "art-joint-anim"]
],
@@ -1918,7 +1922,7 @@
"(method 11 silostep)": [
[100, "v1", "art-joint-anim"]
],
"(enter plat-button-pressed sunken-elevator)": [
[40, "v1", "village2cam"],
[73, "v1", "village2cam"]
@@ -2055,6 +2059,10 @@
[[33, 35], "v1", "merc-ctrl"]
],
"(method 9 screen-filter)": [
[[23, 26], "v1", "dma-packet"]
],
"(method 48 mayor)": [
[32, "a0", "int"]
],
@@ -2063,6 +2071,10 @@
[19, "v1", "float"]
],
"(post idle mayor)": [
[4, "t9", "(function none)"]
],
"(method 43 bird-lady)": [
[19, "v1", "float"]
],
@@ -2205,6 +2217,79 @@
[19, "v1", "float"]
],
"(method 33 progress)": [
[30, "t9", "(function process function object object object object object)"],
[159, "t9", "(function process function object object object object object)"],
[288, "t9", "(function process function object object object object object)"],
[417, "t9", "(function process function object object object object object)"],
[546, "t9", "(function process function object object object object object)"],
[675, "t9", "(function process function object object object object object)"],
[35, "a0", "manipy"],
[38, "v1", "manipy"],
[50, "v1", "manipy"],
[98, "v1", "manipy"],
[164, "a0", "manipy"],
[167, "v1", "manipy"],
[179, "v1", "manipy"],
[227, "v1", "manipy"],
[293, "a0", "manipy"],
[296, "v1", "manipy"],
[308, "v1", "manipy"],
[356, "v1", "manipy"],
[422, "a0", "manipy"],
[425, "v1", "manipy"],
[437, "v1", "manipy"],
[485, "v1", "manipy"],
[551, "a0", "manipy"],
[554, "v1", "manipy"],
[566, "v1", "manipy"],
[614, "v1", "manipy"],
[680, "a0", "manipy"],
[683, "v1", "manipy"],
[695, "v1", "manipy"],
[743, "v1", "manipy"]
],
"fuel-cell-progress-hud-orbit-callback": [
[[0, 199], "s5", "progress"],
[4, "f0", "float"]
],
"(method 7 progress)": [
[16, "a2", "pointer"]
],
"(method 17 progress)": [
[[466, 471], "v1", "dma-packet"],
[[154, 159], "v1", "dma-packet"]
],
"(post progress-debug)": [
[[61, 66], "v1", "dma-packet"],
[[108, 113], "v1", "dma-packet"],
[[153, 158], "v1", "dma-packet"],
[[198, 203], "v1", "dma-packet"]
],
"(method 23 progress)": [
[103, "v1", "float"]
],
"(post progress-normal)": [
[416, "a0", "float"]
],
"(method 53 progress)": [
[[0, 999], "gp", "progress-screen"]
],
"(method 35 progress)": [[38, "s4", "game-text-id"]],
"(method 43 progress)": [[45, "s4", "game-text-id"]],
"(method 38 progress)": [[58, "a1", "game-text-id"]],
"draw-percent-bar": [
[[33, 38], "v1", "dma-packet"]
],
"(method 11 fact-info-target)": [
[135, "v1", "target"],
[148, "v1", "collide-shape"],
@@ -2529,7 +2614,7 @@
"cam-master-effect": [
[[0, 999], "s6", "camera-master"]
],
"birth-func-vector-orient": [
[[7, 24], "s3", "sprite-vec-data-2d"]
],
@@ -2619,6 +2704,13 @@
[70, "v1", "process-mask"]
],
"manipy-init": [[143, "a0", "collide-shape"]],
"forall-particles-with-key-runner": [
[32, "s3", "(inline-array sparticle-cpuinfo)"],
[42, "s3", "(inline-array sparticle-cpuinfo)"]
],
"(trans plat-button-move-downward jungle-elevator)": [
[11, "v0", "(state plat-button)"]
],
@@ -3229,6 +3229,13 @@
}
},
"(method 9 screen-filter)": {
"vars": {
"v1-4":["v1-4", "dma-packet"],
"s5-0":"buf"
}
},
"(method 11 fact-info-target)": {
"args":["obj", "kind", "amount", "source-handle"],
"vars":{"f0-29":"buzz-count","f30-0":"eco-lev"}
@@ -3349,7 +3356,98 @@
"s5-1": ["s5-1", "handle"]
}
},
"draw-percent-bar": {
"vars": {
"v1-3": ["v1-3", "dma-packet"]
}
},
"(dummy-17 progress)": {
"vars": {
"v1-20": ["v1-20", "dma-packet"],
"v1-81": ["v1-81", "dma-packet"]
}
},
"make-current-level-available-to-progress": {
"vars": {
"a0-0": "cur-lev",
"v1-7": "lev-idx"
}
},
"make-levels-with-tasks-available-to-progress": {
"vars": {
"gp-0": "i",
"s4-0": "ii",
"s5-0": "tasks"
}
},
"get-next-task-up": {
"args": ["cur-task-idx", "lev-idx"]
},
"get-next-task-down": {
"args": ["cur-task-idx", "lev-idx"]
},
"get-next-level-up": {
"args": ["lev-idx"]
},
"get-next-level-down": {
"args": ["lev-idx"]
},
"calculate-completion": {
"args": ["the-progress"],
"vars": {
"sv-40":"total-cells",
"sv-48":"total-buzzers",
"sv-56":"total-orbs",
"sv-16":"current-cells",
"sv-24":"current-buzzers",
"sv-32":"current-orbs"
}
},
"(method 48 progress)": {
"args": ["obj", "screen", "option"]
},
"activate-progress": {
"args": ["creator", "screen"]
},
"(method 23 progress)": {
"args": ["obj", "aspect", "video-mode"]
},
"(method 35 progress)": {
"vars": {
"s4-0": ["s4-0", "game-text-id"]
}
},
"(method 43 progress)": {
"vars": {
"s4-0": ["s4-0", "game-text-id"]
}
},
"(method 38 progress)": {
"vars": {
"a1-1": ["a1-1", "game-text-id"]
}
},
"(post progress-debug)": {
"vars": {
"v1-7": ["v1-7", "dma-packet"],
"v1-16": ["v1-16", "dma-packet"],
"v1-25": ["v1-25", "dma-packet"],
"v1-34": ["v1-34", "dma-packet"]
}
},
"aaaaaaaaaaaaaaaaaaaaaaa": {}
}
+26 -3
View File
@@ -395,8 +395,9 @@ int DecompilerTypeSystem::get_format_arg_count(const std::string& str) const {
return bad_it->second;
}
std::vector<char> single_char_ignore_list = {'%', 'T'};
std::vector<std::string> double_two_char_ignore_list = {"0L", "3L", "1K", "2j", "0k"};
static const std::vector<char> single_char_ignore_list = {'%', 'T'};
static const std::vector<std::string> multi_char_ignore_list = {"0L", "1L", "3L", "1K",
"2j", "0k", "30L"};
int arg_count = 0;
for (size_t i = 0; i < str.length(); i++) {
@@ -412,12 +413,17 @@ int DecompilerTypeSystem::get_format_arg_count(const std::string& str) const {
}
}
for (std::string code : double_two_char_ignore_list) {
for (auto& code : multi_char_ignore_list) {
if (i + 1 < str.length() && code.length() == 2 && (str.at(i) == code.at(0)) &&
str.at(i + 1) == code.at(1)) {
code_takes_no_arg = true;
break;
}
if (i + 2 < str.length() && code.length() == 3 && (str.at(i) == code.at(0)) &&
str.at(i + 1) == code.at(1) && str.at(i + 2) == code.at(2)) {
code_takes_no_arg = true;
break;
}
}
if (!code_takes_no_arg) {
@@ -436,6 +442,23 @@ int DecompilerTypeSystem::get_format_arg_count(const TP_Type& type) const {
}
}
int DecompilerTypeSystem::get_dynamic_format_arg_count(const std::string& func_name,
int op_idx) const {
auto kv = format_ops_with_dynamic_string_by_func_name.find(func_name);
if (kv == format_ops_with_dynamic_string_by_func_name.end()) {
throw std::runtime_error(fmt::format("Unknown dynamic format string."));
} else {
auto& formats = kv->second;
auto the_format =
std::find_if(formats.begin(), formats.end(),
[op_idx](const std::vector<int> vec) { return vec.at(0) == op_idx; });
if (the_format == formats.end()) {
throw std::runtime_error(fmt::format("Unknown dynamic format string."));
}
return the_format->at(1);
}
}
TypeSpec DecompilerTypeSystem::lookup_symbol_type(const std::string& name) const {
auto kv = symbol_types.find(name);
if (kv == symbol_types.end()) {
+3
View File
@@ -18,6 +18,8 @@ class DecompilerTypeSystem {
std::unordered_map<std::string, u64> type_flags;
std::unordered_map<std::string, std::string> type_parents;
std::unordered_map<std::string, int> bad_format_strings;
std::unordered_map<std::string, std::vector<std::vector<int>>>
format_ops_with_dynamic_string_by_func_name;
void add_symbol(const std::string& name) {
if (symbols.find(name) == symbols.end()) {
@@ -42,6 +44,7 @@ class DecompilerTypeSystem {
bool tp_lca(TypeState* combined, const TypeState& add);
int get_format_arg_count(const std::string& str) const;
int get_format_arg_count(const TP_Type& type) const;
int get_dynamic_format_arg_count(const std::string& func_name, int op_idx) const;
TypeSpec lookup_symbol_type(const std::string& name) const;
bool should_attempt_cast_simplify(const TypeSpec& expected, const TypeSpec& actual) const;
+2 -1
View File
@@ -364,7 +364,8 @@ goos::Object decomp_ref_to_inline_array_guess_size(
int size_bytes = end_label.offset - start_label.offset;
int size_elts = size_bytes / stride; // 32 bytes per ocean-near-index
int leftover_bytes = size_bytes % stride;
// fmt::print("Size is {} bytes: {} elts, {} left over\n", size_bytes, size_elts, leftover_bytes);
// fmt::print("Size is {} bytes ({} elts), with {} bytes left over\n", size_bytes,
// size_elts,leftover_bytes);
// if we have leftover, should verify that its all zeros, or that it's the type pointer
// of the next basic in the data section.
-3
View File
@@ -122,9 +122,6 @@ u32 Init() {
void Loop(std::function<bool()> f) {
lg::info("GFX Loop");
while (f()) {
// clean the inputs
Pad::ClearKeys();
// check if we have a display
if (Display::GetMainDisplay()) {
// lg::debug("run display");
+5 -2
View File
@@ -92,8 +92,8 @@ s32 goal_main(int argc, const char* const* argv) {
// Set up game configurations
masterConfig.aspect = (u16)sceScfGetAspect();
masterConfig.language = (u16)sceScfGetLanguage();
masterConfig.inactive_timeout = 0;
masterConfig.timeout = 0;
masterConfig.inactive_timeout = 0; // demo thing
masterConfig.timeout = 0; // demo thing
masterConfig.volume = 100;
// Set up language configuration
@@ -118,6 +118,9 @@ s32 goal_main(int argc, const char* const* argv) {
masterConfig.aspect = SCE_ASPECT_FULL;
}
// Added - the territory is originally hardcoded. this allows us to change it whenever.
masterConfig.territory = GAME_TERRITORY_SCEA;
// In retail game, disable debugging modes, and force on DiskBoot
// MasterDebug = 0;
// DiskBoot = 1;
+6
View File
@@ -7,6 +7,10 @@
#include "common/common_types.h"
#define GAME_TERRITORY_SCEA 0 // sony america
#define GAME_TERRITORY_SCEE 1 // sony europe
#define GAME_TERRITORY_SCEI 2 // sony inc. (japan)
struct MasterConfig {
u16 language; //! GOAL language 0
u16 aspect; //! SCE_ASPECT 2
@@ -14,6 +18,8 @@ struct MasterConfig {
u16 inactive_timeout; // todo 6
u16 timeout; // todo 8
u16 volume; // todo 12
u16 territory; // added. this is normally burnt onto the disc executable.
};
// Level to load on boot
+4 -2
View File
@@ -499,7 +499,7 @@ u64 CPadGetData(u64 cpad_info) {
cpad->state = 99;
} else {
// we have actuators to use.
cpad->change_time = 1; // remember to update vibration.
cpad->change_time = 1; // remember to update pad times.
cpad->state = 75;
}
break;
@@ -672,8 +672,10 @@ u64 DecodeVolume() {
return masterConfig.volume;
}
// NOTE: this is originally hardcoded, and returns different values depending on the disc region.
// it returns 0 for NTSC-U, 1 for PAL and 2 for NTSC-J
u64 DecodeTerritory() {
return 0;
return masterConfig.territory;
}
u64 DecodeTimeout() {
+1 -1
View File
@@ -640,4 +640,4 @@ void cb_closedfile(s32 sync_result) {
void cb_reprobe_save(s32) {
assert(false);
}
}
+3
View File
@@ -84,6 +84,9 @@ int scePadRead(int port, int /*slot*/, u8* rdata) {
cpad->button0 |= Gfx::PadIsPressed((Pad::Button)i, port) << i;
}
// keys polled and read, prepare for new ones.
Pad::ClearKeys();
return 32;
}
-5
View File
@@ -1,8 +1,5 @@
#pragma once
#ifndef JAK1_LIBSCF_H
#define JAK1_LIBSCF_H
#define SCE_JAPANESE_LANGUAGE 0
#define SCE_ENGLISH_LANGUAGE 1
#define SCE_FRENCH_LANGUAGE 2
@@ -29,5 +26,3 @@ int sceScfGetAspect();
*/
int sceScfGetLanguage();
} // namespace ee
#endif // JAK1_LIBSCF_H
+3
View File
@@ -140,6 +140,9 @@ void DefaultMapping(MappingInfo& mapping) {
MapButton(mapping, Button::Down, 0, GLFW_KEY_DOWN);
MapButton(mapping, Button::Left, 0, GLFW_KEY_LEFT);
// start for progress
MapButton(mapping, Button::Start, 0, GLFW_KEY_ENTER);
// l3/r3 for menu
MapButton(mapping, Button::L3, 0, GLFW_KEY_COMMA);
MapButton(mapping, Button::R3, 0, GLFW_KEY_PERIOD);
+7 -7
View File
@@ -1510,7 +1510,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'check-drop-level-rain
:sym 'check-drop-level-rain
)
(new 'static 'sp-field-init-spec
:field #x3f
@@ -2130,7 +2130,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-sun
:sym 'sparticle-track-sun
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -2216,7 +2216,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-sun
:sym 'sparticle-track-sun
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -2302,7 +2302,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-sun
:sym 'sparticle-track-sun
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -2393,7 +2393,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-sun
:sym 'sparticle-track-sun
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -2477,7 +2477,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-sun
:sym 'sparticle-track-sun
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -2561,7 +2561,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-sun
:sym 'sparticle-track-sun
)
(new 'static 'sp-field-init-spec :field #x43)
)
+8 -8
View File
@@ -119,14 +119,14 @@
:size-assert #x208
:flag-assert #xf00000208
(:methods
(new (symbol type) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
)
(new (symbol type) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 (_type_) none 14)
)
)
(defmethod new touching-list ((allocation symbol) (type-to-make type))
+25
View File
@@ -849,6 +849,31 @@
(let
((gp-0
(new 'static 'inline-array vector 32 ;; was originally 8, which is too small and would cause memory corruption
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
;; added
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
(new 'static 'vector)
+2 -2
View File
@@ -442,9 +442,9 @@
;; definition for function dm-setting-language
(defun dm-setting-language ((arg0 function) (arg1 int))
(if (= arg1 4)
(set! (-> *setting-control* default language) (/ (the-as int arg0) 8))
(set! (-> *setting-control* default language) (the-as language-enum (/ (the-as int arg0) 8)))
)
(= (-> *setting-control* default language) (/ (the-as int arg0) 8))
(= (-> *setting-control* default language) (the-as language-enum (/ (the-as int arg0) 8)))
)
;; definition for function dm-current-continue
+20 -11
View File
@@ -495,18 +495,18 @@
)
)
;;(cpu-usage)
(__send-gfx-dma-chain (the-as dma-bank-source #x10009000)
(cond
;; some buffer for debugging, not used
(*surrogate-dma-buffer*
*surrogate-dma-buffer*
)
(else
(-> dma-buf-to-send data-buffer)
)
)
(__send-gfx-dma-chain (the-as dma-bank-source #x10009000)
(cond
;; some buffer for debugging, not used
(*surrogate-dma-buffer*
*surrogate-dma-buffer*
)
(else
(-> dma-buf-to-send data-buffer)
)
)
)
)
)
)
(determine-pause-mode)
@@ -532,3 +532,12 @@
(display-frame-finish disp)
(display-sync disp) ;; also starts next
)
;; TODO stub
(defun dma-add-process-drawable-hud ((arg0 process-drawable) (arg1 draw-control) (arg2 symbol) (arg3 dma-buffer))
(set! (-> arg1 status) (logand -9 (-> arg1 status)))
(when (zero? (logand (-> arg1 status) 22))
(logior! (-> arg1 status) 8)
)
(none)
)
+1 -1
View File
@@ -6,7 +6,7 @@
;; dgos: GAME, ENGINE
;; TODO - for water-anim | sunken-elevator
(define-extern ja-post (function int))
(define-extern ja-post (function none :behavior process-drawable))
;; TODO - for rigid-body
(define-extern rider-post (function int))
(define-extern transform-post (function int))
+1
View File
@@ -9,6 +9,7 @@
(define-extern birth-pickup-at-point (function vector int float symbol process-drawable symbol none)) ;; TODO - unconfirmed - see beach-rocks
;; TODO - for oracle
(define-extern *fuel-cell-sg* skeleton-group) ;; unknown type
(define-extern *money-sg* skeleton-group) ;; unknown type
;; TODO - for entity and beach-rocks
(deftype collectable (process-drawable)
((pickup-type int32 :offset-assert 176)
+213 -19
View File
@@ -318,7 +318,7 @@
(set! (-> arg0 fuel-cell-count) (-> obj fuel))
(set! (-> arg0 money-count) (-> obj money-total))
(set! (-> arg0 buzzer-count) (-> obj buzzer-total))
(set! (-> arg0 completion-percentage) (calculate-completion #f))
(set! (-> arg0 completion-percentage) (calculate-completion (the-as progress #f)))
(when (string= (-> obj current-continue name) "title-start")
(set! (-> arg0 new-game) 1)
(set! (-> arg0 level-index) (-> (lookup-level-info 'training) index))
@@ -1262,7 +1262,7 @@
(set! (-> *setting-control* default dialog-volume) (-> save-data user-float0))
)
((= a0-1 (game-save-elt language))
(set! (-> *setting-control* default language) (the-as int (-> save-data user-uint64)))
(set! (-> *setting-control* default language) (the-as language-enum (-> save-data user-uint64)))
)
((= a0-1 (game-save-elt vibration))
(set! (-> *setting-control* default vibration) (= (-> save-data user-uint64) 1))
@@ -1612,8 +1612,7 @@
;; used for the flashing auto-save icon, I think.
(set!
(-> *part-group-id-table* 656)
(set! (-> *part-group-id-table* 656)
(new 'static 'sparticle-launch-group
:length 1
:duration #xbb8
@@ -1629,8 +1628,7 @@
)
;; todo floats/ints for these values.
(set!
(-> *part-id-table* 2662)
(set! (-> *part-id-table* 2662)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 11
@@ -1700,17 +1698,17 @@
(define *auto-save-info* (new 'global 'mc-slot-info))
(deftype auto-save (process)
((card int32 :offset-assert 112)
(slot int32 :offset-assert 116)
(which int32 :offset-assert 120)
(buffer kheap :offset-assert 124)
(mode basic :offset-assert 128)
(result mc-status-code :offset-assert 132)
(save game-save :offset-assert 136)
(info mc-slot-info :inline :offset-assert 140)
(notify handle :offset-assert 440)
(state-time uint64 :offset-assert 448)
(part sparticle-launch-control :offset-assert 456)
((card int32 :offset-assert 112)
(slot int32 :offset-assert 116)
(which int32 :offset-assert 120)
(buffer kheap :offset-assert 124)
(mode basic :offset-assert 128)
(result mc-status-code :offset-assert 132)
(save game-save :offset-assert 136)
(info mc-slot-info :inline :offset-assert 140)
(notify handle :offset-assert 440)
(state-time int64 :offset-assert 448)
(part sparticle-launch-control :offset-assert 456)
)
:heap-base #x160
:method-count-assert 23
@@ -1752,6 +1750,202 @@
(the-as auto-save ((method-of-type process relocate) obj arg0))
)
(defbehavior auto-save-post auto-save ()
(when
(and
(= *cheat-mode* 'debug)
(logtest? (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons l3))
)
(let
((gp-0
(new
'stack
'font-context
*font-default-matrix*
32
160
0.0
(font-color default)
(font-flags shadow kerning)
)
)
)
(let ((v1-5 gp-0))
(set! (-> v1-5 width) (the float 440))
)
(let ((v1-6 gp-0))
(set! (-> v1-6 height) (the float 80))
)
(set! (-> gp-0 flags) (font-flags shadow kerning))
(format
(clear *temp-string*)
"~S / ~S ~D~%"
(-> self mode)
(-> self state name)
(-> self which)
)
(print-game-text *temp-string* gp-0 #f 128 22)
)
)
(when (and (= (-> self mode) 'auto-save) (!= (-> self next-state name) 'done))
(let
((gp-1
(new
'stack
'font-context
*font-default-matrix*
20
40
0.0
(font-color default)
(font-flags shadow kerning)
)
)
)
(let ((v1-15 gp-1))
(set! (-> v1-15 scale) 0.8)
)
(let ((v1-16 gp-1))
(set! (-> v1-16 width) (the float 472))
)
(let ((v1-17 gp-1))
(set! (-> v1-17 height) (the float 20))
)
(set! (-> gp-1 flags) (font-flags shadow kerning middle left large))
(when (zero? (-> *game-info* auto-save-count))
(print-game-text
(lookup-text! *common-text* (game-text-id saving-data) #f)
gp-1
#f
128
22
)
(set! (-> gp-1 origin x) 20.0)
(set! (-> gp-1 origin y) 130.0)
(let ((v1-23 gp-1))
(set! (-> v1-23 scale) 0.7)
)
(let ((v1-24 gp-1))
(set! (-> v1-24 height) (the float 40))
)
(let ((s5-2 print-game-text))
((the-as (function object string object none) format)
(clear *temp-string*)
(lookup-text! *common-text* (game-text-id do-not-remove-mem-card) #f)
1
)
(s5-2 *temp-string* gp-1 #f 128 22)
)
)
)
(when (< (mod (-> *display* real-frame-counter) 300) 270)
(when (> (-> self part matrix) 0)
(let ((gp-2 (sprite-get-user-hvdf (-> self part matrix))))
(set! (-> gp-2 vector4w x) (the-as int 1842.0))
(set!
(-> gp-2 vector4w y)
(the-as
int
(the
float
(+ (the int (* 0.5 (- (* (if (= (get-aspect-ratio) 'aspect16x9)
370.0
360.0
)
(-> *video-parms* relative-y-scale)
)
(the float (-> *video-parms* screen-sy))
)
)
)
2048
)
)
)
)
(set!
(-> gp-2 vector4w z)
(the-as int (+ -1024.0 (-> *math-camera* hvdf-off z)))
)
(set! (-> gp-2 vector4w w) (the-as int (-> *math-camera* hvdf-off w)))
)
)
(dummy-11 (-> self part) *zero-vector*)
)
)
(none)
)
(defstatehandler auto-save :post auto-save-post)
(defbehavior auto-save-init-by-other auto-save ((desired-mode symbol) (notify-proc process-tree) (card-idx int) (file-idx int))
;; stubbing for now.
(return #f)
(when (handle->process (-> *game-info* auto-save-proc))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'notify)
(set! (-> a1-2 param 0) (the-as uint 'error))
(set! (-> a1-2 param 1) (the-as uint 16))
(send-event-function (the-as process notify-proc) a1-2)
)
(return #f)
)
(set! (-> *game-info* auto-save-proc) (process->handle self))
(set! (-> *game-info* auto-save-status) (mc-status-code ok))
(stack-size-set! (-> self main-thread) 512)
(logclear! (-> self mask) (process-mask pause menu progress))
(set! (-> self card) card-idx)
(set! (-> self which) file-idx)
(set! (-> self buffer) #f)
(set! (-> self mode) desired-mode)
(set! (-> self result) (mc-status-code ok))
(set! (-> self save) #f)
(set! (-> self notify) (process->handle notify-proc))
(set! (-> self part) (create-launch-control (-> *part-group-id-table* 656) self))
(set! (-> self part matrix) (sprite-allocate-user-hvdf))
(cond
((= desired-mode 'auto-save)
(if (not (-> *setting-control* current auto-save))
(go-virtual error (mc-status-code no-auto-save))
)
(when (and (zero? (-> self card)) (-> *setting-control* current auto-save))
(set! (-> self card) (-> *game-info* auto-save-card))
(set! (-> self which) (-> *game-info* auto-save-which))
)
)
((= desired-mode 'error)
(set! (-> *setting-control* default auto-save) #f)
(go-virtual error (mc-status-code no-card))
)
)
(set! (-> *setting-control* default auto-save) #f)
(go-virtual get-heap)
(none)
)
(defun auto-save-command ((arg0 symbol) (arg1 int) (arg2 int) (arg3 process-tree))
(make-init-process auto-save auto-save-init-by-other arg0 arg3 arg1 arg2)
(none)
)
(defun auto-save-check ()
(when (and (-> *setting-control* current auto-save)
(not (handle->process (-> *game-info* auto-save-proc)))
)
(mc-get-slot-info 0 *auto-save-info*)
(if (and (nonzero? (-> *auto-save-info* known))
(or (zero? (-> *auto-save-info* handle))
(!= (-> *auto-save-info* handle) (-> *game-info* auto-save-card))
)
)
(auto-save-command 'error 0 0 (the-as process *default-pool*))
)
)
0
(none)
)
;; TODO - for credits
(define-extern print-game-text (function string font-context symbol int int float)) ; TODO decomp error, this seems correct though
+3 -11
View File
@@ -13,8 +13,8 @@
(new-joint-anim art-joint-anim :offset-assert 188)
(new-joint-anim-blend uint64 :offset-assert 192)
(anim-mode symbol :offset-assert 200)
(cur-grab-handle uint64 :offset-assert 208)
(cur-target-handle uint64 :offset-assert 216)
(cur-grab-handle handle :offset-assert 208)
(cur-target-handle handle :offset-assert 216)
(old-grab-pos vector :inline :offset-assert 224)
(joint joint 4 :offset-assert 240)
(new-post-hook function :offset-assert 256)
@@ -27,7 +27,6 @@
:method-count-assert 20
:size-assert #x114
:flag-assert #x1400b00114
;; inherited inspect of process-drawable
)
(deftype part-spawner (process-drawable)
@@ -40,7 +39,6 @@
:method-count-assert 21
:size-assert #xd0
:flag-assert #x15006000d0
;; inherited inspect of process-drawable
(:methods
(dummy-20 () none 20)
)
@@ -65,9 +63,6 @@
:method-count-assert 14
:size-assert #xf8
:flag-assert #xe009000f8
;; inherited inspect of process
(:methods
)
)
(deftype camera-tracker (process)
@@ -95,7 +90,6 @@
:method-count-assert 15
:size-assert #xe0
:flag-assert #xf007000e0
;; inherited inspect of process
;; field ~Tuserdata is a basic loaded with a signed load
(:methods
(dummy-14 () none 14)
@@ -114,7 +108,6 @@
:method-count-assert 20
:size-assert #xd0
:flag-assert #x14006000d0
;; inherited inspect of process-drawable
)
(deftype swingpole (process)
@@ -127,7 +120,6 @@
:method-count-assert 14
:size-assert #x98
:flag-assert #xe00300098
;; inherited inspect of process
)
(deftype gui-query (structure)
@@ -175,6 +167,6 @@
:size-assert #x70
:flag-assert #xf00000070
(:methods
(dummy-14 () none 14)
(die () _type_ :state 14)
)
)
+107 -2
View File
@@ -18,9 +18,114 @@
(define-extern process-grab? (function process symbol))
(define-extern camera-change-to (function string int symbol none)) ;; TODO - not confirmed yet
(define-extern process-release? (function process symbol))
;; TODO - for bird-lady-beach
(define-extern manipy-init (function trsqv vector entity skeleton-group none)) ;; TODO - not confirmed yet
;; TODO - for projectiles | dark-eco-pool
(define-extern part-tracker-init (function sparticle-launch-group int basic basic basic vector none)) ;; TODO - not confirmed
;; TODO - for target-part
(define-extern process-drawable-random-point! (function process-drawable vector vector))
;; TODO PLACEHOLDER STATE
(defstate manipy-idle (manipy)
:code (behavior ()
(loop
(suspend)
)
)
)
(defbehavior manipy-init manipy ((arg0 vector) (arg1 entity) (arg2 skeleton-group) (arg3 vector))
(stack-size-set! (-> self main-thread) 128)
(logior! (-> self mask) (process-mask heap-shrunk))
(set! (-> self entity) arg1)
(cond
((= arg3 'collide-shape-moving)
(let
((s4-1
(new
'process
'collide-shape-moving
self
(collide-list-enum hit-by-player)
)
)
)
(set! (-> s4-1 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-1 reaction) default-collision-reaction)
(set! (-> s4-1 no-reaction) nothing)
(set-vector!
(->
(new 'process 'collide-shape-prim-sphere s4-1 (the-as uint 0))
local-sphere
)
0.0
0.0
0.0
4096.0
)
(dummy-46 s4-1)
(set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w)))
(dummy-50 s4-1)
(set! (-> self root) s4-1)
)
)
(arg3
(let
((s4-2
(new 'process 'collide-shape self (collide-list-enum hit-by-player))
)
)
(let
((s2-0 (new 'process 'collide-shape-prim-sphere s4-2 (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (the-as uint #x8040))
(set! (-> s2-0 collide-with) (the-as uint 16))
(set-vector!
(-> s2-0 local-sphere)
(-> arg3 x)
(-> arg3 y)
(-> arg3 z)
(-> arg3 w)
)
)
(dummy-46 s4-2)
(set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w)))
(dummy-50 s4-2)
(set! (-> self root) s4-2)
)
)
(else
(set! (-> self root) (new 'process 'trsqv))
)
)
;;(set! (-> self root trans quad) (-> arg0 quad))
;;(dummy-14 self arg2 '())
;;(if (type-type? (-> self root type) collide-shape)
;;(dummy-47 (-> self root))
;;)
;;(set! (-> self shadow-backup) (-> self draw shadow))
(set! (-> self new-trans-hook) nothing)
(set! (-> self cur-trans-hook) nothing)
(set! (-> self new-post-hook) nothing)
(set! (-> self cur-post-hook) nothing)
(set! (-> self cur-event-hook) #f)
(set! (-> self cur-grab-handle) (the-as handle #f))
(set! (-> self cur-target-handle) (the-as handle #f))
(set! (-> self clone-copy-trans) #t)
(set! (-> self draw?) #t)
(cond
((nonzero? (-> self skel))
(set! (-> self new-joint-anim) (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
(set! (-> self anim-mode) 'loop)
)
(else
(set! (-> self anim-mode) 'still)
)
)
(set! (-> self event-hook) (-> manipy-idle event))
(go manipy-idle)
(none)
)
+1 -1
View File
@@ -127,7 +127,7 @@
:size-assert #xc
:flag-assert #xa0000000c
(:methods
(dummy-9 (_type_) none 9)
(draw (_type_) none 9)
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -566,7 +566,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'sparticle-track-root-prim
:sym 'sparticle-track-root-prim
)
(new 'static 'sp-field-init-spec :field #x43)
)
+1 -1
View File
@@ -29,7 +29,7 @@
(dialog-volume float :offset-assert 12)
(process-mask process-mask :offset-assert 16)
(common-page int32 :offset-assert 20)
(language int64 :offset-assert 24)
(language language-enum :offset-assert 24)
(screenx int32 :offset-assert 32)
(screeny int32 :offset-assert 36)
(vibration symbol :offset-assert 40)
+2 -2
View File
@@ -154,7 +154,7 @@
(set! (-> obj bg-a-force) (the-as float (-> conn param2)))
)
(('language)
(set! (-> obj language) (the-as int (-> conn param3)))
(set! (-> obj language) (the-as language-enum (-> conn param3)))
)
(('vibration)
(set! (-> obj vibration) (the-as symbol (-> conn param1)))
@@ -408,7 +408,7 @@
(set! (-> gp-0 ambient-volume-movie) (the float (* 5 (the int (+ 0.5 (* 11.0 f0-2))))))
(set! (-> gp-0 dialog-volume-hint) (the float (* 5 (the int (+ 0.5 (* 16.0 f0-2))))))
)
(set! (-> gp-0 language) (the-as int (scf-get-language)))
(set! (-> gp-0 language) (scf-get-language))
(set! (-> gp-0 process-mask) (process-mask execute sleep))
(set! (-> gp-0 screenx) 0)
(set! (-> gp-0 screeny) 0)
+2 -2
View File
@@ -62,7 +62,7 @@
(set-hud-aspect-ratio (get-aspect-ratio) arg0)
)
(if *progress-process*
(TODO-RENAME-23 (-> *progress-process* 0) (get-aspect-ratio) arg0)
(adjust-ratios (-> *progress-process* 0) (get-aspect-ratio) arg0)
)
(let ((v0-3 0))
)
@@ -97,7 +97,7 @@
(set-hud-aspect-ratio arg0 (get-video-mode))
)
(if *progress-process*
(TODO-RENAME-23 (-> *progress-process* 0) arg0 (get-video-mode))
(adjust-ratios (-> *progress-process* 0) arg0 (get-video-mode))
)
(let ((v0-2 0))
)
+6 -6
View File
@@ -230,12 +230,12 @@
(set-draw-env (-> disp draw1) psm w h ztest zpsm 320)
;; initialize a bunch of counters
(set! (-> disp base-frame-counter) #x493e0)
(set! (-> disp game-frame-counter) #x493e0)
(set! (-> disp real-frame-counter) #x493e0)
(set! (-> disp part-frame-counter) #x493e0)
(set! (-> disp integral-frame-counter) #x493e0)
(set! (-> disp real-integral-frame-counter) #x493e0)
(set! (-> disp base-frame-counter) (seconds 1000))
(set! (-> disp game-frame-counter) (seconds 1000))
(set! (-> disp real-frame-counter) (seconds 1000))
(set! (-> disp part-frame-counter) (seconds 1000))
(set! (-> disp integral-frame-counter) (seconds 1000))
(set! (-> disp real-integral-frame-counter) (seconds 1000))
;; and the "old" version, which I think was their value on the last... frame?
(set! (-> disp old-base-frame-counter) (+ (-> disp base-frame-counter) -1))
+4 -4
View File
@@ -36,8 +36,8 @@
(deftype sprite-array-2d (basic)
((num-sprites int32 2 :offset-assert 4)
(num-valid int32 2 :offset-assert 12)
(vec-data uint32 :offset-assert 20)
(adgif-data uint32 :offset-assert 24)
(vec-data pointer :offset-assert 20)
(adgif-data (inline-array adgif-shader) :offset-assert 24)
(pad uint128 4 :offset-assert 32)
(data uint128 1 :offset-assert 96)
)
@@ -78,8 +78,8 @@
(deftype sprite-array-3d (basic)
((num-sprites int32 2 :offset-assert 4)
(num-valid int32 2 :offset-assert 12)
(vec-data uint32 :offset-assert 20)
(adgif-data uint32 :offset-assert 24)
(vec-data pointer :offset-assert 20)
(adgif-data (inline-array adgif-shader) :offset-assert 24)
(data uint128 1 :offset-assert 32)
)
(:methods
+9 -9
View File
@@ -398,15 +398,15 @@
(set! (-> v0-0 num-valid 1) 0)
;; internally, we put the vec-data and then the adgif-data
(set! (-> v0-0 vec-data) (the-as uint (-> v0-0 data)))
(set! (-> v0-0 adgif-data) (the-as uint (&-> v0-0 data vec-data-size)))
(set! (-> v0-0 vec-data) (-> v0-0 data))
(set! (-> v0-0 adgif-data) (the-as (inline-array adgif-shader) (&-> v0-0 data vec-data-size)))
v0-0
)
)
(defmethod new sprite-array-3d ((allocation symbol) (type-to-make type) (group-0-size int) (group-1-size int))
"Allocate a sprite-array for 3d sprites. There are two groups, each can contain the given number of sprites.
Group 1 size is zero in practive for 3d."
Group 1 size is zero in practice for 3d."
(let* ((sprite-count (+ group-0-size group-1-size))
(vec-data-size (* 3 sprite-count))
(adgif-data-size (* 5 sprite-count))
@@ -419,8 +419,8 @@
(set! (-> v0-0 num-sprites 1) group-1-size)
(set! (-> v0-0 num-valid 0) 0)
(set! (-> v0-0 num-valid 1) 0)
(set! (-> v0-0 vec-data) (the-as uint (-> v0-0 data)))
(set! (-> v0-0 adgif-data) (the-as uint (&-> v0-0 data vec-data-size)))
(set! (-> v0-0 vec-data) (-> v0-0 data))
(set! (-> v0-0 adgif-data) (the-as (inline-array adgif-shader) (&-> v0-0 data vec-data-size)))
v0-0
)
)
@@ -606,7 +606,7 @@
;; second packet is vector data (3 qw / sprite)
(let ((qwc-pkt2 (* 3 num-sprites)))
;; we do a ref to the vec-data and don't actually copy it into the dma-buffer
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt2 (+ (-> sprites vec-data) (the-as uint (* 48 start-sprite-idx)))
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt2 (&+ (-> sprites vec-data) (* 48 start-sprite-idx))
(new 'static 'vif-tag :cmd (vif-cmd nop))
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc-pkt2
:imm (new 'static 'vif-unpack-imm :flg 1 :addr 1))
@@ -615,7 +615,7 @@
;; third packet is adgif data (5 qw/sprite)
(let ((qwc-pkt3 (* 5 num-sprites)))
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt3 (+ (-> sprites adgif-data) (the-as uint (* 80 start-sprite-idx)))
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt3 (&+ (-> sprites adgif-data) (* 80 start-sprite-idx))
(new 'static 'vif-tag :cmd (vif-cmd nop))
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc-pkt3
:imm (new 'static 'vif-unpack-imm :flg 1 :addr 145))
@@ -676,7 +676,7 @@
;; second packet is vector data (3 qw / sprite)
(let ((qwc-pkt2 (* 3 num-sprites)))
;; we do a ref to the vec-data and don't actually copy it into the dma-buffer
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt2 (+ (-> sprites vec-data) (the-as uint (* 48 start-sprite-idx)))
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt2 (&+ (-> sprites vec-data) (* 48 start-sprite-idx))
(new 'static 'vif-tag :cmd (vif-cmd nop))
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc-pkt2
:imm (new 'static 'vif-unpack-imm :flg 1 :addr 1))
@@ -685,7 +685,7 @@
;; third packet is adgif data (5 qw/sprite)
(let ((qwc-pkt3 (* 5 num-sprites)))
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt3 (+ (-> sprites adgif-data) (the-as uint (* 80 start-sprite-idx)))
(dma-buffer-add-ref-vif2 dma-buff qwc-pkt3 (&+ (-> sprites adgif-data) (* 80 start-sprite-idx))
(new 'static 'vif-tag :cmd (vif-cmd nop))
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num qwc-pkt3
:imm (new 'static 'vif-unpack-imm :flg 1 :addr 145))
+5
View File
@@ -153,6 +153,11 @@
`(set! ,place (seek ,place ,target ,rate))
)
(defmacro seekl! (place target rate)
"Macro to use seekl in-place. place is the base, and where the result is stored."
`(set! ,place (seekl ,place ,target ,rate))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; integer utility
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+5 -5
View File
@@ -52,15 +52,15 @@
"Block here, waiting for the memory card to finish being read/written.
Note - this will freeze the entire game, so this should not be used
outside of debugging."
(local-vars (v0-0 int))
(set! v0-0 0)
(while (zero? v0-0)
;; run the memory card state machine (in C Kenrel)
(let ((v0-0 0))
(while (zero? v0-0)
;; run the memory card state machine (in C Kernel)
(mc-run)
;; see if we got a good response
(set! v0-0 (mc-check-result))
)
v0-0
v0-0
)
)
(defun show-mc-info ((dma-buf dma-buffer))
+43
View File
@@ -349,6 +349,14 @@
)
(defmacro cpad-pressed (pad-idx)
`(-> *cpad-list* cpads ,pad-idx button0-rel 0)
)
(defmacro cpad-hold (pad-idx)
`(-> *cpad-list* cpads ,pad-idx button0-abs 0)
)
(defmacro cpad-pressed? (pad-idx &rest buttons)
`(logtest? (-> *cpad-list* cpads ,pad-idx button0-rel 0) (pad-buttons ,@buttons))
)
@@ -357,3 +365,38 @@
`(logtest? (-> *cpad-list* cpads ,pad-idx button0-abs 0) (pad-buttons ,@buttons))
)
(defmacro cpad-clear-buttons! (pad-idx &rest buttons)
`(begin
(logclear! (-> *cpad-list* cpads ,pad-idx button0-abs 0) (pad-buttons ,@buttons))
(logclear! (-> *cpad-list* cpads ,pad-idx button0-rel 0) (pad-buttons ,@buttons))
)
)
(defmacro cpad-change-time (pad-idx)
`(-> *cpad-list* cpads ,pad-idx change-time)
)
(defmacro check-cheat-code (cheat-var pad-idx buttons &rest body)
"execute body when a cheat code made up of sequential inputs has been inputted"
`(when (nonzero? (cpad-pressed ,pad-idx)) ;; only check when some button has been pressed
(case ,cheat-var
,@(apply-i
(lambda (x i)
`((,i)
(if (cpad-pressed? ,pad-idx ,x)
,(if (< i (- (length buttons) 1))
`(1+! ,cheat-var)
`(begin ,@body (set! ,cheat-var 0))
)
(set! ,cheat-var 0)
)
)
)
buttons)
)
)
)
+50 -16
View File
@@ -5,6 +5,9 @@
;; name in dgo: gsound
;; dgos: GAME, ENGINE
;; use this constant to enable/disable the sound functions. debug purposes.
(defglobalconstant PC_DEBUG_SOUND_ENABLE #f)
;; The sound playback stuff is all on the IOP so we use IOP RPCs to control it.
;; Ther is a "player" that plays sound effects, and a "loader" that takes care of loading banks.
(define *sound-player-rpc* (new 'global 'rpc-buffer-pair (the uint (size-of sound-rpc-union)) (the-as uint 128) RPC-SOUND-PLAYER))
@@ -163,7 +166,7 @@
0
)
(defun set-language ((lang int))
(defun set-language ((lang language-enum))
(kset-language lang)
(let ((cmd (the sound-rpc-set-language (add-element *sound-loader-rpc*))))
(set! (-> cmd command) (sound-command set-language))
@@ -228,17 +231,17 @@
(cond
((not (is-cd-in?))
(if (or (not *progress-process*)
(!= (-> *progress-process* 0 display-state) 32))
(!= (-> *progress-process* 0 display-state) (progress-screen no-disc)))
(activate-progress *dproc* 32)
(activate-progress *dproc* (progress-screen no-disc))
)
)
((not (is-cd-good?))
(if (or (not *progress-process*)
(!= (-> *progress-process* 0 display-state) 33))
(!= (-> *progress-process* 0 display-state) (progress-screen bad-disc)))
(activate-progress *dproc* 33)
(activate-progress *dproc* (progress-screen bad-disc))
)
)
)
@@ -301,15 +304,18 @@
(defun sound-set-volume ((group uint) (volume float))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-set-master-volume (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command set-master-volume))
(set! (-> cmd group) group)
(set! (-> cmd volume) (the int (* 10.24 volume)))
)
)
0
)
(defun sound-set-reverb ((arg0 int) (arg1 float) (arg2 float) (arg3 uint))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the-as sound-rpc-set-reverb (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command set-reverb))
(set! (-> cmd core) arg3)
@@ -317,37 +323,42 @@
(set! (-> cmd left) (the-as uint (the int (* 32767.0 arg1))))
(set! (-> cmd right) (the-as uint (the int (* 32767.0 arg2))))
)
)
0
)
(defun sound-set-ear-trans ((ear-trans vector) (cam-trans vector) (cam-angle float))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-set-ear-trans (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command set-ear-trans))
(sound-trans-convert (-> cmd ear-trans) ear-trans)
(sound-trans-convert (-> cmd cam-trans) cam-trans)
(set! (-> cmd cam-angle) (sound-angle-convert cam-angle))
)
)
0
)
(defmacro sound-trans-from-process (cmd sound-trans)
"Macro for getting an appropriate sound-trans from a process-drawable, if possible"
`(begin
(with-pp
(let ((proc (the process-drawable pp)))
(when (= ,sound-trans #t)
(if (and proc
(type-type? (-> proc type) process-drawable)
(nonzero? (-> proc root)))
(set! ,sound-trans (-> proc root trans))
(set! ,sound-trans (the vector #f))
)
`(with-pp
(let ((proc (the process-drawable pp)))
(format 0 "get proc~%")
(when (= ,sound-trans #t)
(format 0 "trans #t~%")
(if (and proc
(type-type? (-> proc type) process-drawable)
(nonzero? (-> proc root)))
(set! ,sound-trans (-> proc root trans))
(set! ,sound-trans (the vector #f))
)
(format 0 "trans is ~A~%" ,sound-trans)
)
)
(format 0 "convert~%" ,sound-trans)
(sound-trans-convert (-> ,cmd parms trans) ,sound-trans)
)
)
@@ -355,6 +366,7 @@
(defun sound-play-by-name ((name sound-name) (id sound-id) (vol int) (pitch int) (bend int) (group uint) (trans vector))
"Play a sound called name with the specified params"
(#when PC_DEBUG_SOUND_ENABLE
(let ((sound-trans trans))
(when *sound-player-enable*
(let ((cmd (the sound-rpc-play (get-sound-buffer-entry))))
@@ -368,16 +380,19 @@
(set! (-> cmd parms pitch-mod) pitch)
(set! (-> cmd parms bend) bend)
(format 0 "stfp~%")
(sound-trans-from-process cmd sound-trans)
)
)
)
)
id
)
(defun sound-play-by-spec ((spec sound-spec) (id sound-id) (sound-trans vector))
"Play a sound from the given spec"
(#when PC_DEBUG_SOUND_ENABLE
(when *sound-player-enable*
(let ((cmd (the sound-rpc-play (get-sound-buffer-entry))))
@@ -397,76 +412,92 @@
(sound-trans-from-process cmd sound-trans)
)
)
)
id
)
(defun sound-pause ((id sound-id))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-pause-sound (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command pause-sound))
(set! (-> cmd id) id)
)
)
0
)
(defun sound-stop ((id sound-id))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-stop-sound (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command stop-sound))
(set! (-> cmd id) id)
)
)
0
)
(defun sound-continue ((id sound-id))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-continue-sound (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command continue-sound))
(set! (-> cmd id) id)
)
)
0
)
(defun sound-group-pause ((group uint))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-pause-group (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command pause-group))
(set! (-> cmd group) group)
)
)
0
)
(defun sound-group-stop ((group uint))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-stop-group (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command stop-group))
(set! (-> cmd group) group)
)
)
0
)
(defun sound-group-continue ((group uint))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-continue-group (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command continue-group))
(set! (-> cmd group) group)
)
)
0
)
(defun sound-set-falloff-curve ((curve int) (falloff float) (ease float))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-set-falloff-curve (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command set-falloff-curve))
(set! (-> cmd curve) curve)
(set! (-> cmd falloff) (the int (* 4096.0 falloff)))
(set! (-> cmd ease) (the int (* 4096.0 ease)))
)
)
0
)
(defun sound-set-sound-falloff ((name sound-name) (falloff-min int) (falloff-max int) (curve int))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-set-sound-falloff (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command set-sound-falloff))
(set! (-> cmd name) name)
@@ -474,15 +505,18 @@
(set! (-> cmd max) falloff-max)
(set! (-> cmd curve) curve)
)
)
0
)
(defun sound-set-flava ((flava uint))
(#when PC_DEBUG_SOUND_ENABLE
(let ((cmd (the sound-rpc-set-flava (get-sound-buffer-entry))))
(set! (-> cmd command) (sound-command set-flava))
(set! (-> cmd flava) flava)
)
)
0
)
@@ -858,7 +892,7 @@
2 : flutflut
3 : to-maincave
4 : to-snow
5 : sage-green
5 : sage
6 : assistant
7 : birdlady
8 : mayor
+41 -35
View File
@@ -18,37 +18,37 @@
(define *sp-60-hz* #t)
(deftype sparticle-cpuinfo (structure)
((sprite sprite-vec-data-2d :offset-assert 0)
(adgif adgif-shader :offset-assert 4)
(radius float :offset-assert 8)
(omega float :offset-assert 12)
(vel-sxvel vector :inline :offset-assert 16)
(rot-syvel vector :inline :offset-assert 32)
(fade rgbaf :inline :offset-assert 48)
(acc vector :inline :offset-assert 64)
(rotvel3d quaternion :inline :offset-assert 80)
(vel vector3s :inline :offset 16)
(accel vector3s :inline :offset 64)
(scalevelx float :offset 28)
(scalevely float :offset 44)
(friction float :offset-assert 96)
(timer int32 :offset-assert 100)
(flags uint32 :offset-assert 104)
(user-int32 int32 :offset-assert 108)
(user-uint32 uint32 :offset 108)
(user-float float :offset 108)
(user-pntr uint32 :offset 108)
(user-sprite sprite-vec-data-2d :offset 108)
(func basic :offset-assert 112)
(next-time uint32 :offset-assert 116)
(next-launcher basic :offset-assert 120)
(cache-alpha float :offset-assert 124)
(valid basic :offset-assert 128)
(key basic :offset-assert 132)
(binding sparticle-launch-state :offset-assert 136)
(data uint32 1 :offset 12)
(dataf float 1 :offset 12)
(datac uint8 1 :offset 12)
((sprite sprite-vec-data-2d :offset-assert 0)
(adgif adgif-shader :offset-assert 4)
(radius float :offset-assert 8)
(omega float :offset-assert 12)
(vel-sxvel vector :inline :offset-assert 16)
(rot-syvel vector :inline :offset-assert 32)
(fade rgbaf :inline :offset-assert 48)
(acc vector :inline :offset-assert 64)
(rotvel3d quaternion :inline :offset-assert 80)
(vel vector3s :inline :offset 16)
(accel vector3s :inline :offset 64)
(scalevelx float :offset 28)
(scalevely float :offset 44)
(friction float :offset-assert 96)
(timer int32 :offset-assert 100)
(flags uint32 :offset-assert 104)
(user-int32 int32 :offset-assert 108)
(user-uint32 uint32 :offset 108)
(user-float float :score 100 :offset 108)
(user-pntr uint32 :offset 108)
(user-sprite sprite-vec-data-2d :offset 108)
(func basic :offset-assert 112)
(next-time uint32 :offset-assert 116)
(next-launcher basic :offset-assert 120)
(cache-alpha float :offset-assert 124)
(valid basic :offset-assert 128)
(key sparticle-launch-control :offset-assert 132)
(binding sparticle-launch-state :offset-assert 136)
(data uint32 1 :offset 12)
(dataf float 1 :offset 12)
(datac uint8 1 :offset 12)
)
:method-count-assert 9
:size-assert #x8c
@@ -73,14 +73,17 @@
(num-alloc uint32 2 :offset-assert 20)
(is-3d basic :offset-assert 28)
(flags uint32 :offset-assert 32)
(alloc-table uint32 :offset-assert 36)
(cpuinfo-table sparticle-cpuinfo :offset-assert 40)
(vecdata-table uint32 :offset-assert 44)
(adgifdata-table uint32 :offset-assert 48)
(alloc-table (pointer uint64) :offset-assert 36)
(cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40)
(vecdata-table pointer :offset-assert 44)
(adgifdata-table (inline-array adgif-shader) :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
(:methods
(new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0)
)
)
(define-extern part-group-pointer? (function pointer symbol))
@@ -92,3 +95,6 @@
;; TODO - for basically everything particle related
(define-extern *sp-particle-system-2d* sparticle-system)
(define-extern *sp-particle-system-3d* sparticle-system)
(defun-extern kill-all-particles-with-key sparticle-launch-control none)
@@ -8,16 +8,17 @@
(deftype sp-field-init-spec (structure)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-value int32 :offset-assert 4)
(random-range int32 :offset-assert 8)
(random-mult int32 :offset-assert 12)
(initial-valuef float :offset 4) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(random-rangef float :offset 8) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(random-multf float :offset 12) ;; TODO - floats suck - some of these values end up being NaN - these should come before the int32 fields
(func symbol :offset 4)
(initial-valuef float :offset-assert 4)
(random-rangef float :offset-assert 8)
(random-multf float :offset-assert 12)
(initial-value int32 :offset 4)
(random-range int32 :offset 8)
(random-mult int32 :offset 12)
(sym symbol :offset 4) ;; moved
(func function :offset 4)
(tex uint32 :offset 4)
(pntr uint32 :offset 4)
(sym basic :offset 4)
(pntr pointer :offset 4)
;; gap
(sound basic :offset 4)
)
:method-count-assert 9
@@ -36,15 +37,15 @@
)
(deftype sparticle-group-item (structure)
((launcher uint32 :offset-assert 0)
(fade-after meters :offset-assert 4)
(falloff-to meters :offset-assert 8)
(flags uint16 :offset-assert 12)
(period uint16 :offset-assert 14)
(length uint16 :offset-assert 16)
(offset uint16 :offset-assert 18)
(hour-mask uint32 :offset-assert 20)
(binding uint32 :offset-assert 24)
((launcher uint32 :offset-assert 0)
(fade-after meters :offset-assert 4)
(falloff-to meters :offset-assert 8)
(flags uint16 :offset-assert 12)
(period uint16 :offset-assert 14)
(length uint16 :offset-assert 16)
(offset uint16 :offset-assert 18)
(hour-mask uint32 :offset-assert 20)
(binding uint32 :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -52,20 +53,20 @@
)
(deftype sparticle-launch-state (structure)
((group-item sparticle-group-item :offset-assert 0)
(flags uint16 :offset-assert 4)
(randomize uint16 :offset-assert 6)
(origin vector :offset-assert 8)
(sprite3d sprite-vec-data-3d :offset-assert 12)
(sprite basic :offset-assert 16)
(offset uint32 :offset-assert 20)
(accum float :offset-assert 24)
(spawn-time uint32 :offset-assert 28)
(swarm basic :offset 20)
(seed uint32 :offset 24)
(time uint32 :offset 28)
(spec basic :offset 16)
(id uint32 :offset 12)
((group-item sparticle-group-item :offset-assert 0)
(flags uint16 :offset-assert 4)
(randomize uint16 :offset-assert 6)
(origin vector :offset-assert 8)
(sprite3d sprite-vec-data-3d :offset-assert 12)
(sprite basic :offset-assert 16)
(offset uint32 :offset-assert 20)
(accum float :offset-assert 24)
(spawn-time uint32 :offset-assert 28)
(swarm basic :offset 20)
(seed uint32 :offset 24)
(time uint32 :offset 28)
(spec basic :offset 16)
(id uint32 :offset 12)
)
:method-count-assert 9
:size-assert #x20
@@ -90,26 +91,25 @@
)
(deftype sparticle-launch-control (inline-array-class)
((group basic :offset-assert 16)
(proc basic :offset-assert 20)
(local-clock int32 :offset-assert 24)
(fade float :offset-assert 28)
(matrix int32 :offset-assert 32)
(last-spawn-frame int32 :offset-assert 36)
(last-spawn-time int32 :offset-assert 40)
(center vector :inline :offset-assert 48)
(data uint8 :dynamic :offset-assert 64)
((group sparticle-launch-group :offset-assert 16)
(proc process :offset-assert 20)
(local-clock int32 :offset-assert 24)
(fade float :offset-assert 28)
(matrix int32 :offset-assert 32)
(last-spawn-frame int32 :offset-assert 36)
(last-spawn-time int32 :offset-assert 40)
(center vector :inline :offset-assert 48)
(data sparticle-launch-state :inline :dynamic :offset-assert 64)
)
:method-count-assert 14
:size-assert #x40
:flag-assert #xe00000040
(:methods
(dummy-9 () none 9)
(initialize (_type_ sparticle-launch-group process) none 9)
(dummy-10 () none 10)
(dummy-11 (_type_ vector) none 11)
(deactivate (_type_) none 12)
(dummy-13 () none 13)
)
)
(set! (-> sparticle-launch-control heap-base) (the-as uint 32))
@@ -8,9 +8,35 @@
;; TODO - for shadow
(define *part-id-table* (new 'global 'boxed-array sparticle-launcher 3584))
(define *part-group-id-table* (new 'global 'boxed-array sparticle-launch-group 1024))
(define *particle-300hz-timer* 0)
;; TODO - for particle related code
(define-extern sp-launch-particles-var (function sparticle-system sparticle-launcher vector symbol symbol float none))
;; TODO - for static-screen
(defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process))
(let ((gp-0 (new 'process 'sparticle-launch-control (-> obj length))))
(when (zero? gp-0)
(go process-drawable-art-error "memory")
(return (the-as sparticle-launch-control 0))
)
;;(initialize gp-0 obj arg0)
gp-0
)
)
(defmethod deactivate sparticle-launch-control ((obj sparticle-launch-control))
(countdown (v1-0 (-> obj length))
(let ((a0-3 (-> obj data v1-0)))
(set! (-> a0-3 flags) (logand -3 (-> a0-3 flags)))
)
)
(set! (-> obj local-clock) 0)
(set! (-> obj fade) 1.0)
(kill-all-particles-with-key obj)
(if (> (-> obj matrix) 0)
(sprite-release-user-hvdf (-> obj matrix))
)
(none)
)
(define-extern lookup-part-group-by-name (function string basic))
+146
View File
@@ -8,6 +8,92 @@
;; TODO - for particle code
(define-extern sp-kill-particle (function sparticle-system sparticle-cpuinfo none))
(defmethod new sparticle-system
((allocation symbol)
(type-to-make type)
(arg0 int)
(arg1 int)
(arg2 symbol)
(arg3 pointer)
(arg4 (inline-array adgif-shader))
)
(let
((gp-0
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
)
)
(let* ((v1-3 (/ (+ arg0 63) 64))
(a0-2 (/ (+ arg1 63) 64))
(a1-2 (* v1-3 64))
(a2-2 (* a0-2 64))
(s2-1 (+ v1-3 a0-2))
(s5-1 (+ a1-2 a2-2))
)
(set! (-> gp-0 blocks 0) v1-3)
(set! (-> gp-0 length 0) (the-as uint a1-2))
(set! (-> gp-0 num-alloc 0) (the-as uint 0))
(set! (-> gp-0 blocks 1) a0-2)
(set! (-> gp-0 length 1) (the-as uint a2-2))
(set! (-> gp-0 num-alloc 1) (the-as uint 0))
(set! (-> gp-0 is-3d) arg2)
(set!
(-> gp-0 alloc-table)
(the-as (pointer uint64) (malloc 'global (* s2-1 8)))
)
(set!
(-> gp-0 cpuinfo-table)
(the-as (inline-array sparticle-cpuinfo) (malloc 'global (* 144 s5-1)))
)
(set! (-> gp-0 vecdata-table) arg3)
(set! (-> gp-0 adgifdata-table) arg4)
(dotimes (v1-5 s2-1)
(set! (-> gp-0 alloc-table v1-5) (the-as uint -1))
)
(dotimes (s4-1 s5-1)
(set! (-> gp-0 cpuinfo-table s4-1 valid) #f)
(set!
(-> gp-0 cpuinfo-table s4-1 sprite)
(the-as sprite-vec-data-2d (&+ (-> gp-0 vecdata-table) (* 48 s4-1)))
)
(set! (-> gp-0 cpuinfo-table s4-1 adgif) (-> gp-0 adgifdata-table s4-1))
(adgif-shader<-texture-simple!
(-> gp-0 adgifdata-table s4-1)
(the-as texture #f)
)
(set!
(-> gp-0 adgifdata-table s4-1 alpha)
(new 'static 'gs-miptbp :tbp1 #x48)
)
)
)
gp-0
)
)
(define *sp-particle-system-2d*
(new
'global
'sparticle-system
1920
128
#f
(-> *sprite-array-2d* vec-data)
(-> *sprite-array-2d* adgif-data)
)
)
(define *sp-particle-system-3d*
(new
'global
'sparticle-system
256
0
#t
(-> *sprite-array-3d* vec-data)
(-> *sprite-array-3d* adgif-data)
)
)
(defun set-particle-frame-time ((arg0 int))
(cond
((= arg0 5)
@@ -50,3 +136,63 @@
0
(none)
)
(defun sparticle-kill-it ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(set! (-> arg1 timer) 0)
(set! (-> arg1 func) (the-as basic 0))
(when (and (-> arg1 binding) (nonzero? (-> arg1 binding)))
(set! (-> arg1 binding flags) (logand -4 (-> arg1 binding flags)))
(set! (-> arg1 binding) #f)
)
(none)
)
(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control) (arg1 (function sparticle-system sparticle-cpuinfo none)) (arg2 sparticle-system))
(local-vars (sv-16 int))
(let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0)))
(s2-0 (&+ (-> arg2 vecdata-table) 0))
(s1-0 (+ (-> arg2 blocks 0) (-> arg2 blocks 1)))
)
(dotimes (s0-0 s1-0)
(cond
((!= (-> arg2 alloc-table s0-0) -1)
(set! sv-16 0)
(while (< sv-16 64)
(if
(and
(-> (the-as sparticle-cpuinfo s3-0) valid)
(= (-> (the-as sparticle-cpuinfo s3-0) key) arg0)
)
(arg1 arg2 (the-as sparticle-cpuinfo s3-0))
)
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1))
(&+! s2-0 48)
(set! sv-16 (+ sv-16 1))
)
)
(else
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 64))
(&+! s2-0 3072)
)
)
)
)
(none)
)
(defun forall-particles-with-key ((arg0 sparticle-launch-control) (arg1 (function sparticle-system sparticle-cpuinfo none)) (arg2 symbol) (arg3 symbol))
(if arg2
(forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*)
)
(if arg3
(forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*)
)
(none)
)
(defun kill-all-particles-with-key ((arg0 sparticle-launch-control))
(forall-particles-with-key arg0 sparticle-kill-it #t #t)
(none)
)
+3 -48
View File
@@ -2911,40 +2911,9 @@
(set! (-> self water flags) (the-as uint #x4000f0))
(reset-target-state #t)
(set! (-> self control unknown-vector52 quad) (-> self control trans quad))
(set!
(-> self control unknown-vector52 y)
(+ -819200.0 (-> self control unknown-vector52 y))
)
(set!(-> self control unknown-vector52 y) (+ -819200.0 (-> self control unknown-vector52 y)))
(set! (-> self align) (new 'process 'align-control self))
(let ((s5-1 (get-process *16k-dead-pool* sidekick #x4000)))
(set! (-> self sidekick) (the-as (pointer sidekick) (when s5-1
(let
((t9-37
(method-of-type
sidekick
activate
)
)
)
(t9-37
(the-as sidekick s5-1)
self
'sidekick
(the-as
pointer
#x70004000
)
)
)
(run-now-in-process
s5-1
init-sidekick
)
(-> s5-1 ppointer)
)
)
)
)
(set! (-> self sidekick) (make-init-process sidekick init-sidekick :from *16k-dead-pool* :to self :stack *scratch-memory-top*))
(set! (-> self manipy) (the-as (pointer manipy) #f))
(set! (-> self event-hook) target-generic-event-handler)
(set! (-> self current-level) #f)
@@ -2975,21 +2944,7 @@
(set! (-> *level* border?) #f)
(set! (-> *setting-control* default border-mode) #f)
(stop arg0)
(let* ((s5-0 (get-process *target-dead-pool* target #x4000))
(v1-3 (when s5-0
(let ((t9-2 (method-of-type target activate)))
(t9-2
(the-as target s5-0)
*target-pool*
'target
(&-> *dram-stack* 14336)
)
)
(run-now-in-process s5-0 init-target arg1)
(-> s5-0 ppointer)
)
)
)
(let ((v1-3 (make-init-process target init-target arg1 :from *target-dead-pool* :to *target-pool*)))
(if v1-3
(set! *target* (the-as target (-> v1-3 0 self)))
(set! *target* #f)
+11 -11
View File
@@ -1380,7 +1380,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-copy-target-y-rot
:sym 'birth-func-copy-target-y-rot
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -1514,7 +1514,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-copy-target-y-rot
:sym 'birth-func-copy-target-y-rot
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -1694,7 +1694,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'part-tracker-track-target-joint
:sym 'part-tracker-track-target-joint
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -4511,7 +4511,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-target-orient
:sym 'birth-func-target-orient
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -5343,7 +5343,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-target-orient
:sym 'birth-func-target-orient
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -5574,7 +5574,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-target-orient
:sym 'birth-func-target-orient
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -5804,7 +5804,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-target-orient
:sym 'birth-func-target-orient
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -9333,7 +9333,7 @@
(new 'static 'sp-field-init-spec
:field #x4
:flags #x5
:func 'birth-func-target-orient
:sym 'birth-func-target-orient
)
(new 'static 'sp-field-init-spec
:field #x6
@@ -9541,7 +9541,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'part-first-person-hud-left-func
:sym 'part-first-person-hud-left-func
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -9616,7 +9616,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'part-first-person-hud-right-func
:sym 'part-first-person-hud-right-func
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -9685,7 +9685,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'part-first-person-hud-selector-func
:sym 'part-first-person-hud-selector-func
)
(new 'static 'sp-field-init-spec :field #x43)
)
-216
View File
@@ -136,222 +136,6 @@
:flag-assert #x900000258
)
;; definition for method 3 of type target-bank
(defmethod inspect target-bank ((obj target-bank))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format
#t
"~Tjump-collide-offset: (meters ~m)~%"
(-> obj jump-collide-offset)
)
(format #t "~Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min))
(format #t "~Tjump-height-max: (meters ~m)~%" (-> obj jump-height-max))
(format
#t
"~Tdouble-jump-height-min: (meters ~m)~%"
(-> obj double-jump-height-min)
)
(format
#t
"~Tdouble-jump-height-max: (meters ~m)~%"
(-> obj double-jump-height-max)
)
(format
#t
"~Tflip-jump-height-min: (meters ~m)~%"
(-> obj flip-jump-height-min)
)
(format
#t
"~Tflip-jump-height-max: (meters ~m)~%"
(-> obj flip-jump-height-max)
)
(format
#t
"~Tduck-jump-height-min: (meters ~m)~%"
(-> obj duck-jump-height-min)
)
(format
#t
"~Tduck-jump-height-max: (meters ~m)~%"
(-> obj duck-jump-height-max)
)
(format
#t
"~Tflop-jump-height-min: (meters ~m)~%"
(-> obj flop-jump-height-min)
)
(format
#t
"~Tflop-jump-height-max: (meters ~m)~%"
(-> obj flop-jump-height-max)
)
(format
#t
"~Tattack-jump-height-min: (meters ~m)~%"
(-> obj attack-jump-height-min)
)
(format
#t
"~Tattack-jump-height-max: (meters ~m)~%"
(-> obj attack-jump-height-max)
)
(format
#t
"~Tedge-grab-jump-height-min: (meters ~m)~%"
(-> obj edge-grab-jump-height-min)
)
(format
#t
"~Tedge-grab-jump-height-max: (meters ~m)~%"
(-> obj edge-grab-jump-height-max)
)
(format
#t
"~Tswim-jump-height-min: (meters ~m)~%"
(-> obj swim-jump-height-min)
)
(format
#t
"~Tswim-jump-height-max: (meters ~m)~%"
(-> obj swim-jump-height-max)
)
(format
#t
"~Ttube-jump-height-min: (meters ~m)~%"
(-> obj tube-jump-height-min)
)
(format
#t
"~Ttube-jump-height-max: (meters ~m)~%"
(-> obj tube-jump-height-max)
)
(format #t "~Twheel-duration: ~D~%" (-> obj wheel-duration))
(format #t "~Twheel-jump-pre-window: ~D~%" (-> obj wheel-jump-pre-window))
(format #t "~Twheel-jump-post-window: ~D~%" (-> obj wheel-jump-post-window))
(format #t "~Twheel-timeout: ~D~%" (-> obj wheel-timeout))
(format #t "~Twheel-speed-min: (meters ~m)~%" (-> obj wheel-speed-min))
(format #t "~Twheel-speed-inc: (meters ~m)~%" (-> obj wheel-speed-inc))
(format #t "~Twheel-flip-duration: ~D~%" (-> obj wheel-flip-duration))
(format #t "~Twheel-flip-height: (meters ~m)~%" (-> obj wheel-flip-height))
(format #t "~Twheel-flip-dist: (meters ~m)~%" (-> obj wheel-flip-dist))
(format
#t
"~Twheel-flip-art-height: (meters ~m)~%"
(-> obj wheel-flip-art-height)
)
(format
#t
"~Twheel-flip-art-dist: (meters ~m)~%"
(-> obj wheel-flip-art-dist)
)
(format
#t
"~Tduck-slide-distance: (meters ~m)~%"
(-> obj duck-slide-distance)
)
(format #t "~Tfall-far: (meters ~m)~%" (-> obj fall-far))
(format #t "~Tfall-far-inc: (meters ~m)~%" (-> obj fall-far-inc))
(format #t "~Tattack-timeout: ~D~%" (-> obj attack-timeout))
(format #t "~Tground-timeout: ~D~%" (-> obj ground-timeout))
(format #t "~Tslide-down-timeout: ~D~%" (-> obj slide-down-timeout))
(format #t "~Tfall-timeout: ~D~%" (-> obj fall-timeout))
(format
#t
"~Tfall-stumble-threshold: (meters ~m)~%"
(-> obj fall-stumble-threshold)
)
(format
#t
"~Tyellow-projectile-speed: (meters ~m)~%"
(-> obj yellow-projectile-speed)
)
(format
#t
"~Thit-invulnerable-timeout: ~D~%"
(-> obj hit-invulnerable-timeout)
)
(format #t "~Trun-cycle-length: ~f~%" (-> obj run-cycle-length))
(format #t "~Twalk-cycle-dist: (meters ~m)~%" (-> obj walk-cycle-dist))
(format #t "~Twalk-up-cycle-dist: (meters ~m)~%" (-> obj walk-up-cycle-dist))
(format
#t
"~Twalk-down-cycle-dist: (meters ~m)~%"
(-> obj walk-down-cycle-dist)
)
(format
#t
"~Twalk-side-cycle-dist: (meters ~m)~%"
(-> obj walk-side-cycle-dist)
)
(format #t "~Trun-cycle-dist: (meters ~m)~%" (-> obj run-cycle-dist))
(format #t "~Trun-up-cycle-dist: (meters ~m)~%" (-> obj run-up-cycle-dist))
(format
#t
"~Trun-down-cycle-dist: (meters ~m)~%"
(-> obj run-down-cycle-dist)
)
(format
#t
"~Trun-side-cycle-dist: (meters ~m)~%"
(-> obj run-side-cycle-dist)
)
(format
#t
"~Trun-wall-cycle-dist: (meters ~m)~%"
(-> obj run-wall-cycle-dist)
)
(format
#t
"~Tduck-walk-cycle-dist: (meters ~m)~%"
(-> obj duck-walk-cycle-dist)
)
(format
#t
"~Twade-shallow-walk-cycle-dist: (meters ~m)~%"
(-> obj wade-shallow-walk-cycle-dist)
)
(format
#t
"~Twade-deep-walk-cycle-dist: (meters ~m)~%"
(-> obj wade-deep-walk-cycle-dist)
)
(format #t "~Tsmack-surface-dist: (meters ~m)~%" (-> obj smack-surface-dist))
(format
#t
"~Tsmack-surface-height: (meters ~m)~%"
(-> obj smack-surface-height)
)
(format #t "~Tmin-dive-depth: (meters ~m)~%" (-> obj min-dive-depth))
(format #t "~Troot-radius: (meters ~m)~%" (-> obj root-radius))
(format #t "~Troot-offset: ~`vector`P~%" (-> obj root-offset))
(format #t "~Tbody-radius: (meters ~m)~%" (-> obj body-radius))
(format #t "~Tedge-radius: (meters ~m)~%" (-> obj edge-radius))
(format #t "~Tedge-offset: ~`vector`P~%" (-> obj edge-offset))
(format #t "~Thead-radius: (meters ~m)~%" (-> obj head-radius))
(format #t "~Thead-height: (meters ~m)~%" (-> obj head-height))
(format #t "~Thead-offset: ~`vector`P~%" (-> obj head-offset))
(format #t "~Tspin-radius: (meters ~m)~%" (-> obj spin-radius))
(format #t "~Tspin-offset: ~`vector`P~%" (-> obj spin-offset))
(format #t "~Tduck-spin-radius: (meters ~m)~%" (-> obj duck-spin-radius))
(format #t "~Tduck-spin-offset: ~`vector`P~%" (-> obj duck-spin-offset))
(format #t "~Tpunch-radius: (meters ~m)~%" (-> obj punch-radius))
(format #t "~Tpunch-offset: ~`vector`P~%" (-> obj punch-offset))
(format #t "~Tuppercut-radius: (meters ~m)~%" (-> obj uppercut-radius))
(format #t "~Tuppercut0-offset: ~`vector`P~%" (-> obj uppercut0-offset))
(format #t "~Tuppercut1-offset: ~`vector`P~%" (-> obj uppercut1-offset))
(format #t "~Tflop-radius: (meters ~m)~%" (-> obj flop-radius))
(format #t "~Tflop0-offset: ~`vector`P~%" (-> obj flop0-offset))
(format #t "~Tflop1-offset: ~`vector`P~%" (-> obj flop1-offset))
(format #t "~Tstuck-time: (seconds ~e)~%" (-> obj stuck-time))
(format #t "~Tstuck-timeout: (seconds ~e)~%" (-> obj stuck-timeout))
(format #t "~Tstuck-distance: (meters ~m)~%" (-> obj stuck-distance))
(format #t "~Ttongue-pull-speed-min: ~f~%" (-> obj tongue-pull-speed-min))
(format #t "~Ttongue-pull-speed-max: ~f~%" (-> obj tongue-pull-speed-max))
(format #t "~Tyellow-attack-timeout: ~D~%" (-> obj yellow-attack-timeout))
obj
)
;; definition for symbol *TARGET-bank*, type target-bank
(define
*TARGET-bank*
+7 -1
View File
@@ -5,8 +5,14 @@
;; name in dgo: hud-classes
;; dgos: GAME, ENGINE
(define-extern *fuelcell-naked-sg* skeleton-group)
(defun hud-hidden? ()
#t
)
;; TODO - for assistant-firecanyon
(define-extern hide-hud (function none))
(define-extern hud-hidden? (function symbol))
;; TODO - for static-screen
(define-extern hide-hud-quick (function none))
+6 -4
View File
@@ -7,7 +7,7 @@
;; definition of type hud-icon
(deftype hud-icon (basic)
((icon uint32 :offset-assert 4)
((icon (pointer manipy) :offset-assert 4)
(icon-y int32 :offset-assert 8)
(icon-x int32 :offset-assert 12)
(icon-z int32 :offset-assert 16)
@@ -21,7 +21,7 @@
;; definition of type hud-particle
(deftype hud-particle (basic)
((part basic :offset-assert 4)
((part sparticle-launch-control :offset-assert 4)
(init-pos vector :inline :offset-assert 16)
(pos vector :inline :offset-assert 32)
(prev-pos vector :inline :offset-assert 48)
@@ -114,5 +114,7 @@
)
)
;; TODO - for logic-target
(define-extern activate-hud (function process none))
(defun-extern activate-hud process none)
(defun-extern activate-orb-all int int)
+103 -64
View File
@@ -5,9 +5,6 @@
;; name in dgo: progress-h
;; dgos: GAME, ENGINE
;; progress screen display-state enum:
;; 32 - nocd
;; 33 - dirtycd
(deftype count-info (structure)
((money-count int32 :offset-assert 0)
@@ -57,20 +54,59 @@
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
(param3 int32 :offset-assert 32)
(value-to-modify uint32 :offset-assert 36)
(value-to-modify pointer :offset-assert 36)
)
:method-count-assert 9
:size-assert #x28
:flag-assert #x900000028
)
(defenum progress-screen
:type int64
(invalid -1)
(fuel-cell 0)
(money 1)
(buzzer 2)
(settings 3)
(game-settings 4)
(graphic-settings 5)
(sound-settings 6)
(memcard-no-space 7)
(memcard-not-inserted 8)
(memcard-not-formatted 9)
(memcard-format 10)
(memcard-data-exists 11)
(memcard-loading 12)
(memcard-saving 13)
(memcard-formatting 14)
(memcard-creating 15)
(load-game 16)
(save-game 17)
(save-game-title 18)
(memcard-insert 19)
(memcard-error-loading 20)
(memcard-error-saving 21)
(memcard-removed 22)
(memcard-no-data 23)
(memcard-error-formatting 24)
(memcard-error-creating 25)
(memcard-auto-save-error 26)
(title 27)
(settings-title 28)
(auto-save 29)
(pal-change-to-60hz 30)
(pal-now-60hz 31)
(no-disc 32)
(bad-disc 33)
(quit 34)
)
(deftype progress (process)
((current-debug-string int32 :offset-assert 112)
(current-debug-language int32 :offset-assert 116)
(current-debug-group int32 :offset-assert 120)
(in-out-position int32 :offset-assert 124)
(display-state uint64 :offset-assert 128)
(next-display-state uint64 :offset-assert 136)
(display-state progress-screen :offset-assert 128)
(next-display-state progress-screen :offset-assert 136)
(option-index int32 :offset-assert 144)
(selected-option basic :offset-assert 148)
(completion-percentage float :offset-assert 152)
@@ -108,80 +144,83 @@
(total-nb-of-orbs int32 :offset-assert 284)
(total-nb-of-buzzers int32 :offset-assert 288)
(card-info mc-slot-info :offset-assert 292)
(last-option-index-change uint64 :offset-assert 296)
(last-option-index-change int64 :offset-assert 296)
(video-mode-timeout uint64 :offset-assert 304)
(display-state-stack uint64 5 :offset-assert 312)
(option-index-stack uint32 5 :offset-assert 352)
(display-state-stack progress-screen 5 :offset-assert 312)
(option-index-stack int32 5 :offset-assert 352)
(display-state-pos int32 :offset-assert 372)
(nb-of-icons int32 :offset-assert 376)
(icons uint32 6 :offset-assert 380)
(icons hud-icon 6 :offset-assert 380)
(max-nb-of-particles int32 :offset-assert 404)
(nb-of-particles int32 :offset-assert 408)
(particles uint32 40 :offset-assert 412)
(particle-state uint32 40 :offset-assert 572)
(particles hud-particle 40 :offset-assert 412)
(particle-state int32 40 :offset-assert 572)
)
:method-count-assert 59
:size-assert #x2dc
:flag-assert #x3b000002dc
:heap-base #x270
:flag-assert #x3b027002dc
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 (_type_) none 16)
(draw-progress (_type_) none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-19 (_type_) symbol 19)
(hidden? (_type_) symbol 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(TODO-RENAME-23 (_type_ symbol symbol) none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 (_type_) none 32)
(dummy-33 () none 33)
(dummy-34 () none 34)
(dummy-35 () none 35)
(dummy-36 () none 36)
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 () none 40)
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
(dummy-44 () none 44)
(dummy-45 () none 45)
(dummy-46 () none 46)
(dummy-47 () none 47)
(dummy-48 () none 48)
(dummy-49 () none 49)
(dummy-50 () none 50)
(dummy-51 () none 51)
(dummy-52 () none 52)
(dummy-53 () none 53)
(dummy-54 () none 54)
(dummy-55 () none 55)
(dummy-56 () none 56)
(dummy-57 () none 57)
(dummy-58 () none 58)
(adjust-sprites (_type_) none 21)
(adjust-icons (_type_) none 22)
(adjust-ratios (_type_ symbol symbol) none 23)
(draw-fuel-cell-screen (_type_ int) none 24)
(draw-money-screen (_type_ int) none 25)
(draw-buzzer-screen (_type_ int) none 26)
(draw-notice-screen (_type_) none 27)
(draw-options (_type_ int int float) none 28)
(dummy-29 (_type_) none 29)
(respond-progress (_type_) none 30)
(dummy-31 (_type_) none 31)
(dummy-32 (_type_) symbol 32)
(initialize-icons (_type_) none 33)
(initialize-particles (_type_) none 34)
(draw-memcard-storage-error (_type_ font-context) none 35)
(draw-memcard-data-exists (_type_ font-context) none 36)
(draw-memcard-no-data (_type_ font-context) none 37)
(draw-memcard-accessing (_type_ font-context) none 38)
(draw-memcard-insert (_type_ font-context) none 39)
(draw-memcard-file-select (_type_ font-context) none 40)
(draw-memcard-auto-save-error (_type_ font-context) none 41)
(draw-memcard-removed (_type_ font-context) none 42)
(draw-memcard-error (_type_ font-context) none 43)
(dummy-44 (_type_) none 44)
(push! (_type_) none 45)
(pop! (_type_) none 46)
(dummy-47 (_type_) none 47)
(enter! (_type_ progress-screen int) none 48)
(draw-memcard-format (_type_ font-context) none 49)
(draw-auto-save (_type_ font-context) none 50)
(set-transition-progress! (_type_ int) none 51)
(set-transition-speed! (_type_) none 52)
(dummy-53 (_type_ progress-screen) progress-screen 53)
(draw-pal-change-to-60hz (_type_ font-context) none 54)
(draw-pal-now-60hz (_type_ font-context) none 55)
(draw-no-disc (_type_ font-context) none 56)
(draw-bad-disc (_type_ font-context) none 57)
(draw-quit (_type_ font-context) none 58)
)
)
(define *progress-process* (the (pointer progress) #f))
(define *progress-last-task-index* 0)
(defun-extern activate-progress process int int)
(defun-extern activate-progress process progress-screen none)
(defun-extern hide-progress-screen none)
(defun-extern hide-progress-icons none)
(define-extern *level-task-data* (array level-tasks-info))
(define-extern *level-task-data-remap* (array int32))
(define-extern get-game-count (function int count-info))
(define-extern activate-orb-all (function int int)) ;; maybe in hud?
(define-extern progress-allowed? (function symbol))
(define-extern pause-allowed? (function symbol))
(define-extern deactivate-progress (function none))
(define-extern calculate-completion (function symbol float))
(defun-extern get-game-count int count-info)
(defun-extern progress-allowed? symbol)
(defun-extern pause-allowed? symbol)
(defun-extern deactivate-progress none)
(defun-extern calculate-completion progress float)
(defun-extern make-current-level-available-to-progress none)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+15 -13
View File
@@ -153,40 +153,42 @@
)
)
;; maps options to a progress screen
(define *options-remap*
(new 'static 'boxed-array :type array :length 0 :allocated-length 35)
(new 'static 'boxed-array :type (array game-option) :length 0 :allocated-length 35)
)
;; TODO probably an enum.
;; maps "levels" to the appropriate offset in *level-task-data*
(define *level-task-data-remap*
(new 'static 'boxed-array :type int32 :length 23 :allocated-length 23
0
1
2
3
3
3 ;; jungle?
3 ;; jungleb?
4
5
6
7
7
7 ;; sunken?
7 ;; sunkenb?
8
9
10
11
12
13
13
13
13 ;; maincave?
13 ;; robocave?
13 ;; darkcave?
14
15
15
4
4
15 ;; citadel?
15 ;; finalboss?
4 ;; demo?
4 ;; intro?
)
)
;; TODO what does this map? GOAL language ID or SCE?
;; maps goal language ID to its name string ID
(define *language-name-remap*
(new 'static 'boxed-array :type game-text-id :length 6 :allocated-length 6
(game-text-id english)
File diff suppressed because it is too large Load Diff
+61 -3
View File
@@ -21,6 +21,9 @@
(vibrations #x10e)
(play-hints #x10f)
(center-screen #x110)
(on #x111)
(off #x112)
(move-dpad #x113)
(english #x114)
(french #x115)
(german #x116)
@@ -32,22 +35,71 @@
(game-options #x127)
(graphic-options #x128)
(sound-options #x129)
(4x3 #x12a)
(16x9 #x12b)
(60hz #x12c)
(50hz #x12d)
(game-title #x12e)
(hidden-power-cell #x12f) ;; why is this here??
(memcard-no-space #x130)
(memcard-not-inserted #x131)
(card-not-formatted-title #x132)
(memcard-space-requirement1 #x133)
(memcard-space-requirement2 #x134)
(card-not-formatted-msg #x135)
(saving-data #x136)
(loading-data #x137)
(do-not-remove-mem-card #x138)
(overwrite? #x139)
(format? #x13a)
(continue-without-saving #x13f)
(yes #x13c)
(no #x13d)
(back #x13e)
(continue-without-saving #x13f)
(select-file-to-save #x140)
(select-file-to-load #x141)
(save-data-already-exists #x142)
(insert-memcard #x143)
(continue? #x144)
(load-game #x14b)
(save-game #x14c)
(formatting #x14d)
(creating-save-data #x14e)
(empty #x14f)
(options #x150)
(error-loading #x151)
(error-saving #x152)
(error-formatting #x153)
(error-creating-data #x154)
(memcard-removed #x156)
(autosave-disabled-title #x157)
(autosave-disabled-msg #x158)
(no-save-data #x159)
(create-save-data? #x15a)
(check-memcard #x15b)
(new-game #x15c)
(back? #x15d)
(ok #x15e)
(exit-demo #x15f)
(autosave-warn-title #x160)
(autosave-warn-msg #x161)
(task-completed #x162)
(check-memcard-and-retry #x163)
(screen-change-to-60hz #x164)
(screen-60hz-warn-support #x165)
(screen-60hz-warn-timer #x166)
(screen-now-60hz #x167)
(screen-60hz-keep? #x168)
(warp-gate-use-dpad #x169)
(no-disc-title #x16a)
(no-disc-msg #x16b)
(bad-disc-title #x16c)
(bad-disc-msg #x16d)
(press-start #x16e)
(quit-game #x16f)
(quit? #x170)
(total-collected #x171)
(village1-mayor-money #x200)
(vollage1-uncle-money #x201)
@@ -239,3 +291,9 @@
;; will store the COMMON text when it is loaded.
(define *common-text* (the-as game-text-info #f))
(defun-extern print-game-text string font-context symbol int int float)
+4 -4
View File
@@ -140,7 +140,7 @@
(local-vars
(v0-2 int)
(heap-sym-heap game-text-info)
(lang int)
(lang language-enum)
(load-status int)
(heap-free int)
)
@@ -149,13 +149,13 @@
(set! load-status 0)
(set! heap-free (&- (-> heap top) (the-as uint (-> heap base))))
;; english -> UK english in PAL (I think?)
(if (and (= (scf-get-territory) 1) (zero? lang))
(set! lang 6)
(if (and (= (scf-get-territory) GAME_TERRITORY_SCEE) (= lang (language-enum english)))
(set! lang (language-enum uk-english))
)
;; only load if we actually need to
(when (or (= heap-sym-heap #f) ;; nothing loaded
(!= (-> heap-sym-heap language-id) lang) ;; loaded, but wrong lang
(!= (-> heap-sym-heap language-id) (the-as uint lang)) ;; loaded, but wrong lang
(not (string= (-> heap-sym-heap group-name) txt-name)) ;; loaded, but wrong group
)
+7
View File
@@ -475,6 +475,13 @@
`(neq? ,thing 0)
)
(defmacro not! (var)
`(set! ,var (not ,var)))
(defmacro true! (var)
`(set! ,var #t))
(defmacro false! (var)
`(set! ,var #f))
(defmacro minmax (val minval maxval)
`(max (min ,val ,maxval) ,minval)
)
+11 -4
View File
@@ -119,12 +119,19 @@
(#t (filter pred (cdr lst)))))
(desfun assoc (x a)
(if (eq? (caar a) x)
(car a)
(assoc x (cdr a))
)
(if (null? a)
'()
(if (eq? (caar a) x)
(car a)
(assoc x (cdr a))
)
)
)
(desfun list (&rest items)
(apply (lambda (x) x) items)
)
(desfun reverse (lst)
(if (null? lst)
'()
+19 -3
View File
@@ -124,6 +124,17 @@
(no-auto-save 17)
)
(defenum language-enum
:type int64
(english)
(french)
(german)
(spanish)
(italian)
(japanese)
(uk-english)
)
(define-extern mc-run (function none))
(define-extern mc-format (function int mc-status-code))
(define-extern mc-unformat (function int mc-status-code))
@@ -136,7 +147,7 @@
(define-extern mc-check-result (function int))
;; mc-makefile
(define-extern kset-language (function int int))
(define-extern kset-language (function language-enum int))
(define-extern *debug-segment* symbol)
(define-extern *enable-method-set* int)
@@ -182,12 +193,17 @@
;; file-stream-seek
(define-extern file-stream-read (function file-stream pointer int int))
(define-extern file-stream-write (function file-stream pointer uint uint))
(define-extern scf-get-language (function uint))
(defconstant GAME_TERRITORY_SCEA 0)
(defconstant GAME_TERRITORY_SCEE 1)
(defconstant GAME_TERRITORY_SCEI 2)
(define-extern scf-get-language (function language-enum))
(declare-type scf-time structure)
(define-extern scf-get-time (function scf-time none))
(define-extern scf-get-aspect (function uint))
(define-extern scf-get-volume (function int))
(define-extern scf-get-territory (function int))
(define-extern scf-get-territory (function int)) ;; not actually a scf function...
(define-extern scf-get-timeout (function int))
(define-extern scf-get-inactive-timeout (function int))
;; dma-to-iop
+1 -1
View File
@@ -455,7 +455,7 @@
(deftype state (protect-frame)
((code function :offset-assert 16)
(trans (function none) :offset-assert 20)
(post (function none) :offset-assert 24)
(post function :offset-assert 24)
(enter function :offset-assert 28)
(event (function process int symbol event-message-block object) :offset-assert 32)
)
+54 -10
View File
@@ -92,31 +92,31 @@ It type checks the arguments for the entry function.
)
)
(defmacro make-function-process (dead-pool new-pool proc-type func &key (name #f) &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args)
(defmacro make-function-process (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args)
"Start a new process that runs a function on its main thread.
Returns a pointer to the new process (or #f? on error)."
(with-gensyms (new-proc)
`(let ((,new-proc (the-as ,proc-type (get-process ,dead-pool ,proc-type ,stack-size))))
`(let ((,new-proc (the-as ,proc-type (get-process ,from ,proc-type ,stack-size))))
(when ,new-proc
((method-of-type ,proc-type activate) ,new-proc ,new-pool ,(if name name `(quote ,proc-type)) ,stack)
((method-of-type ,proc-type activate) ,new-proc ,to ,(if name name `(quote ,proc-type)) ,stack)
(run-next-time-in-process ,new-proc ,func ,@args)
(-> ,new-proc ppointer)
(the (pointer ,proc-type) (-> ,new-proc ppointer))
)
)
)
)
(defmacro make-init-process (dead-pool new-pool proc-type func &key (name #f) &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args)
(defmacro make-init-process (proc-type func &key (from *default-dead-pool*) &key (to *default-pool*) &key (name #f) &key (stack-size #x4000) &key (stack *kernel-dram-stack*) &rest args)
"Start a new process and run an init function on it.
Returns a pointer to the new process, or #f (or is it 0?) if something goes wrong."
(with-gensyms (new-proc)
`(let ((,new-proc (the-as ,proc-type (get-process ,dead-pool ,proc-type ,stack-size))))
`(let ((,new-proc (the-as ,proc-type (get-process ,from ,proc-type ,stack-size))))
(when ,new-proc
((method-of-type ,proc-type activate) ,new-proc ,new-pool ,(if name name `(quote ,proc-type)) ,stack)
((method-of-type ,proc-type activate) ,new-proc ,to ,(if name name `(quote ,proc-type)) ,stack)
(run-now-in-process ,new-proc ,func ,@args)
(-> ,new-proc ppointer)
(the (pointer ,proc-type) (-> ,new-proc ppointer))
)
)
)
@@ -136,7 +136,10 @@ It type checks the arguments for the entry function.
(push! *defstate-type-stack* beh-type)
)
)
(defmacro clear-def-state-stack ()
(set! *defstate-type-stack* '())
`(none)
)
(defmacro defstate (state-name parents
&key (virtual #f)
&key (event #f)
@@ -151,9 +154,34 @@ It type checks the arguments for the entry function.
(with-gensyms (new-state)
(let ((defstate-type (first parents)))
(when (not (null? *defstate-type-stack*))
(ferror "*defstate-type-stack* leaked! An error probably happened in a previous defstate. stack is: {}" *defstate-type-stack*)
(fmt #t "*defstate-type-stack* leaked! An error probably happened in a previous defstate. stack is: {}"
*defstate-type-stack*)
)
(set! *defstate-type-stack* '())
;; check for default handlers
(let ((default-handlers (assoc defstate-type *default-state-handlers*)))
(when (not (null? default-handlers))
(set! default-handlers (cdr default-handlers))
(when (and (not event) (car default-handlers))
(set! event (car default-handlers)))
(set! default-handlers (cdr default-handlers))
(when (and (not enter) (car default-handlers))
(set! enter (car default-handlers)))
(set! default-handlers (cdr default-handlers))
(when (and (not trans) (car default-handlers))
(set! trans (car default-handlers)))
(set! default-handlers (cdr default-handlers))
(when (and (not exit) (car default-handlers))
(set! exit (car default-handlers)))
(set! default-handlers (cdr default-handlers))
(when (and (not code) (car default-handlers))
(set! code (car default-handlers)))
(set! default-handlers (cdr default-handlers))
(when (and (not post) (car default-handlers))
(set! post (car default-handlers)))
(set! default-handlers (cdr default-handlers))
)
)
(def-state-check-behavior event defstate-type)
(def-state-check-behavior enter defstate-type)
(def-state-check-behavior trans defstate-type)
@@ -193,6 +221,22 @@ It type checks the arguments for the entry function.
)
)
;; set the default handler functions for a process's state handlers
(seval (define *default-state-handlers* '()))
(defmacro defstatehandler (proc
&key (event #f)
&key (enter #f)
&key (trans #f)
&key (exit #f)
&key (code #f)
&key (post #f))
(if (null? (assoc proc *default-state-handlers*))
(push! *default-state-handlers* (cons proc (list event enter trans exit code post)))
(fmt #t "default state handlers for {} already defined, ignoring duplicate.\n" proc (cadr (assoc proc *default-state-handlers*)))
)
`(none)
)
(defmethod new state
((allocation symbol)
(type-to-make type)
+1 -1
View File
@@ -2165,7 +2165,7 @@
(behavior ()
(let ((t9-0 (-> (method-of-type process-taskable idle) post)))
(if t9-0
(t9-0)
((the-as (function none) t9-0))
)
)
(dummy-45 (-> self root-override))
+1 -1
View File
@@ -1087,7 +1087,7 @@
(new 'static 'sp-field-init-spec
:field #x31
:flags #x5
:func 'check-drop-level-assistant
:sym 'check-drop-level-assistant
)
(new 'static 'sp-field-init-spec
:field #x3a
+74 -36
View File
@@ -19,6 +19,10 @@
(cond (*debug-segment*
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; types
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; a structure to hold the handles used in this file
(deftype pc-pad-proc-list (structure)
((show handle)
@@ -31,10 +35,11 @@
;; a pc pad process
(deftype pc-pad-proc (process)
((state-time seconds)
((state-time int64)
(input-index uint64)
(pad-idx uint64)
)
:heap-base #x10
:heap-base #x20
)
(define *pc-pad-button-names*
@@ -66,12 +71,33 @@
(canceled)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; forward declarations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern pc-pi-mapping-button (state pc-pad-proc))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconstant PC_PAD_INPUT_NOTICE_TIME (seconds 1.5))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun-debug pc-pad-show-start ()
"Start the PC port pad debug display"
(if (not (handle->process (-> *pc-pad-proc-list* show)))
(let ((procp
(make-function-process *nk-dead-pool* *active-pool* pc-pad-proc :name 'pc-pad-show
(make-function-process pc-pad-proc :name 'pc-pad-show
(lambda :behavior pc-pad-proc ()
(stack-size-set! (-> self main-thread) 512)
(loop
@@ -99,11 +125,54 @@
(kill-by-name 'pc-pad-show *active-pool*)
)
(defun-debug pc-pad-input-start ()
"Start the PC port pad debug key mapping"
(if (not (handle->process (-> *pc-pad-proc-list* input)))
(let ((procp
(make-init-process pc-pad-proc :name 'pc-pad-input
(lambda :behavior pc-pad-proc ()
(set! (-> self pad-idx) 0)
(pc-pad-input-mode-set #t)
(go pc-pi-mapping-button)
)
)
))
(set! (-> *pc-pad-proc-list* input) (ppointer->handle procp))
)
(format #t "That process is already running. :-)~%")
)
)
(defconstant PC_PAD_INPUT_NOTICE_TIME (seconds 1.5))
(defun-debug pc-pad-input-stop ()
"Stop the PC port pad debug key mapping"
(kill-by-name 'pc-pad-input *active-pool*)
(pc-pad-input-mode-set 'canceled)
)
(define-extern pc-pi-mapping-button (state pc-pad-proc))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; behaviors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defbehavior pc-pi-post pc-pad-proc ()
(with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf))
(bucket-id debug-draw1))
(draw-string-xy (string-format "MAPPING PAD ~D" (-> self pad-idx)) buf 256 32
(font-color red) (font-flags shadow kerning large middle))
)
)
(defstatehandler pc-pad-proc :post pc-pi-post)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; states
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defstate pc-pi-new-mapping (pc-pad-proc)
@@ -174,13 +243,9 @@
(defstate pc-pi-mapping-button (pc-pad-proc)
:code (behavior ()
(set-state-time)
(loop
(with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf))
(bucket-id debug-draw1))
(if (< (mod (time-passed) (seconds 2)) (seconds 1))
(draw-string-xy "NOW MAPPING PAD" buf 256 32 (font-color red) (font-flags shadow kerning large middle))
)
(draw-string-xy "PRESS ESCAPE TO EXIT" buf 256 64 (font-color default) (font-flags shadow kerning large middle))
(draw-string-xy (string-format "PRESS KEY FOR ~S" (-> *pc-pad-button-names* (-> self input-index)))
buf 256 96 (font-color default) (font-flags shadow kerning large middle))
@@ -214,32 +279,5 @@
)
)
(defun-debug pc-pad-input-start ()
"Start the PC port pad debug key mapping"
(if (not (handle->process (-> *pc-pad-proc-list* input)))
(let ((procp
(make-init-process *nk-dead-pool* *active-pool* pc-pad-proc :name 'pc-pad-input
(lambda :behavior pc-pad-proc ()
(pc-pad-input-mode-set #t)
(go pc-pi-mapping-button)
)
)
))
(set! (-> *pc-pad-proc-list* input) (ppointer->handle procp))
)
(format #t "That process is already running. :-)~%")
)
)
(defun-debug pc-pad-input-stop ()
"Stop the PC port pad debug key mapping"
(kill-by-name 'pc-pad-input *active-pool*)
(pc-pad-input-mode-set 'canceled)
)
)
(else (format #t "No debug memory in use. pc-pad-utils not loaded.")))
+4 -1
View File
@@ -566,7 +566,10 @@ Val* Compiler::compile_mod(const goos::Object& form, const goos::Object& rest, E
fenv->constrain(con);
env->emit_ir<IR_IntegerMath>(form, IntegerMathKind::IMOD_32, result, second);
return result;
auto result_moved = env->make_gpr(first->type());
env->emit_ir<IR_RegSet>(form, result_moved, result);
return result_moved;
}
Val* Compiler::compile_logand(const goos::Object& form, const goos::Object& rest, Env* env) {
+4
View File
@@ -0,0 +1,4 @@
@echo off
cd ..\..
out\build\Release\bin\goalc-test --gtest_filter="TypeCon*"
pause
File diff suppressed because it is too large Load Diff
@@ -167,7 +167,7 @@
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-14 (_type_) none 14)
)
)
+3 -3
View File
@@ -9,8 +9,8 @@
(new-joint-anim art-joint-anim :offset-assert 188)
(new-joint-anim-blend uint64 :offset-assert 192)
(anim-mode symbol :offset-assert 200)
(cur-grab-handle uint64 :offset-assert 208)
(cur-target-handle uint64 :offset-assert 216)
(cur-grab-handle handle :offset-assert 208)
(cur-target-handle handle :offset-assert 216)
(old-grab-pos vector :inline :offset-assert 224)
(joint joint 4 :offset-assert 240)
(new-post-hook function :offset-assert 256)
@@ -311,7 +311,7 @@
:size-assert #x70
:flag-assert #xf00000070
(:methods
(dummy-14 () none 14)
(die () _type_ :state 14)
)
)
+1 -1
View File
@@ -313,7 +313,7 @@
:size-assert #xc
:flag-assert #xa0000000c
(:methods
(dummy-9 (_type_) none 9)
(draw (_type_) none 9)
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -9,7 +9,7 @@
(dialog-volume float :offset-assert 12)
(process-mask process-mask :offset-assert 16)
(common-page int32 :offset-assert 20)
(language int64 :offset-assert 24)
(language language-enum :offset-assert 24)
(screenx int32 :offset-assert 32)
(screeny int32 :offset-assert 36)
(vibration symbol :offset-assert 40)
+5 -2
View File
@@ -173,7 +173,10 @@
(set! (-> obj bg-a-force) (the-as float (-> conn param2)))
)
(('language)
(set! (-> obj language) (the-as int (-> conn param3)))
(set!
(-> obj language)
(the-as language-enum (the-as int (-> conn param3)))
)
)
(('vibration)
(set! (-> obj vibration) (the-as symbol (-> conn param1)))
@@ -521,7 +524,7 @@
(the float (* 5 (the int (+ 0.5 (* 16.0 f0-2)))))
)
)
(set! (-> gp-0 language) (the-as int (scf-get-language)))
(set! (-> gp-0 language) (scf-get-language))
(set! (-> gp-0 process-mask) (process-mask execute sleep))
(set! (-> gp-0 screenx) 0)
(set! (-> gp-0 screeny) 0)
+2 -2
View File
@@ -54,7 +54,7 @@
(set! (-> *video-parms* set-video-mode) #t)
(set-hud-aspect-ratio (get-aspect-ratio) arg0)
(if *progress-process*
(TODO-RENAME-23 (-> *progress-process* 0) (get-aspect-ratio) arg0)
(adjust-ratios (-> *progress-process* 0) (get-aspect-ratio) arg0)
)
0
(none)
@@ -84,7 +84,7 @@
)
(set-hud-aspect-ratio arg0 (get-video-mode))
(if *progress-process*
(TODO-RENAME-23 (-> *progress-process* 0) arg0 (get-video-mode))
(adjust-ratios (-> *progress-process* 0) arg0 (get-video-mode))
)
0
(none)
+44 -41
View File
@@ -222,116 +222,119 @@
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 20
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
(new 'static 'sp-field-init-spec
:field #x1
:initial-valuef (the-as float #x200000)
)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x41000000
:random-mult #x3f800000
:initial-valuef 8.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x4499999a
:random-mult #x3f800000
:initial-valuef 1228.8
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x10
:flags #x1
:initial-value -956301312
:random-range #x47800000
:random-mult #x3f800000
:initial-valuef -32768.0
:random-rangef 65536.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
:initial-valuef (the-as float #xfffffffc)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
:initial-valuef 90.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
:initial-valuef 90.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x42b40000
:random-mult #x3f800000
:initial-valuef 90.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x41a00000
:random-range #x41a00000
:random-mult #x3f800000
:initial-valuef 20.0
:random-rangef 20.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x4103126f
:random-mult #x3f800000
:initial-valuef 8.192
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x1c
:flags #x1
:initial-value #x41888889
:random-mult #x3f800000
:initial-valuef 17.066668
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x20
:flags #x3
:initial-value -4
:random-mult 1
:initial-valuef (the-as float #xfffffffc)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1097229926
:random-mult #x3f800000
:initial-valuef -0.3
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x138c
:random-mult 1
:initial-valuef (the-as float #x138c)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value 12
:random-mult 1
:initial-valuef (the-as float #xc)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x36
:flags #x1
:initial-value -983331271
:random-range #x452aaaab
:random-mult #x3f800000
:initial-valuef -3640.889
:random-rangef 2730.6667
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46800000
:random-mult #x3f800000
:initial-valuef 16384.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:initial-value -956301312
:random-range #x47800000
:random-mult #x3f800000
:initial-valuef -32768.0
:random-rangef 65536.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x444ccccd
:random-mult #x3f800000
:initial-valuef 819.2
:random-multf 1.0
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -18,37 +18,37 @@
;; definition of type sparticle-cpuinfo
(deftype sparticle-cpuinfo (structure)
((sprite sprite-vec-data-2d :offset-assert 0)
(adgif adgif-shader :offset-assert 4)
(radius float :offset-assert 8)
(omega float :offset-assert 12)
(vel-sxvel vector :inline :offset-assert 16)
(rot-syvel vector :inline :offset-assert 32)
(fade rgbaf :inline :offset-assert 48)
(acc vector :inline :offset-assert 64)
(rotvel3d quaternion :inline :offset-assert 80)
(vel vector3s :inline :offset 16)
(accel vector3s :inline :offset 64)
(scalevelx float :offset 28)
(scalevely float :offset 44)
(friction float :offset-assert 96)
(timer int32 :offset-assert 100)
(flags uint32 :offset-assert 104)
(user-int32 int32 :offset-assert 108)
(user-uint32 uint32 :offset 108)
(user-float float :offset 108)
(user-pntr uint32 :offset 108)
(user-sprite sprite-vec-data-2d :offset 108)
(func basic :offset-assert 112)
(next-time uint32 :offset-assert 116)
(next-launcher basic :offset-assert 120)
(cache-alpha float :offset-assert 124)
(valid basic :offset-assert 128)
(key basic :offset-assert 132)
(binding sparticle-launch-state :offset-assert 136)
(data uint32 1 :offset 12)
(dataf float 1 :offset 12)
(datac uint8 1 :offset 12)
((sprite sprite-vec-data-2d :offset-assert 0)
(adgif adgif-shader :offset-assert 4)
(radius float :offset-assert 8)
(omega float :offset-assert 12)
(vel-sxvel vector :inline :offset-assert 16)
(rot-syvel vector :inline :offset-assert 32)
(fade rgbaf :inline :offset-assert 48)
(acc vector :inline :offset-assert 64)
(rotvel3d quaternion :inline :offset-assert 80)
(vel vector3s :inline :offset 16)
(accel vector3s :inline :offset 64)
(scalevelx float :offset 28)
(scalevely float :offset 44)
(friction float :offset-assert 96)
(timer int32 :offset-assert 100)
(flags uint32 :offset-assert 104)
(user-int32 int32 :offset-assert 108)
(user-uint32 uint32 :offset 108)
(user-float float :offset 108)
(user-pntr uint32 :offset 108)
(user-sprite sprite-vec-data-2d :offset 108)
(func basic :offset-assert 112)
(next-time uint32 :offset-assert 116)
(next-launcher basic :offset-assert 120)
(cache-alpha float :offset-assert 124)
(valid basic :offset-assert 128)
(key sparticle-launch-control :offset-assert 132)
(binding sparticle-launch-state :offset-assert 136)
(data uint32 1 :offset 12)
(dataf float 1 :offset 12)
(datac uint8 1 :offset 12)
)
:method-count-assert 9
:size-assert #x8c
@@ -122,19 +122,22 @@
;; definition of type sparticle-system
(deftype sparticle-system (basic)
((blocks int32 2 :offset-assert 4)
(length uint32 2 :offset-assert 12)
(num-alloc uint32 2 :offset-assert 20)
(is-3d basic :offset-assert 28)
(flags uint32 :offset-assert 32)
(alloc-table uint32 :offset-assert 36)
(cpuinfo-table sparticle-cpuinfo :offset-assert 40)
(vecdata-table uint32 :offset-assert 44)
(adgifdata-table uint32 :offset-assert 48)
((blocks int32 2 :offset-assert 4)
(length uint32 2 :offset-assert 12)
(num-alloc uint32 2 :offset-assert 20)
(is-3d basic :offset-assert 28)
(flags uint32 :offset-assert 32)
(alloc-table (pointer uint64) :offset-assert 36)
(cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40)
(vecdata-table pointer :offset-assert 44)
(adgifdata-table (inline-array adgif-shader) :offset-assert 48)
)
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
(:methods
(new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0)
)
)
;; definition for method 3 of type sparticle-system
@@ -3,19 +3,19 @@
;; definition of type sp-field-init-spec
(deftype sp-field-init-spec (structure)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-value int32 :offset-assert 4)
(random-range int32 :offset-assert 8)
(random-mult int32 :offset-assert 12)
(initial-valuef float :offset 4)
(random-rangef float :offset 8)
(random-multf float :offset 12)
(func symbol :offset 4)
(tex uint32 :offset 4)
(pntr uint32 :offset 4)
(sym basic :offset 4)
(sound basic :offset 4)
((field uint16 :offset-assert 0)
(flags uint16 :offset-assert 2)
(initial-valuef float :offset-assert 4)
(random-rangef float :offset-assert 8)
(random-multf float :offset-assert 12)
(initial-value int32 :offset 4)
(random-range int32 :offset 8)
(random-mult int32 :offset 12)
(sym symbol :offset 4)
(func function :offset 4)
(tex uint32 :offset 4)
(pntr pointer :offset 4)
(sound basic :offset 4)
)
:method-count-assert 9
:size-assert #x10
@@ -30,9 +30,9 @@
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
(format #t "~Tinitial-value: ~D~%" (-> obj initial-value))
(format #t "~Trandom-range: ~D~%" (-> obj random-range))
(format #t "~Trandom-mult: ~D~%" (-> obj random-mult))
(format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef))
(format #t "~Trandom-range: ~D~%" (-> obj random-rangef))
(format #t "~Trandom-mult: ~D~%" (-> obj random-multf))
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
@@ -172,21 +172,21 @@
;; definition of type sparticle-launch-control
(deftype sparticle-launch-control (inline-array-class)
((group basic :offset-assert 16)
(proc basic :offset-assert 20)
(local-clock int32 :offset-assert 24)
(fade float :offset-assert 28)
(matrix int32 :offset-assert 32)
(last-spawn-frame int32 :offset-assert 36)
(last-spawn-time int32 :offset-assert 40)
(center vector :inline :offset-assert 48)
(data uint8 :dynamic :offset-assert 64)
((group sparticle-launch-group :offset-assert 16)
(proc process :offset-assert 20)
(local-clock int32 :offset-assert 24)
(fade float :offset-assert 28)
(matrix int32 :offset-assert 32)
(last-spawn-frame int32 :offset-assert 36)
(last-spawn-time int32 :offset-assert 40)
(center vector :inline :offset-assert 48)
(data sparticle-launch-state :inline :dynamic :offset-assert 64)
)
:method-count-assert 14
:size-assert #x40
:flag-assert #xe00000040
(:methods
(dummy-9 () none 9)
(initialize (_type_ sparticle-launch-group process) none 9)
(dummy-10 () none 10)
(dummy-11 (_type_ vector) none 11)
(deactivate (_type_) none 12)
+11 -11
View File
@@ -57,12 +57,12 @@
;; definition of type sprite-array-2d
(deftype sprite-array-2d (basic)
((num-sprites int32 2 :offset-assert 4)
(num-valid int32 2 :offset-assert 12)
(vec-data uint32 :offset-assert 20)
(adgif-data uint32 :offset-assert 24)
(pad uint128 4 :offset-assert 32)
(data uint128 1 :offset-assert 96)
((num-sprites int32 2 :offset-assert 4)
(num-valid int32 2 :offset-assert 12)
(vec-data pointer :offset-assert 20)
(adgif-data (inline-array adgif-shader) :offset-assert 24)
(pad uint128 4 :offset-assert 32)
(data uint128 1 :offset-assert 96)
)
:method-count-assert 9
:size-assert #x70
@@ -138,11 +138,11 @@
;; definition of type sprite-array-3d
(deftype sprite-array-3d (basic)
((num-sprites int32 2 :offset-assert 4)
(num-valid int32 2 :offset-assert 12)
(vec-data uint32 :offset-assert 20)
(adgif-data uint32 :offset-assert 24)
(data uint128 1 :offset-assert 32)
((num-sprites int32 2 :offset-assert 4)
(num-valid int32 2 :offset-assert 12)
(vec-data pointer :offset-assert 20)
(adgif-data (inline-array adgif-shader) :offset-assert 24)
(data uint128 1 :offset-assert 32)
)
:method-count-assert 9
:size-assert #x30
+14 -8
View File
@@ -470,8 +470,11 @@
(set! (-> v0-0 num-sprites 1) group-1-size)
(set! (-> v0-0 num-valid 0) 0)
(set! (-> v0-0 num-valid 1) 0)
(set! (-> v0-0 vec-data) (the-as uint (-> v0-0 data)))
(set! (-> v0-0 adgif-data) (the-as uint (&-> v0-0 data vec-data-size)))
(set! (-> v0-0 vec-data) (-> v0-0 data))
(set!
(-> v0-0 adgif-data)
(the-as (inline-array adgif-shader) (&-> v0-0 data vec-data-size))
)
v0-0
)
)
@@ -506,8 +509,11 @@
(set! (-> v0-0 num-sprites 1) group-1-size)
(set! (-> v0-0 num-valid 0) 0)
(set! (-> v0-0 num-valid 1) 0)
(set! (-> v0-0 vec-data) (the-as uint (-> v0-0 data)))
(set! (-> v0-0 adgif-data) (the-as uint (&-> v0-0 data vec-data-size)))
(set! (-> v0-0 vec-data) (-> v0-0 data))
(set!
(-> v0-0 adgif-data)
(the-as (inline-array adgif-shader) (&-> v0-0 data vec-data-size))
)
v0-0
)
)
@@ -739,7 +745,7 @@
(-> pkt2 dma)
(new 'static 'dma-tag
:id (dma-tag-id ref)
:addr (+ (-> sprites vec-data) (* 48 start-sprite-idx))
:addr (the-as int (&+ (-> sprites vec-data) (* 48 start-sprite-idx)))
:qwc qwc-pkt2
)
)
@@ -758,7 +764,7 @@
(-> pkt3 dma)
(new 'static 'dma-tag
:id (dma-tag-id ref)
:addr (+ (-> sprites adgif-data) (* 80 start-sprite-idx))
:addr (+ (the-as int (-> sprites adgif-data)) (* 80 start-sprite-idx))
:qwc qwc-pkt3
)
)
@@ -854,7 +860,7 @@
(-> pkt2 dma)
(new 'static 'dma-tag
:id (dma-tag-id ref)
:addr (+ (-> sprites vec-data) (* 48 start-sprite-idx))
:addr (the-as int (&+ (-> sprites vec-data) (* 48 start-sprite-idx)))
:qwc qwc-pkt2
)
)
@@ -873,7 +879,7 @@
(-> pkt3 dma)
(new 'static 'dma-tag
:id (dma-tag-id ref)
:addr (+ (-> sprites adgif-data) (* 80 start-sprite-idx))
:addr (the-as int (-> sprites adgif-data start-sprite-idx))
:qwc qwc-pkt3
)
)
+7 -1
View File
@@ -1,7 +1,13 @@
;;-*-Lisp-*-
(in-package goal)
;; type mc-handle is defined here, but it is unknown to the decompiler
;; definition of type mc-handle
(deftype mc-handle (int32)
()
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition of type mc-file-info
(deftype mc-file-info (structure)
+3 -3
View File
@@ -194,7 +194,7 @@
)
;; definition for function set-language
(defun set-language ((arg0 int))
(defun set-language ((arg0 language-enum))
(kset-language arg0)
(let ((cmd (the-as sound-rpc-set-language (add-element *sound-loader-rpc*))))
(set! (-> cmd command) (sound-command set-language))
@@ -347,7 +347,7 @@
(not *progress-process*)
(!= (-> *progress-process* 0 display-state) 32)
)
(activate-progress *dproc* 32)
(activate-progress *dproc* (progress-screen no-disc))
)
)
((nonzero? (-> *sound-iop-info* dirtycd))
@@ -356,7 +356,7 @@
(not *progress-process*)
(!= (-> *progress-process* 0 display-state) 33)
)
(activate-progress *dproc* 33)
(activate-progress *dproc* (progress-screen bad-disc))
)
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -30,7 +30,7 @@
:settings
(new 'static 'shadow-settings
:center
(new 'static 'vector :w 0.000000000000000000000000000000000000000000003)
(new 'static 'vector :w (the-as float #x2))
:shadow-dir
(new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0)
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
+10 -10
View File
@@ -3,12 +3,12 @@
;; definition of type hud-icon
(deftype hud-icon (basic)
((icon uint32 :offset-assert 4)
(icon-y int32 :offset-assert 8)
(icon-x int32 :offset-assert 12)
(icon-z int32 :offset-assert 16)
(scale-x float :offset-assert 20)
(scale-y float :offset-assert 24)
((icon (pointer manipy) :offset-assert 4)
(icon-y int32 :offset-assert 8)
(icon-x int32 :offset-assert 12)
(icon-z int32 :offset-assert 16)
(scale-x float :offset-assert 20)
(scale-y float :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -29,10 +29,10 @@
;; definition of type hud-particle
(deftype hud-particle (basic)
((part basic :offset-assert 4)
(init-pos vector :inline :offset-assert 16)
(pos vector :inline :offset-assert 32)
(prev-pos vector :inline :offset-assert 48)
((part sparticle-launch-control :offset-assert 4)
(init-pos vector :inline :offset-assert 16)
(pos vector :inline :offset-assert 32)
(prev-pos vector :inline :offset-assert 48)
)
:method-count-assert 9
:size-assert #x40
+100 -99
View File
@@ -94,7 +94,7 @@
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
(param3 int32 :offset-assert 32)
(value-to-modify uint32 :offset-assert 36)
(value-to-modify pointer :offset-assert 36)
)
:method-count-assert 9
:size-assert #x28
@@ -116,110 +116,111 @@
;; definition of type progress
(deftype progress (process)
((current-debug-string int32 :offset-assert 112)
(current-debug-language int32 :offset-assert 116)
(current-debug-group int32 :offset-assert 120)
(in-out-position int32 :offset-assert 124)
(display-state uint64 :offset-assert 128)
(next-display-state uint64 :offset-assert 136)
(option-index int32 :offset-assert 144)
(selected-option basic :offset-assert 148)
(completion-percentage float :offset-assert 152)
(ready-to-run basic :offset-assert 156)
(display-level-index int32 :offset-assert 160)
(next-level-index int32 :offset-assert 164)
(task-index int32 :offset-assert 168)
(in-transition basic :offset-assert 172)
(last-in-transition basic :offset-assert 176)
(force-transition basic :offset-assert 180)
(stat-transition basic :offset-assert 184)
(level-transition int32 :offset-assert 188)
(language-selection uint64 :offset-assert 192)
(language-direction basic :offset-assert 200)
(language-transition basic :offset-assert 204)
(language-x-offset int32 :offset-assert 208)
(sides-x-scale float :offset-assert 212)
(sides-y-scale float :offset-assert 216)
(left-x-offset int32 :offset-assert 220)
(right-x-offset int32 :offset-assert 224)
(button-scale float :offset-assert 228)
(slot-scale float :offset-assert 232)
(left-side-x-scale float :offset-assert 236)
(left-side-y-scale float :offset-assert 240)
(right-side-x-scale float :offset-assert 244)
(right-side-y-scale float :offset-assert 248)
(small-orb-y-offset int32 :offset-assert 252)
(big-orb-y-offset int32 :offset-assert 256)
(transition-offset int32 :offset-assert 260)
(transition-offset-invert int32 :offset-assert 264)
(transition-percentage float :offset-assert 268)
(transition-percentage-invert float :offset-assert 272)
(transition-speed float :offset-assert 276)
(total-nb-of-power-cells int32 :offset-assert 280)
(total-nb-of-orbs int32 :offset-assert 284)
(total-nb-of-buzzers int32 :offset-assert 288)
(card-info mc-slot-info :offset-assert 292)
(last-option-index-change uint64 :offset-assert 296)
(video-mode-timeout uint64 :offset-assert 304)
(display-state-stack uint64 5 :offset-assert 312)
(option-index-stack uint32 5 :offset-assert 352)
(display-state-pos int32 :offset-assert 372)
(nb-of-icons int32 :offset-assert 376)
(icons uint32 6 :offset-assert 380)
(max-nb-of-particles int32 :offset-assert 404)
(nb-of-particles int32 :offset-assert 408)
(particles uint32 40 :offset-assert 412)
(particle-state uint32 40 :offset-assert 572)
((current-debug-string int32 :offset-assert 112)
(current-debug-language int32 :offset-assert 116)
(current-debug-group int32 :offset-assert 120)
(in-out-position int32 :offset-assert 124)
(display-state progress-screen :offset-assert 128)
(next-display-state progress-screen :offset-assert 136)
(option-index int32 :offset-assert 144)
(selected-option basic :offset-assert 148)
(completion-percentage float :offset-assert 152)
(ready-to-run basic :offset-assert 156)
(display-level-index int32 :offset-assert 160)
(next-level-index int32 :offset-assert 164)
(task-index int32 :offset-assert 168)
(in-transition basic :offset-assert 172)
(last-in-transition basic :offset-assert 176)
(force-transition basic :offset-assert 180)
(stat-transition basic :offset-assert 184)
(level-transition int32 :offset-assert 188)
(language-selection uint64 :offset-assert 192)
(language-direction basic :offset-assert 200)
(language-transition basic :offset-assert 204)
(language-x-offset int32 :offset-assert 208)
(sides-x-scale float :offset-assert 212)
(sides-y-scale float :offset-assert 216)
(left-x-offset int32 :offset-assert 220)
(right-x-offset int32 :offset-assert 224)
(button-scale float :offset-assert 228)
(slot-scale float :offset-assert 232)
(left-side-x-scale float :offset-assert 236)
(left-side-y-scale float :offset-assert 240)
(right-side-x-scale float :offset-assert 244)
(right-side-y-scale float :offset-assert 248)
(small-orb-y-offset int32 :offset-assert 252)
(big-orb-y-offset int32 :offset-assert 256)
(transition-offset int32 :offset-assert 260)
(transition-offset-invert int32 :offset-assert 264)
(transition-percentage float :offset-assert 268)
(transition-percentage-invert float :offset-assert 272)
(transition-speed float :offset-assert 276)
(total-nb-of-power-cells int32 :offset-assert 280)
(total-nb-of-orbs int32 :offset-assert 284)
(total-nb-of-buzzers int32 :offset-assert 288)
(card-info mc-slot-info :offset-assert 292)
(last-option-index-change int64 :offset-assert 296)
(video-mode-timeout uint64 :offset-assert 304)
(display-state-stack progress-screen 5 :offset-assert 312)
(option-index-stack int32 5 :offset-assert 352)
(display-state-pos int32 :offset-assert 372)
(nb-of-icons int32 :offset-assert 376)
(icons hud-icon 6 :offset-assert 380)
(max-nb-of-particles int32 :offset-assert 404)
(nb-of-particles int32 :offset-assert 408)
(particles hud-particle 40 :offset-assert 412)
(particle-state int32 40 :offset-assert 572)
)
:heap-base #x270
:method-count-assert 59
:size-assert #x2dc
:flag-assert #x3b000002dc
:flag-assert #x3b027002dc
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 (_type_) none 16)
(draw-progress (_type_) none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-19 (_type_) symbol 19)
(hidden? (_type_) symbol 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(TODO-RENAME-23 (_type_ symbol symbol) none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 (_type_) none 32)
(dummy-33 () none 33)
(dummy-34 () none 34)
(dummy-35 () none 35)
(dummy-36 () none 36)
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 () none 40)
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
(dummy-44 () none 44)
(dummy-45 () none 45)
(dummy-46 () none 46)
(dummy-47 () none 47)
(dummy-48 () none 48)
(dummy-49 () none 49)
(dummy-50 () none 50)
(dummy-51 () none 51)
(dummy-52 () none 52)
(dummy-53 () none 53)
(dummy-54 () none 54)
(dummy-55 () none 55)
(dummy-56 () none 56)
(dummy-57 () none 57)
(dummy-58 () none 58)
(adjust-sprites (_type_) none 21)
(adjust-icons (_type_) none 22)
(adjust-ratios (_type_ symbol symbol) none 23)
(draw-fuel-cell-screen (_type_ int) none 24)
(draw-money-screen (_type_ int) none 25)
(draw-buzzer-screen (_type_ int) none 26)
(draw-notice-screen (_type_) none 27)
(draw-options (_type_ int int float) none 28)
(dummy-29 (_type_) none 29)
(respond-progress (_type_) none 30)
(dummy-31 (_type_) none 31)
(dummy-32 (_type_) symbol 32)
(initialize-icons (_type_) none 33)
(initialize-particles (_type_) none 34)
(draw-memcard-storage-error (_type_ font-context) none 35)
(draw-memcard-data-exists (_type_ font-context) none 36)
(draw-memcard-no-data (_type_ font-context) none 37)
(draw-memcard-accessing (_type_ font-context) none 38)
(draw-memcard-insert (_type_ font-context) none 39)
(draw-memcard-file-select (_type_ font-context) none 40)
(draw-memcard-auto-save-error (_type_ font-context) none 41)
(draw-memcard-removed (_type_ font-context) none 42)
(draw-memcard-error (_type_ font-context) none 43)
(dummy-44 (_type_) none 44)
(push! (_type_) none 45)
(pop! (_type_) none 46)
(dummy-47 (_type_) none 47)
(enter! (_type_ progress-screen int) none 48)
(draw-memcard-format (_type_ font-context) none 49)
(draw-auto-save (_type_ font-context) none 50)
(set-transition-progress! (_type_ int) none 51)
(set-transition-speed! (_type_) none 52)
(dummy-53 (_type_ progress-screen) progress-screen 53)
(draw-pal-change-to-60hz (_type_ font-context) none 54)
(draw-pal-now-60hz (_type_ font-context) none 55)
(draw-no-disc (_type_ font-context) none 56)
(draw-bad-disc (_type_ font-context) none 57)
(draw-quit (_type_ font-context) none 58)
)
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -474,10 +474,10 @@
)
)
;; definition for symbol *options-remap*, type (array array)
;; definition for symbol *options-remap*, type (array (array game-option))
(define
*options-remap*
(the-as (array array)
(the-as (array (array game-option))
(new 'static 'boxed-array :type array :length 0 :allocated-length 35)
)
)
@@ -1724,4 +1724,3 @@
;; definition for symbol *game-counts*, type game-count-info
(define *game-counts* (the-as game-count-info #f))
+1 -1
View File
@@ -302,7 +302,7 @@
(deftype state (protect-frame)
((code function :offset-assert 16)
(trans (function none) :offset-assert 20)
(post (function none) :offset-assert 24)
(post function :offset-assert 24)
(enter function :offset-assert 28)
(event (function process int symbol event-message-block object) :offset-assert 32)
)
File diff suppressed because it is too large Load Diff
+81 -79
View File
@@ -33,94 +33,97 @@
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 16
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200000)
(new 'static 'sp-field-init-spec
:field #x1
:initial-valuef (the-as float #x200000)
)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x3e99999a
:random-range #x3e99999a
:random-mult #x3f800000
:initial-valuef 0.3
:random-rangef 0.3
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-value -973078528
:random-mult #x3f800000
:initial-valuef -8192.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x46000000
:random-range #x46000000
:random-mult #x3f800000
:initial-valuef 8192.0
:random-rangef 8192.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
:initial-valuef (the-as float #xfffffffc)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x42c80000
:random-range #x41f00000
:random-mult #x3f800000
:initial-valuef 100.0
:random-rangef 30.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x42a00000
:random-range #x41a00000
:random-mult #x3f800000
:initial-valuef 80.0
:random-rangef 20.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x41f00000
:random-range #x41f00000
:random-mult #x3f800000
:initial-valuef 30.0
:random-rangef 30.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x41800000
:random-range #x42400000
:random-mult #x3f800000
:initial-valuef 16.0
:random-rangef 48.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x415a740e
:random-mult #x3f800000
:initial-valuef 13.653334
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x1c
:flags #x1
:initial-value #x43088889
:random-mult #x3f800000
:initial-valuef 136.53334
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1101368306
:random-mult #x3f800000
:initial-valuef -0.21333334
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x26
:flags #x1
:initial-value -1106522267
:random-mult #x3f800000
:initial-valuef -0.13653333
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x12c
:random-mult 1
:initial-valuef (the-as float #x12c)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value #x1004
:random-mult 1
:initial-valuef (the-as float #x1004)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -133,107 +136,110 @@
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 18
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200f00)
(new 'static 'sp-field-init-spec
:field #x1
:initial-valuef (the-as float #x200f00)
)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x3dcccccd
:random-range #x3f800000
:random-mult #x3f800000
:initial-valuef 0.1
:random-rangef 1.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-value -973078528
:random-mult #x3f800000
:initial-valuef -8192.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x444ccccd
:random-range #x444ccccd
:random-mult #x3f800000
:initial-valuef 819.2
:random-rangef 819.2
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
:initial-valuef (the-as float #xfffffffc)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x42960000
:random-range #x42700000
:random-mult #x3f800000
:initial-valuef 75.0
:random-rangef 60.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x42700000
:random-range #x41a00000
:random-mult #x3f800000
:initial-valuef 60.0
:random-rangef 20.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x41b80000
:random-range #x41f00000
:random-mult #x3f800000
:initial-valuef 23.0
:random-rangef 30.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x43000000
:random-mult #x3f800000
:initial-valuef 128.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x42da740e
:random-range #x42da740e
:random-mult #x3f800000
:initial-valuef 109.22667
:random-rangef 109.22667
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1092979698
:random-mult #x3f800000
:initial-valuef -0.42666668
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x26
:flags #x1
:initial-value -1059425266
:random-mult #x3f800000
:initial-valuef -6.826667
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x12c
:random-mult 1
:initial-valuef (the-as float #x12c)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value #x1004
:random-mult 1
:initial-valuef (the-as float #x1004)
:random-multf (the-as float #x1)
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x45aaaaab
:random-range #x45aaaaab
:random-mult #x3f800000
:initial-valuef 5461.3335
:random-rangef 5461.3335
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:random-range #x47800000
:random-mult #x3f800000
:random-rangef 65536.0
:random-multf 1.0
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x444ccccd
:random-mult #x3f800000
:initial-valuef 819.2
:random-multf 1.0
)
(new 'static 'sp-field-init-spec :field #x43)
)
@@ -1435,7 +1441,3 @@ nav-enemy-default-event-handler
(go (method-of-object obj nav-enemy-idle))
(none)
)

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