Files
jak-project/decompiler/config/jak2/stack_structures.jsonc
T
water111 f3c63f26bb fix let* format, new on stack guessing case, type failure, handle casts (#1860)
Fixes https://github.com/open-goal/jak-project/issues/1821 by adding a
special case for `new` method calls where the argument with type
`symbol` is actually an address to uninitialized structure on the stack.

Fixes https://github.com/open-goal/jak-project/issues/1849 (or at least
the cause of the issue Vaser gave in chat, and one random one I found in
`debug-sphere`)

Fixes https://github.com/open-goal/jak-project/issues/1853

Fixes https://github.com/open-goal/jak-project/issues/1857 by moving the
cast into the cond if the body is a single form and the destination type
is a bitfield/enum which is likely to work well. Seems to work on the
examples we could find in jak 1 and jak 2.

Also fixes an issue with casts on the result of `handle->process` (a
common place to use casts)

the output of process->handle is a plain process. Most of the time, you
end up casting this to a more specific. If you add a cast on every use
of the variable, the decompiler will decide to change the type of that
variable to the more specific type, and this breaks the handle cast.

so previously it was impossible to get code like
```
    (let* ((s2-0 (the-as swingpole (handle->process (-> self control hack))))
           (gp-0 (-> s2-0 dir))
           )
```
But now it will work
2022-09-07 21:58:09 -04:00

536 lines
12 KiB
JSON

