fix(wide): the wide area title card's frame is drawn in strips again #2589

Merged
HumanBean merged 2 commits from HumanBean/Longshot:fix/wide-title-card-sites into main 2026-11-26 02:45:08 +00:00
Owner

Summary

Since the builder moved to Rust (#2286), nothing calls hos_wide_title_prepare, hos_wide_title_draw or hos_wide_title_reset (game/hos_wide_ui.c). The old builder's text patch called them (nx2/oot_wide.py, nx2/oot_patches.py), and that patch went with nothing in its place. So on a picture wider than 16:9, an area's title card keeps its frame at 16:9 in the middle (#2555).

Three engine hook sites call them again, at the places the patch had:

  • ui.titlePrepare replaces f_815505b0's call of f_8154f1c0, which packs a picture's record. It is found inside ui.pictureConstants' function.
  • ui.titleDraw is at f_81550720's entry and can return. It draws the strips through that function itself, and the hook then lets the game draw (per picture, per thread).
  • ui.titleReset is at f_8156abc0's entry, where the constants' arena is reset.

Read first: game/sites/sites.toml and this build's locations.toml (the three sites), game/sites.def, and the callbacks in game/oot_wide_sites.c.

Fixes #2555.

Testing

Tested: Linux (CachyOS), RTX 3090, at 2560x1080. Both runtimes ran headless on the same base, one without the fix (rt-base) and one with it (rt-ws-2555). Each started from assets/saves/castle-gate, and Link walked through the gate into Castle Town, with shots every 20 frames.

  • Without the fix: the "Hyrule Castle Town" card's frame stays at 16:9 in the middle of the 21:9 picture. The log has no title-card lines at all.
  • With the fix: the frame reaches the wide picture's edges, in its three strips. HOS_WIDE_UI_LOG=1 gives title totals for all 8 parts: 316 prepares, 316 draws, and 0 guard failures, unused preparations, missing slots or fallbacks each.
  • Placement: the lift placed 142 hook sites, the three new ones included.
  • The test: tests/test_title_card_sites.py is new and needs no game. It checks the three sites, then runs their callbacks behind the hooks as the lift lowers them, with the real host helpers. It covers a wide card packed and drawn in three strips, a reset of another arena (strips kept) and of its own (strips dropped), a 16:9 picture, and the sites off. It fails on main, because the table has no ui.titlePrepare. Following this PC's rule, it hasn't run here; this PR's CI runs it. tests/test_wide_sites.py gets stubs for the new symbols. The C compiles with gcc and clang at -Wall -Wextra.

Still to test: None.

Measurements

Nothing to measure for speed: three hooks on the title card's path, which runs while a card shows.

Risks

Only the title card is affected, and only on a picture wider than 16:9. At 16:9 or with the sites off, the game's own call runs as before. Revert to undo.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (this PR's CI runs it)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec

