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

;; definition of type generic-input-buffer
(deftype generic-input-buffer (structure)
  ((merc generic-merc-work :inline :offset   0)
   (tie  generic-tie-work  :inline :offset   0)
   (data uint128           472     :offset   0)
   )
  :method-count-assert 9
  :size-assert         #x1d80
  :flag-assert         #x900001d80
  )

;; definition for method 3 of type generic-input-buffer
(defmethod inspect generic-input-buffer ((obj generic-input-buffer))
  (format #t "[~8x] ~A~%" obj 'generic-input-buffer)
  (format #t "~Tdata[472] @ #x~X~%" (-> obj merc))
  (format #t "~Tmerc: #<generic-merc-work @ #x~X>~%" (-> obj merc))
  (format #t "~Ttie: #<generic-tie-work @ #x~X>~%" (-> obj merc))
  obj
  )

;; definition of type generic-debug
(deftype generic-debug (structure)
  ((locks      uint32 4  :offset-assert   0)
   (timer      uint32 32 :offset-assert  16)
   (count      uint32 32 :offset-assert 144)
   (vps        uint32 32 :offset-assert 272)
   (buffer     int32     :offset-assert 400)
   (start-addr int32     :offset-assert 404)
   (lock       int32     :offset-assert 408)
   )
  :method-count-assert 9
  :size-assert         #x19c
  :flag-assert         #x90000019c
  )

;; definition for method 3 of type generic-debug
(defmethod inspect generic-debug ((obj generic-debug))
  (format #t "[~8x] ~A~%" obj 'generic-debug)
  (format #t "~Tlocks[4] @ #x~X~%" (-> obj locks))
  (format #t "~Ttimer[32] @ #x~X~%" (-> obj timer))
  (format #t "~Tcount[32] @ #x~X~%" (-> obj count))
  (format #t "~Tvps[32] @ #x~X~%" (-> obj vps))
  (format #t "~Tbuffer: ~D~%" (-> obj buffer))
  (format #t "~Tstart-addr: ~D~%" (-> obj start-addr))
  (format #t "~Tlock: ~D~%" (-> obj lock))
  obj
  )

;; definition of type generic-vu1-header
(deftype generic-vu1-header (structure)
  ((matrix  matrix          :inline   :offset-assert   0)
   (strgif  generic-gif-tag :inline   :offset-assert  64)
   (adnop1  ad-cmd          :inline   :offset-assert  80)
   (adnop2  ad-cmd          :inline   :offset-assert  96)
   (adcmds  ad-cmd          2 :inline :offset         80)
   (dps     uint16                    :offset         92)
   (kickoff uint16                    :offset        108)
   (strips  uint16                    :offset         76)
   )
  :method-count-assert 9
  :size-assert         #x70
  :flag-assert         #x900000070
  )

;; definition for method 3 of type generic-vu1-header
(defmethod inspect generic-vu1-header ((obj generic-vu1-header))
  (format #t "[~8x] ~A~%" obj 'generic-vu1-header)
  (format #t "~Tmatrix: #<matrix @ #x~X>~%" (-> obj matrix))
  (format #t "~Tstrgif: #<generic-gif-tag @ #x~X>~%" (-> obj strgif))
  (format #t "~Tadcmds[2] @ #x~X~%" (-> obj adnop1))
  (format #t "~Tadnop1: #<ad-cmd @ #x~X>~%" (-> obj adnop1))
  (format #t "~Tadnop2: #<ad-cmd @ #x~X>~%" (-> obj adnop2))
  (format #t "~Tdps: ~D~%" (-> obj dps))
  (format #t "~Tkickoff: ~D~%" (-> obj kickoff))
  (format #t "~Tstrips: ~D~%" (-> obj strips))
  obj
  )

;; definition of type generic-vu1-texbuf
(deftype generic-vu1-texbuf (structure)
  ((header generic-vu1-header :inline  :offset-assert   0)
   (shader uint32             :dynamic :offset-assert 112)
   )
  :method-count-assert 9
  :size-assert         #x70
  :flag-assert         #x900000070
  )

;; definition for method 3 of type generic-vu1-texbuf
(defmethod inspect generic-vu1-texbuf ((obj generic-vu1-texbuf))
  (format #t "[~8x] ~A~%" obj 'generic-vu1-texbuf)
  (format #t "~Theader: #<generic-vu1-header @ #x~X>~%" (-> obj header))
  (format #t "~Tshader[0] @ #x~X~%" (-> obj shader))
  obj
  )

;; definition of type generic-texbuf
(deftype generic-texbuf (structure)
  ((tag    dma-packet         :inline  :offset-assert   0)
   (header generic-vu1-header :inline  :offset-assert  16)
   (shader uint32             :dynamic :offset-assert 128)
   )
  :method-count-assert 9
  :size-assert         #x80
  :flag-assert         #x900000080
  )

;; definition for method 3 of type generic-texbuf
(defmethod inspect generic-texbuf ((obj generic-texbuf))
  (format #t "[~8x] ~A~%" obj 'generic-texbuf)
  (format #t "~Ttag: #<dma-packet @ #x~X>~%" (-> obj tag))
  (format #t "~Theader: #<generic-vu1-header @ #x~X>~%" (-> obj header))
  (format #t "~Tshader[0] @ #x~X~%" (-> obj shader))
  obj
  )

;; definition of type generic-effect-work
(deftype generic-effect-work (structure)
  ((consts   generic-consts  :inline :offset-assert   0)
   (storage  generic-storage :inline :offset-assert 432)
   (storage2 generic-storage :inline :offset-assert 688)
   (lights   vu-lights       :inline :offset-assert 944)
   )
  :method-count-assert 9
  :size-assert         #x420
  :flag-assert         #x900000420
  )

;; definition for method 3 of type generic-effect-work
(defmethod inspect generic-effect-work ((obj generic-effect-work))
  (format #t "[~8x] ~A~%" obj 'generic-effect-work)
  (format #t "~Tconsts: #<generic-consts @ #x~X>~%" (-> obj consts))
  (format #t "~Tstorage: #<generic-storage @ #x~X>~%" (-> obj storage))
  (format #t "~Tstorage2: #<generic-storage @ #x~X>~%" (-> obj storage2))
  (format #t "~Tlights: #<vu-lights @ #x~X>~%" (-> obj lights))
  obj
  )

;; definition of type generic-effect-buffer
(deftype generic-effect-buffer (structure)
  ((outbuf-0 uint8               3552    :offset-assert   0)
   (work     generic-effect-work :inline :offset-assert 3552)
   (outbuf-1 uint8               3552    :offset-assert 4608)
   )
  :method-count-assert 9
  :size-assert         #x1fe0
  :flag-assert         #x900001fe0
  )

;; definition for method 3 of type generic-effect-buffer
(defmethod inspect generic-effect-buffer ((obj generic-effect-buffer))
  (format #t "[~8x] ~A~%" obj 'generic-effect-buffer)
  (format #t "~Toutbuf-0[3552] @ #x~X~%" (-> obj outbuf-0))
  (format #t "~Twork: #<generic-effect-work @ #x~X>~%" (-> obj work))
  (format #t "~Toutbuf-1[3552] @ #x~X~%" (-> obj outbuf-1))
  obj
  )

;; definition of type generic-work
(deftype generic-work (structure)
  ((saves   generic-saves         :inline :offset-assert   0)
   (storage generic-storage       :inline :offset-assert 368)
   (in-buf  generic-input-buffer  :inline :offset-assert 624)
   (fx-buf  generic-effect-buffer :inline :offset-assert 8176)
   )
  :method-count-assert 9
  :size-assert         #x3fd0
  :flag-assert         #x900003fd0
  )

;; definition for method 3 of type generic-work
(defmethod inspect generic-work ((obj generic-work))
  (format #t "[~8x] ~A~%" obj 'generic-work)
  (format #t "~Tsaves: #<generic-saves @ #x~X>~%" (-> obj saves))
  (format #t "~Tstorage: #<generic-storage @ #x~X>~%" (-> obj storage))
  (format #t "~Tin-buf: #<generic-input-buffer @ #x~X>~%" (-> obj in-buf))
  (format #t "~Tfx-buf: #<generic-effect-buffer @ #x~X>~%" (-> obj fx-buf))
  obj
  )

;; definition for symbol *generic-debug*, type generic-debug
(define *generic-debug* (new 'global 'generic-debug))

;; failed to figure out what this is:
0
