feat(menu): a Recomp Options button in the pause menu that opens the Insert menu #290
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!290
Loading…
Reference in a new issue
No description provided.
Delete branch "prob/Longshot:menu/recomp-options"
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?
feat(menu): a Recomp Options button in the pause menu that opens the Insert menu
Why
The Insert menu's settings can only be reached with a key (Insert, F1) or a pad chord, which a controller player may never find. This adds a sixth button, "Recomp Options", to the pause menu's Menu page, below Title Screen, drawn and moved to like the game's own; A on it opens the Insert menu.
What changed
nx2/pause_layout.py(new) addsPa_Button_05to everyPaSystemMenu_00layout inCommon.blarcat build time, a copy ofPa_Button_04below it. The page draws only the panes its layout has (a copy made at run time is never drawn), so the layout itself gets the sixth pane. What grows is appended after the end of the layout and of the archive: no other offset moves, and the prompts' runs overCommon.blarcstay valid.nx2/prompt_assets.pywrites the edited archive toprompts/Common.blarc, raises its entry in the resource size table, and listspause_layout.pyamongprompt_key()'s sources.host/prompts.c: the served layouts' key (layout_runs) also takes the file's size and time, so a build that adds the button makes the served file again.nx2/oot_pause_menu.py(new), applied bynx2/oot_patches.pyand bynx2/chunks.pyedit_c(all its edits or none):f_80f99400(the page made): the sixth pane gets a button object like the other five, and its text ("Recomp Options", localized for pt/es/fr/it/de) on its text boxes (host/oot_pause_menu.chos_pausebtn_build);f_80ad5310(a button's state): the sixth button's control noted (hos_pausebtn_state);f_80aa2ad0(the base of the page's destructor): the button forgotten, so its control is never read after it is freed (hos_pausebtn_gone).host/nn_hid.cpasses the buttons throughhos_pausebtn_buttons: A while the cursor is on the button opens the Insert menu (F1 through the menu's key queue) and is not passed to the game. The page's script has no end for a sixth button's decision, and passing it left the pause menu impossible to close.host/rx_backend.c) exists on every platform, andhost/posix/display_sdl.ckeys_updatenotes each key on its way down, ashost/display.c'sWM_KEYDOWNdoes on Windows.host/nn_applet.c:hos_game_language()for the button's text.tests/test_oot_pause_menu.py(new: the edits all or none, also throughedit_c; unknown layouts and archives left as they are; the teardown clears the control);tests/test_linux_menu_keys.py(new: Linux keys reach the queue once on their way down, none while the window is not in front);tests/test_prompt_skip.py(pause_layoutcovered);tests/test_input_background.py(a pass-through stub for the new call).No game data is in the change: the layout is edited on the player's PC from their own files, and the original romfs is not modified.
Flags and settings
None.
Measurements
main:
fbd42024(2026-11-13)this PR: menu/recomp-options @ 46d640e5
Hardware: NVIDIA GeForce RTX 2070 SUPER 8 GB, driver 621.01; AMD Ryzen 7 5800X; 32 GB; Windows 11 Pro 26220
Scene: Kakariko Village at night, standing still; 1920x1080 output, quality preset 6, DLSS on, frame generation off, frame rate cap Uncapped, vsync off; windowed 1280x720, the window not in front
Method: each build in a game folder of its own (
nx2/make_game.py), the samelongshot_options.iniand save on both; one warm-up run per side first (shaders built, not counted), then main, this PR, main, this PR; 120 s measured per run fromHOS_PRESENT_TRACE(45 s after loading the save, the last 5 s left out); with two runs the median is their meanHow to reproduce: load a save in Kakariko Village, stand still, the settings above,
HOS_PRESENT_TRACE=<csv>; the fps lines of longshot_log.txt agreefbd42024The button only acts while the pause menu's Menu page is open, so no cost in play is expected, and none shows: the averages and medians match. The p99 and 1% low differences are run-to-run spread (main's two runs differ by 1.8 fps there), not something this change does in play.
Testing
Tested:
nx2/make_game.py), Windows 11, RTX 2070 SUPER: the button shows below Title Screen with its text, the cursor reaches it, A opens the Insert menu (pause menu: Recomp options: the Insert menuin longshot_log.txt), and B then closes the pause menu.Not tested: other GPUs and the Steam Deck: the change has no renderer or GPU code (a layout edit, the lifted code's pause-menu calls and the pad's A), so it doesn't depend on the GPU; the one platform-specific part, Linux's key queue (
host/posix/display_sdl.c), was run on Linux.Needs other testers: None
Screenshots
Risk and rollback
The pause menu's Menu page could misbehave if a game update moves the edited functions; the edits are all or none, so a lift that does not find them leaves the button out with a warning (
oot_patches: WARNING: the pause menu's places were found ...). Reverting the commit is enough.Reviewer notes
Start with
host/oot_pause_menu.c(the button, its state, its teardown) andnx2/pause_layout.py(the layout edit). The A press is taken inhost/nn_hid.crather than letting the game decide, because the page's script has no end for a sixth button's decision.Issues
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
docs/tested-configurations.mdfor each measured run.mainand passing here.tests/that reads changed source updated in this PR, not weakened.92e3c1ac0cf909218ebff909218ebfc1ae898fe8c1ae898fe868702277b968702277b91575902fd01575902fd05af898b007View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.