diff --git a/recomp/patches-v121.txt b/recomp/patches-v121.txt index 1fddf02e..0e92e4ab 100644 --- a/recomp/patches-v121.txt +++ b/recomp/patches-v121.txt @@ -933,25 +933,25 @@ spin sdk 23a7fc 23a918 # 19 instructions; loads spin sdk 3d3250 3d3270 # 9 instructions; loads # Aspect ratio (runtime/resolution.c aspect_init switches the set on when the game resolution is not 16:9; the sites are those of -# Fruithapje21's TOTK-Ultrawide 1.2.1 patch, GPL-3.0, read for behaviour, the code here our own). The page holds +64 the -# aspect (output width / height), +68 and +72 the factors the 2D canvas size is multiplied by in x and y: wider than +# Fruithapje21's TOTK-Ultrawide 1.2.1 patch, GPL-3.0, read for behaviour, the code here our own). The page holds +80 the +# aspect (output width / height), +84 and +88 the factors the 2D canvas size is multiplied by in x and y: wider than # 16:9, x by aspect / (16/9); narrower (the Steam Deck's 16:10), y by (16/9) / aspect; the other is 1. # - The world camera reads its aspect from the camera parameter DefaultAspect (main+0x1164a7c reads DefaultFovy, # DefaultAspect, DefaultOffsetX...), whose default is the float at main+0x3816ab4: the reader takes the page's instead. site aspect main 1164aa8 d0013588 @page:x8 # adrp x8, 0x3816000 -> adrp x8, page -site aspect main 1164aac 912ad108 91010108 # add x8, x8, #0xab4 -> add x8, x8, #64 +site aspect main 1164aac 912ad108 91014108 # add x8, x8, #0xab4 -> add x8, x8, #80 # - Two copies of a camera-viewport update compute aspect = (right - left) / (bottom - top) of a 16:9 rectangle; # x9 is set to 1 again after the load, so it holds the page meanwhile. site aspect main 19b36e0 1e223800 @page:x9 # fsub s0, s0, s2 -> adrp x9, page -site aspect main 19b36e8 52800029 bd404120 # mov w9, #1 -> ldr s0, [x9, #64] +site aspect main 19b36e8 52800029 bd405120 # mov w9, #1 -> ldr s0, [x9, #80] site aspect main 19b36f0 1e211800 52800029 # fdiv s0, s0, s1 -> mov w9, #1 site aspect main 1ecdf58 1e223800 @page:x9 -site aspect main 1ecdf60 52800029 bd404120 +site aspect main 1ecdf60 52800029 bd405120 site aspect main 1ecdf68 1e211800 52800029 # - The size of the 2D canvas the layouts are drawn in, loaded as {width, height} at five places: each load is kept # and followed by the multiplication, with x9 and s2 saved on the stack around it. -site aspect main 1add300 2d4307a0 2d4307a0 f81f0fe9 bd000be2 @page:x9 bd404522 1e220800 bd404922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x29, #0x18] -site aspect main 1ae1ae4 2d440680 2d440680 f81f0fe9 bd000be2 @page:x9 bd404522 1e220800 bd404922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x20, #0x20] -site aspect main 1adc6f8 2d4103e1 2d4103e1 f81f0fe9 bd000be2 @page:x9 bd404522 1e220821 bd404922 1e220800 bd400be2 f84107e9 # ldp s1, s0, [sp, #8] (width in s1) -site aspect main 12c7bd4 2d400500 2d400500 f81f0fe9 bd000be2 @page:x9 bd404522 1e220800 bd404922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x8] -site aspect main 12c7fbc 2d400500 2d400500 f81f0fe9 bd000be2 @page:x9 bd404522 1e220800 bd404922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x8] +site aspect main 1add300 2d4307a0 2d4307a0 f81f0fe9 bd000be2 @page:x9 bd405522 1e220800 bd405922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x29, #0x18] +site aspect main 1ae1ae4 2d440680 2d440680 f81f0fe9 bd000be2 @page:x9 bd405522 1e220800 bd405922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x20, #0x20] +site aspect main 1adc6f8 2d4103e1 2d4103e1 f81f0fe9 bd000be2 @page:x9 bd405522 1e220821 bd405922 1e220800 bd400be2 f84107e9 # ldp s1, s0, [sp, #8] (width in s1) +site aspect main 12c7bd4 2d400500 2d400500 f81f0fe9 bd000be2 @page:x9 bd405522 1e220800 bd405922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x8] +site aspect main 12c7fbc 2d400500 2d400500 f81f0fe9 bd000be2 @page:x9 bd405522 1e220800 bd405922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x8] diff --git a/recomp/patches-v143.txt b/recomp/patches-v143.txt index a3ad10ac..1fcc8c4e 100644 --- a/recomp/patches-v143.txt +++ b/recomp/patches-v143.txt @@ -943,10 +943,10 @@ spin sdk 541e54 541f98 # 32 instructions; loads # switched off 1.2.1 draws the gameplay HUD and the system menu the same at 21:9, so what they adjust is not known yet. # - DefaultAspect's default (main+0x2d06910, 16/9): the camera parameter reader takes the page's. site aspect main 1aa0ac4 d0009328 @page:x8 # adrp x8, 0x2d06000 -> adrp x8, page -site aspect main 1aa0ac8 91244108 91010108 # add x8, x8, #0x910 -> add x8, x8, #64 +site aspect main 1aa0ac8 91244108 91014108 # add x8, x8, #0x910 -> add x8, x8, #80 # - The two camera-viewport updates: the division becomes a load of the page's aspect (x9 is set again just after). -site aspect main 1ff04f4 1e211800 @page:x9 bd404120 # fdiv s0, s0, s1 -> adrp x9, page; ldr s0, [x9, #64] -site aspect main 253fbb0 1e211800 @page:x9 bd404120 # fdiv s0, s0, s1 +site aspect main 1ff04f4 1e211800 @page:x9 bd405120 # fdiv s0, s0, s1 -> adrp x9, page; ldr s0, [x9, #80] +site aspect main 253fbb0 1e211800 @page:x9 bd405120 # fdiv s0, s0, s1 # - Loads of the 2D canvas size {width, height}, each followed by the multiplication (x9 and s2 saved around it). -site aspect main 2136fa8 2d4307a0 2d4307a0 f81f0fe9 bd000be2 @page:x9 bd404522 1e220800 bd404922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x29, #0x18] -site aspect main 213641c 2d4103e1 2d4103e1 f81f0fe9 bd000be2 @page:x9 bd404522 1e220821 bd404922 1e220800 bd400be2 f84107e9 # ldp s1, s0, [sp, #8] (width in s1) +site aspect main 2136fa8 2d4307a0 2d4307a0 f81f0fe9 bd000be2 @page:x9 bd405522 1e220800 bd405922 1e220821 bd400be2 f84107e9 # ldp s0, s1, [x29, #0x18] +site aspect main 213641c 2d4103e1 2d4103e1 f81f0fe9 bd000be2 @page:x9 bd405522 1e220821 bd405922 1e220800 bd400be2 f84107e9 # ldp s1, s0, [sp, #8] (width in s1) diff --git a/recomp/patches.py b/recomp/patches.py index 99c3cc49..1075131e 100644 --- a/recomp/patches.py +++ b/recomp/patches.py @@ -11,7 +11,10 @@ Lifted code cannot be byte-patched when the game runs, so a patch is applied whe
is a module offset (hex),