feat(widescreen): the title screen's movies fill a wider screen (Fill title screen) #2988
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2988
Loading…
Reference in a new issue
No description provided.
Delete branch "SplitShotz/Longshot:feat/title-movie-fill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
On a screen wider than 16:9, the title screen has black bars on both sides while the rest of the game fills the screen. Its background is a set of pre-rendered 16:9 movies (
Event/Movie/Dm_Title_*.webm: Link riding across Hyrule Field,0005, then the scenes it loops through,0045to0095), and the movie site keeps every movie in the middle 16:9. To see it onmain: 21:9 (orHOS_ASPECT=2.3889), Aspect ratio at the monitor's shape, Ultrawide menus at Extended, and wait on the title screen.This zooms only the title screen's movies to the screen's full width, trimming what falls past its top and bottom (about 13% each at 21:9). The story movies keep their 16:9. A new Graphics row, Fill title screen, on by default and placed after Ultrawide menus, turns it off.
The same feature for
mod-api's Rust game side, in the widescreen system mod, is #3016; this stays onmainfor the C game side until #2822 lands.Read first:
hos_movie_openedandhos_site_wide_movieingame/oot_wide_sites.c, and the lines at the end ofhost/nn_fs.c'sOpenFilethat tell it which movie the game opened.host/nn_fs.c: each.webmread open that succeeds is passed tohos_movie_opened, once its handle is made (a movie that fails to open changes nothing) (declared ingame/game.h, ashos_stand_in_damagedis).game/oot_wide_sites.c:hos_movie_openednotes whether the movie is one of the title's in an atomic flag (relaxed exchange and load: the opening thread writes it, the movie draw's reads it; logged once per change:wide: the title screen's movies (...)). While it is, and the row is on,hos_site_wide_moviemoves the viewport's top and bottom out byh * m / (1 - 2m)each, instead of narrowing its sides bym. Vulkan takes a viewport past the target, and the scissor (vk_draw.cpp) stays clamped to it.game/options.h:HOS_OPT_TITLE_FILL = 104(103 is taken by #2476).game/menu/rows.c: the row, keyfill_title_screen, added totests/test_menu_ini_keys.py's FROZEN.docs/user/graphics-and-controls.md: the row's line in Every setting, after Ultrawide menus, and the ultrawide tip names the title screen as the exception to movies keeping 16:9.vk_framegen.cppwide_sides) still draw over the movie while no world is drawn, as for every movie: blurred, they now blur the zoomed movie instead of black. The row's help says so.Testing
Tested: in the game, by the author, on Garuda Linux (kernel 7.3.5-zen), NVIDIA GeForce RTX 4060, driver 620.73.04, at 3440 x 1440 (21:9), the Aspect ratio at the monitor's shape: the title screen's movies, from Link riding across Hyrule Field on, fill the screen with no black bars beside them. Fill title screen does as its help says: off, the title's movies are back in the middle 16:9 with the bars. The game's other cutscenes play exactly as on
main. With Ultrawide menus at Centred, blurred sides, the title screen looks right at 21:9 too: the zoomed movie under the blurred sides. On a 16:9 PC the title screen and the movies are as onmain. After the review's fixes,a59f1d2was built and run headless at 21:9 (own profile,HOS_FS_TRACE=1) from the intro into the title menu, about 8,900 frames in all: filled throughout, the bars back with the row off; the game opened one movie file in that time,Dm_Title_0005.webm.Checks, on Linux (Garuda, clang):
tests/test_movie_shape.py: the title's movies at 21:9 and 32:9, the row off, 16:9, 16:10, and a story movie opened after the title. It fails onmain(nohos_movie_opened) and passes here, with the existing seven cases.tests/test_vcore_fs_open.pycompiles the realhos_movie_openedand its flag with the realOpenFile: a title movie that opens selects the title's, a story movie that opens the story's; a story movie that fails to open, is left out (HOS_NO_MOVIES), is missing from the.nup's index, or is opened to write leaves the selection. It fails with the notification before the open (the earlier placement) and without it.tests/test_wide_sites.py(every wide site against main's C, 6000 cases each),test_menu_ini_keys.py,test_menu_rows_model.py,test_menu_i18n.py,test_damaged_rom_files.py,test_fs_save_commit.py,test_vcore_fs_open.py,test_title_card_sites.py,test_hud_layout_row.py: pass. The last threefsfixtures compileOpenFileand get a stub for the new function, as they have forhos_ultrawide_redirect.mise run test(mise 2026.11.16, the pinned tools,mise run test-deps's headers throughLONGSHOT_VULKAN_HEADERS/LONGSHOT_SPIRV_HEADERSas CI sets them): 872 passed, 45 failed, 10 skipped. The run foundtest_settings_table.pywanting the row's line in the settings page; the second commit adds it, and it passes. The other 44 fail onmain(56823e2) on this PC too, run there with the same tools:The 44 that fail on main too
test_blocks_at_start.pytest_bug_report.pytest_control_picture.pytest_crash_record.pytest_crt_options.pytest_dev_update.pytest_draw_stream_visibility.pytest_framegen_hdr.pytest_framegen_resources.pytest_fsr_uniform_ownership.pytest_game_boundary.pytest_guest_holes.pytest_image_reaper_threads.pytest_image_view_retry.pytest_input_background.pytest_keyboard_menu_option.pytest_keyboard_option.pytest_lifter.pytest_linux_pressure.pytest_loaded_modules_drop.pytest_log_levels.pytest_menu_keys.pytest_menu_save_atomic.pytest_oot_occ_raster.pytest_option_ids.pytest_perf_send.pytest_pipeline_tour.pytest_present_acquire_ahead.pytest_present_image_free.pytest_present_source_crop.pytest_program_cache_cleanup.pytest_program_cache_one_variant.pytest_readback_timeout_reuse.pytest_recording_admission.pytest_screensaver.pytest_switch_table.pytest_target_retention.pytest_temporal_present_bandwidth.pytest_tex_desc_memo.pytest_text_keyboard_policy.pytest_upscaler_round_trip.pytest_vram_compact.pytest_windows_display_startup.pytest_windows_on_linux.pyOn
a59f1d2(after the review's fixes),run_all.py --strict --changed origin/main(the 51 checks that read the changed files): 47 passed, 1 skipped, and the 4 failures are among the 44 above.The host's C for Windows, as CI's
host-windowsjob runs it (scripts/check_host_compile.py,RX_TARGET=windows,RX_MARCH=x86-64-v3, llvm-mingw 20261104 fromlongshot_builder.py llvm-mingw, tools.lock's windows-x64 cpm), ona59f1d2: 118 host units, 0 failed. Linux: built and run in the game, as above. The new code compares the guest's path as bytes (strlen,_stricmpon its suffix, asOpenFilealready does for.webm, andstrstr), so a UTF-8 path is no different.Rebased onto
main4e762a4(ceb3fb2), without conflicts:run_all.py --strict --changed origin/main: 46 passed, 1 skipped, and the 4 failures are among the 44 above (test_oot_fov_rust.pyfirst failed offline on #2353's new crate, then passed aftercargo fetch --locked).ruff 0.12.0 (the pinned version) passes on the changed tests; pre-commit passes except
gitleaks, not installed here.Still to test: None.
Measurements
Verdict: within the spread: with Fill title screen on, the title menu ran at a median 236.4 fps against 243.0 off (-2.7%, +0.11 ms median frame time), but the runs overlap (off 210 to 247 fps, on 233 to 245). It only applies on the title screen at a screen wider than 16:9; off, the movie site takes
main's path.Baseline: the row off in the same build, not
main: off, the movie site takesmain's path (the new branch is skipped), and afeatis measured on against off.Setup: Garuda Linux (kernel 7.3.5-zen), RTX 4060, NVIDIA 620.73.04;
a59f1d2(dev.py game --quick), headless, 3440 x 1440 (HOS_OUTPUT_RES),HOS_ASPECT=2.3889, Ultrawide menus at Extended, uncapped (HOS_FPS_MAX=1000), V-Sync off; the title menu over the title's movie (no scene or route reaches it, so notdev.py ab): each run adev.py queue run --mode timingjob with its own profile and a pinned options file differing only infill_title_screen, the title menu reached, 2400 frames of warm-up, then 13,000 frames (53 to 62 s) fromRX_VK_FRAME_LOG. Interleaved off, on, three pairs, the median run.a59f1d2a59f1d2On
main4e762a4(rebased): the numbers are still a59f1d2's. The comparison is off against on in one build, and none ofmain's 8 new commits touches the movie site, the movie's draw or OpenFile.Spread: the off side's second run was disturbed (it fell to 168 fps near its end) and each pair ran off first, so a PC slowing over the hour favours off; pair 1 alone: 246.7 against 245.2. The frame log is per present, not GPU time.
The runs
Each run's options file:
ultrawide_menus=3andfill_title_screen=0or1; every run's log has the same switches (one lists them in another order).Risks
Only the title screen on a screen wider than 16:9 changes. If the game opened a title movie file while a story movie plays, that story movie would be zoomed too; the log line says which movie was opened last. Turn it off with Fill title screen. After updating, players on a wider screen see the title screen filled;
longshot_options.inigets afill_title_screenline when the menu saves.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen. (in this comment: 21:9, Fill title screen off,main's path, and on)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Garuda Linux (kernel 7.3.5-zen), NVIDIA GeForce RTX 4060, driver 620.73.04, 3440 x 1440 (21:9): the title screen's movies, from Link riding across Hyrule Field on, fill the screen with no black bars; Fill title screen off puts them back in the middle 16:9; the other cutscenes play as on main; Ultrawide menus at Centred, blurred sides looks right too. On a 16:9 PC the title screen is as on main.
Possibly related, for context:
Ran the full mise run test: 872 passed, 45 failed, 10 skipped. test_settings_table.py wanted the new row's line in docs/user/graphics-and-controls.md;
f2c01e0adds it and it passes. The other 44 fail the same way on main (56823e2) on this PC; Testing lists them.Ran CI's host-windows check here (check_host_compile.py with llvm-mingw 20261104): 118 host units, 0 failed. Added the Windows/Linux host-code and Docs updated boxes.
@review
Recommendation: Request changes. The movie selection is shared across threads without synchronization, so the wrong movie can be cropped. The viewport change has worked on one Linux/NVIDIA system, but the affected Tier 1 systems and its frame-time cost remain untested.
The title movies can fill an ultrawide picture by cropping their top and bottom, with a menu option to retain the original framing. The viewport calculation is small, but identifying the displayed movie through a process-wide last-open flag introduces correctness and synchronization risks.
Blocking (1): must change before merging.
game/oot_wide_sites.c:236: The movie flag is accessed concurrently without synchronization; volatile does not make these accesses atomic or establish ordering. (more on the line) Do: Use an atomic load and store, or protect all accesses with a suitable lock, and update the fixture to exercise the synchronized implementation.Should fix (1): not blocking, but worth doing before merging.
tests/test_movie_shape.py:72: The new test calls the notification directly, so it does not test that OpenFile sends it or that failed opens leave the active selection alone. (more on the line) Do: Add a game-free filesystem integration case that opens a title movie, checks the notification and resulting selection, and covers a failed movie open.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1 and L2.Questions (2) (not confirmed from the code; they don't hold the recommendation)
host/nn_fs.c:1214: Can the game attempt a failed title or story movie open while a different movie is still displayed?Checks: Still running: 10 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the feature on the author's Garuda Linux/RTX 4060 run: the title filled a 3440 × 1440 screen and turning the option off restored the bars. The frame-time cost is unproven; no on/off measurements were reported.
Other systems: The movie hook also handles story movies and runs independently of the GPU vendor. The expanded viewport reaches Vulkan on Windows and Linux; NVIDIA/Linux was tested in game, but AMD/RADV, Windows and Steam Deck runs are not reported. The 16:9 and narrower paths retain the existing calculation in the source.
Switches: Fill title screen is a new saved player option, on by default. Its default is a presentation preference; the reported run shows it works on one setup, but does not establish behavior on the other affected systems. No environment switch was added.
Reviewed:
f2c01e0071against56823e27a1: Read the repository rules, standards, pull request template, diff and commits; inspected the changed game code, movie test and file-open path, and the renderer viewport and scissor handling. Skimmed the larger filesystem tests, menu-key test, graphics guide and wide-site test; the combined output for the full-file reads was truncated. Tooling's adjacent AGENTS.md and docs/review-checklist.md were unavailable.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run, as requested. The author's reported game run and checks were considered; CI is still running.
Overlaps and merge order: The description reserves option ID 103 for #2476; this change uses 104. No other overlap was established from the available checkout.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -231,0 +233,4 @@each movie file. They are scenery under the title's own layout (Title_00, placed as the menus are), so on a wider picturethe movie site zooms them to its width (the Fill title screen row, HOS_OPT_TITLE_FILL) instead of leaving black besidethem. The story movies keep their 16:9 */static volatile int title_movie;L1 (blocking): The movie flag is accessed concurrently without synchronization; volatile does not make these accesses atomic or establish ordering.
When: OpenFile gives up its virtual core before calling hos_movie_opened, so a file-opening thread can write title_movie while a game thread executing the movie draw reads it. This is a C data race, and the draw can use an invalid or stale selection.
Do: Use an atomic load and store, or protect all accesses with a suitable lock, and update the fixture to exercise the synchronized implementation.
@ -57,6 +69,8 @@ static int check(const char *name, float ratio, float margin, const float expectmemcpy(mem + VP + 8, original, sizeof original);hos_wide_ratio = ratio;hos_wide_margin = margin;hos_movie_opened(path);L2 (should fix): The new test calls the notification directly, so it does not test that OpenFile sends it or that failed opens leave the active selection alone.
When: Removing the hos_movie_opened call from OpenFile still leaves all the new title-shape cases passing, while title movies in the game no longer fill the screen.
Do: Add a game-free filesystem integration case that opens a title movie, checks the notification and resulting selection, and covers a failed movie open.
Screenshots: the title screen's first movie (Link riding across Hyrule Field) at 3440 x 1440 (21:9), Aspect ratio at the monitor's shape (
HOS_ASPECT=2.3889), Ultrawide menus at Extended. One headless run off2c01e0(dev.py game --quick,longshot_ctl.py launch --profile test), Fill title screen set through the bridge between the two shots, about 90 frames apart. Off takesmain's path throughhos_site_wide_movie(the new branch is skipped), so it is the same picture asmain.Fill title screen off (as on
main):Fill title screen on (this pull request):
Screenshots added (comment above); ticked their box.
Description updated for
a59f1d2: OpenFile tells the movie site only after a successful open, the flag is atomic, the new test_vcore_fs_open cases, and the checks and game run ona59f1d2.Thanks for the review.
a59f1d2fixes L1 and L2:L1:
title_movieis now a plainintwritten with__atomic_exchange_nand read with__atomic_load_n, both relaxed, since the flag protects no other data. The exchange also makes the "logged once per change" line race-free.tests/test_movie_shape.pycuts the new code out ofoot_wide_sites.cas before, so its fixture runs the atomic version.L2:
OpenFilenow tellshos_movie_openedonly after the handle is made, just beforeRET(0).tests/test_vcore_fs_open.pycompiles the realhos_movie_openedand its flag together with the realOpenFileand checks the selection:HOS_NO_MOVIES, is missing from the.nup's index, or is opened to write leaves the selection unchanged.The test fails on f2c01e0's placement (the failed-open cases) and with the call removed (the selection cases).
Questions:
a59f1d2headless at 21:9 withHOS_FS_TRACE=1, from the intro into the title menu, about 8,900 frames in all (4,300 of them on the menu). In that time the game opened one movie file,Dm_Title_0005.webm, which holds the intro and the menu's scenes, and nothing else. I haven't traced the step from the title into the first story movie. If that story movie were opened before the title's stopped, the title would fall back to 16:9 for those frames, which ismain's framing. A story movie could only be zoomed if a title movie file were opened while it plays.L3 / L4: still open. L3 needs Windows, AMD/RADV and Steam Deck runs, which I can't do on this PC, and L4's interleaved on/off frame-time runs haven't been done yet. The Tier 1 box stays unticked.
The run (fill off, fill on, then the title menu later on, all at 3440 x 1440):
Please rebase on mod-api branch!
Measured (L4): Fill title screen off against on on the title menu at 21:9, 3 interleaved pairs on
a59f1d2: 243.0 against 236.4 fps (median run), +0.11 ms median frame time, within the spread (off 210 to 247, on 233 to 245). Measurements has the table, setup and the runs.a59f1d23bbceb3fb2ccfRebased onto main
4e762a4(ceb3fb2), no conflicts; the checks that read the changed files pass as before. Description: the rebase, why the measurements still hold, and the mod-api version, #3016.@HumanBean thanks. I looked into rebasing this onto
mod-api, and it can't be a plain rebase: the three C files this PR mostly changes (game/oot_wide_sites.c,game/menu/rows.c,game/options.h) don't exist there, since the widescreen code is the Rust system mod ingame/mods/widescreen. So I've done both:mod-api: the same feature ported to the widescreen mod. Afill_title_screentoggle in itsmod.toml,wide::moviezooming the title's movies, an atomic flag instate.rs, andOpenFiletelling it through a newgame.hexport (hos_movie_opened, after a successful open). Rust andtests/checks, the Windows host compile, and a 21:9 game run with screenshots are in its description.main: players run the C game side until #2822 is merged, and #2822 is still open. Keeping both means the title screen fills a wide screen whichever lands first, and if #2822 merges, #3016 carries the feature over. The setting's key and values are the same in both, so a player'slongshot_options.inireads the same either way.If you'd rather only have the
mod-apiversion, say so and I'll close this one.WIP: feat(widescreen): the title screen's movies fill a wider screen (Fill title screen)to feat(widescreen): the title screen's movies fill a wider screen (Fill title screen)We're going to merge mod-api branch very soon so let's keep that version only
Pull request closed