mirror of
https://github.com/open-goal/jak-project
synced 2026-07-09 23:01:56 -04:00
c12a5d777c
This should make all missions playable with the exception of the end of `precursor-destroy-ship` because `precurd` asserts on level extraction. - `trail` - `trail-graph` - `wastrail-graph` - `cty-protect` - `protect-gunship` - `protect-path` - `protect-script` - `assault-cams` - `assault-enemies` - `assault-path` - `assault-script` - `assault-shared` - `assault-task` - `hover-nav-precura` - `precura-mood` - `precura-obs` - `precura-obs2` - `precura-part` - `precurc-mood` - `precurc-obs` - `precurc-part` - `precurd-obs` - `precurd-part` - `precurd-scenes`
233 lines
8.0 KiB
Common Lisp
Vendored
Generated
233 lines
8.0 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type prim-vertex
|
|
(deftype prim-vertex (structure)
|
|
"Vertex for the prim renderer. These vertices are generated by
|
|
some special effect code, then sent to the prim renderer to be drawn."
|
|
((stq vector :inline)
|
|
(nokick uint32 :overlay-at (-> stq data 2))
|
|
(col rgba :overlay-at (-> stq data 3))
|
|
(pos vector :inline)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type prim-vertex
|
|
(defmethod inspect ((this prim-vertex))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'prim-vertex)
|
|
(format #t "~1Tstq: #<vector @ #x~X>~%" (-> this stq))
|
|
(format #t "~1Tnokick: ~D~%" (-> this stq z))
|
|
(format #t "~1Tcol: ~D~%" (-> this col))
|
|
(format #t "~1Tpos: #<vector @ #x~X>~%" (-> this pos))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type prim-base
|
|
(deftype prim-base (basic)
|
|
"Base class for prim-strip."
|
|
()
|
|
(:methods
|
|
(generate-dma! (_type_ matrix) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type prim-base
|
|
(defmethod inspect ((this prim-base))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type prim-strip
|
|
(deftype prim-strip (prim-base)
|
|
"A collection of vertices, all with the same texture and draw settings.
|
|
These are owned by the thing submitting to prim, not the prim renderer itself."
|
|
((flags prim-flags)
|
|
(tex-name basic)
|
|
(num-verts uint16)
|
|
(allocated-num-verts uint16)
|
|
(tex-id texture-id)
|
|
(adnops gs-adcmd 2 :inline)
|
|
(data0 gs-test :overlay-at (-> adnops 0 word 0))
|
|
(reg0 gs-reg64 :overlay-at (-> adnops 0 word 2))
|
|
(data1 gs-test :offset 48)
|
|
(reg1 gs-reg64 :offset 56)
|
|
(clamp gs-clamp)
|
|
(alpha gs-alpha)
|
|
(bucket bucket-id)
|
|
(sink uint32)
|
|
(level level)
|
|
(texture-index uint32)
|
|
(data prim-vertex :inline :dynamic)
|
|
)
|
|
(:methods
|
|
(new (symbol type int texture-id string) _type_)
|
|
(setup-dma-and-tex (_type_ draw-control) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type prim-strip
|
|
(defmethod inspect ((this prim-strip))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~1Tflags: ~D~%" (-> this flags))
|
|
(format #t "~1Ttex-name: ~A~%" (-> this tex-name))
|
|
(format #t "~1Tnum-verts: ~D~%" (-> this num-verts))
|
|
(format #t "~1Tallocated-num-verts: ~D~%" (-> this allocated-num-verts))
|
|
(format #t "~1Ttex-id: ~D~%" (-> this tex-id))
|
|
(format #t "~1Tadnops[2] @ #x~X~%" (-> this adnops))
|
|
(format #t "~1Tdata0: ~D~%" (-> this data0))
|
|
(format #t "~1Treg0: ~D~%" (-> this adnops 0 cmds))
|
|
(format #t "~1Tdata1: ~D~%" (-> this data1))
|
|
(format #t "~1Treg1: ~D~%" (-> this adnops 1 cmds))
|
|
(format #t "~1Tclamp: ~D~%" (-> this clamp))
|
|
(format #t "~1Talpha: ~D~%" (-> this alpha))
|
|
(format #t "~1Tbucket: ~D~%" (-> this bucket))
|
|
(format #t "~1Tsink: ~D~%" (-> this sink))
|
|
(format #t "~1Tlevel: ~A~%" (-> this level))
|
|
(format #t "~1Ttexture-index: ~D~%" (-> this texture-index))
|
|
(format #t "~1Tdata[0] @ #x~X~%" (-> this data))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 0 of type prim-strip
|
|
(defmethod new prim-strip ((allocation symbol) (type-to-make type) (num-vertices int) (tex-id texture-id) (tex-name string))
|
|
"Allocate a new prim-strip and room for vertices. The texture can be specified by name or ID."
|
|
(with-pp
|
|
(let ((s5-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* num-vertices 32))))))
|
|
(if (zero? s5-0)
|
|
(go process-drawable-art-error "prim-strip")
|
|
)
|
|
(add-connection *prim-engine* pp #f pp s5-0 #f)
|
|
(set! (-> s5-0 flags) (prim-flags alpha-blend-enable texture-enable))
|
|
(set! (-> s5-0 num-verts) (the-as uint num-vertices))
|
|
(set! (-> s5-0 allocated-num-verts) (the-as uint num-vertices))
|
|
(set! (-> s5-0 data0) (new 'static 'gs-test))
|
|
(set! (-> s5-0 adnops 0 cmds) (gs-reg64 hack))
|
|
(set! (-> s5-0 data1) (new 'static 'gs-test))
|
|
(set! (-> s5-0 adnops 1 cmds) (gs-reg64 hack))
|
|
(set! (-> s5-0 clamp) (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
|
|
(set! (-> s5-0 alpha) (new 'static 'gs-alpha :b #x1 :d #x1))
|
|
(cond
|
|
(tex-name
|
|
(set! (-> s5-0 tex-id) (lookup-texture-id-by-name tex-name (the-as string #f)))
|
|
(set! (-> s5-0 tex-name) tex-name)
|
|
(logclear! (-> s5-0 flags) (prim-flags no-texture-name))
|
|
)
|
|
(else
|
|
(set! (-> s5-0 tex-id) tex-id)
|
|
(set! (-> s5-0 tex-name) #f)
|
|
(logior! (-> s5-0 flags) (prim-flags no-texture-name))
|
|
)
|
|
)
|
|
(set! (-> s5-0 bucket) (bucket-id gmerc2-lcom-water))
|
|
(set! (-> s5-0 sink) (the-as uint 64))
|
|
(set! (-> s5-0 level) (-> *level* level-default))
|
|
(set! (-> s5-0 texture-index) (the-as uint 4))
|
|
(let ((f0-1 (/ 1.0 (the float (/ (+ num-vertices -1) 2)))))
|
|
(dotimes (v1-24 num-vertices)
|
|
(let ((a0-7 (-> s5-0 data v1-24)))
|
|
(set! (-> a0-7 stq x) (* (the float (/ v1-24 2)) f0-1))
|
|
(set! (-> a0-7 stq y) (the float (logand v1-24 1)))
|
|
(set! (-> a0-7 stq z) 0.0)
|
|
(set! (-> a0-7 col) (the-as rgba 0.0))
|
|
)
|
|
(set! (-> s5-0 data v1-24 col) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80))
|
|
(set-vector!
|
|
(the-as vector (+ (the-as uint (the-as vector (-> s5-0 data 0 pos))) (* v1-24 32)))
|
|
(* 4096.0 (the float (/ v1-24 2)))
|
|
(* 4096.0 (the float (logand v1-24 1)))
|
|
0.0
|
|
1.0
|
|
)
|
|
)
|
|
)
|
|
s5-0
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 5 of type prim-strip
|
|
;; WARN: Return type mismatch uint vs int.
|
|
(defmethod asize-of ((this prim-strip))
|
|
(the-as int (+ (-> this type size) (* (-> this allocated-num-verts) 32)))
|
|
)
|
|
|
|
;; definition of type prim-sink
|
|
(deftype prim-sink (structure)
|
|
((vertex-count uint8)
|
|
(control-count uint8)
|
|
)
|
|
:allow-misaligned
|
|
)
|
|
|
|
;; definition for method 3 of type prim-sink
|
|
(defmethod inspect ((this prim-sink))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'prim-sink)
|
|
(format #t "~1Tvertex-count: ~D~%" (-> this vertex-count))
|
|
(format #t "~1Tcontrol-count: ~D~%" (-> this control-count))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type prim-work
|
|
(deftype prim-work (structure)
|
|
((vertex-tmpl dma-packet 3 :inline)
|
|
(control-tmpl dma-packet 2 :inline)
|
|
(giftag generic-gif-tag :inline)
|
|
(call-scissor dma-packet :inline)
|
|
(call-noclip dma-packet :inline)
|
|
(shader adgif-shader :inline)
|
|
(mask vector4w :inline)
|
|
(in-verts int32)
|
|
(num-verts int32)
|
|
(vert-ptr (inline-array prim-vertex))
|
|
(sinks prim-sink 68 :inline)
|
|
)
|
|
(:methods
|
|
(reset! (_type_) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type prim-work
|
|
(defmethod inspect ((this prim-work))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'prim-work)
|
|
(format #t "~1Tvertex-tmpl[3] @ #x~X~%" (-> this vertex-tmpl))
|
|
(format #t "~1Tcontrol-tmpl[2] @ #x~X~%" (-> this control-tmpl))
|
|
(format #t "~1Tgiftag: #<generic-gif-tag @ #x~X>~%" (-> this giftag))
|
|
(format #t "~1Tcall-scissor: #<dma-packet @ #x~X>~%" (-> this call-scissor))
|
|
(format #t "~1Tcall-noclip: #<dma-packet @ #x~X>~%" (-> this call-noclip))
|
|
(format #t "~1Tshader: #<adgif-shader @ #x~X>~%" (-> this shader))
|
|
(format #t "~1Tmask: #<vector4w @ #x~X>~%" (-> this mask))
|
|
(format #t "~1Tin-verts: ~D~%" (-> this in-verts))
|
|
(format #t "~1Tnum-verts: ~D~%" (-> this num-verts))
|
|
(format #t "~1Tvert-ptr: #<prim-vertex @ #x~X>~%" (-> this vert-ptr))
|
|
(format #t "~1Tsinks[68] @ #x~X~%" (-> this sinks))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
0
|