mirror of
https://github.com/open-goal/jak-project
synced 2026-06-08 04:17:28 -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>
122 lines
3.9 KiB
Common Lisp
Vendored
Generated
122 lines
3.9 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition for method 11 of type draw-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collide-with-box ((this draw-node) (arg0 int) (arg1 collide-list))
|
|
(dotimes (s3-0 arg0)
|
|
(if (collide-cache-using-box-test (-> this bsphere))
|
|
(collide-with-box (-> this child) (the-as int (-> this child-count)) arg1)
|
|
)
|
|
(&+! this 32)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type draw-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collide-y-probe ((this draw-node) (arg0 int) (arg1 collide-list))
|
|
(dotimes (s3-0 arg0)
|
|
(if (collide-cache-using-y-probe-test (-> this bsphere))
|
|
(collide-y-probe (-> this child) (the-as int (-> this child-count)) arg1)
|
|
)
|
|
(&+! this 32)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type draw-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collide-ray ((this draw-node) (arg0 int) (arg1 collide-list))
|
|
(dotimes (s3-0 arg0)
|
|
(if (collide-cache-using-line-sphere-test (-> this bsphere))
|
|
(collide-ray (-> this child) (the-as int (-> this child-count)) arg1)
|
|
)
|
|
(&+! this 32)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 17 of type draw-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collect-ambients ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list))
|
|
(dotimes (s2-0 arg1)
|
|
(if (spheres-overlap? arg0 (the-as sphere (-> this bsphere)))
|
|
(collect-ambients (-> this child) arg0 (the-as int (-> this child-count)) arg2)
|
|
)
|
|
(&+! this 32)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 3 of type drawable-inline-array-node
|
|
(defmethod inspect ((this drawable-inline-array-node))
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~Tlength: ~D~%" (-> this length))
|
|
(format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data))
|
|
(dotimes (s5-0 (-> this length))
|
|
(format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0))
|
|
)
|
|
this
|
|
)
|
|
|
|
;; definition for method 8 of type drawable-inline-array-node
|
|
(defmethod mem-usage ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int))
|
|
(set! (-> arg0 length) (max 62 (-> arg0 length)))
|
|
(set! (-> arg0 data 61 name) "draw-node")
|
|
(+! (-> arg0 data 61 count) (-> this length))
|
|
(let ((v1-6 (asize-of this)))
|
|
(+! (-> arg0 data 61 used) v1-6)
|
|
(+! (-> arg0 data 61 total) (logand -16 (+ v1-6 15)))
|
|
)
|
|
this
|
|
)
|
|
|
|
;; definition for method 5 of type drawable-inline-array-node
|
|
;; INFO: Return type mismatch uint vs int.
|
|
(defmethod asize-of ((this drawable-inline-array-node))
|
|
(the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> this length) -1) 32)))
|
|
)
|
|
|
|
;; definition for method 11 of type drawable-inline-array-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collide-with-box ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list))
|
|
(collide-with-box (the-as drawable (-> this data)) (-> this length) arg1)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type drawable-inline-array-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collide-y-probe ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list))
|
|
(collide-y-probe (the-as drawable (-> this data)) (-> this length) arg1)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type drawable-inline-array-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collide-ray ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list))
|
|
(collide-ray (the-as drawable (-> this data)) (-> this length) arg1)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 17 of type drawable-inline-array-node
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defmethod collect-ambients ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list))
|
|
(collect-ambients (the-as drawable (-> this data)) arg0 (-> this length) arg2)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function draw-node-cull
|
|
;; ERROR: function was not converted to expressions. Cannot decompile.
|
|
|
|
;; failed to figure out what this is:
|
|
0
|