From 5495a3e41d88f9a54a62df0e0a4bdfd31aa29a69 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:57:38 +0300 Subject: [PATCH] Enforce linear filtering for debug 2D primitives. --- UnleashedRecomp/patches/video_patches.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/UnleashedRecomp/patches/video_patches.cpp b/UnleashedRecomp/patches/video_patches.cpp index 01dff102..39a9e48d 100644 --- a/UnleashedRecomp/patches/video_patches.cpp +++ b/UnleashedRecomp/patches/video_patches.cpp @@ -68,3 +68,16 @@ bool MotionBlurMidAsmHook() { return Config::MotionBlur != EMotionBlur::Off; } + +// Hedgehog::MirageDebug::PrepareRenderPrimitive2D +PPC_FUNC_IMPL(__imp__sub_830D25D8); +PPC_FUNC(sub_830D25D8) +{ + auto device = reinterpret_cast(base + PPC_LOAD_U32(ctx.r4.u32)); + + // Set first sampler to use linear filtering. + device->samplerStates[0].data[3] = (device->samplerStates[0].data[3].get() & ~0x1f80000) | 0x1280000; + device->dirtyFlags[3] = device->dirtyFlags[3].get() | 0x80000000ull; + + __imp__sub_830D25D8(ctx, base); +}