[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
+1 -1
View File
@@ -243,7 +243,7 @@
(let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))
(f0-6 (atan (-> s5-0 y) f0-5))
)
(set! (-> obj head-tilt) (seek (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame))))
(seek! (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame)))
)
)
(set! (-> obj head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> obj head-tilt))))
+4 -12
View File
@@ -495,9 +495,7 @@
(go pelican-fly-to-end (-> self path-to-nest2) (-> *PELICAN-bank* run-away-time))
)
(pelican-path-update 364088.88 30 0.0 0.0 #t)
(set! (-> self path-pos)
(seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
)
(seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
(if (= (-> self path-pos) (-> self path-max))
(go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache)))
)
@@ -581,9 +579,7 @@
:trans
(behavior ()
(pelican-path-update 546133.3 30 0.0 0.0 #f)
(set! (-> self path-pos)
(seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
)
(seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
(if (= (-> self path-pos) (-> self path-max))
(go pelican-wait-at-nest #f)
)
@@ -983,9 +979,7 @@
:trans
(behavior ()
(pelican-path-update 131072.0 150 0.0 0.0 #f)
(set! (-> self path-pos)
(seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
)
(seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
(if (= (-> self path-pos) (-> self path-max))
(go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time))
)
@@ -1028,9 +1022,7 @@
:trans
(behavior ()
(pelican-path-update 546133.3 30 0.0 0.0 #f)
(set! (-> self path-pos)
(seek (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
)
(seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame)))
(if (= (-> self path-pos) (-> self path-max))
(go pelican-wait-at-end #f)
)