Files
jak-project/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc
T
2023-02-26 09:49:16 -05:00

184 lines
5.6 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type idle-control-frame
(deftype idle-control-frame (uint32)
((command ic-cmd :offset 0 :size 8)
(anim uint8 :offset 8 :size 8)
(param0 uint8 :offset 16 :size 8)
(param1 uint8 :offset 24 :size 8)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type idle-control-frame
(defmethod inspect idle-control-frame ((obj idle-control-frame))
(local-vars (a2-4 int))
(when (not obj)
(set! obj obj)
(goto cfg-11)
)
(format #t "[~8x] ~A~%" obj 'idle-control-frame)
(let ((t9-1 format)
(a0-2 #t)
(a1-1 "~1Tcommand: #x~X : ~S~%")
(a2-1 (-> obj command))
(v1-4 (-> obj command))
)
(t9-1 a0-2 a1-1 a2-1 (cond
((= v1-4 (ic-cmd play))
"play"
)
((= v1-4 (ic-cmd push))
"push"
)
((= v1-4 (ic-cmd restart))
"restart"
)
(else
"*unknown*"
)
)
)
)
(format #t "~1Tanim: ~D~%" (-> obj anim))
(format #t "~1Tparam0: ~D~%" (-> obj param0))
(let ((t9-4 format)
(a0-5 #t)
(a1-4 "~1Tparam1: ~D~%")
)
(shift-arith-right-32 a2-4 obj 24)
(t9-4 a0-5 a1-4 a2-4)
)
(label cfg-11)
obj
)
;; definition of type idle-control
(deftype idle-control (structure)
((anim (pointer idle-control-frame) :offset-assert 0)
(current (pointer idle-control-frame) :offset-assert 4)
(counter int32 :offset-assert 8)
(target int32 :offset-assert 12)
)
:method-count-assert 11
:size-assert #x10
:flag-assert #xb00000010
(:methods
(idle-control-method-9 (_type_ (pointer idle-control-frame)) none 9)
(idle-control-method-10 (_type_ process-drawable) none :behavior process-drawable 10)
)
)
;; definition for method 3 of type idle-control
(defmethod inspect idle-control ((obj idle-control))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'idle-control)
(format #t "~1Tanim: #x~X~%" (-> obj anim))
(format #t "~1Tcurrent: #x~X~%" (-> obj current))
(format #t "~1Tcounter: ~D~%" (-> obj counter))
(format #t "~1Ttarget: ~D~%" (-> obj target))
(label cfg-4)
obj
)
;; definition for method 9 of type idle-control
;; WARN: Return type mismatch idle-control vs none.
(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer idle-control-frame)))
(set! (-> obj anim) arg0)
(set! (-> obj current) arg0)
(set! (-> obj counter) 0)
(set! (-> obj target) 0)
(none)
)
;; definition for method 10 of type idle-control
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement.
(defmethod idle-control-method-10 idle-control ((obj idle-control) (arg0 process-drawable))
(local-vars (a1-1 int))
(when (nonzero? (-> obj anim))
(let ((s5-0 self))
(set! self arg0)
(loop
(let ((s4-0 (-> obj current 0)))
(case (-> s4-0 command)
(((ic-cmd play))
(if (< (-> s4-0 anim) 0)
(return #f)
)
(when (zero? (-> obj target))
(let ((t9-0 rand-vu-int-range)
(a0-3 (-> s4-0 param0))
)
(shift-arith-right-32 a1-1 s4-0 24)
(set! (-> obj target) (t9-0 (the-as int a0-3) a1-1))
)
(ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! min)
(return #f)
)
(ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim))
:num! (seek!
(the float
(+ (-> (the-as art-joint-anim (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)))
frames
num-frames
)
-1
)
)
)
)
(cond
((ja-done? 0)
(+! (-> obj counter) 1)
(cond
((>= (-> obj counter) (-> obj target))
(set! (-> obj current) (&-> (-> obj current) 1))
(set! (-> obj counter) 0)
(set! (-> obj target) 0)
0
)
(else
(ja :num-func num-func-identity :frame-num 0.0)
(return #f)
)
)
)
(else
(return #f)
)
)
)
(((ic-cmd push))
(ja-channel-push! 1 (the-as time-frame (-> s4-0 param0)))
(set! (-> obj current) (&-> (-> obj current) 1))
(set! (-> obj counter) 0)
(set! (-> obj target) 0)
0
)
(((ic-cmd restart))
(set! (-> obj current) (-> obj anim))
(set! (-> obj counter) 0)
(set! (-> obj target) 0)
0
)
)
)
)
(set! self s5-0)
)
)
0
(none)
)