From 9aedb88f3c59e77e1ff66d96b51063c8618bbf9a Mon Sep 17 00:00:00 2001 From: ParantezTech Date: Sat, 18 Jul 2026 23:01:57 +0300 Subject: [PATCH] [bink] keep guest decode path --- docs/bink2-bridge.md | 6 +++--- src/SharpEmu.Libs/Bink/Bink2MovieBridge.cs | 23 +++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/docs/bink2-bridge.md b/docs/bink2-bridge.md index 6ea35a57..e2ea7369 100644 --- a/docs/bink2-bridge.md +++ b/docs/bink2-bridge.md @@ -14,9 +14,9 @@ available, presents its decoded BGRA frames at the normal guest-flip boundary. This preserves the game's own timing and lets the host Vulkan presenter display the movie without trying to execute the PS5-specific Bink GPU decode path. -Without an adapter, Bink movies are skipped by default: their open call returns -not-found so games that mark cinematics as optional progress to their next -state instead of waiting on an empty Bink GPU texture. +Without an adapter, Bink files remain visible to the guest and the game's +statically linked decoder runs normally. Set SHARPEMU_BINK_MODE=skip only when +explicitly testing a title whose cinematics are optional. Set SHARPEMU_BINK_MODE=dummy to retain the open and show a built-in, non-decoded placeholder frame. This requires no SDK, but is a visual diagnostic diff --git a/src/SharpEmu.Libs/Bink/Bink2MovieBridge.cs b/src/SharpEmu.Libs/Bink/Bink2MovieBridge.cs index d3d5ead1..21699847 100644 --- a/src/SharpEmu.Libs/Bink/Bink2MovieBridge.cs +++ b/src/SharpEmu.Libs/Bink/Bink2MovieBridge.cs @@ -29,10 +29,9 @@ internal static class Bink2MovieBridge private static bool _availabilityReported; /// - /// Returns true when the guest should receive a normal "file not found" - /// result for a Bink movie. This is the safe default without a decoder: - /// games that treat movies as optional fall through to their next state - /// rather than submitting an empty Bink GPU texture forever. + /// Returns true only when movie skipping was explicitly requested. Without + /// a host adapter the guest must be allowed to run the Bink implementation + /// statically linked into its executable. /// internal static bool ShouldSkipGuestMovie(string hostPath) => hostPath.EndsWith(".bk2", StringComparison.OrdinalIgnoreCase) && @@ -53,12 +52,18 @@ internal static class Bink2MovieBridge return; } - if (ResolveMode() == MovieMode.Dummy) + var mode = ResolveMode(); + if (mode == MovieMode.Dummy) { AttachDummyMovieLocked(hostPath); return; } + if (mode != MovieMode.Native) + { + return; + } + var adapter = GetAdapterLocked(); if (adapter is null) { @@ -165,16 +170,15 @@ internal static class Bink2MovieBridge return MovieMode.Skip; } - // With no SDK adapter present, returning "not found" makes optional - // cinematics advance. Supplying either an explicit path or the normal - // side-by-side adapter enables native playback automatically. + // Prefer the optional host adapter when one is supplied. Otherwise let + // the game's statically linked Bink implementation consume the file. if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("SHARPEMU_BINK2_BRIDGE")) || EnumerateAdapterCandidates().Any(File.Exists)) { return MovieMode.Native; } - return MovieMode.Skip; + return MovieMode.Guest; } private static void AttachDummyMovieLocked(string hostPath) @@ -335,6 +339,7 @@ internal static class Bink2MovieBridge private enum MovieMode { + Guest, Skip, Dummy, Native,