Expand description
At any point in time, there are 3 frames in progress:
- one frame is fully rendered and being drawn on the screen.
this frame just sits in the frame buffer, and isn't tracked by the display system.
- one frame is being rendered
(frame buffer is being written to by GS, VU1 sending tris to GS, VIF1 feeding VU1)
this frame needs a DMA buffer that is full, and being read by VIF1
- one frame is being set up. The engine is running gameplay code and generating DMA data
this frame also needs a DMA buffer, which is being filled up.
- one frame is fully rendered and being drawn on the screen.
this frame just sits in the frame buffer, and isn't tracked by the display system.
- one frame is being rendered
(frame buffer is being written to by GS, VU1 sending tris to GS, VIF1 feeding VU1)
this frame needs a DMA buffer that is full, and being read by VIF1
- one frame is being set up. The engine is running gameplay code and generating DMA data
this frame also needs a DMA buffer, which is being filled up.
display: basicsource
Fields
type: type
on-screen: int32
last-screen: int32
frames: display-frame
bgcolor: gs-bgcolor
pmode: gs-pmode
clock: clock
session-clock: clock
game-clock: clock
base-clock: clock
real-clock: clock
frame-clock: clock
real-frame-clock: clock
target-clock: clock
entity-clock: clock
part-clock: clock
bg-clock: clock
camera-clock: clock
user0-clock: clock
total-game-clock: clock
time-factor: float
dog-ratio: float
vblank-start-time: int64
total-run-time: int64
run-half-speed: basic
dog-count: float
vu1-enable-user: vu1-renderer-mask
vu1-enable-user-menu: vu1-renderer-mask
force-sync: uint32
Methods
set-time-ratios(obj: display, arg0: float) => floatsource
Set the 'dog ratio'. This should be 1 when the game is running at full speed.
Larger dog ratio means slower.
Larger dog ratio means slower.
display-frame: basicsource
Fields
type: type
buffer: dma-buffer
calc-buf: dma-buffer
vu1-buf: dma-buffer
debug-buf: dma-buffer
global-buf: dma-buffer
bucket-group: inline-array
profile-array: profile-array
start-time: int64
run-time: int64
Variables
*post-draw-hook*: functionsource
*pre-draw-hook*: functionsource
DEFAULT_ALL_RENDERERS: unknownsource
Functions
allocate-dma-buffers(arg0: display) => displaysource
Allocate the main, debug, and calc dma buffers.
draw-quad2d(arg0: dma-buffer, arg1: draw-context) => nonesource
Draw a quad that fills the entire context
draw-sprite2d-xy(arg0: dma-buffer, arg1: int, arg2: int, arg3: int, arg4: int, arg5: rgba) => nonesource
Draw a sprite primitive with the given color and dimensions.
draw-sprite2d-xy-absolute(arg0: dma-buffer, arg1: int, arg2: int, arg3: int, arg4: int, arg5: rgba) => nonesource
Draw a sprite primitive, setting the gs-xzyf register to exactly the values specified (no offset/clamp)
get-current-time() => time-framesource
Get the base-clock time.
get-integral-current-time() => uintsource
Get the number of frames that have happened.
reset-display-gs-state(arg0: display, arg1: dma-buffer) => displaysource
screen-gradient(arg0: dma-buffer, arg1: rgba, arg2: rgba, arg3: rgba, arg4: rgba) => nonesource
Fill the screen with a sprite with the given colors.
set-display(arg0: display) => displaysource
Allocate and initialize clocks for the display.
set-display-gs-state(arg0: dma-buffer, arg1: int, arg2: int, arg3: int, arg4: int, arg5: int) => dma-buffersource
set-display-gs-state-offset(arg0: dma-buffer, arg1: int, arg2: int, arg3: int, arg4: int, arg5: int, arg6: int, arg7: int) => dma-buffersource
vblank-handler() => intsource
Record the time of the last two vblanks.
vif1-handler() => nonesource
vif1-handler-debug(mark-in: int) => nonesource
Handle the VIF1 interrupt.
The mark register of VIF will be set to the bucket that is now starting.
The mark register of VIF will be set to the bucket that is now starting.
Variables
DMA_BUFFER_DEBUG_SIZE: unknownsource
DMA_BUFFER_GLOBAL_SIZE: unknownsource
Types
draw-context: basicsource
gif-bank: structuresource
gif-cnt: uint32source
gif-ctrl: uint32source
gif-mode: uint32source
gif-p3cnt: uint32source
gif-p3tag: uint32source
gif-packet: basicsource
gif-stat: uint32source
gif-tag: uint128source
gif-tag-count: uint32source
gif-tag-prim: uint32source
gif-tag-regs: uint64source
gif-tag-regs-32: uint32source
gif-tag64: uint64source
gs-adcmd: structuresource
Fields
word: uint32
quad: uint128
data: uint64
cmds: gs-reg64
cmd: uint8
x: uint32
y: uint32
z: uint32
w: uint32
gs-alpha: uint64source
gs-bank: structuresource
Fields
pmode: gs-pmode
smode2: gs-smode2
dspfb1: gs-display-fb
display1: gs-display
dspfb2: gs-display-fb
display2: gs-display
extbuf: uint64
extdata: uint64
extwrite: uint64
bgcolor: gs-bgcolor
csr: gs-csr
imr: uint64
busdir: uint64
gs-bgcolor: uint64source
gs-bitbltbuf: uint64source
gs-clamp: uint64source
gs-color-clamp: uint64source
gs-csr: uint64source
gs-display: uint64source
gs-display-fb: uint64source
gs-dthe: uint64source
gs-fog: uint64source
gs-fogcol: uint64source
gs-frame: uint64source
gs-gif-tag: structuresource
gs-miptbp: uint64source
gs-packed-gt: structuresource
gs-packed-gt4: structuresource
Fields
data: gs-packed-gt
gs-packed-rgba: vector4wsource
Fields
data: int32
x: int32
y: int32
z: int32
w: int32
dword: uint64
quad: uint128
r: int32
g: int32
b: int32
a: int32
gs-packed-stq: vectorsource
gs-packed-uv: vectorsource
gs-packed-xyzw: vectorsource
gs-pmode: uint64source
gs-prim: uint64source
gs-prmode-cont: uint64source
gs-rgbaq: uint64source
gs-scissor: uint64source
gs-smode2: uint64source
gs-st: uint64source
gs-test: uint64source
gs-tex0: uint64source
gs-tex1: uint64source
gs-texa: uint64source
gs-texclut: uint64source
gs-trxdir: uint64source
gs-trxpos: uint64source
gs-trxreg: uint64source
gs-uv: uint64source
gs-xy-offset: uint64source
gs-xyz: uint64source
gs-xyzf: uint64source
gs-zbuf: uint64source
Functions
add-reg-gif-packet(arg0: gif-packet, arg1: int, arg2: int) => nonesource
Add a register + value to the packet
close-gif-packet(arg0: gif-packet, arg1: int) => gif-packetsource
Finish adding registers.
draw-context-set-xy(arg0: draw-context, arg1: int, arg2: int) => nonesource
Set the origin of the draw context.
open-gif-packet(arg0: gif-packet) => gif-packetsource
Initialize an existing gif-packet for 0 registers
psm->string(arg0: gs-psm) => stringsource
Get the name of a texture format.
psm-page-height(arg0: gs-psm) => intsource
Convert texture format to some type of page height
Variables
GIF_REGS_ALL_AD: unknownsource
Types
video-params: structuresource
Fields
set-video-mode: symbol
reset-video-mode: symbol
display-fbp: int32
relative-x-scale: float
display-dx: int32
display-dy: int32
display-sy: int32
relative-x-scale-reciprical: float
screen-pages-high: int32
Variables
Functions
get-aspect-ratio() => symbolsource
get-progressive-scan() => symbolsource
get-video-mode() => symbolsource
set-aspect-ratio(aspect: symbol) => nonesource
Set *video-params* aspect-ratio related settings based on the mode provided.
set-graphics-mode() => nonesource
TODO
set-progressive-scan(val: symbol) => nonesource
Flip the progressive scan setting flag depending on the value provided
set-video-mode(tv-format: symbol) => nonesource
Set related settings to the video mode in the settings, *video-params* and the [[*video-mode*]]
`ntsc` has a *video-mode* value of `0`, where as `pal` has a value of `1`
Will also set a bunch of common settings related to profiling and the camera to finalize the switch
`ntsc` has a *video-mode* value of `0`, where as `pal` has a value of `1`
Will also set a bunch of common settings related to profiling and the camera to finalize the switch