d/jak2: finish the majority of sparticle and sparticle-launcher (#1840)

* sparticle-launcher

* d/jak2: large amount of `sparticle-launcher` done

* d/jak2: finish the majority of `sparticle`

* decomp: improve format code ignoring

* d/jak2: make bits unique in `sp-cpuinfo-flag`

* d/jak1: revert config change
This commit is contained in:
Tyler Wilding
2022-09-05 18:03:46 -04:00
committed by GitHub
parent 71871595da
commit 80d0137dba
28 changed files with 6522 additions and 675 deletions
+1 -1
View File
@@ -994,7 +994,7 @@
:size-assert #x206c
:flag-assert #x5c0000206c
(:methods
(ocean-method-11 () none 11)
(ocean-method-11 (_type_ (inline-array vector) symbol) float 11)
(ocean-method-12 () none 12)
(ocean-method-13 () none 13)
(ocean-method-14 () none 14)
@@ -15,8 +15,8 @@
(fade rgbaf :inline :offset-assert 48)
(acc vector :inline :offset-assert 64)
(rotvel3d quaternion :inline :offset-assert 80)
(vel vector3s :inline :offset 16)
(accel vector3s :inline :offset 64)
(vel vector :inline :offset 16)
(accel vector :inline :offset 64)
(scalevelx float :offset 28)
(scalevely float :offset 44)
(friction float :offset-assert 96)
@@ -36,6 +36,7 @@
(clock-index uint8 :offset-assert 129)
(user1-int16 uint16 :offset-assert 130)
(key sparticle-launch-control :offset-assert 132)
(key-alt sparticle-launch-state :offset 132)
(binding sparticle-launch-state :offset-assert 136)
(data uint32 1 :offset 12)
(datab uint8 4 :offset 12)
@@ -153,6 +154,9 @@
:method-count-assert 9
:size-assert #x34
:flag-assert #x900000034
(:methods
(new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0)
)
)
;; definition for method 3 of type sparticle-system
@@ -177,7 +181,3 @@
;; failed to figure out what this is:
0
@@ -95,12 +95,13 @@
:size-assert #x10
:flag-assert #xb00000010
(:methods
(sparticle-launcher-method-9 (_type_ int) uint 9)
(sparticle-launcher-method-10 (_type_) none 10)
(get-field-spec-by-id (_type_ sp-field-id) sp-field-init-spec 9)
(sparticle-launcher-method-10 (_type_ string) none 10)
)
)
;; definition for method 3 of type sparticle-launcher
;; INFO: this function exists in multiple non-identical object files
(defmethod inspect sparticle-launcher ((obj sparticle-launcher))
(when (not obj)
(set! obj obj)
@@ -220,7 +221,7 @@
:size-assert #x40
:flag-assert #xa00000040
(:methods
(sparticle-launch-group-method-9 () none 9)
(create-launch-control (_type_ process) sparticle-launch-control 9)
)
)
@@ -254,7 +255,7 @@
;; definition of type sparticle-launch-control
(deftype sparticle-launch-control (inline-array-class)
((group sparticle-launch-group :offset-assert 16)
(proc process :offset-assert 20)
(proc process-drawable :offset-assert 20)
(local-clock int32 :offset-assert 24)
(fade float :offset-assert 28)
(matrix int8 :offset-assert 32)
@@ -270,13 +271,13 @@
:size-assert #x70
:flag-assert #x1000000070
(:methods
(sparticle-launch-control-method-9 () none 9)
(sparticle-launch-control-method-10 () none 10)
(sparticle-launch-control-method-11 () none 11)
(sparticle-launch-control-method-12 () none 12)
(sparticle-launch-control-method-13 () none 13)
(sparticle-launch-control-method-14 () none 14)
(sparticle-launch-control-method-15 () none 15)
(initialize (_type_ sparticle-launch-group process) none 9)
(sparticle-launch-control-method-10 (_type_ vector) symbol 10)
(sparticle-launch-control-method-11 (_type_ vector) none 11)
(sparticle-launch-control-method-12 (_type_ matrix) none 12)
(sparticle-launch-control-method-13 (_type_ cspace) none 13)
(kill-and-free-particles (_type_) none 14)
(kill-particles (_type_) none 15)
)
)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,812 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 2 of type sparticle-cpuinfo
;; INFO: Return type mismatch object vs sparticle-cpuinfo.
(defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo))
(format #t "<sparticle-cpuinfo>~%")
(dotimes (s5-0 16)
(format #t "~D:~F~%" s5-0 (the-as float (-> obj data s5-0)))
)
(format #t "TIMER:~D~%" (-> obj timer))
(the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> obj flags)))
)
;; definition for function sp-particle-copy!
;; INFO: Used lq/sq
;; INFO: Return type mismatch (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) vs none.
(defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo))
(let ((v1-1 (-> arg1 sprite x-y-z-sx quad)))
(set! (-> arg0 sprite x-y-z-sx quad) v1-1)
)
(let ((v1-3 (-> arg1 sprite flag-rot-sy quad)))
(set! (-> arg0 sprite flag-rot-sy quad) v1-3)
)
(let ((v1-5 (-> arg1 sprite r-g-b-a quad)))
(set! (-> arg0 sprite r-g-b-a quad) v1-5)
)
(dotimes (v1-6 10)
(set! (-> arg0 adgif prims v1-6) (-> arg1 adgif prims v1-6))
)
(set! (-> arg0 vel-sxvel quad) (-> arg1 vel-sxvel quad))
(set! (-> arg0 rot-syvel quad) (-> arg1 rot-syvel quad))
(set! (-> arg0 fade quad) (-> arg1 fade quad))
(set! (-> arg0 acc quad) (-> arg1 acc quad))
(set! (-> arg0 friction) (-> arg1 friction))
(set! (-> arg0 timer) (-> arg1 timer))
(set! (-> arg0 flags) (-> arg1 flags))
(set! (-> arg0 user-float) (-> arg1 user-float))
(set! (-> arg0 sp-func) (-> arg1 sp-func))
(none)
)
;; definition for method 0 of type sparticle-system
(defmethod new sparticle-system ((allocation symbol)
(type-to-make type)
(arg0 int)
(arg1 int)
(arg2 symbol)
(arg3 pointer)
(arg4 (inline-array adgif-shader))
)
(let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(let* ((v1-3 (/ (+ arg0 63) 64))
(a0-2 (/ (+ arg1 63) 64))
(a1-2 (* v1-3 64))
(a2-2 (* a0-2 64))
(s2-1 (+ v1-3 a0-2))
(s5-1 (+ a1-2 a2-2))
)
(set! (-> gp-0 blocks 0) v1-3)
(set! (-> gp-0 length 0) a1-2)
(set! (-> gp-0 num-alloc 0) 0)
(set! (-> gp-0 blocks 1) a0-2)
(set! (-> gp-0 length 1) a2-2)
(set! (-> gp-0 num-alloc 1) 0)
(set! (-> gp-0 is-3d) (the-as basic arg2))
(set! (-> gp-0 alloc-table) (the-as (pointer uint64) (malloc 'global (* s2-1 8))))
(set! (-> gp-0 cpuinfo-table) (the-as (inline-array sparticle-cpuinfo) (malloc 'global (* 144 s5-1))))
(set! (-> gp-0 vecdata-table) arg3)
(set! (-> gp-0 adgifdata-table) arg4)
(dotimes (v1-5 s2-1)
(set! (-> gp-0 alloc-table v1-5) (the-as uint -1))
)
(dotimes (s4-1 s5-1)
(set! (-> gp-0 cpuinfo-table s4-1 valid) (the-as uint 0))
(set! (-> gp-0 cpuinfo-table s4-1 sprite)
(the-as sprite-vec-data-2d (&+ (-> gp-0 vecdata-table) (* 48 s4-1)))
)
(set! (-> gp-0 cpuinfo-table s4-1 adgif) (-> gp-0 adgifdata-table s4-1))
(adgif-shader<-texture-simple! (-> gp-0 adgifdata-table s4-1) (the-as texture #f))
(set! (-> gp-0 adgifdata-table s4-1 alpha) (new 'static 'gs-alpha :b #x2 :d #x1))
)
)
gp-0
)
)
;; failed to figure out what this is:
(kmemopen global "part-systems")
;; definition for symbol *sp-particle-system-2d*, type sparticle-system
(define *sp-particle-system-2d*
(new 'global 'sparticle-system 1920 128 #f (-> *sprite-array-2d* vec-data) (-> *sprite-array-2d* adgif-data))
)
;; definition for symbol *sp-particle-system-3d*, type sparticle-system
(define *sp-particle-system-3d*
(new 'global 'sparticle-system 256 0 #t (-> *sprite-array-3d* vec-data) (-> *sprite-array-3d* adgif-data))
)
;; failed to figure out what this is:
(kmemclose)
;; definition for function sp-get-block-size
(defun sp-get-block-size ((arg0 sparticle-system) (arg1 int))
(let ((v0-0 0))
(let ((v1-0 0)
(a2-0 (-> arg0 blocks 0))
)
(when (= arg1 1)
(set! v1-0 a2-0)
(set! a2-0 (-> arg0 blocks 1))
)
(dotimes (a1-3 a2-0)
(if (!= (-> arg0 alloc-table (+ v1-0 a1-3)) -1)
(set! v0-0 (+ a1-3 1))
)
)
)
v0-0
)
)
;; definition for function sp-get-approx-alloc-size
(defun sp-get-approx-alloc-size ((arg0 sparticle-system) (arg1 int))
(let ((a3-0 arg1)
(v1-0 0)
)
(let ((a1-1 0)
(a2-0 (-> arg0 blocks 0))
)
(when (= a3-0 1)
(set! a1-1 a2-0)
(set! a2-0 (-> arg0 blocks 1))
)
(dotimes (a3-3 a2-0)
(if (!= (-> arg0 alloc-table (+ a1-1 a3-3)) -1)
(set! v1-0 (+ a3-3 1))
)
)
)
(* v1-0 64)
)
)
;; definition for function sp-free-particle
;; INFO: Return type mismatch int vs none.
(defun sp-free-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-cpuinfo) (arg3 sprite-vec-data-2d))
(if (and (-> arg2 binding) (nonzero? (-> arg2 binding)))
(logclear! (-> arg2 binding flags) (sp-launch-state-flags launcher-active particles-active))
)
(let ((v1-6 (/ arg1 64))
(t0-4 (logand arg1 63))
)
(logior! (-> arg0 alloc-table v1-6) (ash 1 t0-4))
)
(if (< arg1 (-> arg0 length 0))
(+! (-> arg0 num-alloc 0) -1)
(+! (-> arg0 num-alloc 1) -1)
)
(set! (-> arg2 valid) (the-as uint 0))
(set! (-> arg3 r-g-b-a w) 0.0)
0
(none)
)
;; definition for function sp-get-particle
;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; ERROR: Unsupported inline assembly instruction kind - [movz a2, t2, t1]
(defun sp-get-particle ((arg0 sparticle-system) (arg1 int) (arg2 sparticle-launch-state))
(local-vars
(a2-3 int)
(a2-4 int)
(a2-5 int)
(a2-6 int)
(a2-7 int)
(a2-8 int)
(t1-16 int)
(t1-17 int)
(t1-18 int)
(t1-19 int)
(t1-20 int)
(t3-5 int)
)
(let ((v1-0 0)
(t0-0 (-> arg0 blocks 0))
(a3-0 0)
)
(when (= arg1 1)
(set! v1-0 t0-0)
(set! t0-0 (-> arg0 blocks 1))
)
(when arg2
(set! a3-0 (the-as int (-> arg2 randomize)))
(+! (-> arg2 randomize) 1)
(when (= (-> arg2 randomize) t0-0)
(set! (-> arg2 randomize) (the-as uint 0))
0
)
)
(dotimes (a2-1 t0-0)
(when (nonzero? (-> arg0 alloc-table (+ v1-0 a3-0)))
(let ((a2-2 0)
(t1-15 (-> arg0 alloc-table (+ v1-0 a3-0)))
(t0-4 (* (+ v1-0 a3-0) 64))
)
0
0
(let ((t2-4 (shl t1-15 32))
(t3-0 (+ a2-2 32))
)
(move-if-not-zero t1-16 t2-4 t2-4 t1-15)
(.movz a2-3 t3-0 t2-4 a2-2)
)
(let ((t2-5 (shl t1-16 16))
(t3-1 (+ a2-3 16))
)
(move-if-not-zero t1-17 t2-5 t2-5 t1-16)
(.movz a2-4 t3-1 t2-5 a2-3)
)
(let ((t2-6 (* t1-17 256))
(t3-2 (+ a2-4 8))
)
(move-if-not-zero t1-18 t2-6 t2-6 t1-17)
(.movz a2-5 t3-2 t2-6 a2-4)
)
(let ((t2-7 (* t1-18 16))
(t3-3 (+ a2-5 4))
)
(move-if-not-zero t1-19 t2-7 t2-7 t1-18)
(.movz a2-6 t3-3 t2-7 a2-5)
)
(let ((t2-8 (* t1-19 4))
(t3-4 (+ a2-6 2))
)
(move-if-not-zero t1-20 t2-8 t2-8 t1-19)
(.movz a2-7 t3-4 t2-8 a2-6)
(let ((t1-21 (* t1-20 2))
(t2-9 (+ a2-7 1))
)
(move-if-not-zero t3-5 t1-21 t1-21 t3-4)
(.movz a2-8 t2-9 t1-21 a2-7)
)
)
(let ((t0-5 (+ t0-4 a2-8)))
(logxor! (-> arg0 alloc-table (+ v1-0 a3-0)) (the-as uint (ash 1 a2-8)))
(+! (-> arg0 num-alloc arg1) 1)
(let ((v1-9 (-> arg0 cpuinfo-table t0-5)))
(set! (-> v1-9 valid) (the-as uint 1))
(return v1-9)
)
)
)
)
(+! a3-0 1)
(if (= a3-0 t0-0)
(set! a3-0 0)
)
)
)
(the-as sparticle-cpuinfo #f)
)
;; definition for function sp-kill-particle
(defun sp-kill-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(cond
((>= (the-as int arg1) #x70000000)
(set! (-> arg1 timer) 0)
0
)
(else
(let ((a2-1 (/ (the-as int (- (the-as uint arg1) (the-as uint (the-as uint (-> arg0 cpuinfo-table 0))))) 144)))
(when (or (< a2-1 0) (>= a2-1 (+ (-> arg0 length 0) (-> arg0 length 1))))
(format 0 "Tried to release particle ~D~%" a2-1)
(return #f)
)
(sp-free-particle arg0 a2-1 arg1 (-> arg1 sprite))
)
)
)
#t
)
;; definition for function sp-orbiter
;; INFO: Return type mismatch int vs none.
(defun sp-orbiter ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
(let* ((f2-0 (-> arg1 omega))
(f0-0 (-> arg1 radius))
(f3-0 (-> arg1 vel-sxvel x))
(f30-0 (-> arg1 vel-sxvel y))
(f1-0 (-> arg1 vel-sxvel z))
(f4-0 (-> *display* clock (-> arg1 clock-index) sparticle-data y))
(f26-0 (+ f2-0 (* f3-0 f4-0)))
)
(set! (-> arg1 omega) f26-0)
(let ((f28-0 (+ f0-0 (* f1-0 f4-0))))
(set! (-> arg1 radius) f28-0)
(let ((f24-0 (sin f26-0))
(f26-1 (cos f26-0))
(f22-0 (sin (* 0.5 f30-0)))
(f0-5 (cos (* 0.5 f30-0)))
(a1-1 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(let ((s3-0 (new 'stack-no-clear 'matrix)))
(set-vector! a1-1 (* f22-0 f26-1) 0.0 (* f22-0 f24-0) f0-5)
(quaternion*! (-> arg1 rotvel3d) (the-as quaternion a1-1) (-> arg1 rotvel3d))
(quaternion-normalize! (-> arg1 rotvel3d))
(set-vector! s4-0 (* f24-0 f28-0) 0.0 (* f26-1 f28-0) 1.0)
(quaternion->matrix s3-0 (-> arg1 rotvel3d))
(vector-matrix*! s4-0 s4-0 s3-0)
)
(let ((v1-8 (the-as sprite-vec-data-2d (-> arg1 user-float))))
(set! (-> arg2 x) (+ (-> s4-0 x) (-> v1-8 x-y-z-sx x)))
(set! (-> arg2 y) (+ (-> s4-0 y) (-> v1-8 x-y-z-sx y)))
(set! (-> arg2 z) (+ (-> s4-0 z) (-> v1-8 x-y-z-sx z)))
)
)
)
)
0
(none)
)
;; definition for function sp-process-block-2d
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function sp-process-block-3d
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function sp-copy-to-spr
;; INFO: Return type mismatch int vs none.
(defun sp-copy-to-spr ((arg0 int) (arg1 pointer) (arg2 int))
(let ((a2-1 (/ (+ arg2 15) 16)))
(dma-send-to-spr-no-flush (the-as uint arg0) (the-as uint arg1) (the-as uint a2-1) #t)
)
0
(none)
)
;; definition for function sp-copy-from-spr
;; INFO: Return type mismatch int vs none.
(defun sp-copy-from-spr ((arg0 int) (arg1 pointer) (arg2 int))
(let ((a2-1 (/ (+ arg2 15) 16)))
(dma-send-from-spr-no-flush (the-as uint arg1) (the-as uint arg0) (the-as uint a2-1) #t)
)
0
(none)
)
;; definition for function memcpy
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function sp-process-block
;; INFO: Used lq/sq
;; INFO: Return type mismatch int vs none.
(defun sp-process-block ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d) (arg3 int))
(local-vars (sv-16 int) (sv-32 int) (sv-48 int) (sv-64 int))
(let ((s3-0 208)
(s2-0 (* 144 arg3))
(s5-0 (* 48 arg3))
)
(set! sv-32 (* 80 arg3))
(let ((s1-0 (+ s3-0 s2-0)))
(set! sv-16 (+ s1-0 s5-0))
(sp-copy-to-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
(sp-copy-to-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
(let ((t9-2 sp-copy-to-spr)
(a1-7 (-> arg0 adgifdata-table arg1))
)
(t9-2 sv-16 (the-as pointer a1-7) sv-32)
)
(set! sv-48 (+ #x70000000 s3-0))
(set! sv-64 (+ #x70000000 s1-0))
(let ((t1-0 (paused?)))
(cond
((-> arg0 is-3d)
(let ((t9-4 sp-process-block-3d)
(a0-6 arg0)
(a3-1 arg1)
)
(t9-4 a0-6 sv-48 sv-64 a3-1 arg3 t1-0)
)
)
(else
(sp-process-block-2d arg0 sv-48 sv-64 arg1 arg3 t1-0)
)
)
)
(sp-copy-from-spr s3-0 (the-as pointer (-> arg0 cpuinfo-table arg1)) s2-0)
(sp-copy-from-spr s1-0 (&+ (-> arg0 vecdata-table) (* 48 arg1)) s5-0)
)
)
0
(none)
)
;; definition for function sp-process-particle-system
;; INFO: Used lq/sq
;; INFO: Return type mismatch int vs none.
(defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d))
(countdown (v1-0 13)
(let ((a0-4 (-> *display* clock v1-0 sparticle-data quad)))
(set! (-> (the-as vector (+ #x70000000 (* v1-0 16))) quad) a0-4)
)
)
(let* ((v1-3 208)
(s1-0 (/ (- #x4000 v1-3) 272))
(s2-0 0)
(s3-0 (sp-get-approx-alloc-size arg0 arg1))
)
(if (= arg1 1)
(set! s2-0 (* (-> arg0 blocks 0) 64))
)
(set! (-> arg2 num-valid arg1) s3-0)
(flush-cache 0)
(while (>= s3-0 s1-0)
(sp-process-block arg0 s2-0 arg2 s1-0)
(set! s3-0 (- s3-0 s1-0))
(+! s2-0 s1-0)
)
(if (> s3-0 0)
(sp-process-block arg0 s2-0 arg2 s3-0)
)
)
0
(none)
)
;; definition (perm) for symbol *particles-flag*, type symbol
(define-perm *particles-flag* symbol #t)
;; definition for function forall-particles-with-key-runner
;; INFO: Used lq/sq
;; INFO: Return type mismatch int vs none.
(defun forall-particles-with-key-runner ((arg0 sparticle-launch-control)
(arg1 (function sparticle-system sparticle-cpuinfo none))
(arg2 sparticle-system)
)
(local-vars (sv-16 int))
(let ((s3-0 (the-as object (-> arg2 cpuinfo-table 0)))
(s2-0 (&+ (-> arg2 vecdata-table) 0))
(s1-0 (+ (-> arg2 blocks 0) (-> arg2 blocks 1)))
)
(dotimes (s0-0 s1-0)
(cond
((!= (-> arg2 alloc-table s0-0) -1)
(set! sv-16 0)
(while (< sv-16 64)
(if (and (nonzero? (-> (the-as sparticle-cpuinfo s3-0) valid)) (= (-> (the-as sparticle-cpuinfo s3-0) key) arg0))
(arg1 arg2 (the-as sparticle-cpuinfo s3-0))
)
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 1))
(&+! s2-0 48)
(set! sv-16 (+ sv-16 1))
)
)
(else
(set! s3-0 (-> (the-as (inline-array sparticle-cpuinfo) s3-0) 64))
(&+! s2-0 3072)
)
)
)
)
0
(none)
)
;; definition for function forall-particles-with-key
;; INFO: Return type mismatch int vs none.
(defun forall-particles-with-key ((arg0 sparticle-launch-control)
(arg1 (function sparticle-system sparticle-cpuinfo none))
(arg2 symbol)
(arg3 symbol)
)
(if arg2
(forall-particles-with-key-runner arg0 arg1 *sp-particle-system-2d*)
)
(if arg3
(forall-particles-with-key-runner arg0 arg1 *sp-particle-system-3d*)
)
0
(none)
)
;; definition for function sparticle-kill-it
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(set! (-> arg1 timer) 0)
(set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0))
(when (and (-> arg1 binding) (nonzero? (-> arg1 binding)))
(logclear! (-> arg1 binding flags) (sp-launch-state-flags launcher-active particles-active))
(set! (-> arg1 binding) #f)
)
0
(none)
)
;; definition for function sparticle-kill-it-level0
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it-level0 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(if (zero? (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)))
(sparticle-kill-it arg0 arg1)
)
0
(none)
)
;; definition for function sparticle-kill-it-level1
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it-level1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))
(sp-cpuinfo-flag sp-cpuinfo-flag-9)
)
(sparticle-kill-it arg0 arg1)
)
0
(none)
)
;; definition for function sparticle-kill-it-level2
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it-level2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag level0))
(sparticle-kill-it arg0 arg1)
)
0
(none)
)
;; definition for function sparticle-kill-it-level3
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it-level3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))
(sp-cpuinfo-flag sp-cpuinfo-flag-9 level0)
)
(sparticle-kill-it arg0 arg1)
)
0
(none)
)
;; definition for function sparticle-kill-it-level4
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it-level4 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1)) (sp-cpuinfo-flag level1))
(sparticle-kill-it arg0 arg1)
)
0
(none)
)
;; definition for function sparticle-kill-it-level5
;; INFO: Return type mismatch int vs none.
(defun sparticle-kill-it-level5 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo))
(if (= (logand (-> arg1 flags) (sp-cpuinfo-flag sp-cpuinfo-flag-9 level0 level1))
(sp-cpuinfo-flag sp-cpuinfo-flag-9 level1)
)
(sparticle-kill-it arg0 arg1)
)
0
(none)
)
;; definition for function sparticle-60-to-50
;; INFO: Return type mismatch int vs none.
(defun sparticle-60-to-50 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer))
(let ((gp-0 (-> arg1 rotvel3d))
(s5-0 (new 'stack-no-clear 'vector))
)
(vector-angle<-quaternion! s5-0 gp-0)
(set! (-> s5-0 w) (* 12516.455 (-> s5-0 w)))
(quaternion-vector-angle! gp-0 s5-0 (-> s5-0 w))
)
0
(none)
)
;; definition for function sparticle-50-to-60
;; INFO: Return type mismatch int vs none.
(defun sparticle-50-to-60 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer))
(let ((gp-0 (-> arg1 rotvel3d))
(s5-0 (new 'stack-no-clear 'vector))
)
(vector-angle<-quaternion! s5-0 gp-0)
(set! (-> s5-0 w) (* 8691.982 (-> s5-0 w)))
(quaternion-vector-angle! gp-0 s5-0 (-> s5-0 w))
)
0
(none)
)
;; definition for function kill-all-particles-with-key
;; INFO: Return type mismatch int vs none.
(defun kill-all-particles-with-key ((arg0 sparticle-launch-control))
(forall-particles-with-key arg0 sparticle-kill-it #t #t)
0
(none)
)
;; definition for function forall-particles-runner
;; INFO: Return type mismatch int vs none.
(defun forall-particles-runner ((arg0 (function sparticle-system sparticle-cpuinfo pointer none)) (arg1 sparticle-system))
(let ((s4-0 (the-as object (-> arg1 cpuinfo-table 0)))
(s3-0 (&+ (-> arg1 vecdata-table) 0))
(s2-0 (+ (-> arg1 blocks 0) (-> arg1 blocks 1)))
)
(dotimes (s1-0 s2-0)
(cond
((!= (-> arg1 alloc-table s1-0) -1)
(dotimes (s0-0 64)
(if (nonzero? (-> (the-as sparticle-cpuinfo s4-0) valid))
(arg0 arg1 (the-as sparticle-cpuinfo s4-0) s3-0)
)
(set! s4-0 (+ (the-as uint s4-0) 144))
(&+! s3-0 48)
)
)
(else
(set! s4-0 (&+ (the-as pointer s4-0) 9216))
(&+! s3-0 3072)
)
)
)
)
0
(none)
)
;; definition for function forall-particles
;; INFO: Return type mismatch int vs none.
(defun forall-particles ((arg0 function) (arg1 symbol) (arg2 symbol))
(if arg1
(forall-particles-runner
(the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0)
*sp-particle-system-2d*
)
)
(if arg2
(forall-particles-runner
(the-as (function sparticle-system sparticle-cpuinfo pointer none) arg0)
*sp-particle-system-3d*
)
)
0
(none)
)
;; definition for function kill-all-particles-in-level
(defun kill-all-particles-in-level ((arg0 level))
(let ((t9-0 forall-particles)
(v1-0 (-> arg0 index))
)
(t9-0
(cond
((zero? v1-0)
sparticle-kill-it-level0
)
((= v1-0 1)
sparticle-kill-it-level1
)
((= v1-0 2)
sparticle-kill-it-level2
)
((= v1-0 3)
sparticle-kill-it-level3
)
((= v1-0 4)
sparticle-kill-it-level4
)
(else
sparticle-kill-it-level5
)
)
#t
#t
)
)
0
)
;; definition for function all-particles-50-to-60
(defun all-particles-50-to-60 ()
(forall-particles-runner sparticle-50-to-60 *sp-particle-system-3d*)
(none)
)
;; definition for function all-particles-60-to-50
(defun all-particles-60-to-50 ()
(forall-particles-runner sparticle-60-to-50 *sp-particle-system-3d*)
(none)
)
;; definition for function remap-particle
;; INFO: Return type mismatch gs-miptbp vs none.
(defun remap-particle ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 pointer))
(let* ((gp-0 (-> arg1 adgif))
(a0-1 (-> gp-0 texture-id))
(v1-0 (lookup-texture-by-id-fast a0-1))
)
(when v1-0
(set! (-> gp-0 tex0 tbp0) (-> v1-0 dest 0))
(set! (-> gp-0 tex0 cbp) (-> v1-0 clutdest))
(set! (-> gp-0 miptbp1 tbp1) (-> v1-0 dest 1))
(set! (-> gp-0 miptbp1 tbp2) (-> v1-0 dest 2))
(set! (-> gp-0 miptbp1 tbp3) (-> v1-0 dest 3))
)
)
(none)
)
;; definition for function remap-all-particles
(defun remap-all-particles ()
(forall-particles remap-particle #t #t)
(none)
)
;; definition for function process-particles
;; INFO: Return type mismatch int vs none.
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 gp, Count]
;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
(defun process-particles ()
(local-vars (v1-53 int) (gp-0 int))
(with-pp
(when *particles-flag*
0
0
(.mfc0 gp-0 Count)
(set! *sp-launcher-lock* #t)
(when *debug-segment*
(let ((s5-0 (-> *display* frames (-> *display* on-screen) profile-array data 0))
(v1-12 'particles)
(s4-0 *profile-particles-color*)
)
(when (and *dproc* *debug-segment*)
(let ((s3-0 (-> s5-0 data (-> s5-0 count))))
(let ((s2-0 (-> s5-0 base-time)))
(set! (-> s3-0 name) v1-12)
(set! (-> s3-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s2-0))))
)
(set! (-> s3-0 depth) (the-as uint (-> s5-0 depth)))
(set! (-> s3-0 color) s4-0)
(set! (-> s5-0 segment (-> s5-0 depth)) s3-0)
)
(+! (-> s5-0 count) 1)
(+! (-> s5-0 depth) 1)
(set! (-> s5-0 max-depth) (max (-> s5-0 max-depth) (-> s5-0 depth)))
)
)
0
)
(logand (the-as int (-> pp clock sparticle-data x)) 255)
(cond
(*sp-60-hz*
(when (= (-> *setting-control* user-current video-mode) 'pal)
(set! *sp-60-hz* #f)
(all-particles-60-to-50)
)
)
(else
(when (= (-> *setting-control* user-current video-mode) 'ntsc)
(set! *sp-60-hz* #t)
(all-particles-50-to-60)
)
)
)
(clear-sprite-aux-list)
(sp-process-particle-system *sp-particle-system-2d* 0 *sprite-array-2d*)
(sp-process-particle-system *sp-particle-system-2d* 1 *sprite-array-2d*)
(sp-process-particle-system *sp-particle-system-3d* 0 (the-as sprite-array-2d *sprite-array-3d*))
(when *debug-segment*
(let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
(when (and *dproc* *debug-segment*)
(let* ((v1-47 (+ (-> s5-1 depth) -1))
(s4-1 (-> s5-1 segment v1-47))
(s3-1 (-> s5-1 base-time))
)
(when (>= v1-47 0)
(set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-1))))
(+! (-> s5-1 depth) -1)
)
)
)
)
0
)
(set! *sp-launcher-lock* #f)
(sp-clear-queue)
(.mfc0 v1-53 Count)
(- v1-53 gp-0)
(when *display-sprite-info*
(if (movie?)
(format *stdcon* "~%~%~%")
)
(format
*stdcon*
"2d: ~4d~100h3d: ~4d~200hwarp/glow: ~3D~350hhud:~3D~%"
(-> *sp-particle-system-2d* num-alloc 0)
(-> *sp-particle-system-3d* num-alloc 0)
(-> *sprite-aux-list* entry)
(-> *sp-particle-system-2d* num-alloc 1)
)
)
)
0
(none)
)
)
+18 -18
View File
@@ -395,12 +395,12 @@
;; definition of type level
(deftype level (basic)
((name symbol :offset-assert 4)
(load-name basic :offset-assert 8)
(nickname basic :offset-assert 12)
(load-name string :offset-assert 8)
(nickname string :offset-assert 12)
(index int32 :offset-assert 16)
(status symbol :offset-assert 20)
(borrow-level basic 2 :offset-assert 24)
(borrow-from-level basic :offset-assert 32)
(borrow-level level 2 :offset-assert 24)
(borrow-from-level level :offset-assert 32)
(heap kheap :inline :offset-assert 48)
(borrow-heap kheap 2 :inline :offset-assert 64)
(bsp bsp-header :offset-assert 96)
@@ -446,24 +446,24 @@
(texture-dirty-masks texture-mask 10 :inline :offset-assert 4576)
(texture-mask texture-mask 18 :inline :offset-assert 4736)
(sky-mask texture-mask :inline :offset-assert 5024)
(tfrag-masks basic :offset-assert 5040)
(tfrag-masks texture-masks-array :offset-assert 5040)
(tfrag-dists pointer :offset-assert 5044)
(shrub-masks basic :offset-assert 5048)
(shrub-masks texture-masks-array :offset-assert 5048)
(shrub-dists pointer :offset-assert 5052)
(alpha-masks basic :offset-assert 5056)
(alpha-masks texture-masks-array :offset-assert 5056)
(alpha-dists pointer :offset-assert 5060)
(water-masks basic :offset-assert 5064)
(water-masks texture-masks-array :offset-assert 5064)
(water-dists pointer :offset-assert 5068)
(tfrag-last-calls int32 6 :offset-assert 5072)
(texture-anim-array texture-anim-array 10 :offset-assert 5096)
(light-hash basic :offset-assert 5136)
(light-hash light-hash :offset-assert 5136)
(draw-priority float :offset-assert 5140)
(draw-index int32 :offset-assert 5144)
(part-engine basic :offset-assert 5148)
(part-engine engine :offset-assert 5148)
(user-object basic 4 :offset-assert 5152)
(loaded-text-info-count int32 :offset-assert 5168)
(loaded-text-info game-text-info 8 :offset-assert 5172)
(level-type basic :offset-assert 5204)
(level-type type :offset-assert 5204)
(load-order int64 :offset-assert 5208)
(pad int8 12 :offset-assert 5216)
)
@@ -776,7 +776,7 @@
:level0 (new 'static 'level
:name #f
:status 'inactive
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:inside-boxes #f
:force-inside? #f
@@ -787,7 +787,7 @@
:name #f
:index 1
:status 'inactive
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:inside-boxes #f
:force-inside? #f
@@ -798,7 +798,7 @@
:name #f
:index 2
:status 'inactive
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:inside-boxes #f
:force-inside? #f
@@ -809,7 +809,7 @@
:name #f
:index 3
:status 'inactive
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:inside-boxes #f
:force-inside? #f
@@ -820,7 +820,7 @@
:name #f
:index 4
:status 'inactive
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:inside-boxes #f
:force-inside? #f
@@ -831,7 +831,7 @@
:name #f
:index 5
:status 'inactive
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:inside-boxes #f
:force-inside? #f
@@ -842,7 +842,7 @@
:name 'default
:index 6
:status 'reserved
:borrow-level (new 'static 'array basic 2 #f #f)
:borrow-level (new 'static 'array level 2 #f #f)
:borrow-from-level #f
:bsp #f
:inside-boxes #f
+14
View File
@@ -92,6 +92,20 @@
"cam-los-collide", // vector-dot with stack
// cam-update
"update-visible", // assertion crash when filling out bsp-header
// sparticle-launcher
// - field loaded as signed and unsigned
"sp-relaunch-particle-3d",
// - annoying arbitrary data usage functions
"execute-part-engine",
"sparticle-respawn-heights",
"sparticle-respawn-timer",
"sparticle-mode-animate",
"sparticle-mode-animate",
"sparticle-texture-animate",
"sparticle-texture-day-night",
"sparticle-motion-blur", // clipping
"birth-func-texture-group",
"(method 10 sparticle-launcher)", // very strange handling of ambiguous type
// placeholder
// gun-util