Skip to content

HLE: support the opt-in Bink intro skip on native Linux - #7

Open
gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:fix/native-bink-guest-abi
Open

gmankab wants to merge 2 commits into
spidercraft:linux-native-runtimefrom
gmankab:fix/native-bink-guest-abi

Conversation

@gmankab

@gmankab gmankab commented Nov 25, 2026

Copy link
Copy Markdown

This ports C-GDev's opt-in Bink intro skip to the native Linux branch. The original commit retains its author. The follow-up uses Microsoft's x64 calling convention for the wrappers and the original function pointers because the title calls both through its Windows import ABI.

On the PR base, both Bink unit tests passed. The forwarding fixture checks distinct arguments in all three registers after the movie handle. In a separate Wine-free title run with the same wrapper code and VICTORY_SKIP_BINK=1, the 450-frame non-looping movie was skipped and the title continued to story loading.

Based-on: fxceless/victory-fork#613
Tested-on: Fedora Linux 45 x86_64, Mesa 26.2.6 lavapipe, native vkd3d-proton ec20719
Assisted-by: gpt-6.2 sol xhigh

C-GDev and others added 2 commits November 25, 2026 22:40
VICTORY_SKIP_BINK=1 skips the movies that play once (the intro);
VICTORY_SKIP_BINK=all also the looping ones. Unset, nothing changes.

The title's own Bink DLL still opens each movie. The exports a player
loop calls on an open movie (BinkWait, BinkDoFrame*, BinkNextFrame,
BinkGoto, BinkShouldSkip, BinkClose) are bound to wrappers; on the first
of these calls for a movie that is skipped, the movie is put on its last
frame, and from then on nothing is decoded, so the title's own
end-of-movie check ends it at once. Whether a movie loops is read from
its open flags at that first call, after any BinkSetWillLoop.

In a run of the title with VICTORY_SKIP_BINK=1, the one movie it opened
(3840x2160, 450 frames, not looping) was skipped.

The idea comes from XCL PR Marvisak#1053 (xcl-dev/xcl); the code is written anew
for VIctory's loader.

Assisted-by: Claude Code (Claude Opus 5.5)
On a Linux host, Rust's system ABI passes arguments using SysV. A
Windows guest calls wrapped Bink imports using Microsoft's x64 ABI.
When the opt-in intro skip is enabled, the wrapper and its forwarded
call must agree with the guest about which registers hold the movie
handle and the remaining arguments.

Declare the Microsoft x64 ABI on the wrappers and the forwarding
function pointer. Call a bound wrapper with distinct argument values
in the fixture and verify they reach the original function.

Tested-on: Fedora Linux 45 x86_64, Mesa 26.2.6 lavapipe, native vkd3d-proton ec20719
Assisted-by: gpt-6.2 sol xhigh
Based-on: fxceless/victory-fork#613
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants