;;-*-Lisp-*-
(in-package goal)

;; definition of type tfragment-stats
(deftype tfragment-stats (structure)
  ((num-tris   uint16 4 :offset-assert   0)
   (num-dverts uint16 4 :offset-assert   8)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type tfragment-stats
(defmethod inspect tfragment-stats ((obj tfragment-stats))
  (format #t "[~8x] ~A~%" obj 'tfragment-stats)
  (format #t "~Tnum-tris[4] @ #x~X~%" (-> obj num-tris))
  (format #t "~Tnum-dverts[4] @ #x~X~%" (-> obj num-dverts))
  obj
  )

;; definition of type tfragment-debug-data
(deftype tfragment-debug-data (structure)
  ((stats       tfragment-stats      :inline :offset-assert   0)
   (debug-lines (array vector-array)         :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x14
  :flag-assert         #x900000014
  )

;; definition for method 3 of type tfragment-debug-data
(defmethod inspect tfragment-debug-data ((obj tfragment-debug-data))
  (format #t "[~8x] ~A~%" obj 'tfragment-debug-data)
  (format #t "~Tstats: #<tfragment-stats @ #x~X>~%" (-> obj stats))
  (format #t "~Tdebug-lines: ~A~%" (-> obj debug-lines))
  obj
  )

;; definition of type generic-tfragment
(deftype generic-tfragment (structure)
  ((dummy int32  :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x4
  :flag-assert         #x900000004
  )

;; definition for method 3 of type generic-tfragment
(defmethod inspect generic-tfragment ((obj generic-tfragment))
  (format #t "[~8x] ~A~%" obj 'generic-tfragment)
  (format #t "~Tdummy: ~D~%" (-> obj dummy))
  obj
  )

;; definition of type tfragment
(deftype tfragment (drawable)
  ((color-index       uint16                        :offset          6)
   (debug-data        tfragment-debug-data          :offset          8)
   (color-indices     uint32                        :offset         12)
   (colors            uint32                        :offset         12)
   (dma-chain         uint32                      3 :offset-assert  32)
   (dma-common        uint32                        :offset         32)
   (dma-level-0       uint32                        :offset         32)
   (dma-base          uint32                        :offset         36)
   (dma-level-1       uint32                        :offset         40)
   (dma-qwc           uint8                       4 :offset         44)
   (shader            (inline-array adgif-shader)   :offset         48)
   (num-shaders       uint8                         :offset         52)
   (num-base-colors   uint8                         :offset         53)
   (num-level0-colors uint8                         :offset         54)
   (num-level1-colors uint8                         :offset         55)
   (color-offset      uint8                         :offset         56)
   (color-count       uint8                         :offset         57)
   (pad0              uint8                         :offset         58)
   (pad1              uint8                         :offset         59)
   (generic           generic-tfragment             :offset-assert  60)
   (generic-u32       uint32                        :offset         60)
   )
  :method-count-assert 18
  :size-assert         #x40
  :flag-assert         #x1200000040
  )

;; definition for method 3 of type tfragment
(defmethod inspect tfragment ((obj tfragment))
  (format #t "[~8x] ~A~%" obj (-> obj type))
  (format #t "~Tid: ~D~%" (-> obj id))
  (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere))
  (format #t "~Tcolor-index: ~D~%" (-> obj color-index))
  (format #t "~Tdebug-data: #<tfragment-debug-data @ #x~X>~%" (-> obj debug-data))
  (format #t "~Tcolor-indices: #x~X~%" (-> obj color-indices))
  (format #t "~Tcolors: #x~X~%" (-> obj color-indices))
  (format #t "~Tdma-chain[3] @ #x~X~%" (-> obj dma-chain))
  (format #t "~Tdma-common: #x~X~%" (-> obj dma-common))
  (format #t "~Tdma-level-0: #x~X~%" (-> obj dma-common))
  (format #t "~Tdma-base: #x~X~%" (-> obj dma-base))
  (format #t "~Tdma-level-1: #x~X~%" (-> obj dma-level-1))
  (format #t "~Tdma-qwc[4] @ #x~X~%" (-> obj dma-qwc))
  (format #t "~Tshader: #x~X~%" (-> obj shader))
  (format #t "~Tnum-shaders: ~D~%" (-> obj num-shaders))
  (format #t "~Tnum-base-colors: ~D~%" (-> obj num-base-colors))
  (format #t "~Tnum-level0-colors: ~D~%" (-> obj num-level0-colors))
  (format #t "~Tnum-level1-colors: ~D~%" (-> obj num-level1-colors))
  (format #t "~Tcolor-offset: ~D~%" (-> obj color-offset))
  (format #t "~Tcolor-count: ~D~%" (-> obj color-count))
  (format #t "~Tpad0: ~D~%" (-> obj pad0))
  (format #t "~Tpad1: ~D~%" (-> obj pad1))
  (format #t "~Tgeneric: #<generic-tfragment @ #x~X>~%" (-> obj generic))
  obj
  )

;; definition of type drawable-inline-array-tfrag
(deftype drawable-inline-array-tfrag (drawable-inline-array)
  ((data tfragment 1 :inline :offset-assert  32)
   (pad  uint32              :offset-assert  96)
   )
  :method-count-assert 18
  :size-assert         #x64
  :flag-assert         #x1200000064
  )

;; definition of type drawable-inline-array-trans-tfrag
(deftype drawable-inline-array-trans-tfrag (drawable-inline-array-tfrag)
  ((data2 tfragment 1 :inline :offset-assert 112)
   (pad2  uint32              :offset-assert 176)
   )
  :method-count-assert 18
  :size-assert         #xb4
  :flag-assert         #x12000000b4
  )

;; definition of type drawable-tree-tfrag
(deftype drawable-tree-tfrag (drawable-tree)
  ((time-of-day-pal time-of-day-palette     :offset  12)
   (arrays          drawable-inline-array 1 :offset  32)
   )
  :method-count-assert 18
  :size-assert         #x24
  :flag-assert         #x1200000024
  )

;; definition of type drawable-tree-trans-tfrag
(deftype drawable-tree-trans-tfrag (drawable-tree-tfrag)
  ()
  :method-count-assert 18
  :size-assert         #x24
  :flag-assert         #x1200000024
  )

;; definition of type drawable-tree-dirt-tfrag
(deftype drawable-tree-dirt-tfrag (drawable-tree-tfrag)
  ()
  :method-count-assert 18
  :size-assert         #x24
  :flag-assert         #x1200000024
  )

;; definition of type drawable-tree-ice-tfrag
(deftype drawable-tree-ice-tfrag (drawable-tree-tfrag)
  ()
  :method-count-assert 18
  :size-assert         #x24
  :flag-assert         #x1200000024
  )

;; definition of type drawable-tree-lowres-tfrag
(deftype drawable-tree-lowres-tfrag (drawable-tree-tfrag)
  ()
  :method-count-assert 18
  :size-assert         #x24
  :flag-assert         #x1200000024
  )

;; definition of type drawable-tree-lowres-trans-tfrag
(deftype drawable-tree-lowres-trans-tfrag (drawable-tree-trans-tfrag)
  ()
  :method-count-assert 18
  :size-assert         #x24
  :flag-assert         #x1200000024
  )

;; definition of type tfrag-dists
(deftype tfrag-dists (structure)
  ((data   uint32 16        :offset-assert   0)
   (vector vector 4 :inline :offset          0)
   (k0s    vector 2 :inline :offset          0)
   (k1s    vector 2 :inline :offset         32)
   )
  :method-count-assert 9
  :size-assert         #x40
  :flag-assert         #x900000040
  )

;; definition for method 3 of type tfrag-dists
(defmethod inspect tfrag-dists ((obj tfrag-dists))
  (format #t "[~8x] ~A~%" obj 'tfrag-dists)
  (format #t "~Tdata[16] @ #x~X~%" (-> obj k0s))
  (format #t "~Tvector[4] @ #x~X~%" (-> obj k0s))
  (format #t "~Tk0s[2] @ #x~X~%" (-> obj k0s))
  (format #t "~Tk1s[2] @ #x~X~%" (-> obj k1s))
  obj
  )

;; definition of type tfrag-data
(deftype tfrag-data (structure)
  ((data        uint32      56         :offset   0)
   (vector      vector      14 :inline :offset   0)
   (fog         vector      :inline    :offset   0)
   (val         vector      :inline    :offset  16)
   (strgif      gs-gif-tag  :inline    :offset  32)
   (fangif      gs-gif-tag  :inline    :offset  48)
   (adgif       gs-gif-tag  :inline    :offset  64)
   (hvdf-offset vector      :inline    :offset  80)
   (hmge-scale  vector      :inline    :offset  96)
   (invh-scale  vector      :inline    :offset 112)
   (ambient     vector      :inline    :offset 128)
   (guard       vector      :inline    :offset 144)
   (dists       tfrag-dists :inline    :offset 160)
   (k0s         uint128     2          :offset 160)
   (k1s         uint128     2          :offset 192)
   )
  :method-count-assert 9
  :size-assert         #xe0
  :flag-assert         #x9000000e0
  )

;; definition for method 3 of type tfrag-data
(defmethod inspect tfrag-data ((obj tfrag-data))
  (format #t "[~8x] ~A~%" obj 'tfrag-data)
  (format #t "~Tdata[56] @ #x~X~%" (-> obj fog))
  (format #t "~Tvector[14] @ #x~X~%" (-> obj fog))
  (format #t "~Tfog: #<vector @ #x~X>~%" (-> obj fog))
  (format #t "~Tval: #<vector @ #x~X>~%" (-> obj val))
  (format #t "~Tstrgif: #<qword @ #x~X>~%" (-> obj strgif))
  (format #t "~Tfangif: #<qword @ #x~X>~%" (-> obj fangif))
  (format #t "~Tadgif: #<qword @ #x~X>~%" (-> obj adgif))
  (format #t "~Thvdf-offset: #<vector @ #x~X>~%" (-> obj hvdf-offset))
  (format #t "~Thmge-scale: #<vector @ #x~X>~%" (-> obj hmge-scale))
  (format #t "~Tinvh-scale: #<vector @ #x~X>~%" (-> obj invh-scale))
  (format #t "~Tambient: #<vector @ #x~X>~%" (-> obj ambient))
  (format #t "~Tguard: #<vector @ #x~X>~%" (-> obj guard))
  (format #t "~Tdists: #<tfrag-dists @ #x~X>~%" (-> obj dists))
  (format #t "~Tk0s[2] @ #x~X~%" (-> obj dists))
  (format #t "~Tk1s[2] @ #x~X~%" (-> obj dists k1s))
  obj
  )

;; definition of type tfrag-control
(deftype tfrag-control (structure)
  ((num-base-points           uint32  :offset-assert   0)
   (num-shared-base-points    uint32  :offset-assert   4)
   (num-level0-points         uint32  :offset-assert   8)
   (num-shared-level0-points  uint32  :offset-assert  12)
   (num-level1-points         uint32  :offset-assert  16)
   (num-shared-level1-points  uint32  :offset-assert  20)
   (ptr-vtxdata               uint32  :offset-assert  24)
   (ptr-base-points           uint32  :offset-assert  28)
   (ptr-shared-base-points    uint32  :offset-assert  32)
   (ptr-level0-points         uint32  :offset-assert  36)
   (ptr-shared-level0-points  uint32  :offset-assert  40)
   (ptr-level1-points         uint32  :offset-assert  44)
   (ptr-shared-level1-points  uint32  :offset-assert  48)
   (ptr-draw-points           uint32  :offset-assert  52)
   (ptr-interpolated-0        uint32  :offset-assert  56)
   (ptr-shared-interpolated-0 uint32  :offset-assert  60)
   (ptr-interpolated1         uint32  :offset-assert  64)
   (ptr-shared-interpolated1  uint32  :offset-assert  68)
   (ptr-strip-data            uint32  :offset-assert  72)
   (ptr-texture-data          uint32  :offset-assert  76)
   )
  :method-count-assert 9
  :size-assert         #x50
  :flag-assert         #x900000050
  )

;; definition for method 3 of type tfrag-control
(defmethod inspect tfrag-control ((obj tfrag-control))
  (format #t "[~8x] ~A~%" obj 'tfrag-control)
  (format #t "~Tnum-base-points: ~D~%" (-> obj num-base-points))
  (format #t "~Tnum-shared-base-points: ~D~%" (-> obj num-shared-base-points))
  (format #t "~Tnum-level0-points: ~D~%" (-> obj num-level0-points))
  (format #t "~Tnum-shared-level0-points: ~D~%" (-> obj num-shared-level0-points))
  (format #t "~Tnum-level1-points: ~D~%" (-> obj num-level1-points))
  (format #t "~Tnum-shared-level1-points: ~D~%" (-> obj num-shared-level1-points))
  (format #t "~Tptr-vtxdata: ~D~%" (-> obj ptr-vtxdata))
  (format #t "~Tptr-base-points: ~D~%" (-> obj ptr-base-points))
  (format #t "~Tptr-shared-base-points: ~D~%" (-> obj ptr-shared-base-points))
  (format #t "~Tptr-level0-points: ~D~%" (-> obj ptr-level0-points))
  (format #t "~Tptr-shared-level0-points: ~D~%" (-> obj ptr-shared-level0-points))
  (format #t "~Tptr-level1-points: ~D~%" (-> obj ptr-level1-points))
  (format #t "~Tptr-shared-level1-points: ~D~%" (-> obj ptr-shared-level1-points))
  (format #t "~Tptr-draw-points: ~D~%" (-> obj ptr-draw-points))
  (format #t "~Tptr-interpolated-0: ~D~%" (-> obj ptr-interpolated-0))
  (format #t "~Tptr-shared-interpolated-0: ~D~%" (-> obj ptr-shared-interpolated-0))
  (format #t "~Tptr-interpolated1: ~D~%" (-> obj ptr-interpolated1))
  (format #t "~Tptr-shared-interpolated1: ~D~%" (-> obj ptr-shared-interpolated1))
  (format #t "~Tptr-strip-data: ~D~%" (-> obj ptr-strip-data))
  (format #t "~Tptr-texture-data: ~D~%" (-> obj ptr-texture-data))
  obj
  )

;; definition of type tfrag-stats
(deftype tfrag-stats (structure)
  ((from         int32  :offset-assert   0)
   (to           int32  :offset-assert   4)
   (cnt          int32  :offset-assert   8)
   (tris         int32  :offset-assert  12)
   (tfaces       int32  :offset-assert  16)
   (tfrags       int32  :offset-assert  20)
   (dtris        int32  :offset-assert  24)
   (base-verts   int32  :offset-assert  28)
   (level0-verts int32  :offset-assert  32)
   (level1-verts int32  :offset-assert  36)
   (dma-cnt      int32  :offset-assert  40)
   (dma-dta      int32  :offset-assert  44)
   (dma-tex      int32  :offset-assert  48)
   (strips       int32  :offset-assert  52)
   (drawpoints   int32  :offset-assert  56)
   (vif          int32  :offset-assert  60)
   )
  :method-count-assert 9
  :size-assert         #x40
  :flag-assert         #x900000040
  )

;; definition for method 3 of type tfrag-stats
(defmethod inspect tfrag-stats ((obj tfrag-stats))
  (format #t "[~8x] ~A~%" obj 'tfrag-stats)
  (format #t "~Tfrom: ~D~%" (-> obj from))
  (format #t "~Tto: ~D~%" (-> obj to))
  (format #t "~Tcnt: ~D~%" (-> obj cnt))
  (format #t "~Ttris: ~D~%" (-> obj tris))
  (format #t "~Ttfaces: ~D~%" (-> obj tfaces))
  (format #t "~Ttfrags: ~D~%" (-> obj tfrags))
  (format #t "~Tdtris: ~D~%" (-> obj dtris))
  (format #t "~Tbase-verts: ~D~%" (-> obj base-verts))
  (format #t "~Tlevel0-verts: ~D~%" (-> obj level0-verts))
  (format #t "~Tlevel1-verts: ~D~%" (-> obj level1-verts))
  (format #t "~Tdma-cnt: ~D~%" (-> obj dma-cnt))
  (format #t "~Tdma-dta: ~D~%" (-> obj dma-dta))
  (format #t "~Tdma-tex: ~D~%" (-> obj dma-tex))
  (format #t "~Tstrips: ~D~%" (-> obj strips))
  (format #t "~Tdrawpoints: ~D~%" (-> obj drawpoints))
  (format #t "~Tvif: ~D~%" (-> obj vif))
  obj
  )

;; definition of type tfrag-packet
(deftype tfrag-packet (structure)
  ((tag uint128 2 :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x20
  :flag-assert         #x900000020
  )

;; definition for method 3 of type tfrag-packet
(defmethod inspect tfrag-packet ((obj tfrag-packet))
  (format #t "[~8x] ~A~%" obj 'tfrag-packet)
  (format #t "~Ttag[2] @ #x~X~%" (-> obj tag))
  obj
  )

;; definition of type tfrag-work
(deftype tfrag-work (structure)
  ((base-tmpl             dma-packet :inline :offset-assert   0)
   (level-0-tmpl          dma-packet :inline :offset-assert  16)
   (common-tmpl           dma-packet :inline :offset-assert  32)
   (level-1-tmpl          dma-packet :inline :offset-assert  48)
   (color-tmpl            dma-packet :inline :offset-assert  64)
   (frag-dists            vector     :inline :offset-assert  80)
   (max-dist              vector     :inline :offset-assert  96)
   (min-dist              vector     :inline :offset-assert 112)
   (color-ptr             vector4w   :inline :offset-assert 128)
   (tr-stat-tfrag         tr-stat            :offset-assert 144)
   (tr-stat-tfrag-near    tr-stat            :offset-assert 148)
   (vu1-enable-tfrag      int32              :offset-assert 152)
   (vu1-enable-tfrag-near int32              :offset-assert 156)
   (cur-vis-bits          uint32             :offset-assert 160)
   (end-vis-bits          uint32             :offset-assert 164)
   (src-ptr               uint32             :offset-assert 168)
   (last-call             uint32             :offset-assert 172)
   (dma-buffer            basic              :offset-assert 176)
   (test-id               uint32             :offset-assert 180)
   (wait-from-spr         uint32             :offset-assert 184)
   (wait-to-spr           uint32             :offset-assert 188)
   (near-wait-from-spr    uint32             :offset-assert 192)
   (near-wait-to-spr      uint32             :offset-assert 196)
   )
  :method-count-assert 9
  :size-assert         #xc8
  :flag-assert         #x9000000c8
  )

;; definition for method 3 of type tfrag-work
(defmethod inspect tfrag-work ((obj tfrag-work))
  (format #t "[~8x] ~A~%" obj 'tfrag-work)
  (format #t "~Tbase-tmpl: #<dma-packet @ #x~X>~%" (-> obj base-tmpl))
  (format #t "~Tlevel-0-tmpl: #<dma-packet @ #x~X>~%" (-> obj level-0-tmpl))
  (format #t "~Tcommon-tmpl: #<dma-packet @ #x~X>~%" (-> obj common-tmpl))
  (format #t "~Tlevel-1-tmpl: #<dma-packet @ #x~X>~%" (-> obj level-1-tmpl))
  (format #t "~Tcolor-tmpl: #<dma-packet @ #x~X>~%" (-> obj color-tmpl))
  (format #t "~Tfrag-dists: #<vector @ #x~X>~%" (-> obj frag-dists))
  (format #t "~Tmax-dist: #<vector @ #x~X>~%" (-> obj max-dist))
  (format #t "~Tmin-dist: #<vector @ #x~X>~%" (-> obj min-dist))
  (format #t "~Tcolor-ptr: #<vector4w @ #x~X>~%" (-> obj color-ptr))
  (format #t "~Ttr-stat-tfrag: #<tr-stat @ #x~X>~%" (-> obj tr-stat-tfrag))
  (format #t "~Ttr-stat-tfrag-near: #<tr-stat @ #x~X>~%" (-> obj tr-stat-tfrag-near))
  (format #t "~Tvu1-enable-tfrag: ~D~%" (-> obj vu1-enable-tfrag))
  (format #t "~Tvu1-enable-tfrag-near: ~D~%" (-> obj vu1-enable-tfrag-near))
  (format #t "~Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits))
  (format #t "~Tend-vis-bits: ~D~%" (-> obj end-vis-bits))
  (format #t "~Tsrc-ptr: ~D~%" (-> obj src-ptr))
  (format #t "~Tlast-call: ~D~%" (-> obj last-call))
  (format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer))
  (format #t "~Ttest-id: ~D~%" (-> obj test-id))
  (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 tfrag-dma
(deftype tfrag-dma (structure)
  ((banka  tfragment 16 :inline :offset-assert   0)
   (bankb  tfragment 16 :inline :offset-assert 1024)
   (outa   uint128   128        :offset-assert 2048)
   (outb   uint128   128        :offset-assert 4096)
   (colors rgba      2047       :offset-assert 6144)
   )
  :method-count-assert 9
  :size-assert         #x37fc
  :flag-assert         #x9000037fc
  )

;; definition for method 3 of type tfrag-dma
(defmethod inspect tfrag-dma ((obj tfrag-dma))
  (format #t "[~8x] ~A~%" obj 'tfrag-dma)
  (format #t "~Tbanka[16] @ #x~X~%" (-> obj banka))
  (format #t "~Tbankb[16] @ #x~X~%" (-> obj bankb))
  (format #t "~Touta[128] @ #x~X~%" (-> obj outa))
  (format #t "~Toutb[128] @ #x~X~%" (-> obj outb))
  (format #t "~Tcolors[2048] @ #x~X~%" (-> obj colors))
  obj
  )

;; failed to figure out what this is:
0
