wavelength 1.0.0
Loading...
Searching...
No Matches
gsdoublebuffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <libgraph.h>
4
22public:
24 struct DispEnv {
26 sceGsDispEnv mEnv;
28 unsigned long long mDispFb1;
30 unsigned long long mDisplay1;
31 // The stride between the two environments is 0x40, and nothing reads this word.
32 unsigned long long mReserved38; // +0x38
33 };
34
36 struct DrawHalf {
41 sceGifTag mGifTag;
43 sceGsDrawEnv1 mDraw;
45 sceGsClear mClear;
46 };
47
60 void SetBufferPages(short nWidth, short nHeight, short nPsm);
61
77 void
78 SetDefaults(short nWidth, short nHeight, short nPsm, short nZTest, short nZPsm, short nClear);
79
95 void SetDispBuffers(short nWidth, short nHeight, short nPsm, short nFbp0, short nFbp1);
96
112 void SetDrawBuffersSmall(short nWidth,
113 short nHeight,
114 short nPsm,
115 short nFbp0,
116 short nFbp1,
117 short nZbp,
118 short nZTest,
119 short nZPsm,
120 short nClear);
121
133 void PutDispBuffer(int nHalf, int bEnableCircuit1);
134
146 void PutDrawBufferSmall(int nHalf, int bClear);
147
149
151 short GetZbp() const {
152 return mZbp;
153 }
154
161 DrawHalf &GetHalf(int nHalf) {
162 return mHalves[nHalf];
163 }
164
171 const DrawHalf &GetHalf(int nHalf) const {
172 return mHalves[nHalf];
173 }
174
175private:
176 DispEnv mDisp[2];
177
179 DrawHalf mHalves[2];
180
181 // Nothing in the image reads or writes this span.
182 unsigned char mReserved260[8]; // +0x260
183
185 short mWidth;
186
188 short mHeight;
189
191 short mPsm;
192
194 short mFbp0;
195
197 short mFbp1;
198
200 short mZPsm;
201
207 short mZbp;
208};
The display and draw environments of a double-buffered framebuffer.
Definition gsdoublebuffer.h:21
void SetDispBuffers(short nWidth, short nHeight, short nPsm, short nFbp0, short nFbp1)
Build both display environments.
void PutDispBuffer(int nHalf, int bEnableCircuit1)
Write one display environment to the privileged GS registers.
void SetDrawBuffersSmall(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.
DrawHalf & GetHalf(int nHalf)
Report one of the two buffers.
Definition gsdoublebuffer.h:161
void SetBufferPages(short nWidth, short nHeight, short nPsm)
Place buffer 0 at page 0, buffer 1 after it, and the depth buffer after both.
short GetZbp() const
Display environments of the two halves.
Definition gsdoublebuffer.h:151
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.
const DrawHalf & GetHalf(int nHalf) const
Report one of the two buffers.
Definition gsdoublebuffer.h:171
void PutDrawBufferSmall(int nHalf, int bClear)
Send one draw environment to the GS through the SDK.
One display environment, 0x40 bytes.
Definition gsdoublebuffer.h:24
sceGsDispEnv mEnv
The SDK environment PutDispBuffer() writes to read circuit 2.
Definition gsdoublebuffer.h:26
unsigned long long mDisplay1
DISPLAY1, the circuit 1 display rectangle.
Definition gsdoublebuffer.h:30
unsigned long long mDispFb1
DISPFB1, the circuit 1 frame buffer.
Definition gsdoublebuffer.h:28
unsigned long long mReserved38
Definition gsdoublebuffer.h:32
One draw environment preceded by its GIFtag and followed by its clear, 0xf0 bytes.
Definition gsdoublebuffer.h:36
sceGifTag mGifTag
A+D tag whose loop count PutDrawBufferSmall() sets to include or exclude the clear.
Definition gsdoublebuffer.h:41
sceGsClear mClear
The register writes that clear the buffer.
Definition gsdoublebuffer.h:45
sceGsDrawEnv1 mDraw
FRAME_1, ZBUF_1, XYOFFSET_1, and the rest of the context 1 registers.
Definition gsdoublebuffer.h:43