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

;; name: wind-h.gc
;; name in dgo: wind-h
;; dgos: GAME

(declare-type wind-work structure)

(define-extern level-update-wind (function wind-work none))

;; DECOMP BEGINS

(deftype wind-vector (structure)
  ((wind-pos   vector4w  :inline)
   (wind-vel   vector4w  :inline)
   (stiffness  float     :overlay-at (-> wind-vel data 3))
   )
  )


(define *wind-scales* (new 'static 'boxed-array :type uint8
                        #x2
                        #x5
                        #x2
                        #x3
                        #x2
                        #x2
                        #x3
                        #x10
                        #xa
                        #x2
                        #x4
                        #x2
                        #x8
                        #x2
                        #x2
                        #x10
                        #x2
                        #x2
                        #x8
                        #x2
                        #x10
                        #x2
                        #x4
                        #x10
                        #xa
                        #x2
                        #x4
                        #x2
                        #x8
                        #x2
                        #x2
                        #x10
                        )
        )

(deftype wind-work (basic)
  ((wind-array     vector  64 :inline)
   (wind-normal    vector  :inline)
   (wind-temp      vector  :inline)
   (wind-force     float   64)
   (wind-const     vector  :inline)
   (wind-time      uint32)
   (wait-to-vu0    uint32)
   (wait-to-spr    uint32)
   (wait-from-spr  uint32)
   (spr-index      uint32)
   (count          uint32)
   (next-count     uint32)
   (last-count     uint32)
   (to-spr         uint32)
   (from-spr       uint32)
   (next-mem       uint32)
   (last-mem       uint32)
   (next-spr       uint32)
   (last-spr       uint32)
   (to-ptrs        uint32  3)
   )
  )


(deftype wind-dma (structure)
  ((buffer0  wind-vector  128 :inline)
   (buffer1  wind-vector  128 :inline)
   (buffer2  wind-vector  128 :inline)
   )
  )
