Skip to main content

bones-h

source

Types


bone-buffer

bone-buffer: structuresource
Fields
joint: matrix
bone: bone
output: pris-mtx

bone-calculation

bone-calculation: structuresource
Fields
flags: bone-calc-flags
num-bones: uint16
matrix-area: inline-array
joints: inline-array
bones: inline-array
ripple-scale: float
ripple-y-scale: float
ripple-normal-scale: float
ripple-area: inline-array
ripple-vec: vector
next: bone-calculation
dummy-1: uint32
dummy-2: uint32
dummy-3: uint32

bone-debug

bone-debug: structuresource
Fields
time-ctr: uint32
timing: uint32

bone-layout

bone-layout: structuresource
Fields
data: uint16
joint: inline-array
bone: inline-array
output: inline-array
unused: uint32

bone-memory

bone-memory: structuresource
Fields
work: bone-work
buffer: bone-buffer

bone-regs

bone-regs: structuresource
Fields
dma-buf: basic
wait-count: uint32
in-count: uint32
sp-size: uint32
sp-bufnum: uint32
joint-ptr: inline-array
bone-ptr: inline-array
num-bones: uint32
mtxs: inline-array

bone-work

bone-work: structuresource
Fields
layout: bone-layout
regs: bone-regs
Expand description

bones, joints, cspace, matrix, joint-anim-frames...



The "joints" define the structure of the skeleton, just storing a bind pose, and parent info. These don't change,

and are loaded as part of the skeleton. The actual joint objects are stored in the art-joint-geo.



The "do-joint-math" method of process-drawable is responsible for computing the joint-anim-frame and the bones.

The "cspace" system is used to compute bones from joint-anim-frames.

The "joint-anim-frame" is a list of transformqs for the relative transform between bones.

The "bones" are the world space transform of each 'bone'



The "do-joint-math" function does:

- call the generate-frame-function callback to generate a joint-anim-frame (does the joint anim decompress/blending)

- call the prebind-function which can modify the relative transforms (eg: joint-mods)

- walk the tree of joints, computing bones using the cspace

- call the postbind-function, for other effects.



The "bones" system creates matrices for foreground renderers from bones/joints.

