Skip to main content

blit-displays-h

source

Types


blit-displays-work

blit-displays-work: structuresource
Fields
adgif-tmpl: dma-gif-packet
sprite-tmpl: dma-gif-packet
sprite-slow-tmpl: dma-gif-packet
line-tmpl: dma-gif-packet
scan-tmpl: dma-gif-packet
color: vector4w
line-color: uint64
scan-colors: vector4w
menu-mode: symbol
screen-copied: symbol
vu1-enable-user-menu: vu1-renderer-mask
texture-enable-user-menu: uint32
count-down: uint32
horizontal-flip-flag: symbol
scan-alpha: float
scanline: uint32
progress-interp: float
progress-interp-dest: float
progress-interp-speed: float

blit-displays

source

Functions


blit-displays

blit-displays() => nonesource

draw-raw-image

draw-raw-image(arg0: bucket-id, arg1: art-group, arg2: int, arg3: int, arg4: level, arg5: int) => nonesource

Variables


*blit-displays-work*

*blit-displays-work*: blit-displays-worksource

font-h

source

Types


char-color

char-color: structuresource
Fields
color: rgba

char-verts

char-verts: structuresource
Fields
pos: vector
color: vector
tex-st: vector

draw-string-result

draw-string-result: uint64source

font-context

font-context: basicsource
Fields
type: type
origin: vector
strip-gif: vector
width: float
height: float
projection: float
scale: float
color: font-color
flags: font-flags
mat: matrix
start-line: uint32
alpha: float
Methods
set-mat!(obj: font-context, arg0: matrix) => font-contextsource
set-origin!(obj: font-context, arg0: int, arg1: int) => font-contextsource
set-depth!(obj: font-context, arg0: int) => font-contextsource
set-w!(obj: font-context, arg0: float) => font-contextsource
set-width!(obj: font-context, arg0: int) => font-contextsource
set-height!(obj: font-context, arg0: int) => font-contextsource
set-projection!(obj: font-context, arg0: float) => font-contextsource
set-color!(obj: font-context, arg0: font-color) => font-contextsource
set-flags!(obj: font-context, arg0: font-flags) => font-contextsource
set-start-line!(obj: font-context, arg0: uint) => font-contextsource
set-scale!(obj: font-context, arg0: float) => font-contextsource
set-alpha!(obj: font-context, arg0: float) => font-contextsource

font-work

font-work: structuresource
Fields
font-tmpl: dma-gif-packet
char-tmpl: dma-gif-packet
tex1-tmpl: uint64
small-font-0-tmpl: uint64
small-font-1-tmpl: uint64
small-font-2-tmpl: uint64
small-font-3-tmpl: uint64
large-font-0-tmpl: uint64
large-font-1-tmpl: uint64
large-font-2-tmpl: uint64
large-font-3-tmpl: uint64
size1-small: vector
size2-small: vector
size3-small: vector
size1-large: vector
size2-large-0: vector
size2-large-1: vector
size2-large-2: vector
size2-large-3: vector
size3-large: vector
size2-0: vector
size2-1: vector
size2-2: vector
size2-3: vector
size-st1: vector
size-st2: vector
size-st3: vector
save: vector
save-color: vector
current-verts: char-verts
src-verts: char-verts
dest-verts: char-verts
justify: vector
color-shadow: vector4w
color-table: char-color
current-font-0-tmpl: uint64
current-font-1-tmpl: uint64
current-font-2-tmpl: uint64
current-font-3-tmpl: uint64
last-color: font-color
save-last-color: font-color
buf: basic
str-ptr: uint32
flags: font-flags
reg-save: uint32

Functions


font-set-tex0

font-set-tex0(arg0: pointer, arg1: texture, arg2: int, arg3: int, arg4: int) => nonesource

Write the TEX0 parameters for a font

set-font-color

set-font-color(color: font-color, vert: int, rgba-red: rgba, rgba-green: rgba, rgba-blue: rgba) => intsource

Variables


*font-default-matrix*

*font-default-matrix*: matrixsource

*font-work*

*font-work*: font-worksource

Functions


draw-string-adv

draw-string-adv(arg0: string, arg1: dma-buffer, arg2: font-context) => nonesource

draw-string-xy