{
"quaternion-exp!": [[16, "vector"]],
"quaternion-axis-angle!": [[16, "vector"]],
"quaternion-vector-angle!": [[16, "vector"]],
"quaternion-look-at!": [[16, "matrix"]],
"quaternion-smooth-seek!": [[16, ["inline-array", "quaternion", 2]]],
// possible for automatic detection:
"eul->matrix": [[16, "vector"]],
"vector-sincos!": [[16, "vector"]],
"vector-reflect-flat-gravity!": [
[16, "vector"],
[32, "vector"]
],
"vector-line-distance": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"vector-line-distance-point!": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"forward-up-nopitch->inv-matrix": [[16, "vector"]],
"forward-up-nopitch->quaternion": [[16, "matrix"]],
"forward-up->quaternion": [
[16, "matrix"],
[80, "vector"]
],
"quaternion-from-two-vectors!": [[16, "vector"]],
"quaternion-from-two-vectors-max-angle!": [[16, "vector"]],
"matrix-from-two-vectors!": [[16, "vector"]],
"matrix-from-two-vectors-max-angle!": [[16, "vector"]],
"matrix-from-two-vectors-max-angle-partial!": [[16, "vector"]],
"matrix-from-two-vectors-partial-linear!": [[16, "vector"]],
"matrix-remove-z-rot": [
[16, "vector"],
[32, "matrix"]
],
"matrix-rot-diff!": [
[16, "quaternion"],
[32, "quaternion"],
[48, "quaternion"]
],
"quaternion-seek": [
[16, "matrix"],
[80, "matrix"],
[144, "quaternion"]
],
"vector-segment-overlap": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"line-sphere-intersection?": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"forward-up->inv-matrix": [[16, "vector"]],
"quaternion-from-two-vectors-partial!": [[16, "vector"]],
"quaternion-from-two-vectors-max-angle-partial!": [[16, "vector"]],
"matrix-from-two-vectors-smooth!": [[16, "vector"]],
"matrix-from-two-vectors-the-long-way-smooth!": [[16, "vector"]],
"quaternion-from-two-vectors-smooth!": [[16, "matrix"]],
"vector-deg-seek": [[16, "matrix"]],
"vector-deg-slerp": [
[16, "matrix"],
[80, "vector"],
[96, "vector"]
],
"circle-test": [
[16, "sphere"],
[32, "sphere"],
[48, "vector"],
[64, "vector"]
],
"vector-vector-deg-slerp!": [
[16, "vector"],
[32, "vector"],
[48, "quaternion"],
[64, "quaternion"],
[80, "quaternion"],
[96, "vector"]
],
"vector-circle-tangent-new": [
[16, "sphere"],
[32, "vector"],
[48, "vector"]
],
"vector-circle-tangent": [
[16, "sphere"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"curve-length": [
[16, "vector"],
[32, "vector"]
],
"curve-closest-point": [
[16, "vector"],
[32, "vector"]
],
"closest-pt-in-triangle": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"vector-plane-distance": [[16, "vector"]],
"vector-smooth-seek!": [[16, "vector"]],
"vector-vector-angle-safe": [
[16, "vector"],
[32, "vector"]
],
"move-target-from-pad": [
[16, "vector"],
[32, "vector"],
[48, "matrix"]
],
"reverse-transform-point!": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"init-for-transform": [
[16, "matrix"],
[80, "matrix"],
[144, "vector4s-3"],
[192, "vector"],
[208, "vector4s-3"]
],
"draw-sprite2d-xy": [[16, "draw-context"]],
"screen-gradient": [[16, "draw-context"]],
"play": [
[16, "event-message-block"],
[96, ["array", "symbol", 10]]
],
"store-image": [[16, "file-stream"]],
"joint-mod-blend-world-callback": [[160, "vector"]],
"joint-mod-rotate-local-callback": [[16, "vector"]],
"light-hash-get-bucket-index": [[16, "vector4w"]],
"(method 10 cam-vector-seeker)": [[16, "vector"]],
"(method 39 nav-mesh)": [
[16, "vector"],
[32, "vector"]
],
"(method 41 nav-mesh)": [
[16, "vector"],
[32, "vector"]
],
"show-level": [[16, ["array", "symbol", 10]]],
"(method 17 mood-control)": [[16, "vector"]],
"(method 9 mood-control)": [[16, "mood-control-work "]],
"string->sound-name": [[16, "qword"]],
"doppler-pitch-shift": [[16, ["inline-array", "vector", 2]]],
"(anon-function 1 gsound)": [
[16, ["array", "symbol", 4]],
[32, ["array", "symbol", 4]]
],
"matrix<-parented-transformq!": [[16, "vector"]],
"(method 9 cylinder)": [
[48, "cylinder-verts"],
[432, "cylinder-verts"],
[816, "matrix"],
[880, "matrix"]
],
"(method 9 cylinder-flat)": [
[48, "cylinder-flat-verts"],
[208, "cylinder-flat-verts"],
[368, "matrix"],
[432, "vector"]
],
// debug
"add-debug-point": [
[16, "vector4w-2"],
[48, "vector"]
],
"internal-draw-debug-line": [
[16, "vector4w-2"],
[48, "vector4w-2"],
[80, "vector"],
[96, "vector"]
],
"internal-draw-debug-text-3d": [
[16, "vector4w"],
[32, "font-context"]
],
"add-debug-triangle-normal": [
[16, "vector"],
[32, "vector"]
],
"add-debug-flat-triangle": [
[16, "vector4w-3"],
[64, "vector4w-3"],
[112, "vector"],
[128, "vector"],
[144, "vector"]
],
"add-debug-line2d": [
[16, "vector4w"],
[32, "vector4w"]
],
"add-debug-box": [
[16, "vector"],
[32, "vector"]
],
"add-debug-box-with-transform": [
[16, ["inline-array", "vector", 8]],
[144, ["inline-array", "vector", 2]],
[176, "vector"]
],
"add-debug-x": [
[16, "vector"],
[32, "vector"]
],
"add-debug-cross": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "vector"],
[96, "vector"],
[112, "vector"],
[128, "vector"]
],
"add-debug-sphere-with-transform": [
[16, "vector"]
],
"add-debug-line-sphere": [
[48, "matrix"],
[112, "matrix"],
[128, "vector"],
[144, "vector"],
[160, "vector"],
[176, "vector"],
[208, "vector"],
[192, "vector"]
],
"add-debug-circle": [
[16, "vector"],
[32, "vector"]
],
"add-debug-vector": [
[16, "vector"]
],
"add-debug-quaternion": [
[16, "matrix"]
],
"add-debug-yrot-vector": [
[16, "vector"]
],
"add-debug-arc": [
[16, "vector"],
[32, "vector"]
],
"add-debug-curve": [
[16, "vector"],
[32, "vector"]
],
"add-debug-points": [
[16, "vector"]
],
"add-debug-light": [
[16, "vector"]
],
"add-debug-cursor": [
[16, "vector"]
],
"dma-timeout-cam": [
[16, "vector"],
[32, "matrix"]
],
// debug-sphere
"make-debug-sphere-table": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "vector"],
[96, "vector"],
[112, "vector"]
],
"add-debug-sphere-from-table": [
[16, "vector"],
[48, "vector"],
[64, "vector"]
],
"matrix-3x3-triple-transpose-product": [[16, ["inline-array", "matrix", 3]]],
"(method 14 rigid-body)": [[16, "quaternion"]],
"(method 19 rigid-body)": [
[16, "vector"],
[32, "vector"]
],
"(method 22 rigid-body)": [[16, "vector"]],
"want-to-board?": [
[16, "collide-query"],
[560, ["inline-array", "sphere", 3]],
[608, "vector"]
],
"(method 10 cam-setting-data)": [[16, "event-message-block"]],
"(method 18 tracking-spline)": [
[16, "tracking-spline-sampler"],
[32, "tracking-spline-sampler"]
],
"(method 20 tracking-spline)": [
[16, "vector"], // hang without!
[32, "vector"]
],
"cam-calc-follow!": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"slave-set-rotation!": [
[96, "vector"],
[112, "matrix"],
[176, "vector"]
],
"v-slrp2!": [
[32, "vector"],
[64, "matrix"]
],
"v-slrp3!": [[32, "vector"]],
"cam-state-from-entity": [[16, "curve"]], // decompiler guessed 'symbol' instead!
"camera-teleport-to-entity": [[16, "transformq"]],
"(event cam-master-active)": [
[16, "event-message-block"],
[96, "vector"],
[112, "vector"],
[16, "event-message-block"]
],
"master-choose-entity": [[16, "event-message-block"]],
"(code cam-pov180)": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"]
],
"(code cam-pov-track)": [
[16, "vector"],
[32, "matrix"]
],
"(code cam-eye)": [
[16, "vector"],
[32, "matrix"],
[112, "vector"]
],
"los-cw-ccw": [
[16, "vector"],
[32, "vector"],
[48, "matrix"],
[112, "vector"]
],
"cam-los-spline-collide": [
[16, "collide-query"],
[560, "vector"],
[576, "vector"]
],
"cam-los-collide": [
[16, "collide-query"],
[592, "vector"],
[608, "vector"]
],
"cam-string-joystick": [
[32, "vector"],
[48, "matrix"],
[128, "matrix"],
[192, "vector"],
[208, "vector"],
[224, "matrix"]
],
"cam-string-find-position-rel!": [[48, "collide-query"]],
"cam-string-find-hidden": [[16, "collide-query"]],
"cam-string-move": [[80, "collide-query"]],
"(enter cam-string)": [[32, "collide-query"]],
"cam-stick-code": [
[608, "vector"],
[64, "collide-query"]
],
"(trans cam-stick)": [
[16, "matrix"],
[80, "vector"],
[96, "vector"],
[112, "vector"]
],
"(code cam-spline)": [[16, "curve"]],
"(code cam-point-watch)": [
[16, "vector"],
[32, "vector"]
],
"cam-free-floating-move": [[16, "camera-free-floating-move-info"]],
"cam-helper-temp": [
[16, "matrix"],
[64, "vector"],
[80, "matrix"]
],
"update-view-planes": [
[208, "vector"],
[224, "vector"],
[16, "view-frustum"]
],
"camera-slave-debug": [
[16, "vector"],
[32, "vector"],
[48, "matrix"],
[128, "curve"]
],
"cam-collision-record-draw": [
[48, "collide-query"],
[16, "vector4w"],
[32, "vector4w"]
],
"cam-debug-draw-tris": [[16, "vector4w"]],
"draw-string-xy": [[16, "font-context"]],
"(code die gun)": [
[16, "matrix"],
[112, "vector"],
[128, "vector"],
[144, "vector"]
],
"draw-beam": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"gun-post": [
[16, "vector"],
[32, "vector"],
[48, "matrix"],
[144, "vector"],
[160, "vector"],
[176, "vector"]
],
"(method 9 gun-info)": [
[16, "collide-query"],
[560, "vector"],
[576, "vector"],
[592, "vector"],
[608, "vector"],
[624, "vector"],
[640, "vector"],
[656, "vector"]
],
"target-gun-fire-yellow": [
[16, "matrix"],
[112, "event-message-block"]
],
"(method 14 collide-cache)": [[16, "bounding-box"]],
"sp-adjust-launch": [[16, "matrix"]],
"sp-launch-particles-death": [[16, "matrix"]],
"sp-relaunch-particle-3d": [[16, "quaternion"]],
"execute-part-engine": [
[16, "matrix"],
[80, "vector"]
],
"sparticle-motion-blur-old": [
[16, "vector"],
[32, "vector4w"],
[48, "vector4w"]
],
"sp-orbiter": [
[16, "vector"],
[32, "vector"],
[48, "matrix"]
],
"joint-mod-ik-callback": [
[16, "matrix"],
[80, "matrix"],
[144, "vector"],
[160, "vector"],
[176, "vector"],
[192, "vector"],
[208, "vector"],
[224, "vector"],
[272, "vector"],
[256, "vector"],
[288, "vector"],
[304, "vector"],
[320, "quaternion"],
[336, "quaternion"],
[352, "vector"],
[448, "vector"],
[464, "vector"],
[480, "vector"],
[496, "quaternion"],
[512, "matrix"],
[576, "vector"],
[592, "matrix"],
[656, "matrix"],
[720, "matrix"]
],
"joint-mod-look-at-handler": [
[16, "vector"],
[32, "vector"],
[48, "vector"],
[64, "vector"],
[96, "vector"],
[112, "vector"],
[128, "vector"]
],
"joint-mod-polar-look-at-guts": [[32, "vector"]],
"joint-mod-world-look-at-handler": [[16, "vector"]],
"joint-mod-joint-set-world-handler": [
[32, "vector"],
[48, "vector"]
],
"joint-mod-joint-set*-world-handler": [[16, "matrix"]],
"(method 11 chain-physics)": [
[16, "matrix"],
[80, "vector"],
[128, "vector"],
[144, "vector"],
[160, "vector"],
[176, "vector"],
[192, "vector"],
[208, "vector"],
[224, "vector"],
[240, "vector"],
[256, "vector"]
],
"(method 13 gui-control)": [[16, ["array", "sound-id", 4]]],
"ja-play-spooled-anim": [[96, "event-message-block"]],
"update-under-lights": [
[16, "matrix"],
[64, "vector"]
],
// placeholder
"placeholder-do-not-add-below": []
}