mirror of
https://github.com/open-goal/jak-project
synced 2026-08-02 16:46:26 -04:00
decomp3: cam-debug, hover-nav-edit, pilot-recorder (#4203)
Should be the last remaining files aside from `anim-tester` which we already have a better replacement for.
This commit is contained in:
+1811
File diff suppressed because it is too large
Load Diff
+609
@@ -0,0 +1,609 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
;; definition for method 3 of type memory-usage-block
|
||||
(defmethod inspect ((this memory-usage-block))
|
||||
(format #t "-------------------------------------------------------------~%")
|
||||
(format #t " # name count bytes used aligned bytes~%")
|
||||
(format #t "-------------------------------------------------------------~%")
|
||||
(let ((s5-0 0)
|
||||
(s4-0 0)
|
||||
)
|
||||
(dotimes (s3-0 (-> this length))
|
||||
(let ((v1-2 (-> this data s3-0)))
|
||||
(+! s5-0 (-> v1-2 used))
|
||||
(+! s4-0 (-> v1-2 total))
|
||||
(format
|
||||
#t
|
||||
"~3D: ~20S ~7D ~8D ~8D~%"
|
||||
s3-0
|
||||
(-> v1-2 name)
|
||||
(-> v1-2 count)
|
||||
(-> v1-2 used)
|
||||
(-> v1-2 total)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format #t "total: ~8D ~8D~%" s5-0 s4-0)
|
||||
)
|
||||
(format #t "-------------------------------------------------------------~%")
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 8 of type object
|
||||
(defmethod mem-usage ((this object) (usage memory-usage-block) (flags int))
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 10 of type memory-usage-block
|
||||
(defmethod calculate-total ((this memory-usage-block))
|
||||
(let ((v0-0 0))
|
||||
(dotimes (v1-0 (-> this length))
|
||||
(+! v0-0 (-> this data v1-0 total))
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 9 of type memory-usage-block
|
||||
(defmethod reset! ((this memory-usage-block))
|
||||
(set! (-> this length) 0)
|
||||
(dotimes (v1-0 113)
|
||||
(set! (-> this data v1-0 used) 0)
|
||||
(set! (-> this data v1-0 total) 0)
|
||||
(set! (-> this data v1-0 count) 0)
|
||||
)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for function mem-size
|
||||
(defun mem-size ((arg0 basic) (arg1 symbol) (arg2 int))
|
||||
(let ((gp-0 (new 'stack 'memory-usage-block)))
|
||||
(mem-usage arg0 gp-0 arg2)
|
||||
(if arg1
|
||||
(inspect gp-0)
|
||||
)
|
||||
(calculate-total gp-0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 14 of type level
|
||||
(defmethod compute-memory-usage! ((this level) (arg0 symbol))
|
||||
(if (zero? (-> this mem-usage-block))
|
||||
(set! (-> this mem-usage-block) (new 'debug 'memory-usage-block))
|
||||
)
|
||||
(set! arg0 (or (zero? (-> this mem-usage-block length)) arg0))
|
||||
(when arg0
|
||||
(mem-usage this (reset! (-> this mem-usage-block)) 0)
|
||||
(set! (-> this mem-usage) (calculate-total (-> this mem-usage-block)))
|
||||
0
|
||||
)
|
||||
(-> this mem-usage-block)
|
||||
)
|
||||
|
||||
;; definition for method 8 of type process-tree
|
||||
(defmethod mem-usage ((this process-tree) (usage memory-usage-block) (flags int))
|
||||
(let ((s3-0 91))
|
||||
(let* ((s2-0 *dead-pool-list*)
|
||||
(a0-1 (car s2-0))
|
||||
)
|
||||
(while (not (null? s2-0))
|
||||
(set! (-> usage data s3-0 name) (symbol->string-debug (the-as symbol a0-1)))
|
||||
(+! s3-0 1)
|
||||
(set! s2-0 (cdr s2-0))
|
||||
(set! a0-1 (car s2-0))
|
||||
)
|
||||
)
|
||||
(set! (-> usage length) (max (-> usage length) s3-0))
|
||||
)
|
||||
(set! (-> usage data 97 name) "*debug-dead-pool*")
|
||||
(set! *temp-mem-usage* usage)
|
||||
(when (logtest? flags 32)
|
||||
(let* ((s5-1 91)
|
||||
(s4-1 *dead-pool-list*)
|
||||
(v1-10 (car s4-1))
|
||||
)
|
||||
(while (not (null? s4-1))
|
||||
(let ((a0-4 (-> (the-as symbol v1-10) value)))
|
||||
(set! *global-search-count* s5-1)
|
||||
(iterate-process-tree
|
||||
(the-as process-tree a0-4)
|
||||
(lambda ((arg0 basic))
|
||||
(let ((gp-0 *temp-mem-usage*)
|
||||
(s5-0 *global-search-count*)
|
||||
)
|
||||
(+! (-> gp-0 data s5-0 used) 1)
|
||||
(+! (-> gp-0 data s5-0 total) (logand -16 (+ (asize-of arg0) 15)))
|
||||
)
|
||||
#t
|
||||
)
|
||||
*null-kernel-context*
|
||||
)
|
||||
)
|
||||
(+! s5-1 1)
|
||||
(set! s4-1 (cdr s4-1))
|
||||
(set! v1-10 (car s4-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(iterate-process-tree
|
||||
this
|
||||
(lambda ((arg0 process-drawable))
|
||||
(let ((gp-0 *temp-mem-usage*))
|
||||
(let ((s4-0 (cond
|
||||
((= (-> arg0 pool) *8k-dead-pool*)
|
||||
92
|
||||
)
|
||||
((= (-> arg0 pool) *16k-dead-pool*)
|
||||
93
|
||||
)
|
||||
((= (-> arg0 pool) *nk-dead-pool*)
|
||||
94
|
||||
)
|
||||
((= (-> arg0 pool) *target-dead-pool*)
|
||||
95
|
||||
)
|
||||
((= (-> arg0 pool) *camera-dead-pool*)
|
||||
96
|
||||
)
|
||||
((= (-> arg0 pool) *debug-dead-pool*)
|
||||
97
|
||||
)
|
||||
(else
|
||||
91
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! (-> gp-0 data s4-0 count) 1)
|
||||
(+! (-> gp-0 data s4-0 total) (logand -16 (+ (asize-of arg0) 15)))
|
||||
)
|
||||
(set! (-> gp-0 length) (max 99 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 98 name) "process-active")
|
||||
(+! (-> gp-0 data 98 count) 1)
|
||||
(let ((v1-23 (asize-of arg0)))
|
||||
(+! (-> gp-0 data 98 used) v1-23)
|
||||
(+! (-> gp-0 data 98 total) (logand -16 (+ v1-23 15)))
|
||||
)
|
||||
(set! (-> gp-0 length) (max 100 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 99 name) "heap-total")
|
||||
(+! (-> gp-0 data 99 count) 1)
|
||||
(let ((v1-34 (+ (- -4 (the-as int arg0)) (the-as int (-> arg0 heap-cur)))))
|
||||
(+! (-> gp-0 data 99 used) v1-34)
|
||||
(+! (-> gp-0 data 99 total) (logand -16 (+ v1-34 15)))
|
||||
)
|
||||
(set! (-> gp-0 length) (max 101 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 100 name) "heap-process")
|
||||
(+! (-> gp-0 data 100 count) 1)
|
||||
(let ((v1-45 (- (-> arg0 type size) (-> arg0 type heap-base))))
|
||||
(+! (-> gp-0 data 100 used) v1-45)
|
||||
(+! (-> gp-0 data 100 total) (logand -16 (+ v1-45 15)))
|
||||
)
|
||||
(set! (-> gp-0 length) (max 102 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 101 name) "heap-header")
|
||||
(+! (-> gp-0 data 101 count) 1)
|
||||
(let ((v1-55 (-> arg0 type heap-base)))
|
||||
(+! (-> gp-0 data 101 used) v1-55)
|
||||
(+! (-> gp-0 data 101 total) (logand -16 (+ v1-55 15)))
|
||||
)
|
||||
(set! (-> gp-0 length) (max 103 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 102 name) "heap-thread")
|
||||
(+! (-> gp-0 data 102 count) 1)
|
||||
(let ((v1-65 (asize-of (-> arg0 main-thread))))
|
||||
(+! (-> gp-0 data 102 used) v1-65)
|
||||
(+! (-> gp-0 data 102 total) (logand -16 (+ v1-65 15)))
|
||||
)
|
||||
(when (type? arg0 process-drawable)
|
||||
(when (nonzero? (-> arg0 root))
|
||||
(set! (-> gp-0 length) (max 104 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 103 name) "heap-root")
|
||||
(+! (-> gp-0 data 103 count) 1)
|
||||
(let ((v1-78 (asize-of (-> arg0 root))))
|
||||
(+! (-> gp-0 data 103 used) v1-78)
|
||||
(+! (-> gp-0 data 103 total) (logand -16 (+ v1-78 15)))
|
||||
)
|
||||
(when (type? (-> arg0 root) collide-shape)
|
||||
(set! (-> gp-0 length) (max 110 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 109 name) "heap-collide-prim")
|
||||
(+! (-> gp-0 data 109 count) 1)
|
||||
(let ((v1-90 (asize-of (-> (the-as collide-shape-moving (-> arg0 root)) root-prim))))
|
||||
(+! (-> gp-0 data 109 used) v1-90)
|
||||
(+! (-> gp-0 data 109 total) (logand -16 (+ v1-90 15)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 node-list))
|
||||
(set! (-> gp-0 length) (max 107 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 106 name) "heap-cspace")
|
||||
(+! (-> gp-0 data 106 count) 1)
|
||||
(let ((v1-102 (asize-of (-> arg0 node-list))))
|
||||
(+! (-> gp-0 data 106 used) v1-102)
|
||||
(+! (-> gp-0 data 106 total) (logand -16 (+ v1-102 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 draw))
|
||||
(set! (-> gp-0 length) (max 105 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 104 name) "heap-draw-control")
|
||||
(+! (-> gp-0 data 104 count) 1)
|
||||
(let ((v1-114 (asize-of (-> arg0 draw))))
|
||||
(+! (-> gp-0 data 104 used) v1-114)
|
||||
(+! (-> gp-0 data 104 total) (logand -16 (+ v1-114 15)))
|
||||
)
|
||||
(when (nonzero? (-> arg0 draw skeleton))
|
||||
(set! (-> gp-0 length) (max 108 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 107 name) "heap-bone")
|
||||
(+! (-> gp-0 data 107 count) 1)
|
||||
(let ((v1-128 (asize-of (-> arg0 draw skeleton))))
|
||||
(+! (-> gp-0 data 107 used) v1-128)
|
||||
(+! (-> gp-0 data 107 total) (logand -16 (+ v1-128 15)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 skel))
|
||||
(set! (-> gp-0 length) (max 106 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 105 name) "heap-joint-control")
|
||||
(+! (-> gp-0 data 105 count) 1)
|
||||
(let ((v1-140 (asize-of (-> arg0 skel))))
|
||||
(+! (-> gp-0 data 105 used) v1-140)
|
||||
(+! (-> gp-0 data 105 total) (logand -16 (+ v1-140 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 part))
|
||||
(set! (-> gp-0 length) (max 109 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 108 name) "heap-part")
|
||||
(+! (-> gp-0 data 108 count) 1)
|
||||
(let ((v1-152 (asize-of (-> arg0 part))))
|
||||
(+! (-> gp-0 data 108 used) v1-152)
|
||||
(+! (-> gp-0 data 108 total) (logand -16 (+ v1-152 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 nav))
|
||||
(set! (-> gp-0 length) (max 111 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 110 name) "heap-misc")
|
||||
(+! (-> gp-0 data 110 count) 1)
|
||||
(let ((v1-164 (asize-of (-> arg0 nav))))
|
||||
(+! (-> gp-0 data 110 used) v1-164)
|
||||
(+! (-> gp-0 data 110 total) (logand -16 (+ v1-164 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 path))
|
||||
(set! (-> gp-0 length) (max 111 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 110 name) "heap-misc")
|
||||
(+! (-> gp-0 data 110 count) 1)
|
||||
(let ((v1-176 (asize-of (-> arg0 path))))
|
||||
(+! (-> gp-0 data 110 used) v1-176)
|
||||
(+! (-> gp-0 data 110 total) (logand -16 (+ v1-176 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> arg0 vol))
|
||||
(set! (-> gp-0 length) (max 111 (-> gp-0 length)))
|
||||
(set! (-> gp-0 data 110 name) "heap-misc")
|
||||
(+! (-> gp-0 data 110 count) 1)
|
||||
(let ((v1-188 (asize-of (-> arg0 vol))))
|
||||
(+! (-> gp-0 data 110 used) v1-188)
|
||||
(+! (-> gp-0 data 110 total) (logand -16 (+ v1-188 15)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#t
|
||||
)
|
||||
*null-kernel-context*
|
||||
)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for symbol *max-dma*, type int
|
||||
(define *max-dma* 0)
|
||||
|
||||
;; definition for method 11 of type memory-usage-block
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod print-mem-usage ((this memory-usage-block) (arg0 level) (arg1 object))
|
||||
(local-vars (sv-16 object) (sv-32 string) (sv-48 symbol))
|
||||
(let ((s3-0 (&- (-> arg0 heap current) (the-as uint (-> arg0 heap base)))))
|
||||
(let ((v1-2 (+ (-> this data 62 total) (-> this data 63 total))))
|
||||
(< #x10000 v1-2)
|
||||
)
|
||||
(let* ((v1-4 (-> arg0 info memory-mode))
|
||||
(v1-5
|
||||
(cond
|
||||
((= v1-4 (level-memory-mode large))
|
||||
#xbd0000
|
||||
)
|
||||
((= v1-4 (level-memory-mode medium))
|
||||
#x8fb800
|
||||
)
|
||||
((or (= v1-4 (level-memory-mode small-center)) (= v1-4 (level-memory-mode city-center)))
|
||||
#x627000
|
||||
)
|
||||
((or (= v1-4 (level-memory-mode borrow))
|
||||
(= v1-4 (level-memory-mode borrow0))
|
||||
(= v1-4 (level-memory-mode borrow1))
|
||||
(= v1-4 (level-memory-mode borrow2))
|
||||
(= v1-4 (level-memory-mode borrow3))
|
||||
(= v1-4 (level-memory-mode borrow4))
|
||||
(= v1-4 (level-memory-mode borrow-city-small))
|
||||
)
|
||||
(+ (- #xc000 (the-as int (-> arg0 heap base))) (the-as int (-> arg0 heap top-base)))
|
||||
)
|
||||
((or (= v1-4 (level-memory-mode tiny-center))
|
||||
(= v1-4 (level-memory-mode tiny-edge))
|
||||
(= v1-4 (level-memory-mode city-tiny-edge))
|
||||
(= v1-4 (level-memory-mode tiny))
|
||||
)
|
||||
#x3f0000
|
||||
)
|
||||
((= v1-4 (level-memory-mode micro))
|
||||
#x1f8000
|
||||
)
|
||||
((= v1-4 (level-memory-mode tiny-center-micro))
|
||||
#x2f4000
|
||||
)
|
||||
((= v1-4 (level-memory-mode tiny-center-small))
|
||||
#x4ec000
|
||||
)
|
||||
(else
|
||||
#x5e8000
|
||||
)
|
||||
)
|
||||
)
|
||||
(a0-25 (-> arg0 info memory-mode))
|
||||
(v1-8
|
||||
(- (the-as int v1-5)
|
||||
(the-as
|
||||
uint
|
||||
(if (or (= a0-25 (level-memory-mode tiny-center)) (or (= a0-25 (level-memory-mode tiny-edge))
|
||||
(= a0-25 (level-memory-mode city-tiny-edge))
|
||||
(= a0-25 (level-memory-mode tiny))
|
||||
)
|
||||
)
|
||||
#x24000
|
||||
#xc000
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(a0-28 0)
|
||||
)
|
||||
(when (-> arg0 info borrow)
|
||||
(dotimes (a1-21 5)
|
||||
(+! a0-28 (-> arg0 info borrow borrow-size a1-21))
|
||||
)
|
||||
)
|
||||
(let ((s1-0 (- v1-8 (shl a0-28 10)))
|
||||
(s2-0 (* (dma-buffer-length (-> *display* frames (-> *display* last-screen) global-buf)) 16))
|
||||
)
|
||||
(set! *max-dma* (max s2-0 *max-dma*))
|
||||
(if (< (- s1-0 (the-as int (shl (-> arg0 info buffer-size) 10))) s3-0)
|
||||
(format arg1 "~3L")
|
||||
)
|
||||
(let ((s0-0 format))
|
||||
(set! sv-16 arg1)
|
||||
(set! sv-32 "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--")
|
||||
(set! sv-48 (-> arg0 name))
|
||||
(let* ((s3-1 (sar s3-0 10))
|
||||
(s4-1 (- (sar s1-0 10) (the-as int (-> arg0 info buffer-size))))
|
||||
(s1-1 (sar (memory-used *nk-dead-pool*) 10))
|
||||
(t2-0 (sar (memory-total *nk-dead-pool*) 10))
|
||||
(t0-0 s4-1)
|
||||
(t1-0 s1-1)
|
||||
)
|
||||
(s0-0 sv-16 sv-32 sv-48 s3-1 t0-0 t1-0 t2-0)
|
||||
(format arg1 "~5,'-DK/~5,'-DK--~%" (shr s2-0 10) (sar *max-dma* 10))
|
||||
(when *stats-memory-short*
|
||||
(let ((s3-2 (if (cpad-hold? 1 l3)
|
||||
#t
|
||||
arg1
|
||||
)
|
||||
)
|
||||
(s4-2 format)
|
||||
(s2-1 "heap-~5,'-DK/~5,'-DK----~D---~D/~D~%")
|
||||
(s1-2 (sar (memory-used *nk-dead-pool*) 10))
|
||||
(s0-1 (sar (memory-total *nk-dead-pool*) 10))
|
||||
)
|
||||
(set! t0-0 (the-as int (compact-time *nk-dead-pool*)))
|
||||
(set! t1-0 (the-as int (-> *nk-dead-pool* compact-count)))
|
||||
(set! t2-0 (the-as int (-> *nk-dead-pool* compact-count-targ)))
|
||||
(s4-2 s3-2 s2-1 s1-2 s0-1 (the-as uint t0-0) (the-as uint t1-0) (the-as uint t2-0))
|
||||
)
|
||||
)
|
||||
(when (not *stats-memory-short*)
|
||||
(set! (-> *dma-mem-usage* data 88 total)
|
||||
(* (dma-buffer-length (-> *display* frames (-> *display* last-screen) debug-buf)) 16)
|
||||
)
|
||||
(let ((t9-11 format)
|
||||
(a0-47 arg1)
|
||||
(a1-28 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%")
|
||||
(a2-12 (sar (+ (-> this data 59 total) (-> this data 60 total) (-> this data 61 total)) 10))
|
||||
(a3-5 (sar (-> *dma-mem-usage* data 88 total) 10))
|
||||
)
|
||||
(t9-11 a0-47 a1-28 a2-12 a3-5 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0))
|
||||
(format
|
||||
arg1
|
||||
" bsp-leaf-vis ~192H~5DK~%"
|
||||
(sar (+ (-> this data 62 total) (-> this data 63 total)) 10)
|
||||
(the-as none a3-5)
|
||||
)
|
||||
(format arg1 " level-code ~192H~5DK~%" (sar (-> this data 66 total) 10) (the-as none a3-5))
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" tfrag ~192H~5DK ~280Htfragment~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 1 total)
|
||||
(-> this data 2 total)
|
||||
(-> this data 3 total)
|
||||
(-> this data 4 total)
|
||||
(-> this data 5 total)
|
||||
(-> this data 6 total)
|
||||
(-> this data 7 total)
|
||||
(-> this data 8 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 1 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" tie-proto ~192H~5DK ~280Hsky~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 9 total)
|
||||
(-> this data 10 total)
|
||||
(-> this data 11 total)
|
||||
(-> this data 12 total)
|
||||
(-> this data 13 total)
|
||||
(-> this data 14 total)
|
||||
(-> this data 16 total)
|
||||
(-> this data 17 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 89 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%"
|
||||
(sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10)
|
||||
(sar (-> *dma-mem-usage* data 9 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 25 total)
|
||||
(-> this data 26 total)
|
||||
(-> this data 27 total)
|
||||
(-> this data 28 total)
|
||||
(-> this data 29 total)
|
||||
(-> this data 30 total)
|
||||
(-> this data 31 total)
|
||||
(-> this data 32 total)
|
||||
(-> this data 33 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 15 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%"
|
||||
(sar (-> this data 34 total) 10)
|
||||
(sar (-> *dma-mem-usage* data 27 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" hfragment ~192H~5DK ~280Hhfragment~456H~5DK~%"
|
||||
(sar (-> this data 43 total) 10)
|
||||
(sar (-> *dma-mem-usage* data 43 total) 10)
|
||||
(the-as none t0-0)
|
||||
(the-as none t1-0)
|
||||
(the-as none t2-0)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" collision ~192H~5DK ~280Htie-generic~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 51 total)
|
||||
(-> this data 52 total)
|
||||
(-> this data 53 total)
|
||||
(-> this data 54 total)
|
||||
(-> this data 55 total)
|
||||
(-> this data 56 total)
|
||||
(-> this data 57 total)
|
||||
(-> this data 58 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 17 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 35 total)
|
||||
(-> this data 36 total)
|
||||
(-> this data 37 total)
|
||||
(-> this data 38 total)
|
||||
(-> this data 39 total)
|
||||
(-> this data 40 total)
|
||||
(-> this data 41 total)
|
||||
(-> this data 42 total)
|
||||
(-> this data 74 total)
|
||||
(-> this data 75 total)
|
||||
(-> this data 76 total)
|
||||
(-> this data 77 total)
|
||||
(-> this data 79 total)
|
||||
(-> this data 82 total)
|
||||
(-> this data 81 total)
|
||||
(-> this data 112 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 35 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 68 total)
|
||||
(-> this data 69 total)
|
||||
(-> this data 70 total)
|
||||
(-> this data 71 total)
|
||||
(-> this data 72 total)
|
||||
(-> this data 78 total)
|
||||
(-> this data 80 total)
|
||||
(-> this data 73 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 90 total) 10)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" textures ~192H~5DK ~280Htextures~456H~5DK~%"
|
||||
(sar (-> this data 83 total) 10)
|
||||
(sar (-> *dma-mem-usage* data 83 total) 10)
|
||||
)
|
||||
(format arg1 " entity ~192H~5DK~%" (sar
|
||||
(+ (-> this data 67 total)
|
||||
(-> this data 44 total)
|
||||
(-> this data 45 total)
|
||||
(-> this data 46 total)
|
||||
(-> this data 50 total)
|
||||
(-> this data 49 total)
|
||||
(-> this data 47 total)
|
||||
(-> this data 48 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
)
|
||||
(format
|
||||
arg1
|
||||
" misc ~192H~5DK ~280Hsprite~456H~5DK~%"
|
||||
(sar
|
||||
(+ (-> this data 0 total)
|
||||
(-> this data 64 total)
|
||||
(-> this data 65 total)
|
||||
(-> this data 84 total)
|
||||
(-> this data 85 total)
|
||||
)
|
||||
10
|
||||
)
|
||||
(sar (-> *dma-mem-usage* data 86 total) 10)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format arg1 "~1K~0L")
|
||||
this
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
;; definition for symbol *sampler-mem*, type pointer
|
||||
(define *sampler-mem* (the-as pointer #f))
|
||||
|
||||
;; definition for symbol *sampler-compare*, type uint
|
||||
(define *sampler-compare* (the-as uint 1))
|
||||
|
||||
;; definition for symbol *sampler-count*, type int
|
||||
(define *sampler-count* 0)
|
||||
|
||||
;; definition (debug) for function timer0-handler
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> (the-as timer-bank #x10000000) mode) (new 'static 'timer-mode))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(install-handler 9 timer0-handler)
|
||||
|
||||
;; definition (debug) for function sampler-start
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun-debug sampler-start ()
|
||||
(set! (-> (the-as timer-bank #x10000000) mode) (new 'static 'timer-mode))
|
||||
(set! (-> (the-as timer-bank #x10000000) count) (the-as uint 0))
|
||||
(set! (-> (the-as timer-bank #x10000000) comp) *sampler-compare*)
|
||||
(if (not *sampler-mem*)
|
||||
(set! *sampler-mem* (malloc 'debug #x1000000))
|
||||
)
|
||||
(when (nonzero? *sampler-mem*)
|
||||
(mem-set32! *sampler-mem* #x400000 0)
|
||||
(set! (-> (the-as timer-bank #x10000000) mode)
|
||||
(new 'static 'timer-mode :clks (timer-clock-selection busclk/256) :zret #x1 :cue #x1 :cmpe #x1 :equf #x1)
|
||||
)
|
||||
(set! *sampler-count* 0)
|
||||
0
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition (debug) for function sampler-stop
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun-debug sampler-stop ()
|
||||
(set! (-> (the-as timer-bank #x10000000) mode) (new 'static 'timer-mode))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(setup-font-texture *texture-pool*)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(let ((v1-2 (get-texture skull-gem-dest programmer)))
|
||||
(when v1-2
|
||||
(set! (-> v1-2 w) 32)
|
||||
(set! (-> v1-2 h) 32)
|
||||
(set! (-> v1-2 dest 0) (-> *skull-gem-texture-base* vram-block))
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(init! *sky-texture-anim-array*)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(init! *darkjak-texture-anim-array*)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(init! *skull-gem-texture-anim-array*)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(init! *default-water-texture-anim-array*)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(init! *default-warp-texture-anim-array*)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(kmemclose)
|
||||
|
||||
|
||||
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *generic-envmap-texture*, type texture
|
||||
(define *generic-envmap-texture* (get-texture pal-environment-front environment-generic))
|
||||
|
||||
;; definition for symbol *default-envmap-shader*, type adgif-shader
|
||||
(define *default-envmap-shader* (new 'global 'adgif-shader))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(let ((gp-0 *default-envmap-shader*))
|
||||
(let ((a1-1 *generic-envmap-texture*))
|
||||
(adgif-shader<-texture! gp-0 a1-1)
|
||||
)
|
||||
(set! (-> gp-0 tex1) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(set! (-> gp-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
|
||||
(set! (-> gp-0 alpha) (new 'static 'gs-miptbp :tbp1 #x58))
|
||||
(set! (-> gp-0 prims 1) (gs-reg64 tex0-1))
|
||||
(set! (-> gp-0 prims 3) (gs-reg64 tex1-1))
|
||||
(set! (-> gp-0 prims 5) (gs-reg64 miptbp1-1))
|
||||
(set! (-> gp-0 clamp-reg) (gs-reg64 clamp-1))
|
||||
(set! (-> gp-0 prims 9) (gs-reg64 alpha-1))
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(kmemopen global "tpages")
|
||||
|
||||
|
||||
|
||||
|
||||
+685
@@ -0,0 +1,685 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
;; definition for function probe-for-clear-collision?
|
||||
;; INFO: Used lq/sq
|
||||
(defun probe-for-clear-collision? ((arg0 vector) (arg1 vector))
|
||||
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
|
||||
(vector-copy! (-> s5-0 start-pos) arg0)
|
||||
(vector-! (-> s5-0 move-dist) arg1 arg0)
|
||||
(let ((v1-2 s5-0))
|
||||
(set! (-> v1-2 radius) 4096.0)
|
||||
(set! (-> v1-2 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-2 ignore-process0) #f)
|
||||
(set! (-> v1-2 ignore-process1) #f)
|
||||
(set! (-> v1-2 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-2 action-mask) (collide-action solid))
|
||||
)
|
||||
(when (< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s4-0 arg0)
|
||||
(let* ((f0-2 (vector-vector-distance s4-0 arg1))
|
||||
(s3-1 (+ (the int (/ f0-2 (meters 30))) 1))
|
||||
(s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) 110592.0))
|
||||
)
|
||||
(dotimes (s1-0 s3-1)
|
||||
(vector-copy! (-> s5-0 start-pos) s4-0)
|
||||
(vector-! (-> s5-0 move-dist) arg1 s4-0)
|
||||
(if (< 122880.0 (vector-length (-> s5-0 move-dist)))
|
||||
(vector-normalize! (-> s5-0 move-dist) 122880.0)
|
||||
)
|
||||
(let ((v1-15 s5-0))
|
||||
(set! (-> v1-15 radius) 12288.0)
|
||||
(set! (-> v1-15 collide-with) (collide-spec backgnd))
|
||||
(set! (-> v1-15 ignore-process0) #f)
|
||||
(set! (-> v1-15 ignore-process1) #f)
|
||||
(set! (-> v1-15 ignore-pat)
|
||||
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
|
||||
)
|
||||
(set! (-> v1-15 action-mask) (collide-action solid))
|
||||
)
|
||||
(if (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0)
|
||||
(return #f)
|
||||
)
|
||||
(vector+! s4-0 s4-0 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function hover-nav-graph-process-points
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun hover-nav-graph-process-points ()
|
||||
(local-vars (v1-10 symbol))
|
||||
(let ((v1-0 (get-nav-graph-editor)))
|
||||
(when v1-0
|
||||
(let* ((gp-0 (-> v1-0 nav-graph))
|
||||
(s5-0 (-> gp-0 node-array length))
|
||||
)
|
||||
(dotimes (s4-0 s5-0)
|
||||
(let ((s3-0 (+ (the-as uint (-> gp-0 node-array data 0 position)) (* 80 s4-0))))
|
||||
(when (< s4-0 (+ s5-0 -1))
|
||||
(let ((s2-0 (+ s4-0 1)))
|
||||
(while (< s2-0 s5-0)
|
||||
(let ((s1-0 (+ (the-as uint (-> gp-0 node-array data 0 position)) (* 80 s2-0))))
|
||||
(dotimes (v1-8 (-> gp-0 edge-array length))
|
||||
(let* ((a1-1 (-> gp-0 edge-array data v1-8))
|
||||
(a0-8 (-> a1-1 runtime-node-id-1))
|
||||
(a1-2 (-> a1-1 runtime-node-id-2))
|
||||
)
|
||||
(when (or (and (= s4-0 a0-8) (= s2-0 a1-2)) (and (= s4-0 a1-2) (= s2-0 a0-8)))
|
||||
(set! v1-10 #t)
|
||||
(goto cfg-19)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! v1-10 #f)
|
||||
(label cfg-19)
|
||||
(when (not v1-10)
|
||||
(when (and (< (vector-vector-distance (the-as vector s3-0) (the-as vector s1-0)) 204800.0)
|
||||
(probe-for-clear-collision? (the-as vector s3-0) (the-as vector s1-0))
|
||||
(probe-for-clear-collision? (the-as vector s1-0) (the-as vector s3-0))
|
||||
)
|
||||
(let ((v1-17 (alloc-new-edge! gp-0)))
|
||||
(when (!= v1-17 -1)
|
||||
(let ((v1-20 (-> gp-0 edge-array data v1-17)))
|
||||
(set! (-> v1-20 runtime-node-id-1) s4-0)
|
||||
(set! (-> v1-20 runtime-node-id-2) s2-0)
|
||||
(set! (-> v1-20 directionality) (nav-directionality bi_directional))
|
||||
(set! (-> v1-20 speed_limit) 122880.0)
|
||||
(set! (-> v1-20 density) 1.0)
|
||||
(set! (-> v1-20 traffic_edge_flag) 0)
|
||||
(set! (-> v1-20 nav_clock_mask) (nav-clock-mask))
|
||||
(set! (-> v1-20 nav_clock_type) (nav-clock-type no-clock))
|
||||
(set! (-> v1-20 width) 0.0)
|
||||
(set! (-> v1-20 minimap_edge_flag) (nav-minimap-edge-flag))
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s2-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function hover-nav-graph-output
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch file-stream vs object.
|
||||
(defun hover-nav-graph-output ((arg0 string))
|
||||
(local-vars
|
||||
(sv-96 vector)
|
||||
(sv-112 vector)
|
||||
(sv-128 int)
|
||||
(sv-144 int)
|
||||
(sv-160 (function _varargs_ object))
|
||||
(sv-176 string)
|
||||
(sv-192 string)
|
||||
(sv-208 int)
|
||||
(sv-224 (function _varargs_ object))
|
||||
(sv-240 string)
|
||||
(sv-256 string)
|
||||
(sv-272 int)
|
||||
)
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector))
|
||||
(gp-0 (new 'debug 'string #x7a120 (the-as string #f)))
|
||||
)
|
||||
(let ((s3-0 (clear *temp-string*)))
|
||||
(format s3-0 "select translate_x,translate_y,translate_z from level_info where name='~S'" arg0)
|
||||
(format 0 "~S~%" s3-0)
|
||||
(let ((s2-0 (sql-query s3-0)))
|
||||
(when (!= (-> s2-0 content-type) 'select)
|
||||
(format 0 "ERROR: sql: select error ~A~%" s2-0)
|
||||
(return (the-as object #f))
|
||||
)
|
||||
(set-vector!
|
||||
s4-0
|
||||
(* 4096.0 (string->float (the-as string (-> s2-0 sql-data 0))))
|
||||
(* 4096.0 (string->float (the-as string (-> s2-0 sql-data 1))))
|
||||
(* 4096.0 (string->float (the-as string (-> s2-0 sql-data 2))))
|
||||
1.0
|
||||
)
|
||||
)
|
||||
)
|
||||
(format 0 "level offset: ~m ~m ~m~%" (-> s4-0 x) (-> s4-0 y) (-> s4-0 z))
|
||||
(let ((s3-2 (new 'debug 'mysql-nav-graph (the-as string 'hover))))
|
||||
(when (or (not s3-2) (not (init-from-sql! s3-2 'hover arg0)))
|
||||
(format 0 "ERROR: Failed to load hover graph (level ~s) from MySQL!~%" arg0)
|
||||
(return (the-as object #f))
|
||||
)
|
||||
(format gp-0 ";-*-Lisp-*-~%(in-package goal)~%~%;;~%")
|
||||
(format
|
||||
gp-0
|
||||
";; WARNING: This file was generated by running (hover-nav-graph-output ...) found in hover-nav-edit.gc.~%;;~%~%"
|
||||
)
|
||||
(format gp-0 "(def-nav-network-adjacency-table *~S-adjacency*~% (~%" arg0)
|
||||
(let ((s2-1 (-> s3-2 node-array length))
|
||||
(s1-0 0)
|
||||
)
|
||||
(dotimes (s0-0 s2-1)
|
||||
(when (nonzero? (-> s3-2 node-array data s0-0 nav_node_id))
|
||||
(set! sv-96 (new 'stack-no-clear 'vector))
|
||||
(let ((v1-22 (+ (the-as uint (-> s3-2 node-array data 0 position)) (* 80 s0-0)))
|
||||
(a0-22 s4-0)
|
||||
)
|
||||
(.mov.vf.w vf6 vf0)
|
||||
(.lvf vf4 (&-> (the-as (pointer int128) v1-22)))
|
||||
(.lvf vf5 (&-> a0-22 quad))
|
||||
)
|
||||
(.add.vf.xyz vf6 vf4 vf5)
|
||||
(.svf (&-> sv-96 quad) vf6)
|
||||
(set! sv-112 (new 'stack-no-clear 'vector))
|
||||
(format gp-0 " (~d (~m ~m ~m) (" s1-0 (-> sv-96 x) (-> sv-96 y) (-> sv-96 z))
|
||||
(set! sv-128 0)
|
||||
(while (< sv-128 (-> s3-2 edge-array length))
|
||||
(let ((v1-32 (-> s3-2 edge-array data sv-128)))
|
||||
(set! sv-272 (-> v1-32 runtime-node-id-1))
|
||||
(set! sv-144 (-> v1-32 runtime-node-id-2))
|
||||
)
|
||||
(when (= s0-0 sv-272)
|
||||
(vector+! sv-112 (the-as vector (+ (the-as uint (-> s3-2 node-array data 0 position)) (* 80 sv-144))) s4-0)
|
||||
(set! sv-160 format)
|
||||
(set! sv-176 gp-0)
|
||||
(set! sv-192 "(~d ~m) ")
|
||||
(set! sv-208 sv-144)
|
||||
(let ((a3-3 (vector-vector-distance sv-96 sv-112)))
|
||||
(sv-160 sv-176 sv-192 sv-208 a3-3)
|
||||
)
|
||||
)
|
||||
(when (= s0-0 sv-144)
|
||||
(vector+! sv-112 (the-as vector (+ (the-as uint (-> s3-2 node-array data 0 position)) (* 80 sv-272))) s4-0)
|
||||
(set! sv-224 format)
|
||||
(set! sv-240 gp-0)
|
||||
(set! sv-256 "(~d ~m) ")
|
||||
(let ((a3-4 (vector-vector-distance sv-96 sv-112)))
|
||||
(sv-224 sv-240 sv-256 sv-272 a3-4)
|
||||
)
|
||||
)
|
||||
(set! sv-128 (+ sv-128 1))
|
||||
)
|
||||
(format gp-0 "))~%")
|
||||
(+! s1-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format gp-0 " )~% (")
|
||||
(dotimes (s4-1 (-> s3-2 edge-array length))
|
||||
(let ((v1-58 (-> s3-2 edge-array data s4-1)))
|
||||
(format
|
||||
gp-0
|
||||
"(~d ~d ~m) "
|
||||
(-> v1-58 runtime-node-id-1)
|
||||
(-> v1-58 runtime-node-id-2)
|
||||
(if (!= 0.0 (-> v1-58 width))
|
||||
(-> v1-58 width)
|
||||
#x46800000
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (= (logand (+ s4-1 -1) 7) 7)
|
||||
(format gp-0 "~% ")
|
||||
)
|
||||
)
|
||||
)
|
||||
(format gp-0 ")~%")
|
||||
(format gp-0 " )~%")
|
||||
(format (clear *temp-string*) "game/hover-nav-graph-~s.gc" arg0)
|
||||
*temp-string*
|
||||
(format 0 "Writing nav-graph as file ~S...~%" *temp-string*)
|
||||
(let ((s5-1 (new 'stack 'file-stream *temp-string* 'write)))
|
||||
(format s5-1 gp-0)
|
||||
(file-stream-close s5-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for symbol *axes-table*, type (array vector)
|
||||
(define *axes-table* (new 'static 'boxed-array :type vector
|
||||
(new 'static 'vector :x 1.0 :w 1.0)
|
||||
(new 'static 'vector :y 1.0 :w 1.0)
|
||||
(new 'static 'vector :z 1.0 :w 1.0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type hover-nav-bsp-point
|
||||
(deftype hover-nav-bsp-point (list-node)
|
||||
((index int32)
|
||||
(pos vector :inline)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type hover-nav-bsp-point
|
||||
(defmethod inspect ((this hover-nav-bsp-point))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'hover-nav-bsp-point)
|
||||
(format #t "~1Tnext: #<list-node @ #x~X>~%" (-> this next))
|
||||
(format #t "~1Tprev: #<list-node @ #x~X>~%" (-> this prev))
|
||||
(format #t "~1Tindex: ~D~%" (-> this index))
|
||||
(format #t "~1Tpos: #<vector @ #x~X>~%" (-> this pos))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 0 of type hover-nav-bsp-point
|
||||
;; WARN: Return type mismatch structure vs hover-nav-bsp-point.
|
||||
(defmethod new hover-nav-bsp-point ((allocation symbol) (type-to-make type))
|
||||
(let ((t9-0 (method-of-type structure new))
|
||||
(v1-1 type-to-make)
|
||||
)
|
||||
(-> type-to-make size)
|
||||
(let ((v0-0 (t9-0 allocation v1-1)))
|
||||
(set! (-> (the-as hover-nav-bsp-point v0-0) next) #f)
|
||||
(set! (-> (the-as hover-nav-bsp-point v0-0) prev) #f)
|
||||
(the-as hover-nav-bsp-point v0-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type hover-nav-bsp-node
|
||||
(deftype hover-nav-bsp-node (structure)
|
||||
((split-plane vector :inline)
|
||||
(point-list hover-nav-bsp-point)
|
||||
(left hover-nav-bsp-node)
|
||||
(right hover-nav-bsp-node)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_)
|
||||
(hover-nav-bsp-node-method-9 (_type_) none)
|
||||
(hover-nav-bsp-node-method-10 (_type_ int) none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type hover-nav-bsp-node
|
||||
(defmethod inspect ((this hover-nav-bsp-node))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'hover-nav-bsp-node)
|
||||
(format #t "~1Tsplit-plane: #<vector @ #x~X>~%" (-> this split-plane))
|
||||
(format #t "~1Tpoint-list: #<hover-nav-bsp-point @ #x~X>~%" (-> this point-list))
|
||||
(format #t "~1Tleft: #<hover-nav-bsp-node @ #x~X>~%" (-> this left))
|
||||
(format #t "~1Tright: #<hover-nav-bsp-node @ #x~X>~%" (-> this right))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 0 of type hover-nav-bsp-node
|
||||
;; WARN: Return type mismatch structure vs hover-nav-bsp-node.
|
||||
(defmethod new hover-nav-bsp-node ((allocation symbol) (type-to-make type))
|
||||
(let ((t9-0 (method-of-type structure new))
|
||||
(v1-1 type-to-make)
|
||||
)
|
||||
(-> type-to-make size)
|
||||
(let ((v0-0 (t9-0 allocation v1-1)))
|
||||
(set! (-> (the-as hover-nav-bsp-node v0-0) point-list) #f)
|
||||
(set! (-> (the-as hover-nav-bsp-node v0-0) left) #f)
|
||||
(set! (-> (the-as hover-nav-bsp-node v0-0) right) #f)
|
||||
(the-as hover-nav-bsp-node v0-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type hover-nav-bsp
|
||||
(deftype hover-nav-bsp (structure)
|
||||
((root hover-nav-bsp-node)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type hover-nav-bsp
|
||||
(defmethod inspect ((this hover-nav-bsp))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'hover-nav-bsp)
|
||||
(format #t "~1Troot: #<hover-nav-bsp-node @ #x~X>~%" (-> this root))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for method 9 of type hover-nav-bsp-node
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod hover-nav-bsp-node-method-9 ((this hover-nav-bsp-node))
|
||||
(let ((v1-0 (-> this split-plane)))
|
||||
(format #t "((~,,1f ~,,1f ~,,1f ~m)~% " (-> v1-0 x) (-> v1-0 y) (-> v1-0 z) (-> v1-0 w))
|
||||
)
|
||||
(let ((v1-2 (the-as list-node (-> this point-list))))
|
||||
(while v1-2
|
||||
(let ((s5-0 (-> v1-2 next)))
|
||||
(format
|
||||
#t
|
||||
"(~d (~m ~m ~m)) "
|
||||
(-> (the-as hover-nav-bsp-point v1-2) index)
|
||||
(-> (the-as hover-nav-bsp-point v1-2) pos x)
|
||||
(-> (the-as hover-nav-bsp-point v1-2) pos y)
|
||||
(-> (the-as hover-nav-bsp-point v1-2) pos z)
|
||||
)
|
||||
(set! v1-2 s5-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (-> this left)
|
||||
(hover-nav-bsp-node-method-9 (-> this left))
|
||||
)
|
||||
(if (-> this right)
|
||||
(hover-nav-bsp-node-method-9 (-> this right))
|
||||
)
|
||||
(format #t ")~%")
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type hover-nav-bsp-node
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod hover-nav-bsp-node-method-10 ((this hover-nav-bsp-node) (arg0 int))
|
||||
(when (-> this point-list)
|
||||
(format 0 "build-bsp: ")
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector))
|
||||
(s3-0 0)
|
||||
)
|
||||
(let ((v1-2 (the-as list-node (-> this point-list))))
|
||||
(while v1-2
|
||||
(set! v1-2 (-> v1-2 next))
|
||||
(+! s3-0 1)
|
||||
)
|
||||
)
|
||||
(format 0 "count ~d ~%" s3-0)
|
||||
(when (< 1 s3-0)
|
||||
(vector-reset! s4-0)
|
||||
(let ((f0-1 (/ 1.0 (the float s3-0)))
|
||||
(a2-1 (the-as list-node (-> this point-list)))
|
||||
)
|
||||
(while a2-1
|
||||
(let ((v1-9 (-> a2-1 next)))
|
||||
(vector+float*! s4-0 s4-0 (the-as vector (+ (the-as uint a2-1) 16)) f0-1)
|
||||
(set! a2-1 v1-9)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> this split-plane) (-> *axes-table* arg0))
|
||||
(set! (-> this split-plane w) (- (vector-dot s4-0 (-> this split-plane))))
|
||||
(let ((s3-1 (the-as list-node (-> this point-list))))
|
||||
(while s3-1
|
||||
(let ((s4-1 (-> s3-1 next)))
|
||||
(let ((f0-7 (- (vector-dot (the-as vector (+ (the-as uint s3-1) 16)) (-> this split-plane)))))
|
||||
(cond
|
||||
((= f0-7 (-> this split-plane w))
|
||||
)
|
||||
((< f0-7 (-> this split-plane w))
|
||||
(if (not (-> this left))
|
||||
(set! (-> this left) (new 'global 'hover-nav-bsp-node))
|
||||
)
|
||||
(let ((v1-21 s3-1))
|
||||
(let ((a0-12 (&-> this point-list)))
|
||||
(if (= (-> a0-12 0) v1-21)
|
||||
(set! (-> a0-12 0) (the-as hover-nav-bsp-point (-> v1-21 next)))
|
||||
)
|
||||
)
|
||||
(if (-> v1-21 prev)
|
||||
(set! (-> v1-21 prev next) (-> v1-21 next))
|
||||
)
|
||||
(if (-> v1-21 next)
|
||||
(set! (-> v1-21 next prev) (-> v1-21 prev))
|
||||
)
|
||||
(set! (-> v1-21 prev) #f)
|
||||
(set! (-> v1-21 next) #f)
|
||||
)
|
||||
(let ((a0-19 (-> this left point-list))
|
||||
(v1-25 (&-> this left point-list))
|
||||
)
|
||||
(when (zero? s3-1)
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (or (= s3-1 a0-19) (= s3-1 v1-25))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (not (or (not a0-19) (!= (-> a0-19 prev) s3-1)))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when a0-19
|
||||
(set! (-> s3-1 next) a0-19)
|
||||
(set! (-> s3-1 prev) (-> a0-19 prev))
|
||||
(if (-> s3-1 prev)
|
||||
(set! (-> s3-1 prev next) s3-1)
|
||||
)
|
||||
(if (-> s3-1 next)
|
||||
(set! (-> s3-1 next prev) s3-1)
|
||||
)
|
||||
)
|
||||
(if (or (not a0-19) (= a0-19 (-> v1-25 0)))
|
||||
(set! (-> v1-25 0) (the-as hover-nav-bsp-point s3-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(if (not (-> this right))
|
||||
(set! (-> this right) (new 'global 'hover-nav-bsp-node))
|
||||
)
|
||||
(let ((v1-30 s3-1))
|
||||
(let ((a0-22 (&-> this point-list)))
|
||||
(if (= (-> a0-22 0) v1-30)
|
||||
(set! (-> a0-22 0) (the-as hover-nav-bsp-point (-> v1-30 next)))
|
||||
)
|
||||
)
|
||||
(if (-> v1-30 prev)
|
||||
(set! (-> v1-30 prev next) (-> v1-30 next))
|
||||
)
|
||||
(if (-> v1-30 next)
|
||||
(set! (-> v1-30 next prev) (-> v1-30 prev))
|
||||
)
|
||||
(set! (-> v1-30 prev) #f)
|
||||
(set! (-> v1-30 next) #f)
|
||||
)
|
||||
(let ((v1-32 s3-1)
|
||||
(a1-40 (-> this right point-list))
|
||||
(a0-31 (&-> this right point-list))
|
||||
)
|
||||
(when (zero? v1-32)
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (or (= v1-32 a1-40) (= v1-32 a0-31))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (not (or (not a1-40) (!= (-> a1-40 prev) v1-32)))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when a1-40
|
||||
(set! (-> v1-32 next) a1-40)
|
||||
(set! (-> v1-32 prev) (-> a1-40 prev))
|
||||
(if (-> v1-32 prev)
|
||||
(set! (-> v1-32 prev next) v1-32)
|
||||
)
|
||||
(if (-> v1-32 next)
|
||||
(set! (-> v1-32 next prev) v1-32)
|
||||
)
|
||||
)
|
||||
(if (or (not a1-40) (= a1-40 (-> a0-31 0)))
|
||||
(set! (-> a0-31 0) (the-as hover-nav-bsp-point v1-32))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! s3-1 s4-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (-> this left)
|
||||
(hover-nav-bsp-node-method-10 (-> this left) (mod (+ arg0 1) 3))
|
||||
)
|
||||
(if (-> this right)
|
||||
(hover-nav-bsp-node-method-10 (-> this right) (mod (+ arg0 1) 3))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for symbol *hover-bsp*, type hover-nav-bsp
|
||||
(define *hover-bsp* (the-as hover-nav-bsp #f))
|
||||
|
||||
;; definition for function hover-nav-graph-output-bsp
|
||||
;; INFO: Used lq/sq
|
||||
(defun hover-nav-graph-output-bsp ()
|
||||
(let ((v1-0 (get-nav-graph-editor)))
|
||||
(when v1-0
|
||||
(let ((s5-0 (-> v1-0 nav-graph))
|
||||
(gp-0 (new 'global 'hover-nav-bsp))
|
||||
)
|
||||
(let ((s4-0 (-> s5-0 node-array length))
|
||||
(s3-0 0)
|
||||
)
|
||||
(set! (-> gp-0 root) (new 'global 'hover-nav-bsp-node))
|
||||
(dotimes (s2-0 s4-0)
|
||||
(when (nonzero? (-> s5-0 node-array data s2-0 nav_node_id))
|
||||
(let ((v1-9 (new 'global 'hover-nav-bsp-point)))
|
||||
(set! (-> v1-9 index) s3-0)
|
||||
(set! (-> v1-9 pos quad)
|
||||
(-> (the-as (pointer uint128) (+ (the-as uint (-> s5-0 node-array data 0 position)) (* 80 s2-0))))
|
||||
)
|
||||
(let ((a1-7 (-> gp-0 root point-list))
|
||||
(a0-8 (&-> gp-0 root point-list))
|
||||
)
|
||||
(when (zero? v1-9)
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (or (= v1-9 a1-7) (= v1-9 a0-8))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (not (or (not a1-7) (!= (-> a1-7 prev) v1-9)))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when a1-7
|
||||
(set! (-> v1-9 next) a1-7)
|
||||
(set! (-> v1-9 prev) (-> a1-7 prev))
|
||||
(if (-> v1-9 prev)
|
||||
(set! (-> v1-9 prev next) v1-9)
|
||||
)
|
||||
(if (-> v1-9 next)
|
||||
(set! (-> v1-9 next prev) v1-9)
|
||||
)
|
||||
)
|
||||
(if (or (not a1-7) (= a1-7 (-> a0-8 0)))
|
||||
(set! (-> a0-8 0) v1-9)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s3-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(hover-nav-bsp-node-method-10 (-> gp-0 root) 0)
|
||||
(set! *hover-bsp* gp-0)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function hover-nav-network-build-bsp
|
||||
;; INFO: Used lq/sq
|
||||
(defun hover-nav-network-build-bsp ((arg0 (array hover-nav-bsp-point)))
|
||||
(let ((gp-0 (new 'global 'hover-nav-bsp)))
|
||||
(let ((s4-0 (-> arg0 length))
|
||||
(s3-0 0)
|
||||
)
|
||||
(set! (-> gp-0 root) (new 'global 'hover-nav-bsp-node))
|
||||
(dotimes (s2-0 s4-0)
|
||||
(let ((v1-3 (new 'global 'hover-nav-bsp-point)))
|
||||
(set! (-> v1-3 index) (-> (the-as (pointer int32) (-> arg0 s2-0)) 12))
|
||||
(vector-copy! (-> v1-3 pos) (the-as vector (&+ (-> arg0 s2-0) 32)))
|
||||
(let ((a1-8 (-> gp-0 root point-list))
|
||||
(a0-11 (&-> gp-0 root point-list))
|
||||
)
|
||||
(when (zero? v1-3)
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (or (= v1-3 a1-8) (= v1-3 a0-11))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when (not (or (not a1-8) (!= (-> a1-8 prev) v1-3)))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(when a1-8
|
||||
(set! (-> v1-3 next) a1-8)
|
||||
(set! (-> v1-3 prev) (-> a1-8 prev))
|
||||
(if (-> v1-3 prev)
|
||||
(set! (-> v1-3 prev next) v1-3)
|
||||
)
|
||||
(if (-> v1-3 next)
|
||||
(set! (-> v1-3 next prev) v1-3)
|
||||
)
|
||||
)
|
||||
(if (or (not a1-8) (= a1-8 (-> a0-11 0)))
|
||||
(set! (-> a0-11 0) v1-3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s3-0 1)
|
||||
)
|
||||
)
|
||||
(hover-nav-bsp-node-method-10 (-> gp-0 root) 0)
|
||||
(set! *hover-bsp* gp-0)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function hover-nav-bsp-output
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun hover-nav-bsp-output ((arg0 hover-nav-bsp))
|
||||
(format #t "(")
|
||||
(hover-nav-bsp-node-method-9 (-> arg0 root))
|
||||
(format #t ")~%")
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
+744
@@ -0,0 +1,744 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
;; definition of type pilrec-sample
|
||||
(deftype pilrec-sample (structure)
|
||||
((sample-time time-frame)
|
||||
(pos vector :inline)
|
||||
(quat quaternion :inline)
|
||||
(stick-x float)
|
||||
(stick-y float)
|
||||
(throttle float)
|
||||
(flags pilrec-sample-flag)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type pilrec-sample
|
||||
(defmethod inspect ((this pilrec-sample))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'pilrec-sample)
|
||||
(format #t "~1Tsample-time: ~D~%" (-> this sample-time))
|
||||
(format #t "~1Tpos: ~`vector`P~%" (-> this pos))
|
||||
(format #t "~1Tquat: #<quaternion @ #x~X>~%" (-> this quat))
|
||||
(format #t "~1Tstick-x: ~f~%" (-> this stick-x))
|
||||
(format #t "~1Tstick-y: ~f~%" (-> this stick-y))
|
||||
(format #t "~1Tthrottle: ~f~%" (-> this throttle))
|
||||
(format #t "~1Tflags: ~D~%" (-> this flags))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition of type pilot-recorder-samples
|
||||
(deftype pilot-recorder-samples (basic)
|
||||
((samples (inline-array pilrec-sample))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type pilot-recorder-samples
|
||||
(defmethod inspect ((this pilot-recorder-samples))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this (-> this type))
|
||||
(format #t "~1Tsamples: #x~X~%" (-> this samples))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(when (or (not *pilot-recorder-samples*) (zero? *pilot-recorder-samples*))
|
||||
(let ((gp-0 (new 'debug 'pilot-recorder-samples)))
|
||||
(set! *pilot-recorder-samples* gp-0)
|
||||
(set! (-> gp-0 samples) (the-as (inline-array pilrec-sample) (malloc 'debug #xe1000)))
|
||||
)
|
||||
)
|
||||
|
||||
;; definition of type pilot-recorder
|
||||
(deftype pilot-recorder (process)
|
||||
((info race-info)
|
||||
(mesh race-mesh)
|
||||
(select-race uint64)
|
||||
(path-num int32)
|
||||
(sample-count int32)
|
||||
(samples (inline-array pilrec-sample))
|
||||
(state-time time-frame)
|
||||
(start-time time-frame)
|
||||
(start-record-plane plane :inline)
|
||||
(start-record-center vector :inline)
|
||||
(finish-record-plane plane :inline)
|
||||
(finish-record-center vector :inline)
|
||||
(prev-pos vector :inline)
|
||||
)
|
||||
(:state-methods
|
||||
die-fast
|
||||
idle
|
||||
active
|
||||
recording
|
||||
fail-full
|
||||
finished
|
||||
save
|
||||
fail-save
|
||||
)
|
||||
(:methods
|
||||
(pilot-recorder-method-22 (_type_) symbol)
|
||||
(passed-starting-line? (_type_ vector vector) symbol)
|
||||
(recording-finished? (_type_ vector vector) symbol)
|
||||
(draw-starting-line (_type_ vector vector) none)
|
||||
(draw-recorded-path (_type_) none)
|
||||
(pilot-recorder-method-27 (_type_) none)
|
||||
(record-input-sample! (_type_ pilrec-sample) pilrec-sample-flag)
|
||||
(lerp-samples! (_type_ pilrec-sample pilrec-sample pilrec-sample float time-frame) none)
|
||||
(save-to-db! (_type_) symbol)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type pilot-recorder
|
||||
(defmethod inspect ((this pilot-recorder))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(let ((t9-0 (method-of-type process inspect)))
|
||||
(t9-0 this)
|
||||
)
|
||||
(format #t "~2Tinfo: ~A~%" (-> this info))
|
||||
(format #t "~2Tmesh: ~A~%" (-> this mesh))
|
||||
(format #t "~2Tselect-race: ~D~%" (-> this select-race))
|
||||
(format #t "~2Tpath-num: ~D~%" (-> this path-num))
|
||||
(format #t "~2Tsample-count: ~D~%" (-> this sample-count))
|
||||
(format #t "~2Tsamples: #x~X~%" (-> this samples))
|
||||
(format #t "~2Tstate-time: ~D~%" (-> this state-time))
|
||||
(format #t "~2Tstart-time: ~D~%" (-> this start-time))
|
||||
(format #t "~2Tstart-record-plane: #<plane @ #x~X>~%" (-> this start-record-plane))
|
||||
(format #t "~2Tstart-record-center: #<vector @ #x~X>~%" (-> this start-record-center))
|
||||
(format #t "~2Tfinish-record-plane: #<plane @ #x~X>~%" (-> this finish-record-plane))
|
||||
(format #t "~2Tfinish-record-center: #<vector @ #x~X>~%" (-> this finish-record-center))
|
||||
(format #t "~2Tprev-pos: #<vector @ #x~X>~%" (-> this prev-pos))
|
||||
(label cfg-4)
|
||||
this
|
||||
)
|
||||
|
||||
;; definition for function delete-race-path
|
||||
;; WARN: Return type mismatch int vs object.
|
||||
(defun delete-race-path ((arg0 int) (arg1 int))
|
||||
(let ((s5-0 (-> *race-info-array* arg0 path-group-name)))
|
||||
(format #t "Attempting to delete path ~s.[~d]~%" s5-0 arg1)
|
||||
(let ((s4-0 (clear *temp-string*)))
|
||||
(format s4-0 "delete from race_path where race='~s' and path=~d~%" s5-0 arg1)
|
||||
(let ((a2-2 (sql-query s4-0)))
|
||||
(cond
|
||||
((= (-> a2-2 content-type) 'modify)
|
||||
(format #t "Success!~%")
|
||||
)
|
||||
(else
|
||||
(format 0 "ERROR: sql: modify error ~A~%" a2-2)
|
||||
(return (the-as object #f))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
;; definition for symbol *pilot-recorder*, type (pointer pilot-recorder)
|
||||
(define *pilot-recorder* (the-as (pointer pilot-recorder) #f))
|
||||
|
||||
;; definition for method 28 of type pilot-recorder
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs pilrec-sample-flag.
|
||||
(defmethod record-input-sample! ((this pilot-recorder) (arg0 pilrec-sample))
|
||||
(let ((v1-0 *target*))
|
||||
(the-as
|
||||
pilrec-sample-flag
|
||||
(when v1-0
|
||||
(let ((v1-1 (-> v1-0 pilot)))
|
||||
(the-as
|
||||
pilrec-sample-flag
|
||||
(when (nonzero? v1-1)
|
||||
(let ((v1-3 (handle->process (-> v1-1 vehicle))))
|
||||
(the-as
|
||||
pilrec-sample-flag
|
||||
(when v1-3
|
||||
(set-time! (-> arg0 sample-time))
|
||||
(let ((v1-5 (-> (the-as vehicle v1-3) rbody)))
|
||||
(vector-copy! (-> arg0 pos) (-> v1-5 position))
|
||||
(quaternion-copy! (-> arg0 quat) (the-as quaternion (-> v1-5 rot)))
|
||||
)
|
||||
(set! (-> arg0 stick-x) (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))
|
||||
(set! (-> arg0 stick-y) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0))
|
||||
(set! (-> arg0 throttle) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6)))))
|
||||
(let ((flag (pilrec-sample-flag)))
|
||||
(if (>= (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7)))) 0.5)
|
||||
(set! flag (the-as pilrec-sample-flag (logior (the-as int flag) (pilrec-sample-flag square))))
|
||||
)
|
||||
(if (cpad-hold? 0 l1)
|
||||
(set! flag (the-as pilrec-sample-flag (logior (the-as int flag) (pilrec-sample-flag l1))))
|
||||
)
|
||||
(if (>= (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6)))) 0.5)
|
||||
(set! flag (the-as pilrec-sample-flag (logior (the-as int flag) (pilrec-sample-flag x))))
|
||||
)
|
||||
(set! (-> arg0 flags) (the-as pilrec-sample-flag flag))
|
||||
flag
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 29 of type pilot-recorder
|
||||
;; WARN: Return type mismatch pilrec-sample-flag vs none.
|
||||
(defmethod lerp-samples! ((this pilot-recorder)
|
||||
(arg0 pilrec-sample)
|
||||
(arg1 pilrec-sample)
|
||||
(arg2 pilrec-sample)
|
||||
(arg3 float)
|
||||
(arg4 time-frame)
|
||||
)
|
||||
(set! (-> arg0 sample-time) arg4)
|
||||
(vector-lerp! (-> arg0 pos) (-> arg1 pos) (-> arg2 pos) arg3)
|
||||
(quaternion-slerp! (-> arg0 quat) (-> arg1 quat) (-> arg2 quat) arg3)
|
||||
(set! (-> arg0 stick-x) (lerp (-> arg1 stick-x) (-> arg2 stick-x) arg3))
|
||||
(set! (-> arg0 stick-y) (lerp (-> arg1 stick-y) (-> arg2 stick-y) arg3))
|
||||
(set! (-> arg0 throttle) (lerp (-> arg1 throttle) (-> arg2 throttle) arg3))
|
||||
(if (>= arg3 0.5)
|
||||
(set! (-> arg0 flags) (-> arg2 flags))
|
||||
(set! (-> arg0 flags) (-> arg1 flags))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 23 of type pilot-recorder
|
||||
(defmethod passed-starting-line? ((this pilot-recorder) (arg0 vector) (arg1 vector))
|
||||
(when (and (< (vector4-dot arg0 (the-as vector (-> this start-record-plane))) 0.0)
|
||||
(>= (vector4-dot arg1 (the-as vector (-> this start-record-plane))) 0.0)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-! s4-0 arg1 arg0)
|
||||
(let ((f0-4 (intersect-ray-plane arg0 s4-0 (-> this start-record-center) (-> this start-record-plane)))
|
||||
(a0-5 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector+float*! a0-5 arg0 s4-0 f0-4)
|
||||
(let ((f0-5 184320.0))
|
||||
(if (>= (* f0-5 f0-5) (vector-vector-xz-distance-squared a0-5 (-> this start-record-center)))
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 24 of type pilot-recorder
|
||||
(defmethod recording-finished? ((this pilot-recorder) (arg0 vector) (arg1 vector))
|
||||
(when (and (< (vector4-dot arg0 (the-as vector (-> this finish-record-plane))) 0.0)
|
||||
(>= (vector4-dot arg1 (the-as vector (-> this finish-record-plane))) 0.0)
|
||||
)
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-! s4-0 arg1 arg0)
|
||||
(let ((f0-4 (intersect-ray-plane arg0 s4-0 (-> this finish-record-center) (-> this finish-record-plane)))
|
||||
(a0-5 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector+float*! a0-5 arg0 s4-0 f0-4)
|
||||
(let ((f0-5 184320.0))
|
||||
(if (>= (* f0-5 f0-5) (vector-vector-xz-distance-squared a0-5 (-> this finish-record-center)))
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 25 of type pilot-recorder
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-starting-line ((this pilot-recorder) (arg0 vector) (arg1 vector))
|
||||
(let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-copy! (-> gp-0 0) arg0)
|
||||
(vector-float*! (-> gp-0 0) (-> gp-0 0) 184320.0)
|
||||
(vector-copy! (-> gp-0 1) (-> gp-0 0))
|
||||
(vector-rotate-around-y! (-> gp-0 0) (-> gp-0 0) 16384.0)
|
||||
(vector-rotate-around-y! (-> gp-0 1) (-> gp-0 1) -16384.0)
|
||||
(vector+! (-> gp-0 0) (-> gp-0 0) arg1)
|
||||
(vector+! (-> gp-0 1) (-> gp-0 1) arg1)
|
||||
(+! (-> gp-0 0 y) 1638.4)
|
||||
(+! (-> gp-0 1 y) 1638.4)
|
||||
(countdown (s5-1 10)
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> gp-0 0)
|
||||
(-> gp-0 1)
|
||||
(new 'static 'rgba :g #x80 :a #x80)
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
(+! (-> gp-0 0 y) 1638.4)
|
||||
(+! (-> gp-0 1 y) 1638.4)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 26 of type pilot-recorder
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-recorded-path ((this pilot-recorder))
|
||||
(let ((s2-0 0)
|
||||
(s5-0 1)
|
||||
(s4-0 (+ (-> this sample-count) -1))
|
||||
(s3-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(vector-copy! s3-0 (math-camera-pos))
|
||||
(while (< s2-0 s4-0)
|
||||
(let* ((s2-1 (-> this samples s2-0))
|
||||
(s1-1 (-> this samples s5-0))
|
||||
(f0-0 (vector-vector-distance-squared (-> s2-1 pos) s3-0))
|
||||
(f1-0 819200.0)
|
||||
)
|
||||
(if (< f0-0 (* f1-0 f1-0))
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug)
|
||||
(-> s2-1 pos)
|
||||
(-> s1-1 pos)
|
||||
(new 'static 'rgba :r #xff :a #x80)
|
||||
#f
|
||||
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! s2-0 s5-0)
|
||||
(set! s5-0 (min (+ s5-0 1) s4-0))
|
||||
)
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"recorded path ~d time ~5,,3f~%"
|
||||
(-> this path-num)
|
||||
(* 0.016666668 (the float (-> this sample-count)))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 27 of type pilot-recorder
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod pilot-recorder-method-27 ((this pilot-recorder))
|
||||
(let ((gp-0 (new 'stack-no-clear 'matrix))
|
||||
(s5-0 (new 'static 'boxed-array :type vector
|
||||
(new 'static 'vector :y 4096.0 :w 1.0)
|
||||
(new 'static 'vector :x 4096.0 :w 1.0)
|
||||
(new 'static 'vector :x 4096.0 :w 1.0)
|
||||
(new 'static 'vector :y -4096.0 :w 1.0)
|
||||
(new 'static 'vector :y -4096.0 :w 1.0)
|
||||
(new 'static 'vector :x -4096.0 :w 1.0)
|
||||
(new 'static 'vector :x -4096.0 :w 1.0)
|
||||
(new 'static 'vector :y 4096.0 :w 1.0)
|
||||
(new 'static 'vector :y 4096.0 :w 1.0)
|
||||
(new 'static 'vector :z 40960.0 :w 1.0)
|
||||
(new 'static 'vector :x 4096.0 :w 1.0)
|
||||
(new 'static 'vector :z 40960.0 :w 1.0)
|
||||
(new 'static 'vector :y -4096.0 :w 1.0)
|
||||
(new 'static 'vector :z 40960.0 :w 1.0)
|
||||
(new 'static 'vector :x -4096.0 :w 1.0)
|
||||
(new 'static 'vector :z 40960.0 :w 1.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(vector-! (-> gp-0 fvec) (-> this samples 1 pos) (-> this samples 0 pos))
|
||||
(vector-normalize! (-> gp-0 fvec) 1.0)
|
||||
(vector-cross! (-> gp-0 rvec) *up-vector* (-> gp-0 fvec))
|
||||
(vector-normalize! (-> gp-0 rvec) 1.0)
|
||||
(vector-cross! (-> gp-0 uvec) (-> gp-0 fvec) (-> gp-0 rvec))
|
||||
(vector-normalize! (-> gp-0 uvec) 1.0)
|
||||
(vector-copy! (-> gp-0 trans) (-> this samples 0 pos))
|
||||
(let ((s4-1 0))
|
||||
(while (< s4-1 (-> s5-0 length))
|
||||
(let ((a1-9 (-> s5-0 s4-1))
|
||||
(s3-0 (-> s5-0 (+ s4-1 1)))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
(s1-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(+! s4-1 2)
|
||||
(vector-matrix*! s2-0 a1-9 gp-0)
|
||||
(vector-matrix*! s1-0 s3-0 gp-0)
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug)
|
||||
s2-0
|
||||
s1-0
|
||||
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 22 of type pilot-recorder
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod pilot-recorder-method-22 ((this pilot-recorder))
|
||||
(let* ((s5-0 (-> this samples 0))
|
||||
(s4-0 (+ (-> this sample-count) -45))
|
||||
(s3-0 (-> this samples s4-0))
|
||||
(s2-0 (new 'stack-no-clear 'inline-array 'vector 4))
|
||||
)
|
||||
(vector-! (-> s2-0 0) (-> s3-0 pos) (-> this samples (+ s4-0 -1) pos))
|
||||
(vector-float*! (-> s2-0 0) (-> s2-0 0) 60.0)
|
||||
(vector-! (-> s2-0 1) (-> this samples 1 pos) (-> s5-0 pos))
|
||||
(vector-float*! (-> s2-0 1) (-> s2-0 1) 60.0)
|
||||
(vector-float*! (-> s2-0 2) (-> s3-0 pos) -3.0)
|
||||
(vector+float*! (-> s2-0 2) (-> s2-0 2) (-> s5-0 pos) 3.0)
|
||||
(vector+float*! (-> s2-0 2) (-> s2-0 2) (-> s2-0 0) -2.0)
|
||||
(vector-! (-> s2-0 2) (-> s2-0 2) (-> s2-0 1))
|
||||
(vector+! (-> s2-0 3) (-> s2-0 1) (-> s2-0 0))
|
||||
(vector+float*! (-> s2-0 3) (-> s2-0 3) (-> s5-0 pos) -2.0)
|
||||
(vector+float*! (-> s2-0 3) (-> s2-0 3) (-> s3-0 pos) 2.0)
|
||||
(let ((s1-0 1)
|
||||
(s0-0 (new 'stack-no-clear 'inline-array 'vector 4))
|
||||
)
|
||||
(while (< s1-0 45)
|
||||
(let ((f0-8 (* 0.022222223 (the float s1-0)))
|
||||
(v1-24 (-> this samples (+ s4-0 s1-0)))
|
||||
)
|
||||
(vector+float*! (-> s0-0 1) (-> s3-0 pos) (-> s2-0 0) f0-8)
|
||||
(vector+float*! (-> s0-0 1) (-> s0-0 1) (-> s2-0 2) (* f0-8 f0-8))
|
||||
(vector+float*! (-> s0-0 1) (-> s0-0 1) (-> s2-0 3) (* f0-8 f0-8 f0-8))
|
||||
(vector-copy! (-> v1-24 pos) (-> s0-0 1))
|
||||
(quaternion-slerp! (-> v1-24 quat) (-> s3-0 quat) (-> s5-0 quat) f0-8)
|
||||
)
|
||||
(+! s1-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
|
||||
;; definition for method 30 of type pilot-recorder
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod save-to-db! ((this pilot-recorder))
|
||||
(local-vars (sv-16 pilrec-sample-flag))
|
||||
(let ((gp-0 (clear *temp-string*))
|
||||
(s4-0 (-> *race-info-array* *select-race* path-group-name))
|
||||
(s3-0 *select-race-path*)
|
||||
)
|
||||
(format gp-0 "delete from race_path where race='~s' and path=~d~%" s4-0 s3-0)
|
||||
(let ((a2-1 (sql-query gp-0)))
|
||||
(when (!= (-> a2-1 content-type) 'modify)
|
||||
(format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 this)
|
||||
(return #f)
|
||||
)
|
||||
)
|
||||
(dotimes (s2-0 (-> this sample-count))
|
||||
(let ((s1-0 (-> this samples s2-0)))
|
||||
(clear gp-0)
|
||||
(format gp-0 "insert into race_path set ")
|
||||
(format gp-0 "race='~s'," s4-0)
|
||||
(format gp-0 "path=~d," s3-0)
|
||||
(format gp-0 "pos_x=~f," (/ (-> s1-0 pos x) METER_LENGTH))
|
||||
(format gp-0 "pos_y=~f," (/ (-> s1-0 pos y) METER_LENGTH))
|
||||
(format gp-0 "pos_z=~f," (/ (-> s1-0 pos z) METER_LENGTH))
|
||||
(format gp-0 "quat_x=~f," (-> s1-0 quat x))
|
||||
(format gp-0 "quat_y=~f," (-> s1-0 quat y))
|
||||
(format gp-0 "quat_z=~f," (-> s1-0 quat z))
|
||||
(format gp-0 "quat_w=~f," (-> s1-0 quat w))
|
||||
(set! sv-16 (-> s1-0 flags))
|
||||
(let ((s0-0 #f))
|
||||
(format gp-0 "flags='")
|
||||
(when (logtest? sv-16 (pilrec-sample-flag square))
|
||||
(set! s0-0 (cond
|
||||
(s0-0
|
||||
(format gp-0 ",")
|
||||
s0-0
|
||||
)
|
||||
(else
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
(format gp-0 "break")
|
||||
)
|
||||
(when (logtest? sv-16 (pilrec-sample-flag l1))
|
||||
(set! s0-0 (cond
|
||||
(s0-0
|
||||
(format gp-0 ",")
|
||||
s0-0
|
||||
)
|
||||
(else
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
(format gp-0 "jump")
|
||||
)
|
||||
(when (logtest? sv-16 (pilrec-sample-flag x))
|
||||
(if s0-0
|
||||
(format gp-0 ",")
|
||||
#t
|
||||
)
|
||||
(format gp-0 "throttle")
|
||||
)
|
||||
)
|
||||
(format gp-0 "',")
|
||||
(format gp-0 "stick_x=~f," (-> s1-0 stick-x))
|
||||
(format gp-0 "stick_y=~f," (-> s1-0 stick-y))
|
||||
(format gp-0 "throttle=~f~%" (-> s1-0 throttle))
|
||||
)
|
||||
(let ((a2-14 (sql-query gp-0)))
|
||||
(when (!= (-> a2-14 content-type) 'modify)
|
||||
(format 0 "ERROR: sql: modify error ~A for ~A~%" a2-14 this)
|
||||
(return #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#t
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate idle (pilot-recorder)
|
||||
:virtual #t
|
||||
:trans (behavior ()
|
||||
(let ((a1-0 (new 'stack-no-clear 'pilrec-sample)))
|
||||
(if (record-input-sample! self a1-0)
|
||||
(go-virtual active)
|
||||
)
|
||||
)
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate active (pilot-recorder)
|
||||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(let ((gp-0 (new 'stack-no-clear 'pilrec-sample)))
|
||||
(if (not (record-input-sample! self gp-0))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(vector-copy! (-> self prev-pos) (-> gp-0 pos))
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(let ((gp-0 (new 'stack-no-clear 'pilrec-sample)))
|
||||
(if (not (record-input-sample! self gp-0))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(if (passed-starting-line? self (-> self prev-pos) (-> gp-0 pos))
|
||||
(go-virtual recording)
|
||||
(vector-copy! (-> self prev-pos) (-> gp-0 pos))
|
||||
)
|
||||
)
|
||||
(if (>= (mod (current-time) 240) 120)
|
||||
(format *stdcon* " Cross starting line to begin recording.~%")
|
||||
)
|
||||
(draw-starting-line self (-> self start-record-plane) (-> self start-record-center))
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate recording (pilot-recorder)
|
||||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(set-time! (-> self start-time))
|
||||
(set! (-> self samples) (-> *pilot-recorder-samples* samples))
|
||||
(let ((gp-0 (-> self samples 0)))
|
||||
(if (not (record-input-sample! self gp-0))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(set! (-> self sample-count) 1)
|
||||
(vector-copy! (-> self prev-pos) (-> gp-0 pos))
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(let ((gp-0 (new 'stack-no-clear 'pilrec-sample)))
|
||||
(if (not (record-input-sample! self gp-0))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(if (recording-finished? self (-> self prev-pos) (-> gp-0 pos))
|
||||
(go-virtual finished)
|
||||
(vector-copy! (-> self prev-pos) (-> gp-0 pos))
|
||||
)
|
||||
(let* ((s5-0 (-> self samples (+ (-> self sample-count) -1)))
|
||||
(s4-0 (- (-> gp-0 sample-time) (-> s5-0 sample-time)))
|
||||
(s3-0 0)
|
||||
)
|
||||
(until #f
|
||||
(+! s3-0 5)
|
||||
(if (< s4-0 s3-0)
|
||||
(goto cfg-12)
|
||||
)
|
||||
(let ((s2-0 (-> self sample-count)))
|
||||
(if (>= s2-0 #x3840)
|
||||
(go-virtual fail-full)
|
||||
)
|
||||
(lerp-samples!
|
||||
self
|
||||
(-> self samples s2-0)
|
||||
s5-0
|
||||
gp-0
|
||||
(/ (the float s3-0) (the float s4-0))
|
||||
(+ (-> s5-0 sample-time) s3-0)
|
||||
)
|
||||
(set! (-> self sample-count) (+ s2-0 1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
(label cfg-12)
|
||||
(if (>= (mod (current-time) 240) 120)
|
||||
(format *stdcon* " Recording~%")
|
||||
)
|
||||
(draw-starting-line self (-> self finish-record-plane) (-> self finish-record-center))
|
||||
(if (time-elapsed? (-> self start-time) (seconds 4))
|
||||
(pilot-recorder-method-27 self)
|
||||
)
|
||||
0
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate finished (pilot-recorder)
|
||||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(set-time! (-> self state-time))
|
||||
(change-parent self *entity-pool*)
|
||||
(if (logtest? (-> self mesh flags) (race-mesh-flag rmf0))
|
||||
(pilot-recorder-method-22 self)
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(when (time-elapsed? (-> self state-time) (seconds 0.5))
|
||||
(cond
|
||||
((cpad-pressed? 1 triangle)
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
((cpad-pressed? 1 x)
|
||||
(go-virtual save)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (>= (mod (current-time) 240) 120)
|
||||
(format *stdcon* " Finished.~%")
|
||||
(format *stdcon* "~%")
|
||||
)
|
||||
(format *stdcon* " Press pad1 X to save, or triangle to discard.~%")
|
||||
(draw-recorded-path self)
|
||||
0
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate save (pilot-recorder)
|
||||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(set-time! (-> self state-time))
|
||||
(if (not (save-to-db! self))
|
||||
(go-virtual fail-save)
|
||||
)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(if (time-elapsed? (-> self state-time) (seconds 4))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(if (>= (mod (current-time) 240) 120)
|
||||
(format *stdcon* " Save complete!~%")
|
||||
)
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate fail-save (pilot-recorder)
|
||||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(set-time! (-> self state-time))
|
||||
)
|
||||
:trans (behavior ()
|
||||
(if (time-elapsed? (-> self state-time) (seconds 15))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(if (>= (mod (current-time) 60) 30)
|
||||
(format *stdcon* " SAVE FAILED!!!~%")
|
||||
)
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate fail-full (pilot-recorder)
|
||||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(set-time! (-> self state-time))
|
||||
)
|
||||
:trans (behavior ()
|
||||
(if (time-elapsed? (-> self state-time) (seconds 15))
|
||||
(go-virtual die-fast)
|
||||
)
|
||||
(if (>= (mod (current-time) 60) 30)
|
||||
(format *stdcon* " FAILED!!! BUFFER FULL!!!~%")
|
||||
)
|
||||
)
|
||||
:code sleep-code
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate die-fast (pilot-recorder)
|
||||
:virtual #t
|
||||
:code nothing
|
||||
)
|
||||
|
||||
;; definition for function pilot-recorder-init-by-other
|
||||
;; INFO: Used lq/sq
|
||||
(defbehavior pilot-recorder-init-by-other pilot-recorder ((arg0 uint) (arg1 int))
|
||||
(set! (-> self select-race) arg0)
|
||||
(set! (-> self path-num) arg1)
|
||||
(let ((v1-2 (-> *race-info-array* arg0)))
|
||||
(set! (-> self info) v1-2)
|
||||
(set! (-> self mesh) (-> v1-2 mesh))
|
||||
(vector-copy! (-> self start-record-center) (-> v1-2 start-sphere))
|
||||
(set! (-> self start-record-plane quad) (-> v1-2 start-dir quad))
|
||||
(set! (-> self start-record-plane w)
|
||||
(- (vector-dot (the-as vector (-> self start-record-plane)) (-> self start-record-center)))
|
||||
)
|
||||
(vector-copy! (-> self finish-record-center) (-> v1-2 finish-sphere))
|
||||
(set! (-> self finish-record-plane quad) (-> v1-2 finish-dir quad))
|
||||
)
|
||||
(set! (-> self finish-record-plane w)
|
||||
(- (vector-dot (the-as vector (-> self finish-record-plane)) (-> self finish-record-center)))
|
||||
)
|
||||
(set! *pilot-recorder* (the-as (pointer pilot-recorder) self))
|
||||
(go-virtual idle)
|
||||
)
|
||||
|
||||
;; definition for function start-pilot-recorder
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun start-pilot-recorder ()
|
||||
(process-spawn pilot-recorder *select-race* *select-race-path* :name "pilot-recorder" :to *target*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
Reference in New Issue
Block a user