decomp: eye (#778)

* decomp: `eye` close just need a pile of casts for the rendering code

* stash

* decomp: `eye` mostly cleaned up, xmm reg issue with `pextlb`

* waitin

* update ref tests and gsrc

* update reference tests
This commit is contained in:
Tyler Wilding
2022-02-12 22:39:25 -05:00
committed by GitHub
parent ffb04ddd10
commit bf11ef3934
20 changed files with 2629 additions and 2559 deletions
+7 -6
View File
@@ -535,6 +535,7 @@
(pris-tex1 51)
(bucket-52 52)
(bucket-53 53)
(bucket-54 54) ;; eye::update-eyes
;; merc1 52
;; generic1 53
@@ -7946,7 +7947,7 @@
(deftype art-joint-anim (art-element)
;; figured out manually from custom inspect.
((_unknown (pointer int16) :offset 4) ;; no clue. used in mem-usage
((_unknown (pointer int16) :offset 4) ;; no clue. used in mem-usage and merc-eye-anim
(speed float :offset 20)
(artist-base float :offset 24)
(artist-step float :offset 28)
@@ -14014,11 +14015,11 @@
)
(deftype eye-control (structure)
((process uint64 :offset-assert 0)
((process handle :offset-assert 0)
(random-time uint16 :offset-assert 8)
(level uint16 :offset-assert 10)
(blink float :offset-assert 12)
(shaders uint32 :offset-assert 16)
(shaders (inline-array adgif-shader) :offset-assert 16)
(left eye :inline :offset-assert 32)
(right eye :inline :offset-assert 64)
)
@@ -19909,7 +19910,7 @@
(define-extern clone-anim-once (function handle int symbol string none :behavior process-drawable))
(define-extern convert-to-hud-object (function process-drawable hud none :behavior hud))
(define-extern clone-anim (function handle int symbol string none :behavior process-drawable))
(define-extern merc-eye-anim (function process-drawable none))
(define-extern merc-eye-anim (function manipy none))
(define-extern ja-anim-done? (function process symbol))
(define-extern command-get-camera (function object state state))
(define-extern camera-anim (function symbol basic entity (pointer process) :behavior camera-tracker)) ;; unused
@@ -21829,8 +21830,8 @@
;; - Functions
(define-extern convert-eye-data function)
(define-extern render-eyes function)
(define-extern convert-eye-data (function box8s uint128 float))
(define-extern render-eyes (function dma-buffer eye-control int pointer))
(define-extern update-eyes (function none))
;; - Unknowns
@@ -330,8 +330,6 @@
"ocean-frames": [["L1", "(pointer uint32)", 16384]],
"eye": [["L36", "eye-work"]],
"shadow-cpu": [
["L122", "shadow-data"],
["L121", "vu-function"]
@@ -2065,6 +2063,13 @@
["L523", "float", true] // TODO - meters
],
"eye": [
["L36", "eye-work"],
["L38", "float", true],
["L40", "float", true],
["L44", "uint64", true]
],
"snow-bunny": [["L190", "attack-info"]],
// please do not add things after this entry! git is dumb.
@@ -5467,5 +5467,10 @@
[112, "nav-gap-info"]
],
"merc-eye-anim": [
[16, "box8s"], // 2 vectors, could be a boundingbox, or something else
[48, "vector"]
],
"placeholder-do-not-add-below!": []
}
@@ -7146,5 +7146,109 @@
[106, "a0", "(inline-array vector)"]
],
"update-eyes": [
[[19, 25], "a0", "dma-packet"],
[[28, 34], "a0", "gs-gif-tag"],
[39, "a0", "(pointer gs-test)"],
[41, "a0", "(pointer gs-reg64)"],
[[45, 50], "v1", "dma-packet"],
[[83, 89], "a0", "dma-packet"],
[[92, 98], "a0", "gs-gif-tag"],
[103, "a0", "(pointer gs-test)"],
[105, "a0", "(pointer gs-reg64)"],
[[109, 114], "v1", "dma-packet"],
[[147, 153], "a0", "dma-packet"],
[[156, 162], "a0", "gs-gif-tag"],
[167, "a0", "(pointer gs-test)"],
[169, "a0", "(pointer gs-reg64)"],
[[173, 178], "v1", "dma-packet"],
[212, "v1", "process-drawable"],
[218, "v1", "process-drawable"],
[[281, 286], "v1", "dma-packet"],
[[319, 324], "v1", "dma-packet"],
[[356, 362], "a0", "dma-packet"],
[[365, 371], "a0", "gs-gif-tag"],
[376, "a0", "(pointer gs-reg64)"],
[378, "a0", "(pointer gs-reg64)"],
[[382, 387], "v1", "dma-packet"],
[[415, 421], "a0", "dma-packet"],
[[424, 430], "a0", "gs-gif-tag"],
[435, "a0", "(pointer gs-reg64)"],
[437, "a0", "(pointer gs-reg64)"],
[[441, 446], "v1", "dma-packet"],
[[474, 480], "a0", "dma-packet"],
[[483, 489], "a0", "gs-gif-tag"],
[494, "a0", "(pointer gs-reg64)"],
[496, "a0", "(pointer gs-reg64)"],
[[500, 505], "v1", "dma-packet"]
],
"render-eyes": [
[[45, 52], "v1", "dma-gif-packet"],
[[52, 64], "s0", "(pointer uint64)"],
[[68, 74], "a0", "dma-packet"],
[[77, 83], "a0", "gs-gif-tag"],
[95, "a0", "(pointer gs-scissor)"],
[97, "a0", "(pointer gs-reg64)"],
[[100, 135], "v1", "(inline-array vector4w)"],
[145, "v1", "(inline-array vector4w)"],
[[164, 170], "a2", "dma-packet"],
[[173, 179], "a2", "gs-gif-tag"],
[191, "a2", "(pointer gs-scissor)"],
[193, "a2", "(pointer gs-reg64)"],
[[199, 244], "a1", "(inline-array vector4w)"],
[250, "a1", "(inline-array vector4w)"],
[[253, 259], "a2", "dma-packet"],
[[262, 268], "a2", "gs-gif-tag"],
[280, "a2", "(pointer gs-scissor)"],
[282, "a2", "(pointer gs-reg64)"],
[[288, 337], "a1", "(inline-array vector4w)"],
[343, "v1", "(inline-array vector4w)"],
[[346, 352], "a0", "dma-packet"],
[[355, 361], "a0", "gs-gif-tag"],
[366, "a0", "(pointer gs-test)"],
[368, "a0", "(pointer gs-reg64)"],
[[373, 380], "v1", "(inline-array vector4w)"],
[[380, 392], "s0", "(pointer uint64)"],
[[412, 418], "a2", "dma-packet"],
[[421, 427], "a2", "gs-gif-tag"],
[439, "a2", "(pointer gs-scissor)"],
[441, "a2", "(pointer gs-reg64)"],
[[447, 497], "a1", "(inline-array vector4w)"],
[498, "a1", "(inline-array vector4w)"],
[[501, 507], "a2", "dma-packet"],
[[510, 516], "a2", "gs-gif-tag"],
[528, "a2", "(pointer gs-scissor)"],
[530, "a2", "(pointer gs-reg64)"],
[[536, 585], "a1", "(inline-array vector4w)"],
[591, "v1", "(inline-array vector4w)"],
[[594, 600], "a0", "dma-packet"],
[[603, 609], "a0", "gs-gif-tag"],
[614, "a0", "(pointer gs-test)"],
[616, "a0", "(pointer gs-reg64)"],
[[621, 628], "v1", "dma-gif-packet"],
[[628, 640], "s0", "(pointer uint64)"],
[641, "v1", "(inline-array dma-gif-packet)"],
[[673, 679], "a2", "dma-packet"],
[[682, 688], "a2", "gs-gif-tag"],
[700, "a2", "(pointer gs-scissor)"],
[702, "a2", "(pointer gs-reg64)"],
[[712, 759], "a1", "(inline-array vector4w)"],
[765, "a1", "(inline-array vector4w)"],
[[781, 787], "a2", "dma-packet"],
[[790, 796], "a2", "gs-gif-tag"],
[808, "a2", "(pointer gs-scissor)"],
[810, "a2", "(pointer gs-reg64)"],
[[820, 868], "a1", "(inline-array vector4w)"],
[874, "v1", "(inline-array vector4w)"]
],
"merc-eye-anim": [
[[81, 86], "v1", "(pointer int64)"],
[[89, 94], "v1", "(pointer int64)"],
[[119, 125], "v1", "(pointer int64)"],
[[128, 134], "v1", "(pointer int64)"]
],
"placeholder-do-not-add-below": []
}
+1
View File
@@ -269,6 +269,7 @@
(pris-tex1 51)
(bucket-52 52) ;; merc
(bucket-53 53)
(bucket-54 54) ;; eye::update-eyes
;; merc1 52
;; generic1 53
+1 -1
View File
@@ -74,7 +74,7 @@
(merc-blend-shape self)
)
(if (logtest? (-> self skel status) 384)
(merc-eye-anim self)
(merc-eye-anim (the-as manipy self))
)
)
(else
+35 -29
View File
@@ -5,67 +5,73 @@
;; name in dgo: eye-h
;; dgos: GAME, ENGINE
;; definition of type eye
(define-extern get-eye-block (function int int int))
(define-extern merc-eye-anim (function manipy none))
;; DECOMP BEGINS
(deftype eye (structure)
((data uint128 2 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(lid float :offset 8)
(iris-scale float :offset 16)
(pupil-scale float :offset 20)
(lid-scale float :offset 24)
((data uint128 2 :offset-assert 0)
(x float :offset 0)
(y float :offset 4)
(lid float :offset 8)
(iris-scale float :offset 16)
(pupil-scale float :offset 20)
(lid-scale float :offset 24)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition of type eye-control
(deftype eye-control (structure)
((process uint64 :offset-assert 0)
(random-time uint16 :offset-assert 8)
(level uint16 :offset-assert 10)
(blink float :offset-assert 12)
(shaders uint32 :offset-assert 16)
(left eye :inline :offset-assert 32)
(right eye :inline :offset-assert 64)
((process handle :offset-assert 0)
(random-time uint16 :offset-assert 8)
(level uint16 :offset-assert 10)
(blink float :offset-assert 12)
(shaders (inline-array adgif-shader) :offset-assert 16)
(left eye :inline :offset-assert 32)
(right eye :inline :offset-assert 64)
)
:method-count-assert 9
:size-assert #x60
:flag-assert #x900000060
)
;; definition of type eye-control-array
(deftype eye-control-array (basic)
((data eye-control 11 :inline :offset-assert 16)
((data eye-control 11 :inline :offset-assert 16)
)
:method-count-assert 9
:size-assert #x430
:flag-assert #x900000430
)
;; definition of type eye-work
(deftype eye-work (structure)
((sprite-tmpl dma-gif-packet :inline :offset-assert 0)
(sprite-tmpl2 dma-gif-packet :inline :offset-assert 32)
(adgif-tmpl dma-gif-packet :inline :offset-assert 64)
(blink-table float 10 :offset-assert 96)
((sprite-tmpl dma-gif-packet :inline :offset-assert 0)
(sprite-tmpl2 dma-gif-packet :inline :offset-assert 32)
(adgif-tmpl dma-gif-packet :inline :offset-assert 64)
(blink-table float 10 :offset-assert 96)
)
:method-count-assert 9
:size-assert #x88
:flag-assert #x900000088
)
;; definition for symbol *eye-control-array*, type eye-control-array
(define *eye-control-array* (new 'static 'eye-control-array))
;; failed to figure out what this is:
(dotimes (v1-5 11)
(set! (-> *eye-control-array* data v1-5 process) (the-as uint #f))
(set! (-> *eye-control-array* data v1-5 shaders) (the-as uint #f))
(set! (-> *eye-control-array* data v1-5 process) (the-as handle #f))
(set! (-> *eye-control-array* data v1-5 shaders) (the-as (inline-array adgif-shader) #f))
(set! (-> *eye-control-array* data v1-5 random-time) (the-as uint 60))
(set! (-> *eye-control-array* data v1-5 blink) 0.0)
)
(define-extern get-eye-block (function int int int))
(defun-extern merc-eye-anim process-drawable none)
0
+1215 -44
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -976,7 +976,7 @@
(merc-blend-shape obj)
)
(if (logtest? (-> obj skel status) 384)
(merc-eye-anim obj)
(merc-eye-anim (the-as manipy obj))
)
(label cfg-27)
(let ((a0-17 (-> gp-0 effect)))
+1 -1
View File
@@ -61,7 +61,7 @@
(merc-blend-shape self)
)
(if (logtest? (-> self skel status) 384)
(merc-eye-anim self)
(merc-eye-anim (the-as manipy self))
)
)
(else
+9 -9
View File
@@ -31,13 +31,13 @@
;; definition of type eye-control
(deftype eye-control (structure)
((process uint64 :offset-assert 0)
(random-time uint16 :offset-assert 8)
(level uint16 :offset-assert 10)
(blink float :offset-assert 12)
(shaders uint32 :offset-assert 16)
(left eye :inline :offset-assert 32)
(right eye :inline :offset-assert 64)
((process handle :offset-assert 0)
(random-time uint16 :offset-assert 8)
(level uint16 :offset-assert 10)
(blink float :offset-assert 12)
(shaders (inline-array adgif-shader) :offset-assert 16)
(left eye :inline :offset-assert 32)
(right eye :inline :offset-assert 64)
)
:method-count-assert 9
:size-assert #x60
@@ -100,8 +100,8 @@
;; failed to figure out what this is:
(dotimes (v1-5 11)
(set! (-> *eye-control-array* data v1-5 process) (the-as uint #f))
(set! (-> *eye-control-array* data v1-5 shaders) (the-as uint #f))
(set! (-> *eye-control-array* data v1-5 process) (the-as handle #f))
(set! (-> *eye-control-array* data v1-5 shaders) (the-as (inline-array adgif-shader) #f))
(set! (-> *eye-control-array* data v1-5 random-time) (the-as uint 60))
(set! (-> *eye-control-array* data v1-5 blink) 0.0)
)
+1233
View File
File diff suppressed because it is too large Load Diff
-149
View File
@@ -1,149 +0,0 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *sp-frame-time*, type vector
(define *sp-frame-time* (new 'global 'vector))
;; failed to figure out what this is:
(set-vector! *sp-frame-time* 0.00000000000000000000000000000000000001175495 5.0 1.0 1.0)
;; definition for symbol *sp-60-hz*, type symbol
(define *sp-60-hz* #t)
;; definition of type sparticle-cpuinfo
(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 :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
)
;; definition for method 3 of type sparticle-cpuinfo
(defmethod inspect sparticle-cpuinfo ((obj sparticle-cpuinfo))
(format #t "[~8x] ~A~%" obj 'sparticle-cpuinfo)
(format #t "~Tsprite: #<sprite-vec-data-2d @ #x~X>~%" (-> obj sprite))
(format #t "~Tadgif: #<adgif-shader @ #x~X>~%" (-> obj adgif))
(format #t "~Tradius: ~f~%" (-> obj radius))
(format #t "~Tomega: ~f~%" (-> obj omega))
(format #t "~Tvel-sxvel: #<vector @ #x~X>~%" (-> obj vel-sxvel))
(format #t "~Trot-syvel: #<vector @ #x~X>~%" (-> obj rot-syvel))
(format #t "~Tfade: #<rgbaf @ #x~X>~%" (-> obj fade))
(format #t "~Tacc: #<vector @ #x~X>~%" (-> obj acc))
(format #t "~Trotvel3d: #<quaternion @ #x~X>~%" (-> obj rotvel3d))
(format #t "~Tvel: #<vector3s @ #x~X>~%" (-> obj vel-sxvel))
(format #t "~Taccel: #<vector3s @ #x~X>~%" (-> obj acc))
(format #t "~Tscalevelx: ~f~%" (-> obj vel-sxvel w))
(format #t "~Tscalevely: ~f~%" (-> obj rot-syvel w))
(format #t "~Tfriction: ~f~%" (-> obj friction))
(format #t "~Ttimer: ~D~%" (-> obj timer))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Tuser-int32: ~D~%" (-> obj user-float))
(format #t "~Tuser-uint32: ~D~%" (-> obj user-float))
(format #t "~Tuser-float: ~f~%" (the-as float (-> obj user-float)))
(format #t "~Tuser-pntr: #x~X~%" (-> obj user-float))
(format #t "~Tuser-sprite: #<sprite-vec-data-2d @ #x~X>~%" (-> obj user-float))
(format #t "~Tfunc: ~A~%" (-> obj func))
(format #t "~Tnext-time: ~D~%" (-> obj next-time))
(format #t "~Tnext-launcher: ~A~%" (-> obj next-launcher))
(format #t "~Tcache-alpha: ~f~%" (-> obj cache-alpha))
(format #t "~Tvalid: ~A~%" (-> obj valid))
(format #t "~Tkey: ~A~%" (-> obj key))
(format #t "~Tbinding: #<sparticle-launch-state @ #x~X>~%" (-> obj binding))
(format #t "~Tdata[1] @ #x~X~%" (&-> obj omega))
(format #t "~Tdataf[1] @ #x~X~%" (&-> obj omega))
(format #t "~Tdatac[1] @ #x~X~%" (&-> obj omega))
obj
)
;; definition of type sparticle-launchinfo
(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
)
;; definition for method 3 of type sparticle-launchinfo
(defmethod inspect sparticle-launchinfo ((obj sparticle-launchinfo))
(format #t "[~8x] ~A~%" obj 'sparticle-launchinfo)
(format #t "~Tlaunchrot: #<vector @ #x~X>~%" (-> obj launchrot))
(format #t "~Tconerot: #<vector @ #x~X>~%" (-> obj conerot))
(format #t "~Tconeradius: ~f~%" (-> obj coneradius))
(format #t "~Trotate-y: ~f~%" (-> obj rotate-y))
(format #t "~Tdata[1] @ #x~X~%" (-> obj launchrot))
obj
)
;; definition of type sparticle-system
(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)
)
)
;; definition for method 3 of type sparticle-system
(defmethod inspect sparticle-system ((obj sparticle-system))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tblocks[2] @ #x~X~%" (-> obj blocks))
(format #t "~Tlength[2] @ #x~X~%" (-> obj length))
(format #t "~Tnum-alloc[2] @ #x~X~%" (-> obj num-alloc))
(format #t "~Tis-3d: ~A~%" (-> obj is-3d))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Talloc-table: #x~X~%" (-> obj alloc-table))
(format #t "~Tcpuinfo-table: #x~X~%" (-> obj cpuinfo-table))
(format #t "~Tvecdata-table: #x~X~%" (-> obj vecdata-table))
(format #t "~Tadgifdata-table: #x~X~%" (-> obj adgifdata-table))
obj
)
;; failed to figure out what this is:
0
@@ -1,215 +0,0 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type sp-field-init-spec
(deftype sp-field-init-spec (structure)
((field sp-field-id :offset-assert 0)
(flags sp-flag :offset-assert 2)
(initial-valuef float :offset-assert 4)
(random-rangef float :offset-assert 8)
(random-multf float :offset-assert 12)
(initial-value int32 :offset 4)
(random-range int32 :offset 8)
(random-mult int32 :offset 12)
(sym symbol :offset 4)
(func symbol :offset 4)
(tex uint32 :offset 4)
(pntr pointer :offset 4)
(sound sound-spec :offset 4)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type sp-field-init-spec
(defmethod inspect sp-field-init-spec ((obj sp-field-init-spec))
(format #t "[~8x] ~A~%" obj 'sp-field-init-spec)
(format #t "~Tfield: ~D~%" (-> obj field))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef))
(format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef))
(format #t "~Trandom-multf: ~f~%" (-> obj random-multf))
(format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef))
(format #t "~Trandom-range: ~D~%" (-> obj random-rangef))
(format #t "~Trandom-mult: ~D~%" (-> obj random-multf))
(format #t "~Tfunc: ~A~%" (-> obj initial-valuef))
(format #t "~Ttex: ~D~%" (-> obj initial-valuef))
(format #t "~Tpntr: #x~X~%" (-> obj initial-valuef))
(format #t "~Tsym: ~A~%" (-> obj initial-valuef))
(format #t "~Tsound: ~A~%" (-> obj initial-valuef))
obj
)
;; definition of type sparticle-launcher
(deftype sparticle-launcher (basic)
((birthaccum float :offset-assert 4)
(soundaccum float :offset-assert 8)
(init-specs (inline-array sp-field-init-spec) :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; 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))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tbirthaccum: ~f~%" (-> obj birthaccum))
(format #t "~Tsoundaccum: ~f~%" (-> obj soundaccum))
(format #t "~Tinit-specs: #x~X~%" (-> obj init-specs))
obj
)
;; definition of type sparticle-group-item
(deftype sparticle-group-item (structure)
((launcher uint32 :offset-assert 0)
(fade-after meters :offset-assert 4)
(falloff-to meters :offset-assert 8)
(flags sp-group-item-flag :offset-assert 12)
(period uint16 :offset-assert 14)
(length uint16 :offset-assert 16)
(offset uint16 :offset-assert 18)
(hour-mask uint32 :offset-assert 20)
(binding uint32 :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
:flag-assert #x90000001c
)
;; definition for method 3 of type sparticle-group-item
(defmethod inspect sparticle-group-item ((obj sparticle-group-item))
(format #t "[~8x] ~A~%" obj 'sparticle-group-item)
(format #t "~Tlauncher: ~D~%" (-> obj launcher))
(format #t "~Tfade-after: (meters ~m)~%" (-> obj fade-after))
(format #t "~Tfalloff-to: (meters ~m)~%" (-> obj falloff-to))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Tperiod: ~D~%" (-> obj period))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Toffset: ~D~%" (-> obj offset))
(format #t "~Thour-mask: ~D~%" (-> obj hour-mask))
(format #t "~Tbinding: ~D~%" (-> obj binding))
obj
)
;; definition of type sparticle-launch-state
(deftype sparticle-launch-state (structure)
((group-item sparticle-group-item :offset-assert 0)
(flags sp-launch-state-flags :offset-assert 4)
(randomize uint16 :offset-assert 6)
(origin vector :offset-assert 8)
(sprite3d sprite-vec-data-3d :offset-assert 12)
(sprite sparticle-cpuinfo :offset-assert 16)
(offset uint32 :offset-assert 20)
(accum float :offset-assert 24)
(spawn-time uint32 :offset-assert 28)
(swarm basic :offset 20)
(seed uint32 :offset 24)
(time uint32 :offset 28)
(spec basic :offset 16)
(id uint32 :offset 12)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
;; definition for method 3 of type sparticle-launch-state
(defmethod inspect sparticle-launch-state ((obj sparticle-launch-state))
(format #t "[~8x] ~A~%" obj 'sparticle-launch-state)
(format #t "~Tgroup-item: #<sparticle-group-item @ #x~X>~%" (-> obj group-item))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Trandomize: ~D~%" (-> obj randomize))
(format #t "~Torigin: #<vector @ #x~X>~%" (-> obj origin))
(format #t "~Tsprite3d: #<sprite-vec-data-3d @ #x~X>~%" (-> obj sprite3d))
(format #t "~Tsprite: ~A~%" (-> obj sprite))
(format #t "~Toffset: ~D~%" (-> obj offset))
(format #t "~Taccum: ~f~%" (-> obj accum))
(format #t "~Tspawn-time: ~D~%" (-> obj spawn-time))
(format #t "~Tswarm: ~A~%" (-> obj offset))
(format #t "~Tseed: ~D~%" (-> obj accum))
(format #t "~Ttime: ~D~%" (-> obj spawn-time))
(format #t "~Tspec: ~A~%" (-> obj sprite))
(format #t "~Tid: ~D~%" (-> obj sprite3d))
obj
)
;; definition of type sparticle-launch-group
(deftype sparticle-launch-group (basic)
((length int16 :offset-assert 4)
(duration uint16 :offset-assert 6)
(linger-duration uint16 :offset-assert 8)
(flags sp-group-flag :offset-assert 10)
(name string :offset-assert 12)
(launcher (inline-array sparticle-group-item) :offset-assert 16)
(bounds sphere :inline :offset-assert 32)
)
:method-count-assert 10
:size-assert #x30
:flag-assert #xa00000030
(:methods
(create-launch-control (_type_ process) sparticle-launch-control 9)
)
)
;; definition for method 3 of type sparticle-launch-group
(defmethod inspect sparticle-launch-group ((obj sparticle-launch-group))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tduration: ~D~%" (-> obj duration))
(format #t "~Tlinger-duration: ~D~%" (-> obj linger-duration))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Tlauncher: #x~X~%" (-> obj launcher))
(format #t "~Tbounds: #<sphere @ #x~X>~%" (-> obj bounds))
obj
)
;; 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)
(local-clock int32 :offset-assert 24)
(fade float :offset-assert 28)
(matrix int32 :offset-assert 32)
(last-spawn-frame int32 :offset-assert 36)
(last-spawn-time int32 :offset-assert 40)
(center vector :inline :offset-assert 48)
(data sparticle-launch-state :inline :dynamic :offset-assert 64)
)
:method-count-assert 14
:size-assert #x40
:flag-assert #xe00000040
(:methods
(initialize (_type_ sparticle-launch-group process) none 9)
(is-visible? (_type_ vector) symbol 10)
(spawn (_type_ vector) object 11)
(kill-and-free-particles (_type_) none 12)
(kill-particles (_type_) none 13)
)
)
;; definition for method 3 of type sparticle-launch-control
(defmethod inspect sparticle-launch-control ((obj sparticle-launch-control))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tgroup: ~A~%" (-> obj group))
(format #t "~Tproc: ~A~%" (-> obj proc))
(format #t "~Tlocal-clock: ~D~%" (-> obj local-clock))
(format #t "~Tfade: ~f~%" (-> obj fade))
(format #t "~Tmatrix: ~D~%" (-> obj matrix))
(format #t "~Tlast-spawn-frame: ~D~%" (-> obj last-spawn-frame))
(format #t "~Tlast-spawn-time: ~D~%" (-> obj last-spawn-time))
(format #t "~Tcenter: ~`vector`P~%" (-> obj center))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)
;; failed to figure out what this is:
(set! (-> sparticle-launch-control heap-base) (the-as uint 32))
;; failed to figure out what this is:
0
File diff suppressed because it is too large Load Diff
-731
View File
@@ -1,731 +0,0 @@
;;-*-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: Return type mismatch basic vs none.
;; Used lq/sq
(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 color quad)))
(set! (-> arg0 sprite color 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 func) (-> arg1 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) 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) #f)
(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-miptbp :tbp1 #x48))
)
)
gp-0
)
)
;; 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))
)
;; 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) #f)
(set! (-> arg3 a) 0.0)
0
(none)
)
;; definition for function sp-get-particle
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: Unsupported inline assembly instruction kind - [movz a2, t3, t2]
;; WARN: 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)))
(set! (-> arg0 alloc-table (+ v1-0 a3-0))
(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) #t)
(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
;; INFO: Return type mismatch symbol vs none.
;; WARN: Expression building failed: Function sp-kill-particle has a return type of none, but the expression builder found a return statement.
(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 (-> 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
(none)
)
;; 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))
(f4-0 (-> arg1 vel-sxvel x))
(f24-0 (-> arg1 vel-sxvel y))
(f1-0 (-> arg1 vel-sxvel z))
(f3-0 (-> *sp-frame-time* y))
(f28-0 (+ f2-0 (* f4-0 f3-0)))
)
(set! (-> arg1 omega) f28-0)
(let ((f30-0 (+ f0-0 (* f1-0 f3-0))))
(set! (-> arg1 radius) f30-0)
(let ((f26-0 (sin f28-0))
(f28-1 (cos f28-0))
(f22-0 (sin (* 0.5 f24-0)))
(f0-5 (cos (* 0.5 f24-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 f28-1) 0.0 (* f22-0 f26-0) f0-5)
(quaternion*! (-> arg1 rotvel3d) (the-as quaternion a1-1) (-> arg1 rotvel3d))
(quaternion-normalize! (-> arg1 rotvel3d))
(set-vector! s4-0 (* f26-0 f30-0) 0.0 (* f28-1 f30-0) 1.0)
(quaternion->matrix s3-0 (-> arg1 rotvel3d))
(vector-matrix*! s4-0 s4-0 s3-0)
)
(let ((v1-3 (the-as object (-> arg1 user-float))))
(set! (-> arg2 x) (+ (-> s4-0 x) (-> (the-as sprite-vec-data-2d v1-3) x)))
(set! (-> arg2 y) (+ (-> s4-0 y) (-> (the-as sprite-vec-data-2d v1-3) y)))
(set! (-> arg2 z) (+ (-> s4-0 z) (-> (the-as sprite-vec-data-2d v1-3) 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: Return type mismatch int vs none.
;; Used lq/sq
(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 (function sparticle-system int int int int symbol none))
(sv-64 sparticle-system)
(sv-80 int)
(sv-96 int)
(sv-112 int)
(sv-128 (function sparticle-system int int int int symbol none))
(sv-144 sparticle-system)
(sv-160 int)
(sv-176 int)
(sv-192 int)
)
(let ((s3-0 16)
(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-80 (+ #x70000000 s3-0))
(set! sv-96 (+ #x70000000 s1-0))
(cond
((-> arg0 is-3d)
(set! sv-48 sp-process-block-3d)
(set! sv-64 arg0)
(set! sv-112 arg1)
(let ((t1-0 (paused?)))
(sv-48 sv-64 sv-80 sv-96 sv-112 arg3 t1-0)
)
)
(else
(set! sv-128 sp-process-block-2d)
(set! sv-144 arg0)
(set! sv-160 sv-80)
(set! sv-176 sv-96)
(set! sv-192 arg1)
(let ((t1-1 (paused?)))
(sv-128 sv-144 sv-160 sv-176 sv-192 arg3 t1-1)
)
)
)
(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: Return type mismatch int vs none.
(defun sp-process-particle-system ((arg0 sparticle-system) (arg1 int) (arg2 sprite-array-2d))
(let* ((v1-0 16)
(s1-0 (/ (- #x4000 v1-0) 272))
(s3-0 0)
(s4-0 (sp-get-approx-alloc-size arg0 arg1))
)
(if (= arg1 1)
(set! s3-0 (* (-> arg0 blocks 0) 64))
)
(set! (-> arg2 num-valid arg1) s4-0)
(flush-cache 0)
(while (>= s4-0 s1-0)
(sp-process-block arg0 s3-0 arg2 s1-0)
(set! s4-0 (- s4-0 s1-0))
(+! s3-0 s1-0)
)
(if (> s4-0 0)
(sp-process-block arg0 s3-0 arg2 s4-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: Return type mismatch int vs none.
;; Used lq/sq
(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 (-> (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 func) (the-as basic 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 (logtest? (-> arg1 flags) (sp-cpuinfo-flag level0))
(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 (logtest? (-> arg1 flags) (sp-cpuinfo-flag 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 'quaternion))
)
(vector-angle<-quaternion! (the-as vector s5-0) gp-0)
(set! (-> s5-0 w) (* 12516.455 (-> s5-0 w)))
(quaternion-vector-angle! gp-0 (the-as vector 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 'quaternion))
)
(vector-angle<-quaternion! (the-as vector s5-0) gp-0)
(set! (-> s5-0 w) (* 8691.982 (-> s5-0 w)))
(quaternion-vector-angle! gp-0 (the-as vector 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 (-> (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))
(forall-particles
(if (zero? (-> arg0 index))
sparticle-kill-it-level0
sparticle-kill-it-level1
)
#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 set-particle-frame-time
;; INFO: Return type mismatch int vs none.
(defun set-particle-frame-time ((arg0 int))
(cond
((= arg0 5)
(set-vector! *sp-frame-time* 0.00000000000000000000000000000000000001175495 5.0 1.0 1.0)
)
((= arg0 6)
(set-vector! *sp-frame-time* 0.000000000000000000000000000000000000011754952 6.0 1.2 1.2)
)
((= arg0 10)
(set-vector! *sp-frame-time* 0.000000000000000000000000000000000000011754958 10.0 2.0 2.0)
)
((= arg0 12)
(set-vector! *sp-frame-time* 0.00000000000000000000000000000000000001175496 12.0 2.4 2.4)
)
)
0
(none)
)
;; definition for function process-particles
;; INFO: Return type mismatch int vs none.
;; WARN: Unsupported inline assembly instruction kind - [mfc0 gp, Count]
;; WARN: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
(defun process-particles ()
(local-vars (v1-29 int) (gp-0 int))
(when *particles-flag*
0
0
(.mfc0 gp-0 Count)
(set! *sp-launcher-lock* #t)
(if *debug-segment*
(add-frame
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
'draw
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
)
)
(let ((v1-14 (logand (the-as int (-> *sp-frame-time* x)) 255)))
(set! *particle-300hz-timer* (+ *particle-300hz-timer* v1-14))
(cond
(*sp-60-hz*
(when (or (= v1-14 6) (= v1-14 12))
(set! *sp-60-hz* #f)
(all-particles-60-to-50)
)
)
(else
(when (or (= v1-14 5) (= v1-14 10))
(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*))
(if *debug-segment*
(add-frame
(-> *display* frames (-> *display* on-screen) frame profile-bar 0)
'draw
(new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)
)
)
(set! *sp-launcher-lock* #f)
(sp-clear-queue)
(.mfc0 v1-29 Count)
(let ((a2-5 (- v1-29 gp-0)))
(if *display-sprite-info*
(format
*stdcon*
"Particle time = ~D cycles for ~D 2D [~D warp] and ~D HUD and ~D 3D~%"
a2-5
(-> *sp-particle-system-2d* num-alloc 0)
(-> *sprite-aux-list* entry)
(-> *sp-particle-system-2d* num-alloc 1)
(-> *sp-particle-system-3d* num-alloc 0)
)
)
)
)
0
(none)
)
+7 -6
View File
@@ -92,7 +92,7 @@
)
;; definition for function stopwatch-stop
;; INFO: Return type mismatch int vs uint.
;; INFO: Return type mismatch int vs none.
;; WARN: Unsupported inline assembly instruction kind - [mfc0 a1, Count]
(defun stopwatch-stop ((arg0 stopwatch))
(local-vars (a1-0 int))
@@ -102,7 +102,8 @@
(.mfc0 a1-0 Count)
(+! (-> arg0 prev-time-elapsed) (- (the-as time-frame a1-0) (-> arg0 start-time)))
)
(the-as uint 0)
0
(none)
)
;; definition for function stopwatch-begin
@@ -119,7 +120,7 @@
)
;; definition for function stopwatch-end
;; INFO: Return type mismatch int vs uint.
;; INFO: Return type mismatch int vs none.
;; WARN: Unsupported inline assembly instruction kind - [mfc0 a1, Count]
(defun stopwatch-end ((arg0 stopwatch))
(local-vars (a1-0 int))
@@ -129,11 +130,11 @@
(.mfc0 a1-0 Count)
(+! (-> arg0 prev-time-elapsed) (- (the-as time-frame a1-0) (-> arg0 start-time)))
)
(the-as uint 0)
0
(none)
)
;; definition for function stopwatch-elapsed-ticks
;; INFO: Return type mismatch time-frame vs uint.
;; WARN: Unsupported inline assembly instruction kind - [mfc0 v1, Count]
(defun stopwatch-elapsed-ticks ((arg0 stopwatch))
(local-vars (v1-3 int))
@@ -143,7 +144,7 @@
(.mfc0 v1-3 Count)
(+! v0-0 (- (the-as time-frame v1-3) (-> arg0 start-time)))
)
(the-as uint v0-0)
v0-0
)
)
+1 -4
View File
@@ -53,6 +53,7 @@
)
;; 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))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tbirthaccum: ~f~%" (-> obj birthaccum))
@@ -212,7 +213,3 @@
;; failed to figure out what this is:
0
+1 -1
View File
@@ -207,7 +207,7 @@
(merc-blend-shape self)
)
(if (logtest? (-> self skel status) 384)
(merc-eye-anim self)
(merc-eye-anim (the-as manipy self))
)
(none)
)
+1 -1
View File
@@ -6,5 +6,5 @@ third-party/zydis:
sha: 562a7c1e5f2c5017ea882ad0aa3360c465a3eb8f
third-party/discord-rpc:
sha: 963aa9f3e5ce81a4682c6ca3d136cddda614db33
third-party/fng:
third-party/fpng:
sha: bfe5f9c69e93b99b31268c10db8e645c9125a07f