fix issues and decompile racer-states (#924)

* fix issues and decompile racer-states

* type fix
This commit is contained in:
water111
2021-10-21 22:38:39 -04:00
committed by GitHub
parent 5649ca51c0
commit 44626cfedd
37 changed files with 6856 additions and 147 deletions
+17 -27
View File
@@ -218,6 +218,7 @@ std::string Type::get_parent() const {
bool Type::common_type_info_equal(const Type& other) const {
// clang-format off
return m_methods == other.m_methods &&
m_states == other.m_states &&
m_new_method_info == other.m_new_method_info &&
m_new_method_info_defined == other.m_new_method_info_defined &&
m_parent == other.m_parent &&
@@ -247,17 +248,21 @@ std::string Type::common_type_info_diff(const Type& other) const {
}
}
if (m_states != other.m_states) {
if (m_states.size() != other.m_states.size()) {
result += fmt::format("Number of additional states {} vs. {}\n", m_states.size(),
other.m_states.size());
result += "States are different:\n";
for (auto& ours : m_states) {
auto theirs = other.m_states.find(ours.first);
if (theirs == other.m_states.end()) {
result += fmt::format(" {} is in one, but not the other.\n", ours.first);
} else if (ours.second != theirs->second) {
result += fmt::format(" {} is defined differently: {} vs {}\n", ours.first,
ours.second.print(), theirs->second.print());
}
}
for (size_t i = 0; i < std::min(m_states.size(), other.m_states.size()); i++) {
if (m_states.at(i) != other.m_states.at(i)) {
result +=
fmt::format("State {} ({}/{}):\n", i, m_states.at(i).name, other.m_states.at(i).name);
result += m_states.at(i).diff(other.m_states.at(i));
result += "\n";
for (auto& theirs : other.m_states) {
auto ours = m_states.find(theirs.first);
if (ours == m_states.end()) {
result += fmt::format(" {} is in one, but not the other.\n", theirs.first);
}
}
}
@@ -396,25 +401,10 @@ std::string Type::print_method_info() const {
return result;
}
const StateInfo& Type::add_state(const StateInfo& info) {
m_states.push_back(info);
return m_states.back();
}
bool StateInfo::operator==(const StateInfo& other) const {
return name == other.name && type == other.type;
}
std::string StateInfo::diff(const StateInfo& other) const {
std::string result;
if (name != other.name) {
result += fmt::format("name: {} vs. {}\n", name, other.name);
void Type::add_state(const std::string& name, const TypeSpec& type) {
if (!m_states.insert({name, type}).second) {
throw std::runtime_error(fmt::format("State {} is multiply defined", name));
}
if (type != other.type) {
result += fmt::format("type: {} vs. {}\n", type.print(), other.type.print());
}
return result;
}
std::string Type::incompatible_diff(const Type& other) const {
+4 -12
View File
@@ -6,6 +6,7 @@
*/
#include <string>
#include <map>
#include "common/util/assert.h"
#include <unordered_map>
#include "common/goal_constants.h"
@@ -27,15 +28,6 @@ struct MethodInfo {
std::string diff(const MethodInfo& other) const;
};
struct StateInfo {
std::string name;
TypeSpec type;
bool operator==(const StateInfo& other) const;
bool operator!=(const StateInfo& other) const { return !((*this) == other); }
std::string diff(const StateInfo& other) const;
};
/*!
* Parent class of all Types.
*/
@@ -89,14 +81,14 @@ class Type {
const MethodInfo& add_method(const MethodInfo& info);
const MethodInfo& add_new_method(const MethodInfo& info);
std::string print_method_info() const;
const StateInfo& add_state(const StateInfo& info);
void add_state(const std::string& name, const TypeSpec& type);
void disallow_in_runtime() { m_allow_in_runtime = false; }
virtual ~Type() = default;
const std::vector<MethodInfo>& get_methods_defined_for_type() const { return m_methods; }
const std::vector<StateInfo>& get_states_declared_for_type() const { return m_states; }
const std::map<std::string, TypeSpec>& get_states_declared_for_type() const { return m_states; }
const MethodInfo* get_new_method_defined_for_type() const {
if (m_new_method_info_defined) {
@@ -116,7 +108,7 @@ class Type {
std::string incompatible_diff(const Type& other) const;
std::vector<MethodInfo> m_methods;
std::vector<StateInfo> m_states;
std::map<std::string, TypeSpec> m_states;
MethodInfo m_new_method_info;
bool m_new_method_info_defined = false;
+5 -5
View File
@@ -1694,15 +1694,15 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
std::string states_string;
for (auto& info : type->get_states_declared_for_type()) {
if (info.type.arg_count() > 1) {
states_string.append(fmt::format(" ({}", info.name));
for (size_t i = 0; i < info.type.arg_count() - 1; i++) {
if (info.second.arg_count() > 1) {
states_string.append(fmt::format(" ({}", info.first));
for (size_t i = 0; i < info.second.arg_count() - 1; i++) {
states_string.push_back(' ');
states_string.append(info.type.get_arg(i).print());
states_string.append(info.second.get_arg(i).print());
}
states_string.append(")\n");
} else {
states_string.append(fmt::format(" {}\n", info.name));
states_string.append(fmt::format(" {}\n", info.first));
}
}
+2 -2
View File
@@ -258,7 +258,7 @@ void declare_state(Type* type, TypeSystem* type_system, const goos::Object& def)
});
state_typespec.add_arg(TypeSpec(type->get_name()));
type->add_state({state_name, state_typespec});
type->add_state(state_name, state_typespec);
} else {
// name
auto state_name = symbol_string(*obj);
@@ -266,7 +266,7 @@ void declare_state(Type* type, TypeSystem* type_system, const goos::Object& def)
TypeSpec state_typespec("state");
state_typespec.add_arg(TypeSpec(type->get_name()));
type->add_state({state_name, state_typespec});
type->add_state(state_name, state_typespec);
}
});
}
@@ -3223,6 +3223,10 @@ Form* try_rewrite_as_process_to_ppointer(CondNoElseElement* value,
auto repopped = stack.pop_reg(condition_var, {}, env, true);
if (!repopped) {
repopped = var_to_form(condition_var, pool);
} else {
if (!env.dts->ts.tc(TypeSpec("process"), env.get_variable_type(condition_var, true))) {
repopped = pool.form<CastElement>(TypeSpec("process"), repopped);
}
}
return pool.alloc_single_element_form<GenericElement>(
+33
View File
@@ -553,6 +553,39 @@ FormElement* BitfieldAccessElement::push_step(const BitfieldManip step,
std::vector<BitFieldDef>{def});
}
if (m_steps.empty() && step.kind == BitfieldManip::Kind::LOGIOR_WITH_CONSTANT_INT) {
// this is a rare case of setting a bitfield to a constant. Usually we clear the field with an
// and, then set the bits we want with an or. In the case where we want to set all the bits to
// 1, we can omit the and to clear first.
// in this case, we expect the value we're oring with to be the appropriate mask for the field.
fmt::print("Rare bitfield set!\n");
u64 value = step.amount;
auto type = ts.lookup_type(m_type);
auto as_bitfield = dynamic_cast<BitFieldType*>(type);
assert(as_bitfield);
auto field = find_field_from_mask(ts, as_bitfield, value, m_got_pcpyud);
assert(field);
bool is_signed =
ts.tc(TypeSpec("int"), field->type()) && !ts.tc(TypeSpec("uint"), field->type());
// use the field to figure out what value is being set.
s64 set_value;
if (is_signed) {
set_value = extract_bitfield<s64>(value, field->offset() - pcpyud_offset, field->size());
} else {
set_value = extract_bitfield<u64>(value, field->offset() - pcpyud_offset, field->size());
}
BitFieldDef def;
def.field_name = field->name();
def.value = pool.alloc_single_element_form<SimpleAtomElement>(
nullptr, SimpleAtom::make_int_constant(set_value));
return pool.alloc_element<ModifiedCopyBitfieldElement>(m_type, m_base, m_got_pcpyud,
std::vector<BitFieldDef>{def});
}
if (m_steps.size() == 1 && m_steps.at(0).kind == BitfieldManip::Kind::LOGAND_WITH_CONSTANT_INT &&
step.kind == BitfieldManip::Kind::LOGIOR_WITH_FORM) {
// this is setting a bitfield to a variable
+75 -57
View File
@@ -9873,6 +9873,9 @@
(nocamera uint8 :offset 1 :size 1)
(noedge uint8 :offset 2 :size 1)
(nolineofsight uint8 :offset 12 :size 1)
;; this is not in the inspect, but appears to be set.
(unknown-bit uint8 :offset 15 :size 1)
)
:method-count-assert 9
:size-assert #x4
@@ -11284,10 +11287,15 @@
(unknown-dword40 int64 :offset 2160) ;; from logic-target::target-compute-edge
(unknown-dword41 int64 :offset 2168) ;; from logic-target::target-compute-edge
(unknown-handle10 handle :offset 2176) ;; from logic-target::target-compute-pole - probably a swingpole
(unknown-float120 float :offset 2184) ;; from target::mod-var-jump
(unknown-symbol20 symbol :offset 2184) ;; from (anon-function 1 basebutton)
(unknown-int20 int32 :offset 2188) ;; from logic-target::target-compute-pole
(unknown-float121 float :offset 2188) ;; from target::mod-var-jump
(unknown-float123 float :offset 2200) ;; from target::mod-var-jump
(unknown-vector102 vector :inline :offset 2224) ;; from (anon-function 3 basebutton)
(unknown-vector103 vector :inline :offset 2240) ;; from (anon-function 3 basebutton)
(unknown-quaternion02 quaternion :inline :offset 2256) ;; from racer-states::(code target-racing-get-on)
(unknown-quaternion03 quaternion :inline :offset 2272) ;; from racer-states::(code target-racing-get-on)
(unknown-smush00 smush-control :inline :offset 2288) ;; from (event target-fishing)
(unknown-vector110 vector :inline :offset 2320) ;; from logic-target::flag-setup
(unknown-vector111 vector :inline :offset 2336) ;; from logic-target::flag-setup
@@ -11780,6 +11788,24 @@
(:methods
(dummy-20 (_type_ collide-cache) none 20)
)
(:states
(target-racing-get-off handle)
(target-racing-jump float float symbol)
(target-racing-hit handle attack-info)
(target-racing-grab)
(target-racing-clone-anim handle)
(target-racing-get-on handle)
(target-racing-falling)
(target-racing-bounce float float symbol)
(target-racing-death symbol)
(target-racing-get-off-jump handle)
(target-racing-get-off-hit-ground symbol)
(target-death)
(target-hit-ground symbol)
(target-clone-anim)
)
)
(deftype sidekick (process-drawable)
@@ -18116,7 +18142,7 @@
;;(define-extern *col-timer-enable* object) ;; unknown type
;;(define-extern *frame-timer* object) ;; unknown type
;;(define-extern *col-timer* object) ;; unknown type
;;(define-extern *race-track-surface* object) ;; unknown type
(define-extern *race-track-surface* surface)
;; ----------------------
@@ -19459,7 +19485,7 @@
(define-extern set-forward-vel (function float vector :behavior target))
(define-extern delete-back-vel (function float none :behavior target))
(define-extern set-side-vel (function float vector :behavior target))
(define-extern target-timed-invulnerable (function uint64 target none)) ;; TODO - likely useconds
(define-extern target-timed-invulnerable (function uint target none)) ;; TODO - likely useconds
(define-extern target-timed-invulnerable-off (function target none))
(define-extern ground-tween-initialize (function ground-tween-info uint uint uint uint uint uint ground-tween-info :behavior target)) ;; TODO - dealing with inline-array issues
(define-extern ground-tween-update (function ground-tween-info float float none :behavior target)) ;; TODO - inline array issues as well
@@ -22784,6 +22810,9 @@
(away-from-rand-transv-y-lo float :offset 56)
(away-from-rand-transv-y-hi float :offset 60)
)
(:methods
(new (symbol type int) _type_ 0)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
@@ -22873,7 +22902,7 @@
;; - Functions
(define-extern joint-exploder-joint-callback (function joint-exploder none))
(define-extern joint-exploder-init-by-other function)
(define-extern joint-exploder-init-by-other (function skeleton-group int joint-exploder-static-params joint-exploder-tuning none :behavior joint-exploder))
;; - Unknowns
@@ -29405,7 +29434,7 @@
;; - Types
(deftype racer-info (basic)
((entity basic :offset-assert 4)
((entity entity-actor :offset-assert 4)
(bike-trans vector :inline :offset-assert 16)
(bike-quat vector :inline :offset-assert 32)
(bike-scale vector :inline :offset-assert 48)
@@ -29446,14 +29475,14 @@
(targ-rotx degrees :offset-assert 332)
(speed-rotx float :offset-assert 336)
(mult-rotx degrees :offset-assert 340)
(front-blade basic :offset-assert 344)
(front-blade joint-mod :offset-assert 344)
(front-rot degrees :offset-assert 348)
(front-rotv degrees :offset-assert 352)
(bottom-blade basic :offset-assert 356)
(bottom-blade joint-mod :offset-assert 356)
(bottom-rot degrees :offset-assert 360)
(front basic :offset-assert 364)
(front joint-mod :offset-assert 364)
(front-turn degrees :offset-assert 368)
(tail basic :offset-assert 372)
(tail joint-mod :offset-assert 372)
(tail-tilt degrees :offset-assert 376)
(transv-max meters :offset-assert 380)
(slide-down-time uint64 2 :offset-assert 384)
@@ -29470,7 +29499,7 @@
(boost-level float :offset-assert 452)
(boost-target float :offset-assert 456)
(boost-output float :offset-assert 460)
(hop? basic :offset-assert 464)
(hop? symbol :offset-assert 464)
(hop-start-y float :offset-assert 468)
(bounce int32 :offset-assert 472)
(bounce-hit float :offset-assert 476)
@@ -29485,10 +29514,10 @@
(rudd-anim-vel float :offset-assert 512)
(rudd-anim-frame float :offset-assert 516)
(racing-time uint64 :offset-assert 520)
(stick-lock basic :offset-assert 528)
(stick-off basic :offset-assert 532)
(heavy basic :offset-assert 536)
(unstuck-time uint64 :offset-assert 544)
(stick-lock symbol :offset-assert 528)
(stick-off symbol :offset-assert 532)
(heavy symbol :offset-assert 536)
(unstuck-time int64 :offset-assert 544)
(stuck-count int32 :offset-assert 552)
(scrape-sound-id sound-id :offset-assert 556)
(heat-sound-time uint64 :offset-assert 560)
@@ -29580,39 +29609,29 @@
;; - Types
; (deftype racer (process-drawable)
; ((extra-trans vector :inline :offset-assert 176)
; (condition int32 :offset-assert 192)
; (cell uint64 :offset-assert 200)
; (path-data UNKNOWN 2 :offset-assert 208)
; (path-target basic :offset-assert 208)
; (path-racer basic :offset-assert 212)
; (auto-get-off basic :offset-assert 216)
; (shadow-backup basic :offset-assert 220)
; )
; :method-count-assert 24
; :size-assert #xe0
; :heap-base #x70
; :flag-assert #x18007000e0
; ;; inherited inspect of process-drawable
; (:methods
; (dummy-9 () none 9)
; (dummy-10 () none 10)
; (dummy-11 () none 11)
; (dummy-12 () none 12)
; (dummy-13 () none 13)
; (dummy-14 () none 14)
; (dummy-15 () none 15)
; (dummy-16 () none 16)
; (dummy-17 () none 17)
; (dummy-18 () none 18)
; (dummy-19 () none 19)
; (dummy-20 () none 20)
; (dummy-21 () none 21)
; (dummy-22 () none 22)
; (dummy-23 () none 23)
; )
; )
(deftype racer (process-drawable)
((parent-override (pointer target) :score 100 :offset 12)
(root-override collide-shape-moving :score 100 :offset 112)
(extra-trans vector :inline :offset-assert 176)
(condition int32 :offset-assert 192)
(cell handle :offset-assert 200)
(path-data path-control 2 :offset-assert 208)
(path-target curve-control :offset 208)
(path-racer path-control :offset 212)
(auto-get-off symbol :offset-assert 216)
(shadow-backup shadow-geo :offset-assert 220)
)
:method-count-assert 24
:size-assert #xe0
:heap-base #x70
:flag-assert #x18007000e0
(:methods
(wait-for-start () _type_ :state 20)
(idle () _type_ :state 21)
(pickup ((state collectable)) _type_ :state 22)
(wait-for-return () _type_ :state 23)
)
)
;; - Functions
@@ -29623,7 +29642,7 @@
;; - Unknowns
(define-extern *racer-sg* skeleton-group)
;;(define-extern *racer-shadow-control* object) ;; unknown type
(define-extern *racer-shadow-control* shadow-control)
(define-extern *racer-explode-sg* skeleton-group)
@@ -29639,21 +29658,21 @@
(define-extern racer-service-slide function)
(define-extern racer-xz function)
(define-extern racer-thrust function)
(define-extern racer-calc-gravity function)
(define-extern racer-calc-gravity (function vector :behavior target))
(define-extern racer-on-ground? function)
(define-extern racer-collision function)
(define-extern racer-integrate function)
(define-extern racer-effects function)
(define-extern racer-sounds function)
(define-extern racer-sounds (function object :behavior target))
(define-extern racer-bend-gravity function)
(define-extern racer-find-prop-point function)
(define-extern racer-cushion function)
(define-extern racer-buzz function)
(define-extern target-racing-center-anim function)
(define-extern target-racing-turn-anim function)
(define-extern target-racing-jump-anim function)
(define-extern target-racing-land-anim function)
(define-extern target-racing-post function)
(define-extern racer-buzz (function float none :behavior target))
(define-extern target-racing-center-anim (function none :behavior target))
(define-extern target-racing-turn-anim (function none :behavior target))
(define-extern target-racing-jump-anim (function basic int none :behavior target))
(define-extern target-racing-land-anim (function symbol none :behavior target))
(define-extern target-racing-post (function none :behavior target))
;; - Unknowns
@@ -29686,9 +29705,8 @@
(define-extern target-racing (state target)) ;; unknown type
(define-extern target-racing-grab (state target)) ;; unknown type
(define-extern target-racing-clone-anim (state handle target)) ;; unknown type
(define-extern target-racing-get-off-hit-ground (state target)) ;; unknown type
(define-extern target-racing-get-off-hit-ground (state symbol target)) ;; unknown type
(define-extern target-racing-get-off-jump (state handle target)) ;; unknown type
(define-extern target-racing-death (state target)) ;; unknown type
(define-extern target-racing-jump (state float float symbol target)) ;; unknown type
(define-extern target-racing-bounce (state float float symbol target)) ;; unknown type
(define-extern target-racing-falling (state target)) ;; unknown type
@@ -801,5 +801,11 @@
[6, "(function final-door symbol)"]
],
"racer-states-FIC-LAV-MIS-OGR-ROL": [
[17, "(function (pointer process) :behavior racer)"],
[45, "(function joint-mod :behavior manipy)"],
[46, "(function float :behavior manipy)"]
],
"placeholder-do-not-add-below": []
}
@@ -2672,5 +2672,80 @@
[16, "event-message-block"]
],
"(exit target-racing-start)": [
[16, "event-message-block"]
],
"(code target-racing-start)": [
[16, "event-message-block"]
],
"target-racing-smack-check": [
[16, "vector"],
[32, "vector"]
],
"(trans target-racing)": [
[16, "vector"]
],
"(trans target-racing-jump)": [
[16, "vector"]
],
"(trans target-racing-bounce)": [
[16, "vector"]
],
"(code target-racing-hit)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "vector"]
],
"(exit target-racing-death)": [
[16, "event-message-block"]
],
"(anon-function 17 racer-states-FIC-LAV-MIS-OGR-ROL)": [
[16, "joint-exploder-tuning"]
],
"(code target-racing-death)": [
[16, "event-message-block"],
[96, "vector"],
[112, "vector"]
],
"(code target-racing-get-on)": [
[16, "vector"],
[32, "vector"],
[48, "event-message-block"]
],
"(post target-racing-get-on)": [
[16, "vector"]
],
"(code target-racing-get-off-jump)": [
[16, "vector"],
[32, "vector"],
[48, "event-message-block"]
],
"(post target-racing-get-off-jump)": [
[16, "vector"]
],
"(exit target-racing-clone-anim)": [
[16, "event-message-block"]
],
"(code target-racing-clone-anim)": [
[16, "event-message-block"]
],
"placeholder-do-not-add-below!": []
}
@@ -4042,5 +4042,44 @@
[251, "a0", "process-drawable"]
],
"(anon-function 46 racer-states-FIC-LAV-MIS-OGR-ROL)": [
[[4, 32], "v1", "target"]
],
"(anon-function 45 racer-states-FIC-LAV-MIS-OGR-ROL)": [
[19, "a0", "target"],
[31, "a0", "target"],
[42, "v1", "target"]
],
"(code target-racing-smack)": [
[30, "v1", "art-joint-anim"]
],
"(code target-racing-hit)": [
[186, "v1", "art-joint-anim"]
],
"(code target-racing-death)": [
[242, "v1", "art-joint-anim"]
],
"(code target-racing-get-on)": [
[59, "s3", "racer"]
],
"(code target-racing-get-off-jump)": [
[67, "s2", "racer"],
[145, "v1", "art-joint-anim"]
],
"(code target-racing-get-off-hit-ground)": [
[13, "v1", "art-joint-anim"]
],
"(event target-racing-grab)": [
[24, "a0", "process-drawable"]
],
"placeholder-do-not-add-below": []
}
+1 -1
View File
@@ -67,7 +67,7 @@ void DecompilerTypeSystem::parse_type_defs(const std::vector<std::string>& file_
}
// declare the type's states globally
for (auto& state : dtr.type_info->get_states_declared_for_type()) {
add_symbol(state.name, state.type);
add_symbol(state.first, state.second);
}
} else if (car(o).as_symbol()->name == "declare-type") {
+2 -1
View File
@@ -21,4 +21,5 @@ VI1.DGO out/iso/VI1.DGO
VI2.DGO out/iso/VI2.DGO
VI3.DGO out/iso/VI3.DGO
TRA.DGO out/iso/TRA.DGO
FIN.DGO out/iso/FIN.DGO
FIN.DGO out/iso/FIN.DGO
FIC.DGO out/iso/FIC.DGO
+28
View File
@@ -0,0 +1,28 @@
("FIC.DGO"
("target-racer-h-FIC-LAV-MIS-OGR-ROL.o" "target-racer-h")
("racer-part.o" "racer-part")
("racer.o" "racer")
("target-racer-FIC-LAV-MIS-OGR-ROL.o" "target-racer")
("racer-states-FIC-LAV-MIS-OGR-ROL.o" "racer-states")
("collide-reaction-racer.o" "collide-reaction-racer")
("eichar-racer+0-ag.go" "eichar-racer+0")
("tpage-1119.go" "tpage-1119")
("blocking-plane.o" "blocking-plane")
("firecanyon-part.o" "firecanyon-part")
("assistant-firecanyon.o" "assistant-firecanyon")
("firecanyon-obs.o" "firecanyon-obs")
("tpage-815.go" "tpage-815")
("tpage-822.go" "tpage-822")
("tpage-854.go" "tpage-854")
("tpage-1123.go" "tpage-1123")
("assistant-firecanyon-ag.go" "assistant-firecanyon")
("babak-ag.go" "babak")
("balloon-ag.go" "balloon")
("crate-darkeco-cluster-ag-FIC.go" "crate-darkeco-cluster")
("ecovalve-ag-FIC-OGR.go" "ecovalve")
("ef-plane-ag-FIC-LAV-OGR-ROL-SNO-SWA.go" "ef-plane")
("racer-ag-FIC-ROL.go" "racer")
("spike-ag.go" "spike")
("firecanyon-vis.go" "firecanyon-vis")
)
+1
View File
@@ -107,3 +107,4 @@
(define-extern cspace<-parented-transformq-joint! (function cspace transformq none))
(define-extern cspace<-transformq! (function cspace transformq matrix))
(define-extern vector<-cspace! (function vector cspace vector))
(define-extern cspace<-transformq+world-trans! (function cspace transformq vector matrix))
@@ -121,10 +121,15 @@
(unknown-dword40 int64 :offset 2160) ;; from logic-target::target-compute-edge
(unknown-dword41 int64 :offset 2168) ;; from logic-target::target-compute-edge
(unknown-handle10 handle :offset 2176) ;; from logic-target::target-compute-pole - probably a swingpole
(unknown-float120 float :offset 2184) ;; from target::mod-var-jump
(unknown-symbol20 symbol :offset 2184) ;; from (anon-function 1 basebutton)
(unknown-int20 int32 :offset 2188) ;; from logic-target::target-compute-pole
(unknown-float121 float :offset 2188) ;; from target::mod-var-jump
(unknown-float123 float :offset 2200) ;; from target::mod-var-jump
(unknown-vector102 vector :inline :offset 2224) ;; from (anon-function 3 basebutton)
(unknown-vector103 vector :inline :offset 2240) ;; from (anon-function 3 basebutton)
(unknown-quaternion02 quaternion :inline :offset 2256) ;; from racer-states::(code target-racing-get-on)
(unknown-quaternion03 quaternion :inline :offset 2272) ;; from racer-states::(code target-racing-get-on)
(unknown-smush00 smush-control :inline :offset 2288) ;; from (event target-fishing)
(unknown-vector110 vector :inline :offset 2320) ;; from logic-target::flag-setup
(unknown-vector111 vector :inline :offset 2336) ;; from logic-target::flag-setup
+1
View File
@@ -63,6 +63,7 @@
(nocamera uint8 :offset 1 :size 1)
(noedge uint8 :offset 2 :size 1)
(nolineofsight uint8 :offset 12 :size 1)
(unknown-bit uint8 :offset 15 :size 1)
)
:method-count-assert 9
:size-assert #x4
+22
View File
@@ -26,6 +26,9 @@
;; TODO - for logic-target - defined in target-death
(define-extern target-continue (state continue-point none))
(define-extern target-periscope (state target))
(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target))
(define-extern init-var-jump (function float float vector vector vector vector :behavior target)) ;; 1st and 2nd vectors may be symbols instead?
(define-extern target-standard-event-handler function)
(declare-type sidekick basic)
(declare-type collide-cache basic)
@@ -89,6 +92,24 @@
(:methods
(dummy-20 (_type_ collide-cache) none 20)
)
(:states
(target-racing-get-off handle)
(target-racing-jump float float symbol)
(target-racing-hit handle attack-info)
(target-racing-grab)
(target-racing-clone-anim handle)
(target-racing-get-on handle)
(target-racing-falling)
(target-racing-bounce float float symbol)
(target-racing-death symbol)
(target-racing-get-off-jump handle)
(target-racing-get-off-hit-ground symbol)
(target-death)
(target-hit-ground symbol)
(target-clone-anim)
)
)
(define-perm *target* target #f)
@@ -106,3 +127,4 @@
)
(define-perm *sidekick* sidekick #f)
(define-extern target-attacked (function symbol uint uint process (state target) object :behavior target)) ;; unconfirmed, target-tube::(event target-tube-start)
+1 -1
View File
@@ -1188,7 +1188,7 @@
)
)
(defun target-timed-invulnerable ((arg0 uint64) (arg1 target))
(defun target-timed-invulnerable ((arg0 uint) (arg1 target))
(logior! (-> arg1 state-flags) 32)
(set! (-> arg1 control unknown-dword70) (-> *display* base-frame-counter))
(set! (-> arg1 control unknown-dword71) (the-as int arg0))
+46
View File
@@ -214,6 +214,7 @@
"out/iso/VI3.DGO"
"out/iso/TRA.DGO"
"out/iso/FIN.DGO"
"out/iso/FIC.DGO"
)
;;;;;;;;;;;;;;;;;;;;;;;;
@@ -225,6 +226,9 @@
(copy-gos
"warpgate-ag"
"sharkey-ag-BEA-TRA-VI2"
"eichar-racer+0-ag"
"babak-ag"
)
@@ -240,6 +244,15 @@
"village_common/villagep-obs.gc"
"village_common/oracle.gc"
"common/blocking-plane.gc"
"racer_common/target-racer-h-FIC-LAV-MIS-OGR-ROL.gc"
"racer_common/racer-part.gc"
"racer_common/racer.gc"
"racer_common/target-racer-FIC-LAV-MIS-OGR-ROL.gc"
"racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc"
"racer_common/collide-reaction-racer.gc"
)
@@ -314,6 +327,39 @@
"village1-vis"
)
;;;;;;;;;;;;;;;;;;;;;
;; Fire Canyon
;;;;;;;;;;;;;;;;;;;;;
(cgo "FIC.DGO"
"fic.gd"
)
(copy-textures 1119) ;; might be common/zoomer hud??
(goal-src-sequence
"levels/firecanyon/"
:deps ;; no idea what these depend on, make it depend on the whole engine
("out/obj/default-menu.o")
"firecanyon-part.gc"
"assistant-firecanyon.gc"
"firecanyon-obs.gc"
)
(copy-textures 815 822 854 1123)
(copy-gos
"assistant-firecanyon-ag"
"balloon-ag"
"crate-darkeco-cluster-ag-FIC"
"ecovalve-ag-FIC-OGR"
"ef-plane-ag-FIC-LAV-OGR-ROL-SNO-SWA"
"racer-ag-FIC-ROL"
"spike-ag"
"firecanyon-vis")
;;;;;;;;;;;;;;;;;;;;;
;; Training
;;;;;;;;;;;;;;;;;;;;;
File diff suppressed because it is too large Load Diff
+24
View File
@@ -5,3 +5,27 @@
;; name in dgo: racer
;; dgos: L1, FIC, LAV, MIS, OGR, RACERP, ROL
(deftype racer (process-drawable)
((parent-override (pointer target) :score 100 :offset 12)
(root-override collide-shape-moving :score 100 :offset 112)
(extra-trans vector :inline :offset-assert 176)
(condition int32 :offset-assert 192)
(cell handle :offset-assert 200)
(path-data path-control 2 :offset-assert 208)
(path-target curve-control :offset 208)
(path-racer path-control :offset 212)
(auto-get-off symbol :offset-assert 216)
(shadow-backup shadow-geo :offset-assert 220)
)
:method-count-assert 24
:size-assert #xe0
:heap-base #x70
:flag-assert #x18007000e0
(:methods
(wait-for-start () _type_ :state 20)
(idle () _type_ :state 21)
(pickup ((state collectable)) _type_ :state 22)
(wait-for-return () _type_ :state 23)
)
)
@@ -5,3 +5,5 @@
;; name in dgo: target-racer
;; dgos: FIC, LAV, MIS, OGR, ROL
(define-extern racer-collision-reaction function)
(define-extern *racer-mods* surface)
@@ -6,11 +6,22 @@
;; dgos: FIC, LAV, MIS, OGR, ROL
(define-extern *balloon-sg* skeleton-group)
(define-extern *racer-sg* skeleton-group)
(define-extern target-racing-smack (state float symbol target))
(define-extern target-racing-center-anim (function none :behavior target))
(define-extern racer-buzz (function float none :behavior target))
(define-extern target-racing-post (function none :behavior target))
(define-extern target-racing-land-anim (function symbol none :behavior target))
(define-extern target-racing-turn-anim (function none :behavior target))
(define-extern racer-calc-gravity (function vector :behavior target))
(define-extern target-racing-jump-anim (function basic int none :behavior target))
(define-extern racer-sounds (function object :behavior target))
(define-extern *racer-air-mods* surface)
;; decomp begins
(deftype racer-info (basic)
((entity basic :offset-assert 4)
((entity entity-actor :offset-assert 4)
(bike-trans vector :inline :offset-assert 16)
(bike-quat vector :inline :offset-assert 32)
(bike-scale vector :inline :offset-assert 48)
@@ -51,14 +62,14 @@
(targ-rotx degrees :offset-assert 332)
(speed-rotx float :offset-assert 336)
(mult-rotx degrees :offset-assert 340)
(front-blade basic :offset-assert 344)
(front-blade joint-mod :offset-assert 344)
(front-rot degrees :offset-assert 348)
(front-rotv degrees :offset-assert 352)
(bottom-blade basic :offset-assert 356)
(bottom-blade joint-mod :offset-assert 356)
(bottom-rot degrees :offset-assert 360)
(front basic :offset-assert 364)
(front joint-mod :offset-assert 364)
(front-turn degrees :offset-assert 368)
(tail basic :offset-assert 372)
(tail joint-mod :offset-assert 372)
(tail-tilt degrees :offset-assert 376)
(transv-max meters :offset-assert 380)
(slide-down-time uint64 2 :offset-assert 384)
@@ -75,7 +86,7 @@
(boost-level float :offset-assert 452)
(boost-target float :offset-assert 456)
(boost-output float :offset-assert 460)
(hop? basic :offset-assert 464)
(hop? symbol :offset-assert 464)
(hop-start-y float :offset-assert 468)
(bounce int32 :offset-assert 472)
(bounce-hit float :offset-assert 476)
@@ -90,10 +101,10 @@
(rudd-anim-vel float :offset-assert 512)
(rudd-anim-frame float :offset-assert 516)
(racing-time uint64 :offset-assert 520)
(stick-lock basic :offset-assert 528)
(stick-off basic :offset-assert 532)
(heavy basic :offset-assert 536)
(unstuck-time uint64 :offset-assert 544)
(stick-lock symbol :offset-assert 528)
(stick-off symbol :offset-assert 532)
(heavy symbol :offset-assert 536)
(unstuck-time int64 :offset-assert 544)
(stuck-count int32 :offset-assert 552)
(scrape-sound-id sound-id :offset-assert 556)
(heat-sound-time uint64 :offset-assert 560)
@@ -103,6 +114,7 @@
:flag-assert #x900000238
)
;; definition of type racer-bank
(deftype racer-bank (basic)
((slide-hold-time seconds :offset-assert 8)
+7 -6
View File
@@ -376,21 +376,22 @@ Val* Compiler::compile_deftype(const goos::Object& form, const goos::Object& res
// add declared states
for (auto& state : result.type_info->get_states_declared_for_type()) {
auto existing_type = m_symbol_types.find(state.name);
if (existing_type != m_symbol_types.end() && existing_type->second != state.type) {
auto existing_type = m_symbol_types.find(state.first);
if (existing_type != m_symbol_types.end() && existing_type->second != state.second) {
if (m_throw_on_define_extern_redefinition) {
throw_compiler_error(form, "deftype would redefine the type of state {} from {} to {}.",
state.name, existing_type->second.print(), state.type.print());
state.first, existing_type->second.print(), state.second.print());
} else {
print_compiler_warning(
"[Warning] deftype has redefined the type of state {}\npreviously: {}\nnow: "
"{}\n",
state.name.c_str(), existing_type->second.print().c_str(), state.type.print().c_str());
state.first.c_str(), existing_type->second.print().c_str(),
state.second.print().c_str());
}
}
m_symbol_types[state.name] = state.type;
m_symbol_info.add_fwd_dec(state.name, form);
m_symbol_types[state.first] = state.second;
m_symbol_info.add_fwd_dec(state.first, form);
}
if (result.create_runtime_type) {
@@ -128,10 +128,15 @@
(unknown-dword40 int64 :offset 2160)
(unknown-dword41 int64 :offset 2168)
(unknown-handle10 handle :offset 2176)
(unknown-float120 float :offset 2184)
(unknown-symbol20 symbol :offset 2184)
(unknown-int20 int32 :offset 2188)
(unknown-float121 float :offset 2188)
(unknown-float123 float :offset 2200)
(unknown-vector102 vector :inline :offset 2224)
(unknown-vector103 vector :inline :offset 2240)
(unknown-quaternion02 quaternion :inline :offset 2256)
(unknown-quaternion03 quaternion :inline :offset 2272)
(unknown-smush00 smush-control :inline :offset 2288)
(unknown-vector110 vector :inline :offset 2320)
(unknown-vector111 vector :inline :offset 2336)
+1
View File
@@ -12,6 +12,7 @@
(nocamera uint8 :offset 1 :size 1)
(noedge uint8 :offset 2 :size 1)
(nolineofsight uint8 :offset 12 :size 1)
(unknown-bit uint8 :offset 15 :size 1)
)
:method-count-assert 9
:size-assert #x4
+16
View File
@@ -36,6 +36,22 @@
(:methods
(dummy-20 (_type_ collide-cache) none 20)
)
(:states
target-clone-anim
target-death
(target-hit-ground symbol)
(target-racing-bounce float float symbol)
(target-racing-clone-anim handle)
(target-racing-death symbol)
target-racing-falling
(target-racing-get-off handle)
(target-racing-get-off-hit-ground symbol)
(target-racing-get-off-jump handle)
(target-racing-get-on handle)
target-racing-grab
(target-racing-hit handle attack-info)
(target-racing-jump float float symbol)
)
)
;; definition for method 3 of type target
+1 -1
View File
@@ -1433,7 +1433,7 @@
;; definition for function target-timed-invulnerable
;; INFO: Return type mismatch int vs none.
(defun target-timed-invulnerable ((arg0 uint64) (arg1 target))
(defun target-timed-invulnerable ((arg0 uint) (arg1 target))
(logior! (-> arg1 state-flags) 32)
(set! (-> arg1 control unknown-dword70) (-> *display* base-frame-counter))
(set! (-> arg1 control unknown-dword71) (the-as int arg0))
+1 -1
View File
@@ -494,7 +494,7 @@
(v1-5 ((method-of-type process new) allocation process 'dead arg1))
)
(set! (-> s3-0 child) (process->ppointer v1-5))
(set! (-> v1-5 parent) (process->ppointer s3-0))
(set! (-> v1-5 parent) (process->ppointer (the-as process s3-0)))
(set! (-> v1-5 pool) s3-0)
(set! (-> v1-5 brother) s1-0)
)
+4 -4
View File
@@ -836,7 +836,7 @@
(-> self control unknown-vector102 y)
(+ -4096.0 (-> self control unknown-vector102 y))
)
(set! (-> self control unknown-symbol20) #f)
(set! (-> self control unknown-float120) (the-as float #f))
(vector-reset! (-> self control transv))
(logior! (-> self state-flags) 1024)
(set! (-> self alt-cam-pos quad) (-> arg1 quad))
@@ -986,7 +986,7 @@
(and
(or
(< (vector-dot gp-2 (-> self control transv)) 0.0)
(-> self control unknown-symbol20)
(-> self control unknown-float120)
)
(>= (- (-> *display* base-frame-counter) (-> self state-time)) 15)
)
@@ -997,10 +997,10 @@
)
(set! (-> self control transv x) (* 0.95 (-> self control transv x)))
(set! (-> self control transv z) (* 0.95 (-> self control transv z)))
(when (not (-> self control unknown-symbol20))
(when (not (-> self control unknown-float120))
(send-event self 'do-effect 'death-warp-out -1.0)
(let ((v0-2 #t))
(set! (-> self control unknown-symbol20) v0-2)
(set! (-> self control unknown-float120) (the-as float v0-2))
v0-2
)
)
@@ -20,10 +20,10 @@
(common-trans (_type_) none 20)
)
(:states
light-eco-child-die
light-eco-child-grabbed
light-eco-child-hit-ground
light-eco-child-idle
light-eco-child-die
)
)
@@ -60,8 +60,8 @@
(common-trans (_type_) none 21)
)
(:states
light-eco-mother-discipate
light-eco-mother-active
light-eco-mother-discipate
)
)
+4 -4
View File
@@ -3004,7 +3004,7 @@
(activate! (-> self control unknown-smush00) 1.0 120 210 0.3 1.0)
)
((= arg2 'lose)
(set! (-> self control unknown-symbol20) arg2)
(set! (-> self control unknown-float120) (the-as float arg2))
arg2
)
(else
@@ -3017,7 +3017,7 @@
(set! (-> self control unknown-surface00) *empty-mods*)
(logior! (-> self state-flags) 16)
(set-zero! (-> self control unknown-smush00))
(set! (-> self control unknown-symbol20) #f)
(set! (-> self control unknown-float120) (the-as float #f))
(none)
)
:exit
@@ -3134,7 +3134,7 @@
(set! (-> s5-1 frame-num) (ja-aframe 15.0 0))
)
(let ((s5-2 (new 'stack-no-clear 'vector)))
(until (-> self control unknown-symbol20)
(until (-> self control unknown-float120)
(let ((v1-42 (handle->process arg0)))
(when v1-42
(let ((a0-28 (-> self skel root-channel 0)))
@@ -3187,7 +3187,7 @@
(suspend)
)
)
(case (-> self control unknown-symbol20)
(case (-> self control unknown-float120)
(('lose)
(ja-channel-push! 1 30)
(let ((a0-38 (-> self skel root-channel 0)))
@@ -63,9 +63,9 @@
:size-assert #x200
:flag-assert #x4c01900200
(:states
baby-spider-die-fast
baby-spider-hatching
baby-spider-resume
baby-spider-die-fast
)
)
@@ -42,8 +42,8 @@
:size-assert #xb4
:flag-assert #x14005000b4
(:states
spiderwebs-idle
spiderwebs-bounce
spiderwebs-idle
)
)
File diff suppressed because it is too large Load Diff
@@ -3,7 +3,7 @@
;; definition of type racer-info
(deftype racer-info (basic)
((entity basic :offset-assert 4)
((entity entity-actor :offset-assert 4)
(bike-trans vector :inline :offset-assert 16)
(bike-quat vector :inline :offset-assert 32)
(bike-scale vector :inline :offset-assert 48)
@@ -44,14 +44,14 @@
(targ-rotx degrees :offset-assert 332)
(speed-rotx float :offset-assert 336)
(mult-rotx degrees :offset-assert 340)
(front-blade basic :offset-assert 344)
(front-blade joint-mod :offset-assert 344)
(front-rot degrees :offset-assert 348)
(front-rotv degrees :offset-assert 352)
(bottom-blade basic :offset-assert 356)
(bottom-blade joint-mod :offset-assert 356)
(bottom-rot degrees :offset-assert 360)
(front basic :offset-assert 364)
(front joint-mod :offset-assert 364)
(front-turn degrees :offset-assert 368)
(tail basic :offset-assert 372)
(tail joint-mod :offset-assert 372)
(tail-tilt degrees :offset-assert 376)
(transv-max meters :offset-assert 380)
(slide-down-time uint64 2 :offset-assert 384)
@@ -68,7 +68,7 @@
(boost-level float :offset-assert 452)
(boost-target float :offset-assert 456)
(boost-output float :offset-assert 460)
(hop? basic :offset-assert 464)
(hop? symbol :offset-assert 464)
(hop-start-y float :offset-assert 468)
(bounce int32 :offset-assert 472)
(bounce-hit float :offset-assert 476)
@@ -83,10 +83,10 @@
(rudd-anim-vel float :offset-assert 512)
(rudd-anim-frame float :offset-assert 516)
(racing-time uint64 :offset-assert 520)
(stick-lock basic :offset-assert 528)
(stick-off basic :offset-assert 532)
(heavy basic :offset-assert 536)
(unstuck-time uint64 :offset-assert 544)
(stick-lock symbol :offset-assert 528)
(stick-off symbol :offset-assert 532)
(heavy symbol :offset-assert 536)
(unstuck-time int64 :offset-assert 544)
(stuck-count int32 :offset-assert 552)
(scrape-sound-id sound-id :offset-assert 556)
(heat-sound-time uint64 :offset-assert 560)
+1 -1
View File
@@ -936,7 +936,7 @@ TEST_F(FormRegressionTest, ExprMethod0DeadPool) {
" (v1-5 ((method-of-type process new) arg0 process 'dead arg3))\n"
" )\n"
" (set! (-> s3-0 child) (process->ppointer v1-5))\n"
" (set! (-> v1-5 parent) (process->ppointer s3-0))\n"
" (set! (-> v1-5 parent) (process->ppointer (the-as process s3-0)))\n"
" (set! (-> v1-5 pool) s3-0)\n"
" (set! (-> v1-5 brother) s1-0)\n"
" )\n"