Screenshots: Take the game image while the game is on a TV

An output screenshot reads back the device's own screen, which only has
the touch controls on it then.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-22 23:07:10 +02:00
1 parent 080470d041
commit ba55ee7e5f
9 files changed
+23

No files matched your search

+3
View File
@@ -526,6 +526,9 @@ void TakeUserScreenshot() {
if (GetUIState() != UISTATE_INGAME) {
// We're out in the UI, no game. The only type of screenshot available is output.
type = ScreenshotType::Output;
} else if (gpu && gpu->PresentsToOtherOutput()) {
// The game is on a TV. The device's own screen only has the controls on it.
type = ScreenshotType::Display;
}
// Close any active popups, so they don't end up in the screenshot.
+4
View File
@@ -132,6 +132,10 @@ void FramebufferManagerCommon::SetPresentationOutput(const OutputParams *output)
presentation_->SetOutputOverride(output);
}
bool FramebufferManagerCommon::PresentsToOtherOutput() const {
return presentation_->HasOutputOverride();
}
void FramebufferManagerCommon::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) {
displayFramebufPtr_ = framebuf & 0x3FFFFFFF;
if (Memory::IsVRAMAddress(displayFramebufPtr_))
+1
View File
@@ -525,6 +525,7 @@ public:
bool PresentedThisFrame() const;
void SetPresentationOutput(const OutputParams *output);
bool PresentsToOtherOutput() const;
const std::vector<VirtualFramebuffer *> &GetVFBs() const {
return vfbs_;
+3
View File
@@ -129,6 +129,9 @@ public:
restorePostShader_ = true;
}
}
bool HasOutputOverride() const {
return hasOutputOverride_;
}
OutputParams GetOutput() const {
return hasOutputOverride_ ? outputOverride_ : PrimaryOutputParams(pixelWidth_, pixelHeight_);
}
+2
View File
@@ -156,6 +156,8 @@ public:
// Presents the display to another output than the primary one, until called with nullptr. Set it
// before PrepareCopyDisplayToOutput, which lays out for it.
virtual void SetPresentationOutput(const OutputParams *output) {}
// Whether the game goes to another output than the primary (SetPresentationOutput), like a TV.
virtual bool PresentsToOtherOutput() const { return false; }
// Invalidate any cached content sourced from the specified range.
// If size = -1, invalidate everything.
+4
View File
@@ -525,6 +525,10 @@ void GPUCommonHW::SetPresentationOutput(const OutputParams *output) {
framebufferManager_->SetPresentationOutput(output);
}
bool GPUCommonHW::PresentsToOtherOutput() const {
return framebufferManager_->PresentsToOtherOutput();
}
void GPUCommonHW::DoState(PointerWrap &p) {
GPUCommon::DoState(p);
+1
View File
@@ -72,6 +72,7 @@ public:
bool PresentedThisFrame() const override;
void SetPresentationOutput(const OutputParams *output) override;
bool PresentsToOtherOutput() const override;
private:
void CheckDepthUsage(VirtualFramebuffer *vfb) override;
+4
View File
@@ -726,6 +726,10 @@ void SoftGPU::SetPresentationOutput(const OutputParams *output) {
}
}
bool SoftGPU::PresentsToOtherOutput() const {
return presentation_ && presentation_->HasOutputOverride();
}
void SoftGPU::MarkDirty(uint32_t addr, uint32_t stride, uint32_t height, GEBufferFormat fmt, SoftGPUVRAMDirty value) {
uint32_t bytes = height * stride * (fmt == GE_FORMAT_8888 ? 4 : 2);
MarkDirty(addr, bytes, value);
+1
View File
@@ -257,6 +257,7 @@ public:
void BeginHostFrame(const DisplayLayoutConfig &config) override;
bool PresentedThisFrame() const override;
void SetPresentationOutput(const OutputParams *output) override;
bool PresentsToOtherOutput() const override;
protected:
void FastRunLoop(DisplayList &list) override;