resonance 1.0.1
Loading...
Searching...
No Matches
gfxdevice.h File Reference
#include <vector>
#include "math/color.h"
Include dependency graph for gfxdevice.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GifQuadword
 One quadword of a packet stream. More...
class  GfxDevice
 Owner of the display, the GIF packet buffer, and the frame timing counters. More...
struct  GfxDevice::Rect
 Rectangle of four floats. More...

Namespaces

namespace  Rnd
 The rendering engine.

Functions

int DrawVSyncCB (int nCause)
 Count one vertical blank in gVCount.

Variables

constexpr int kGifBufferQuadwords = 0x1e0
 Quadwords of the packet buffer a caller may fill before it has to be submitted.
constexpr int kGsRegisterCount = 128
 GS registers the device shadows, the whole register address space.
GfxDevice Rnd::ThePs
 The display device.
volatile int gVCount
 Vertical blanks counted since start-up.
GifQuadword g_vu1MicrocodeChain []
 DMA chain that uploads the VU1 microcode, the start of the .vutext section.
GifQuadword g_vu0MicrocodeChain []
 DMA chain at the end of .vutext that uploads the VU0 microcode.

Function Documentation

◆ DrawVSyncCB()

int DrawVSyncCB ( int nCause)

Count one vertical blank in gVCount.

GfxDevice::InitDisplayMode() installs it through sceGsSyncVCallback(). The body increments the counter, runs the kernel's ExitHandler() sequence (sync, ei), and returns 0. ExitHandler() is MIPS inline assembly and assembles only with the PlayStation 2 toolchain.

Parameters
nCauseThe interrupt cause the kernel passes, unused.
Returns
0.
Ghidra address:
NTSC-U/C: 0x0049fea0
Ghidra address:
PAL: 0x004ddf28

Variable Documentation

◆ kGifBufferQuadwords

int kGifBufferQuadwords = 0x1e0
constexpr

Quadwords of the packet buffer a caller may fill before it has to be submitted.

◆ kGsRegisterCount

int kGsRegisterCount = 128
constexpr

GS registers the device shadows, the whole register address space.

◆ gVCount

volatile int gVCount
extern

Vertical blanks counted since start-up.

DrawVSyncCB() increments it. SwapBuffers() busy-waits on it, reloading it on every pass.

Ghidra address:
NTSC-U/C: 0x006f2f20
Ghidra address:
PAL: 0x00736970

◆ g_vu1MicrocodeChain

GifQuadword g_vu1MicrocodeChain[]
extern

DMA chain that uploads the VU1 microcode, the start of the .vutext section.

The chain and the microprogram it uploads are DVP assembly. The microprogram enters at VU address 0x3c0 to initialise, 0x000 and 0x4ce for textured and untextured faces, 0x1c2 for edges, and 0x258 for sprites. InitDisplayMode() sends the chain on the VIF1 channel. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00664ab0
Ghidra address:
PAL: 0x006a5640

◆ g_vu0MicrocodeChain

GifQuadword g_vu0MicrocodeChain[]
extern

DMA chain at the end of .vutext that uploads the VU0 microcode.

The chain and the microprogram it uploads are DVP assembly. InitDisplayMode() sends the chain on the VIF0 channel. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00666de0
Ghidra address:
PAL: 0x006a7970