resonance 1.0.1
Loading...
Searching...
No Matches
gsdoublebuffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <libgraph.h>
4
24public:
26 struct DispEnv {
28 sceGsDispEnv mEnv;
30 unsigned long long mDispFb1;
32 unsigned long long mDisplay1;
33 // The stride between the two environments is 0x40, and nothing reads this word.
34 unsigned long long mReserved38; // +0x38
35 };
36
38 struct DrawHalf {
43 sceGifTag mGifTag;
45 sceGsDrawEnv1 mDraw;
47 sceGsClear mClear;
48 };
49
66 void
67 SetDefaults(short nWidth, short nHeight, short nPsm, short nZTest, short nZPsm, short nClear);
68
73 // Nothing in the image reads or writes this span.
74 unsigned char mReserved260[8]; // +0x260
76 short mWidth;
78 short mHeight;
80 short mPsm;
82 short mFbp0;
84 short mFbp1;
86 short mZPsm;
92 short mZbp;
93};
94
112 GsDoubleBuffer *pBuffers, short nWidth, short nHeight, short nPsm, short nFbp0, short nFbp1);
113
131 short nWidth,
132 short nHeight,
133 short nPsm,
134 short nFbp0,
135 short nFbp1,
136 short nZbp,
137 short nZTest,
138 short nZPsm,
139 short nClear);
140
153void PutDrawBufferSmall(GsDoubleBuffer *pBuffers, int nHalf, int bClear);
154
167void PutDispBuffer(GsDoubleBuffer *pBuffers, int nHalf, int bEnableCircuit1);
The display and draw environments of a double-buffered framebuffer.
Definition gsdoublebuffer.h:23
DrawHalf mHalves[2]
Draw environments of the two halves.
Definition gsdoublebuffer.h:72
short mFbp1
Page of buffer 1, the pages one buffer occupies.
Definition gsdoublebuffer.h:84
unsigned char mReserved260[8]
Definition gsdoublebuffer.h:74
short mPsm
Frame buffer pixel storage format SetDefaults() recorded.
Definition gsdoublebuffer.h:80
short mZPsm
Depth buffer pixel storage format SetDefaults() recorded.
Definition gsdoublebuffer.h:86
void SetDefaults(short nWidth, short nHeight, short nPsm, short nZTest, short nZPsm, short nClear)
Fill both halves for a framebuffer and a depth buffer laid out from page 0.
short mFbp0
Page of buffer 0, always zero.
Definition gsdoublebuffer.h:82
DispEnv mDisp[2]
Display environments of the two halves.
Definition gsdoublebuffer.h:70
short mHeight
Height SetDefaults() recorded.
Definition gsdoublebuffer.h:78
short mWidth
Width SetDefaults() recorded.
Definition gsdoublebuffer.h:76
short mZbp
Page of the depth buffer, twice mFbp1.
Definition gsdoublebuffer.h:92
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.
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.
One display environment, 0x40 bytes.
Definition gsdoublebuffer.h:26
sceGsDispEnv mEnv
The SDK environment PutDispBuffer() writes to read circuit 2.
Definition gsdoublebuffer.h:28
unsigned long long mDisplay1
DISPLAY1, the circuit 1 display rectangle.
Definition gsdoublebuffer.h:32
unsigned long long mDispFb1
DISPFB1, the circuit 1 frame buffer.
Definition gsdoublebuffer.h:30
unsigned long long mReserved38
Definition gsdoublebuffer.h:34
One draw environment preceded by its GIFtag and followed by its clear, 0xf0 bytes.
Definition gsdoublebuffer.h:38
sceGifTag mGifTag
A+D tag whose loop count PutDrawBufferSmall() sets to include or exclude the clear.
Definition gsdoublebuffer.h:43
sceGsClear mClear
The register writes that clear the buffer.
Definition gsdoublebuffer.h:47
sceGsDrawEnv1 mDraw
FRAME_1, ZBUF_1, XYOFFSET_1, and the rest of the context 1 registers.
Definition gsdoublebuffer.h:45