22 unsigned long long mLo;
23 unsigned long long mHi;
141 void Init(
int nWidth,
int nHeight,
int nBitDepth);
216 void SetGsReg(
int nReg,
unsigned long long qwValue,
unsigned long long qwMask);
401#ifdef VIDEO_STANDARD_PAL
495 static void DrawDebugText(
const char *pszText,
const Rect &rect,
const Color &color);
506 static void DrawTimingBar(
const Rect &rect,
const Color &color);
517 void DrawFpsReadout();
555 unsigned char mReserved484[0x0c];
Owner of the display, the GIF packet buffer, and the frame timing counters.
Definition gfxdevice.h:38
int mnUseVu1
Non-zero while geometry is submitted through VU1 rather than the software path.
Definition gfxdevice.h:440
void SavePacket()
Wait for the GIF and VIF1 channels to stop, then copy the packet into mSavedPacket.
int mnSwapVblank
Vertical blank count before which SwapBuffers() does not show the next frame.
Definition gfxdevice.h:429
int mnDisplayHeight
Display height in pixels.
Definition gfxdevice.h:412
int mnDisplayWidth
Display width in pixels, as Init() recorded it.
Definition gfxdevice.h:410
void SetGsReg(int nReg, unsigned long long qwValue, unsigned long long qwMask)
Set the masked part of one GS register, unless it already agrees.
GifQuadword * mpReservedRegion
Start of the reserved region, or null when none is open.
Definition gfxdevice.h:396
int mFeedbackInset
Inset of the texture window at both corners, in sixteenths of a texel.
Definition gfxdevice.h:552
int GetReservedVramWords() const
Words of video memory the display and depth buffers occupy.
GifQuadword * mpOpenVifDirect
First quadword after the VIF DIRECT code that WriteGifTag() opened, or null.
Definition gfxdevice.h:448
int mnDrawBuffer
Half of the double buffer being drawn, which RestoreFrameBufferTarget() selects by.
Definition gfxdevice.h:432
void EnterVu1Path()
Route later packets through VIF1 and VU1 rather than straight to the GIF.
void DrawRenderStatsOverlay()
Draw the render statistics as debug text.
void SwapGifWrite()
Exchange the write pointer with the one the reservation preserved.
void Terminate()
Restore the base render class factories that Init() replaced.
unsigned long long mGsRegs[kGsRegisterCount]
Last value written to each GS register, indexed by register number.
Definition gfxdevice.h:424
GifQuadword * mpSavedWrite
Write pointer preserved across a reservation.
Definition gfxdevice.h:394
Rect mFeedbackRect
Rectangle SetupGsDrawContext() draws and samples, in fractions of the display.
Definition gfxdevice.h:540
void WriteGifTag(const GifQuadword *pTag)
Start a GIFtag at the write pointer.
void FlipFrameBuffer()
Put the draw environment of the current half, then run SwapBuffers().
void PresentFrame(int nSwapBuffers)
Finish a frame and show it.
void RestoreFrameBufferTarget()
Point FRAME_1 and XYOFFSET_1 back at the display buffer being drawn.
void Init(int nWidth, int nHeight, int nBitDepth)
Bring up the display and the drawing subsystems.
void InitDisplayMode()
Program the GS display registers for the recorded geometry.
std::vector< GifQuadword > mSavedPacket
Copy of the packet under construction, filled by SavePacket().
Definition gfxdevice.h:398
float mFeedbackAlpha
Blend factor SetupGsDrawContext() writes into ALPHA_1 FIX after scaling it by 128.
Definition gfxdevice.h:546
void SetupGsDrawContext()
Blend the displayed frame back over the frame being drawn.
~GfxDevice()
Undo what Init() installs.
Definition gfxdevice.h:75
void RestorePacket()
Copy mSavedPacket back over the packet buffer, for the length SavePacket() used.
void DrawSubsystemTimingGraph(int nFullScaleMs)
Draw one bar per profiler timer, scaled against a full-scale time.
int FlushGifPacket(int bRetainOpenTag, int bOnlyWhenFull)
Send the assembled packet and move to the other scratchpad half.
GifQuadword * mpWrite
Where the next quadword is written.
Definition gfxdevice.h:390
GsDoubleBuffer * mpDisplayBuffers
Double buffer InitDisplayMode() builds at 0x006f36c0, addressed through its uncached alias.
Definition gfxdevice.h:438
GfxDevice()
Construct the device with an empty packet and the default feedback and clear settings.
void ReserveGifSpace(int nQuadwords)
Divert writes into a region carved off the end of the packet buffer.
int mFeedbackEnabled
Non-zero while the feedback effect is enabled, stored as a whole word.
Definition gfxdevice.h:534
int mnDepthBytes
Depth buffer bytes per sample, which InitDisplayMode() derives from mnPixelBytes.
Definition gfxdevice.h:420
int mnPixelBytes
Framebuffer bytes per pixel, the Init() bit depth divided by 8.
Definition gfxdevice.h:414
void FlushReservedGif()
Copy the reserved region into the main stream and close the reservation.
void BeginFrame()
Start a frame.
void SetClearColor(const Color &color)
Record the colour both halves of the double buffer clear to.
void ResetVramAndSavePacket()
Release every video memory record and save the packet under construction.
void LeaveVu1Path()
Return to sending packets straight to the GIF.
GifQuadword mAdTag
A+D GIFtag SetGsReg() opens when the open tag is not already an A+D tag.
Definition gfxdevice.h:422
void CloseGifTag(int bEndOfPacket)
Fill in the loop count of the open GIFtag, and optionally end the packet.
GifQuadword * mpOpenTag
GIFtag whose loop count is still to be filled in, or null when none is open.
Definition gfxdevice.h:400
GifQuadword * mpBuffer
Scratchpad half currently being filled.
Definition gfxdevice.h:392
The display and draw environments of a double-buffered framebuffer.
Definition gsdoublebuffer.h:23
GifQuadword g_vu1MicrocodeChain[]
DMA chain that uploads the VU1 microcode, the start of the .vutext section.
int DrawVSyncCB(int nCause)
Count one vertical blank in gVCount.
volatile int gVCount
Vertical blanks counted since start-up.
GifQuadword g_vu0MicrocodeChain[]
DMA chain at the end of .vutext that uploads the VU0 microcode.
constexpr int kGsRegisterCount
GS registers the device shadows, the whole register address space.
Definition gfxdevice.h:13
constexpr int kGifBufferQuadwords
Quadwords of the packet buffer a caller may fill before it has to be submitted.
Definition gfxdevice.h:10
The rendering engine.
Definition animhelper.h:3
GfxDevice ThePs
The display device.
Linear colour with four float components.
Definition color.h:10
Rectangle of four floats.
Definition gfxdevice.h:50
float y
Definition gfxdevice.h:52
float x
Definition gfxdevice.h:51
float w
Definition gfxdevice.h:53
float h
Definition gfxdevice.h:54
One quadword of a packet stream.
Definition gfxdevice.h:21
unsigned long long mHi
Definition gfxdevice.h:23
unsigned long long mLo
Definition gfxdevice.h:22