Skip to main content

simple-sprite-h

source

Types


simple-sprite-system

simple-sprite-system: structuresource
Fields
count: int16
max-count: int16
data: inline-array
Methods
add!(obj: simple-sprite-system, arg0: sprite-glow-data) => nonesource
draw-all-sprites!(obj: simple-sprite-system, arg0: dma-buffer) => nonesource
clear!(obj: simple-sprite-system) => nonesource

sprite-glow-data

sprite-glow-data: structuresource
Fields
position: vector
size-x: float
size-probe: float
z-offset: float
rot-angle: float
size-y: float
color: rgbaf
fade-a: float
fade-b: float
tex-id: texture-id
dummy: uint32
quads: vector
Methods
set-trans(obj: sprite-glow-data, arg0: vector) => nonesource

sprite-distort

source
Expand description

Works just like Jak 1 with some exceptions:

- Sprite texture source doesn't seem to be the current framebuffer, instead tbp0 is hardcoded to #x3300.

- The sprite-aux-list contains more than just distort sprites. Instead of containing sprite-vec-data-2d's

directly, it's now a list of sprite-aux-elem. If the aux-type is 0, then that element is a distort sprite.

- No longer takes video-params screen-sy into account.



Sprite distort works by drawing a circle for each sprite whose texture is the framebuffer contents of what's

been drawn so far. The texture coordinates are off slightly to give a "distortion" effect as the sprite moves

across the screen. The resolution of the circle is defined by the number of "turns", which can range between

3 and 11. Turns basically define the number of edges that make up the circle, so 3 turns will create a triangle,

5 will create a pentagon, etc. The sprite-vec-data-2d 'warp-turns'/'flag' field contains the number of turns.

Types


sprite-distorter-sine-tables

sprite-distorter-sine-tables: basicsource
Fields
type: type
aspx: float
aspy: float
entry: vector
ientry: qword
giftag: gs-gif-tag
color: qword

Functions


sprite-distorter-generate-tables

sprite-distorter-generate-tables() => nonesource

sprite-draw-distorters

sprite-draw-distorters(dma-buff: dma-buffer) => nonesource

sprite-init-distorter

sprite-init-distorter(dma-buff: dma-buffer) => nonesource

Sets up GS registers, adds a reference to sprite-distorter-sine-tables, and loads the VU program.

Variables


*sprite-distorter-sine-tables*

*sprite-distorter-sine-tables*: sprite-distorter-sine-tablessource

sprite-distort-vu1-block

const sprite-distort-vu1-block: vu-functionsource

sprite-glow

source

Types


sprite-glow-cnt-template

sprite-glow-cnt-template: structuresource
Fields
control-packet: dma-packet
num-sprites: uint32
dummys: uint32
num-sprites-quad: uint128
vecdata-packet: dma-packet
vecdata: sprite-glow-data
shader-packet: dma-packet
shader: adgif-shader
mscal-packet: dma-packet

sprite-glow-consts

sprite-glow-consts: structuresource
Fields
camera: matrix
perspective: matrix
hvdf-offset: vector
hmge-scale: vector
consts: vector
pfog0: float
deg-to-rad: float
min-scale: float
inv-area: float
sincos-01: vector
sincos-23: vector
sincos-45: vector
sincos-67: vector
sincos-89: vector
basis-x: vector
basis-y: vector
xy-array: vector
clamp-min: vector
clamp-max: vector

sprite-glow-dma-packet-data

sprite-glow-dma-packet-data: structuresource
Fields
control-packet: dma-packet
vecdata-packet: dma-packet
shader-cnt-packet: dma-packet
shader-ref-packet: dma-packet
mscal-packet: dma-packet

sprite-glow-ref-template

sprite-glow-ref-template: structuresource
Fields
control-packet: dma-packet
num-sprites: uint32
dummys: uint32
num-sprites-quad: uint128
vecdata-packet: dma-packet
vecdata: sprite-glow-data
shader-packet: dma-packet
shader-packet-ptr: pointer
mscal-packet: dma-packet

sprite-glow-template

