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

;; definition of type generic-tie-instance
(deftype generic-tie-instance (structure)
  ((matrix-tag  dma-packet :inline   :offset-assert   0)
   (matrix-data vector     6 :inline :offset-assert  16)
   (index-tag   dma-packet :inline   :offset-assert 112)
   (indices     uint8      224       :offset-assert 128)
   (end-tag     dma-packet :inline   :offset-assert 352)
   )
  :method-count-assert 9
  :size-assert         #x170
  :flag-assert         #x900000170
  )

;; definition for method 3 of type generic-tie-instance
(defmethod inspect generic-tie-instance ((obj generic-tie-instance))
  (format #t "[~8x] ~A~%" obj 'generic-tie-instance)
  (format #t "~Tmatrix-tag: #<dma-packet @ #x~X>~%" (-> obj matrix-tag))
  (format #t "~Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data))
  (format #t "~Tindex-tag: #<dma-packet @ #x~X>~%" (-> obj index-tag))
  (format #t "~Tindices[224] @ #x~X~%" (-> obj indices))
  (format #t "~Tend-tag: #<dma-packet @ #x~X>~%" (-> obj end-tag))
  obj
  )

;; definition of type generic-tie-input
(deftype generic-tie-input (structure)
  ((palette-tag dma-packet :inline     :offset-assert   0)
   (palette     rgba       128         :offset-assert  16)
   (model-tag   dma-packet :inline     :offset-assert 528)
   (model       vector     146 :inline :offset-assert 544)
   (matrix-tag  dma-packet :inline     :offset-assert 2880)
   (matrix-data vector     6 :inline   :offset-assert 2896)
   (index-tag   dma-packet :inline     :offset-assert 2992)
   (indices     uint8      224         :offset-assert 3008)
   (end-tag     dma-packet :inline     :offset-assert 3232)
   )
  :method-count-assert 9
  :size-assert         #xcb0
  :flag-assert         #x900000cb0
  )

;; definition for method 3 of type generic-tie-input
(defmethod inspect generic-tie-input ((obj generic-tie-input))
  (format #t "[~8x] ~A~%" obj 'generic-tie-input)
  (format #t "~Tpalette-tag: #<dma-packet @ #x~X>~%" (-> obj palette-tag))
  (format #t "~Tpalette[128] @ #x~X~%" (-> obj palette))
  (format #t "~Tmodel-tag: #<dma-packet @ #x~X>~%" (-> obj model-tag))
  (format #t "~Tmodel[146] @ #x~X~%" (-> obj model))
  (format #t "~Tmatrix-tag: #<dma-packet @ #x~X>~%" (-> obj matrix-tag))
  (format #t "~Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data))
  (format #t "~Tindex-tag: #<dma-packet @ #x~X>~%" (-> obj index-tag))
  (format #t "~Tindices[224] @ #x~X~%" (-> obj indices))
  (format #t "~Tend-tag: #<dma-packet @ #x~X>~%" (-> obj end-tag))
  obj
  )

;; definition of type generic-tie-run-control
(deftype generic-tie-run-control (structure)
  ((skip-bp2    uint8  :offset-assert   0)
   (skip-ips    uint8  :offset-assert   1)
   (gifbuf-skip uint8  :offset-assert   2)
   (strips      uint8  :offset-assert   3)
   (target-bp1  uint8  :offset-assert   4)
   (target-bp2  uint8  :offset-assert   5)
   (target-ip1  uint8  :offset-assert   6)
   (target-ip2  uint8  :offset-assert   7)
   (target-bps  uint8  :offset-assert   8)
   (target-ips  uint8  :offset-assert   9)
   (is-generic  uint8  :offset-assert  10)
   (reserved    uint8  :offset-assert  11)
   )
  :method-count-assert 9
  :size-assert         #xc
  :flag-assert         #x90000000c
  )

;; definition for method 3 of type generic-tie-run-control
(defmethod inspect generic-tie-run-control ((obj generic-tie-run-control))
  (format #t "[~8x] ~A~%" obj 'generic-tie-run-control)
  (format #t "~Tskip-bp2: ~D~%" (-> obj skip-bp2))
  (format #t "~Tskip-ips: ~D~%" (-> obj skip-ips))
  (format #t "~Tgifbuf-skip: ~D~%" (-> obj gifbuf-skip))
  (format #t "~Tstrips: ~D~%" (-> obj strips))
  (format #t "~Ttarget-bp1: ~D~%" (-> obj target-bp1))
  (format #t "~Ttarget-bp2: ~D~%" (-> obj target-bp2))
  (format #t "~Ttarget-ip1: ~D~%" (-> obj target-ip1))
  (format #t "~Ttarget-ip2: ~D~%" (-> obj target-ip2))
  (format #t "~Ttarget-bps: ~D~%" (-> obj target-bps))
  (format #t "~Ttarget-ips: ~D~%" (-> obj target-ips))
  (format #t "~Tis-generic: ~D~%" (-> obj is-generic))
  (format #t "~Treserved: ~D~%" (-> obj reserved))
  obj
  )

;; definition of type generic-tie-base-point
(deftype generic-tie-base-point (structure)
  ((x    int16     :offset-assert   0)
   (y    int16     :offset-assert   2)
   (z    int16     :offset-assert   4)
   (d0   int16     :offset-assert   6)
   (vtx  uint64    :offset          0)
   (u    int16     :offset-assert   8)
   (v    int16     :offset-assert  10)
   (tex  uint32    :offset          8)
   (w    int16     :offset-assert  12)
   (d1   int16     :offset-assert  14)
   (data uint16  8 :offset          0)
   (quad uint128   :offset          0)
   )
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type generic-tie-base-point
;; INFO: Used lq/sq
(defmethod inspect generic-tie-base-point ((obj generic-tie-base-point))
  (format #t "[~8x] ~A~%" obj 'generic-tie-base-point)
  (format #t "~Tdata[8] @ #x~X~%" (&-> obj x))
  (format #t "~Tquad: ~D~%" (-> obj quad))
  (format #t "~Tx: ~D~%" (-> obj x))
  (format #t "~Ty: ~D~%" (-> obj y))
  (format #t "~Tz: ~D~%" (-> obj z))
  (format #t "~Td0: ~D~%" (-> obj d0))
  (format #t "~Tvtx: ~D~%" (-> obj vtx))
  (format #t "~Tu: ~D~%" (-> obj u))
  (format #t "~Tv: ~D~%" (-> obj v))
  (format #t "~Ttex: ~D~%" (-> obj tex))
  (format #t "~Tw: ~D~%" (-> obj w))
  (format #t "~Td1: ~D~%" (-> obj d1))
  obj
  )

;; definition of type generic-tie-bps
(deftype generic-tie-bps (structure)
  ((bp generic-tie-base-point 4 :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x40
  :flag-assert         #x900000040
  )

;; definition for method 3 of type generic-tie-bps
(defmethod inspect generic-tie-bps ((obj generic-tie-bps))
  (format #t "[~8x] ~A~%" obj 'generic-tie-bps)
  (format #t "~Tbp[4] @ #x~X~%" (-> obj bp))
  obj
  )

;; definition of type generic-tie-interp-point
(deftype generic-tie-interp-point (structure)
  ((x      int16     :offset-assert   0)
   (y      int16     :offset-assert   2)
   (z      int16     :offset-assert   4)
   (d0     int16     :offset-assert   6)
   (vtx0   uint64    :offset          0)
   (dx     int16     :offset-assert   8)
   (dy     int16     :offset-assert  10)
   (dz     int16     :offset-assert  12)
   (unused int16     :offset-assert  14)
   (vtx1   uint64    :offset          8)
   (u      int16     :offset-assert  16)
   (v      int16     :offset-assert  18)
   (tex    uint32    :offset         16)
   (w      int16     :offset-assert  20)
   (d1     int16     :offset-assert  22)
   (data   uint16 12 :offset          0)
   )
  :pack-me
  :method-count-assert 9
  :size-assert         #x18
  :flag-assert         #x900000018
  )

;; definition for method 3 of type generic-tie-interp-point
;; INFO: Used lq/sq
(defmethod inspect generic-tie-interp-point ((obj generic-tie-interp-point))
  (format #t "[~8x] ~A~%" obj 'generic-tie-interp-point)
  (format #t "~Tdata[12] @ #x~X~%" (&-> obj x))
  (format #t "~Tquad: ~D~%" (-> (the-as (pointer uint128) obj) 0))
  (format #t "~Tx: ~D~%" (-> obj x))
  (format #t "~Ty: ~D~%" (-> obj y))
  (format #t "~Tz: ~D~%" (-> obj z))
  (format #t "~Td0: ~D~%" (-> obj d0))
  (format #t "~Tvtx0: ~D~%" (-> obj vtx0))
  (format #t "~Tdx: ~D~%" (-> obj dx))
  (format #t "~Tdy: ~D~%" (-> obj dy))
  (format #t "~Tdz: ~D~%" (-> obj dz))
  (format #t "~Tunused: ~D~%" (-> obj unused))
  (format #t "~Tvtx1: ~D~%" (-> obj vtx1))
  (format #t "~Tu: ~D~%" (-> obj u))
  (format #t "~Tv: ~D~%" (-> obj v))
  (format #t "~Ttex: ~D~%" (-> obj tex))
  (format #t "~Tw: ~D~%" (-> obj w))
  (format #t "~Td1: ~D~%" (-> obj d1))
  obj
  )

;; definition of type generic-tie-ips
(deftype generic-tie-ips (structure)
  ((ip generic-tie-interp-point 2 :inline :offset-assert   0)
   )
  :method-count-assert 9
  :size-assert         #x30
  :flag-assert         #x900000030
  )

;; definition for method 3 of type generic-tie-ips
(defmethod inspect generic-tie-ips ((obj generic-tie-ips))
  (format #t "[~8x] ~A~%" obj 'generic-tie-ips)
  (format #t "~Tip[2] @ #x~X~%" (-> obj ip))
  obj
  )

;; definition of type generic-tie-header
(deftype generic-tie-header (structure)
  ((effect              uint8              :offset-assert   0)
   (interp-table-size   uint8              :offset-assert   1)
   (num-bps             uint8              :offset-assert   2)
   (num-ips             uint8              :offset-assert   3)
   (tint-color          uint32             :offset-assert   4)
   (index-table-offset  uint16             :offset-assert   8)
   (kick-table-offset   uint16             :offset-assert  10)
   (normal-table-offset uint16             :offset-assert  12)
   (interp-table-offset uint16             :offset-assert  14)
   (gsf-header          gsf-header :inline :offset-assert  16)
   )
  :method-count-assert 9
  :size-assert         #x20
  :flag-assert         #x900000020
  )

;; definition for method 3 of type generic-tie-header
(defmethod inspect generic-tie-header ((obj generic-tie-header))
  (format #t "[~8x] ~A~%" obj 'generic-tie-header)
  (format #t "~Teffect: ~D~%" (-> obj effect))
  (format #t "~Tinterp-table-size: ~D~%" (-> obj interp-table-size))
  (format #t "~Tnum-bps: ~D~%" (-> obj num-bps))
  (format #t "~Tnum-ips: ~D~%" (-> obj num-ips))
  (format #t "~Ttint-color: ~D~%" (-> obj tint-color))
  (format #t "~Tindex-table-offset: ~D~%" (-> obj index-table-offset))
  (format #t "~Tkick-table-offset: ~D~%" (-> obj kick-table-offset))
  (format #t "~Tnormal-table-offset: ~D~%" (-> obj normal-table-offset))
  (format #t "~Tinterp-table-offset: ~D~%" (-> obj interp-table-offset))
  (format #t "~Tgsf-header: #<gsf-header @ #x~X>~%" (-> obj gsf-header))
  obj
  )

;; definition of type generic-tie-matrix
(deftype generic-tie-matrix (structure)
  ((matrix matrix :inline :offset-assert   0)
   (morph  vector :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 generic-tie-matrix
(defmethod inspect generic-tie-matrix ((obj generic-tie-matrix))
  (format #t "[~8x] ~A~%" obj 'generic-tie-matrix)
  (format #t "~Tmatrix: #<matrix @ #x~X>~%" (-> obj matrix))
  (format #t "~Tmorph: #<vector @ #x~X>~%" (-> obj morph))
  (format #t "~Tfog: #<qword @ #x~X>~%" (-> obj fog))
  obj
  )

;; definition of type generic-tie-normal
(deftype generic-tie-normal (structure)
  ((x     int8  :offset-assert   0)
   (y     int8  :offset-assert   1)
   (z     int8  :offset-assert   2)
   (dummy int8  :offset-assert   3)
   )
  :method-count-assert 9
  :size-assert         #x4
  :flag-assert         #x900000004
  )

;; definition for method 3 of type generic-tie-normal
(defmethod inspect generic-tie-normal ((obj generic-tie-normal))
  (format #t "[~8x] ~A~%" obj 'generic-tie-normal)
  (format #t "~Tx: ~D~%" (-> obj x))
  (format #t "~Ty: ~D~%" (-> obj y))
  (format #t "~Tz: ~D~%" (-> obj z))
  (format #t "~Tdummy: ~D~%" (-> obj dummy))
  obj
  )

;; definition of type generic-tie-control
(deftype generic-tie-control (structure)
  ((ptr-palette   uint32                   :offset-assert   0)
   (ptr-shaders   uint32                   :offset-assert   4)
   (ptr-runctrl   generic-tie-run-control  :offset-assert   8)
   (ptr-verts     uint32                   :offset-assert  12)
   (ptr-generic   generic-tie-header       :offset-assert  16)
   (ptr-dps       uint32                   :offset-assert  20)
   (ptr-kicks     uint32                   :offset-assert  24)
   (ptr-normals   uint32                   :offset-assert  28)
   (ptr-interp    uint32                   :offset-assert  32)
   (ptr-mtxs      generic-tie-matrix       :offset-assert  36)
   (ptr-cinds     uint32                   :offset-assert  40)
   (next-instance uint32                   :offset-assert  44)
   (next-model    uint32                   :offset-assert  48)
   (next-is-model uint32                   :offset-assert  52)
   (tie-type      uint32                   :offset-assert  56)
   )
  :method-count-assert 9
  :size-assert         #x3c
  :flag-assert         #x90000003c
  )

;; definition for method 3 of type generic-tie-control
(defmethod inspect generic-tie-control ((obj generic-tie-control))
  (format #t "[~8x] ~A~%" obj 'generic-tie-control)
  (format #t "~Tptr-palette: #x~X~%" (-> obj ptr-palette))
  (format #t "~Tptr-shaders: #x~X~%" (-> obj ptr-shaders))
  (format #t "~Tptr-runctrl: #<generic-tie-run-control @ #x~X>~%" (-> obj ptr-runctrl))
  (format #t "~Tptr-verts: #x~X~%" (-> obj ptr-verts))
  (format #t "~Tptr-generic: #<generic-tie-header @ #x~X>~%" (-> obj ptr-generic))
  (format #t "~Tptr-dps: #x~X~%" (-> obj ptr-dps))
  (format #t "~Tptr-kicks: #x~X~%" (-> obj ptr-kicks))
  (format #t "~Tptr-normals: #x~X~%" (-> obj ptr-normals))
  (format #t "~Tptr-interp: #x~X~%" (-> obj ptr-interp))
  (format #t "~Tptr-mtxs: #<generic-tie-matrix @ #x~X>~%" (-> obj ptr-mtxs))
  (format #t "~Tptr-cinds: #x~X~%" (-> obj ptr-cinds))
  (format #t "~Tnext-instance: #x~X~%" (-> obj next-instance))
  (format #t "~Tnext-model: #x~X~%" (-> obj next-model))
  (format #t "~Tnext-is-model: ~D~%" (-> obj next-is-model))
  (format #t "~Ttie-type: ~D~%" (-> obj tie-type))
  obj
  )

;; definition of type generic-tie-stats
(deftype generic-tie-stats (structure)
  ((num-bps       uint32  :offset-assert   0)
   (num-ips       uint32  :offset-assert   4)
   (num-dps       uint32  :offset-assert   8)
   (num-shaders   uint32  :offset-assert  12)
   (num-models    uint32  :offset-assert  16)
   (num-instances uint32  :offset-assert  20)
   (num-waits     uint32  :offset-assert  24)
   (num-qwc       uint32  :offset-assert  28)
   (max-qwc       uint32  :offset-assert  32)
   )
  :method-count-assert 9
  :size-assert         #x24
  :flag-assert         #x900000024
  )

;; definition for method 3 of type generic-tie-stats
(defmethod inspect generic-tie-stats ((obj generic-tie-stats))
  (format #t "[~8x] ~A~%" obj 'generic-tie-stats)
  (format #t "~Tnum-bps: ~D~%" (-> obj num-bps))
  (format #t "~Tnum-ips: ~D~%" (-> obj num-ips))
  (format #t "~Tnum-dps: ~D~%" (-> obj num-dps))
  (format #t "~Tnum-shaders: ~D~%" (-> obj num-shaders))
  (format #t "~Tnum-models: ~D~%" (-> obj num-models))
  (format #t "~Tnum-instances: ~D~%" (-> obj num-instances))
  (format #t "~Tnum-waits: ~D~%" (-> obj num-waits))
  (format #t "~Tnum-qwc: ~D~%" (-> obj num-qwc))
  (format #t "~Tmax-qwc: ~D~%" (-> obj max-qwc))
  obj
  )

;; definition of type generic-tie-calls
(deftype generic-tie-calls (structure)
  ((generic-prepare-dma-double basic  :offset-assert   0)
   (generic-envmap-dproc       basic  :offset-assert   4)
   (generic-interp-dproc       basic  :offset-assert   8)
   (generic-no-light-dproc     basic  :offset-assert  12)
   )
  :pack-me
  :method-count-assert 9
  :size-assert         #x10
  :flag-assert         #x900000010
  )

;; definition for method 3 of type generic-tie-calls
(defmethod inspect generic-tie-calls ((obj generic-tie-calls))
  (format #t "[~8x] ~A~%" obj 'generic-tie-calls)
  (format #t "~Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double))
  (format #t "~Tgeneric-envmap-dproc: ~A~%" (-> obj generic-envmap-dproc))
  (format #t "~Tgeneric-interp-dproc: ~A~%" (-> obj generic-interp-dproc))
  (format #t "~Tgeneric-no-light-dproc: ~A~%" (-> obj generic-no-light-dproc))
  obj
  )

;; definition of type generic-tie-shadow
(deftype generic-tie-shadow (structure)
  ((out-buf      gsf-buffer                :offset-assert   0)
   (cur-buf      uint32                    :offset-assert   4)
   (tie-type     int32                     :offset-assert   8)
   (ptr-inst     uint32                    :offset-assert  12)
   (ptr-buf      uint32                    :offset-assert  16)
   (inst-xor     int32                     :offset-assert  20)
   (end-of-chain uint32                    :offset-assert  24)
   (write-limit  uint32                    :offset-assert  28)
   (calls        generic-tie-calls :inline :offset-assert  32)
   )
  :pack-me
  :method-count-assert 9
  :size-assert         #x30
  :flag-assert         #x900000030
  )

;; definition for method 3 of type generic-tie-shadow
(defmethod inspect generic-tie-shadow ((obj generic-tie-shadow))
  (format #t "[~8x] ~A~%" obj 'generic-tie-shadow)
  (format #t "~Tout-buf: #<gsf-buffer @ #x~X>~%" (-> obj out-buf))
  (format #t "~Tcur-buf: #x~X~%" (-> obj cur-buf))
  (format #t "~Ttie-type: ~D~%" (-> obj tie-type))
  (format #t "~Tptr-inst: #x~X~%" (-> obj ptr-inst))
  (format #t "~Tptr-buf: #x~X~%" (-> obj ptr-buf))
  (format #t "~Tinst-xor: ~D~%" (-> obj inst-xor))
  (format #t "~Tend-of-chain: ~D~%" (-> obj end-of-chain))
  (format #t "~Twrite-limit: ~D~%" (-> obj write-limit))
  (format #t "~Tcalls: #<generic-tie-calls @ #x~X>~%" (-> obj calls))
  obj
  )

;; definition of type generic-tie-work
(deftype generic-tie-work (structure)
  ((control     generic-tie-control  :inline :offset-assert   0)
   (interp-job  generic-interp-job   :inline :offset-assert  60)
   (shadow      generic-tie-shadow   :inline :offset-assert  76)
   (input-a     generic-tie-input    :inline :offset-assert 128)
   (input-b     generic-tie-input    :inline :offset-assert 3376)
   (inst-buf    generic-tie-instance :inline :offset-assert 6624)
   (palette-buf rgba                 128     :offset-assert 6992)
   )
  :method-count-assert 9
  :size-assert         #x1d50
  :flag-assert         #x900001d50
  )

;; definition for method 3 of type generic-tie-work
(defmethod inspect generic-tie-work ((obj generic-tie-work))
  (format #t "[~8x] ~A~%" obj 'generic-tie-work)
  (format #t "~Tcontrol: #<generic-tie-control @ #x~X>~%" (-> obj control))
  (format #t "~Tinterp-job: #<generic-interp-job @ #x~X>~%" (-> obj interp-job))
  (format #t "~Tshadow: #<generic-tie-shadow @ #x~X>~%" (-> obj shadow))
  (format #t "~Tinput-a: #<generic-tie-input @ #x~X>~%" (-> obj input-a))
  (format #t "~Tinput-b: #<generic-tie-input @ #x~X>~%" (-> obj input-b))
  (format #t "~Tinst-buf: #<generic-tie-instance @ #x~X>~%" (-> obj inst-buf))
  (format #t "~Tpalette-buf[128] @ #x~X~%" (-> obj palette-buf))
  obj
  )

;; failed to figure out what this is:
0
