Repository navigation
games/acnh: adaptive-view adapter on the frame step state page - #2609
Open
lucaszhongsj wants to merge 1 commit into
Open
lucaszhongsj wants to merge 1 commit into
lucaszhongsj wants to merge 1 commit into
Conversation
On a picture taller than 16:9 the game reuses projections and screen rectangles it cached before the shape changed, so scissors, captures, field ranges and the inline keyboard keep their 16:9 positions. The screen-shape stubs change the output size and camera angle but cannot invalidate those cached objects. Register an owned ARM64 adapter (view.s, assembled by gen_view_stubs.py, MIT-0) from the profile's FRAME_STEP callback: 21 hooks and 29 cache checks refresh cached projections, adapt scissors, captures and field ranges, and dock the inline keyboard and footer. It shares dm_fps_state with screen_shape (+0x58 target aspect, +0xa0..+0xb8 frame stamps), so no VIEW table, VIEW_STATE_OFF, host file or general-code change is needed. main+0x265140 is the one shared site: a single chained stub runs the upstream y-row division first (its 16:9 test reads m0/m5, which Lscreen_projection rewrites) then calls the adapter, with all three early returns retargeted to the trailing ret. main+0x27d4c0 and main+0x27d570 were disassembled and coexist. Checked: test_patches (22), test_view_stubs (3), test_docs (6); patch_nso.py on 3.0.3 main produces 64 cuts, one at 0x265140, no VIEW_STATE_OFF in fixups; disassembly confirms the early returns and the BL target. No chain input changed, so no shader rebuild. Device validation is open: the dock offset's stretch division (option B) and the pointer-free keyboard frame stamps need a real-device check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Fixes #2568 (Animal Crossing: New Horizons adaptive view on a taller-than-16:9 picture)
Problem
On a taller-than-16:9 picture the game reuses projections and screen rectangles it cached before the shape changed, so scissors, captures, field ranges and the inline keyboard keep their 16:9 positions. The
screen_shapestubs change the output size and camera angle but cannot invalidate those cached objects.Fix
Register an owned ARM64 adapter from the profile's
FRAME_STEPcallback (view.s, assembled to position-independent code bygen_view_stubs.py, MIT-0 inview.LICENSE), gated to the 3.0.3mainbuild ID:dm_fps_stateframe-step state page withscreen_shape(+0x58 target aspect, +0xa0..+0xb8 frame stamps); noVIEWtable,VIEW_STATE_OFF, host file or general-code change is needed.main+0x265140is the one shared site: the singleretofnn::ui2d::DrawInfo::SetProjectionMtx. One chained stub runs the upstream y-row division first (its 16:9 test reads m0/m5, which the adapter'sLscreen_projectionrewrites), then calls the adapter's keyboard dock; the three early returns are retargeted to the trailing ret.main+0x27d4c0andmain+0x27d570were disassembled and coexist.Verification
test_patches(22),test_view_stubs(3),test_docs(6) pass;patch_nso.pyon 3.0.3mainproduces 64 cuts, one at 0x265140, noVIEW_STATE_OFFin fixups; disassembly confirms the early returns and the BL target.