Files
jak-project/goal_src/engine/anim/bones-h.gc
T
water111 9c00b0c135 [graphics] generic merc (#1192)
* begin generic merc

* more generic stuff

* generic dma generation not crashing, at least until high-speed-reject

* c

* unpacker for generic

* starting to work

* small fixes

* more fixes

* more progress

* cleanup

* fix tests

* no custom imgui assert on windows
2022-02-24 22:33:10 -05:00

131 lines
3.8 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: bones-h.gc
;; name in dgo: bones-h
;; dgos: GAME, ENGINE
(deftype bone-buffer (structure)
((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0)
(bone bone 16 :inline :offset-assert 1024)
(_pad uint8 2048 :offset-assert 2560)
)
:method-count-assert 9
:size-assert #x1200
:flag-assert #x900001200
)
(deftype bone-layout (structure)
((joint joint 2 :offset-assert 0)
(bone bone 2 :offset-assert 8)
(data uint16 8 :offset 0)
(output uint32 2 :offset-assert 16)
(cache uint32 2 :offset-assert 24)
)
:method-count-assert 9
:size-assert #x20
:flag-assert #x900000020
)
(deftype bone-regs (structure)
((joint-ptr (inline-array joint) :offset-assert 0)
(bone-ptr (inline-array bone) :offset-assert 4)
(num-bones uint32 :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
(deftype bone-work (structure)
((layout bone-layout :inline :offset-assert 0)
(bounds sphere :inline :offset-assert 32)
(lights vu-lights :inline :offset-assert 48)
(distance vector :inline :offset-assert 160)
(next-tag dma-packet :inline :offset-assert 176)
(dma-buf dma-buffer :offset-assert 192)
(sink-group dma-foreground-sink-group :offset-assert 196)
(next-pris dma-packet :offset-assert 200)
(next-merc dma-packet :offset-assert 204)
(wait-count uint32 :offset-assert 208)
(in-count uint32 :offset-assert 212)
(sp-size uint32 :offset-assert 216)
(sp-bufnum uint32 :offset-assert 220)
(regs bone-regs :inline :offset-assert 224)
)
:method-count-assert 9
:size-assert #xec
:flag-assert #x9000000ec
)
(deftype bone-debug (structure)
((time-ctr uint32 :offset-assert 0)
(timing uint32 360 :offset-assert 4)
)
:method-count-assert 9
:size-assert #x5a4
:flag-assert #x9000005a4
)
(deftype bone-memory (structure)
((work bone-work :inline :offset-assert 0)
(buffer bone-buffer 2 :inline :offset-assert 240)
(dma-list dma-packet :inline :offset 240)
)
:method-count-assert 9
:size-assert #x24f0
:flag-assert #x9000024f0
)
(defun invalidate-cache-line ((arg0 pointer))
"Invalidate a single cache line. Won't be used in PC"
(#unless PC_PORT
(.sync.l)
(.cache dxwbin arg0 0)
(.sync.l)
(.cache dxwbin arg0 1)
(.sync.l)
)
0
)
(deftype merc-globals (structure)
((first uint32 :offset-assert 0)
(next (pointer uint32) :offset-assert 4)
(sink generic-dma-foreground-sink :offset-assert 8)
)
:allow-misaligned
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
(deftype merc-global-array (structure)
((count uint32 :offset-assert 0)
(globals merc-globals 8 :inline :offset-assert 4)
)
:method-count-assert 9
:size-assert #x84
:flag-assert #x900000084
)
(define *merc-globals* (the-as merc-globals #f))
(deftype shadow-dma-packet (structure)
((tag generic-merc-tag :inline :offset-assert 0)
(settings shadow-settings :inline :offset-assert 16)
(geo-ref dma-packet :inline :offset-assert 96)
(mtx-ref dma-packet :inline :offset-assert 112)
(end-tag dma-packet :inline :offset-assert 128)
)
:method-count-assert 9
:size-assert #x90
:flag-assert #x900000090
)
(define-extern vu-lights<-light-group! (function vu-lights light-group none))
;; TODO - for mood
(define-extern *default-shadow-settings* shadow-settings)