The inputs are bones/joints, and the output is pris-mtx, which is a 4x4 "t-mtx" for transforming, and a 3x3 (stored in 3 vec4's)

n-mtx for rotating normals.



all matrices are calculated at once, and shared between merc/emerc/gmerc/shadow

this is done by a linked list of "bone calculations", which is stashed in the dma buffer.

Types


bone-calculation-list

bone-calculation-list: structuresource

Functions


bone-list-init

bone-list-init() => nonesource

Reset bone calculation list to have nothing in it.

bones-debug

bones-debug() => nonesource

bones-init

bones-init(arg0: dma-buffer) => nonesource

Initialize scratchpad/vu0 for BONE MATH.

bones-mtx-calc-execute

bones-mtx-calc-execute() => nonesource

Execute all bone matrix calculations.

bones-reset-sqwc

bones-reset-sqwc() => nonesource

Reset sqwc so DMA works normally again (see bones-set-sqwc)

bones-set-sqwc

bones-set-sqwc() => nonesource

Set the sqwc register so the DMA transfer of joints skips the metadata and just transfers the bind-pose.

dump-bone-mem

dump-bone-mem() => nonesource

dump-mem

dump-mem(arg0: pointer, arg1: int) => nonesource

dump-qword

dump-qword(arg0: qword) => nonesource

Variables


*bone-calculation-list*

*bone-calculation-list*: bone-calculation-listsource

bones-vu0-block

const bones-vu0-block: vu-functionsource

Types


eye

eye: structuresource
Fields
data: vector
x: float
y: float
lid: float
iris-scale: float
pupil-scale: float
lid-scale: float

eye-control

eye-control: structuresource
Fields
process: handle
draw-flag: symbol
different-eyes: symbol
random-time: uint16
bucket: uint16
blink: float
shaders: inline-array
left: eye
right: eye

eye-control-array

eye-control-array: basicsource
Fields
type: type
data: eye-control

eye-control-arrays

eye-control-arrays: basicsource
Fields
type: type
data: eye-control-array
pad: uint32

eye-work

eye-work: structuresource
Fields
sprite-tmpl: dma-gif-packet
sprite-tmpl2: dma-gif-packet
adgif-tmpl: dma-gif-packet
blink-table: float

Variables


*eye-control-arrays*

*eye-control-arrays*: eye-control-arrayssource

Functions


convert-eye-data

convert-eye-data(arg0: eye, arg1: uint) => floatsource

get-eye-block

get-eye-block(arg0: int, arg1: int) => intsource

merc-eye-anim

merc-eye-anim(arg0: process-drawable) => nonesource

render-eyes-32

render-eyes-32(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource

render-eyes-32-different

render-eyes-32-different(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource

render-eyes-64

render-eyes-64(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource

render-eyes-64-different

render-eyes-64-different(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource

set-eye-draw-flag

set-eye-draw-flag(arg0: symbol, arg1: int, arg2: int) => nonesource

update-eyes

update-eyes() => nonesource

Variables


*eye-work*

*eye-work*: eye-worksource

foreground-h

source

Types


foreground-bucket

foreground-bucket: structuresource
Fields
merc: merc-chain
emerc: merc-chain
mercneric: mercneric-chain

foreground-bucket-grid

foreground-bucket-grid: structuresource
Fields
level-buckets: foreground-level-buckets
warp-chain: mercneric-chain

foreground-globals

foreground-globals: structuresource
Fields
foreground-grid: foreground-bucket-grid
merc-bucket-info: merc-bucket-info
texscroll: texscroll-globals

foreground-level-buckets

foreground-level-buckets: structuresource

foreground-regs

foreground-regs: structuresource
Fields
dist: float
merc-used: uint32
emerc-used: uint32
mercneric-used: uint32
use-isometric: uint32
base-start: dma-packet
joint-ptr: inline-array
bone-ptr: inline-array
num-bones: uint32
mtxs: inline-array
dma-buf: dma-buffer
default-texture-index: uint32
mercneric-chain: mercneric-chain
level-buckets: foreground-level-buckets

foreground-work

foreground-work: structuresource
Fields
regs: foreground-regs
draw-index-map: uint8
grid: foreground-bucket-grid
bounds: sphere
lights: vu-lights
distance: vector
next-tmpl: dma-packet

merc-bucket-info

merc-bucket-info: structuresource
Fields
light: vu-lights
needs-clip: int32
need-mercprime-if-merc: int32
must-use-mercneric-for-clip: int32
effect: merc-effect-bucket-info

merc-chain

merc-chain: structuresource
Fields
first: dma-packet
patch: dma-packet
vu1-bucket: bucket-id

merc-effect-bucket-info

merc-effect-bucket-info: structuresource
Fields
color-fade: rgba
alpha: uint8
merc-path: uint8
ignore-alpha: uint8
disable-draw: uint8
disable-envmap: uint8

mercneric-chain

mercneric-chain: structuresource
Fields
first: uint32
next: uint32
state: generic-bucket-state
vu1-bucket: bucket-id

shadow-dma-packet

shadow-dma-packet: structuresource
Fields
tag: generic-merc-tag
settings: shadow-settings
geo-ref: dma-packet
mtx-ref: dma-packet
end-tag: dma-packet

texscroll-globals

texscroll-globals: structuresource
Fields
requests: int32
effects: merc-effect

Functions


invalidate-cache-line

invalidate-cache-line(arg0: pointer) => intsource

Variables


*foreground*

*foreground*: foreground-globalssource

foreground

source

Types


pc-merc-flags

pc-merc-flags: structuresource
Fields
enable-mask: uint64
ignore-alpha-mask: uint64
effect-count: uint8
bit-flags: pc-merc-bits

Functions


foreground-add-mtx-calc

foreground-add-mtx-calc(arg0: bone-calculation, arg1: inline-array, arg2: bone-calc-flags) => bone-calculationsource

foreground-draw

foreground-draw(dc: draw-control, dma-buf: dma-buffer, dist-in: float) => nonesource

foreground-emerc

foreground-emerc(arg0: draw-control, arg1: inline-array, arg2: pointer, arg3: object, arg4: int, arg5: int) => pointersource

foreground-generic-merc-add-fragments

foreground-generic-merc-add-fragments(arg0: merc-effect, arg1: pointer, arg2: mercneric-chain) => pointersource

Add fragments from a merc-effect to the generic chain.

foreground-generic-merc-death

foreground-generic-merc-death(arg0: draw-control, arg1: generic-merc-ctrl) => nonesource

Modify a generic-merc-ctrl to set up merc-death effect.

foreground-init

foreground-init() => nonesource

foreground-ripple

foreground-ripple(arg0: draw-control, arg1: merc-ctrl, arg2: pointer, arg3: int) => pointersource

foreground-shadow

foreground-shadow(draw-ctrl: draw-control, arg1: inline-array, arg2: pointer) => pointersource

foreground-wrapup

foreground-wrapup() => nonesource

generic-bucket-state-init

generic-bucket-state-init(arg0: generic-bucket-state) => nonesource

Generic buckets double buffer across models and store their state in generic-bucket-state.
Reset a state for the first transfer

mercneric-chain-init

mercneric-chain-init(arg0: mercneric-chain, arg1: bucket-id) => nonesource

Initialize a mercneric chain. (generic chain specific to merc)

pc-draw-bones

pc-draw-bones(dc: draw-control, dma-buf: pointer, matrix-buf: pointer) => pointersource

Add a dma packet to tell the PC renderer which model we are renderering.

pc-merc-draw-request

pc-merc-draw-request(dc: draw-control, dma-buf: pointer, matrix-buf: pointer, tex-idx: int, update-verts: symbol) => pointersource

Send a request to PC Merc2 to draw the given object.
Only draws the effects which match this texture index.
Just places a single big dma packet, you have to patch the end yourself.

texscroll-execute

texscroll-execute() => nonesource

texscroll-make-request

texscroll-make-request(arg0: merc-effect) => nonesource

vu-lights<-light-group!

vu-lights<-light-group!(arg0: vu-lights, arg1: light-group) => nonesource

vu1-bucket-map

vu1-bucket-map(arg0: int, arg1: int, arg2: merc-mode) => bucket-idsource

level, tex, mode -> bucket.

Variables


*bucket-map*

*bucket-map*: pointersource

*default-shadow-settings*

*default-shadow-settings*: shadow-settingssource

foreground-vu0-block

const foreground-vu0-block: vu-functionsource

ripple

source

Types


ripple-globals

ripple-globals: structuresource
Fields
count: int32
requests: ripple-request

ripple-request

ripple-request: structuresource
Fields
waveform: ripple-wave
effect: merc-effect

Functions


ripple-add-debug-sphere

ripple-add-debug-sphere(arg0: process-drawable, arg1: vector, arg2: float, arg3: float) => nonesource

ripple-execute

ripple-execute() => nonesource

Iterate through ripple-globals requests, from the end to index 0
For each request, if it has a waveform create the wave-table via ripple-create-wave-table
Then for each waveform apply the effect using ripple-apply-wave-table

Once completed, all requests have been processed and the count is reset to 0

ripple-find-height

ripple-find-height(arg0: process-drawable, arg1: int, arg2: vector) => floatsource

ripple-make-request

ripple-make-request(waveform: ripple-wave, effect: merc-effect) => nonesource

Iterate through ripple-globals requests looking for the one that matches the provided effect
If NOT found, append a new ripple-request with the providded effect and waveform to the end of the requests.

NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!

ripple-slow-add-sine-waves

ripple-slow-add-sine-waves(arg0: ripple-wave-set, arg1: float, arg2: float) => floatsource

ripple-update-waveform-offs

ripple-update-waveform-offs(arg0: ripple-wave-set, arg1: clock) => nonesource

Variables


*ripple-globals*

*ripple-globals*: ripple-globalssource

A collection of ripple-request (max of 16)

shadow-cpu-h

source

Types


shadow-bucket

shadow-bucket: structuresource
Fields
first: pointer
next: pointer
bucket-id: int32
shadow-color: rgba
constants: shadow-vu1-constants

shadow-control

shadow-control: basicsource
Fields
type: type
settings: shadow-settings
Methods
clear-offset-bit(obj: shadow-control) => intsource
set-offset-bit(obj: shadow-control) => intsource
set-top-plane-offset(obj: shadow-control, arg0: float) => intsource
set-bottom-plane-offset(obj: shadow-control, arg0: float) => intsource
shadow-control-method-13(obj: shadow-control, arg0: vector, arg1: float, arg2: float, arg3: float) => nonesource
shadow-control-method-14(obj: shadow-control, arg0: vector, arg1: vector, arg2: float, arg3: float, arg4: float) => nonesource

shadow-data

shadow-data: structuresource
Fields
dma-unpack-template: dma-packet
dma-cnt: dma-tag
vif-nop: vif-tag
vif-unpack-v4-8: vif-tag
pdc: basic
dist: float
waits: uint32
inside-volume?: uint32

shadow-edge

shadow-edge: structuresource
Fields
ind-0: uint8
ind-1: uint8
tri-0: uint8
tri-1: uint8

shadow-frag-header

shadow-frag-header: structuresource
Fields
qwc-data: uint32
num-joints: uint32
num-verts: uint16
num-twos: uint16
num-single-tris: uint16
num-single-edges: uint16
num-double-tris: uint16
num-double-edges: uint16
ofs-verts: uint32
ofs-refs: uint32
ofs-single-tris: uint32
ofs-single-edges: uint32
ofs-double-tris: uint32
ofs-double-edges: uint32

shadow-frag-ref

shadow-frag-ref: structuresource
Fields
header: shadow-frag-header
qwc: uint32

shadow-geo

shadow-geo: art-elementsource
Fields
type: type
name: string
length: int32
extra: res-lump
pad: uint8
version: uint32
total-qwc: uint32
num-joints: uint32
num-fragments: uint32
frags: shadow-frag-ref

shadow-geo-old

shadow-geo-old: art-elementsource
Fields
type: type
name: string
length: int32
extra: res-lump
pad: uint8
version: uint32
header: shadow-frag-header
total-qwc: uint32
rest: uint64

shadow-globals

shadow-globals: structuresource
Fields
num-buckets: uint32
cur-bucket: uint32
bucket: shadow-bucket

shadow-matrix-ref

shadow-matrix-ref: structuresource
Fields
joint-0: uint8
joint-1: uint8

shadow-settings

shadow-settings: structuresource
Fields
flags: shadow-flags
center: vector
shadow-dir: vector
dist-to-locus: float
bot-plane: plane
top-plane: plane
fade-dist: float
fade-start: float
dummy-2: int32
shadow-type: int32
flag-vector: vector

shadow-tri

shadow-tri: structuresource
Fields
ind-0: uint8
ind-1: uint8
ind-2: uint8
faces: uint8

shadow-vertex

shadow-vertex: structuresource
Fields
x: float
y: float
z: float
weight: float

shadow-work

shadow-work: structuresource
Fields
shadow-data: shadow-data
inbuf: uint128

Variables


*shadow-debug*

*shadow-debug*: symbolsource

*shadow-dma-buf*

*shadow-dma-buf*: dma-buffersource

*shadow-globals*

*shadow-globals*: shadow-globalssource

*shadow-object*

*shadow-object*: symbolsource

*shadow*

*shadow*: symbolsource

shadow-cpu

source

Types


shadow-dcache

shadow-dcache: structuresource
Fields
vtx-table: uint32
single-edge-table: uint32
double-edge-table: uint32
double-tri-table: uint32
dcache-top: uint32
num-facing-single-tris: uint32
num-single-edges: uint32
num-double-edges: uint32
single-tri-list: uint32
single-edge-list: uint32
double-edge-list: uint32
ptr-dual-verts: uint32
stats: shadow-stats
frag-qwc: uint32
center: vector
plane: vector
top-plane: vector
near-plane: vector
light-dir: vector
vtx-min: vector
data: uint8

shadow-stats

shadow-stats: structuresource
Fields
num-single-tris: uint32
num-double-tris: uint32
num-single-edges: uint32
num-double-edges: uint32
num-fragments: uint16
num-objects: uint16

Functions


debug-draw-settings

debug-draw-settings(arg0: matrix) => nonesource

shadow-dma-end

shadow-dma-end(arg0: dma-buffer, arg1: gs-rgbaq, arg2: symbol, arg3: int) => nonesource

shadow-dma-init

shadow-dma-init(arg0: dma-buffer) => nonesource

shadow-execute-all

shadow-execute-all(arg0: dma-buffer) => nonesource

shadow-invert-z-buf

shadow-invert-z-buf(arg0: dma-buffer) => nonesource

shadow-make-invert-buf

shadow-make-invert-buf() => nonesource

shadow-vu0-upload

shadow-vu0-upload() => nonesource

Variables


*shadow-data*

*shadow-data*: shadow-datasource

*shadow-dma-invert-call*

*shadow-dma-invert-call*: pointersource

shadow-vu0-block

const shadow-vu0-block: vu-functionsource

shadow-vu1

source

Types


shadow-vu1-constants

shadow-vu1-constants: structuresource
Fields
hmgescale: vector
invhscale: vector
texoffset: vector
texscale: vector
hvdfoff: vector
fog: vector
clrs: vector
adgif: gs-gif-tag
texflush: gs-adcmd
flush: gs-adcmd
trigif: gs-gif-tag
quadgif: gs-gif-tag

shadow-vu1-data

shadow-vu1-data: structuresource
Fields
adgif: gs-gif-tag
ad: gs-adcmd
flush: gs-adcmd
trigif: gs-gif-tag
quadgif: gs-gif-tag
texoffset: vector
texscale: vector
clrs: qword

Functions


shadow-vu1-add-constants

shadow-vu1-add-constants(arg0: dma-buffer, arg1: int) => nonesource

shadow-vu1-add-matrix

shadow-vu1-add-matrix(arg0: dma-buffer, arg1: math-camera) => nonesource

shadow-vu1-init-buffer

shadow-vu1-init-buffer(arg0: dma-buffer, arg1: int) => nonesource

shadow-vu1-patch-consts

shadow-vu1-patch-consts(arg0: symbol, arg1: int) => nonesource

Variables


*shadow-vu1-data*

*shadow-vu1-data*: shadow-vu1-datasource

shadow-vu1-block

const shadow-vu1-block: vu-functionsource