mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
49 lines
1.1 KiB
Common Lisp
49 lines
1.1 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: matrix-h.gc
|
|
;; name in dgo: matrix-h
|
|
;; dgos: GAME, ENGINE
|
|
|
|
;; matrix-h
|
|
(deftype matrix (structure)
|
|
((data float 16 :offset-assert 0)
|
|
(vector vector 4 :offset 0)
|
|
(quad uint128 4 :offset 0)
|
|
)
|
|
:method-count-assert 10
|
|
:size-assert #x40
|
|
:flag-assert #xa00000040
|
|
(:methods
|
|
(dummy-9 () none 9)
|
|
)
|
|
)
|
|
|
|
(deftype matrix3 (structure)
|
|
((data float 12 :offset-assert 0)
|
|
(vector vector 3 :offset 0)
|
|
(quad uint128 3 :offset 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x30
|
|
:flag-assert #x900000030
|
|
)
|
|
|
|
;; guess on signs here
|
|
(deftype matrix4h (structure)
|
|
((data int16 16 :offset-assert 0)
|
|
(vector4h vector4h 4 :offset 0)
|
|
(long int64 4 :offset 0)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x20
|
|
:flag-assert #x900000020
|
|
)
|
|
|
|
(defun matrix-copy! ((dst matrix) (src matrix))
|
|
"Copy src to dst."
|
|
;; actual implementation is in assembly, unrolled quad copies, loads/stores spaced out.
|
|
(dotimes (i 16 dst)
|
|
(set! (-> dst data i) (-> src data i))
|
|
)
|
|
) |