Types
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
Functions
blit-displays() => nonesource
draw-raw-image(arg0: bucket-id, arg1: art-group, arg2: int, arg3: int, arg4: level, arg5: int) => nonesource
Variables
Types
draw-string-result: uint64source
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: 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(arg0: pointer, arg1: texture, arg2: int, arg3: int, arg4: int) => nonesource
Write the TEX0 parameters for a font
set-font-color(color: font-color, vert: int, rgba-red: rgba, rgba-green: rgba, rgba-blue: rgba) => intsource
Variables
Functions
draw-string-adv(arg0: string, arg1: dma-buffer, arg2: font-context) => nonesource
draw-string-xy(arg0: string, arg1: dma-buffer, arg2: int, arg3: int, arg4: font-color, arg5: font-flags) => draw-string-resultsource
gen-font-12(arg0: string) => nonesource
Types
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: 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: 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: 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(arg0: string) => lightning-specsource
Variables
Types
Functions
gs-packed-rgba-lerp!(arg0: gs-packed-rgba, arg1: rgba, arg2: rgba, arg3: float) => gs-packed-rgbasource
lightning-draw(arg0: dma-buffer, arg1: lightning-control, arg2: lightning-globals) => symbolsource
lightning-draw-all() => nonesource
lightning-fade(arg0: lightning-control) => intsource
lightning-fractal-gen(arg0: inline-array, arg1: int, arg2: int, arg3: float, arg4: lightning-spec) => nonesource
lightning-start(arg0: float, arg1: float) => pointersource
lightning-trail-fractal-gen(arg0: inline-array, arg1: inline-array, arg2: int, arg3: int, arg4: float, arg5: lightning-spec) => nonesource
lightning-trail-uniform-gen(arg0: inline-array, arg1: inline-array, arg2: float, arg3: int) => symbolsource
lightning-uniform-gen(arg0: inline-array, arg1: int, arg2: int, arg3: float, arg4: lightning-spec) => nonesource
lightning-update(arg0: lightning-control) => symbolsource
unlink-lightning-spec-by-heap(arg0: kheap) => nonesource
Variables
*lightning*: symbolsource
Types
light: structuresource
light-hash: basicsource
light-sphere: structuresource
vu-lights: structuresource
Variables
Functions
init-light-hash() => nonesource
light-group-process!(arg0: vu-lights, arg1: light-group, arg2: vector, arg3: vector) => nonesource
light-group-slerp(arg0: light-group, arg1: light-group, arg2: light-group, arg3: float) => light-groupsource
lookup-light-sphere-by-name(arg0: string, arg1: light-hash) => light-spheresource
reset-light-hash(arg0: light-hash) => nonesource
update-light-hash(arg0: light-hash) => nonesource
vu-lights-default!(arg0: vu-lights) => vu-lightssource
Variables
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.
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.
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: 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
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.
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.
Functions
fog-corrector-setup(arg0: fog-corrector, arg1: math-camera) => nonesource
Set the fog corrector based on the supplied math-camera
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.
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(arg0: float, arg1: float) => quaternionsource
Unused camera smoothing
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.
This function must be extremely old because it takes a non-quaternion transform,
and all target stuff uses quaternions.
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!(arg0: vector4w, arg1: vector) => symbolsource
Apply camera transformation to point, returning fixed point 28.4 position
that can be given to the GS directly.
that can be given to the GS directly.
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
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!(arg0: vector, arg1: vector) => floatsource
Similar to transform-point-qword! but returns the scale factor instead.
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
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
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
dma-foreground-sink: basicsource
Fields
type: type
bucket: bucket-id
foreground-texture-page: tpage-category
foreground-texture-level: int8
foreground-output-bucket: int8
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(arg0: dma-buffer) => nonesource
draw the current framebuffer to tbp #x3300 (13056)