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

;; definition for symbol tnear-vu1-block, type vu-function
(define tnear-vu1-block (new 'static 'vu-function :length #x388 :qlength #x1c4))

;; definition (debug) for function tfrag-details
;; INFO: Return type mismatch symbol vs none.
(defun-debug tfrag-details ((arg0 tfragment))
  (format 0 "id = ~d~%" (-> arg0 id))
  (format 0 "common:~%")
  (let ((s5-0 (-> arg0 dma-qwc 0))
        (s4-0 (-> arg0 dma-common))
        )
    (format 0 "qwc = ~d, ref = ~x~%" s5-0 s4-0)
    (disasm-vif-tag (the-as (pointer vif-tag) s4-0) (the-as int (* s5-0 4)) (the-as symbol 0) #t)
    )
  (format 0 "base:~%")
  (let ((s5-1 (-> arg0 dma-qwc 1))
        (s4-1 (-> arg0 dma-base))
        )
    (format 0 "qwc = ~d, ref = ~x~%" s5-1 s4-1)
    (disasm-vif-tag (the-as (pointer vif-tag) s4-1) (the-as int (* s5-1 4)) (the-as symbol 0) #t)
    )
  (format 0 "level-0:~%")
  (let ((s5-2 (-> arg0 dma-qwc 3))
        (s4-2 (-> (the-as (pointer uint32) arg0) 10))
        )
    (format 0 "qwc = ~d, ref = ~x~%" s5-2 s4-2)
    (disasm-vif-tag (the-as (pointer vif-tag) s4-2) (the-as int (* s5-2 4)) (the-as symbol 0) #t)
    )
  (format 0 "level-1:~%")
  (let ((s5-3 (-> arg0 dma-qwc 2))
        (gp-1 (-> arg0 dma-level-1))
        )
    (format 0 "qwc = ~d, ref = ~x~%" s5-3 gp-1)
    (disasm-vif-tag (the-as (pointer vif-tag) gp-1) (the-as int (* s5-3 4)) (the-as symbol 0) #t)
    )
  (none)
  )

;; definition (debug) for function clip-restore
;; INFO: Return type mismatch vector vs none.
;; Used lq/sq
(defun-debug clip-restore ()
  (let ((a0-0 (new-stack-vector0))
        (a1-0 (new-stack-matrix0))
        )
    (set! (-> a0-0 x) 92648.22)
    (set! (-> a0-0 y) 238025.03)
    (set! (-> a0-0 z) 199836.31)
    (set! (-> a0-0 w) 1.0)
    (set! (-> a1-0 vector 0 x) -0.9283)
    (set! (-> a1-0 vector 0 y) 0.0)
    (set! (-> a1-0 vector 0 z) 0.3716)
    (set! (-> a1-0 vector 0 w) 0.0)
    (set! (-> a1-0 vector 1 x) -0.2257)
    (set! (-> a1-0 vector 1 y) 0.7945)
    (set! (-> a1-0 vector 1 z) -0.5637)
    (set! (-> a1-0 vector 1 w) 0.0)
    (set! (-> a1-0 vector 2 x) -0.2952)
    (set! (-> a1-0 vector 2 y) -0.6072)
    (set! (-> a1-0 vector 2 z) -0.7375)
    (set! (-> a1-0 vector 2 w) 0.0)
    (set! (-> a1-0 vector 3 x) 0.0)
    (set! (-> a1-0 vector 3 y) 0.0)
    (set! (-> a1-0 vector 3 z) 0.0)
    (set! (-> a1-0 vector 3 w) 1.0)
    (debug-set-camera-pos-rot! a0-0 a1-0)
    )
  (none)
  )
