jak-project/goal_src/engine/anim/bones-h.gc
Tyler Wilding d400ec3b2d
decomp: mood (#672)
* decomp: Almost finished `mood`, but confused over the `mood-context` type!

* only function that remains involves vftoi / ppach instructions

* stash

* decomp: fix inline array access issue

* decomp: finalize `mood`

* linting
2021-08-01 16:11:22 -04:00

131 lines
3.7 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 (pointer joint) :offset-assert 0)
(bone-ptr (pointer 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 basic :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 uint32 :offset-assert 4)
(sink basic :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* #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)