draw-string-xy(arg0: string, arg1: dma-buffer, arg2: int, arg3: int, arg4: font-color, arg5: font-flags) => draw-string-resultsource

gen-font-12

gen-font-12(arg0: string) => nonesource

lightning-h

source

Types


lightning-control

lightning-control: basicsource
Fields
type: type
spec: lightning-spec
process: pointer
state: lightning-state
Methods
change-mode(obj: lightning-control, arg0: lightning-mode) => lightning-modesource
get-mode(obj: lightning-control) => lightning-modesource
set-point!(obj: lightning-control, arg0: int, arg1: vector) => nonesource
set-first-meet-point(obj: lightning-control, arg0: vector) => nonesource
set-last-meet-point(obj: lightning-control, arg0: vector) => nonesource

lightning-probe-vars

lightning-probe-vars: basicsource
Fields
type: type
src-joint-index: uint32
next-spawn-time: time-frame
last-valid-time: time-frame
point: vector
start-pos: vector
end-pos: vector
probe-dirs: inline-array

lightning-spec

lightning-spec: basicsource
Fields
type: type
name: string
flags: lightning-spec-flags
rand-func: uint8
adjust-distance: uint8
start-color: rgba
end-color: rgba
fade-to-color: rgba
fade-start-factor: float
fade-time: float
texture: texture-id
reduction: float
num-points: int32
box-size: float
merge-factor: float
merge-count: int32
radius: float
duration: float
duration-rand: float
sound: basic
delay: float
delay-rand: float

lightning-state

lightning-state: structuresource
Fields
mode: lightning-mode
counter: float
points-to-draw: int32
box-size: float
gcf-control: gcf-control
line: vector-array
meet: vector-array
path: vector-array
start-color: rgba
end-color: rgba

Functions


lookup-lightning-spec-by-name

lookup-lightning-spec-by-name(arg0: string) => lightning-specsource

Variables


*lightning-probe-vars*

*lightning-probe-vars*: lightning-probe-varssource

lightning

source

Types


lightning-globals

lightning-globals: structuresource
Fields
gcf-buf: uint16
vtx-buf: uint16

Functions


gs-packed-rgba-lerp!

gs-packed-rgba-lerp!(arg0: gs-packed-rgba, arg1: rgba, arg2: rgba, arg3: float) => gs-packed-rgbasource

lightning-draw

lightning-draw(arg0: dma-buffer, arg1: lightning-control, arg2: lightning-globals) => symbolsource

lightning-draw-all

lightning-draw-all() => nonesource

lightning-fade

lightning-fade(arg0: lightning-control) => intsource

lightning-fractal-gen

lightning-fractal-gen(arg0: inline-array, arg1: int, arg2: int, arg3: float, arg4: lightning-spec) => nonesource

lightning-start

lightning-start(arg0: float, arg1: float) => pointersource

lightning-trail-fractal-gen

lightning-trail-fractal-gen(arg0: inline-array, arg1: inline-array, arg2: int, arg3: int, arg4: float, arg5: lightning-spec) => nonesource

lightning-trail-uniform-gen

lightning-trail-uniform-gen(arg0: inline-array, arg1: inline-array, arg2: float, arg3: int) => symbolsource

lightning-uniform-gen

lightning-uniform-gen(arg0: inline-array, arg1: int, arg2: int, arg3: float, arg4: lightning-spec) => nonesource

lightning-update

lightning-update(arg0: lightning-control) => symbolsource

rgba-lerp

rgba-lerp(arg0: rgba, arg1: rgba, arg2: rgba) => rgbasource
unlink-lightning-spec-by-heap(arg0: kheap) => nonesource

Variables


*lightning-gcf*

*lightning-gcf*: gcf-controlsource

*lightning-globals*

*lightning-globals*: lightning-globalssource

*lightning-spec-id-table*

*lightning-spec-id-table*: arraysource

*lightning*

*lightning*: symbolsource

lights-h

source

Types


light

light: structuresource
Fields
direction: vector
color: rgbaf
extra: vector
level: float
luminance: float
priority: float
bytes: uint8
mask: uint16
palette-index: int8

light-group

light-group: structuresource
Fields
dir0: light
dir1: light
dir2: light
ambi: light
lights: light

light-hash

light-hash: basicsource
Fields
type: type
num-lights: uint16
num-indices: uint16
num-buckets: uint16
bucket-step: uint8
base-trans: vector
axis-scale: vector
dimension-array: vector4w
bucket-array: inline-array
index-array: pointer
light-sphere-array: inline-array

light-hash-bucket

light-hash-bucket: structuresource
Fields
index: uint16
count: uint16

light-hash-work

light-hash-work: structuresource
Fields
ones: vector4w

light-sphere

light-sphere: structuresource
Fields
name: string
bsphere: vector
direction: vector
color: vector
decay-start: float
ambient-point-ratio: float
brightness: float
bytes: uint8
mask: uint16
palette-index: int8

vu-lights

vu-lights: structuresource
Fields
direction: vector
color: vector
ambient: vector
fade-int: uint32
fade-flags: uint32

Variables


*light-hash*

*light-hash*: light-hashsource

lights

source

Functions


init-light-hash

init-light-hash() => nonesource

light-group-process!

light-group-process!(arg0: vu-lights, arg1: light-group, arg2: vector, arg3: vector) => nonesource

light-group-slerp

light-group-slerp(arg0: light-group, arg1: light-group, arg2: light-group, arg3: float) => light-groupsource

light-slerp

light-slerp(arg0: light, arg1: light, arg2: light, arg3: float) => lightsource

lookup-light-sphere-by-name

lookup-light-sphere-by-name(arg0: string, arg1: light-hash) => light-spheresource

reset-light-hash

reset-light-hash(arg0: light-hash) => nonesource

update-light-hash

update-light-hash(arg0: light-hash) => nonesource

vu-lights-default!

vu-lights-default!(arg0: vu-lights) => vu-lightssource

Variables


*default-lights*

*default-lights*: vu-lightssource

*light-hash-work*

*light-hash-work*: light-hash-worksource

math-camera-h

source
Expand description

The "math-camera" is responsible for computing the projection matrix used in the renderer

from the position of the in-game camera. It also computes some other common camera info.

See cam-update.gc for how the game camera updates the math-camera.



It also contains some GIF stuff, but these seem to be wrong/unused.

Some of the code here may be extremely old and unused, but this does compute the camera projection

matrix used almost everywhere.

Types


cull-info

cull-info: structuresource
Fields
x-fact: float
y-fact: float
z-fact: float
cam-radius: float
cam-x: float
cam-y: float
xz-dir-ax: float
xz-dir-az: float
xz-dir-bx: float
xz-dir-bz: float
xz-cross-ab: float
yz-dir-ay: float
yz-dir-az: float
yz-dir-by: float
yz-dir-bz: float
yz-cross-ab: float

math-camera

math-camera: basicsource
Fields
type: type
d: meters
f: meters
fov: degrees
x-ratio: float
y-ratio: float
x-pix: float
x-clip: float
x-clip-ratio-in: float
x-clip-ratio-over: float
y-pix: float
y-clip: float
y-clip-ratio-in: float
y-clip-ratio-over: float
cull-info: cull-info
fog-start: meters
fog-end: meters
fog-max: float
fog-min: float
reset: int32
smooth-step: float
smooth-t: float
perspective: matrix
isometric: matrix
sprite-2d: matrix
sprite-2d-hvdf: vector
camera-rot: matrix
inv-camera-rot: matrix
inv-camera-rot-smooth: matrix
inv-camera-rot-smooth-from: quaternion
camera-temp: matrix
prev-camera-temp: matrix
prev-inv-camera-rot: matrix
prev-trans: vector
hmge-scale: vector
inv-hmge-scale: vector
hvdf-off: vector
guard: vector
vis-gifs: vis-gif-tag
giftex: uint128
gifgr: uint128
giftex-trans: uint128
gifgr-trans: uint128
pfog0: float
pfog1: float
trans: vector
plane: plane
guard-plane: plane
shrub-mat: matrix
quat-other: quaternion
trans-other: vector
shrub-mat-other: matrix
camera-temp-other: matrix
camera-rot-other: matrix
inv-camera-rot-other: matrix
plane-other: plane
guard-plane-other: plane
mirror-trans: vector
mirror-normal: vector
fov-correction-factor: float

