hle: skip the title's Bink movies on request (LEONIDA_SKIP_BINK) #2898

Manually merged
github merged 1 commit from github-bot/gh-2898 into main 2026-12-01 17:03:26 +00:00 AGit
Owner

@⁠ubiquitarianism on GitHub · 2026-12-01 16:35 UTC · original
ProjectLeonida:feat/skip-bink → main · +403 −1 · 4 files · 1 commits · merged 2026-12-01 17:00 UTC

Item: D3D12-HLE-SKIP-BINK (claimed in #2570).

LEONIDA_SKIP_BINK=1 skips the movies that play once (logos, the intro); =all skips the looping ones too (menu backgrounds, which then stay dark). Unset, nothing changes and no import is bound anew.

The title's Bink DLL still opens every movie. The exports a player loop calls on an open movie (BinkWait, BinkDoFrame*, BinkNextFrame, BinkGoto, BinkShouldSkip, BinkClose) are bound to wrappers (d3d12/crates/leonida-hle/src/modules/bink.rs). They put a skipped movie on its last frame and keep it from reaching the DLL, so the title's own end-of-movie check closes it. The executable's imports and those of DLLs the title loads later go through SkipMovies (run.rs). An export looked up with GetProcAddress is not wrapped.

The technique comes from fxceless/victory-fork (pull request 613, by C-GDev), as carried by trustno1-coder/VIctory-NVIDIA and lobomfz/VIctory-xmem 0a4aadf (GPL-3.0). It is written anew for this loader.

Tested

  • cargo test -p leonida-hle --lib bink: 2 tests pass. The wrapping test fails when wrap_in returns the DLL's address instead of the wrapper, which I checked by making that change and running it.
  • cargo build --profile diag -p leonida --features diagnostics.
  • RX 6800, Windows 11, driver 32.0.21030.2001, LEONIDA_SKIP_BINK=1. The log shows all eight wrapped exports the executable imports from Bink2Scarlett.dll bound to the wrappers, and the title ran as before: 4.7 min from a save, 3 min from no save.
  • In the game, on the same machine, booting with no save and pressing Enter by LEONIDA_KEYS: the first movie (3840x2160, 450 frames, not looping) was skipped (Bink movie ... looping=false skip=true), and the title went on to its setup screen. Booting from a save, no movie is played before the start screen, so nothing is skipped there.
**@⁠ubiquitarianism** on GitHub · 2026-12-01 16:35 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2898) `ProjectLeonida:feat/skip-bink` → `main` · +403 −1 · 4 files · 1 commits · merged 2026-12-01 17:00 UTC Item: `D3D12-HLE-SKIP-BINK` (claimed in #2570). `LEONIDA_SKIP_BINK=1` skips the movies that play once (logos, the intro); `=all` skips the looping ones too (menu backgrounds, which then stay dark). Unset, nothing changes and no import is bound anew. The title's Bink DLL still opens every movie. The exports a player loop calls on an open movie (`BinkWait`, `BinkDoFrame*`, `BinkNextFrame`, `BinkGoto`, `BinkShouldSkip`, `BinkClose`) are bound to wrappers (`d3d12/crates/leonida-hle/src/modules/bink.rs`). They put a skipped movie on its last frame and keep it from reaching the DLL, so the title's own end-of-movie check closes it. The executable's imports and those of DLLs the title loads later go through `SkipMovies` (`run.rs`). An export looked up with `GetProcAddress` is not wrapped. The technique comes from fxceless/victory-fork (pull request 613, by C-GDev), as carried by trustno1-coder/VIctory-NVIDIA and lobomfz/VIctory-xmem `0a4aadf` (GPL-3.0). It is written anew for this loader. ## Tested - `cargo test -p leonida-hle --lib bink`: 2 tests pass. The wrapping test fails when `wrap_in` returns the DLL's address instead of the wrapper, which I checked by making that change and running it. - `cargo build --profile diag -p leonida --features diagnostics`. - RX 6800, Windows 11, driver 32.0.21030.2001, `LEONIDA_SKIP_BINK=1`. The log shows all eight wrapped exports the executable imports from `Bink2Scarlett.dll` bound to the wrappers, and the title ran as before: 4.7 min from a save, 3 min from no save. - In the game, on the same machine, booting with no save and pressing Enter by `LEONIDA_KEYS`: the first movie (3840x2160, 450 frames, not looping) was skipped (`Bink movie ... looping=false skip=true`), and the title went on to its setup screen. Booting from a save, no movie is played before the start screen, so nothing is skipped there.
LEONIDA_SKIP_BINK=1 skips the movies that play once (logos, the intro);
=all skips the looping ones too (menu backgrounds, which then stay dark).
Unset, nothing changes and no import is bound anew.

The title's Bink DLL still opens every movie. The exports a player loop
calls on an open movie (BinkWait, BinkDoFrame*, BinkNextFrame, BinkGoto,
BinkShouldSkip, BinkClose) are bound to wrappers that put a skipped movie
on its last frame and keep it from reaching the DLL, so the title's own
end-of-movie check closes it. The executable's imports and those of DLLs
the title loads later go through the wrapper; GetProcAddress does not.

The technique is from fxceless/victory-fork (pull request 613, by
C-GDev), as carried by trustno1-coder/VIctory-NVIDIA and
lobomfz/VIctory-xmem 0a4aadf (GPL-3.0); written anew for this loader.

Checked on an RX 6800 (Windows 11, driver 32.0.21030.2001): with =1 all
eight wrapped exports the executable imports from Bink2Scarlett.dll are
bound to the wrappers and the title runs as before (4.7 min on a save,
3 min from no save). No movie was stepped in those runs (a save-less boot
waits at the start screen), so the skip itself is shown by the unit test
alone, which fails when the wrappers are not bound.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 16:37:43 +00:00
github-bot force-pushed github-bot/gh-2898 from 117d0403e5 to 2d769e5f46 2026-12-01 16:56:52 +00:00 Compare
github manually merged commit 0d4cbd589d into main 2026-12-01 17:03:26 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2898
No description provided.