[decompiler] detect seek! and seekl! macros (#1317)

* detect `seek!` and `seekl!`

* fancy struct instead of pair mess

* fixes

* i think this was wrong?

* update refs

* update source

* More logical branching

* even better branching
This commit is contained in:
ManDude
2022-04-18 20:01:44 +01:00
committed by GitHub
parent cbc6987351
commit 66e395d547
109 changed files with 952 additions and 1398 deletions
+15 -28
View File
@@ -396,9 +396,7 @@
:code
(behavior ()
(while #t
(set! (-> self in-out-position)
(seekl (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self in-out-position) 0 (the int (* 350.0 (-> *display* time-adjust-ratio))))
(if (zero? (-> self in-out-position))
(go hud-normal)
)
@@ -424,12 +422,8 @@
(= (-> *progress-process* 0 next-state name) 'progress-going-out)
(= (-> *progress-process* 0 next-state name) 'progress-gone)
)
(set! (-> self in-out-position)
(seekl (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio))))
)
(set! (-> self in-out-position)
(seekl (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self in-out-position) 0 (the int (* 150.0 (-> *display* time-adjust-ratio))))
(seekl! (-> self in-out-position) 4096 (the int (* 200.0 (-> *display* time-adjust-ratio))))
)
(suspend)
)
@@ -442,9 +436,7 @@
:code
(behavior ()
(while #t
(set! (-> self in-out-position)
(seekl (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self in-out-position) 4096 (the int (* 350.0 (-> *display* time-adjust-ratio))))
(if (= (-> self in-out-position) 4096)
(deactivate self)
)
@@ -2567,13 +2559,11 @@
(fmin 1.0 (* arg0 (/ (-> self control unknown-float01) (-> self control unknown-surface01 target-speed))))
)
)
(set! (-> self control unknown-float130)
(seek
(-> self control unknown-float130)
(fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3))
(* arg1 (-> *display* seconds-per-frame))
)
)
(seek!
(-> self control unknown-float130)
(fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3))
(* arg1 (-> *display* seconds-per-frame))
)
)
(let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))))
(forward-up-nopitch->quaternion (-> self control unknown-quaternion01) gp-0 a2-2)
@@ -2590,15 +2580,12 @@
)
(set! (-> self control unknown-float00) (fabs (-> self control unknown-float130)))
(if (= (-> self next-state name) 'target-swim-down)
(set! (-> self control unknown-float131)
(seek (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame)))
)
(set! (-> self control unknown-float131) (seek
(-> self control unknown-float131)
(the-as float (-> (new 'static 'array int32 1 0) 0))
(* 2048.0 (-> *display* seconds-per-frame))
)
)
(seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame)))
(seek!
(-> self control unknown-float131)
(the-as float (-> (new 'static 'array int32 1 0) 0))
(* 2048.0 (-> *display* seconds-per-frame))
)
)
(let ((f0-20 (-> self control unknown-float131)))
(set! (-> self control unknown-vector11 y) f0-20)