mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 06:54:31 -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:
+104
-111
@@ -34140,34 +34140,31 @@
|
||||
;; cam-debug ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype cam-dbg-scratch (structure)
|
||||
((linevec4w vector :inline :offset-assert 0) ;; vector4w 2 :inline
|
||||
(color vector :inline :offset-assert 32) ;; vector4w :inline
|
||||
(plotvec vector :inline :offset-assert 48) ;; vector4w 2 :inline
|
||||
(linevec vector :inline :offset-assert 80) ;; vector4w 2 :inline
|
||||
(rel-vec vector :inline :offset-assert 112)
|
||||
(sphere-v-start vector :inline :offset-assert 128)
|
||||
(sphere-v-end vector :inline :offset-assert 144)
|
||||
(sphere-v-down vector :inline :offset-assert 160)
|
||||
(sphere-vec vector :inline :offset-assert 176)
|
||||
(crossvec vector :inline :offset-assert 192)
|
||||
(bboxvec vector :inline :offset-assert 240)
|
||||
(fov-vv vector :inline :offset-assert 336)
|
||||
(fov-src vector :inline :offset-assert 400)
|
||||
(fov-dest vector :inline :offset-assert 416)
|
||||
(fov-vert vector :inline :offset-assert 432)
|
||||
(fov-horz vector :inline :offset-assert 448)
|
||||
((linevec4w vector4w 2 :inline :offset-assert 0) ;; vector4w 2 :inline
|
||||
(color vector4w :inline :offset-assert 32) ;; vector4w :inline
|
||||
(plotvec vector4w 2 :inline :offset-assert 48) ;; vector4w 2 :inline
|
||||
(linevec vector4w 2 :inline :offset-assert 80) ;; vector4w 2 :inline
|
||||
(rel-vec vector :inline :offset-assert 112)
|
||||
(sphere-v-start vector :inline :offset-assert 128)
|
||||
(sphere-v-end vector :inline :offset-assert 144)
|
||||
(sphere-v-down vector :inline :offset-assert 160)
|
||||
(sphere-vec vector :inline :offset-assert 176)
|
||||
(crossvec vector 3 :inline :offset-assert 192)
|
||||
(bboxvec vector 6 :inline :offset-assert 240)
|
||||
(fov-vv vector 4 :inline :offset-assert 336)
|
||||
(fov-src vector :inline :offset-assert 400)
|
||||
(fov-dest vector :inline :offset-assert 416)
|
||||
(fov-vert vector :inline :offset-assert 432)
|
||||
(fov-horz vector :inline :offset-assert 448)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x1d0
|
||||
:flag-assert #x9000001d0
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype cam-debug-tri (structure)
|
||||
((vertex vector 3 :offset-assert 0) ;; guessed by decompiler
|
||||
((vertex vector 3 :inline :offset-assert 0) ;; guessed by decompiler
|
||||
(intersect vector :inline :offset-assert 48)
|
||||
(color vector4w :offset-assert 64)
|
||||
)
|
||||
@@ -34175,9 +34172,7 @@
|
||||
:size-assert #x44
|
||||
:flag-assert #x900000044
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype cam-collision-record (structure)
|
||||
((pos vector :inline :offset-assert 0)
|
||||
(vel vector :inline :offset-assert 16)
|
||||
@@ -34199,9 +34194,7 @@
|
||||
:size-assert #xa8
|
||||
:flag-assert #x9000000a8
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype cam-collision-record-array (inline-array-class)
|
||||
((data cam-collision-record :dynamic :offset-assert 16) ;; guessed by decompiler
|
||||
)
|
||||
@@ -34209,54 +34202,53 @@
|
||||
:size-assert #x10
|
||||
:flag-assert #xe00000010
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern *camera-old-cpu* object) ;; int
|
||||
;; (define-extern *camera-old-vu* object) ;; int
|
||||
;; (define-extern *camera-old-tfrag-bytes* object) ;; int
|
||||
;; (define-extern *camera-old-level* object) ;; string
|
||||
;; (define-extern *camera-old-stat-string-tfrag* object) ;; string
|
||||
;; (define-extern *camera-old-stat-string-tfrag-near* object) ;; string
|
||||
;; (define-extern *camera-old-stat-string-total* object) ;; string
|
||||
(define-extern *camera-old-cpu* int)
|
||||
(define-extern *camera-old-vu* int)
|
||||
(define-extern *camera-old-tfrag-bytes* int)
|
||||
(define-extern *camera-old-level* string)
|
||||
(define-extern *camera-old-stat-string-tfrag* string)
|
||||
(define-extern *camera-old-stat-string-tfrag-near* string)
|
||||
(define-extern *camera-old-stat-string-total* string)
|
||||
(define-extern cam-slave-options->string (function cam-slave-options object string))
|
||||
(define-extern cam-index-options->string (function cam-index-options object string))
|
||||
(define-extern slave-los-state->string (function slave-los-state string))
|
||||
;; (define-extern cam-line-dma function) ;; (function pointer)
|
||||
;; (define-extern camera-line2d function) ;; (function vector4w vector4w pointer)
|
||||
(define-extern cam-line-dma (function pointer))
|
||||
(define-extern camera-line2d (function vector4w vector4w pointer))
|
||||
(define-extern camera-plot-float-func (function float float float float (function float float) vector4w none))
|
||||
(define-extern camera-line-setup (function vector4w none))
|
||||
(define-extern camera-line-draw (function vector vector none))
|
||||
(define-extern camera-line (function vector vector vector4w none))
|
||||
(define-extern camera-line-rel (function vector vector vector4w none))
|
||||
(define-extern camera-line-rel-len (function vector vector float vector4w none))
|
||||
;; (define-extern camera-sphere function) ;; (function vector float vector4w none)
|
||||
(define-extern camera-sphere (function vector float vector4w none))
|
||||
(define-extern camera-cross (function vector vector vector vector4w meters none))
|
||||
;; (define-extern camera-bounding-box-draw function) ;; (function bounding-box basic rgba none)
|
||||
;; (define-extern *cam-debug-los-tri-current* object) ;; int
|
||||
;; (define-extern *cam-debug-los-tri* object) ;; (inline-array cam-debug-tri)
|
||||
;; (define-extern *cam-debug-coll-tri-current* object) ;; int
|
||||
;; (define-extern *cam-debug-coll-tri* object) ;; (inline-array cam-debug-tri)
|
||||
(define-extern camera-bounding-box-draw (function bounding-box basic rgba none))
|
||||
(define-extern *cam-debug-los-tri-current* int)
|
||||
(define-extern *cam-debug-los-tri* (inline-array cam-debug-tri))
|
||||
(define-extern *cam-debug-coll-tri-current* int)
|
||||
(define-extern *cam-debug-coll-tri* (inline-array cam-debug-tri))
|
||||
(define-extern cam-debug-reset-coll-tri (function none))
|
||||
(define-extern cam-debug-add-los-tri (function (inline-array collide-cache-tri) vector vector none))
|
||||
;; (define-extern cam-debug-add-coll-tri function) ;; (function cam-debug-tri vector cam-debug-tri none)
|
||||
;; (define-extern cam-debug-draw-tris function) ;; (function symbol)
|
||||
;; (define-extern camera-fov-draw function) ;; (function int int vector float float vector4w none)
|
||||
(define-extern cam-debug-add-coll-tri (function cam-debug-tri vector cam-debug-tri none))
|
||||
(define-extern cam-debug-draw-tris (function symbol))
|
||||
(define-extern camera-fov-draw (function int int vector float float vector4w none))
|
||||
(define-extern camera-fov-frame (function matrix vector float float float vector4w symbol))
|
||||
;; (define-extern debug-euler function) ;; (function cam-dbg-scratch object)
|
||||
;; (define-extern bike-cam-limit function) ;; (function float float)
|
||||
(define-extern debug-euler (function cam-dbg-scratch object))
|
||||
(define-extern bike-cam-limit (function float float))
|
||||
(define-extern camera-slave-debug (function camera-slave none))
|
||||
;; (define-extern master-draw-coordinates function) ;; (function vector none)
|
||||
;; (define-extern *cam-collision-record-first* object) ;; int
|
||||
;; (define-extern *cam-collision-record-last* object) ;; int
|
||||
;; (define-extern *cam-collision-record-show* object) ;; int
|
||||
;; (define-extern *cam-collision-record* object) ;; cam-collision-record-array
|
||||
(define-extern master-draw-coordinates (function vector none))
|
||||
(define-extern *cam-collision-record-first* int)
|
||||
(define-extern *cam-collision-record-last* int)
|
||||
(define-extern *cam-collision-record-show* int)
|
||||
(define-extern *cam-collision-record* cam-collision-record-array)
|
||||
(define-extern cam-collision-record-save (function vector vector int symbol camera-slave none))
|
||||
;; (define-extern cam-collision-record-step function) ;; (function int none)
|
||||
;; (define-extern cam-collision-record-draw function) ;; (function none)
|
||||
(define-extern cam-collision-record-step (function int none))
|
||||
(define-extern cam-collision-record-draw (function none))
|
||||
(define-extern camera-master-debug (function camera-master none))
|
||||
(define-extern debug-set-camera-pos-rot! (function vector matrix vector))
|
||||
;; (define-extern cam-restore function) ;; (function none)
|
||||
;; (define-extern cam-restore-generic-bug function)
|
||||
(define-extern cam-restore (function none))
|
||||
(define-extern cam-restore-generic-bug (function none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; cam-start ;;
|
||||
@@ -41061,12 +41053,12 @@
|
||||
;; sampler ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (define-extern *sampler-mem* object) ;; pointer
|
||||
;; (define-extern *sampler-compare* object) ;; uint
|
||||
;; (define-extern *sampler-count* object) ;; int
|
||||
;; (define-extern timer0-handler function) ;; (function none)
|
||||
;; (define-extern sampler-start function) ;; (function none)
|
||||
;; (define-extern sampler-stop function) ;; (function none)
|
||||
(define-extern *sampler-mem* pointer)
|
||||
(define-extern *sampler-compare* uint)
|
||||
(define-extern *sampler-count* int)
|
||||
(define-extern timer0-handler (function none))
|
||||
(define-extern sampler-start (function none))
|
||||
(define-extern sampler-stop (function none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; default-menu ;;
|
||||
@@ -44321,7 +44313,6 @@
|
||||
;; hover-nav-edit ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype hover-nav-bsp-point (list-node)
|
||||
((index int32 :offset-assert 8)
|
||||
(pos vector :inline :offset-assert 16)
|
||||
@@ -44329,10 +44320,11 @@
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
(:methods
|
||||
(new (symbol type) _type_) ;; 0
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype hover-nav-bsp-node (structure)
|
||||
((split-plane vector :inline :offset-assert 0)
|
||||
(point-list hover-nav-bsp-point :offset-assert 16)
|
||||
@@ -44343,14 +44335,12 @@
|
||||
:size-assert #x1c
|
||||
:flag-assert #xb0000001c
|
||||
(:methods
|
||||
(new (symbol type) _type_) ;; 0 ;; (new (symbol type) _type_)
|
||||
(hover-nav-bsp-node-method-9 () none) ;; 9 ;; (hover-nav-bsp-node-method-9 (_type_) none)
|
||||
(hover-nav-bsp-node-method-10 () none) ;; 10 ;; (hover-nav-bsp-node-method-10 (_type_ int) none)
|
||||
(new (symbol type) _type_) ;; 0
|
||||
(hover-nav-bsp-node-method-9 (_type_) none) ;; 9
|
||||
(hover-nav-bsp-node-method-10 (_type_ int) none) ;; 10
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype hover-nav-bsp (structure)
|
||||
((root hover-nav-bsp-node :offset-assert 0)
|
||||
)
|
||||
@@ -44358,16 +44348,15 @@
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern probe-for-clear-collision? function) ;; (function vector vector symbol)
|
||||
;; (define-extern hover-nav-graph-process-points function) ;; (function none)
|
||||
;; (define-extern hover-nav-graph-output function) ;; (function symbol)
|
||||
;; (define-extern *axes-table* array) ;; (array vector)
|
||||
;; (define-extern *hover-bsp* object) ;; hover-nav-bsp
|
||||
;; (define-extern hover-nav-graph-output-bsp function) ;; (function hover-nav-bsp)
|
||||
;; (define-extern hover-nav-network-build-bsp function) ;; (function (array hover-nav-bsp-point) hover-nav-bsp)
|
||||
;; (define-extern hover-nav-bsp-output function) ;; (function hover-nav-bsp none)
|
||||
(define-extern probe-for-clear-collision? (function vector vector symbol))
|
||||
(define-extern hover-nav-graph-process-points (function none))
|
||||
(define-extern hover-nav-graph-output (function string object))
|
||||
(define-extern *axes-table* (array vector))
|
||||
(define-extern *hover-bsp* hover-nav-bsp)
|
||||
(define-extern hover-nav-graph-output-bsp (function hover-nav-bsp))
|
||||
(define-extern hover-nav-network-build-bsp (function (array hover-nav-bsp-point) hover-nav-bsp))
|
||||
(define-extern hover-nav-bsp-output (function hover-nav-bsp none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; dp-bipedal-part ;;
|
||||
@@ -56758,23 +56747,30 @@
|
||||
;; pilot-recorder ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
;; +++pilot-recorder:pilrec-sample-flag
|
||||
(defenum pilrec-sample-flag
|
||||
:type uint8
|
||||
:bitfield #t
|
||||
(square 0)
|
||||
(l1 1)
|
||||
(x 2)
|
||||
)
|
||||
;; ---pilot-recorder:pilrec-sample-flag
|
||||
|
||||
(deftype pilrec-sample (structure)
|
||||
((sample-time uint64 :offset-assert 0) ;; time-frame
|
||||
((sample-time time-frame :offset-assert 0) ;; time-frame
|
||||
(pos vector :inline :offset-assert 16)
|
||||
(quat quaternion :inline :offset-assert 32)
|
||||
(stick-x float :offset-assert 48)
|
||||
(stick-y float :offset-assert 52)
|
||||
(throttle float :offset-assert 56)
|
||||
(flags uint8 :offset-assert 60)
|
||||
(flags pilrec-sample-flag :offset-assert 60)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x3d
|
||||
:flag-assert #x90000003d
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype pilot-recorder-samples (basic)
|
||||
((samples (inline-array pilrec-sample) :offset-assert 4) ;; guessed by decompiler
|
||||
)
|
||||
@@ -56782,18 +56778,16 @@
|
||||
:size-assert #x8
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype pilot-recorder (process)
|
||||
((info race-info :offset-assert 128) ;; guessed by decompiler
|
||||
(mesh race-mesh :offset-assert 132) ;; guessed by decompiler
|
||||
(select-race uint64 :offset-assert 136)
|
||||
(path-num int32 :offset-assert 144)
|
||||
(sample-count int32 :offset-assert 148)
|
||||
(samples pilot-recorder-samples :offset-assert 152) ;; guessed by decompiler
|
||||
(state-time uint64 :offset-assert 160) ;; time-frame
|
||||
(start-time uint64 :offset-assert 168) ;; time-frame
|
||||
(samples (inline-array pilrec-sample) :offset-assert 152) ;; guessed by decompiler
|
||||
(state-time time-frame :offset-assert 160) ;; time-frame
|
||||
(start-time time-frame :offset-assert 168) ;; time-frame
|
||||
(start-record-plane plane :inline :offset-assert 176)
|
||||
(start-record-center vector :inline :offset-assert 192)
|
||||
(finish-record-plane plane :inline :offset-assert 208)
|
||||
@@ -56803,34 +56797,33 @@
|
||||
:method-count-assert 31
|
||||
:size-assert #x100
|
||||
:flag-assert #x1f00800100
|
||||
(:methods
|
||||
(pilot-recorder-method-22 () none) ;; 22 ;; (pilot-recorder-method-22 () none)
|
||||
(pilot-recorder-method-23 () none) ;; 23 ;; (pilot-recorder-method-23 () none)
|
||||
(pilot-recorder-method-24 () none) ;; 24 ;; (pilot-recorder-method-24 () none)
|
||||
(pilot-recorder-method-25 () none) ;; 25 ;; (pilot-recorder-method-25 () none)
|
||||
(pilot-recorder-method-26 () none) ;; 26 ;; (pilot-recorder-method-26 () none)
|
||||
(pilot-recorder-method-27 () none) ;; 27 ;; (pilot-recorder-method-27 () none)
|
||||
(pilot-recorder-method-28 () none) ;; 28 ;; (pilot-recorder-method-28 () none)
|
||||
(pilot-recorder-method-29 () none) ;; 29 ;; (pilot-recorder-method-29 () none)
|
||||
(pilot-recorder-method-30 () none) ;; 30 ;; (pilot-recorder-method-30 () none)
|
||||
)
|
||||
(:state-methods
|
||||
die-fast ;; 14, old: (die-fast () _type_ :state)
|
||||
fail-full ;; 18, old: (fail-full () _type_ :state)
|
||||
fail-save ;; 21, old: (fail-save () _type_ :state)
|
||||
save ;; 20, old: (save () _type_ :state)
|
||||
finished ;; 19, old: (finished () _type_ :state)
|
||||
recording ;; 17, old: (recording () _type_ :state)
|
||||
active ;; 16, old: (active () _type_ :state)
|
||||
idle ;; 15, old: (idle () _type_ :state)
|
||||
die-fast ;; 14
|
||||
idle ;; 15
|
||||
active ;; 16
|
||||
recording ;; 17
|
||||
fail-full ;; 18
|
||||
finished ;; 19
|
||||
save ;; 20
|
||||
fail-save ;; 21
|
||||
)
|
||||
(:methods
|
||||
(pilot-recorder-method-22 (_type_) symbol) ;; 22
|
||||
(passed-starting-line? (_type_ vector vector) symbol) ;; 23
|
||||
(recording-finished? (_type_ vector vector) symbol) ;; 24
|
||||
(draw-starting-line (_type_ vector vector) none) ;; 25
|
||||
(draw-recorded-path (_type_) none) ;; 26
|
||||
(pilot-recorder-method-27 (_type_) none) ;; 27
|
||||
(record-input-sample! (_type_ pilrec-sample) pilrec-sample-flag) ;; 28
|
||||
(lerp-samples! (_type_ pilrec-sample pilrec-sample pilrec-sample float time-frame) none) ;; 29
|
||||
(save-to-db! (_type_) symbol) ;; 30
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern *pilot-recorder-samples* object)
|
||||
;; (define-extern delete-race-path function)
|
||||
;; (define-extern *pilot-recorder* object)
|
||||
;; (define-extern pilot-recorder-init-by-other function)
|
||||
(define-extern *pilot-recorder-samples* pilot-recorder-samples)
|
||||
(define-extern delete-race-path (function int int object))
|
||||
(define-extern *pilot-recorder* (pointer pilot-recorder))
|
||||
(define-extern pilot-recorder-init-by-other (function uint int object :behavior pilot-recorder))
|
||||
(define-extern start-pilot-recorder (function none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
@@ -41,9 +41,6 @@
|
||||
"anim-test-anim-list-handler",
|
||||
"anim-test-sequence-list-handler",
|
||||
"anim-tester-get-playing-item",
|
||||
"start-pilot-recorder",
|
||||
"(anon-function 10 pilot-recorder)",
|
||||
"(anon-function 10 sig-recorder)",
|
||||
// actual asm
|
||||
"quad-copy!",
|
||||
"return-from-thread",
|
||||
@@ -584,7 +581,8 @@
|
||||
[378, 0],
|
||||
[413, 0]
|
||||
],
|
||||
"(trans carry precur-bomb)": [[60, 0]]
|
||||
"(trans carry precur-bomb)": [[60, 0]],
|
||||
"hover-nav-graph-output": [[319, 0]]
|
||||
},
|
||||
|
||||
"mips2c_functions_by_name": [
|
||||
|
||||
@@ -2631,5 +2631,20 @@
|
||||
"(method 14 nav-mesh-editable)": [
|
||||
[16, ["inline-array", "vector", 4]],
|
||||
[80, ["inline-array", "vector", 4]]
|
||||
],
|
||||
"camera-slave-debug": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "matrix"],
|
||||
[128, "curve"]
|
||||
],
|
||||
"hover-nav-graph-output": [
|
||||
[32, "vector"],
|
||||
[48, "vector"]
|
||||
],
|
||||
"(method 25 pilot-recorder)": [[16, ["inline-array", "vector", 2]]],
|
||||
"(method 22 pilot-recorder)": [
|
||||
[16, ["inline-array", "vector", 4]],
|
||||
[80, ["inline-array", "vector", 4]]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11482,5 +11482,267 @@
|
||||
"(trans idle nav-mesh-editor)": [
|
||||
[423, "v0", "int"],
|
||||
[476, "v0", "int"]
|
||||
],
|
||||
"cam-collision-record-draw": [[[45, 240], "s5", "cam-collision-record"]],
|
||||
"camera-fov-frame": [
|
||||
[87, "a0", "vector4w"],
|
||||
[128, "a0", "vector4w"],
|
||||
[169, "a0", "vector4w"],
|
||||
[7, "a0", "cam-dbg-scratch"],
|
||||
[18, "a0", "cam-dbg-scratch"],
|
||||
[29, "a0", "cam-dbg-scratch"],
|
||||
[33, "a2", "cam-dbg-scratch"],
|
||||
[36, "a3", "cam-dbg-scratch"],
|
||||
[39, "t0", "cam-dbg-scratch"],
|
||||
[45, "a0", "cam-dbg-scratch"],
|
||||
[50, "a0", "cam-dbg-scratch"],
|
||||
[54, "a2", "cam-dbg-scratch"],
|
||||
[57, "a3", "cam-dbg-scratch"],
|
||||
[60, "t0", "cam-dbg-scratch"],
|
||||
[66, "a0", "cam-dbg-scratch"],
|
||||
[72, "a0", "cam-dbg-scratch"],
|
||||
[75, "a1", "cam-dbg-scratch"],
|
||||
[83, "a0", "cam-dbg-scratch"],
|
||||
[86, "a1", "cam-dbg-scratch"],
|
||||
[91, "a0", "cam-dbg-scratch"],
|
||||
[95, "a2", "cam-dbg-scratch"],
|
||||
[101, "t0", "cam-dbg-scratch"],
|
||||
[98, "a3", "cam-dbg-scratch"],
|
||||
[107, "a0", "cam-dbg-scratch"],
|
||||
[113, "a0", "cam-dbg-scratch"],
|
||||
[116, "a1", "cam-dbg-scratch"],
|
||||
[124, "a0", "cam-dbg-scratch"],
|
||||
[127, "a1", "cam-dbg-scratch"],
|
||||
[132, "a0", "cam-dbg-scratch"],
|
||||
[136, "a2", "cam-dbg-scratch"],
|
||||
[139, "a3", "cam-dbg-scratch"],
|
||||
[142, "t0", "cam-dbg-scratch"],
|
||||
[148, "a0", "cam-dbg-scratch"],
|
||||
[154, "a0", "cam-dbg-scratch"],
|
||||
[157, "a1", "cam-dbg-scratch"],
|
||||
[165, "a0", "cam-dbg-scratch"],
|
||||
[168, "a1", "cam-dbg-scratch"],
|
||||
[173, "a0", "cam-dbg-scratch"],
|
||||
[177, "a2", "cam-dbg-scratch"],
|
||||
[180, "a3", "cam-dbg-scratch"],
|
||||
[183, "t0", "cam-dbg-scratch"],
|
||||
[189, "a0", "cam-dbg-scratch"],
|
||||
[195, "a0", "cam-dbg-scratch"],
|
||||
[198, "a1", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-sphere": [
|
||||
[[43, 49], "v1", "cam-dbg-scratch"],
|
||||
[64, "v1", "cam-dbg-scratch"],
|
||||
[80, "v1", "cam-dbg-scratch"],
|
||||
[94, "v1", "cam-dbg-scratch"],
|
||||
[109, "v1", "cam-dbg-scratch"],
|
||||
[124, "v1", "cam-dbg-scratch"],
|
||||
[138, "v1", "cam-dbg-scratch"],
|
||||
[152, "v1", "cam-dbg-scratch"],
|
||||
[156, "a0", "cam-dbg-scratch"],
|
||||
[159, "a1", "cam-dbg-scratch"],
|
||||
[164, "a0", "cam-dbg-scratch"],
|
||||
[167, "a1", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-line-draw": [
|
||||
[36, "a0", "cam-dbg-scratch"],
|
||||
[44, "a0", "cam-dbg-scratch"],
|
||||
[2, "a2", "cam-dbg-scratch"],
|
||||
[7, "a0", "cam-dbg-scratch"],
|
||||
[14, "v1", "cam-dbg-scratch"],
|
||||
[18, "v1", "cam-dbg-scratch"],
|
||||
[22, "a0", "cam-dbg-scratch"],
|
||||
[24, "v1", "cam-dbg-scratch"],
|
||||
[29, "a0", "cam-dbg-scratch"],
|
||||
[32, "a1", "cam-dbg-scratch"],
|
||||
[36, "a0", "cam-dbg-scratch"],
|
||||
[44, "a0", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-plot-float-func": [
|
||||
[56, "v1", "cam-dbg-scratch"],
|
||||
[64, "a0", "cam-dbg-scratch"],
|
||||
[68, "a0", "cam-dbg-scratch"],
|
||||
[105, "v1", "cam-dbg-scratch"],
|
||||
[242, "v1", "cam-dbg-scratch"],
|
||||
[21, "a0", "cam-dbg-scratch"],
|
||||
[24, "a0", "cam-dbg-scratch"],
|
||||
[27, "a0", "cam-dbg-scratch"],
|
||||
[30, "a0", "cam-dbg-scratch"],
|
||||
[51, "a0", "cam-dbg-scratch"],
|
||||
[54, "a0", "cam-dbg-scratch"],
|
||||
[56, "v1", "cam-dbg-scratch"],
|
||||
[58, "a0", "cam-dbg-scratch"],
|
||||
[64, "a0", "cam-dbg-scratch"],
|
||||
[87, "a0", "cam-dbg-scratch"],
|
||||
[97, "a0", "cam-dbg-scratch"],
|
||||
[103, "a0", "cam-dbg-scratch"],
|
||||
[105, "v1", "cam-dbg-scratch"],
|
||||
[107, "a0", "cam-dbg-scratch"],
|
||||
[111, "a0", "cam-dbg-scratch"],
|
||||
[114, "a1", "cam-dbg-scratch"],
|
||||
[119, "a0", "cam-dbg-scratch"],
|
||||
[122, "a0", "cam-dbg-scratch"],
|
||||
[128, "a0", "cam-dbg-scratch"],
|
||||
[131, "a0", "cam-dbg-scratch"],
|
||||
[135, "a0", "cam-dbg-scratch"],
|
||||
[138, "a1", "cam-dbg-scratch"],
|
||||
[142, "a0", "cam-dbg-scratch"],
|
||||
[148, "a0", "cam-dbg-scratch"],
|
||||
[154, "a0", "cam-dbg-scratch"],
|
||||
[160, "a0", "cam-dbg-scratch"],
|
||||
[164, "a0", "cam-dbg-scratch"],
|
||||
[167, "a1", "cam-dbg-scratch"],
|
||||
[171, "a0", "cam-dbg-scratch"],
|
||||
[174, "a0", "cam-dbg-scratch"],
|
||||
[177, "a0", "cam-dbg-scratch"],
|
||||
[183, "a0", "cam-dbg-scratch"],
|
||||
[187, "a0", "cam-dbg-scratch"],
|
||||
[190, "a1", "cam-dbg-scratch"],
|
||||
[197, "a0", "cam-dbg-scratch"],
|
||||
[200, "a0", "cam-dbg-scratch"],
|
||||
[206, "a0", "cam-dbg-scratch"],
|
||||
[212, "a0", "cam-dbg-scratch"],
|
||||
[216, "a0", "cam-dbg-scratch"],
|
||||
[219, "a1", "cam-dbg-scratch"],
|
||||
[223, "a0", "cam-dbg-scratch"],
|
||||
[226, "a0", "cam-dbg-scratch"],
|
||||
[238, "a0", "cam-dbg-scratch"],
|
||||
[242, "v1", "cam-dbg-scratch"],
|
||||
[244, "a0", "cam-dbg-scratch"],
|
||||
[247, "a0", "cam-dbg-scratch"],
|
||||
[266, "a0", "cam-dbg-scratch"],
|
||||
[270, "a0", "cam-dbg-scratch"],
|
||||
[273, "a1", "cam-dbg-scratch"]
|
||||
],
|
||||
"cam-line-dma": [
|
||||
[32, "t0", "vector"],
|
||||
[36, "t0", "vector"],
|
||||
[45, "t0", "vector"],
|
||||
[50, "t0", "vector"],
|
||||
[[12, 16], "a3", "dma-packet"],
|
||||
[[22, 25], "a3", "gs-gif-tag"],
|
||||
[[33, 38], "a3", "(pointer uint128)"],
|
||||
[[46, 52], "a1", "(pointer uint128)"],
|
||||
[[60, 65], "a0", "dma-packet"],
|
||||
[[65, 74], "a0", "(pointer uint64)"]
|
||||
],
|
||||
"camera-line2d": [
|
||||
[4, "a2", "cam-dbg-scratch"],
|
||||
[6, "a0", "cam-dbg-scratch"],
|
||||
[10, "a0", "cam-dbg-scratch"],
|
||||
[13, "a0", "cam-dbg-scratch"],
|
||||
[14, "a1", "cam-dbg-scratch"],
|
||||
[18, "a0", "cam-dbg-scratch"],
|
||||
[20, "a1", "cam-dbg-scratch"],
|
||||
[24, "a0", "cam-dbg-scratch"],
|
||||
[27, "a0", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-line-setup": [[2, "a0", "cam-dbg-scratch"]],
|
||||
"camera-line-rel-len": [
|
||||
[9, "a0", "cam-dbg-scratch"],
|
||||
[5, "a0", "cam-dbg-scratch"],
|
||||
[12, "a1", "cam-dbg-scratch"],
|
||||
[18, "a0", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-line-rel": [
|
||||
[2, "a3", "cam-dbg-scratch"],
|
||||
[8, "a1", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-bounding-box-draw": [
|
||||
[6, "a0", "cam-dbg-scratch"],
|
||||
[15, "a0", "cam-dbg-scratch"],
|
||||
[21, "v1", "cam-dbg-scratch"],
|
||||
[24, "a0", "cam-dbg-scratch"],
|
||||
[30, "v1", "cam-dbg-scratch"],
|
||||
[33, "a0", "cam-dbg-scratch"],
|
||||
[39, "v1", "cam-dbg-scratch"],
|
||||
[42, "a0", "cam-dbg-scratch"],
|
||||
[48, "v1", "cam-dbg-scratch"],
|
||||
[51, "a0", "cam-dbg-scratch"],
|
||||
[57, "v1", "cam-dbg-scratch"],
|
||||
[62, "a1", "cam-dbg-scratch"],
|
||||
[68, "a1", "cam-dbg-scratch"],
|
||||
[74, "a1", "cam-dbg-scratch"],
|
||||
[80, "a1", "cam-dbg-scratch"],
|
||||
[86, "a1", "cam-dbg-scratch"],
|
||||
[92, "a1", "cam-dbg-scratch"],
|
||||
[97, "a0", "cam-dbg-scratch"],
|
||||
[100, "a1", "cam-dbg-scratch"],
|
||||
[105, "a0", "cam-dbg-scratch"],
|
||||
[108, "a1", "cam-dbg-scratch"],
|
||||
[113, "a0", "cam-dbg-scratch"],
|
||||
[116, "a1", "cam-dbg-scratch"],
|
||||
[121, "a0", "cam-dbg-scratch"],
|
||||
[124, "a1", "cam-dbg-scratch"],
|
||||
[129, "a0", "cam-dbg-scratch"],
|
||||
[132, "a1", "cam-dbg-scratch"],
|
||||
[137, "a0", "cam-dbg-scratch"],
|
||||
[140, "a1", "cam-dbg-scratch"],
|
||||
[12, "v1", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-cross": [
|
||||
[8, "a0", "cam-dbg-scratch"],
|
||||
[14, "a0", "cam-dbg-scratch"],
|
||||
[18, "a2", "cam-dbg-scratch"],
|
||||
[22, "a0", "cam-dbg-scratch"],
|
||||
[26, "a2", "cam-dbg-scratch"],
|
||||
[31, "a0", "cam-dbg-scratch"],
|
||||
[34, "a1", "cam-dbg-scratch"],
|
||||
[39, "a0", "cam-dbg-scratch"],
|
||||
[42, "a1", "cam-dbg-scratch"],
|
||||
[47, "a0", "cam-dbg-scratch"],
|
||||
[52, "a0", "cam-dbg-scratch"],
|
||||
[52, "a0", "cam-dbg-scratch"],
|
||||
[56, "a2", "cam-dbg-scratch"],
|
||||
[60, "a0", "cam-dbg-scratch"],
|
||||
[64, "a2", "cam-dbg-scratch"],
|
||||
[69, "a0", "cam-dbg-scratch"],
|
||||
[72, "a1", "cam-dbg-scratch"],
|
||||
[77, "a0", "cam-dbg-scratch"],
|
||||
[80, "a1", "cam-dbg-scratch"],
|
||||
[85, "a0", "cam-dbg-scratch"],
|
||||
[90, "a0", "cam-dbg-scratch"],
|
||||
[94, "a2", "cam-dbg-scratch"],
|
||||
[98, "a0", "cam-dbg-scratch"],
|
||||
[101, "a1", "cam-dbg-scratch"],
|
||||
[106, "a0", "cam-dbg-scratch"],
|
||||
[109, "a1", "cam-dbg-scratch"]
|
||||
],
|
||||
"cam-debug-draw-tris": [
|
||||
[20, "a0", "cam-dbg-scratch"],
|
||||
[88, "a0", "cam-dbg-scratch"]
|
||||
],
|
||||
"camera-fov-draw": [
|
||||
[16, "t2", "cam-dbg-scratch"],
|
||||
[30, "a3", "cam-dbg-scratch"],
|
||||
[43, "a0", "cam-dbg-scratch"],
|
||||
[60, "a0", "cam-dbg-scratch"],
|
||||
[63, "a1", "cam-dbg-scratch"],
|
||||
[68, "a0", "cam-dbg-scratch"],
|
||||
[71, "a1", "cam-dbg-scratch"],
|
||||
[76, "a0", "cam-dbg-scratch"],
|
||||
[79, "a1", "cam-dbg-scratch"],
|
||||
[2, "t2", "cam-dbg-scratch"],
|
||||
[13, "v1", "(pointer vector)"],
|
||||
[27, "v1", "(pointer vector)"],
|
||||
[40, "v1", "(pointer vector)"],
|
||||
[53, "v1", "(pointer vector)"]
|
||||
],
|
||||
"cam-collision-record-save": [[[8, 56], "v1", "cam-collision-record"]],
|
||||
"(method 9 hover-nav-bsp-node)": [[[22, 28], "v1", "hover-nav-bsp-point"]],
|
||||
"(method 0 hover-nav-bsp-node)": [[[6, 9], "v0", "hover-nav-bsp-node"]],
|
||||
"(method 0 hover-nav-bsp-point)": [[[6, 8], "v0", "hover-nav-bsp-point"]],
|
||||
"(method 28 pilot-recorder)": [[20, "v1", "vehicle"]],
|
||||
"hover-nav-network-build-bsp": [
|
||||
[26, "a0", "(pointer int32)"],
|
||||
[33, "a1", "vector"]
|
||||
],
|
||||
"sampler-stop": [[1, "v1", "timer-bank"]],
|
||||
"(top-level-login sampler)": [[14, "v1", "timer-bank"]],
|
||||
"sampler-start": [
|
||||
[3, "v1", "timer-bank"],
|
||||
[6, "a0", "timer-bank"],
|
||||
[24, "a0", "timer-bank"],
|
||||
[1, "v1", "timer-bank"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2174,5 +2174,10 @@
|
||||
"vars": {
|
||||
"v0-3": ["filter", "editable-filter"]
|
||||
}
|
||||
},
|
||||
"(method 28 pilot-recorder)": {
|
||||
"vars": {
|
||||
"v0-0": ["flag", "pilrec-sample-flag"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,5 +5,44 @@
|
||||
;; name in dgo: sampler
|
||||
;; dgos: GAME
|
||||
|
||||
;; og:ignore-form:install-handler 9 timer0-handler
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
(define *sampler-mem* (the-as pointer #f))
|
||||
|
||||
(define *sampler-compare* (the-as uint 1))
|
||||
|
||||
(define *sampler-count* 0)
|
||||
|
||||
;; ERROR: function was not converted to expressions. Cannot decompile.
|
||||
|
||||
;; og:preserve-this
|
||||
; (set! (-> (the-as timer-bank #x10000000) mode) (new 'static 'timer-mode))
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
(defun-debug sampler-stop ()
|
||||
(set! (-> (the-as timer-bank #x10000000) mode) (new 'static 'timer-mode))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -7,3 +7,655 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
(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
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype hover-nav-bsp-point (list-node)
|
||||
((index int32)
|
||||
(pos vector :inline)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_)
|
||||
)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype hover-nav-bsp (structure)
|
||||
((root hover-nav-bsp-node)
|
||||
)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
(define *hover-bsp* (the-as hover-nav-bsp #f))
|
||||
|
||||
(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
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
|
||||
@@ -5,5 +5,671 @@
|
||||
;; name in dgo: pilot-recorder
|
||||
;; dgos: WASLEAPR, DESRALLY, DESTRACK
|
||||
|
||||
;; +++pilrec-sample-flag
|
||||
(defenum pilrec-sample-flag
|
||||
:type uint8
|
||||
:bitfield #t
|
||||
(square 0)
|
||||
(l1 1)
|
||||
(x 2)
|
||||
)
|
||||
;; ---pilrec-sample-flag
|
||||
|
||||
(declare-type pilot-recorder-samples basic)
|
||||
(define-extern *pilot-recorder-samples* pilot-recorder-samples)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; this file is debug only
|
||||
(declare-file (debug))
|
||||
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(deftype pilot-recorder-samples (basic)
|
||||
((samples (inline-array pilrec-sample))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(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)))
|
||||
)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; 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
|
||||
)
|
||||
|
||||
(define *pilot-recorder* (the-as (pointer pilot-recorder) #f))
|
||||
|
||||
;; 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
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
;; 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)
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(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
|
||||
)
|
||||
|
||||
(defstate die-fast (pilot-recorder)
|
||||
:virtual #t
|
||||
:code nothing
|
||||
)
|
||||
|
||||
(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)
|
||||
)
|
||||
|
||||
(defun start-pilot-recorder ()
|
||||
(process-spawn pilot-recorder *select-race* *select-race-path* :name "pilot-recorder" :to *target*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
)
|
||||
)
|
||||
|
||||
(define-extern start-pilot-recorder (function none))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(define *v-snake-racer-constants* (new 'static 'rigid-body-vehicle-constants))
|
||||
|
||||
+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)
|
||||
)
|
||||
@@ -391,7 +391,8 @@
|
||||
"(method 19 rope-prim-system)",
|
||||
// funny casts with matrix.
|
||||
"sprite-add-matrix-data",
|
||||
"(method 17 nav-mesh-editable)" // weird delay branch that tries to set a variable that doesn't exist
|
||||
"(method 17 nav-mesh-editable)", // weird delay branch that tries to set a variable that doesn't exist
|
||||
"camera-fov-frame"
|
||||
],
|
||||
|
||||
"skip_compile_states": {
|
||||
|
||||
Reference in New Issue
Block a user