Skip to main content

display-h

source

Types


display

display: basicsource
Fields
type: type
display-env0: display-env
display-env1: display-env
display-env2: display-env
gif-tag0: gs-gif-tag
draw0: draw-env
gif-tag1: gs-gif-tag
draw1: draw-env
gif-tag2: gs-gif-tag
draw2: draw-env
on-screen: int32
last-screen: int32
frames: virtual-frame
bg-clear-color: rgba
real-frame-counter: time-frame
base-frame-counter: time-frame
game-frame-counter: time-frame
integral-frame-counter: time-frame
real-integral-frame-counter: time-frame
actual-frame-counter: time-frame
real-actual-frame-counter: time-frame
part-frame-counter: time-frame
old-real-frame-counter: time-frame
old-base-frame-counter: time-frame
old-game-frame-counter: time-frame
old-integral-frame-counter: time-frame
old-real-integral-frame-counter: time-frame
old-actual-frame-counter: time-frame
old-real-actual-frame-counter: time-frame
old-part-frame-counter: time-frame
time-ratio: float
seconds-per-frame: float
frames-per-second: float
time-factor: float
time-adjust-ratio: float
Methods
set-time-ratios(obj: display, slowdown: float) => floatsource

Set the time ratios for the current game speed. For example, set slowdown = 1.0 if the game
is running at full speed or slowdown = 2.0 if the game is running at half speed.

display-env

display-env: structuresource
Fields
pmode: gs-pmode
smode2: gs-smode2
dspfb: gs-display-fb
display: gs-display
bgcolor: gs-bgcolor

display-frame

display-frame: basicsource
Fields
type: type
calc-buf: dma-buffer
vu1-buf: dma-buffer
debug-buf: dma-buffer
global-buf: dma-buffer
bucket-group: inline-array
buffer: dma-buffer
profile-bar: profile-bar
run-time: int64

draw-env

draw-env: structuresource
Fields
frame1: gs-frame
frame1addr: gs-reg64
zbuf1: gs-zbuf
zbuf1addr: gs-reg64
xyoffset1: gs-xy-offset
xyoffset1addr: gs-reg64
scissor1: gs-scissor
scissor1addr: gs-reg64
prmodecont: gs-prmode-cont
prmodecontaddr: gs-reg64
colclamp: gs-color-clamp
colclampaddr: gs-reg64
dthe: gs-dthe
dtheaddr: gs-reg64
test1: gs-test
test1addr: gs-reg64

virtual-frame

virtual-frame: structuresource
Fields
display: display-env
display-last: display-env
gif: pointer
draw: draw-env
frame: display-frame

Functions


put-draw-env

put-draw-env(packet: pointer) => nonesource

Begin DMA transfer to the GIF/GS to send a draw env packet.
The length of the transfer is taken from the nloop field of the tag.

Variables


*post-draw-hook*

*post-draw-hook*: functionsource

*pre-draw-hook*

*pre-draw-hook*: functionsource

display

source

Functions


allocate-dma-buffers

allocate-dma-buffers(arg0: display) => displaysource

Allocate the main DMA buffers!

draw-quad2d

draw-quad2d(buf: dma-buffer, context: draw-context) => nonesource

Draw a quad that fills the entire context

draw-sprite2d-xy

draw-sprite2d-xy(buf: dma-buffer, x: int, y: int, w: int, h: int, color: rgba) => nonesource

Draw a sprite primitive with the given color and dimensions.

get-current-time

get-current-time() => time-framesource

Get the in game time. This advances when the game is unpaused.
This increases at the same rate for PAL/NTSC and if the game is lagging.

get-integral-current-time

get-integral-current-time() => time-framesource

Get the game time as a number of frames. This advances at different rates for PAL/NTSC.
This counts the number of actual vsyncs done by the PS2, including ones that are missed due to lag.

put-display-alpha-env

put-display-alpha-env(arg0: display-env) => nonesource

Set display1 and dspfb1 directly, right now.
This is unused.

