deftype and defmethod syntax major changes (#3094)

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>
This commit is contained in:
ManDude
2023-10-30 03:20:02 +00:00
committed by GitHub
parent 09536c68ac
commit cd68cb671e
2079 changed files with 94384 additions and 117066 deletions
+1 -4
View File
@@ -10,14 +10,11 @@
;; definition of type euler-angles
(deftype euler-angles (vector)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type euler-angles
;; INFO: Used lq/sq
(defmethod inspect euler-angles ((this euler-angles))
(defmethod inspect ((this euler-angles))
(when (not this)
(set! this this)
(goto cfg-4)
+2 -17
View File
@@ -150,9 +150,6 @@
;; definition of type float-type
(deftype float-type (uint32)
()
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for symbol exp-slead, type (pointer float)
@@ -256,25 +253,16 @@
(b uint8 :offset 16 :size 8)
(a uint8 :offset 24 :size 8)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition of type xyzw
(deftype xyzw (uint128)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition of type xyzwh
(deftype xyzwh (uint128)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for function print-time
@@ -578,15 +566,12 @@
;; definition of type random-generator
(deftype random-generator (basic)
((seed uint32 :offset-assert 4)
((seed uint32)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type random-generator
(defmethod inspect random-generator ((this random-generator))
(defmethod inspect ((this random-generator))
(when (not this)
(set! this this)
(goto cfg-4)
+14 -23
View File
@@ -3,22 +3,19 @@
;; definition of type matrix
(deftype matrix (structure)
((data float 16 :offset-assert 0)
(vector vector 4 :inline :offset 0)
(quad uint128 4 :offset 0)
(trans vector :inline :offset 48)
((data float 16)
(vector vector 4 :inline :overlay-at (-> data 0))
(quad uint128 4 :overlay-at (-> data 0))
(trans vector :inline :overlay-at (-> data 12))
)
:method-count-assert 10
:size-assert #x40
:flag-assert #xa00000040
(:methods
(transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9)
(transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none)
)
)
;; definition for method 3 of type matrix
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect matrix ((this matrix))
(defmethod inspect ((this matrix))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -34,18 +31,15 @@
;; definition of type matrix3
(deftype matrix3 (structure)
((data float 12 :offset-assert 0)
(vector vector 3 :inline :offset 0)
(quad uint128 3 :offset 0)
((data float 12)
(vector vector 3 :inline :overlay-at (-> data 0))
(quad uint128 3 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type matrix3
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect matrix3 ((this matrix3))
(defmethod inspect ((this matrix3))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -60,17 +54,14 @@
;; definition of type matrix4h
(deftype matrix4h (structure)
((data int16 16 :offset-assert 0)
(vector4h vector4h 4 :inline :offset 0)
(long int64 4 :offset 0)
((data int16 16)
(vector4h vector4h 4 :inline :overlay-at (-> data 0))
(long int64 4 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type matrix4h
(defmethod inspect matrix4h ((this matrix4h))
(defmethod inspect ((this matrix4h))
(when (not this)
(set! this this)
(goto cfg-4)
+2 -2
View File
@@ -3,7 +3,7 @@
;; definition for method 3 of type matrix
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect matrix ((this matrix))
(defmethod inspect ((this matrix))
(format #t "[~8x] matrix~%" this)
(format
#t
@@ -35,7 +35,7 @@
;; definition for method 3 of type matrix3
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect matrix3 ((this matrix3))
(defmethod inspect ((this matrix3))
(format #t "[~8x] matrix3~%" this)
(format #t "~T[~F] [~F] [~F]~%" (-> this vector 0 x) (-> this vector 0 y) (-> this vector 0 z))
(format #t "~T[~F] [~F] [~F]~%" (-> this vector 1 x) (-> this vector 1 y) (-> this vector 1 z))
+8 -11
View File
@@ -3,23 +3,20 @@
;; definition of type quaternion
(deftype quaternion (structure)
((data float 4 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(z float :offset 8)
(w float :offset 12)
(vec vector :inline :offset 0)
(quad uint128 :offset 0)
((data float 4)
(x float :overlay-at (-> data 0))
(y float :overlay-at (-> data 1))
(z float :overlay-at (-> data 2))
(w float :overlay-at (-> data 3))
(vec vector :inline :overlay-at (-> data 0))
(quad uint128 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type quaternion
;; INFO: this function exists in multiple non-identical object files
;; INFO: Used lq/sq
(defmethod inspect quaternion ((this quaternion))
(defmethod inspect ((this quaternion))
(when (not this)
(set! this this)
(goto cfg-4)
+1 -1
View File
@@ -3,7 +3,7 @@
;; definition for method 3 of type quaternion
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect quaternion ((this quaternion))
(defmethod inspect ((this quaternion))
(format #t "[~8x] quaternion~%" this)
(format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w))
(let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) (* (-> this z) (-> this z))))))
+9 -15
View File
@@ -3,17 +3,14 @@
;; definition of type transform
(deftype transform (structure)
((trans vector :inline :offset-assert 0)
(rot vector :inline :offset-assert 16)
(scale vector :inline :offset-assert 32)
((trans vector :inline)
(rot vector :inline)
(scale vector :inline)
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type transform
(defmethod inspect transform ((this transform))
(defmethod inspect ((this transform))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -28,20 +25,17 @@
;; definition of type trs
(deftype trs (basic)
((trans vector :inline :offset-assert 16)
(rot vector :inline :offset-assert 32)
(scale vector :inline :offset-assert 48)
((trans vector :inline)
(rot vector :inline)
(scale vector :inline)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
(:methods
(new (symbol type) _type_ 0)
(new (symbol type) _type_)
)
)
;; definition for method 3 of type trs
(defmethod inspect trs ((this trs))
(defmethod inspect ((this trs))
(when (not this)
(set! this this)
(goto cfg-4)
+1 -1
View File
@@ -2,7 +2,7 @@
(in-package goal)
;; definition for method 2 of type transform
(defmethod print transform ((this transform))
(defmethod print ((this transform))
(format #t "#<transform @ #x~X~%" this)
(format #t "~T~Ttrans:~F ~F ~F ~F ~%" (-> this trans x) (-> this trans y) (-> this trans z) (-> this trans w))
(format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w))
+34 -43
View File
@@ -3,15 +3,12 @@
;; definition of type transformq
(deftype transformq (transform)
((quat quaternion :inline :offset 16)
((quat quaternion :inline :overlay-at (-> rot data 0))
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type transformq
(defmethod inspect transformq ((this transformq))
(defmethod inspect ((this transformq))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -27,15 +24,12 @@
;; definition of type trsq
(deftype trsq (trs)
((quat quaternion :inline :offset 32)
((quat quaternion :inline :overlay-at (-> rot data 0))
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; definition for method 3 of type trsq
(defmethod inspect trsq ((this trsq))
(defmethod inspect ((this trsq))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -51,43 +45,40 @@
;; definition of type trsqv
(deftype trsqv (trsq)
((pause-adjust-distance meters :offset 4)
(nav-radius meters :offset 8)
(transv vector :inline :offset-assert 64)
(rotv vector :inline :offset-assert 80)
(scalev vector :inline :offset-assert 96)
(dir-targ quaternion :inline :offset-assert 112)
(angle-change-time time-frame :offset-assert 128)
(old-y-angle-diff float :offset-assert 136)
((pause-adjust-distance meters :offset 4)
(nav-radius meters :offset 8)
(transv vector :inline)
(rotv vector :inline)
(scalev vector :inline)
(dir-targ quaternion :inline)
(angle-change-time time-frame)
(old-y-angle-diff float)
)
:method-count-assert 28
:size-assert #x8c
:flag-assert #x1c0000008c
(:methods
(seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9)
(set-heading-vec! (_type_ vector) quaternion 10)
(seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11)
(point-toward-point! (_type_ vector) quaternion 12)
(seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13)
(set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14)
(set-roll-to-grav! (_type_ float) quaternion 15)
(set-roll-to-grav-2! (_type_ float) quaternion 16)
(rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion 17)
(set-quaternion! (_type_ quaternion) quaternion 18)
(set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19)
(point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20)
(rot->dir-targ! (_type_) quaternion 21)
(y-angle (_type_) float 22)
(global-y-angle-to-point (_type_ vector) float 23)
(relative-y-angle-to-point (_type_ vector) float 24)
(roll-relative-to-gravity (_type_) float 25)
(set-and-limit-velocity (_type_ int vector float) trsqv :behavior process 26)
(get-quaternion (_type_) quaternion 27)
(seek-toward-heading-vec! (_type_ vector float time-frame) quaternion)
(set-heading-vec! (_type_ vector) quaternion)
(seek-to-point-toward-point! (_type_ vector float time-frame) quaternion)
(point-toward-point! (_type_ vector) quaternion)
(seek-toward-yaw-angle! (_type_ float float time-frame) quaternion)
(set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion)
(set-roll-to-grav! (_type_ float) quaternion)
(set-roll-to-grav-2! (_type_ float) quaternion)
(rotate-toward-orientation! (_type_ quaternion float float int int float) quaternion)
(set-quaternion! (_type_ quaternion) quaternion)
(set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion)
(point-toward-point-clear-roll-pitch! (_type_ vector) quaternion)
(rot->dir-targ! (_type_) quaternion)
(y-angle (_type_) float)
(global-y-angle-to-point (_type_ vector) float)
(relative-y-angle-to-point (_type_ vector) float)
(roll-relative-to-gravity (_type_) float)
(set-and-limit-velocity (_type_ int vector float) trsqv :behavior process)
(get-quaternion (_type_) quaternion)
)
)
;; definition for method 3 of type trsqv
(defmethod inspect trsqv ((this trsqv))
(defmethod inspect ((this trsqv))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -110,12 +101,12 @@
)
;; definition for method 23 of type trsqv
(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector))
(defmethod global-y-angle-to-point ((this trsqv) (arg0 vector))
(vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))
)
;; definition for method 24 of type trsqv
(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector))
(defmethod relative-y-angle-to-point ((this trsqv) (arg0 vector))
(deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))))
)
+17 -17
View File
@@ -2,7 +2,7 @@
(in-package goal)
;; definition for method 2 of type transformq
(defmethod print transformq ((this transformq))
(defmethod print ((this transformq))
(format #t "#<transformq @ #x~X~%" this)
(format #t "~T~Ttrans:~F ~F ~F ~F ~%" (-> this trans x) (-> this trans y) (-> this trans z) (-> this trans w))
(format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w))
@@ -11,27 +11,27 @@
)
;; definition for method 27 of type trsqv
(defmethod get-quaternion trsqv ((this trsqv))
(defmethod get-quaternion ((this trsqv))
(-> this quat)
)
;; definition for method 18 of type trsqv
(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion))
(defmethod set-quaternion! ((this trsqv) (arg0 quaternion))
(quaternion-copy! (get-quaternion this) arg0)
)
;; definition for method 21 of type trsqv
(defmethod rot->dir-targ! trsqv ((this trsqv))
(defmethod rot->dir-targ! ((this trsqv))
(quaternion-copy! (-> this dir-targ) (get-quaternion this))
)
;; definition for method 22 of type trsqv
(defmethod y-angle trsqv ((this trsqv))
(defmethod y-angle ((this trsqv))
(quaternion-y-angle (get-quaternion this))
)
;; definition for method 9 of type trsqv
(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
(defmethod seek-toward-heading-vec! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
(let* ((f0-0 (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle arg0)))
(f1-2 (fmin (* arg1 (seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2))))
(f30-0 (fmax (fmin f0-0 f1-2) (- f1-2)))
@@ -60,7 +60,7 @@
)
;; definition for method 10 of type trsqv
(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector))
(defmethod set-heading-vec! ((this trsqv) (arg0 vector))
(let ((s3-0 (get-quaternion this)))
(forward-up-nopitch->quaternion
s3-0
@@ -71,12 +71,12 @@
)
;; definition for method 11 of type trsqv
(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
(defmethod seek-to-point-toward-point! ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame))
(seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2)
)
;; definition for method 12 of type trsqv
(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector))
(defmethod point-toward-point! ((this trsqv) (arg0 vector))
(let ((s3-0 (get-quaternion this)))
(forward-up-nopitch->quaternion
s3-0
@@ -87,7 +87,7 @@
)
;; definition for method 13 of type trsqv
(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame))
(defmethod seek-toward-yaw-angle! ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame))
(let ((s3-0 (method-of-object this seek-toward-heading-vec!))
(s2-0 (new 'stack-no-clear 'vector))
)
@@ -100,7 +100,7 @@
)
;; definition for method 14 of type trsqv
(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float))
(defmethod set-yaw-angle-clear-roll-pitch! ((this trsqv) (arg0 float))
(let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!))
(s4-0 (new 'stack-no-clear 'vector))
)
@@ -113,12 +113,12 @@
)
;; definition for method 15 of type trsqv
(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float))
(defmethod set-roll-to-grav! ((this trsqv) (arg0 float))
(set-roll-to-grav-2! this arg0)
)
;; definition for method 16 of type trsqv
(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float))
(defmethod set-roll-to-grav-2! ((this trsqv) (arg0 float))
(let* ((s5-0 (get-quaternion this))
(s1-0 (-> *standard-dynamics* gravity-normal))
(s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) s5-0))
@@ -135,7 +135,7 @@
)
;; definition for method 25 of type trsqv
(defmethod roll-relative-to-gravity trsqv ((this trsqv))
(defmethod roll-relative-to-gravity ((this trsqv))
(let* ((s5-0 (get-quaternion this))
(gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0))
(s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0))
@@ -155,7 +155,7 @@
;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3]
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defmethod rotate-toward-orientation! trsqv ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float))
(defmethod rotate-toward-orientation! ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float))
(local-vars
(f0-4 float)
(sv-192 (function quaternion vector vector float int quaternion))
@@ -222,7 +222,7 @@
)
;; definition for method 19 of type trsqv
(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector))
(defmethod set-heading-vec-clear-roll-pitch! ((this trsqv) (arg0 vector))
(forward-up->quaternion
(get-quaternion this)
(vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0)
@@ -231,7 +231,7 @@
)
;; definition for method 20 of type trsqv
(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector))
(defmethod point-toward-point-clear-roll-pitch! ((this trsqv) (arg0 vector))
(forward-up->quaternion
(get-quaternion this)
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0)
+183 -291
View File
@@ -3,25 +3,22 @@
;; definition of type bit-array
(deftype bit-array (basic)
((length int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(_pad uint8 :offset-assert 12)
(bytes uint8 :dynamic :offset 12)
((length int32)
(allocated-length int32)
(_pad uint8)
(bytes uint8 :dynamic :overlay-at _pad)
)
:method-count-assert 13
:size-assert #xd
:flag-assert #xd0000000d
(:methods
(new (symbol type int) _type_ 0)
(get-bit (_type_ int) symbol 9)
(clear-bit (_type_ int) int 10)
(set-bit (_type_ int) int 11)
(clear-all! (_type_) _type_ 12)
(new (symbol type int) _type_)
(get-bit (_type_ int) symbol)
(clear-bit (_type_ int) int)
(set-bit (_type_ int) int)
(clear-all! (_type_) _type_)
)
)
;; definition for method 3 of type bit-array
(defmethod inspect bit-array ((this bit-array))
(defmethod inspect ((this bit-array))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -43,37 +40,37 @@
)
;; definition for method 4 of type bit-array
(defmethod length bit-array ((this bit-array))
(defmethod length ((this bit-array))
(-> this length)
)
;; definition for method 5 of type bit-array
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of bit-array ((this bit-array))
(defmethod asize-of ((this bit-array))
(the-as int (+ (-> this type size) (/ (logand -8 (+ (-> this allocated-length) 7)) 8)))
)
;; definition for method 9 of type bit-array
(defmethod get-bit bit-array ((this bit-array) (arg0 int))
(defmethod get-bit ((this bit-array) (arg0 int))
(let ((v1-2 (-> this bytes (/ arg0 8))))
(logtest? v1-2 (ash 1 (logand arg0 7)))
)
)
;; definition for method 10 of type bit-array
(defmethod clear-bit bit-array ((this bit-array) (arg0 int))
(defmethod clear-bit ((this bit-array) (arg0 int))
(logclear! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7)))
0
)
;; definition for method 11 of type bit-array
(defmethod set-bit bit-array ((this bit-array) (arg0 int))
(defmethod set-bit ((this bit-array) (arg0 int))
(logior! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7)))
0
)
;; definition for method 12 of type bit-array
(defmethod clear-all! bit-array ((this bit-array))
(defmethod clear-all! ((this bit-array))
(countdown (v1-2 (/ (logand -8 (+ (-> this allocated-length) 7)) 8))
(nop!)
(nop!)
@@ -84,17 +81,14 @@
;; definition of type vector16ub
(deftype vector16ub (structure)
((data uint8 16 :offset-assert 0)
(quad uint128 :offset 0)
((data uint8 16)
(quad uint128 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector16ub
;; INFO: Used lq/sq
(defmethod inspect vector16ub ((this vector16ub))
(defmethod inspect ((this vector16ub))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -108,21 +102,18 @@
;; definition of type vector4ub
(deftype vector4ub (structure)
((data uint8 4 :offset-assert 0)
(x uint8 :offset 0)
(y uint8 :offset 1)
(z uint8 :offset 2)
(w uint8 :offset 3)
(clr uint32 :offset 0)
((data uint8 4)
(x uint8 :overlay-at (-> data 0))
(y uint8 :overlay-at (-> data 1))
(z uint8 :overlay-at (-> data 2))
(w uint8 :overlay-at (-> data 3))
(clr uint32 :overlay-at (-> data 0))
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector4ub
(defmethod inspect vector4ub ((this vector4ub))
(defmethod inspect ((this vector4ub))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -140,21 +131,18 @@
;; definition of type vector4b
(deftype vector4b (structure)
((data int8 4 :offset-assert 0)
(x int8 :offset 0)
(y int8 :offset 1)
(z int8 :offset 2)
(w int8 :offset 3)
(clr int32 :offset 0)
((data int8 4)
(x int8 :overlay-at (-> data 0))
(y int8 :overlay-at (-> data 1))
(z int8 :overlay-at (-> data 2))
(w int8 :overlay-at (-> data 3))
(clr int32 :overlay-at (-> data 0))
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector4b
(defmethod inspect vector4b ((this vector4b))
(defmethod inspect ((this vector4b))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -172,19 +160,16 @@
;; definition of type vector2ub
(deftype vector2ub (structure)
((data uint8 2 :offset-assert 0)
(x uint8 :offset 0)
(y uint8 :offset 1)
(clr uint16 :offset 0)
((data uint8 2)
(x uint8 :overlay-at (-> data 0))
(y uint8 :overlay-at (-> data 1))
(clr uint16 :overlay-at (-> data 0))
)
:pack-me
:method-count-assert 9
:size-assert #x2
:flag-assert #x900000002
)
;; definition for method 3 of type vector2ub
(defmethod inspect vector2ub ((this vector2ub))
(defmethod inspect ((this vector2ub))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -200,18 +185,15 @@
;; definition of type vector2b
(deftype vector2b (structure)
((data int8 2 :offset-assert 0)
(x int8 :offset 0)
(y int8 :offset 1)
(clr int16 :offset 0)
((data int8 2)
(x int8 :overlay-at (-> data 0))
(y int8 :overlay-at (-> data 1))
(clr int16 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x2
:flag-assert #x900000002
)
;; definition for method 3 of type vector2b
(defmethod inspect vector2b ((this vector2b))
(defmethod inspect ((this vector2b))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -227,18 +209,15 @@
;; definition of type vector2h
(deftype vector2h (structure)
((data int16 2 :offset-assert 0)
(x int16 :offset 0)
(y int16 :offset 2)
((data int16 2)
(x int16 :overlay-at (-> data 0))
(y int16 :overlay-at (-> data 1))
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector2h
(defmethod inspect vector2h ((this vector2h))
(defmethod inspect ((this vector2h))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -253,19 +232,16 @@
;; definition of type vector2uh
(deftype vector2uh (structure)
((data uint16 2 :offset-assert 0)
(x uint16 :offset 0)
(y uint16 :offset 2)
(val uint32 :offset 0)
((data uint16 2)
(x uint16 :overlay-at (-> data 0))
(y uint16 :overlay-at (-> data 1))
(val uint32 :overlay-at (-> data 0))
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type vector2uh
(defmethod inspect vector2uh ((this vector2uh))
(defmethod inspect ((this vector2uh))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -281,18 +257,15 @@
;; definition of type vector3h
(deftype vector3h (structure)
((data int16 3 :offset-assert 0)
(x int16 :offset 0)
(y int16 :offset 2)
(z int16 :offset 4)
((data int16 3)
(x int16 :overlay-at (-> data 0))
(y int16 :overlay-at (-> data 1))
(z int16 :overlay-at (-> data 2))
)
:method-count-assert 9
:size-assert #x6
:flag-assert #x900000006
)
;; definition for method 3 of type vector3h
(defmethod inspect vector3h ((this vector3h))
(defmethod inspect ((this vector3h))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -308,18 +281,15 @@
;; definition of type vector3uh
(deftype vector3uh (structure)
((data uint16 3 :offset-assert 0)
(x uint16 :offset 0)
(y uint16 :offset 2)
(z uint16 :offset 4)
((data uint16 3)
(x uint16 :overlay-at (-> data 0))
(y uint16 :overlay-at (-> data 1))
(z uint16 :overlay-at (-> data 2))
)
:method-count-assert 9
:size-assert #x6
:flag-assert #x900000006
)
;; definition for method 3 of type vector3uh
(defmethod inspect vector3uh ((this vector3uh))
(defmethod inspect ((this vector3uh))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -335,17 +305,14 @@
;; definition of type vector2w
(deftype vector2w (structure)
((data int32 2 :offset-assert 0)
(x int32 :offset 0)
(y int32 :offset 4)
((data int32 2)
(x int32 :overlay-at (-> data 0))
(y int32 :overlay-at (-> data 1))
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type vector2w
(defmethod inspect vector2w ((this vector2w))
(defmethod inspect ((this vector2w))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -360,18 +327,15 @@
;; definition of type vector3w
(deftype vector3w (structure)
((data int32 3 :offset-assert 0)
(x int32 :offset 0)
(y int32 :offset 4)
(z int32 :offset 8)
((data int32 3)
(x int32 :overlay-at (-> data 0))
(y int32 :overlay-at (-> data 1))
(z int32 :overlay-at (-> data 2))
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type vector3w
(defmethod inspect vector3w ((this vector3w))
(defmethod inspect ((this vector3w))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -387,22 +351,19 @@
;; definition of type vector4w
(deftype vector4w (structure)
((data int32 4 :offset-assert 0)
(x int32 :offset 0)
(y int32 :offset 4)
(z int32 :offset 8)
(w int32 :offset 12)
(dword uint64 2 :offset 0)
(quad uint128 :offset 0)
((data int32 4)
(x int32 :overlay-at (-> data 0))
(y int32 :overlay-at (-> data 1))
(z int32 :overlay-at (-> data 2))
(w int32 :overlay-at (-> data 3))
(dword uint64 2 :overlay-at (-> data 0))
(quad uint128 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector4w
;; INFO: Used lq/sq
(defmethod inspect vector4w ((this vector4w))
(defmethod inspect ((this vector4w))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -421,18 +382,15 @@
;; definition of type vector2
(deftype vector2 (structure)
((data float 2 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
((data float 2)
(x float :overlay-at (-> data 0))
(y float :overlay-at (-> data 1))
)
:allow-misaligned
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type vector2
(defmethod inspect vector2 ((this vector2))
(defmethod inspect ((this vector2))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -447,18 +405,15 @@
;; definition of type vector3
(deftype vector3 (structure)
((data float 3 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(z float :offset 8)
((data float 3)
(x float :overlay-at (-> data 0))
(y float :overlay-at (-> data 1))
(z float :overlay-at (-> data 2))
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type vector3
(defmethod inspect vector3 ((this vector3))
(defmethod inspect ((this vector3))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -474,22 +429,19 @@
;; definition of type vector4
(deftype vector4 (structure)
((data float 4 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(z float :offset 8)
(w float :offset 12)
(dword uint64 2 :offset 0)
(quad uint128 :offset 0)
((data float 4)
(x float :overlay-at (-> data 0))
(y float :overlay-at (-> data 1))
(z float :overlay-at (-> data 2))
(w float :overlay-at (-> data 3))
(dword uint64 2 :overlay-at (-> data 0))
(quad uint128 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector4
;; INFO: Used lq/sq
(defmethod inspect vector4 ((this vector4))
(defmethod inspect ((this vector4))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -507,24 +459,21 @@
)
;; definition for method 2 of type vector4w
(defmethod print vector4w ((this vector4w))
(defmethod print ((this vector4w))
(format #t "#<vector4w ~D ~D ~D ~D @ #x~X>" (-> this x) (-> this y) (-> this z) (-> this w) this)
this
)
;; definition of type vector4w-2
(deftype vector4w-2 (structure)
((data int32 8 :offset-assert 0)
(quad uint128 2 :offset 0)
(vector vector4w 2 :inline :offset 0)
((data int32 8)
(quad uint128 2 :overlay-at (-> data 0))
(vector vector4w 2 :inline :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type vector4w-2
(defmethod inspect vector4w-2 ((this vector4w-2))
(defmethod inspect ((this vector4w-2))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -539,17 +488,14 @@
;; definition of type vector4w-3
(deftype vector4w-3 (structure)
((data int32 12 :offset-assert 0)
(quad uint128 3 :offset 0)
(vector vector4w 3 :inline :offset 0)
((data int32 12)
(quad uint128 3 :overlay-at (-> data 0))
(vector vector4w 3 :inline :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type vector4w-3
(defmethod inspect vector4w-3 ((this vector4w-3))
(defmethod inspect ((this vector4w-3))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -564,17 +510,14 @@
;; definition of type vector4w-4
(deftype vector4w-4 (structure)
((data int32 16 :offset-assert 0)
(quad uint128 4 :offset 0)
(vector vector4w 4 :inline :offset 0)
((data int32 16)
(quad uint128 4 :overlay-at (-> data 0))
(vector vector4w 4 :inline :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; definition for method 3 of type vector4w-4
(defmethod inspect vector4w-4 ((this vector4w-4))
(defmethod inspect ((this vector4w-4))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -589,21 +532,18 @@
;; definition of type vector4h
(deftype vector4h (structure)
((data int16 4 :offset-assert 0)
(x int16 :offset 0)
(y int16 :offset 2)
(z int16 :offset 4)
(w int16 :offset 6)
(long uint64 :offset 0)
((data int16 4)
(x int16 :overlay-at (-> data 0))
(y int16 :overlay-at (-> data 1))
(z int16 :overlay-at (-> data 2))
(w int16 :overlay-at (-> data 3))
(long uint64 :overlay-at (-> data 0))
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type vector4h
(defmethod inspect vector4h ((this vector4h))
(defmethod inspect ((this vector4h))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -621,17 +561,14 @@
;; definition of type vector8h
(deftype vector8h (structure)
((data int16 8 :offset-assert 0)
(quad uint128 :offset 0)
((data int16 8)
(quad uint128 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector8h
;; INFO: Used lq/sq
(defmethod inspect vector8h ((this vector8h))
(defmethod inspect ((this vector8h))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -645,17 +582,14 @@
;; definition of type vector16b
(deftype vector16b (structure)
((data int8 16 :offset-assert 0)
(quad uint128 :offset 0)
((data int8 16)
(quad uint128 :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector16b
;; INFO: Used lq/sq
(defmethod inspect vector16b ((this vector16b))
(defmethod inspect ((this vector16b))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -668,14 +602,14 @@
)
;; definition for method 3 of type vector
(defmethod inspect vector ((this vector))
(defmethod inspect ((this vector))
(format #t "[~8x] vector~%" this)
(format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w))
this
)
;; definition for method 2 of type vector
(defmethod print vector ((this vector))
(defmethod print ((this vector))
(format #t "#<vector ~F ~F ~F ~F @ #x~X>" (-> this x) (-> this y) (-> this z) (-> this w) this)
this
)
@@ -700,17 +634,14 @@
;; definition of type vector4s-3
(deftype vector4s-3 (structure)
((data float 12 :offset-assert 0)
(quad uint128 3 :offset 0)
(vector vector 3 :inline :offset 0)
((data float 12)
(quad uint128 3 :overlay-at (-> data 0))
(vector vector 3 :inline :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x30
:flag-assert #x900000030
)
;; definition for method 3 of type vector4s-3
(defmethod inspect vector4s-3 ((this vector4s-3))
(defmethod inspect ((this vector4s-3))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -725,15 +656,12 @@
;; definition of type vector-array
(deftype vector-array (inline-array-class)
((data vector :inline :dynamic :offset-assert 16)
((data vector :inline :dynamic)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vector-array
(defmethod inspect vector-array ((this vector-array))
(defmethod inspect ((this vector-array))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -751,19 +679,16 @@
;; definition of type rgbaf
(deftype rgbaf (vector)
((r float :offset 0)
(g float :offset 4)
(b float :offset 8)
(a float :offset 12)
((r float :overlay-at (-> data 0))
(g float :overlay-at (-> data 1))
(b float :overlay-at (-> data 2))
(a float :overlay-at (-> data 3))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type rgbaf
;; INFO: Used lq/sq
(defmethod inspect rgbaf ((this rgbaf))
(defmethod inspect ((this rgbaf))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -785,19 +710,16 @@
;; definition of type plane
(deftype plane (vector)
((a float :offset 0)
(b float :offset 4)
(c float :offset 8)
(d float :offset 12)
((a float :overlay-at (-> data 0))
(b float :overlay-at (-> data 1))
(c float :overlay-at (-> data 2))
(d float :overlay-at (-> data 3))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type plane
;; INFO: Used lq/sq
(defmethod inspect plane ((this plane))
(defmethod inspect ((this plane))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -819,16 +741,13 @@
;; definition of type sphere
(deftype sphere (vector)
((r float :offset 12)
((r float :overlay-at (-> data 3))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type sphere
;; INFO: Used lq/sq
(defmethod inspect sphere ((this sphere))
(defmethod inspect ((this sphere))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -848,26 +767,20 @@
;; definition of type isphere
(deftype isphere (vec4s)
()
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition of type box8s
(deftype box8s (structure)
((data float 8 :offset-assert 0)
(quad uint128 2 :offset 0)
(vector vector 2 :offset 0)
(min vector :inline :offset 0)
(max vector :inline :offset 16)
((data float 8)
(quad uint128 2 :overlay-at (-> data 0))
(vector vector 2 :overlay-at (-> data 0))
(min vector :inline :overlay-at (-> data 0))
(max vector :inline :overlay-at (-> data 4))
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type box8s
(defmethod inspect box8s ((this box8s))
(defmethod inspect ((this box8s))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -884,15 +797,12 @@
;; definition of type box8s-array
(deftype box8s-array (inline-array-class)
((data box8s :inline :dynamic :offset-assert 16)
((data box8s :inline :dynamic)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type box8s-array
(defmethod inspect box8s-array ((this box8s-array))
(defmethod inspect ((this box8s-array))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -910,22 +820,19 @@
;; definition of type cylinder
(deftype cylinder (structure)
((origin vector :inline :offset-assert 0)
(axis vector :inline :offset-assert 16)
(radius float :offset-assert 32)
(length float :offset-assert 36)
((origin vector :inline)
(axis vector :inline)
(radius float)
(length float)
)
:method-count-assert 11
:size-assert #x28
:flag-assert #xb00000028
(:methods
(debug-draw (_type_ vector4w) none 9)
(ray-capsule-intersect (_type_ vector vector) float 10)
(debug-draw (_type_ vector4w) none)
(ray-capsule-intersect (_type_ vector vector) float)
)
)
;; definition for method 3 of type cylinder
(defmethod inspect cylinder ((this cylinder))
(defmethod inspect ((this cylinder))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -941,22 +848,19 @@
;; definition of type cylinder-flat
(deftype cylinder-flat (structure)
((origin vector :inline :offset-assert 0)
(axis vector :inline :offset-assert 16)
(radius float :offset-assert 32)
(length float :offset-assert 36)
((origin vector :inline)
(axis vector :inline)
(radius float)
(length float)
)
:method-count-assert 11
:size-assert #x28
:flag-assert #xb00000028
(:methods
(debug-draw (_type_ vector4w) none 9)
(ray-flat-cyl-intersect (_type_ vector vector) float 10)
(debug-draw (_type_ vector4w) none)
(ray-flat-cyl-intersect (_type_ vector vector) float)
)
)
;; definition for method 3 of type cylinder-flat
(defmethod inspect cylinder-flat ((this cylinder-flat))
(defmethod inspect ((this cylinder-flat))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -972,15 +876,12 @@
;; definition of type vertical-planes
(deftype vertical-planes (structure)
((data uint128 4 :offset-assert 0)
((data uint128 4)
)
:method-count-assert 9
:size-assert #x40
:flag-assert #x900000040
)
;; definition for method 3 of type vertical-planes
(defmethod inspect vertical-planes ((this vertical-planes))
(defmethod inspect ((this vertical-planes))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -993,16 +894,13 @@
;; definition of type vertical-planes-array
(deftype vertical-planes-array (basic)
((length uint32 :offset-assert 4)
(data vertical-planes :inline :dynamic :offset-assert 16)
((length uint32)
(data vertical-planes :inline :dynamic)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type vertical-planes-array
(defmethod inspect vertical-planes-array ((this vertical-planes-array))
(defmethod inspect ((this vertical-planes-array))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -1016,23 +914,20 @@
;; definition of type qword
(deftype qword (structure)
((data uint32 4 :offset-assert 0)
(byte uint8 16 :offset 0)
(hword uint16 8 :offset 0)
(word uint32 4 :offset 0)
(dword uint64 2 :offset 0)
(quad uint128 :offset 0)
(vector vector :inline :offset 0)
(vector4w vector4w :inline :offset 0)
((data uint32 4)
(byte uint8 16 :overlay-at (-> data 0))
(hword uint16 8 :overlay-at (-> data 0))
(word uint32 4 :overlay-at (-> data 0))
(dword uint64 2 :overlay-at (-> data 0))
(quad uint128 :overlay-at (-> data 0))
(vector vector :inline :overlay-at (-> data 0))
(vector4w vector4w :inline :overlay-at (-> data 0))
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type qword
;; INFO: Used lq/sq
(defmethod inspect qword ((this qword))
(defmethod inspect ((this qword))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -1052,19 +947,16 @@
;; definition of type vector3s
(deftype vector3s (structure)
((data float 3 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(z float :offset 8)
((data float 3)
(x float :overlay-at (-> data 0))
(y float :overlay-at (-> data 1))
(z float :overlay-at (-> data 2))
)
:pack-me
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type vector3s
(defmethod inspect vector3s ((this vector3s))
(defmethod inspect ((this vector3s))
(when (not this)
(set! this this)
(goto cfg-4)
+1 -1
View File
@@ -1508,7 +1508,7 @@
)
;; definition for method 2 of type vector2
(defmethod print vector2 ((this vector2))
(defmethod print ((this vector2))
(format #t "#<vector ~F ~F @ #x~X>" (-> this x) (-> this y) this)
this
)