sprite-glow-template: structuresource
Fields
clear-init-giftag: gs-gif-tag
clear-init-adcmds: gs-adcmd
clear-draw-giftag: gs-gif-tag
clear-draw-clr-0: gs-packed-rgba
clear-draw-xyz-0: gs-packed-xyzw
clear-draw-clr-1: gs-packed-rgba
clear-draw-xyz-1: vector
offscr-setup-giftag: gs-gif-tag
offscr-setup-adcmds: gs-adcmd
offscr-first-giftag: gs-gif-tag
offscr-first-clr: gs-packed-rgba
offscr-first-uv-0: gs-packed-uv
offscr-first-xyzw-0: gs-packed-xyzw
offscr-first-uv-1: gs-packed-uv
offscr-first-xyzw-1: gs-packed-xyzw
repeat-draw-giftag: gs-gif-tag
repeat-draw-adcmds: gs-adcmd
flare-alpha-giftag: gs-gif-tag
flare-alpha-clr: gs-packed-rgba
flare-alpha-uv: gs-packed-uv
flare-alpha-xyzw-0: gs-packed-xyzw
flare-alpha-xyzw-1: gs-packed-xyzw
flare-alpha-xyzw-2: gs-packed-xyzw
flare-alpha-xyzw-3: gs-packed-xyzw
flare-init-giftag: gs-gif-tag
flare-init-adcmds: gs-adcmd
flare-draw-giftag: gs-gif-tag
flare-draw-clr: gs-packed-rgba
flare-draw-stq-0: gs-packed-stq
flare-draw-xyzw-0: gs-packed-xyzw
flare-draw-stq-1: gs-packed-stq
flare-draw-xyzw-1: gs-packed-xyzw
flare-draw-stq-2: gs-packed-stq
flare-draw-xyzw-2: gs-packed-xyzw
flare-draw-stq-3: gs-packed-stq
flare-draw-xyzw-3: gs-packed-xyzw

Functions


add-shader-to-dma

add-shader-to-dma(arg0: dma-buffer) => adgif-shadersource

sprite-glow-add-simple-sprite

sprite-glow-add-simple-sprite(arg0: dma-buffer, arg1: sprite-glow-dma-packet-data, arg2: sprite-glow-data, arg3: pointer) => nonesource

sprite-glow-add-sprite

sprite-glow-add-sprite(arg0: dma-buffer, arg1: sprite-vec-data-2d, arg2: float, arg3: float, arg4: float, arg5: adgif-shader) => nonesource

sprite-glow-draw

sprite-glow-draw(arg0: dma-buffer) => nonesource

sprite-glow-init-consts

sprite-glow-init-consts(arg0: sprite-glow-consts) => nonesource

sprite-glow-init-engine

sprite-glow-init-engine(arg0: dma-buffer) => nonesource

Variables


*simple-sprite-system*

*simple-sprite-system*: simple-sprite-systemsource

*sprite-glow-dma-packet-data*

*sprite-glow-dma-packet-data*: sprite-glow-dma-packet-datasource

*sprite-glow-template*

*sprite-glow-template*: sprite-glow-templatesource

sprite-glow-vu1-block

const sprite-glow-vu1-block: vu-functionsource

sprite-h

source

Types


sprite-array-2d

sprite-array-2d: basicsource
Fields
type: type
num-sprites: int32
num-valid: int32
vec-data: pointer
adgif-data: inline-array
pad: uint128
data: uint128

sprite-array-3d

sprite-array-3d: basicsource
Fields
type: type
num-sprites: int32
num-valid: int32
vec-data: pointer
adgif-data: inline-array
data: uint128

sprite-vec-data-2d

sprite-vec-data-2d: structuresource
Fields
x-y-z-sx: vector
flag-rot-sy: vector
r-g-b-a: vector
x: float
y: float
z: float
sx: float
sy: float
rot: float
flag: int32
matrix: int32
warp-turns: int32
r: float
g: float
b: float
a: float
trans: vector3s
color: rgbaf
data: uint128
data64: uint64

sprite-vec-data-3d

sprite-vec-data-3d: structuresource
Fields
x-y-z-sx: vector
qx-qy-qz-sy: vector
r-g-b-a: vector
x: float
y: float
z: float
sx: float
sy: float
qx: float
qy: float
qz: float
r: float
g: float
b: float
a: float
trans: vector3s
rot: vector3s
color: rgbaf
data: uint128

Variables


SPRITE_AUX_MAX_AMOUNT_MULT

SPRITE_AUX_MAX_AMOUNT_MULT: unknownsource

SPRITE_MAX_AMOUNT_MULT

SPRITE_MAX_AMOUNT_MULT: unknownsource

sprite

source
Expand description

the sprite renderer draw 2D or 3D sprites

Types


sprite-aux-elem

sprite-aux-elem: structuresource
Fields
aux-type: sprite-aux-type
data: vector
vec-data: sprite-vec-data-2d
gif-data: adgif-shader
aux-data: sparticle-cpuinfo

sprite-aux-list

sprite-aux-list: basicsource
Fields
type: type
num-entries: int32
entry: int32
data: sprite-aux-elem

sprite-frame-data

