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
+19 -25
View File
@@ -6,27 +6,24 @@
;; definition of type gs-store-image-packet
(deftype gs-store-image-packet (structure)
((vifcode vif-tag 4 :offset-assert 0)
(giftag gif-tag :offset-assert 16)
(bitbltbuf gs-bitbltbuf :offset-assert 32)
(bitbltbuf-addr gs-reg64 :offset-assert 40)
(trxpos gs-trxpos :offset-assert 48)
(trxpos-addr gs-reg64 :offset-assert 56)
(trxreg gs-trxreg :offset-assert 64)
(trxreg-addr gs-reg64 :offset-assert 72)
(finish int64 :offset-assert 80)
(finish-addr gs-reg64 :offset-assert 88)
(trxdir gs-trxdir :offset-assert 96)
(trxdir-addr gs-reg64 :offset-assert 104)
((vifcode vif-tag 4)
(giftag gif-tag)
(bitbltbuf gs-bitbltbuf)
(bitbltbuf-addr gs-reg64)
(trxpos gs-trxpos)
(trxpos-addr gs-reg64)
(trxreg gs-trxreg)
(trxreg-addr gs-reg64)
(finish int64)
(finish-addr gs-reg64)
(trxdir gs-trxdir)
(trxdir-addr gs-reg64)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
;; definition for method 3 of type gs-store-image-packet
;; INFO: Used lq/sq
(defmethod inspect gs-store-image-packet ((this gs-store-image-packet))
(defmethod inspect ((this gs-store-image-packet))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -50,19 +47,16 @@
;; definition of type screen-shot-work
(deftype screen-shot-work (structure)
((count int16 :offset-assert 0)
(size int16 :offset-assert 2)
(name string :offset-assert 4)
(highres-enable symbol :offset-assert 8)
(hud-enable symbol :offset-assert 12)
((count int16)
(size int16)
(name string)
(highres-enable symbol)
(hud-enable symbol)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type screen-shot-work
(defmethod inspect screen-shot-work ((this screen-shot-work))
(defmethod inspect ((this screen-shot-work))
(when (not this)
(set! this this)
(goto cfg-4)
+10 -19
View File
@@ -6,16 +6,13 @@
;; definition of type glst-node
(deftype glst-node (structure)
((next glst-node :offset-assert 0)
(prev glst-node :offset-assert 4)
((next glst-node)
(prev glst-node)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type glst-node
(defmethod inspect glst-node ((this glst-node))
(defmethod inspect ((this glst-node))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -29,15 +26,12 @@
;; definition of type glst-named-node
(deftype glst-named-node (glst-node)
((privname string :offset-assert 8)
((privname string)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
;; definition for method 3 of type glst-named-node
(defmethod inspect glst-named-node ((this glst-named-node))
(defmethod inspect ((this glst-named-node))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -52,18 +46,15 @@
;; definition of type glst-list
(deftype glst-list (structure)
((head glst-node :offset-assert 0)
(tail glst-node :offset-assert 4)
(tailpred glst-node :offset-assert 8)
(numelem int32 :offset-assert 12)
((head glst-node)
(tail glst-node)
(tailpred glst-node)
(numelem int32)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type glst-list
(defmethod inspect glst-list ((this glst-list))
(defmethod inspect ((this glst-list))
(when (not this)
(set! this this)
(goto cfg-4)
+30 -42
View File
@@ -3,24 +3,21 @@
;; definition of type profile-segment
(deftype profile-segment (structure)
((name symbol :offset-assert 0)
(start-time int16 :offset-assert 4)
(end-time int16 :offset-assert 6)
(count uint8 :offset-assert 8)
(vu-count uint8 :offset-assert 9)
(depth uint16 :offset-assert 10)
(color rgba :offset-assert 12)
(code-time uint16 :offset 4)
(vu-time uint16 :offset 6)
((name symbol)
(start-time int16)
(end-time int16)
(count uint8)
(vu-count uint8)
(depth uint16)
(color rgba)
(code-time uint16 :overlay-at start-time)
(vu-time uint16 :overlay-at end-time)
)
:allow-misaligned
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type profile-segment
(defmethod inspect profile-segment ((this profile-segment))
(defmethod inspect ((this profile-segment))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -41,16 +38,13 @@
;; definition of type profile-collapse
(deftype profile-collapse (structure)
((count int32 :offset-assert 0)
(data profile-segment 48 :inline :offset-assert 4)
((count int32)
(data profile-segment 48 :inline)
)
:method-count-assert 9
:size-assert #x304
:flag-assert #x900000304
)
;; definition for method 3 of type profile-collapse
(defmethod inspect profile-collapse ((this profile-collapse))
(defmethod inspect ((this profile-collapse))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -64,26 +58,23 @@
;; definition of type profile-segment-array
(deftype profile-segment-array (basic)
((count int16 :offset-assert 4)
(depth int8 :offset-assert 6)
(max-depth int8 :offset-assert 7)
(base-time int16 :offset-assert 8)
(segment profile-segment 9 :offset-assert 12)
(data profile-segment 512 :inline :offset-assert 48)
((count int16)
(depth int8)
(max-depth int8)
(base-time int16)
(segment profile-segment 9)
(data profile-segment 512 :inline)
)
:method-count-assert 13
:size-assert #x2030
:flag-assert #xd00002030
(:methods
(get-total-time (_type_) int 9)
(start-frame! (_type_) none 10)
(start-segment! (_type_ symbol rgba) none 11)
(end-segment! (_type_) none 12)
(get-total-time (_type_) int)
(start-frame! (_type_) none)
(start-segment! (_type_ symbol rgba) none)
(end-segment! (_type_) none)
)
)
;; definition for method 3 of type profile-segment-array
(defmethod inspect profile-segment-array ((this profile-segment-array))
(defmethod inspect ((this profile-segment-array))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -101,20 +92,17 @@
;; definition of type profile-array
(deftype profile-array (structure)
((data profile-segment-array 2 :offset-assert 0)
((data profile-segment-array 2)
)
:method-count-assert 12
:size-assert #x8
:flag-assert #xc00000008
(:methods
(setup-categories! (_type_) none 9)
(draw-bars! (_type_ dma-buffer int) none 10)
(draw-text! (_type_) none 11)
(setup-categories! (_type_) none)
(draw-bars! (_type_ dma-buffer int) none)
(draw-text! (_type_) none)
)
)
;; definition for method 3 of type profile-array
(defmethod inspect profile-array ((this profile-array))
(defmethod inspect ((this profile-array))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -126,7 +114,7 @@
)
;; definition for method 9 of type profile-segment-array
(defmethod get-total-time profile-segment-array ((this profile-segment-array))
(defmethod get-total-time ((this profile-segment-array))
(- (-> this data 0 end-time) (-> this data 0 start-time))
)
+10 -13
View File
@@ -3,17 +3,14 @@
;; definition of type profile-work
(deftype profile-work (structure)
((sprite-tmpl dma-gif-packet :inline :offset-assert 0)
(line-tmpl dma-gif-packet :inline :offset-assert 32)
(last-index int32 :offset-assert 64)
((sprite-tmpl dma-gif-packet :inline)
(line-tmpl dma-gif-packet :inline)
(last-index int32)
)
:method-count-assert 9
:size-assert #x44
:flag-assert #x900000044
)
;; definition for method 3 of type profile-work
(defmethod inspect profile-work ((this profile-work))
(defmethod inspect ((this profile-work))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -77,7 +74,7 @@
;; definition for method 10 of type profile-segment-array
;; WARN: Return type mismatch int vs none.
(defmethod start-frame! profile-segment-array ((this profile-segment-array))
(defmethod start-frame! ((this profile-segment-array))
(set! (-> this count) 0)
(set! (-> this depth) 0)
(set! (-> this max-depth) 0)
@@ -89,7 +86,7 @@
;; definition for method 11 of type profile-segment-array
;; WARN: Return type mismatch int vs none.
(defmethod start-segment! profile-segment-array ((this profile-segment-array) (arg0 symbol) (arg1 rgba))
(defmethod start-segment! ((this profile-segment-array) (arg0 symbol) (arg1 rgba))
(when (and *dproc* *debug-segment*)
(let ((s4-0 (-> this data (-> this count))))
(let ((s3-0 (-> this base-time)))
@@ -110,7 +107,7 @@
;; definition for method 12 of type profile-segment-array
;; WARN: Return type mismatch int vs none.
(defmethod end-segment! profile-segment-array ((this profile-segment-array))
(defmethod end-segment! ((this profile-segment-array))
(when (and *dproc* *debug-segment*)
(let* ((v1-4 (+ (-> this depth) -1))
(s5-0 (-> this segment v1-4))
@@ -402,7 +399,7 @@
;; definition for method 9 of type profile-array
;; WARN: Return type mismatch int vs none.
(defmethod setup-categories! profile-array ((this profile-array))
(defmethod setup-categories! ((this profile-array))
(dotimes (s5-0 2)
(let ((s3-0 (-> *profile-array* data s5-0))
(s4-0 *profile-collapse*)
@@ -561,7 +558,7 @@
;; definition for method 10 of type profile-array
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-bars! profile-array ((this profile-array) (arg0 dma-buffer) (arg1 int))
(defmethod draw-bars! ((this profile-array) (arg0 dma-buffer) (arg1 int))
(local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object)))
(dma-buffer-add-gs-set arg0
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
@@ -739,7 +736,7 @@
;; definition for method 11 of type profile-array
;; WARN: Return type mismatch int vs none.
(defmethod draw-text! profile-array ((this profile-array))
(defmethod draw-text! ((this profile-array))
(let ((gp-0 *profile-collapse*))
(dotimes (s5-0 (-> gp-0 count))
(when (or (nonzero? (-> gp-0 data s5-0 count)) (nonzero? (-> gp-0 data s5-0 vu-count)))
+20 -26
View File
@@ -3,21 +3,18 @@
;; definition of type script-form
(deftype script-form (structure)
((name symbol :offset-assert 0)
(spec pair :offset-assert 4)
(func (function script-context object) :offset-assert 8)
((name symbol)
(spec pair)
(func (function script-context object))
)
:pack-me
:method-count-assert 10
:size-assert #xc
:flag-assert #xa0000000c
(:methods
(script-form-method-9 () none 9)
(script-form-method-9 () none)
)
)
;; definition for method 3 of type script-form
(defmethod inspect script-form ((this script-form))
(defmethod inspect ((this script-form))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -32,30 +29,27 @@
;; definition of type script-context
(deftype script-context (structure)
((load-state load-state :offset-assert 0)
(key object :offset-assert 4)
(process process :offset-assert 8)
(trans vector :offset-assert 12)
(side-effect? symbol :offset-assert 16)
(got-error? symbol :offset-assert 20)
(expr pair :offset-assert 24)
(param-count int32 :offset-assert 28)
(param object 16 :offset-assert 32)
(param-type object 16 :offset-assert 96)
((load-state load-state)
(key object)
(process process)
(trans vector)
(side-effect? symbol)
(got-error? symbol)
(expr pair)
(param-count int32)
(param object 16)
(param-type object 16)
)
:method-count-assert 12
:size-assert #xa0
:flag-assert #xc000000a0
(:methods
(new (symbol type object process vector) _type_ 0)
(eval! (_type_ pair) object 9)
(script-context-method-10 (_type_ object pair) object 10)
(script-context-method-11 (_type_ pair pair symbol) symbol 11)
(new (symbol type object process vector) _type_)
(eval! (_type_ pair) object)
(script-context-method-10 (_type_ object pair) object)
(script-context-method-11 (_type_ pair pair symbol) symbol)
)
)
;; definition for method 3 of type script-context
(defmethod inspect script-context ((this script-context))
(defmethod inspect ((this script-context))
(when (not this)
(set! this this)
(goto cfg-10)
+20 -23
View File
@@ -3,30 +3,27 @@
;; definition of type smush-control
(deftype smush-control (structure)
((start-time time-frame :offset-assert 0)
(period float :offset-assert 8)
(duration float :offset-assert 12)
(amp float :offset-assert 16)
(damp-amp float :offset-assert 20)
(damp-period float :offset-assert 24)
(ticks float :offset-assert 28)
((start-time time-frame)
(period float)
(duration float)
(amp float)
(damp-amp float)
(damp-period float)
(ticks float)
)
:pack-me
:method-count-assert 15
:size-assert #x20
:flag-assert #xf00000020
(:methods
(set-zero! (_type_) _type_ 9)
(update! (_type_) float 10)
(get-no-update (_type_) float 11)
(activate! (_type_ float int int float float clock) _type_ 12)
(nonzero-amplitude? (_type_) symbol 13)
(die-on-next-update! (_type_) _type_ 14)
(set-zero! (_type_) _type_)
(update! (_type_) float)
(get-no-update (_type_) float)
(activate! (_type_ float int int float float clock) _type_)
(nonzero-amplitude? (_type_) symbol)
(die-on-next-update! (_type_) _type_)
)
)
;; definition for method 3 of type smush-control
(defmethod inspect smush-control ((this smush-control))
(defmethod inspect ((this smush-control))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -44,12 +41,12 @@
)
;; definition for method 13 of type smush-control
(defmethod nonzero-amplitude? smush-control ((this smush-control))
(defmethod nonzero-amplitude? ((this smush-control))
(!= (-> this amp) 0.0)
)
;; definition for method 9 of type smush-control
(defmethod set-zero! smush-control ((this smush-control))
(defmethod set-zero! ((this smush-control))
(set! (-> this period) 0.0)
(set! (-> this duration) 0.0)
(set! (-> this amp) 0.0)
@@ -60,7 +57,7 @@
)
;; definition for method 10 of type smush-control
(defmethod update! smush-control ((this smush-control))
(defmethod update! ((this smush-control))
(cond
((!= (-> this amp) 0.0)
(let* ((f30-0 (the float (- (current-time) (-> this start-time))))
@@ -90,7 +87,7 @@
)
;; definition for method 11 of type smush-control
(defmethod get-no-update smush-control ((this smush-control))
(defmethod get-no-update ((this smush-control))
(cond
((!= (-> this amp) 0.0)
(let* ((f30-0 (the float (- (current-time) (-> this start-time))))
@@ -109,7 +106,7 @@
)
;; definition for method 14 of type smush-control
(defmethod die-on-next-update! smush-control ((this smush-control))
(defmethod die-on-next-update! ((this smush-control))
(if (!= (-> this amp) 0.0)
(set! (-> this damp-period) -1.0)
)
@@ -117,7 +114,7 @@
)
;; definition for method 12 of type smush-control
(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock))
(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock))
(when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this)))
(set! (-> this amp) arg0)
(set! (-> this period) (the float arg1))
+84 -114
View File
@@ -3,23 +3,20 @@
;; definition of type sync-info-params
(deftype sync-info-params (structure)
((sync-type symbol :offset-assert 0)
(sync-flags sync-flags :offset-assert 8)
(entity basic :offset-assert 16)
(period uint32 :offset-assert 20)
(percent float :offset-assert 24)
(ease-in float :offset-assert 28)
(ease-out float :offset-assert 32)
(pause-in float :offset-assert 36)
(pause-out float :offset-assert 40)
((sync-type symbol)
(sync-flags sync-flags)
(entity basic)
(period uint32)
(percent float)
(ease-in float)
(ease-out float)
(pause-in float)
(pause-out float)
)
:method-count-assert 9
:size-assert #x2c
:flag-assert #x90000002c
)
;; definition for method 3 of type sync-info-params
(defmethod inspect sync-info-params ((this sync-info-params))
(defmethod inspect ((this sync-info-params))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -40,26 +37,23 @@
;; definition of type sync-info
(deftype sync-info (structure)
((sync-flags sync-flags :offset-assert 0)
(offset float :offset-assert 8)
(period uint32 :offset-assert 12)
((sync-flags sync-flags)
(offset float)
(period uint32)
)
:method-count-assert 16
:size-assert #x10
:flag-assert #x1000000010
(:methods
(get-current-phase-no-mod (_type_) float 9)
(get-phase-offset (_type_) float 10)
(get-norm! (_type_ int) float 11)
(get-scaled-val! (_type_ float int) float 12)
(initialize! (_type_ sync-info-params) none 13)
(get-timeframe-offset! (_type_ time-frame) time-frame 14)
(sync-now! (_type_ float) none 15)
(get-current-phase-no-mod (_type_) float)
(get-phase-offset (_type_) float)
(get-norm! (_type_ int) float)
(get-scaled-val! (_type_ float int) float)
(initialize! (_type_ sync-info-params) none)
(get-timeframe-offset! (_type_ time-frame) time-frame)
(sync-now! (_type_ float) none)
)
)
;; definition for method 3 of type sync-info
(defmethod inspect sync-info ((this sync-info))
(defmethod inspect ((this sync-info))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -76,13 +70,10 @@
(deftype sync-linear (sync-info)
()
:pack-me
:method-count-assert 16
:size-assert #x10
:flag-assert #x1000000010
)
;; definition for method 3 of type sync-linear
(defmethod inspect sync-linear ((this sync-linear))
(defmethod inspect ((this sync-linear))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -97,22 +88,19 @@
;; definition of type sync-eased
(deftype sync-eased (sync-info)
((tlo float :offset-assert 16)
(thi float :offset-assert 20)
(ylo float :offset-assert 24)
(m2 float :offset-assert 28)
(yend float :offset-assert 32)
(pause-in float :offset-assert 36)
(pause-out float :offset-assert 40)
((tlo float)
(thi float)
(ylo float)
(m2 float)
(yend float)
(pause-in float)
(pause-out float)
)
:pack-me
:method-count-assert 16
:size-assert #x2c
:flag-assert #x100000002c
)
;; definition for method 3 of type sync-eased
(defmethod inspect sync-eased ((this sync-eased))
(defmethod inspect ((this sync-eased))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -134,16 +122,13 @@
;; definition of type sync-paused
(deftype sync-paused (sync-info)
((pause-in float :offset-assert 16)
(pause-out float :offset-assert 20)
((pause-in float)
(pause-out float)
)
:method-count-assert 16
:size-assert #x18
:flag-assert #x1000000018
)
;; definition for method 3 of type sync-paused
(defmethod inspect sync-paused ((this sync-paused))
(defmethod inspect ((this sync-paused))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -160,27 +145,24 @@
;; definition of type delayed-rand-float
(deftype delayed-rand-float (structure)
((min-time int32 :offset-assert 0)
(max-time int32 :offset-assert 4)
(max-val float :offset-assert 8)
(timer int32 :offset-assert 12)
(start-time time-frame :offset-assert 16)
(value float :offset-assert 24)
((min-time int32)
(max-time int32)
(max-val float)
(timer int32)
(start-time time-frame)
(value float)
)
:pack-me
:method-count-assert 13
:size-assert #x1c
:flag-assert #xd0000001c
(:methods
(set-params! (_type_ int int float) float 9)
(reset! (_type_) float 10)
(update! (_type_) float 11)
(update-and-clear! (_type_) none 12)
(set-params! (_type_ int int float) float)
(reset! (_type_) float)
(update! (_type_) float)
(update-and-clear! (_type_) none)
)
)
;; definition for method 3 of type delayed-rand-float
(defmethod inspect delayed-rand-float ((this delayed-rand-float))
(defmethod inspect ((this delayed-rand-float))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -198,25 +180,22 @@
;; definition of type oscillating-float
(deftype oscillating-float (structure)
((value float :offset-assert 0)
(target float :offset-assert 4)
(vel float :offset-assert 8)
(max-vel float :offset-assert 12)
(damping float :offset-assert 16)
(accel float :offset-assert 20)
((value float)
(target float)
(vel float)
(max-vel float)
(damping float)
(accel float)
)
:allow-misaligned
:method-count-assert 11
:size-assert #x18
:flag-assert #xb00000018
(:methods
(set-params! (_type_ float float float float) float 9)
(update! (_type_ float) float 10)
(set-params! (_type_ float float float float) float)
(update! (_type_ float) float)
)
)
;; definition for method 3 of type oscillating-float
(defmethod inspect oscillating-float ((this oscillating-float))
(defmethod inspect ((this oscillating-float))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -234,26 +213,23 @@
;; definition of type bouncing-float
(deftype bouncing-float (structure)
((osc oscillating-float :inline :offset-assert 0)
(max-value float :offset-assert 24)
(min-value float :offset-assert 28)
(elasticity float :offset-assert 32)
(state int32 :offset-assert 36)
((osc oscillating-float :inline)
(max-value float)
(min-value float)
(elasticity float)
(state int32)
)
:allow-misaligned
:method-count-assert 13
:size-assert #x28
:flag-assert #xd00000028
(:methods
(set-params! (_type_ float float float float float float float) float 9)
(update! (_type_ float) float 10)
(at-min? (_type_) symbol 11)
(at-max? (_type_) symbol 12)
(set-params! (_type_ float float float float float float float) float)
(update! (_type_ float) float)
(at-min? (_type_) symbol)
(at-max? (_type_) symbol)
)
)
;; definition for method 3 of type bouncing-float
(defmethod inspect bouncing-float ((this bouncing-float))
(defmethod inspect ((this bouncing-float))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -270,27 +246,24 @@
;; definition of type delayed-rand-vector
(deftype delayed-rand-vector (structure)
((min-time int32 :offset-assert 0)
(max-time int32 :offset-assert 4)
(xz-max float :offset-assert 8)
(y-max float :offset-assert 12)
(timer int32 :offset-assert 16)
(start-time time-frame :offset-assert 24)
(value vector :inline :offset-assert 32)
((min-time int32)
(max-time int32)
(xz-max float)
(y-max float)
(timer int32)
(start-time time-frame)
(value vector :inline)
)
:method-count-assert 13
:size-assert #x30
:flag-assert #xd00000030
(:methods
(set-params! (_type_ int int float float) vector 9)
(update-now! (_type_) vector 10)
(update-with-delay! (_type_) vector 11)
(update-with-delay-or-reset! (_type_) vector 12)
(set-params! (_type_ int int float float) vector)
(update-now! (_type_) vector)
(update-with-delay! (_type_) vector)
(update-with-delay-or-reset! (_type_) vector)
)
)
;; definition for method 3 of type delayed-rand-vector
(defmethod inspect delayed-rand-vector ((this delayed-rand-vector))
(defmethod inspect ((this delayed-rand-vector))
(when (not this)
(set! this this)
(goto cfg-4)
@@ -309,24 +282,21 @@
;; definition of type oscillating-vector
(deftype oscillating-vector (structure)
((value vector :inline :offset-assert 0)
(target vector :inline :offset-assert 16)
(vel vector :inline :offset-assert 32)
(max-vel float :offset-assert 48)
(damping float :offset-assert 52)
(accel float :offset-assert 56)
((value vector :inline)
(target vector :inline)
(vel vector :inline)
(max-vel float)
(damping float)
(accel float)
)
:method-count-assert 11
:size-assert #x3c
:flag-assert #xb0000003c
(:methods
(set-params! (_type_ vector float float float) vector 9)
(update! (_type_ vector) vector 10)
(set-params! (_type_ vector float float float) vector)
(update! (_type_ vector) vector)
)
)
;; definition for method 3 of type oscillating-vector
(defmethod inspect oscillating-vector ((this oscillating-vector))
(defmethod inspect ((this oscillating-vector))
(when (not this)
(set! this this)
(goto cfg-4)
+40 -40
View File
@@ -3,14 +3,14 @@
;; definition for method 13 of type sync-info
;; WARN: Return type mismatch object vs none.
(defmethod initialize! sync-info ((this sync-info) (arg0 sync-info-params))
(defmethod initialize! ((this sync-info) (arg0 sync-info-params))
"Set up a sync-info from params."
(format 0 "ERROR: Invalid call to sync-info::initialize!~%")
(none)
)
;; definition for method 9 of type sync-info
(defmethod get-current-phase-no-mod sync-info ((this sync-info))
(defmethod get-current-phase-no-mod ((this sync-info))
"Get the current value, with no fancy modifications."
(let* ((v1-0 (-> this period))
(f0-1 (the float v1-0))
@@ -21,14 +21,14 @@
)
;; definition for method 10 of type sync-info
(defmethod get-phase-offset sync-info ((this sync-info))
(defmethod get-phase-offset ((this sync-info))
"Get the offset, as a fraction of period"
(/ (-> this offset) (the float (-> this period)))
)
;; definition for method 15 of type sync-info
;; WARN: Return type mismatch int vs none.
(defmethod sync-now! sync-info ((this sync-info) (arg0 float))
(defmethod sync-now! ((this sync-info) (arg0 float))
"Adjust our offset so our current phase is the given phase."
(let* ((a2-0 (-> this period))
(f0-1 (the float a2-0))
@@ -44,20 +44,20 @@
)
;; definition for method 11 of type sync-info
(defmethod get-norm! sync-info ((this sync-info) (arg0 int))
(defmethod get-norm! ((this sync-info) (arg0 int))
"Get the current value, from 0 to 1."
(format 0 "ERROR: Unsupported sync-info::get-norm!~%")
0.0
)
;; definition for method 12 of type sync-info
(defmethod get-scaled-val! sync-info ((this sync-info) (arg0 float) (arg1 int))
(defmethod get-scaled-val! ((this sync-info) (arg0 float) (arg1 int))
"Multiples result of `get-norm!` by the provided float"
(* (get-norm! this arg1) arg0)
)
;; definition for method 14 of type sync-info
(defmethod get-timeframe-offset! sync-info ((this sync-info) (arg0 time-frame))
(defmethod get-timeframe-offset! ((this sync-info) (arg0 time-frame))
"Get the difference between the given time-frame and when this sync-info is at 0."
(if (zero? arg0)
(set! arg0 (current-time))
@@ -73,7 +73,7 @@
;; definition for method 13 of type sync-linear
;; INFO: Used lq/sq
;; WARN: Return type mismatch float vs none.
(defmethod initialize! sync-linear ((this sync-linear) (arg0 sync-info-params))
(defmethod initialize! ((this sync-linear) (arg0 sync-info-params))
"Set up a sync-info from params."
(local-vars (sv-16 res-tag))
(if (!= (-> arg0 sync-type) 'sync-linear)
@@ -109,7 +109,7 @@
)
;; definition for method 11 of type sync-linear
(defmethod get-norm! sync-linear ((this sync-linear) (arg0 int))
(defmethod get-norm! ((this sync-linear) (arg0 int))
"Get the current value, from 0 to 1."
(if (zero? arg0)
(set! arg0 (the-as int (current-time)))
@@ -139,7 +139,7 @@
)
;; definition for method 12 of type sync-linear
(defmethod get-scaled-val! sync-linear ((this sync-linear) (arg0 float) (arg1 int))
(defmethod get-scaled-val! ((this sync-linear) (arg0 float) (arg1 int))
"Multiples result of `get-norm!` by the provided float"
(* (get-norm! this arg1) arg0)
)
@@ -147,7 +147,7 @@
;; definition for method 13 of type sync-eased
;; INFO: Used lq/sq
;; WARN: Return type mismatch float vs none.
(defmethod initialize! sync-eased ((this sync-eased) (arg0 sync-info-params))
(defmethod initialize! ((this sync-eased) (arg0 sync-info-params))
"Set up a sync-info from params."
(local-vars (sv-16 res-tag))
(if (!= (-> arg0 sync-type) 'sync-eased)
@@ -247,7 +247,7 @@
)
;; definition for method 11 of type sync-eased
(defmethod get-norm! sync-eased ((this sync-eased) (arg0 int))
(defmethod get-norm! ((this sync-eased) (arg0 int))
"Get the current value, from 0 to 1."
(if (zero? arg0)
(set! arg0 (the-as int (current-time)))
@@ -314,7 +314,7 @@
)
;; definition for method 12 of type sync-eased
(defmethod get-scaled-val! sync-eased ((this sync-eased) (arg0 float) (arg1 int))
(defmethod get-scaled-val! ((this sync-eased) (arg0 float) (arg1 int))
"Multiples result of `get-norm!` by the provided float"
(* (get-norm! this arg1) arg0)
)
@@ -322,7 +322,7 @@
;; definition for method 13 of type sync-paused
;; INFO: Used lq/sq
;; WARN: Return type mismatch float vs none.
(defmethod initialize! sync-paused ((this sync-paused) (arg0 sync-info-params))
(defmethod initialize! ((this sync-paused) (arg0 sync-info-params))
"Set up a sync-info from params."
(local-vars (sv-16 res-tag))
(if (!= (-> arg0 sync-type) 'sync-paused)
@@ -384,7 +384,7 @@
)
;; definition for method 11 of type sync-paused
(defmethod get-norm! sync-paused ((this sync-paused) (arg0 int))
(defmethod get-norm! ((this sync-paused) (arg0 int))
"Get the current value, from 0 to 1."
(if (zero? arg0)
(set! arg0 (the-as int (current-time)))
@@ -431,13 +431,13 @@
)
;; definition for method 12 of type sync-paused
(defmethod get-scaled-val! sync-paused ((this sync-paused) (arg0 float) (arg1 int))
(defmethod get-scaled-val! ((this sync-paused) (arg0 float) (arg1 int))
"Multiples result of `get-norm!` by the provided float"
(* (get-norm! this arg1) arg0)
)
;; definition for method 9 of type delayed-rand-float
(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float))
(defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float))
(set! (-> this min-time) arg0)
(set! (-> this max-time) arg1)
(set! (-> this max-val) (* 0.5 arg2))
@@ -448,14 +448,14 @@
)
;; definition for method 10 of type delayed-rand-float
(defmethod reset! delayed-rand-float ((this delayed-rand-float))
(defmethod reset! ((this delayed-rand-float))
(set-time! (-> this start-time))
(set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time)))
(set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val)))
)
;; definition for method 11 of type delayed-rand-float
(defmethod update! delayed-rand-float ((this delayed-rand-float))
(defmethod update! ((this delayed-rand-float))
(if (time-elapsed? (-> this start-time) (-> this timer))
(reset! this)
)
@@ -464,7 +464,7 @@
;; definition for method 12 of type delayed-rand-float
;; WARN: Return type mismatch float vs none.
(defmethod update-and-clear! delayed-rand-float ((this delayed-rand-float))
(defmethod update-and-clear! ((this delayed-rand-float))
(if (time-elapsed? (-> this start-time) (-> this timer))
(reset! this)
(set! (-> this value) 0.0)
@@ -474,7 +474,7 @@
)
;; definition for method 9 of type oscillating-float
(defmethod set-params! oscillating-float ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float))
(defmethod set-params! ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float))
(set! (-> this value) arg0)
(set! (-> this target) arg0)
(set! (-> this vel) 0.0)
@@ -485,7 +485,7 @@
)
;; definition for method 10 of type oscillating-float
(defmethod update! oscillating-float ((this oscillating-float) (arg0 float))
(defmethod update! ((this oscillating-float) (arg0 float))
(with-pp
(let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> pp clock time-adjust-ratio)))))
(+! (-> this vel) f0-3)
@@ -498,15 +498,15 @@
)
;; definition for method 9 of type bouncing-float
(defmethod set-params! bouncing-float ((this bouncing-float)
(arg0 float)
(arg1 float)
(arg2 float)
(arg3 float)
(arg4 float)
(arg5 float)
(arg6 float)
)
(defmethod set-params! ((this bouncing-float)
(arg0 float)
(arg1 float)
(arg2 float)
(arg3 float)
(arg4 float)
(arg5 float)
(arg6 float)
)
(set-params! (-> this osc) arg0 arg4 arg5 arg6)
(set! (-> this max-value) arg1)
(set! (-> this min-value) arg2)
@@ -516,7 +516,7 @@
)
;; definition for method 10 of type bouncing-float
(defmethod update! bouncing-float ((this bouncing-float) (arg0 float))
(defmethod update! ((this bouncing-float) (arg0 float))
(update! (-> this osc) arg0)
(set! (-> this state) 0)
(when (>= (-> this osc value) (-> this max-value))
@@ -537,17 +537,17 @@
)
;; definition for method 11 of type bouncing-float
(defmethod at-min? bouncing-float ((this bouncing-float))
(defmethod at-min? ((this bouncing-float))
(= (-> this state) -1)
)
;; definition for method 12 of type bouncing-float
(defmethod at-max? bouncing-float ((this bouncing-float))
(defmethod at-max? ((this bouncing-float))
(= (-> this state) 1)
)
;; definition for method 9 of type delayed-rand-vector
(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float))
(defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float))
(set! (-> this min-time) arg0)
(set! (-> this max-time) arg1)
(set! (-> this xz-max) (* 0.5 arg2))
@@ -559,7 +559,7 @@
)
;; definition for method 10 of type delayed-rand-vector
(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector))
(defmethod update-now! ((this delayed-rand-vector))
(set-time! (-> this start-time))
(set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time)))
(set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max)))
@@ -569,7 +569,7 @@
)
;; definition for method 11 of type delayed-rand-vector
(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector))
(defmethod update-with-delay! ((this delayed-rand-vector))
(if (time-elapsed? (-> this start-time) (-> this timer))
(update-now! this)
)
@@ -577,7 +577,7 @@
)
;; definition for method 12 of type delayed-rand-vector
(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector))
(defmethod update-with-delay-or-reset! ((this delayed-rand-vector))
(if (time-elapsed? (-> this start-time) (-> this timer))
(update-now! this)
(vector-reset! (-> this value))
@@ -587,7 +587,7 @@
;; definition for method 9 of type oscillating-vector
;; INFO: Used lq/sq
(defmethod set-params! oscillating-vector ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float))
(defmethod set-params! ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float))
(cond
(arg0
(set! (-> this value quad) (-> arg0 quad))
@@ -606,7 +606,7 @@
)
;; definition for method 10 of type oscillating-vector
(defmethod update! oscillating-vector ((this oscillating-vector) (arg0 vector))
(defmethod update! ((this oscillating-vector) (arg0 vector))
(with-pp
(let ((v1-0 (new 'stack-no-clear 'vector)))
(cond
-4
View File
@@ -4,11 +4,7 @@
;; definition of type part-id
(deftype part-id (uint32)
()
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; failed to figure out what this is:
0