Repository navigation
widescreen: support narrow landscape Unlocked aspect ratio (#474) - #504
Conversation
…ked aspect ratio (mamcjr#474)
|
Thanks! I tested it on the POCO with LARECOMP_WIDE_TEST=0.9 and 0.75: the world is right (Vert+, the HUD in the corners). I still need to check the map, the inventory with the 3D Link, the scope and the FOV transitions (bow, scope, paraglider), so I'll hold it until then. Two notes: it isn't opt-in (every 16:10 tablet and 4:3 screen gets Vert+ instead of bars, with Original as the way back), which is fine but should be in the PR text; and it rewrites the camera's stored fovy/sin/cos/tan, not only its aspect. If the game derives a new fovy from the current one (zoom, paraglider, cutscene blends), please make sure it can't creep. |
… merged, v0.4.8-beta triage [skip ci]
Enable full-height unlocked rendering on narrow landscape displays (9/16 <= shape < 1, such as 16:10, 3:2, 4:3, 1:1, and unfolded foldables) while keeping portrait (dw < dh), 16:9, and ultrawide (> 1) behavior unchanged. - Output/aspect reshaping (runtime/nvn/output_scale.c, runtime/nvn/vulkan/device.c): accept narrow landscape ratios in [9/16, 0.995) when dw >= dh (or explicit LARECOMP_WIDE_TEST >= 9/16), keep [0.995, 1.005] deadband and portrait guard consistent between both files, and sanitize env overrides once. - Camera/HUD state (runtime/hle/widescreen.c): expand 3D perspective vertically via Vert+ (or Hor- with LARECOMP_NARROW_HOR_MINUS=1), preserve mAngle untouched while tracking orig_fovy and scaled sin/cos/tan/aspect across frames to prevent FOV creep during camera blends, maintain seen projections in a 256-entry LRU with C11 atomics and RT_ON_RESET cleanup, restore aspect cleanly on dynamic resize, adapt UI projection and HUD vertical/strip anchors without splitting upper heart rows or shifting interior 3D enemy HP bars, and apply symmetric 16:9 vertical crop on Title and Sheikah Scope. - Vulkan UI/cover/band adaptation (runtime/nvn/vulkan/exec.c): adapt map terrain and full-screen fades/backdrops/top-bottom cover bands using nn::ui2d cb3[33] (w, h, left, top) layout bounds with finiteness and off-screen guards, adapt condensed text, and gate draw_() UI viewport box skipping to narrow UI layouts. - Tests (tools/test_fullscreen_narrow.py, tools/test_rt_load_upload.c): add host unit/negative-control test suite (-Wall -Wextra -Werror, 10 negative controls, 60-frame FOV creep check, tall_ui/backdrop tests) and required widescreen_* link stubs for Android Bionic unit builds.
25ebfb6 to
186ea04
Compare
|
Updated in
|
…amcjr#507 review updates & v0.4.8-beta-mali rollout
|
Thanks for the creep guard and the test. On the POCO with LARECOMP_WIDE_TEST=0.9 and 0.75 (all three PRs together, 1.9.0): the world is Vert+ with the HUD in the corners, the map fills the narrow window with its markers on their places, the inventory fits with the 3D Link undistorted, bow aiming and the scope look right (the scope's vertical lines are there at 16:9 too), and nothing crashed. I didn't test the paraglider. Merged, thanks! |
…rktree cleanup, and PR mamcjr#507 rebase/UI note
Summary
Addresses #474 by enabling full-height
Unlockedaspect rendering on narrow landscape displays (9/16 <= shape < 1, such as16:10tablets,3:2,4:3,1:1, and unfolded foldables) while leaving portrait screens (dw < dh),16:9,20:9ultrawide,Originalaspect mode, and unhooked game versions (!reshape_allowed) unchanged.Default behavior & rollback: Selecting
Unlockedin Video settings automatically applies Vert+ narrow-landscape framing on narrow landscape displays (16:10,4:3, etc.); switchingAspectback toOriginalrestores stock16:9letterboxing immediately (LARECOMP_NARROW_HOR_MINUS=1andLARECOMP_NO_SCOPE_BARS=1remain available as env fallbacks).Changes
runtime/nvn/output_scale.c,runtime/nvn/vulkan/device.c):shape in [9/16, 0.995)whendw >= dh, or explicitLARECOMP_WIDE_TEST >= 9/16) while keeping portrait (dw < dh),[0.995, 1.005]deadband,Originalmode, and unhooked versions (!reshape_allowed) at16:9letterbox.[0.995, 1.005]deadband and9/16portrait boundary identical acrossoutput_scale.canddevice.c, guards non-positive/non-finite dimensions, and parses env overrides once.runtime/hle/widescreen.c):tan_new = tan(orig_fovy / 2) / shape), leavingp[2](mAngle) untouched while storingorig_fovyalongsidescaled_{sin,cos,tan,aspect}checked bytrig_scaled_match()and asame_nfstack-reuse guard. BecausemAngleis preserved andtrig_scaled_match()recognizes already-scaled projection entries (updatingnear/farwithout rescaling), repeated frames, camera blends, zooms, and paraglider transitions cannot compound-scale or creep FPS/FOV._Atomicstate, single-snapshot readers, dynamicnear/fartolerance, address-reuse invalidation, fullmAspectrestoration across dynamic resizes (narrow <-> 16:9 / portrait / ultrawide), lock-free steady-statert_persp_aspect(), andRT_ON_RESET(widescreen_reset).widescreen_hud_anchor()) for top/bottom strips (y >= 260 && (x < -120 || x > 290)so multi-row hearts don't split), isolates far-left Rune/D-pad/Champion columns (y >= 170 && x < -460) without moving interior 3D enemy HP bars, and exposeswidescreen_cropped()so Title and Sheikah Scope use symmetric16:9cropping (LARECOMP_NO_SCOPE_BARS=1opt-out).runtime/nvn/vulkan/exec.c):!fixed) text proportions, skips thedraw_()fminfviewport box on narrowui_layoutdraws, and adaptsnn::ui2dfull-screen covers, blurred backdrops, and loading-screen top/bottom color bands usingcb3[33](w, h, left, top)bounds with finiteness,panesize, and off-screen guards.widescreen_band_seen()on!widescreen_in_menu()so HUD anchors react immediately on menu close.tools/test_fullscreen_narrow.py,tools/test_rt_load_upload.c):-Wall -Wextra -Werror,0warnings) coveringoutput_scale.c,device.c,widescreen.c,exec.c,16:9/20:9regressions, 60-frame FOV zero-creep verification, dynamic resizes,1:1/4:3stack reuse, 300-camera LRU,PROT_NONE64-byte text UBO OOB guard,tall_uiviewport bypass,g_wide_backdrop,--wide-test, and 10--negative-controlmodes.widescreen_*link stubs referenced byexec.cintools/test_rt_load_upload.c(tools/patches.py,runtime/gamelib.h, and.gitignoreremain untouched).Rollback / Zero-Overhead Guarantee
Originalaspect mode (and non-narrow16:9/20:9/ portrait surfaces) bypasses narrow-landscape projection/UI adaptation; settingAspectback toOriginalrestores stock16:9letterboxing.LARECOMP_NARROW_HOR_MINUS=1andLARECOMP_NO_SCOPE_BARS=1provide env fallbacks for Vert+ and16:9scope cropping.Isolated On-Device Verification (Exact
v0.4.8-betaCommit186ea04)Environment: Galaxy Tab S11 (
SM-X730), Android 16,Mali-G925-Immortalis MC12(vendor 0x13b5,device 0xd8300010,driver-id 9,v1.r49p1-03bet0.f8a98b506b89b21c80a508d70abfcb3f), BOTW1.9.0, upstream base2b71a10(v0.4.8-beta), commit186ea04(built from identical tree6668c01, debug APK9c4c071600e3), native2560x1600(16:10), USB-powered (plugged: 2, no off-charger power claims made).Verbatim startup & runtime log proof (
Unlocked,LARECOMP_LOG_ASPECT=1):Official 30 FPS
benchmark.c(Unlocked16:10Vert+,warmup_s=8,calm_s=2,window_s=6, 181 frames/scene)plateauUnlocked(16:10Vert+,186ea04)30.0029.5233.34/33.85 ms26.67/33.64 ms17.73/20.43 ms6.66 mszora-plazaUnlocked(16:10Vert+,186ea04)30.0029.5733.34/33.78 ms27.56/33.49 ms17.49/21.30 ms5.77 ms(For visual comparison against
Original16:9letterbox, baselineOriginalcaptures from25ebfb6(30.00fps) are shown alongside exactv0.4.8-betacommit186ea04Unlockedcaptures below.)Visual Comparison (
SM-X7302560x1600)Original(16:9letterbox baseline)Unlocked(16:10Vert+,186ea04)Additional Unit & Build Checks (
186ea04)test_fullscreen_narrow.py,-Wall -Wextra -Werror):PASS, including--wide-test -0.5, 0.5, 0.5625, 0.75, 0.996, 1.25, infand 10/10--negative-controldetections (camera,ui,anchor,map,crop,band,crop_title,oob_guard,tall_ui,backdrop); WSL-fsanitize=threadpassed on25ebfb6(0races).test_vulkan_compat.py(16),test_vulkan_startup.py(33),test_shader_cache.py(17),test_soft_linear.py(23 C + 3 SPIR-V + 203 math),test_gpu_timing_trace.py(8),test_command_snapshot.py,test_pipeline_cache_save.py: PASS.SM-X730,tools/test_android_runtime.ps1):7/7 PASS;:app:assembleDebug --no-daemonBUILD SUCCESSFUL.Tested vs Untested GPU Matrix
SM-X730,r49p1,2560x160016:10)v0.4.8-betacommit186ea04:Unlockedbenchmark +(mAngle preserved)logs + screenshots + Bionic7/74:3/3:2/1:1/20:9/-0.5..infshapes--wide-testverifiedtest_fullscreen_narrow.py(incl. 60-frame zero-creep and1:1stack reuse)< r49, unfolded foldables, Desktopreshape_allowed/aspectbounds;Originaland16:9/20:9logic unchanged