## Summary Since the builder moved to Rust ([#2286](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2286)), nothing calls `hos_wide_title_prepare`, `hos_wide_title_draw` or `hos_wide_title_reset` (`game/hos_wide_ui.c`). The old builder's text patch called them (`nx2/oot_wide.py`, `nx2/oot_patches.py`), and that patch went with nothing in its place. So on a picture wider than 16:9, an area's title card keeps its frame at 16:9 in the middle ([#2555](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/2555)). Three engine hook sites call them again, at the places the patch had: - **`ui.titlePrepare`** replaces `f_815505b0`'s call of `f_8154f1c0`, which packs a picture's record. It is found inside `ui.pictureConstants`' function. - **`ui.titleDraw`** is at `f_81550720`'s entry and can return. It draws the strips through that function itself, and the hook then lets the game draw (per picture, per thread). - **`ui.titleReset`** is at `f_8156abc0`'s entry, where the constants' arena is reset. Read first: `game/sites/sites.toml` and this build's `locations.toml` (the three sites), `game/sites.def`, and the callbacks in `game/oot_wide_sites.c`. Fixes #2555. ## Testing **Tested:** Linux (CachyOS), RTX 3090, at 2560x1080. Both runtimes ran headless on the same base, one without the fix (`rt-base`) and one with it (`rt-ws-2555`). Each started from `assets/saves/castle-gate`, and Link walked through the gate into Castle Town, with shots every 20 frames. - **Without the fix:** the "Hyrule Castle Town" card's frame stays at 16:9 in the middle of the 21:9 picture. The log has no title-card lines at all. - **With the fix:** the frame reaches the wide picture's edges, in its three strips. `HOS_WIDE_UI_LOG=1` gives `title totals` for all 8 parts: 316 prepares, 316 draws, and 0 guard failures, unused preparations, missing slots or fallbacks each. - **Placement:** the lift placed 142 hook sites, the three new ones included. - **The test:** `tests/test_title_card_sites.py` is new and needs no game. It checks the three sites, then runs their callbacks behind the hooks as the lift lowers them, with the real host helpers. It covers a wide card packed and drawn in three strips, a reset of another arena (strips kept) and of its own (strips dropped), a 16:9 picture, and the sites off. It fails on main, because the table has no `ui.titlePrepare`. Following this PC's rule, it hasn't run here; this PR's CI runs it. `tests/test_wide_sites.py` gets stubs for the new symbols. The C compiles with gcc and clang at `-Wall -Wextra`. **Still to test:** None. ## Measurements Nothing to measure for speed: three hooks on the title card's path, which runs while a card shows. ## Risks Only the title card is affected, and only on a picture wider than 16:9. At 16:9 or with the sites off, the game's own call runs as before. Revert to undo. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (this PR's CI runs it) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec
The three sites that call game/hos_wide_ui.c's hos_wide_title_prepare, _draw
and _reset, run behind their hooks as the lift lowers them with the real host
helpers: a wide picture packed and drawn in three strips, dropped at its
arena's reset, a 16:9 picture or the sites off as the game. Fails on main:
no site calls the three since the builder in Rust (#2286), so the table has
no ui.titlePrepare.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec
fix(wide): the wide area title card's frame is drawn in strips again
Some checks failed
CI / What the change needs (pull_request) Successful in 14s
CI / Third-party parts and guide screenshots (pull_request) Successful in 17s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 5m29s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m31s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 5m7s
CI / Website build and checks (pull_request) Successful in 3m3s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Successful in 8m59s
PR description / Title and description (pull_request_target) Failing after 6s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 18m19s
62714ff544
Since the builder in Rust (#2286) nothing called hos_wide_title_prepare, _draw
and _reset: the old builder's text patch (nx2/oot_patches.py, nx2/oot_wide.py)
went with no hook site in its place, so on a wider picture the title card's
frame stayed at 16:9 in the middle. Three engine sites call them again, at the
places the patch had:

- ui.titlePrepare replaces f_815505b0's call of f_8154f1c0 (a picture's record
  packed), in ui.pictureConstants' function;
- ui.titleDraw, f_81550720's entry, can return: the strips drawn through the
  function itself, whose own hook then lets the game draw (per picture, per
  thread);
- ui.titleReset, f_8156abc0's entry (the constants' arena reset).

Fixes #2555.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1RP1VgcWpgA7Kq6ec
Author
Owner

Tested in game: Linux (CachyOS), RTX 3090, 2560x1080, headless: from the castle-gate save, Link walks into Castle Town. Without the fix the 'Hyrule Castle Town' card's frame stays 16:9 in the middle; with it the frame spans the wide picture (3 strips), title totals 316 prepares/316 draws per part, no guard failures or fallbacks.

Tested in game: Linux (CachyOS), RTX 3090, 2560x1080, headless: from the castle-gate save, Link walks into Castle Town. Without the fix the 'Hyrule Castle Town' card's frame stays 16:9 in the middle; with it the frame spans the wide picture (3 strips), title totals 316 prepares/316 draws per part, no guard failures or fallbacks.
HumanBean changed title from WIP: fix(wide): the wide area title card's frame is drawn in strips again to fix(wide): the wide area title card's frame is drawn in strips again 2026-11-26 02:45:01 +00:00
HumanBean deleted branch fix/wide-title-card-sites 2026-11-26 02:45:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!2589
No description provided.