Skip to content

Commit

Permalink
[game] edge grab, small fixes, add zoomer (#1083)
Browse files Browse the repository at this point in the history
* fix a few small things

* fix tests

* another fix

* fix tests
  • Loading branch information
water111 authored Jan 17, 2022
1 parent dc77c3c commit dc663d8
Show file tree
Hide file tree
Showing 27 changed files with 2,441 additions and 186 deletions.
12 changes: 6 additions & 6 deletions decompiler/IR2/Form.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3027,9 +3027,9 @@ void DefpartgroupElement::apply(const std::function<void(FormElement*)>& f) {
f(this);
}

void DefpartgroupElement::apply_form(const std::function<void(Form*)>& f) {}
void DefpartgroupElement::collect_vars(RegAccessSet& vars, bool recursive) const {}
void DefpartgroupElement::get_modified_regs(RegSet& regs) const {}
void DefpartgroupElement::apply_form(const std::function<void(Form*)>&) {}
void DefpartgroupElement::collect_vars(RegAccessSet&, bool) const {}
void DefpartgroupElement::get_modified_regs(RegSet&) const {}

goos::Object DefpartgroupElement::to_form_internal(const Env& env) const {
std::vector<goos::Object> forms;
Expand Down Expand Up @@ -3134,9 +3134,9 @@ void DefpartElement::apply(const std::function<void(FormElement*)>& f) {
f(this);
}

void DefpartElement::apply_form(const std::function<void(Form*)>& f) {}
void DefpartElement::collect_vars(RegAccessSet& vars, bool recursive) const {}
void DefpartElement::get_modified_regs(RegSet& regs) const {}
void DefpartElement::apply_form(const std::function<void(Form*)>&) {}
void DefpartElement::collect_vars(RegAccessSet&, bool) const {}
void DefpartElement::get_modified_regs(RegSet&) const {}

goos::Object DefpartElement::to_form_internal(const Env& env) const {
std::vector<goos::Object> forms;
Expand Down
22 changes: 11 additions & 11 deletions decompiler/config/all-types.gc
Original file line number Diff line number Diff line change
Expand Up @@ -9563,7 +9563,7 @@
:size-assert #x30
:flag-assert #xa00000030
(:methods
(dummy-9 (_type_) _type_ 9)
(debug-print-frames (_type_) _type_ 9)
)
)

Expand Down Expand Up @@ -9596,7 +9596,7 @@
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 (_type_) float 9)
(dummy-10 (_type_ symbol) int 10)
(debug-print-channels (_type_ symbol) int 10)
)
)

Expand Down Expand Up @@ -11752,7 +11752,7 @@
:flag-assert #xb00000144
(:methods
(dummy-9 (_type_) symbol 9)
(dummy-10 (_type_) symbol 10)
(debug-draw (_type_) symbol 10)
)
)

Expand Down Expand Up @@ -11803,7 +11803,7 @@
:flag-assert #xb00000810
(:methods
(debug-draw (_type_) object 9)
(dummy-10 (_type_ collide-edge-hold-item) none 10)
(add-to-list! (_type_ collide-edge-hold-item) none 10)
)
)

Expand Down Expand Up @@ -11841,17 +11841,17 @@
:size-assert #x2690
:flag-assert #x1400002690
(:methods
(dummy-9 (_type_ collide-edge-hold-list) symbol 9)
(search-for-edges (_type_ collide-edge-hold-list) symbol 9)
(debug-draw-edges (_type_) object 10)
(dummy-11 (_type_) none 11)
(debug-draw-tris (_type_) none 11)
(debug-draw-sphere (_type_) symbol 12)
(dummy-13 (_type_ collide-edge-hold-item vector) none 13)
(compute-center-point! (_type_ collide-edge-edge vector) float 13)
(dummy-14 (_type_ vector vector int) float 14)
(dummy-15 (_type_) none 15)
(find-grabbable-edges! (_type_) none 15)
(find-grabbable-tris! (_type_) none 16)
(dummy-17 (_type_) none 17)
(dummy-18 (_type_ collide-edge-hold-list edge-grab-info) none 18)
(dummy-19 (_type_ collide-edge-hold-item edge-grab-info) symbol 19)
(should-add-to-list? (_type_ collide-edge-hold-item collide-edge-edge) symbol 17)
(find-best-grab! (_type_ collide-edge-hold-list edge-grab-info) symbol 18)
(check-grab-for-collisions (_type_ collide-edge-hold-item edge-grab-info) symbol 19)
)
)

