From 34108551da7d22489f0486fb2175b8784ff8cc4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Feb 2026 14:04:05 +0100 Subject: [PATCH 1/2] Fix a problem with copies to RAM - forgot to set up the copy dest rectangle Fixes #21187 --- GPU/Common/FramebufferManagerCommon.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 9c4792b4cd..f5d009a8c2 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -2636,7 +2636,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst if (bpp == 4) { // Only one possibility unless it's doing split pixel tricks (which we could detect through stride maybe). ramFormat = GE_FORMAT_8888; - } else if (srcRect.vfb->fb_format != GE_FORMAT_8888) { + } else if (srcRect.vfb && srcRect.vfb->fb_format != GE_FORMAT_8888) { // We guess that the game will interpret the data the same as it was in the source of the copy. // Seems like a likely good guess, and works in Test Drive Unlimited. ramFormat = srcRect.vfb->fb_format; @@ -2645,10 +2645,15 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst ramFormat = GE_FORMAT_5551; } dstRect.vfb = CreateRAMFramebuffer(dstBasePtr, width, height, dstStride, ramFormat); + dstRect.x_bytes = bpp * dstX; + dstRect.y = dstY; + dstRect.w_bytes = bpp * width; + dstRect.h = height; + dstRect.channel = RASTER_COLOR; } else { dstRect.vfb = CreateRAMFramebuffer(dstBasePtr, width, height, dstStride, GE_FORMAT_DEPTH16); dstRect.x_bytes = 0; - dstRect.w_bytes = 2 * width; + dstRect.w_bytes = 2 * width; // 2 = depth bpp dstRect.y = 0; dstRect.h = height; dstRect.channel = RASTER_DEPTH; From b05dbb8713b8f1f7bcbf26171a415bb7e8601d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Feb 2026 14:04:50 +0100 Subject: [PATCH 2/2] Warning fix --- Windows/Hid/HidCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Windows/Hid/HidCommon.cpp b/Windows/Hid/HidCommon.cpp index e09a4fe4dc..d8e2aa2ec8 100644 --- a/Windows/Hid/HidCommon.cpp +++ b/Windows/Hid/HidCommon.cpp @@ -6,11 +6,11 @@ bool WriteReport(HANDLE handle, const u8 *data, size_t size) { DWORD written; - bool result = WriteFile(handle, data, size, &written, NULL); + bool result = WriteFile(handle, data, (DWORD)size, &written, NULL); if (!result) { u32 errorCode = GetLastError(); if (errorCode == ERROR_INVALID_PARAMETER) { - if (!HidD_SetOutputReport(handle, (PVOID)data, size)) { + if (!HidD_SetOutputReport(handle, (PVOID)data, (DWORD)size)) { errorCode = GetLastError(); } }