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

Merged
ubiquitarianism merged 1 commit from upstream-pr/2898 into main 2026-12-01 17:00:34 +00:00
ubiquitarianism commented 2026-12-01 16:35:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-01T16:35:39Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5590029270 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2898). Originally posted by [ubiquitarianism](https://github.com/ubiquitarianism) on 2026-12-01T16:35:39Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
ProjectLeonida/mandy!2898
No description provided.