reset-display-gs-state

reset-display-gs-state(disp: display, dma-buf: dma-buffer, oddeven: int) => displaysource

Set the gs state back to something reasonable

screen-gradient

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

set-display(disp: display, psm: int, w: int, h: int, ztest: int, zpsm: int) => displaysource

Set up the entire display structure, both draw and display envs

set-display-env

set-display-env(env: display-env, psm: int, width: int, height: int, dx: int, dy: int, fbp: int) => display-envsource

Set the commonly used parameters of a display env.
psm: texture format
width/height: dimensions of the framebuffer
dx/dy: location on the TV screen
fpb: the framebuffer.

set-display-gs-state

set-display-gs-state(dma-buf: dma-buffer, fbp: int, scx: int, scy: int, fb-msk: int, psm: int) => dma-buffersource

Set various gs state registers

set-display-gs-state-offset

set-display-gs-state-offset(dma-buf: dma-buffer, fbp: int, width: int, height: int, fb-msk: int, psm: int, off-x: int, off-y: int) => dma-buffersource

Set various gs state registers

set-display2

set-display2(disp: display, psm: int, w: int, h: int, ztest: int, zpsm: int) => displaysource

Set the display and draw envs only. This assumes you have already done a set-display and you just need to update the video mode.

set-draw-env

set-draw-env(env: draw-env, psm: int, width: int, height: int, ztest: int, zpsm: int, fbp: int) => draw-envsource

Set parameters of the draw env

set-draw-env-offset

set-draw-env-offset(env: draw-env, x: int, y: int, arg3: int) => draw-envsource

Set the drawing offset (origin of the WCS).
The input x and y should be in pixels to the center of the scissoring area
The width/height of the window are taken from the scissoring settings.
It is assumed that scax0 and scay0 are set to 0.
To center things in the usual way, call with 2048, 2048, even/odd

vif1-handler-debug

vif1-handler-debug() => nonesource

Variables


*display*

*display*: displaysource

*font-context*

*font-context*: font-contextsource

*oddeven*

*oddeven*: intsource

*pause-context*

*pause-context*: font-contextsource

*profile-h*

*profile-h*: intsource

*profile-ticks*

*profile-ticks*: symbolsource

*profile-w*

*profile-w*: intsource

*profile-x*

*profile-x*: intsource

*profile-y*

*profile-y*: intsource

*vu0-dma-list*

*vu0-dma-list*: dma-buffersource

DISPLAY_FPS_RATIO

DISPLAY_FPS_RATIO: unknownsource

DMA_BUFFER_DEBUG_SIZE

const DMA_BUFFER_DEBUG_SIZE: unknownsource

DMA_BUFFER_GLOBAL_SIZE

const DMA_BUFFER_GLOBAL_SIZE: unknownsource

Types


draw-context

draw-context: basicsource
Fields
type: type
orgx: int32
orgy: int32
orgz: int32
width: int32
height: int32
color: rgba

gif-bank

gif-bank: structuresource
Fields
ctrl: gif-ctrl
mode: gif-mode
stat: gif-stat
tag0: uint32
tag1: uint32
tag2: uint32
tag3: uint32
cnt: gif-cnt
p3cnt: gif-p3cnt
p3tag: gif-p3tag

gif-cnt

gif-cnt: uint32source

gif-ctrl

gif-ctrl: uint32source

gif-mode

gif-mode: uint32source

gif-p3cnt

gif-p3cnt: uint32source

gif-p3tag

gif-p3tag: uint32source

gif-packet

gif-packet: basicsource
Fields
type: type
reg-count: int32
gif-tag: gs-gif-tag
gif-tag0: uint128
args: uint64

gif-stat

gif-stat: uint32source

gif-tag

gif-tag: uint128source

gif-tag-count

gif-tag-count: uint32source

gif-tag-prim

gif-tag-prim: uint32source

gif-tag-regs

gif-tag-regs: uint64source

gif-tag64

