resonance 1.0.1
Loading...
Searching...
No Matches
gsdoublebuffer.h File Reference
#include <libgraph.h>
Include dependency graph for gsdoublebuffer.h:

Go to the source code of this file.

Classes

class  GsDoubleBuffer
 The display and draw environments of a double-buffered framebuffer. More...
struct  GsDoubleBuffer::DispEnv
 One display environment, 0x40 bytes. More...
struct  GsDoubleBuffer::DrawHalf
 One draw environment preceded by its GIFtag and followed by its clear, 0xf0 bytes. More...

Functions

void SetDispBuffers (GsDoubleBuffer *pBuffers, short nWidth, short nHeight, short nPsm, short nFbp0, short nFbp1)
 Build both display environments.
void SetDrawBuffersSmall (GsDoubleBuffer *pBuffers, short nWidth, short nHeight, short nPsm, short nFbp0, short nFbp1, short nZbp, short nZTest, short nZPsm, short nClear)
 Build both draw environments, their GIFtags, and their clears.
void PutDrawBufferSmall (GsDoubleBuffer *pBuffers, int nHalf, int bClear)
 Send one draw environment to the GS through the SDK.
void PutDispBuffer (GsDoubleBuffer *pBuffers, int nHalf, int bEnableCircuit1)
 Write one display environment to the privileged GS registers.

Function Documentation

◆ SetDispBuffers()

void SetDispBuffers ( GsDoubleBuffer * pBuffers,
short nWidth,
short nHeight,
short nPsm,
short nFbp0,
short nFbp1 )

Build both display environments.

Each takes the SDK defaults with PMODE blending at 0x80 and both circuits enabled. Circuit 1 shows the buffer as the SDK set it, and circuit 2 starts one line lower, one line shorter, and two units to the right.

Parameters
pBuffersThe double buffer.
nWidthWidth in pixels.
nHeightHeight in pixels.
nPsmPixel storage format.
nFbp0Page of buffer 0.
nFbp1Page of buffer 1.
Ghidra address:
NTSC-U/C: 0x0058e330
Ghidra address:
PAL: 0x005d1688

◆ SetDrawBuffersSmall()

void SetDrawBuffersSmall ( GsDoubleBuffer * pBuffers,
short nWidth,
short nHeight,
short nPsm,
short nFbp0,
short nFbp1,
short nZbp,
short nZTest,
short nZPsm,
short nClear )

Build both draw environments, their GIFtags, and their clears.

Parameters
pBuffersThe double buffer.
nWidthWidth in pixels.
nHeightHeight in pixels.
nPsmPixel storage format of the frame buffers.
nFbp0Page of buffer 0.
nFbp1Page of buffer 1.
nZbpPage of the depth buffer.
nZTestDepth test, where zero also masks depth writes.
nZPsmPixel storage format of the depth buffer.
nClearNever read. The caller passes it in the tenth argument slot on the stack.
Ghidra address:
NTSC-U/C: 0x0058e538
Ghidra address:
PAL: 0x005d1890

◆ PutDrawBufferSmall()

void PutDrawBufferSmall ( GsDoubleBuffer * pBuffers,
int nHalf,
int bClear )

Send one draw environment to the GS through the SDK.

Both GIFtags receive the loop count first. The choice of clear therefore persists into the other half.

Parameters
pBuffersThe double buffer.
nHalfZero for half 0, anything else for half 1.
bClearNon-zero to send the clear with the environment.
Ghidra address:
NTSC-U/C: 0x0058e7e8
Ghidra address:
PAL: 0x005d1b40

◆ PutDispBuffer()

void PutDispBuffer ( GsDoubleBuffer * pBuffers,
int nHalf,
int bEnableCircuit1 )

Write one display environment to the privileged GS registers.

Read circuit 2 is always enabled. Circuit 1 is enabled or disabled by bEnableCircuit1, and the choice is stored back into the environment.

Parameters
pBuffersThe double buffer.
nHalfZero for half 0, anything else for half 1.
bEnableCircuit1Non-zero to enable read circuit 1.
Ghidra address:
NTSC-U/C: 0x0058e860
Ghidra address:
PAL: 0x005d1bb8