Expand Down
22 changes: 15 additions & 7 deletions decompiler/config/jak1_ntsc_black_label/hacks.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -234,20 +234,20 @@
"collide-probe-node", // CFG

// collide-edge-grab
"(method 13 collide-edge-work)", // CFG
"(method 17 collide-edge-work)", // CFG
// CFG
// CFG
"(method 15 collide-edge-work)", // CFG
// CFG
"(method 9 edge-grab-info)", // CFG
"(method 18 collide-edge-work)", // CFG
// CFG
// CFG
// CFG


"(method 12 collide-mesh)",

// process-drawable BUG
"cspace-inspect-tree",
"(method 19 process-drawable)",
//"(method 19 process-drawable)",

// ambient
"ambient-inspect",
Expand Down Expand Up @@ -491,7 +491,13 @@
"(method 13 collide-shape-prim-group)" : [0, 1, 2,3,4],
"(method 19 collide-cache)" : [0, 1, 3, 4, 5, 18, 19],
"(method 10 collide-mesh)" : [1, 2, 4, 5],
"target-falling-anim-trans" : [5, 6]
"target-falling-anim-trans" : [5, 6],
"(method 19 process-drawable)" : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
"(anon-function 9 racer)" : [75],
"(method 13 collide-edge-work)" : [0, 2],
"(method 17 collide-edge-work)" : [0, 1, 2, 3, 4],
"(method 9 edge-grab-info)" : [15, 16, 18, 19, 21, 22, 24]
// "(method 18 collide-edge-work)" : [1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24]

},

Expand Down Expand Up @@ -564,7 +570,9 @@
"(method 15 collide-mesh)",

"(method 16 collide-edge-work)",
"(method 10 collide-edge-hold-list)"
"(method 10 collide-edge-hold-list)",
"(method 15 collide-edge-work)",
"(method 18 collide-edge-work)"
],

// there are some missing textures. I don't know what the game actually does here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6190,5 +6190,14 @@
[224, "vector"]
],

"(method 18 collide-edge-work)": [
[16, "pbhp-stack-vars"]
],

"(method 9 edge-grab-info)": [
[16, "collide-using-spheres-params"],
[48, "event-message-block"]
],

"placeholder-do-not-add-below!": []
}
16 changes: 10 additions & 6 deletions decompiler/config/jak1_ntsc_black_label/type_casts.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5738,16 +5738,14 @@
],

"(method 9 collide-edge-work)": [
[10, "s3", "collide-edge-edge"],
[16, "s4", "collide-edge-hold-item"],
[46, "s4", "(inline-array collide-edge-hold-item)"],
[48, "s3", "(inline-array collide-edge-edge)"]
[[5, 52], "s3", "collide-edge-edge"],
[[5, 52], "s4", "collide-edge-hold-item"]
],

"(method 19 collide-edge-work)": [
[150, "a1", "int"],
[150, "v1", "int"],
[[149, 162], "a0", "collide-shape-prim-group"]
[150, "v1", "int"]
//[[149, 162], "a0", "collide-shape-prim-group"]
],

"collide-probe-make-list": [
Expand Down Expand Up @@ -7771,5 +7769,11 @@
[921, "a0", "(pointer symbol)"]
],

"(method 9 edge-grab-info)": [
[23, "a0", "int"],
[[24,31], "s5", "collide-shape-prim"],
[29, "a0", "process-drawable"],
[156, "s5", "collide-shape-prim"]
],
"placeholder-do-not-add-below": []
}
2 changes: 1 addition & 1 deletion decompiler/util/sparticle_decompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ goos::Object decompile_sparticle_float_degrees_with_rand_init(const std::vector<
}
}

goos::Object decompile_sparticle_sound_spec(const std::vector<LinkedWord>& words,
goos::Object decompile_sparticle_sound_spec(const std::vector<LinkedWord>& /*words*/,
const std::string& field_name,
const std::string& flag_name,
const goos::Object& original) {
Expand Down
Loading

0 comments on commit dc663d8

Please sign in to comment.