mirror of
https://github.com/open-goal/jak-project
synced 2026-06-28 03:03:29 -04:00
fdd8615204
* maybe fix symbol decompile issue * try again on a label * stash * very close on `hud-classes` * 1 function remaining, whats `key` off the cpuinfo? * some more work on hud-classes, 1 function to go... * start updating `collectables` to new state handling * decomp: finish `hud-classes` * blocked: `hud` crashes in `(code hud-collecting)` around states * fix tests * address feedback * damn submodules Co-authored-by: water <awaterford111445@gmail.com>
127 lines
4.6 KiB
Common Lisp
127 lines
4.6 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: sparticle-h.gc
|
|
;; name in dgo: sparticle-h
|
|
;; dgos: GAME, ENGINE
|
|
|
|
(define *sp-frame-time* (new 'global 'vector))
|
|
|
|
(set-vector!
|
|
*sp-frame-time*
|
|
0.00000000000000000000000000000000000001175495
|
|
5.0
|
|
1.0
|
|
1.0
|
|
)
|
|
|
|
(define *sp-60-hz* #t)
|
|
|
|
(defenum sp-cpuinfo-flag
|
|
:bitfield #t
|
|
:type uint32
|
|
(bit0 0)
|
|
(bit1 1) ;; village1-part
|
|
(bit2 2) ;; cleared after an aux has its func set to add-to-sprite-aux-lst
|
|
(bit3 3)
|
|
(ready-to-launch 6) ;; maybe just just death?
|
|
(bit7 7)
|
|
(aux-list 8) ;; prevents relaunch, adds to aux
|
|
(bit9 9)
|
|
(level0 10)
|
|
(level1 11)
|
|
(bit12 12) ;; required to relaunch
|
|
(bit13 13)
|
|
(bit14 14)
|
|
(use-global-acc 16)
|
|
(launch-along-z 17)
|
|
(left-multiply-quat 18)
|
|
(right-multiply-quat 19)
|
|
(set-conerot 20)
|
|
)
|
|
|
|
(deftype sparticle-cpuinfo (structure)
|
|
((sprite sprite-vec-data-2d :offset-assert 0)
|
|
(adgif adgif-shader :offset-assert 4)
|
|
(radius float :offset-assert 8)
|
|
(omega float :offset-assert 12)
|
|
(vel-sxvel vector :inline :offset-assert 16)
|
|
(rot-syvel vector :inline :offset-assert 32)
|
|
(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)
|
|
(scalevelx float :offset 28)
|
|
(scalevely float :offset 44)
|
|
(friction float :offset-assert 96)
|
|
(timer int32 :offset-assert 100)
|
|
(flags sp-cpuinfo-flag :offset-assert 104)
|
|
(user-int32 int32 :offset-assert 108)
|
|
(user-uint32 uint32 :offset 108)
|
|
(user-float float :score 100 :offset 108)
|
|
(user-pntr uint32 :offset 108)
|
|
(user-sprite sprite-vec-data-2d :offset 108)
|
|
(func basic :offset-assert 112)
|
|
(next-time uint32 :offset-assert 116)
|
|
(next-launcher basic :offset-assert 120)
|
|
(cache-alpha float :offset-assert 124)
|
|
(valid symbol :offset-assert 128)
|
|
(key sparticle-launch-control :offset-assert 132)
|
|
(binding sparticle-launch-state :offset-assert 136)
|
|
(data uint32 1 :offset 12)
|
|
(dataf float 1 :offset 12)
|
|
(datac uint8 1 :offset 12)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x8c
|
|
:flag-assert #x90000008c
|
|
;; field key is a basic loaded with a signed load
|
|
)
|
|
|
|
|
|
(deftype sparticle-launchinfo (structure)
|
|
((launchrot vector :inline :offset-assert 0)
|
|
(conerot vector :inline :offset-assert 16)
|
|
(coneradius float :offset-assert 32)
|
|
(rotate-y float :offset-assert 36)
|
|
(data uint8 1 :offset 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x28
|
|
:flag-assert #x900000028
|
|
)
|
|
|
|
(deftype sparticle-system (basic)
|
|
((blocks int32 2 :offset-assert 4)
|
|
(length int32 2 :offset-assert 12)
|
|
(num-alloc int32 2 :offset-assert 20)
|
|
(is-3d basic :offset-assert 28)
|
|
(flags uint32 :offset-assert 32)
|
|
(alloc-table (pointer uint64) :offset-assert 36)
|
|
(cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40)
|
|
(vecdata-table pointer :offset-assert 44)
|
|
(adgifdata-table (inline-array adgif-shader) :offset-assert 48)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x34
|
|
:flag-assert #x900000034
|
|
(:methods
|
|
(new (symbol type int int symbol pointer (inline-array adgif-shader)) _type_ 0)
|
|
)
|
|
)
|
|
|
|
(define-extern part-group-pointer? (function pointer symbol))
|
|
|
|
;; TODO - for shadow
|
|
(define-extern *part-id-table* (array sparticle-launcher))
|
|
(define-extern *part-group-id-table* (array sparticle-launch-group))
|
|
|
|
;; TODO - for basically everything particle related
|
|
(define-extern *sp-particle-system-2d* sparticle-system)
|
|
(define-extern *sp-particle-system-3d* sparticle-system)
|
|
|
|
(defun-extern kill-all-particles-with-key sparticle-launch-control none)
|
|
|
|
(define-extern sp-get-particle (function sparticle-system int sparticle-launch-state sparticle-cpuinfo))
|