decomp: generic-merc | generic-vu0 | generic-vu1 | shadow-vu1 (#1184)

This commit is contained in:
Hat Kid
2022-02-19 19:12:44 +01:00
committed by GitHub
parent af447aeab7
commit eebbe00ce4
13 changed files with 1086 additions and 46 deletions
+44 -44
View File
@@ -4502,7 +4502,7 @@
)
(deftype gs-gif-tag (structure)
((qword uint128 :offset-assert 0) ;; is "qword" and inline? in game
((qword uint128 :offset-assert 0 :score -1) ;; is "qword" and inline? in game
(tag gif-tag64 :offset 0)
(regs gif-tag-regs :offset 8)
@@ -9053,7 +9053,7 @@
(deftype shadow-data (structure)
((texoffset vector :inline :offset-assert 0)
(texscale vector :inline :offset-assert 16)
(clrs uint128 2 :offset-assert 32)
(clrs vector 2 :inline :offset-assert 32)
(dma-unpack-template dma-packet :inline :offset-assert 64)
(dma-cnt uint64 :offset-assert 80)
(vif-nop uint32 :offset-assert 88)
@@ -16656,7 +16656,7 @@
;; - Unknowns
;;(define-extern generic-vu0-block object) ;; unknown type
(define-extern generic-vu0-block vu-function) ;; unknown type
;; ----------------------
@@ -16687,7 +16687,7 @@
(define-extern generic-add-constants (function dma-buffer int none))
(define-extern generic-setup-constants (function generic-constants int none))
(define-extern generic-reset-buffers function)
(define-extern generic-reset-buffers (function dma-buffer int int none))
;; - Unknowns
@@ -16734,8 +16734,8 @@
;; - Unknowns
;;(define-extern *generic-consts* object) ;; unknown type
;;(define-extern *target-lock* object) ;; unknown type
(define-extern *generic-consts* generic-consts) ;; unknown type
(define-extern *target-lock* symbol) ;; unknown type
;; ----------------------
@@ -16765,13 +16765,13 @@
(define-extern mercneric-convert function)
(define-extern high-speed-reject function)
(define-extern generic-merc-execute-asm function)
(define-extern generic-merc-add-to-cue (function uint none))
(define-extern generic-merc-add-to-cue (function basic none))
(define-extern generic-merc-execute-all (function none))
;; - Unknowns
;;(define-extern mercneric-vu0-block object) ;; unknown type
;;(define-extern *inv-init-table* object) ;; unknown type
(define-extern mercneric-vu0-block vu-function) ;; unknown type
(define-extern *inv-init-table* (inline-array invinitdata)) ;; unknown type
;; ----------------------
@@ -16794,7 +16794,7 @@
;; - Unknowns
;;(define-extern *generic-tie* object) ;; unknown type
(define-extern *generic-tie* symbol) ;; unknown type
;; ----------------------
@@ -16846,10 +16846,10 @@
;; - Functions
(define-extern shadow-vu0-upload function)
(define-extern shadow-vu1-init-buffer function)
(define-extern shadow-dma-init function)
(define-extern shadow-execute function)
(define-extern shadow-dma-end function)
(define-extern shadow-vu1-init-buffer (function dma-buffer none))
(define-extern shadow-xform-verts function)
(define-extern shadow-calc-dual-verts function)
(define-extern shadow-scissor-edges function)
@@ -16872,7 +16872,7 @@
;; - Unknowns
;;(define-extern shadow-vu0-block object) ;; unknown type
(define-extern shadow-vu0-block vu-function) ;; unknown type
;; ----------------------
@@ -16883,46 +16883,46 @@
;; - Types
; (deftype shadow-vu1-constants (structure)
; ((hmgescale vector :inline :offset-assert 0)
; (invhscale vector :inline :offset-assert 16)
; (texoffset vector :inline :offset-assert 32)
; (texscale vector :inline :offset-assert 48)
; (hvdfoff vector :inline :offset-assert 64)
; (fog vector :inline :offset-assert 80)
; (clrs UNKNOWN 2 :offset-assert 96)
; (adgif gs-gif-tag :inline :offset-assert 128)
; (texflush ad-cmd :inline :offset-assert 144)
; (flush ad-cmd :inline :offset-assert 160)
; (trigif gs-gif-tag :inline :offset-assert 176)
; (quadgif gs-gif-tag :inline :offset-assert 192)
; )
; :method-count-assert 9
; :size-assert #xd0
; :flag-assert #x9000000d0
; )
(deftype shadow-vu1-constants (structure)
((hmgescale vector :inline :offset-assert 0)
(invhscale vector :inline :offset-assert 16)
(texoffset vector :inline :offset-assert 32)
(texscale vector :inline :offset-assert 48)
(hvdfoff vector :inline :offset-assert 64)
(fog vector :inline :offset-assert 80)
(clrs vector 2 :inline :offset-assert 96)
(adgif gs-gif-tag :inline :offset-assert 128)
(texflush ad-cmd :inline :offset-assert 144)
(flush ad-cmd :inline :offset-assert 160)
(trigif gs-gif-tag :inline :offset-assert 176)
(quadgif gs-gif-tag :inline :offset-assert 192)
)
:method-count-assert 9
:size-assert #xd0
:flag-assert #x9000000d0
)
; (deftype shadow-vu1-gifbuf-template (structure)
; ((adgif gs-gif-tag :inline :offset-assert 0)
; (ad ad-cmd :inline :offset-assert 16)
; (flush ad-cmd :inline :offset-assert 32)
; (trigif gs-gif-tag :inline :offset-assert 48)
; (quadgif gs-gif-tag :inline :offset-assert 64)
; )
; :method-count-assert 9
; :size-assert #x50
; :flag-assert #x900000050
; )
(deftype shadow-vu1-gifbuf-template (structure)
((adgif gs-gif-tag :inline :offset-assert 0)
(ad ad-cmd :inline :offset-assert 16)
(flush ad-cmd :inline :offset-assert 32)
(trigif gs-gif-tag :inline :offset-assert 48)
(quadgif gs-gif-tag :inline :offset-assert 64)
)
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
;; - Functions
(define-extern shadow-vu1-add-constants function)
(define-extern shadow-vu1-add-matrix function)
(define-extern shadow-vu1-add-constants (function dma-buffer none))
(define-extern shadow-vu1-add-matrix (function dma-buffer math-camera none))
;; - Unknowns
(define-extern shadow-vu1-block vu-function)
;;(define-extern *shadow-vu1-tri-template* object) ;; unknown type
(define-extern *shadow-vu1-tri-template* shadow-vu1-gifbuf-template) ;; unknown type
;; ----------------------
@@ -487,7 +487,8 @@
"(method 60 ice-cube)": [8],
"(anon-function 2 snow-ball)": [22],
"draw-bones-merc": [1, 3, 5, 7, 8, 10, 11, 12, 13],
"(anon-function 48 lavatube-energy)": [13]
"(anon-function 48 lavatube-energy)": [13],
"generic-tie-execute": [4, 9]
},
// Sometimes the game might use format strings that are fetched dynamically,
@@ -2087,6 +2087,30 @@
["L150", "vu-function"]
],
"generic-merc": [
["L161", "(inline-array invinitdata)", 8],
["L162", "vu-function"]
],
"generic-vu0": [
["L1", "vu-function"]
],
"generic-vu1": [
["L8", "vector4w"],
["L9", "vector4w"],
["L10", "vu-function"]
],
"generic-effect": [
["L95", "generic-consts"]
],
"shadow-vu1": [
["L5", "vu-function"],
["L6", "shadow-vu1-gifbuf-template"]
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
}
@@ -7300,5 +7300,45 @@
[41, "a0", "dma-packet"]
],
"generic-reset-buffers": [
[6, "t1", "dma-packet"],
[8, "t1", "dma-packet"],
[10, "t1", "dma-packet"],
[12, "t1", "dma-packet"],
[14, "t1", "dma-packet"],
[15, "t0", "dma-packet"]
],
"shadow-vu1-add-constants": [
[2, "a1", "dma-packet"],
[7, "a1", "dma-packet"],
[9, "a1", "dma-packet"],
[14, "a1", "dma-packet"],
[[21, 58], "v1", "shadow-vu1-constants"],
[61, "a1", "dma-packet"],
[63, "a1", "dma-packet"],
[65, "a1", "dma-packet"],
[67, "a1", "dma-packet"],
[71, "a1", "dma-packet"],
[[73, 85], "a1", "shadow-vu1-gifbuf-template"]
],
"shadow-vu1-add-matrix": [
[6, "a3", "dma-packet"],
[11, "a3", "dma-packet"],
[13, "a3", "dma-packet"],
[18, "a3", "dma-packet"],
[19, "a3", "dma-packet"],
[21, "v1", "dma-packet"],
[[26, 31], "v1", "matrix"]
],
"shadow-vu1-init-buffer": [
[14, "a0", "dma-packet"],
[16, "a0", "dma-packet"],
[22, "a0", "dma-packet"],
[24, "a0", "dma-packet"]
],
"placeholder-do-not-add-below": []
}
@@ -5,3 +5,60 @@
;; name in dgo: generic-merc
;; dgos: GAME, ENGINE
(define mercneric-vu0-block (new 'static 'vu-function :length #x0 :origin #x0 :qlength #x0))
(deftype invinitdata (structure)
((count uint8 :offset-assert 0)
(init-data uint8 :offset-assert 1)
(init-addr uint16 :offset-assert 2)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(defmethod inspect invinitdata ((obj invinitdata))
(format #t "[~8x] ~A~%" obj 'invinitdata)
(format #t "~Tcount: ~D~%" (-> obj count))
(format #t "~Tinit-data: ~D~%" (-> obj init-data))
(format #t "~Tinit-addr: ~D~%" (-> obj init-addr))
obj
)
(define *inv-init-table* (new 'static 'inline-array invinitdata 8
(new 'static 'invinitdata :count #x48 :init-addr #x1)
(new 'static 'invinitdata :count #x38 :init-data #x24 :init-addr #xe1)
(new 'static 'invinitdata :count #xbe)
(new 'static 'invinitdata :count #x81 :init-data #x80 :init-addr #x3b80)
(new 'static 'invinitdata :count #x88 :init-data #x50 :init-addr #x100a)
(new 'static 'invinitdata :count #x7d :init-data #xb :init-addr #x81e8)
(new 'static 'invinitdata :count #x7d :init-data #x1b :init-addr #x81e8)
(new 'static 'invinitdata :count #x2 :init-data #x68 :init-addr #x5200)
)
)
;; (def-mips2c generic-merc-init-asm function) ;; TODO mips2c
;; (def-mips2c mercneric-matrix-asm function) ;; TODO mips2c
;; (def-mips2c mercneric-shader-asm function) ;; TODO mips2c
;; (def-mips2c mercneric-bittable-asm function) ;; TODO mips2c
;; (def-mips2c mercneric-convert function) ;; TODO mips2c
;; (def-mips2c high-speed-reject function) ;; TODO mips2c
;; (def-mips2c generic-merc-execute-asm function) ;; TODO mips2c
(defun generic-merc-add-to-cue ((arg0 basic))
(set! (-> *merc-globals* sink) arg0)
(+! (-> *merc-global-array* count) 1)
(set! *merc-globals* (-> *merc-global-array* globals (-> *merc-global-array* count)))
(none)
)
;; (def-mips2c generic-merc-execute-all function) ;; TODO mips2c
@@ -5,3 +5,4 @@
;; name in dgo: generic-vu0
;; dgos: GAME, ENGINE
(define generic-vu0-block (new 'static 'vu-function :length #x0 :qlength #x0))
+166
View File
@@ -5,3 +5,169 @@
;; name in dgo: generic-vu1
;; dgos: GAME, ENGINE
(define generic-vu1-block (new 'static 'vu-function :length #x0 :qlength #x0))
(defun generic-setup-constants ((arg0 generic-constants) (arg1 int))
(let ((a2-0 *math-camera*))
(set-vector! (-> arg0 fog) (-> a2-0 pfog0) (-> a2-0 fog-min) (-> a2-0 fog-max) 3071.0)
)
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x7 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 giftag tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 giftag regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 hvdf-offset quad) (-> *math-camera* hvdf-off quad))
(set! (-> arg0 hmge-scale quad) (-> *math-camera* hmge-scale quad))
(set! (-> arg0 invh-scale quad) (-> *math-camera* inv-hmge-scale quad))
(set! (-> arg0 guard quad) (-> *math-camera* guard quad))
(set! (-> arg0 adnop dword 0) (the-as uint #x5026b))
(set! (-> arg0 adnop dword 1) (the-as uint 71))
(set! (-> arg0 flush dword 0) (the-as uint #x3f80000080808080))
(set! (-> arg0 flush dword 1) (the-as uint 1))
(none)
)
(defun generic-add-constants ((arg0 dma-buffer) (arg1 int))
(let* ((a2-0 10)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x381 :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(generic-setup-constants (the-as generic-constants (-> arg0 base)) arg1)
(&+! (-> arg0 base) 160)
(none)
)
(defun generic-init-buf ((arg0 dma-buffer) (arg1 int) (arg2 gs-zbuf))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask generic))
(dma-buffer-add-vu-function arg0 generic-vu1-block 1)
(let* ((v1-3 arg0)
(a0-2 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a0-2 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> a0-2 vif0) (new 'static 'vif-tag))
(set! (-> a0-2 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-3 base) (the-as pointer (&+ a0-2 16)))
)
(let* ((v1-4 arg0)
(a0-4 (the-as gs-gif-tag (-> v1-4 base)))
)
(set! (-> a0-4 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2))
(set! (-> a0-4 regs)
(new 'static 'gif-tag-regs
:regs0 (gif-reg-id a+d)
:regs1 (gif-reg-id a+d)
:regs2 (gif-reg-id a+d)
:regs3 (gif-reg-id a+d)
:regs4 (gif-reg-id a+d)
:regs5 (gif-reg-id a+d)
:regs6 (gif-reg-id a+d)
:regs7 (gif-reg-id a+d)
:regs8 (gif-reg-id a+d)
:regs9 (gif-reg-id a+d)
:regs10 (gif-reg-id a+d)
:regs11 (gif-reg-id a+d)
:regs12 (gif-reg-id a+d)
:regs13 (gif-reg-id a+d)
:regs14 (gif-reg-id a+d)
:regs15 (gif-reg-id a+d)
)
)
(set! (-> v1-4 base) (the-as pointer (&+ a0-4 16)))
)
(let* ((v1-5 arg0)
(a0-6 (-> v1-5 base))
)
(set! (-> (the-as (pointer gs-test) a0-6) 0)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
)
(set! (-> (the-as (pointer uint64) a0-6) 1) (the-as uint (gs-reg test-1)))
(set! (-> (the-as (pointer gs-zbuf) a0-6) 2) arg2)
(set! (-> (the-as (pointer uint64) a0-6) 3) (the-as uint (gs-reg zbuf-1)))
(set! (-> v1-5 base) (&+ a0-6 32))
)
(generic-add-constants arg0 arg1)
(let* ((v1-6 arg0)
(a0-9 (the-as dma-packet (-> v1-6 base)))
)
(set! (-> a0-9 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-9 vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> a0-9 vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> v1-6 base) (the-as pointer (&+ a0-9 16)))
)
(let ((v1-7 (the-as (pointer int32) (-> arg0 base))))
(set! (-> (the-as (pointer vif-tag) v1-7) 0) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) v1-7) 1) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) v1-7) 2) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) v1-7) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> v1-7 4) 0)
(set! (-> v1-7 5) 0)
(set! (-> v1-7 6) 0)
(set! (-> v1-7 7) 0)
(set! (-> arg0 base) (&+ (the-as pointer v1-7) 32))
)
)
0
(none)
)
;; unused
;; (defun generic-reset-buffers ((arg0 dma-buffer) (arg1 int) (arg2 int))
;; (when (logtest? *vu1-enable-user* (vu1-renderer-mask generic))
;; (let ((a3-0 (new 'static 'vector :x (the-as float #x345) :y (the-as float #x363)))
;; (v1-3 (new 'static 'vector :y (the-as float #x117) :z (the-as float #x22e)))
;; )
;; (let* ((t0-0 arg0)
;; (t1-0 (the-as object (-> t0-0 base)))
;; )
;; (set! (-> (the-as dma-packet t1-0) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
;; (set! (-> (the-as dma-packet t1-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
;; (set! (-> (the-as dma-packet t1-0) vif1)
;; (new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32))
;; )
;; (set! (-> t0-0 base) (the-as pointer (the-as dma-packet (&+ (the-as pointer t1-0) 16))))
;; )
;; (let ((t0-1 (-> arg0 base)))
;; (set! (-> (the-as (pointer int32) t0-1)) 0)
;; (s.w! (+ t0-1 4) 0)
;; (let ((a1-3 (-> a3-0 data arg1)))
;; (s.w! (+ t0-1 8) a1-3)
;; )
;; (let ((v1-5 (-> v1-3 data arg2)))
;; (s.w! (+ t0-1 12) v1-5)
;; )
;; (s.w! (+ t0-1 16) 0)
;; (s.w! (+ t0-1 20) 0)
;; (s.w! (+ t0-1 24) 0)
;; (let ((v1-6 #x1500000c))
;; (s.w! (+ t0-1 28) v1-6)
;; )
;; (set! (-> arg0 base) (&+ t0-1 32))
;; )
;; )
;; )
;; 0
;; (none)
;; )
+1 -1
View File
@@ -72,7 +72,7 @@
(deftype shadow-data (structure)
((texoffset vector :inline :offset-assert 0)
(texscale vector :inline :offset-assert 16)
(clrs uint128 2 :offset-assert 32)
(clrs vector 2 :inline :offset-assert 32)
(dma-unpack-template dma-packet :inline :offset-assert 64)
(dma-cnt uint64 :offset-assert 80)
(vif-nop uint32 :offset-assert 88)
+236
View File
@@ -5,3 +5,239 @@
;; name in dgo: shadow-vu1
;; dgos: GAME, ENGINE
(deftype shadow-vu1-constants (structure)
((hmgescale vector :inline :offset-assert 0)
(invhscale vector :inline :offset-assert 16)
(texoffset vector :inline :offset-assert 32)
(texscale vector :inline :offset-assert 48)
(hvdfoff vector :inline :offset-assert 64)
(fog vector :inline :offset-assert 80)
(clrs vector 2 :inline :offset-assert 96)
(adgif gs-gif-tag :inline :offset-assert 128)
(texflush ad-cmd :inline :offset-assert 144)
(flush ad-cmd :inline :offset-assert 160)
(trigif gs-gif-tag :inline :offset-assert 176)
(quadgif gs-gif-tag :inline :offset-assert 192)
)
:method-count-assert 9
:size-assert #xd0
:flag-assert #x9000000d0
)
(defmethod inspect shadow-vu1-constants ((obj shadow-vu1-constants))
(format #t "[~8x] ~A~%" obj 'shadow-vu1-constants)
(format #t "~Thmgescale: #<vector @ #x~X>~%" (-> obj hmgescale))
(format #t "~Tinvhscale: #<vector @ #x~X>~%" (-> obj invhscale))
(format #t "~Ttexoffset: #<vector @ #x~X>~%" (-> obj texoffset))
(format #t "~Ttexscale: #<vector @ #x~X>~%" (-> obj texscale))
(format #t "~Thvdfoff: #<vector @ #x~X>~%" (-> obj hvdfoff))
(format #t "~Tfog: #<vector @ #x~X>~%" (-> obj fog))
(format #t "~Tclrs[2] @ #x~X~%" (-> obj clrs))
(format #t "~Tadgif: #<gs-gif-tag @ #x~X>~%" (-> obj adgif))
(format #t "~Ttexflush: #<ad-cmd @ #x~X>~%" (-> obj texflush))
(format #t "~Tflush: #<ad-cmd @ #x~X>~%" (-> obj flush))
(format #t "~Ttrigif: #<gs-gif-tag @ #x~X>~%" (-> obj trigif))
(format #t "~Tquadgif: #<gs-gif-tag @ #x~X>~%" (-> obj quadgif))
obj
)
(deftype shadow-vu1-gifbuf-template (structure)
((adgif gs-gif-tag :inline :offset-assert 0)
(ad ad-cmd :inline :offset-assert 16)
(flush ad-cmd :inline :offset-assert 32)
(trigif gs-gif-tag :inline :offset-assert 48)
(quadgif gs-gif-tag :inline :offset-assert 64)
)
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
(defmethod inspect shadow-vu1-gifbuf-template ((obj shadow-vu1-gifbuf-template))
(format #t "[~8x] ~A~%" obj 'shadow-vu1-gifbuf-template)
(format #t "~Tadgif: #<gs-gif-tag @ #x~X>~%" (-> obj adgif))
(format #t "~Tad: #<ad-cmd @ #x~X>~%" (-> obj ad))
(format #t "~Tflush: #<ad-cmd @ #x~X>~%" (-> obj flush))
(format #t "~Ttrigif: #<gs-gif-tag @ #x~X>~%" (-> obj trigif))
(format #t "~Tquadgif: #<gs-gif-tag @ #x~X>~%" (-> obj quadgif))
obj
)
(define
*shadow-vu1-tri-template*
(new 'static 'shadow-vu1-gifbuf-template
:adgif
(new 'static 'gs-gif-tag
:tag
(new 'static 'gif-tag64 :nloop #x1 :nreg #x1)
:regs
(new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
)
:ad
(new 'static 'ad-cmd :word (new 'static 'array uint32 4 #x0 #x0 #x3f #x0))
:flush
(new 'static 'ad-cmd :word (new 'static 'array uint32 4 #x0 #x3f800000 #x1 #x0))
:trigif
(new 'static 'gs-gif-tag
:tag
(new 'static 'gif-tag64
:nloop #x1
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1)
:nreg #x7
)
:regs
(new 'static 'gif-tag-regs
:regs0 (gif-reg-id rgbaq)
:regs1 (gif-reg-id st)
:regs2 (gif-reg-id xyzf2)
:regs3 (gif-reg-id st)
:regs4 (gif-reg-id xyzf2)
:regs5 (gif-reg-id st)
:regs6 (gif-reg-id xyzf2)
)
)
:quadgif
(new 'static 'gs-gif-tag
:tag
(new 'static 'gif-tag64
:nloop #x1
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1)
:nreg #x9
)
:regs
(new 'static 'gif-tag-regs
:regs0 (gif-reg-id rgbaq)
:regs1 (gif-reg-id st)
:regs2 (gif-reg-id xyzf2)
:regs3 (gif-reg-id st)
:regs4 (gif-reg-id xyzf2)
:regs5 (gif-reg-id st)
:regs6 (gif-reg-id xyzf2)
:regs7 (gif-reg-id st)
:regs8 (gif-reg-id xyzf2)
)
)
)
)
(define shadow-vu1-block (new 'static 'vu-function :length #x0 :qlength #x0))
(defun shadow-vu1-add-constants ((arg0 dma-buffer))
(let* ((a2-0 13)
(v1-0 arg0)
(a1-0 (the-as object (-> v1-0 base)))
)
(set! (-> (the-as dma-packet a1-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> (the-as dma-packet a1-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet a1-0) vif1)
(new 'static 'vif-tag :imm #x370 :cmd (vif-cmd unpack-v4-32) :num a2-0)
)
(set! (-> v1-0 base) (&+ (the-as pointer a1-0) 16))
)
(let ((v1-1 (the-as object (-> arg0 base)))
(a3-4 *math-camera*)
(a2-4 *shadow-data*)
(a1-2 *shadow-vu1-tri-template*)
)
(set! (-> (the-as shadow-vu1-constants v1-1) hmgescale quad) (-> a3-4 hmge-scale quad))
(set! (-> (the-as shadow-vu1-constants v1-1) invhscale quad) (-> a3-4 inv-hmge-scale quad))
(set! (-> (the-as shadow-vu1-constants v1-1) texoffset quad) (-> a2-4 texoffset quad))
(set! (-> (the-as shadow-vu1-constants v1-1) texscale quad) (-> a2-4 texscale quad))
(set! (-> (the-as shadow-vu1-constants v1-1) hvdfoff quad) (-> a3-4 hvdf-off quad))
(set! (-> (the-as shadow-vu1-constants v1-1) fog x) (-> a3-4 pfog0))
(set! (-> (the-as shadow-vu1-constants v1-1) clrs 0 quad) (-> a2-4 clrs 0 quad))
(set! (-> (the-as shadow-vu1-constants v1-1) clrs 1 quad) (-> a2-4 clrs 1 quad))
(set! (-> (the-as shadow-vu1-constants v1-1) adgif qword) (-> a1-2 adgif qword))
(set! (-> (the-as shadow-vu1-constants v1-1) texflush quad) (-> a1-2 ad quad))
(set! (-> (the-as shadow-vu1-constants v1-1) flush quad) (-> a1-2 flush quad))
(set! (-> (the-as shadow-vu1-constants v1-1) trigif qword) (-> a1-2 trigif qword))
(set! (-> (the-as shadow-vu1-constants v1-1) quadgif qword) (-> a1-2 quadgif qword))
)
(&+! (-> arg0 base) 208)
(let* ((v1-4 arg0)
(a1-4 (the-as object (-> v1-4 base)))
)
(set! (-> (the-as dma-packet a1-4) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a1-4) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet a1-4) vif1)
(new 'static 'vif-tag :imm #x3ac :num #x4 :cmd (vif-cmd unpack-v4-32))
)
(set! (-> v1-4 base) (&+ (the-as pointer a1-4) 16))
)
(let* ((v1-5 arg0)
(a1-6 (the-as object (-> v1-5 base)))
)
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) adgif tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x2))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) adgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d) :regs1 (gif-reg-id rgbaq))
)
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) ad data) (the-as uint 0))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) ad cmds) (the-as uint 63))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) flush data) (the-as uint 0))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) flush cmds) (the-as uint 0))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) trigif tag)
(new 'static 'gif-tag64
:nloop #x3
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1)
:nreg #x2
)
)
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) trigif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id xyzf2))
)
(set! (-> v1-5 base) (&+ (the-as pointer a1-6) 64))
)
(none)
)
(defun shadow-vu1-add-matrix ((arg0 dma-buffer) (arg1 math-camera))
(let ((v1-0 4))
(let* ((a2-4 arg0)
(a3-0 (the-as object (-> a2-4 base)))
)
(set! (-> (the-as dma-packet a3-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-0))
(set! (-> (the-as dma-packet a3-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet a3-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num v1-0))
(set! (-> a2-4 base) (the-as pointer (&+ (the-as dma-packet a3-0) 16)))
)
)
(let ((v1-5 (the-as object (-> arg0 base))))
(let ((a2-5 (-> arg1 perspective vector 0 quad))
(a3-1 (-> arg1 perspective vector 1 quad))
(t0-4 (-> arg1 perspective vector 2 quad))
(a1-1 (-> arg1 perspective vector 3 quad))
)
(set! (-> (the-as matrix v1-5) vector 0 quad) a2-5)
(set! (-> (the-as matrix v1-5) vector 1 quad) a3-1)
(set! (-> (the-as matrix v1-5) vector 2 quad) t0-4)
(set! (-> (the-as matrix v1-5) vector 3 quad) a1-1)
)
(set! (-> arg0 base) (the-as pointer (&+ (the-as matrix v1-5) 64)))
)
(none)
)
(defun shadow-vu1-init-buffer ((arg0 dma-buffer))
(dma-buffer-add-vu-function arg0 shadow-vu1-block 1)
(shadow-vu1-add-constants arg0)
(shadow-vu1-add-matrix arg0 *math-camera*)
(let* ((v1-0 arg0)
(a0-4 (the-as object (-> v1-0 base)))
)
(set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm #xa))
(set! (-> (the-as dma-packet a0-4) vif1) (new 'static 'vif-tag :cmd (vif-cmd flushe) :msk #x1))
(set! (-> v1-0 base) (&+ (the-as pointer a0-4) 16))
)
(none)
)
+75
View File
@@ -0,0 +1,75 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol mercneric-vu0-block, type vu-function
(define mercneric-vu0-block (new 'static 'vu-function :length #xbe :origin #x118 :qlength 95))
;; definition of type invinitdata
(deftype invinitdata (structure)
((count uint8 :offset-assert 0)
(init-data uint8 :offset-assert 1)
(init-addr uint16 :offset-assert 2)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
;; definition for method 3 of type invinitdata
(defmethod inspect invinitdata ((obj invinitdata))
(format #t "[~8x] ~A~%" obj 'invinitdata)
(format #t "~Tcount: ~D~%" (-> obj count))
(format #t "~Tinit-data: ~D~%" (-> obj init-data))
(format #t "~Tinit-addr: ~D~%" (-> obj init-addr))
obj
)
;; definition for symbol *inv-init-table*, type (inline-array invinitdata)
(define *inv-init-table* (new 'static 'inline-array invinitdata 8
(new 'static 'invinitdata :count #x48 :init-addr #x1)
(new 'static 'invinitdata :count #x38 :init-data #x24 :init-addr #xe1)
(new 'static 'invinitdata :count #xbe)
(new 'static 'invinitdata :count #x81 :init-data #x80 :init-addr #x3b80)
(new 'static 'invinitdata :count #x88 :init-data #x50 :init-addr #x100a)
(new 'static 'invinitdata :count #x7d :init-data #xb :init-addr #x81e8)
(new 'static 'invinitdata :count #x7d :init-data #x1b :init-addr #x81e8)
(new 'static 'invinitdata :count #x2 :init-data #x68 :init-addr #x5200)
)
)
;; definition for function generic-merc-init-asm
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function mercneric-matrix-asm
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function mercneric-shader-asm
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function mercneric-bittable-asm
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function mercneric-convert
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function high-speed-reject
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function generic-merc-execute-asm
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function generic-merc-add-to-cue
;; INFO: Return type mismatch merc-globals vs none.
(defun generic-merc-add-to-cue ((arg0 basic))
(set! (-> *merc-globals* sink) arg0)
(+! (-> *merc-global-array* count) 1)
(set! *merc-globals* (-> *merc-global-array* globals (-> *merc-global-array* count)))
(none)
)
;; definition for function generic-merc-execute-all
;; ERROR: function was not converted to expressions. Cannot decompile.
+9
View File
@@ -0,0 +1,9 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol generic-vu0-block, type vu-function
(define generic-vu0-block (new 'static 'vu-function :length #x127 :qlength #x94))
+178
View File
@@ -0,0 +1,178 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol generic-vu1-block, type vu-function
(define generic-vu1-block (new 'static 'vu-function :length #x446 :qlength #x223))
;; definition for function generic-setup-constants
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defun generic-setup-constants ((arg0 generic-constants) (arg1 int))
(let ((a2-0 *math-camera*))
(set-vector! (-> arg0 fog) (-> a2-0 pfog0) (-> a2-0 fog-min) (-> a2-0 fog-max) 3071.0)
)
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x7 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 giftag tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 giftag regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 hvdf-offset quad) (-> *math-camera* hvdf-off quad))
(set! (-> arg0 hmge-scale quad) (-> *math-camera* hmge-scale quad))
(set! (-> arg0 invh-scale quad) (-> *math-camera* inv-hmge-scale quad))
(set! (-> arg0 guard quad) (-> *math-camera* guard quad))
(set! (-> arg0 adnop dword 0) (the-as uint #x5026b))
(set! (-> arg0 adnop dword 1) (the-as uint 71))
(set! (-> arg0 flush dword 0) (the-as uint #x3f80000080808080))
(set! (-> arg0 flush dword 1) (the-as uint 1))
(none)
)
;; definition for function generic-add-constants
;; INFO: Return type mismatch pointer vs none.
(defun generic-add-constants ((arg0 dma-buffer) (arg1 int))
(let* ((a2-0 10)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x381 :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(generic-setup-constants (the-as generic-constants (-> arg0 base)) arg1)
(&+! (-> arg0 base) 160)
(none)
)
;; definition for function generic-init-buf
;; INFO: Return type mismatch int vs none.
(defun generic-init-buf ((arg0 dma-buffer) (arg1 int) (arg2 gs-zbuf))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask generic))
(dma-buffer-add-vu-function arg0 generic-vu1-block 1)
(let* ((v1-3 arg0)
(a0-2 (the-as dma-packet (-> v1-3 base)))
)
(set! (-> a0-2 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> a0-2 vif0) (new 'static 'vif-tag))
(set! (-> a0-2 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1))
(set! (-> v1-3 base) (the-as pointer (&+ a0-2 16)))
)
(let* ((v1-4 arg0)
(a0-4 (the-as gs-gif-tag (-> v1-4 base)))
)
(set! (-> a0-4 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2))
(set! (-> a0-4 regs)
(new 'static 'gif-tag-regs
:regs0 (gif-reg-id a+d)
:regs1 (gif-reg-id a+d)
:regs2 (gif-reg-id a+d)
:regs3 (gif-reg-id a+d)
:regs4 (gif-reg-id a+d)
:regs5 (gif-reg-id a+d)
:regs6 (gif-reg-id a+d)
:regs7 (gif-reg-id a+d)
:regs8 (gif-reg-id a+d)
:regs9 (gif-reg-id a+d)
:regs10 (gif-reg-id a+d)
:regs11 (gif-reg-id a+d)
:regs12 (gif-reg-id a+d)
:regs13 (gif-reg-id a+d)
:regs14 (gif-reg-id a+d)
:regs15 (gif-reg-id a+d)
)
)
(set! (-> v1-4 base) (the-as pointer (&+ a0-4 16)))
)
(let* ((v1-5 arg0)
(a0-6 (-> v1-5 base))
)
(set! (-> (the-as (pointer gs-test) a0-6) 0)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
)
(set! (-> (the-as (pointer uint64) a0-6) 1) (the-as uint (gs-reg test-1)))
(set! (-> (the-as (pointer gs-zbuf) a0-6) 2) arg2)
(set! (-> (the-as (pointer uint64) a0-6) 3) (the-as uint (gs-reg zbuf-1)))
(set! (-> v1-5 base) (&+ a0-6 32))
)
(generic-add-constants arg0 arg1)
(let* ((v1-6 arg0)
(a0-9 (the-as dma-packet (-> v1-6 base)))
)
(set! (-> a0-9 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-9 vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> a0-9 vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> v1-6 base) (the-as pointer (&+ a0-9 16)))
)
(let ((v1-7 (the-as (pointer int32) (-> arg0 base))))
(set! (-> (the-as (pointer vif-tag) v1-7) 0) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) v1-7) 1) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) v1-7) 2) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) v1-7) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> v1-7 4) 0)
(set! (-> v1-7 5) 0)
(set! (-> v1-7 6) 0)
(set! (-> v1-7 7) 0)
(set! (-> arg0 base) (&+ (the-as pointer v1-7) 32))
)
)
0
(none)
)
;; definition for function generic-reset-buffers
;; INFO: Return type mismatch int vs none.
(defun generic-reset-buffers ((arg0 dma-buffer) (arg1 int) (arg2 int))
(when (logtest? *vu1-enable-user* (vu1-renderer-mask generic))
(let ((a3-0 (new 'static 'vector :x (the-as float #x345) :y (the-as float #x363)))
(v1-3 (new 'static 'vector :y (the-as float #x117) :z (the-as float #x22e)))
)
(let* ((t0-0 arg0)
(t1-0 (the-as object (-> t0-0 base)))
)
(set! (-> (the-as dma-packet t1-0) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet t1-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet t1-0) vif1)
(new 'static 'vif-tag :imm #x38a :num #x1 :cmd (vif-cmd unpack-v4-32))
)
(set! (-> t0-0 base) (the-as pointer (the-as dma-packet (&+ (the-as pointer t1-0) 16))))
)
(let ((t0-1 (-> arg0 base)))
(set! (-> (the-as (pointer int32) t0-1)) 0)
(s.w! (+ t0-1 4) 0)
(let ((a1-3 (-> a3-0 data arg1)))
(s.w! (+ t0-1 8) a1-3)
)
(let ((v1-5 (-> v1-3 data arg2)))
(s.w! (+ t0-1 12) v1-5)
)
(s.w! (+ t0-1 16) 0)
(s.w! (+ t0-1 20) 0)
(s.w! (+ t0-1 24) 0)
(let ((v1-6 #x1500000c))
(s.w! (+ t0-1 28) v1-6)
)
(set! (-> arg0 base) (&+ t0-1 32))
)
)
)
0
(none)
)
+253
View File
@@ -0,0 +1,253 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type shadow-vu1-constants
(deftype shadow-vu1-constants (structure)
((hmgescale vector :inline :offset-assert 0)
(invhscale vector :inline :offset-assert 16)
(texoffset vector :inline :offset-assert 32)
(texscale vector :inline :offset-assert 48)
(hvdfoff vector :inline :offset-assert 64)
(fog vector :inline :offset-assert 80)
(clrs vector 2 :inline :offset-assert 96)
(adgif gs-gif-tag :inline :offset-assert 128)
(texflush ad-cmd :inline :offset-assert 144)
(flush ad-cmd :inline :offset-assert 160)
(trigif gs-gif-tag :inline :offset-assert 176)
(quadgif gs-gif-tag :inline :offset-assert 192)
)
:method-count-assert 9
:size-assert #xd0
:flag-assert #x9000000d0
)
;; definition for method 3 of type shadow-vu1-constants
(defmethod inspect shadow-vu1-constants ((obj shadow-vu1-constants))
(format #t "[~8x] ~A~%" obj 'shadow-vu1-constants)
(format #t "~Thmgescale: #<vector @ #x~X>~%" (-> obj hmgescale))
(format #t "~Tinvhscale: #<vector @ #x~X>~%" (-> obj invhscale))
(format #t "~Ttexoffset: #<vector @ #x~X>~%" (-> obj texoffset))
(format #t "~Ttexscale: #<vector @ #x~X>~%" (-> obj texscale))
(format #t "~Thvdfoff: #<vector @ #x~X>~%" (-> obj hvdfoff))
(format #t "~Tfog: #<vector @ #x~X>~%" (-> obj fog))
(format #t "~Tclrs[2] @ #x~X~%" (-> obj clrs))
(format #t "~Tadgif: #<gs-gif-tag @ #x~X>~%" (-> obj adgif))
(format #t "~Ttexflush: #<ad-cmd @ #x~X>~%" (-> obj texflush))
(format #t "~Tflush: #<ad-cmd @ #x~X>~%" (-> obj flush))
(format #t "~Ttrigif: #<gs-gif-tag @ #x~X>~%" (-> obj trigif))
(format #t "~Tquadgif: #<gs-gif-tag @ #x~X>~%" (-> obj quadgif))
obj
)
;; definition of type shadow-vu1-gifbuf-template
(deftype shadow-vu1-gifbuf-template (structure)
((adgif gs-gif-tag :inline :offset-assert 0)
(ad ad-cmd :inline :offset-assert 16)
(flush ad-cmd :inline :offset-assert 32)
(trigif gs-gif-tag :inline :offset-assert 48)
(quadgif gs-gif-tag :inline :offset-assert 64)
)
:method-count-assert 9
:size-assert #x50
:flag-assert #x900000050
)
;; definition for method 3 of type shadow-vu1-gifbuf-template
(defmethod inspect shadow-vu1-gifbuf-template ((obj shadow-vu1-gifbuf-template))
(format #t "[~8x] ~A~%" obj 'shadow-vu1-gifbuf-template)
(format #t "~Tadgif: #<gs-gif-tag @ #x~X>~%" (-> obj adgif))
(format #t "~Tad: #<ad-cmd @ #x~X>~%" (-> obj ad))
(format #t "~Tflush: #<ad-cmd @ #x~X>~%" (-> obj flush))
(format #t "~Ttrigif: #<gs-gif-tag @ #x~X>~%" (-> obj trigif))
(format #t "~Tquadgif: #<gs-gif-tag @ #x~X>~%" (-> obj quadgif))
obj
)
;; definition for symbol *shadow-vu1-tri-template*, type shadow-vu1-gifbuf-template
(define
*shadow-vu1-tri-template*
(new 'static 'shadow-vu1-gifbuf-template
:adgif
(new 'static 'gs-gif-tag
:tag
(new 'static 'gif-tag64 :nloop #x1 :nreg #x1)
:regs
(new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
)
:ad
(new 'static 'ad-cmd :word (new 'static 'array uint32 4 #x0 #x0 #x3f #x0))
:flush
(new 'static 'ad-cmd :word (new 'static 'array uint32 4 #x0 #x3f800000 #x1 #x0))
:trigif
(new 'static 'gs-gif-tag
:tag
(new 'static 'gif-tag64
:nloop #x1
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1)
:nreg #x7
)
:regs
(new 'static 'gif-tag-regs
:regs0 (gif-reg-id rgbaq)
:regs1 (gif-reg-id st)
:regs2 (gif-reg-id xyzf2)
:regs3 (gif-reg-id st)
:regs4 (gif-reg-id xyzf2)
:regs5 (gif-reg-id st)
:regs6 (gif-reg-id xyzf2)
)
)
:quadgif
(new 'static 'gs-gif-tag
:tag
(new 'static 'gif-tag64
:nloop #x1
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1)
:nreg #x9
)
:regs
(new 'static 'gif-tag-regs
:regs0 (gif-reg-id rgbaq)
:regs1 (gif-reg-id st)
:regs2 (gif-reg-id xyzf2)
:regs3 (gif-reg-id st)
:regs4 (gif-reg-id xyzf2)
:regs5 (gif-reg-id st)
:regs6 (gif-reg-id xyzf2)
:regs7 (gif-reg-id st)
:regs8 (gif-reg-id xyzf2)
)
)
)
)
;; definition for symbol shadow-vu1-block, type vu-function
(define shadow-vu1-block (new 'static 'vu-function :length #x2e4 :qlength #x172))
;; definition for function shadow-vu1-add-constants
;; INFO: Return type mismatch dma-buffer vs none.
;; Used lq/sq
(defun shadow-vu1-add-constants ((arg0 dma-buffer))
(let* ((a2-0 13)
(v1-0 arg0)
(a1-0 (the-as object (-> v1-0 base)))
)
(set! (-> (the-as dma-packet a1-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> (the-as dma-packet a1-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet a1-0) vif1)
(new 'static 'vif-tag :imm #x370 :cmd (vif-cmd unpack-v4-32) :num a2-0)
)
(set! (-> v1-0 base) (&+ (the-as pointer a1-0) 16))
)
(let ((v1-1 (the-as object (-> arg0 base)))
(a3-4 *math-camera*)
(a2-4 *shadow-data*)
(a1-2 *shadow-vu1-tri-template*)
)
(set! (-> (the-as shadow-vu1-constants v1-1) hmgescale quad) (-> a3-4 hmge-scale quad))
(set! (-> (the-as shadow-vu1-constants v1-1) invhscale quad) (-> a3-4 inv-hmge-scale quad))
(set! (-> (the-as shadow-vu1-constants v1-1) texoffset quad) (-> a2-4 texoffset quad))
(set! (-> (the-as shadow-vu1-constants v1-1) texscale quad) (-> a2-4 texscale quad))
(set! (-> (the-as shadow-vu1-constants v1-1) hvdfoff quad) (-> a3-4 hvdf-off quad))
(set! (-> (the-as shadow-vu1-constants v1-1) fog x) (-> a3-4 pfog0))
(set! (-> (the-as shadow-vu1-constants v1-1) clrs 0 quad) (-> a2-4 clrs 0 quad))
(set! (-> (the-as shadow-vu1-constants v1-1) clrs 1 quad) (-> a2-4 clrs 1 quad))
(set! (-> (the-as shadow-vu1-constants v1-1) adgif qword) (-> a1-2 adgif qword))
(set! (-> (the-as shadow-vu1-constants v1-1) texflush quad) (-> a1-2 ad quad))
(set! (-> (the-as shadow-vu1-constants v1-1) flush quad) (-> a1-2 flush quad))
(set! (-> (the-as shadow-vu1-constants v1-1) trigif qword) (-> a1-2 trigif qword))
(set! (-> (the-as shadow-vu1-constants v1-1) quadgif qword) (-> a1-2 quadgif qword))
)
(&+! (-> arg0 base) 208)
(let* ((v1-4 arg0)
(a1-4 (the-as object (-> v1-4 base)))
)
(set! (-> (the-as dma-packet a1-4) dma) (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a1-4) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet a1-4) vif1)
(new 'static 'vif-tag :imm #x3ac :num #x4 :cmd (vif-cmd unpack-v4-32))
)
(set! (-> v1-4 base) (&+ (the-as pointer a1-4) 16))
)
(let* ((v1-5 arg0)
(a1-6 (the-as object (-> v1-5 base)))
)
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) adgif tag) (new 'static 'gif-tag64 :nloop #x1 :nreg #x2))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) adgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d) :regs1 (gif-reg-id rgbaq))
)
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) ad data) (the-as uint 0))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) ad cmds) (the-as uint 63))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) flush data) (the-as uint 0))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) flush cmds) (the-as uint 0))
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) trigif tag)
(new 'static 'gif-tag64
:nloop #x3
:eop #x1
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :tme #x1)
:nreg #x2
)
)
(set! (-> (the-as shadow-vu1-gifbuf-template a1-6) trigif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id xyzf2))
)
(set! (-> v1-5 base) (&+ (the-as pointer a1-6) 64))
)
(none)
)
;; definition for function shadow-vu1-add-matrix
;; INFO: Return type mismatch dma-buffer vs none.
;; Used lq/sq
(defun shadow-vu1-add-matrix ((arg0 dma-buffer) (arg1 math-camera))
(let ((v1-0 4))
(let* ((a2-4 arg0)
(a3-0 (the-as object (-> a2-4 base)))
)
(set! (-> (the-as dma-packet a3-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc v1-0))
(set! (-> (the-as dma-packet a3-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as dma-packet a3-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :num v1-0))
(set! (-> a2-4 base) (the-as pointer (&+ (the-as dma-packet a3-0) 16)))
)
)
(let ((v1-5 (the-as object (-> arg0 base))))
(let ((a2-5 (-> arg1 perspective vector 0 quad))
(a3-1 (-> arg1 perspective vector 1 quad))
(t0-4 (-> arg1 perspective vector 2 quad))
(a1-1 (-> arg1 perspective vector 3 quad))
)
(set! (-> (the-as matrix v1-5) vector 0 quad) a2-5)
(set! (-> (the-as matrix v1-5) vector 1 quad) a3-1)
(set! (-> (the-as matrix v1-5) vector 2 quad) t0-4)
(set! (-> (the-as matrix v1-5) vector 3 quad) a1-1)
)
(set! (-> arg0 base) (the-as pointer (&+ (the-as matrix v1-5) 64)))
)
(none)
)
;; definition for function shadow-vu1-init-buffer
;; INFO: Return type mismatch dma-buffer vs none.
(defun shadow-vu1-init-buffer ((arg0 dma-buffer))
(dma-buffer-add-vu-function arg0 shadow-vu1-block 1)
(shadow-vu1-add-constants arg0)
(shadow-vu1-add-matrix arg0 *math-camera*)
(let* ((v1-0 arg0)
(a0-4 (the-as object (-> v1-0 base)))
)
(set! (-> (the-as dma-packet a0-4) dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-4) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm #xa))
(set! (-> (the-as dma-packet a0-4) vif1) (new 'static 'vif-tag :cmd (vif-cmd flushe) :msk #x1))
(set! (-> v1-0 base) (&+ (the-as pointer a0-4) 16))
)
(none)
)