gif-tag64: uint64source

gs-alpha

gs-alpha: uint64source

gs-bank

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

gs-bgcolor: uint64source

gs-bitbltbuf

gs-bitbltbuf: uint64source

gs-clamp

gs-clamp: uint64source

gs-color-clamp

gs-color-clamp: uint64source

gs-csr

gs-csr: uint64source

gs-display

gs-display: uint64source

gs-display-fb

gs-display-fb: uint64source

gs-dthe

gs-dthe: uint64source

gs-fog

gs-fog: uint64source

gs-fogcol

gs-fogcol: uint64source

gs-frame

gs-frame: uint64source

gs-gif-tag

gs-gif-tag: structuresource
Fields
qword: uint128
tag: gif-tag64
regs: gif-tag-regs
dword: uint64
word: uint32

gs-miptbp

gs-miptbp: uint64source

gs-pmode

gs-pmode: uint64source

gs-prim

gs-prim: uint64source

gs-prmode-cont

gs-prmode-cont: uint64source

gs-rgbaq

gs-rgbaq: uint64source

gs-scissor

gs-scissor: uint64source

gs-smode2

gs-smode2: uint64source

gs-st

gs-st: uint64source

gs-test

gs-test: uint64source

gs-tex0

gs-tex0: uint64source

gs-tex1

gs-tex1: uint64source

gs-texa

gs-texa: uint64source

gs-texclut

gs-texclut: uint64source

gs-trxdir

gs-trxdir: uint64source

gs-trxpos

gs-trxpos: uint64source

gs-trxreg

gs-trxreg: uint64source

gs-uv

gs-uv: uint64source

gs-xy-offset

gs-xy-offset: uint64source

gs-xyz

gs-xyz: uint64source

gs-xyzf

gs-xyzf: uint64source

gs-zbuf

gs-zbuf: uint64source

Functions


add-reg-gif-packet

add-reg-gif-packet(packet: gif-packet, reg-idx: int, reg-val: int) => nonesource

Add a register to the packet

close-gif-packet

close-gif-packet(arg0: gif-packet, eop: int) => gif-packetsource

Finish adding registers.

default-buffer-init

default-buffer-init(buff: dma-buffer) => nonesource

Set some GS registers back to default values. Ends with a ret dma-tag.
This is intended to live in its own separate dma-buffer and not be added
to the global buffer. Calling this will reset this dma-buffer.

draw-context-set-xy

draw-context-set-xy(arg0: draw-context, x: int, y: int) => nonesource

Set the origin of the draw context, scaling by relative-y-scale as needed.

open-gif-packet

open-gif-packet(arg0: gif-packet) => gif-packetsource

Initialize an existing gif-packet for 0 registers

psm->string

psm->string(arg0: gs-psm) => stringsource

Get the name of a texture format.

psm-page-height

psm-page-height(arg0: gs-psm) => intsource

Convert texture format to some type of page height

psm-size

psm-size(arg0: gs-psm) => intsource

Convert texture format to some type of size.

Variables


*default-regs-buffer*

*default-regs-buffer*: dma-buffersource

*fog-color*

*fog-color*: rgbasource

video-h

source

Types


video-parms

video-parms: structuresource
Fields
set-video-mode: basic
reset-video-mode: basic
screen-sy: int32
screen-hy: int32
screen-miny: int32
screen-maxy: int32
screen-masky: int32
display-dx: int32
display-dy: int32
screen-pages-high: int32
_pad: int64
relative-x-scale: float
relative-y-scale: float
_pad2: int64
relative-x-scale-reciprical: float
relative-y-scale-reciprical: float

Variables


*video-parms*

*video-parms*: video-parmssource

Functions


get-aspect-ratio

get-aspect-ratio() => symbolsource

get-video-mode

get-video-mode() => symbolsource

set-aspect-ratio

set-aspect-ratio(arg0: symbol) => nonesource

set-video-mode

set-video-mode(arg0: symbol) => nonesource