Types
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: 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
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: basicsource
Functions
sprite-distorter-generate-tables() => nonesource
sprite-draw-distorters(dma-buff: dma-buffer) => nonesource
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
const sprite-distort-vu1-block: vu-functionsource
Types
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: 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: 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: 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: 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(arg0: dma-buffer) => adgif-shadersource
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(arg0: dma-buffer, arg1: sprite-vec-data-2d, arg2: float, arg3: float, arg4: float, arg5: adgif-shader) => nonesource
sprite-glow-draw(arg0: dma-buffer) => nonesource
sprite-glow-init-consts(arg0: sprite-glow-consts) => nonesource
sprite-glow-init-engine(arg0: dma-buffer) => nonesource
Variables
const sprite-glow-vu1-block: vu-functionsource
Types
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: basicsource
Fields
type: type
num-sprites: int32
num-valid: int32
vec-data: pointer
adgif-data: inline-array
data: uint128
sprite-vec-data-2d: structuresource
sprite-vec-data-3d: structuresource
Variables
SPRITE_AUX_MAX_AMOUNT_MULT: unknownsource
SPRITE_MAX_AMOUNT_MULT: unknownsource
Expand description
the sprite renderer draw 2D or 3D sprites
Types
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: basicsource
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
Functions
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() => nonesource
Remove everything from the sprite aux list
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(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(sprites: sprite-array-3d, dma-buff: dma-buffer, group-idx: int) => nonesource
Set up DMA for all 3d sprites
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(dma-buff: dma-buffer, tbp-offset: uint) => nonesource
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() => intsource
Allocate an HVDF entry. Returns the index. Or 0 if it fails
sprite-draw(disp: display) => nonesource
Main sprite draw function.
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(idx: int) => vectorsource
Get an HVDF entry by index
sprite-release-user-hvdf(idx: int) => nonesource
Free an HVDF
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(data: sprite-frame-data, tbp-offset: uint) => nonesource
Build the sprite-frame-data. This should be done once per frame
sprite-setup-header(hdr: sprite-header, num-sprites: int) => nonesource
Setup a sprite-header for the given number of sprites