[decomp] flags for continue points (#1303)

* make flags!

* finish flags

* refs

* Update game.gp

* fix target decomp

* Update target.gc
This commit is contained in:
ManDude
2022-04-15 23:06:24 +01:00
committed by GitHub
parent ab063bf7b0
commit 5300a7fc2b
21 changed files with 3349 additions and 3269 deletions
+33 -50
View File
@@ -504,10 +504,10 @@
;; INFO: Return type mismatch object vs none.
(defun anim-tester-num-print ((arg0 basic) (arg1 float))
(cond
((= arg1 (-> (new 'static 'array float 1 -2.0) 0))
((= arg1 -2.0)
(format arg0 "max")
)
((= arg1 (-> (new 'static 'array float 1 -1.0) 0))
((= arg1 -1.0)
(format arg0 "min")
)
(else
@@ -700,8 +700,8 @@
(set! (-> (the-as anim-test-seq-item v0-0) privname) arg1)
(set! (-> (the-as anim-test-seq-item v0-0) speed) 100)
(set! (-> (the-as anim-test-seq-item v0-0) blend) 0)
(set! (-> (the-as anim-test-seq-item v0-0) first-frame) (-> (new 'static 'array float 1 -1.0) 0))
(set! (-> (the-as anim-test-seq-item v0-0) last-frame) (-> (new 'static 'array float 1 -2.0) 0))
(set! (-> (the-as anim-test-seq-item v0-0) first-frame) -1.0)
(set! (-> (the-as anim-test-seq-item v0-0) last-frame) -2.0)
(the-as anim-test-seq-item v0-0)
)
)
@@ -773,7 +773,7 @@
#t
" item ~A SP=~f BL=~d FIRST="
(-> s3-0 privname)
(* (-> (new 'static 'array float 1 0.01) 0) (the float (-> s3-0 speed)))
(* 0.01 (the float (-> s3-0 speed)))
(-> s3-0 blend)
)
(anim-tester-num-print #t (-> s3-0 first-frame))
@@ -812,7 +812,7 @@
)
(format #t "-------------~%")
(format #t "current-obj=~A~%" (-> obj current-obj))
(format #t "speed=~f~%" (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> obj speed))))
(format #t "speed=~f~%" (* 0.01 (the float (-> obj speed))))
(format #t "--flags:--~%")
(the-as anim-tester (format #t " CONNECTED: ~A~%" (if (logtest? (-> obj flags) (anim-tester-flags fanimt0))
"TRUE"
@@ -960,10 +960,8 @@
(defbehavior anim-tester-update-anim-info anim-tester ((arg0 anim-test-seq-item))
(set! (-> self anim-first) (-> arg0 first-frame))
(set! (-> self anim-last) (-> arg0 last-frame))
(set! (-> self anim-gspeed) (* (-> (new 'static 'array float 1 0.01) 0) (the float (-> self speed))))
(set! (-> self anim-speed)
(* (-> (new 'static 'array float 1 0.01) 0) (-> self anim-gspeed) (the float (-> arg0 speed)))
)
(set! (-> self anim-gspeed) (* 0.01 (the float (-> self speed))))
(set! (-> self anim-speed) (* 0.01 (-> self anim-gspeed) (the float (-> arg0 speed))))
(when (< (-> self anim-speed) 0.0)
(set! (-> self anim-first) (-> arg0 last-frame))
(set! (-> self anim-last) (-> arg0 first-frame))
@@ -1010,8 +1008,8 @@
(set! (-> self draw sink-group) (-> *level* level-default foreground-sink-group 1))
(set! (-> self draw lod-set lod 0 geo) a1-4)
)
(set! (-> self draw lod-set lod 0 dist) (-> (new 'static 'array float 1 4095996000.0) 0))
(set! (-> self draw bounds w) (-> (new 'static 'array float 1 40960.0) 0))
(set! (-> self draw lod-set lod 0 dist) 4095996000.0)
(set! (-> self draw bounds w) 40960.0)
(set! (-> self draw data-format) (the-as uint 1))
(let ((v1-16 (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad)))
(set! (-> self draw color-mult quad) v1-16)
@@ -1048,13 +1046,13 @@
(gp-0 (-> s3-0 base))
)
(cond
((= arg1 (-> (new 'static 'array float 1 -1.0) 0))
((= arg1 -1.0)
(let ((s2-1 draw-string-adv))
(format (clear *temp-string*) "~Smin" arg0)
(s2-1 *temp-string* s3-0 arg3)
)
)
((= arg1 (-> (new 'static 'array float 1 -2.0) 0))
((= arg1 -2.0)
(let ((s2-2 draw-string-adv))
(format (clear *temp-string*) "~Smax" arg0)
(s2-2 *temp-string* s3-0 arg3)
@@ -1630,36 +1628,37 @@
)
;; definition for function anim-tester-adjust-frame
;; INFO: Return type mismatch number vs float.
(defun anim-tester-adjust-frame ((arg0 float) (arg1 float))
(cond
((cpad-hold? 0 down)
(cond
((= arg0 (-> (new 'static 'array float 1 -2.0) 0))
(set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg1))
((= arg0 -2.0)
(set! arg0 (+ -1.0 arg1))
)
((!= arg0 (-> (new 'static 'array float 1 -1.0) 0))
(set! arg0 (+ (-> (new 'static 'array float 1 -1.0) 0) arg0))
((!= arg0 -1.0)
(set! arg0 (+ -1.0 arg0))
(if (< arg0 0.0)
(set! arg0 (-> (new 'static 'array float 1 -1.0) 0))
(set! arg0 (the-as float -1.0))
)
)
)
)
((cpad-hold? 0 up)
(cond
((= arg0 (-> (new 'static 'array float 1 -1.0) 0))
(set! arg0 (-> (new 'static 'array float 1 0.0) 0))
((= arg0 -1.0)
(set! arg0 (the-as float 0.0))
)
((!= arg0 (-> (new 'static 'array float 1 -2.0) 0))
(set! arg0 (+ (-> (new 'static 'array float 1 1.0) 0) arg0))
((!= arg0 -2.0)
(set! arg0 (+ 1.0 arg0))
(if (>= arg0 arg1)
(set! arg0 (-> (new 'static 'array float 1 -2.0) 0))
(set! arg0 (the-as float -2.0))
)
)
)
)
)
arg0
(the-as float arg0)
)
;; definition for function anim-tester-pick-item-setup
@@ -1751,7 +1750,7 @@
*font-default-matrix*
(-> arg1 xpos)
(-> arg1 ypos)
(-> (new 'static 'array float 1 0.0) 0)
(the-as float 0.0)
(the-as font-color (if (= (-> arg1 the-index) (-> arg1 current-index))
15
12
@@ -2592,13 +2591,13 @@
(ja-channel-set! 1)
)
(cond
((= (-> self anim-first) (-> (new 'static 'array float 1 -1.0) 0))
((= (-> self anim-first) -1.0)
(let ((s3-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval! s3-0 s4-1 num-func-identity)
(set! (-> s3-0 frame-num) 0.0)
)
)
((= (-> self anim-first) (-> (new 'static 'array float 1 -2.0) 0))
((= (-> self anim-first) -2.0)
(let ((s3-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval! s3-1 s4-1 num-func-identity)
(set! (-> s3-1 frame-num) (the float (+ (-> s4-1 data 0 length) -1)))
@@ -2615,13 +2614,7 @@
(while (and (!= (-> self skel root-channel 0) (-> self skel channel)) (logtest? (-> s5-1 flags) 2))
(when (logtest? (-> self flags) (anim-tester-flags fanimt5))
(TODO-RENAME-9 (-> self align))
(TODO-RENAME-10
(-> self align)
31
(-> (new 'static 'array float 1 1.0) 0)
(-> (new 'static 'array float 1 1.0) 0)
(-> (new 'static 'array float 1 1.0) 0)
)
(TODO-RENAME-10 (-> self align) 31 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0))
)
(suspend)
)
@@ -2629,21 +2622,15 @@
(until (ja-done? 0)
(when (logtest? (-> self flags) (anim-tester-flags fanimt5))
(TODO-RENAME-9 (-> self align))
(TODO-RENAME-10
(-> self align)
31
(-> (new 'static 'array float 1 1.0) 0)
(-> (new 'static 'array float 1 1.0) 0)
(-> (new 'static 'array float 1 1.0) 0)
)
(TODO-RENAME-10 (-> self align) 31 (the-as float 1.0) (the-as float 1.0) (the-as float 1.0))
)
(suspend)
(anim-tester-update-anim-info s5-1)
(let ((v1-73 (= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0))))
(let ((v1-73 (= (-> self anim-last) -2.0)))
(cond
((or v1-73 (>= (-> self anim-last) (-> self anim-first)))
(cond
((= (-> self anim-last) (-> (new 'static 'array float 1 -2.0) 0))
((= (-> self anim-last) -2.0)
(let ((a0-42 (-> self skel root-channel 0)))
(set! (-> a0-42 param 0) (the float (+ (-> a0-42 frame-group data 0 length) -1)))
(set! (-> a0-42 param 1) (-> self anim-speed))
@@ -2659,7 +2646,7 @@
)
)
)
((= (-> self anim-last) (-> (new 'static 'array float 1 -1.0) 0))
((= (-> self anim-last) -1.0)
(let ((a0-44 (-> self skel root-channel 0)))
(set! (-> a0-44 param 0) 0.0)
(set! (-> a0-44 param 1) (-> self anim-speed))
@@ -2719,11 +2706,7 @@
(set! (-> self list-con list-owner) (the-as uint self))
(quaternion-identity! (-> self root quat))
(vector-identity! (-> self root scale))
(position-in-front-of-camera!
(-> self root trans)
(-> (new 'static 'array float 1 40960.0) 0)
(-> (new 'static 'array float 1 4096.0) 0)
)
(position-in-front-of-camera! (-> self root trans) (the-as float 40960.0) (the-as float 4096.0))
(set! (-> self event-hook) anim-tester-standard-event-handler)
(anim-tester-reset)
(go anim-tester-process)