From 8cfe49295f105506a270ff350a9ea717e8af2172 Mon Sep 17 00:00:00 2001 From: Techjar Date: Mon, 31 May 2021 16:31:27 -0400 Subject: VideoCommon: Add fallback handling for bounding box when disabled or unsupported The SDK seems to write "default" bounding box values before every draw (1023 0 1023 0 are the only values encountered so far, which happen to be the extents allowed by the BP registers) to reset the registers for comparison in the pixel engine, and presumably to detect whether GX has updated the registers with real values. Handling these writes and returning them on read when bounding box emulation is disabled or unsupported, even without computing real values from rendering, seems to prevent games from corrupting memory or crashing. This obviously does not fix any effects that rely on bounding box emulation, but having the game not clobber its own code/data or just outright crash is a definite improvement. --- Source/Core/VideoCommon/VideoBackendBase.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp') diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index 2f7e92664a..f38601dcd7 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -168,10 +168,8 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index) "for this game."); } warn_once = false; - return 0; } - - if (!g_ActiveConfig.backend_info.bSupportsBBox) + else if (!g_ActiveConfig.backend_info.bSupportsBBox) { static bool warn_once = true; if (warn_once) @@ -182,7 +180,6 @@ u16 VideoBackendBase::Video_GetBoundingBox(int index) "freezes while running this game."); } warn_once = false; - return 0; } Fifo::SyncGPU(Fifo::SyncGPUReason::BBox); -- cgit v1.2.3