[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
+5 -15
View File
@@ -1627,9 +1627,7 @@
(suspend)
(set! (-> self state-time) (-> *display* base-frame-counter))
(until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3))
(set! (-> self timer-pos-offset)
(seekl (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio))))
(when (= (-> self timer-pos-offset) 100)
(send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable)
(send-event (ppointer->process (-> *hud-parts* money)) 'enable)
@@ -1656,9 +1654,7 @@
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3))
(set! (-> self timer-pos-offset)
(seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio))))
(when (= (-> self timer-pos-offset) 100)
(send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable)
(send-event (ppointer->process (-> *hud-parts* money)) 'enable)
@@ -1847,9 +1843,7 @@
(set! (-> self state-time) (-> *display* game-frame-counter))
(while #t
(seconds->race-time (-> self this-time) (- (-> *display* game-frame-counter) (-> self state-time)))
(set! (-> self timer-pos-offset)
(seekl (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self timer-pos-offset) 0 (the int (* 5.0 (-> *display* time-adjust-ratio))))
(completed? (-> self ticker))
(gorge-start-draw-time #f #f)
(suspend)
@@ -1869,9 +1863,7 @@
(behavior ()
(while #t
(suspend)
(set! (-> self timer-pos-offset)
(seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio))))
(when (= (-> self timer-pos-offset) 100)
(send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable)
(send-event (ppointer->process (-> *hud-parts* money)) 'enable)
@@ -1916,9 +1908,7 @@
(behavior ()
(while #t
(suspend)
(set! (-> self timer-pos-offset)
(seekl (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio))))
)
(seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio))))
(when (= (-> self timer-pos-offset) 100)
(send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable)
(send-event (ppointer->process (-> *hud-parts* money)) 'enable)