|
resonance 1.0.1
|
The display and draw environments of a double-buffered framebuffer. More...
#include <gsdoublebuffer.h>

Classes | |
| struct | DispEnv |
| One display environment, 0x40 bytes. More... | |
| struct | DrawHalf |
| One draw environment preceded by its GIFtag and followed by its clear, 0xf0 bytes. More... | |
Public Member Functions | |
| 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. | |
Public Attributes | |
| DispEnv | mDisp [2] |
| Display environments of the two halves. | |
| DrawHalf | mHalves [2] |
| Draw environments of the two halves. | |
| unsigned char | mReserved260 [8] |
| short | mWidth |
| Width SetDefaults() recorded. | |
| short | mHeight |
| Height SetDefaults() recorded. | |
| short | mPsm |
| Frame buffer pixel storage format SetDefaults() recorded. | |
| short | mFbp0 |
| Page of buffer 0, always zero. | |
| short | mFbp1 |
| Page of buffer 1, the pages one buffer occupies. | |
| short | mZPsm |
| Depth buffer pixel storage format SetDefaults() recorded. | |
| short | mZbp |
| Page of the depth buffer, twice mFbp1. | |
The display and draw environments of a double-buffered framebuffer.
This is the game's own structure rather than the SDK's sceGsDBuff. The SDK setter at 0x005e4b30 takes its arguments as (psm, w, h, ztest, zpsm, clear) and fills a 0x230-byte sceGsDBuff, whereas SetDefaults() takes (w, h, psm, ztest, zpsm, clear) and fills a structure whose draw halves begin at +0x80 and +0x170 and which records its parameters from +0x268 on. The extra room at the front comes from each display environment recording a second pair of display registers for read circuit 1 beside the SDK's pair for read circuit 2.
The two read circuits show the same buffer one line apart, and PMODE blends them at half strength. SetDispBuffers() builds both pairs.
The class is not polymorphic and has no RTTI, and no literal in the image identifies it. Its name and the names of its members are inferred from what the routines below do with it. GfxDevice addresses the one instance at an uncached address and reads the draw environments and the depth buffer page directly with no accessor. The data members are therefore public.
| void GsDoubleBuffer::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.
Records the geometry, places buffer 0 at page 0, buffer 1 after it, and the depth buffer after both, then builds the display and draw environments. The page count assumes 4 bytes per pixel for any format other than PSMCT24 and PSMCT16.
| nWidth | Width in pixels. |
| nHeight | Height in pixels. |
| nPsm | Pixel storage format of the frame buffers. |
| nZTest | Depth test, where zero also masks depth writes. |
| nZPsm | Pixel storage format of the depth buffer. |
| nClear | Passed through to SetDrawBuffersSmall() and never read. |
| DispEnv GsDoubleBuffer::mDisp[2] |
Display environments of the two halves.
+0x000
| DrawHalf GsDoubleBuffer::mHalves[2] |
Draw environments of the two halves.
+0x080
| unsigned char GsDoubleBuffer::mReserved260[8] |
| short GsDoubleBuffer::mWidth |
Width SetDefaults() recorded.
+0x268
| short GsDoubleBuffer::mHeight |
Height SetDefaults() recorded.
+0x26a
| short GsDoubleBuffer::mPsm |
Frame buffer pixel storage format SetDefaults() recorded.
+0x26c
| short GsDoubleBuffer::mFbp0 |
Page of buffer 0, always zero.
+0x26e
| short GsDoubleBuffer::mFbp1 |
Page of buffer 1, the pages one buffer occupies.
+0x270
| short GsDoubleBuffer::mZPsm |
Depth buffer pixel storage format SetDefaults() recorded.
+0x272
| short GsDoubleBuffer::mZbp |
Page of the depth buffer, twice mFbp1.
GfxDevice::GetReservedVramWords() reads it to find where the buffers end. +0x274