Skip to content

bink_framebuffers_test: the exe's Bink path (frame buffers) over movies.rpf (RT-BINK-FRAMEBUFFERS) - #7405

Open
quackottu wants to merge 1 commit into
ItsNotRexed:mainfrom
quackottu:bink-game-path-test
Open

quackottu wants to merge 1 commit into
ItsNotRexed:mainfrom
quackottu:bink-game-path-test

Conversation

@quackottu

Copy link
Copy Markdown
Contributor

RT-BINK-FRAMEBUFFERS, claimed in #7049 (comment)

The retail exe imports 23 Bink2Scarlett.dll functions, including BinkOpenWithOptions, BinkGetFrameBuffersInfo, BinkRegisterFrameBuffers and BinkDoFrame, and none of BinkCopyToBuffer, BinkOpen or BinkGetSummary. bink_decode_test, bink_abi_test and bink_audio_test only use those three, so the exe's own path had never run under rt::Loader. The DLL itself has no d3d12*/dxgi* imports, so a boot movie needs no d3d12_xs method or compute shader from Bink.

  • New package-gated bink_framebuffers_test (ctest bink_framebuffers, skips with 77 without LEONIDA_GAME_DIR and LEONIDA_BINK_INDEX): per stream, copy it from movies.rpf to one temp file, BinkOpenWithOptions, BinkGetFrameBuffersInfo, check the layout, decode into the library's planes, then reopen, BinkRegisterFrameBuffers with caller-owned planes before the first decode, decode, and check the caller's planes were written.
  • docs/movies.md: a section with the measured structure (264 bytes: counts and sizes only, no frame data).

Measured (Windows 11, MSVC, RelWithDebInfo, 1.0.2.1): all 515 streams, LEONIDA_BINK_LIMIT=515, RESULT PASS (4,636 checks). Default 12 streams: 0.8 s. Registering after a decode left the planes untouched on 21 of 515 streams, so the test registers first, as a game would. Not covered here and still unmeasured: BinkSetMemory, BinkSetOSFileCallbacks, the async-thread calls, BinkGetPlatformInfo, BinkSetSoundSystem.

No game data in the diff (check_no_game_data.py clean).

AI-assisted.

… BinkRegisterFrameBuffers) over movies.rpf (RT-BINK-FRAMEBUFFERS)

The retail exe imports 23 Bink2Scarlett functions and none of BinkCopyToBuffer, so the existing Bink tests never ran its path. Package-gated test: 515 of 515 streams pass; layout, 4:2:0 planes, size and pitch rounding measured in docs/movies.md.
@MartinIndra02

Copy link
Copy Markdown

Independent Windows + 1.0.2.1 package test of 064a958c4: pass.

Setup: Windows 11 x64, MSVC 19.44.35220 (RelWithDebInfo, Windows SDK 10.0.26100.0), own 1.0.2.1 Xbox package.

  • Without LEONIDA_GAME_DIR / LEONIDA_BINK_INDEX: SKIP (no package/index) (exit 77).
  • With own 1.0.2.1 movies.rpf + Bink2Scarlett.dll (default 12 streams): PASS (exit 0).
  • Minor MSVC warning at bink_framebuffers_test.cpp(245): C4244 (emplace_back(size_t, int) narrowing int to uint8_t).

AI-assisted review/test.

@Etr0p

Etr0p commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 064a958 on my own Xbox 1.0.2.1 copy (all 108 files match game/xbox-1.0.2.1.json by size), Windows 11 26200, MSVC 14.44 (RelWithDebInfo, Ninja): pass, including the full 515-stream run.

  • tools/bink_index.py <package>/movies.rpf --out <local csv>: 515 Bink 2 streams, 0 unread. The index stays local.
  • bink_framebuffers_test, default 12 streams: 12 picked, 12 opened, RESULT PASS, exit 0, 2 s.
  • LEONIDA_BINK_LIMIT=515: 515 picked, 515 opened, RESULT PASS, exit 0, 184 s. 4,636 PASS lines and 0 FAIL, the same check count as the description's.
  • With LEONIDA_GAME_DIR/LEONIDA_BINK_INDEX unset: SKIP (no package/index), exit 77.
  • The build shows the same C4244 narrowing warning @MartinIndra02 reported (from xutility, instantiated by the test's emplace_back). Warnings are not errors in that target, so it builds.

The test is CPU-only (no GPU involved). There is no main comparison, since the test is new. Counts and pass/fail only; nothing from the archive is posted.

AI-assisted (Claude Code).

@jeremygold02

Copy link
Copy Markdown
Contributor

Two static call sites in the title resolve the argument order left open here. Both pass an options pointer second and a 32-bit flags value third to BinkOpenWithOptions(source, options, flags). The registered file-open callback reads fields from the source object. The frame-buffer test uses both defaults. Its path, flags, options comment can be corrected independently of its pixel result. Callback test and measurements

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.

4 participants