vis-gif-tag

vis-gif-tag: structuresource
Fields
fog0: uint32
strip: uint32
regs: uint32
fan: uint32

math-camera

source
Expand description

;;;;;;;;;;;;;;;;;;;;

math camera basics

;;;;;;;;;;;;;;;;;;;;



the math camera computes the perspective matrix, hvdf offset, and hmge scale.



multiplying a point by the perspective matrix, doing the persepctive divide, then adding hvdf offset gives you:

H : horizontal position (in GS coordinates)

V : vertical position (in GS coordinates)

D : depth (as a 24-bit integer for the z buffer)

F : fog



Multiplying by hmge then checking the clipping flags can be used to see if a point is outside the view frustum.



The "camera-temp" matrix is the perspective matrix multplied by the camera tranformation and is used

renderers that want a single matrix.

Types


fog-corrector

fog-corrector: structuresource
Fields
fog-end: float
fog-start: float

Functions


fog-corrector-setup

fog-corrector-setup(arg0: fog-corrector, arg1: math-camera) => nonesource

Set the fog corrector based on the supplied math-camera

init-for-transform

init-for-transform(arg0: matrix) => nonesource

Sets up VU0 registers with camera info.
This is probably a very old function and it's only used by camera debug.
It stashes some data in vector float registers that must be there before calling transform-float-point.

math-cam-start-smoothing

math-cam-start-smoothing(arg0: float, arg1: float) => quaternionsource

Unused camera smoothing

move-target-from-pad

move-target-from-pad(arg0: transform, arg1: int) => transformsource

Unused function to adjust trans based on inputs from the pad.
This function must be extremely old because it takes a non-quaternion transform,
and all target stuff uses quaternions.

reverse-transform-point!

reverse-transform-point!(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => nonesource

Likely transform arg3 from screen space to world coords, using arg1/arg2 for... something.

transform-point-qword!

transform-point-qword!(arg0: vector4w, arg1: vector) => symbolsource

Apply camera transformation to point, returning fixed point 28.4 position
that can be given to the GS directly.

transform-point-vector!

transform-point-vector!(arg0: vector, arg1: vector) => symbolsource

Apply camera transformation to a point. Return true if it is visible or not.
This returns the point in GS coords, but as float instead of int, so it's
not really useful. See transform-point-qword! for more details

transform-point-vector-scale!

transform-point-vector-scale!(arg0: vector, arg1: vector) => floatsource

Similar to transform-point-qword! but returns the scale factor instead.

update-math-camera

update-math-camera(arg0: math-camera, arg1: symbol, arg2: symbol, arg3: float) => math-camerasource

Compute some one-time camera constants. These should only change when changing aspect ratio.

Variables


*math-camera-fog-correction*

*math-camera-fog-correction*: fog-correctorsource

*math-camera*

*math-camera*: math-camerasource

vu1-user-h

source
Expand description

this file contains shared enums for the various renderers.



Renderers will output data to "buckets", which are later spliced together into a single

very large dma chain.



With the exception of a few special case buckets, there's a bucket for

<renderer>-<special_modes>-<draw-level>-<tpage>

unlike jak 1, the "draw level index" is separate from the normal level index.



for example: tie-s-l1-tfrag

- will be filled by the TIE renderer

- special "s" (scissor) variant of TIE

- using geometry of level 1

- while the tfrag tpage is in VRAM

Types


dma-foreground-sink

dma-foreground-sink: basicsource
Fields
type: type
bucket: bucket-id
foreground-texture-page: tpage-category
foreground-texture-level: int8
foreground-output-bucket: int8

generic-bucket-state

generic-bucket-state: structuresource
Fields
gifbuf-adr: uint32
inbuf-adr: uint32

generic-dma-foreground-sink

generic-dma-foreground-sink: dma-foreground-sinksource
Fields
type: type
bucket: bucket-id
foreground-texture-page: tpage-category
foreground-texture-level: int8
foreground-output-bucket: int8
state: generic-bucket-state

Functions


fx-copy-buf

fx-copy-buf(arg0: dma-buffer) => nonesource

draw the current framebuffer to tbp #x3300 (13056)

Variables


*warp-shader*

*warp-shader*: adgif-shadersource