Files
jak-project/test/decompiler/reference/engine/gfx/tie/tie-h_REF.gc
T
water111 a8342aef31 [graphics] TIE extractor (#1026)
* temp

* temp

* wip

* more progress on the instance asm

* first half of tie extraction, up to dma lists

* more tie extraction

* first part figured out maybe

* bp1 loop seems to work, bp2 loop does not

* bp1 and bp2 appear working. sadly ip is needed

* ip1 outline, not working ip2

* just kidding, ip2 seems to work

* extraction seems to work

* basic rendering working

* tie fixes

* performance optimization of tie renderer

* hook up tie to engine

* fix more bugs

* cleanup and perf improvements

* fix tests

* ref tests

* mm256i for gcc

* CLANG

* windows

* more compile fixes

* fix fast time of day

* small fixes

* fix after merge

* clang
2021-12-26 12:33:51 -05:00

346 lines
16 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type tie-fragment
(deftype tie-fragment (drawable)
((gif-ref (inline-array adgif-shader) :offset 4)
(point-ref uint32 :offset 8)
(color-index uint16 :offset 12)
(base-colors uint8 :offset 14)
(tex-count uint16 :offset-assert 32)
(gif-count uint16 :offset-assert 34)
(vertex-count uint16 :offset-assert 36)
(color-count uint16 :offset-assert 38)
(num-tris uint16 :offset-assert 40)
(num-dverts uint16 :offset-assert 42)
(dp-ref uint32 :offset-assert 44)
(dp-qwc uint32 :offset-assert 48)
(generic-ref uint32 :offset-assert 52)
(generic-count uint32 :offset-assert 56)
(debug-lines (array vector-array) :offset-assert 60)
)
:method-count-assert 18
:size-assert #x40
:flag-assert #x1200000040
)
;; definition for method 3 of type tie-fragment
(defmethod inspect tie-fragment ((obj tie-fragment))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tid: ~D~%" (-> obj id))
(format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere))
(format #t "~Tgif-ref: #x~X~%" (-> obj gif-ref))
(format #t "~Tpoint-ref: #x~X~%" (-> obj point-ref))
(format #t "~Tcolor-index: ~D~%" (-> obj color-index))
(format #t "~Tbase-colors: ~D~%" (-> obj base-colors))
(format #t "~Ttex-count: ~D~%" (-> obj tex-count))
(format #t "~Tgif-count: ~D~%" (-> obj gif-count))
(format #t "~Tvertex-count: ~D~%" (-> obj vertex-count))
(format #t "~Tcolor-count: ~D~%" (-> obj color-count))
(format #t "~Tnum-tris: ~D~%" (-> obj num-tris))
(format #t "~Tnum-dverts: ~D~%" (-> obj num-dverts))
(format #t "~Tdp-ref: #x~X~%" (-> obj dp-ref))
(format #t "~Tdp-qwc: ~D~%" (-> obj dp-qwc))
(format #t "~Tgeneric-ref: #x~X~%" (-> obj generic-ref))
(format #t "~Tgeneric-count: ~D~%" (-> obj generic-count))
(format #t "~Tdebug-lines: ~A~%" (-> obj debug-lines))
obj
)
;; definition of type instance-tie
(deftype instance-tie (instance)
((color-indices uint32 :offset 8)
(bucket-ptr prototype-bucket-tie :offset 12)
(max-scale uint16 :offset 38)
(flags uint16 :offset 46)
)
:method-count-assert 18
:size-assert #x40
:flag-assert #x1200000040
)
;; definition for method 3 of type instance-tie
(defmethod inspect instance-tie ((obj instance-tie))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tid: ~D~%" (-> obj id))
(format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere))
(format #t "~Tbucket-index: ~D~%" (-> obj bucket-index))
(format #t "~Torigin: #<matrix4h @ #x~X>~%" (-> obj origin))
(format #t "~Twind-index: ~D~%" (-> obj wind-index))
(format #t "~Tcolor-indices: #x~X~%" (-> obj error))
(format #t "~Tbucket-ptr: ~A~%" (-> obj bucket-ptr))
(format #t "~Tmax-scale: ~D~%" (-> obj max-scale))
(format #t "~Tflags: ~D~%" (-> obj flags))
obj
)
;; definition of type drawable-inline-array-instance-tie
(deftype drawable-inline-array-instance-tie (drawable-inline-array)
((data instance-tie 1 :inline :offset-assert 32)
(pad uint32 :offset-assert 96)
)
:method-count-assert 18
:size-assert #x64
:flag-assert #x1200000064
)
;; definition of type drawable-tree-instance-tie
(deftype drawable-tree-instance-tie (drawable-tree)
((prototypes proxy-prototype-array-tie :offset 8)
)
:method-count-assert 18
:size-assert #x24
:flag-assert #x1200000024
)
;; definition for method 3 of type drawable-tree-instance-tie
(defmethod inspect drawable-tree-instance-tie ((obj drawable-tree-instance-tie))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tid: ~D~%" (-> obj id))
(format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[1] @ #x~X~%" (-> obj data))
(format #t "~Tprototypes: ~A~%" (-> obj prototypes))
obj
)
;; definition of type prototype-tie
(deftype prototype-tie (drawable-inline-array)
((data tie-fragment 1 :inline :offset-assert 32)
(pad uint32 :offset-assert 96)
)
:method-count-assert 18
:size-assert #x64
:flag-assert #x1200000064
)
;; definition of type tie-matrix
(deftype tie-matrix (structure)
((mat matrix :inline :offset-assert 0)
(morph qword :inline :offset-assert 64)
(fog qword :inline :offset-assert 80)
)
:method-count-assert 9
:size-assert #x60
:flag-assert #x900000060
)
;; definition for method 3 of type tie-matrix
(defmethod inspect tie-matrix ((obj tie-matrix))
(format #t "[~8x] ~A~%" obj 'tie-matrix)
(format #t "~Tmat: #<matrix @ #x~X>~%" (-> obj mat))
(format #t "~Tmorph: #<qword @ #x~X>~%" (-> obj morph))
(format #t "~Tfog: #<qword @ #x~X>~%" (-> obj fog))
obj
)
;; definition of type instance-tie-work
(deftype instance-tie-work (structure)
((wind-const vector :inline :offset-assert 0)
(hmge-d vector :inline :offset-assert 16)
(hvdf-offset vector :inline :offset-assert 32)
(wind-force vector :inline :offset-assert 48)
(constant vector :inline :offset-assert 64)
(far-morph vector :inline :offset-assert 80)
(dist-test vector :inline :offset-assert 96)
(min-dist vector :inline :offset-assert 112)
(guard-plane plane 4 :inline :offset-assert 128)
(upload-color-0 dma-packet :inline :offset-assert 192)
(upload-color-1 dma-packet :inline :offset-assert 208)
(upload-color-2 dma-packet :inline :offset-assert 224)
(upload-color-ret dma-packet :inline :offset-assert 240)
(upload-color-temp dma-packet :inline :offset-assert 256)
(generic-color-0 dma-packet :inline :offset-assert 272)
(generic-color-1 dma-packet :inline :offset-assert 288)
(generic-color-end dma-packet :inline :offset-assert 304)
(tie-near-perspective-matrix matrix :inline :offset-assert 320)
(wind-vectors uint32 :offset-assert 384)
(test-id uint32 :offset-assert 388)
(test-id2 uint32 :offset-assert 392)
(dma-buffer basic :offset-assert 396)
(to-spr uint32 :offset-assert 400)
(from-spr uint32 :offset-assert 404)
(wind-work uint32 :offset-assert 408)
(cur-vis-bits uint32 :offset-assert 412)
(end-vis-bits uint32 :offset-assert 416)
(first-generic-prototype uint32 :offset-assert 420)
(refl-fade-fac float :offset-assert 424)
(refl-fade-end float :offset-assert 428)
(flags uint32 :offset-assert 432)
(paused basic :offset-assert 436)
(wait-from-spr uint32 :offset-assert 440)
(wait-to-spr uint32 :offset-assert 444)
)
:method-count-assert 9
:size-assert #x1c0
:flag-assert #x9000001c0
)
;; definition for method 3 of type instance-tie-work
(defmethod inspect instance-tie-work ((obj instance-tie-work))
(format #t "[~8x] ~A~%" obj 'instance-tie-work)
(format #t "~Twind-const: #<vector @ #x~X>~%" (-> obj wind-const))
(format #t "~Thmge-d: #<vector @ #x~X>~%" (-> obj hmge-d))
(format #t "~Thvdf-offset: #<vector @ #x~X>~%" (-> obj hvdf-offset))
(format #t "~Twind-force: #<vector @ #x~X>~%" (-> obj wind-force))
(format #t "~Tconstant: #<vector @ #x~X>~%" (-> obj constant))
(format #t "~Tfar-morph: #<vector @ #x~X>~%" (-> obj far-morph))
(format #t "~Tdist-test: #<vector @ #x~X>~%" (-> obj dist-test))
(format #t "~Tmin-dist: #<vector @ #x~X>~%" (-> obj min-dist))
(format #t "~Tguard-plane[4] @ #x~X~%" (-> obj guard-plane))
(format #t "~Tupload-color-0: #<dma-packet @ #x~X>~%" (-> obj upload-color-0))
(format #t "~Tupload-color-1: #<dma-packet @ #x~X>~%" (-> obj upload-color-1))
(format #t "~Tupload-color-2: #<dma-packet @ #x~X>~%" (-> obj upload-color-2))
(format #t "~Tupload-color-ret: #<dma-packet @ #x~X>~%" (-> obj upload-color-ret))
(format #t "~Tupload-color-temp: #<dma-packet @ #x~X>~%" (-> obj upload-color-temp))
(format #t "~Tgeneric-color-0: #<dma-packet @ #x~X>~%" (-> obj generic-color-0))
(format #t "~Tgeneric-color-1: #<dma-packet @ #x~X>~%" (-> obj generic-color-1))
(format #t "~Tgeneric-color-end: #<dma-packet @ #x~X>~%" (-> obj generic-color-end))
(format #t "~Ttie-near-perspective-matrix: #<matrix @ #x~X>~%" (-> obj tie-near-perspective-matrix))
(format #t "~Twind-vectors: #x~X~%" (-> obj wind-vectors))
(format #t "~Ttest-id: ~D~%" (-> obj test-id))
(format #t "~Ttest-id2: ~D~%" (-> obj test-id2))
(format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer))
(format #t "~Tto-spr: ~D~%" (-> obj to-spr))
(format #t "~Tfrom-spr: ~D~%" (-> obj from-spr))
(format #t "~Twind-work: ~D~%" (-> obj wind-work))
(format #t "~Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits))
(format #t "~Tend-vis-bits: ~D~%" (-> obj end-vis-bits))
(format #t "~Tfirst-generic-prototype: #x~X~%" (-> obj first-generic-prototype))
(format #t "~Trefl-fade-fac: ~f~%" (-> obj refl-fade-fac))
(format #t "~Trefl-fade-end: ~f~%" (-> obj refl-fade-end))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Tpaused: ~A~%" (-> obj paused))
(format #t "~Twait-from-spr: ~D~%" (-> obj wait-from-spr))
(format #t "~Twait-to-spr: ~D~%" (-> obj wait-to-spr))
obj
)
;; definition of type instance-tie-dma
(deftype instance-tie-dma (structure)
((banka instance-tie 32 :inline :offset-assert 0)
(bankb instance-tie 32 :inline :offset-assert 2048)
(outa uint128 256 :offset-assert 4096)
(outb uint128 256 :offset-assert 8192)
(work instance-tie-work :dynamic :offset-assert 12288)
)
:method-count-assert 9
:size-assert #x3000
:flag-assert #x900003000
)
;; definition for method 3 of type instance-tie-dma
(defmethod inspect instance-tie-dma ((obj instance-tie-dma))
(format #t "[~8x] ~A~%" obj 'instance-tie-dma)
(format #t "~Tbanka[32] @ #x~X~%" (-> obj banka))
(format #t "~Tbankb[32] @ #x~X~%" (-> obj bankb))
(format #t "~Touta[256] @ #x~X~%" (-> obj outa))
(format #t "~Toutb[256] @ #x~X~%" (-> obj outb))
(format #t "~Twork: #<instance-tie-work @ #x~X>~%" (-> obj work 0))
obj
)
;; definition of type prototype-tie-work
(deftype prototype-tie-work (structure)
((upload-palette-0 dma-packet :inline :offset-assert 0)
(upload-palette-1 dma-packet :inline :offset-assert 16)
(upload-model-0 dma-packet :inline :offset-assert 32)
(upload-model-1 dma-packet :inline :offset-assert 48)
(upload-model-2 dma-packet :inline :offset-assert 64)
(upload-model-3 dma-packet :inline :offset-assert 80)
(upload-model-near-0 dma-packet :inline :offset-assert 96)
(upload-model-near-1 dma-packet :inline :offset-assert 112)
(upload-model-near-2 dma-packet :inline :offset-assert 128)
(upload-model-near-3 dma-packet :inline :offset-assert 144)
(upload-model-near-4 dma-packet :inline :offset-assert 160)
(generic-envmap-shader dma-packet :inline :offset-assert 176)
(generic-palette dma-packet :inline :offset-assert 192)
(generic-model-0 dma-packet :inline :offset-assert 208)
(generic-model-1 dma-packet :inline :offset-assert 224)
(generic-model-2 dma-packet :inline :offset-assert 240)
(generic-model-next dma-packet :inline :offset-assert 256)
(clamp uint64 :offset-assert 272)
(prototype-array basic :offset-assert 280)
(generic-wait-from-spr uint32 :offset-assert 284)
(generic-wait-to-spr uint32 :offset-assert 288)
(wait-from-spr uint32 :offset-assert 292)
(wait-to-spr uint32 :offset-assert 296)
(near-wait-from-spr uint32 :offset-assert 300)
(near-wait-to-spr uint32 :offset-assert 304)
)
:method-count-assert 9
:size-assert #x134
:flag-assert #x900000134
)
;; definition for method 3 of type prototype-tie-work
(defmethod inspect prototype-tie-work ((obj prototype-tie-work))
(format #t "[~8x] ~A~%" obj 'prototype-tie-work)
(format #t "~Tupload-palette-0: #<dma-packet @ #x~X>~%" (-> obj upload-palette-0))
(format #t "~Tupload-palette-1: #<dma-packet @ #x~X>~%" (-> obj upload-palette-1))
(format #t "~Tupload-model-0: #<dma-packet @ #x~X>~%" (-> obj upload-model-0))
(format #t "~Tupload-model-1: #<dma-packet @ #x~X>~%" (-> obj upload-model-1))
(format #t "~Tupload-model-2: #<dma-packet @ #x~X>~%" (-> obj upload-model-2))
(format #t "~Tupload-model-3: #<dma-packet @ #x~X>~%" (-> obj upload-model-3))
(format #t "~Tupload-model-near-0: #<dma-packet @ #x~X>~%" (-> obj upload-model-near-0))
(format #t "~Tupload-model-near-1: #<dma-packet @ #x~X>~%" (-> obj upload-model-near-1))
(format #t "~Tupload-model-near-2: #<dma-packet @ #x~X>~%" (-> obj upload-model-near-2))
(format #t "~Tupload-model-near-3: #<dma-packet @ #x~X>~%" (-> obj upload-model-near-3))
(format #t "~Tupload-model-near-4: #<dma-packet @ #x~X>~%" (-> obj upload-model-near-4))
(format #t "~Tgeneric-envmap-shader: #<dma-packet @ #x~X>~%" (-> obj generic-envmap-shader))
(format #t "~Tgeneric-palette: #<dma-packet @ #x~X>~%" (-> obj generic-palette))
(format #t "~Tgeneric-model-0: #<dma-packet @ #x~X>~%" (-> obj generic-model-0))
(format #t "~Tgeneric-model-1: #<dma-packet @ #x~X>~%" (-> obj generic-model-1))
(format #t "~Tgeneric-model-2: #<dma-packet @ #x~X>~%" (-> obj generic-model-2))
(format #t "~Tgeneric-model-next: #<dma-packet @ #x~X>~%" (-> obj generic-model-next))
(format #t "~Tclamp: ~D~%" (-> obj clamp))
(format #t "~Tprototype-array: ~A~%" (-> obj prototype-array))
(format #t "~Tgeneric-wait-from-spr: ~D~%" (-> obj generic-wait-from-spr))
(format #t "~Tgeneric-wait-to-spr: ~D~%" (-> obj generic-wait-to-spr))
(format #t "~Twait-from-spr: ~D~%" (-> obj wait-from-spr))
(format #t "~Twait-to-spr: ~D~%" (-> obj wait-to-spr))
(format #t "~Tnear-wait-from-spr: ~D~%" (-> obj near-wait-from-spr))
(format #t "~Tnear-wait-to-spr: ~D~%" (-> obj near-wait-to-spr))
obj
)
;; definition of type prototype-tie-dma
(deftype prototype-tie-dma (structure)
((colora rgba 256 :offset-assert 0)
(colorb rgba 256 :offset-assert 1024)
(outa uint128 256 :offset-assert 2048)
(outb uint128 256 :offset-assert 6144)
(length uint32 :offset-assert 10240)
(dma-buffer basic :offset-assert 10244)
(this-frag-count uint32 :offset-assert 10248)
(next uint32 4 :offset 10256)
(geometry uint32 4 :offset-assert 10272)
(frag-count uint8 4 :offset-assert 10288)
)
:method-count-assert 9
:size-assert #x2834
:flag-assert #x900002834
)
;; definition for method 3 of type prototype-tie-dma
(defmethod inspect prototype-tie-dma ((obj prototype-tie-dma))
(format #t "[~8x] ~A~%" obj 'prototype-tie-dma)
(format #t "~Tcolora[256] @ #x~X~%" (-> obj colora))
(format #t "~Tcolorb[256] @ #x~X~%" (-> obj colorb))
(format #t "~Touta[256] @ #x~X~%" (-> obj outa))
(format #t "~Toutb[256] @ #x~X~%" (-> obj outb))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer))
(format #t "~Tthis-frag-count: ~D~%" (-> obj this-frag-count))
(format #t "~Tnext[4] @ #x~X~%" (-> obj next))
(format #t "~Tgeometry[4] @ #x~X~%" (-> obj geometry))
(format #t "~Tfrag-count[4] @ #x~X~%" (-> obj frag-count))
obj
)
;; definition for symbol *instance-tie-work-copy*, type instance-tie-work
(define *instance-tie-work-copy* (the-as instance-tie-work #f))
;; failed to figure out what this is:
0