sprite-frame-data: structuresource
Fields
cdata: vector
xy-array: vector
st-array: vector
xyz-array: vector
hmge-scale: vector
consts: vector
pfog0: float
deg-to-rad: float
min-scale: float
inv-area: float
adgif-giftag: gs-gif-tag
sprite-2d-giftag: gs-gif-tag
sprite-2d-giftag-2: gs-gif-tag
sincos-01: vector
sincos-23: vector
sincos-45: vector
sincos-67: vector
sincos-89: vector
basis-x: vector
basis-y: vector
sprite-3d-giftag: gs-gif-tag
sprite-3d-giftag-2: gs-gif-tag
screen-shader: adgif-shader
inv-hmge-scale: vector
stq-offset: vector
stq-scale: vector
rgba-plain: qword
warp-giftag: gs-gif-tag
fog-clamp: vector
fog-min: float
fog-max: float
max-scale: float

sprite-header

sprite-header: structuresource
Fields
header: qword
num-sprites: int32

sprite-hvdf-control

sprite-hvdf-control: structuresource
Fields
alloc: int8

sprite-hvdf-data

sprite-hvdf-data: structuresource
Fields
data: qword

Functions


add-to-sprite-aux-list

add-to-sprite-aux-list(system: sparticle-system, sprite-info: sparticle-cpuinfo, sprite-vec: sprite-vec-data-3d, arg3: uint) => nonesource

clear-sprite-aux-list

clear-sprite-aux-list() => nonesource

Remove everything from the sprite aux list

sprite-add-2d-all

sprite-add-2d-all(sprites: sprite-array-2d, dma-buff: dma-buffer, group-idx: int) => nonesource

Builds a DMA list for sprites

sprite-add-2d-chunk

sprite-add-2d-chunk(sprites: sprite-array-2d, start-sprite-idx: int, num-sprites: int, dma-buff: dma-buffer, mscal-addr: int) => nonesource

Upload sprite data from elements in the array.

sprite-add-3d-all

sprite-add-3d-all(sprites: sprite-array-3d, dma-buff: dma-buffer, group-idx: int) => nonesource

Set up DMA for all 3d sprites

sprite-add-3d-chunk

sprite-add-3d-chunk(sprites: sprite-array-3d, start-sprite-idx: int, num-sprites: int, dma-buff: dma-buffer) => nonesource

Add DMA list data for up to 48 sprites. This is very similar to the 2D one, see that for more documentation

sprite-add-frame-data

sprite-add-frame-data(dma-buff: dma-buffer, tbp-offset: uint) => nonesource

sprite-add-matrix-data

sprite-add-matrix-data(dma-buff: dma-buffer, matrix-mode: uint) => nonesource

Add matrix data to a dma-buffer.
Mode 0 = send (-> math-camera camera-temp)
Mode 1 = screen sprites, like the HUD

sprite-allocate-user-hvdf

sprite-allocate-user-hvdf() => intsource

Allocate an HVDF entry. Returns the index. Or 0 if it fails

sprite-draw

sprite-draw(disp: display) => nonesource

Main sprite draw function.

sprite-get-3d-quaternion!

sprite-get-3d-quaternion!(out: quaternion, sprite: sprite-vec-data-3d) => quaternionsource

Get a quaternion. It's stored with only 3 components, so qw is
recalculated.

sprite-get-user-hvdf

sprite-get-user-hvdf(idx: int) => vectorsource

Get an HVDF entry by index

sprite-release-user-hvdf

sprite-release-user-hvdf(idx: int) => nonesource

Free an HVDF

sprite-set-3d-quaternion!

sprite-set-3d-quaternion!(sprite: sprite-vec-data-3d, quat: quaternion) => quaternionsource

Set the quaternion for a 3d sprite.
NOTE: the w component of the quaternion is not stored and
the original w value is preserved.

sprite-setup-frame-data

sprite-setup-frame-data(data: sprite-frame-data, tbp-offset: uint) => nonesource

Build the sprite-frame-data. This should be done once per frame

sprite-setup-header

sprite-setup-header(hdr: sprite-header, num-sprites: int) => nonesource

Setup a sprite-header for the given number of sprites

Variables


*sprite-array-2d*

*sprite-array-2d*: sprite-array-2dsource

*sprite-array-3d*

*sprite-array-3d*: sprite-array-3dsource

*sprite-aux-list*

*sprite-aux-list*: sprite-aux-listsource

*sprite-hvdf-control*

*sprite-hvdf-control*: sprite-hvdf-controlsource

*sprite-hvdf-data*

*sprite-hvdf-data*: sprite-hvdf-datasource

sprite-vu1-block

const sprite-vu1-block: vu-functionsource