mirror of
https://github.com/open-goal/jak-project
synced 2026-08-27 08:28:03 -04:00
cd68cb671e
Major change to how `deftype` shows up in our code: - the decompiler will no longer emit the `offset-assert`, `method-count-assert`, `size-assert` and `flag-assert` parameters. There are extremely few cases where having this in the decompiled code is helpful, as the types there come from `all-types` which already has those parameters. This also doesn't break type consistency because: - the asserts aren't compared. - the first step of the test uses `all-types`, which has the asserts, which will throw an error if they're bad. - the decompiler won't emit the `heap-base` parameter unless necessary now. - the decompiler will try its hardest to turn a fixed-offset field into an `overlay-at` field. It falls back to the old offset if all else fails. - `overlay-at` now supports field "dereferencing" to specify the offset that's within a field that's a structure, e.g.: ```lisp (deftype foobar (structure) ((vec vector :inline) (flags int32 :overlay-at (-> vec w)) ) ) ``` in this structure, the offset of `flags` will be 12 because that is the final offset of `vec`'s `w` field within this structure. - **removed ID from all method declarations.** IDs are only ever automatically assigned now. Fixes #3068. - added an `:overlay` parameter to method declarations, in order to declare a new method that goes on top of a previously-defined method. Syntax is `:overlay <method-name>`. Please do not ever use this. - added `state-methods` list parameter. This lets you quickly specify a list of states to be put in the method table. Same syntax as the `states` list parameter. The decompiler will try to put as many states in this as it can without messing with the method ID order. Also changes `defmethod` to make the first type definition (before the arguments) optional. The type can now be inferred from the first argument. Fixes #3093. --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
218 lines
15 KiB
Common Lisp
Vendored
Generated
218 lines
15 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type collide-history
|
|
(deftype collide-history (structure)
|
|
((intersect vector :inline)
|
|
(trans vector :inline)
|
|
(transv vector :inline)
|
|
(transv-out vector :inline)
|
|
(local-normal vector :inline)
|
|
(surface-normal vector :inline)
|
|
(time time-frame)
|
|
(status cshape-moving-flags)
|
|
(pat pat-surface)
|
|
(reaction-flag cshape-reaction-flags)
|
|
)
|
|
(:methods
|
|
(update! (_type_ collide-shape-moving vector vector vector) _type_)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type collide-history
|
|
(defmethod inspect ((this collide-history))
|
|
(format #t "[~8x] ~A~%" this 'collide-history)
|
|
(format #t "~Tintersect: ~`vector`P~%" (-> this intersect))
|
|
(format #t "~Ttrans: ~`vector`P~%" (-> this trans))
|
|
(format #t "~Ttransv: ~`vector`P~%" (-> this transv))
|
|
(format #t "~Ttransv-out: ~`vector`P~%" (-> this transv-out))
|
|
(format #t "~Tlocal-normal: ~`vector`P~%" (-> this local-normal))
|
|
(format #t "~Tsurface-normal: ~`vector`P~%" (-> this surface-normal))
|
|
(format #t "~Ttime: ~D~%" (-> this time))
|
|
(format #t "~Tstatus: ~D~%" (-> this status))
|
|
(format #t "~Tpat: ~D~%" (-> this pat))
|
|
(format #t "~Treaction-flag: ~D~%" (-> this reaction-flag))
|
|
this
|
|
)
|
|
|
|
;; definition of type control-info
|
|
(deftype control-info (collide-shape-moving)
|
|
((unknown-vector00 vector :inline :offset 448)
|
|
(unknown-vector01 vector :inline :offset 464)
|
|
(unknown-vector02 vector :inline :offset 480)
|
|
(unknown-quaternion00 quaternion :inline :offset 496)
|
|
(unknown-quaternion01 quaternion :inline :offset 512)
|
|
(unknown-float00 float :offset 528)
|
|
(unknown-float01 float :offset 532)
|
|
(unknown-float02 float :offset 536)
|
|
(unknown-vector10 vector :inline :offset 544)
|
|
(unknown-vector11 vector :inline :offset 560)
|
|
(unknown-vector12 vector :inline :offset 576)
|
|
(unknown-vector13 vector :inline :offset 592)
|
|
(unknown-vector14 vector :inline :offset 608)
|
|
(unknown-vector15 vector :inline :offset 624)
|
|
(unknown-vector16 vector :inline :offset 640)
|
|
(unknown-dynamics00 dynamics :offset 656)
|
|
(unknown-surface00 surface :offset 660)
|
|
(unknown-surface01 surface :offset 664)
|
|
(unknown-cpad-info00 cpad-info :offset 668)
|
|
(unknown-float10 float :offset 672)
|
|
(unknown-float11 float :offset 676)
|
|
(unknown-float12 float :offset 680)
|
|
(unknown-float13 float :offset 684)
|
|
(unknown-vector20 vector :inline :offset 688)
|
|
(unknown-vector21 vector :inline :offset 704)
|
|
(unknown-vector22 vector :inline :offset 720)
|
|
(unknown-vector23 vector :inline :offset 736)
|
|
(unknown-vector-array00 vector 7 :inline :offset 752)
|
|
(unknown-vector30 vector :inline :offset 880)
|
|
(unknown-vector31 vector :inline :offset 896)
|
|
(unknown-float20 float :offset 912)
|
|
(unknown-float21 float :offset 916)
|
|
(unknown-dword00 uint64 :offset 920)
|
|
(unknown-matrix00 matrix :inline :offset 928)
|
|
(unknown-matrix01 matrix :inline :offset 992)
|
|
(unknown-matrix02 matrix :inline :offset 1056)
|
|
(unknown-qword00 uint128 :offset 1136)
|
|
(unknown-float30 float :offset 1140)
|
|
(unknown-vector40 vector :inline :offset 1152)
|
|
(unknown-float40 float :offset 1172)
|
|
(unknown-float41 float :offset 1176)
|
|
(unknown-int00 int32 :offset 1180)
|
|
(unknown-float50 float :offset 1168)
|
|
(unknown-vector50 vector :inline :offset 1184)
|
|
(unknown-vector51 vector :inline :offset 1200)
|
|
(unknown-vector52 vector :inline :offset 1216)
|
|
(unknown-vector53 vector :inline :offset 1232)
|
|
(last-known-safe-ground vector :inline :offset 1248)
|
|
(unknown-vector55 vector :inline :offset 1264)
|
|
(unknown-dword10 time-frame :offset 1280)
|
|
(unknown-dword11 time-frame :offset 1288)
|
|
(unknown-float60 float :offset 1300)
|
|
(unknown-float61 float :offset 1304)
|
|
(unknown-float62 float :offset 1308)
|
|
(unknown-float63 float :offset 1312)
|
|
(unknown-float64 float :offset 1316)
|
|
(unknown-dword20 time-frame :offset 1320)
|
|
(unknown-dword21 time-frame :offset 1328)
|
|
(unknown-dword-coverage int64 :offset 1336)
|
|
(unknown-float-coverage-0 float :offset 1344)
|
|
(unknown-float-coverage-1 float :offset 1348)
|
|
(unknown-float-coverage-2 float :offset 1352)
|
|
(unknown-u32-coverage-0 uint32 :offset 1356)
|
|
(unknown-vector-coverage-0 vector :inline :offset 1376)
|
|
(unknown-vector-coverage-1 vector :inline :offset 1392)
|
|
(unknown-vector-coverage-2 vector :inline :offset 1440)
|
|
(unknown-vector-coverage-3 vector :inline :offset 1472)
|
|
(unknown-vector60 vector :inline :offset 1456)
|
|
(unknown-vector61 vector :inline :offset 1504)
|
|
(unknown-float70 float :offset 1520)
|
|
(unknown-float71 float :offset 1524)
|
|
(unknown-vector70 vector :inline :offset 1536)
|
|
(unknown-vector71 vector :inline :offset 1552)
|
|
(unknown-vector72 vector :inline :offset 1568)
|
|
(unknown-vector73 vector :inline :offset 1584)
|
|
(unknown-handle00 handle :offset 1600)
|
|
(unknown-sphere-array00 collide-shape-prim-sphere 3 :offset 1608)
|
|
(unknown-sphere00 collide-shape-prim-sphere :offset 1632)
|
|
(unknown-sphere01 collide-shape-prim-sphere :offset 1636)
|
|
(unknown-sphere02 collide-shape-prim-sphere :offset 1640)
|
|
(unknown-int50 int32 :offset 1656)
|
|
(unknown-dword30 time-frame :offset 1664)
|
|
(unknown-dword31 time-frame :offset 1672)
|
|
(unknown-dword32 time-frame :offset 1680)
|
|
(unknown-dword33 time-frame :offset 1688)
|
|
(unknown-dword34 time-frame :offset 1696)
|
|
(unknown-dword35 time-frame :offset 1704)
|
|
(unknown-dword36 time-frame :offset 1712)
|
|
(unknown-float80 float :offset 1724)
|
|
(unknown-float81 float :offset 1728)
|
|
(unknown-float82 float :offset 1732)
|
|
(unknown-vector80 vector :inline :offset 1744)
|
|
(unknown-cspace00 cspace :inline :offset 1760)
|
|
(unknown-vector90 vector :inline :offset 1776)
|
|
(unknown-vector91 vector :inline :offset 1792)
|
|
(unknown-vector92 vector :inline :offset 1824)
|
|
(unknown-cspace10 cspace :inline :offset 1808)
|
|
(unknown-symbol00 symbol :offset 1840)
|
|
(unknown-float90 float :offset 1844)
|
|
(unknown-float91 float :offset 1848)
|
|
(unknown-vector-array10 vector 16 :inline :offset 1856)
|
|
(unknown-float100 float :offset 2112)
|
|
(unknown-int10 int32 :offset 2116)
|
|
(unknown-float110 float :offset 2120)
|
|
(unknown-vector100 vector :inline :offset 2128)
|
|
(unknown-vector101 vector :inline :offset 2144)
|
|
(unknown-dword40 time-frame :offset 2160)
|
|
(unknown-dword41 time-frame :offset 2168)
|
|
(unknown-handle10 handle :offset 2176)
|
|
(unknown-uint20 uint32 :offset 2184)
|
|
(unknown-spoolanim00 spool-anim :overlay-at unknown-uint20)
|
|
(unknown-int20 int32 :overlay-at unknown-spoolanim00)
|
|
(unknown-symbol20 symbol :overlay-at unknown-int20)
|
|
(unknown-float120 float :overlay-at unknown-symbol20)
|
|
(unknown-int21 int32 :offset 2188)
|
|
(unknown-uint30 uint32 :overlay-at unknown-int21)
|
|
(unknown-float121 float :overlay-at unknown-uint30)
|
|
(unknown-uint31 uint32 :offset 2192)
|
|
(unknown-int37 int32 :overlay-at unknown-uint31)
|
|
(unknown-float122 float :offset 2196)
|
|
(unknown-float123 float :offset 2200)
|
|
(unknown-float124 float :offset 2204)
|
|
(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)
|
|
(unknown-symbol30 symbol :offset 2384)
|
|
(unknown-int31 uint32 :overlay-at unknown-symbol30)
|
|
(unknown-dword50 int64 :offset 2392)
|
|
(unknown-dword51 int64 :offset 2400)
|
|
(unknown-pointer00 pointer :offset 2416)
|
|
(unknown-symbol40 symbol :offset 2428)
|
|
(unknown-dword60 int64 :offset 2432)
|
|
(unknown-dword61 int64 :offset 2440)
|
|
(unknown-dword62 int64 :offset 2448)
|
|
(unknown-dword63 int64 :offset 2456)
|
|
(unknown-halfword00 int16 :offset 2488)
|
|
(history-length int16 :offset 2490)
|
|
(history-data collide-history 128 :inline)
|
|
(unknown-float140 float :offset 18944)
|
|
(unknown-dword70 time-frame :offset 18952)
|
|
(unknown-int40 int32 :offset 18880)
|
|
(unknown-dword80 time-frame :offset 18888)
|
|
(unknown-dword81 time-frame :offset 18896)
|
|
(unknown-float130 float :offset 18904)
|
|
(unknown-float131 float :offset 18908)
|
|
(unknown-dword82 time-frame :offset 18912)
|
|
(unknown-vector120 vector :inline :offset 18928)
|
|
(unknown-float150 float :overlay-at unknown-float140)
|
|
(unknown-vector121 vector :inline :offset 18960)
|
|
(wall-pat pat-surface :offset 18976)
|
|
(unknown-soundid00 sound-id :offset 18980)
|
|
(unknown-float141 float :offset 18984)
|
|
(unknown-soundid01 sound-id :offset 18988)
|
|
(unknown-int34 int32 :offset 18992)
|
|
(unknown-int35 int32 :offset 18996)
|
|
(unknown-int36 int32 :offset 19000)
|
|
)
|
|
)
|
|
|
|
;; definition for method 9 of type collide-history
|
|
;; INFO: Used lq/sq
|
|
(defmethod update! ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector))
|
|
(set! (-> this intersect quad) (-> xs quad))
|
|
(set! (-> this transv quad) (-> transv quad))
|
|
(set! (-> this transv-out quad) (-> transv-out quad))
|
|
(set! (-> this trans quad) (-> cshape trans quad))
|
|
(set! (-> this local-normal quad) (-> cshape local-normal quad))
|
|
(set! (-> this surface-normal quad) (-> cshape surface-normal quad))
|
|
(set-time! (-> this time))
|
|
(set! (-> this status) (-> cshape status))
|
|
(set! (-> this reaction-flag) (-> cshape reaction-flag))
|
|
(set! (-> this pat) (-> cshape cur-pat))
|
|
this
|
|
)
|