mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2025-02-17 02:26:20 +01:00
Update xcx graphics mod to version 7
was version 5 and version 5 is weird and version 7 makes the code easier to read, and the moduleMatch for XCX 1.0.1U was for some reason in decimal and not hex
This commit is contained in:
parent
d789437df2
commit
6646f35ea4
51
src/XenobladeChroniclesX/Graphics/patch_resolution.asm
Normal file
51
src/XenobladeChroniclesX/Graphics/patch_resolution.asm
Normal file
@ -0,0 +1,51 @@
|
||||
[XCX_Aspect]
|
||||
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D, 0x218F6E07, 0xAB97DE6B, 0x676EB33E, 0x785CA8A9, 0x8780C48F ; 1.0.1E, 1.0.2U, 1.0.2J, 1.0.0E, 1.0.1U, 1.0.0U, 1.0.0J, 1.0.1J
|
||||
.origin = codecave
|
||||
|
||||
widthScaleRatio:
|
||||
.float ($width/$gameWidth)
|
||||
heightScaleRatio:
|
||||
.float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave:
|
||||
; Scale the width of the viewport that it wants to calculate the ratio for
|
||||
lis r7, widthScaleRatio@ha
|
||||
lfs f8, widthScaleRatio@l(r7)
|
||||
fmuls f13, f13, f8
|
||||
; Scale the height of the viewport that it wants to calculate the ratio for
|
||||
lis r7, heightScaleRatio@ha
|
||||
lfs f8, heightScaleRatio@l(r7)
|
||||
fmuls f9, f9, f8
|
||||
|
||||
fdivs f13, f13, f9 ; Original instruction that got replaced by the code cave jump, which divides the width and height to get the aspect ratio
|
||||
blr ; Return to the original code
|
||||
|
||||
[XCXAspect_V101E]
|
||||
moduleMatches = 0xF882D5CF, 0x218F6E07 ; 1.0.1E, 1.0.0E
|
||||
0x03160AE8 = bla _aspectChangeCave ; Modify this instruction to go to the code cave which scales the height and width to the upscale ratios
|
||||
0x1003E754 = .float ($width/$height) ; Modify constant that has a ratio in the code
|
||||
|
||||
[XCXAspect_V102U]
|
||||
moduleMatches = 0x30B6E091 ; 1.0.2U
|
||||
0x03160A68 = bla _aspectChangeCave
|
||||
0x1003E754 = .float ($width/$height)
|
||||
|
||||
[XCXAspect_V102J]
|
||||
moduleMatches = 0x7672271D ; 1.0.2J
|
||||
0x0315BE80 = bla _aspectChangeCave
|
||||
0x1003E714 = .float $width/$height
|
||||
|
||||
[XCXAspect_V100U]
|
||||
moduleMatches = 0xAB97DE6B, 0x676EB33E ; 1.0.1U, 1.0.0U
|
||||
0x031608E8 = bla _aspectChangeCave
|
||||
0x1003E754 = .float ($width/$height)
|
||||
|
||||
[XCXAspect_V100J]
|
||||
moduleMatches = 0x785CA8A9 ; 1.0.0J
|
||||
0x03156880 = bla _aspectChangeCave
|
||||
0x1003E6C4 = .float ($width/$height)
|
||||
|
||||
[XCXAspect_V101J]
|
||||
moduleMatches = 0x8780C48F ; 1.0.1J
|
||||
0x0315BBA8 = bla _aspectChangeCave
|
||||
0x1003E714 = .float ($width/$height)
|
@ -1,161 +0,0 @@
|
||||
[XCXAspectV100E_V101E]
|
||||
moduleMatches = 0x218F6E07, 0xF882D5CF
|
||||
|
||||
# Code cave
|
||||
codeCaveSize = 0x0000028
|
||||
|
||||
_widthScaleRatio = 0x0000000
|
||||
0x0000000 = .float ($width/$gameWidth)
|
||||
_heightScaleRatio = 0x0000004
|
||||
0x0000004 = .float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave = 0x0000008
|
||||
; Scale the width of the viewport that it wants to calculate the ratio for
|
||||
0x0000008 = lis r7, _widthScaleRatio@ha
|
||||
0x000000C = lfs f8, _widthScaleRatio@l(r7)
|
||||
0x0000010 = fmuls f13, f13, f8
|
||||
; Scale the height of the viewport that it wants to calculate the ratio for
|
||||
0x0000014 = lis r7, _heightScaleRatio@ha
|
||||
0x0000018 = lfs f8, _heightScaleRatio@l(r7)
|
||||
0x000001C = fmuls f9, f9, f8
|
||||
|
||||
0x0000020 = fdivs f13, f13, f9 ; Original instruction that got replaced by the code cave jump, which divides the width and height to get the aspect ratio
|
||||
0x0000024 = blr ; Return to the original code
|
||||
|
||||
# Code changes
|
||||
0x03160AE8 = bla _aspectChangeCave ; Modify this instruction to go to the code cave which scales the height and width to the upscale ratios
|
||||
0x1003E754 = .float ($width/$height) ; Modify constant that has a ratio in the code
|
||||
|
||||
|
||||
[XCXAspectV102U]
|
||||
moduleMatches = 0x30B6E091
|
||||
|
||||
# Code cave
|
||||
codeCaveSize = 0x0000028
|
||||
|
||||
_widthScaleRatio = 0x0000000
|
||||
0x0000000 = .float ($width/$gameWidth)
|
||||
_heightScaleRatio = 0x0000004
|
||||
0x0000004 = .float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave = 0x0000008
|
||||
0x0000008 = lis r7, _widthScaleRatio@ha
|
||||
0x000000C = lfs f8, _widthScaleRatio@l(r7)
|
||||
0x0000010 = fmuls f13, f13, f8
|
||||
0x0000014 = lis r7, _heightScaleRatio@ha
|
||||
0x0000018 = lfs f8, _heightScaleRatio@l(r7)
|
||||
0x000001C = fmuls f9, f9, f8
|
||||
|
||||
0x0000020 = fdivs f13, f13, f9
|
||||
0x0000024 = blr
|
||||
|
||||
# Code changes
|
||||
0x03160A68 = bla _aspectChangeCave
|
||||
0x1003E754 = .float ($width/$height)
|
||||
|
||||
|
||||
[XCXAspectV100U_V101U]
|
||||
moduleMatches = 2878856811, 0x676EB33E
|
||||
|
||||
# Code cave
|
||||
codeCaveSize = 0x0000028
|
||||
|
||||
_widthScaleRatio = 0x0000000
|
||||
0x0000000 = .float ($width/$gameWidth)
|
||||
_heightScaleRatio = 0x0000004
|
||||
0x0000004 = .float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave = 0x0000008
|
||||
0x0000008 = lis r7, _widthScaleRatio@ha
|
||||
0x000000C = lfs f8, _widthScaleRatio@l(r7)
|
||||
0x0000010 = fmuls f13, f13, f8
|
||||
0x0000014 = lis r7, _heightScaleRatio@ha
|
||||
0x0000018 = lfs f8, _heightScaleRatio@l(r7)
|
||||
0x000001C = fmuls f9, f9, f8
|
||||
|
||||
0x0000020 = fdivs f13, f13, f9
|
||||
0x0000024 = blr
|
||||
|
||||
|
||||
# Code changes
|
||||
0x031608E8 = bla _aspectChangeCave
|
||||
0x1003E754 = .float ($width/$height)
|
||||
|
||||
|
||||
[XCXAspectV100J]
|
||||
moduleMatches = 0x785CA8A9
|
||||
|
||||
# Code cave
|
||||
codeCaveSize = 0x0000028
|
||||
|
||||
_widthScaleRatio = 0x0000000
|
||||
0x0000000 = .float ($width/$gameWidth)
|
||||
_heightScaleRatio = 0x0000004
|
||||
0x0000004 = .float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave = 0x0000008
|
||||
0x0000008 = lis r7, _widthScaleRatio@ha
|
||||
0x000000C = lfs f8, _widthScaleRatio@l(r7)
|
||||
0x0000010 = fmuls f13, f13, f8
|
||||
0x0000014 = lis r7, _heightScaleRatio@ha
|
||||
0x0000018 = lfs f8, _heightScaleRatio@l(r7)
|
||||
0x000001C = fmuls f9, f9, f8
|
||||
|
||||
0x0000020 = fdivs f13, f13, f9
|
||||
0x0000024 = blr
|
||||
|
||||
# Code changes
|
||||
0x03156880 = bla _aspectChangeCave
|
||||
0x1003E6C4 = .float ($width/$height)
|
||||
|
||||
[XCXAspectV101J]
|
||||
moduleMatches = 0x8780C48F
|
||||
|
||||
# Code cave
|
||||
codeCaveSize = 0x0000028
|
||||
|
||||
_widthScaleRatio = 0x0000000
|
||||
0x0000000 = .float ($width/$gameWidth)
|
||||
_heightScaleRatio = 0x0000004
|
||||
0x0000004 = .float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave = 0x0000008
|
||||
0x0000008 = lis r7, _widthScaleRatio@ha
|
||||
0x000000C = lfs f8, _widthScaleRatio@l(r7)
|
||||
0x0000010 = fmuls f13, f13, f8
|
||||
0x0000014 = lis r7, _heightScaleRatio@ha
|
||||
0x0000018 = lfs f8, _heightScaleRatio@l(r7)
|
||||
0x000001C = fmuls f9, f9, f8
|
||||
|
||||
0x0000020 = fdivs f13, f13, f9
|
||||
0x0000024 = blr
|
||||
|
||||
# Code changes
|
||||
0x0315BBA8 = bla _aspectChangeCave
|
||||
0x1003E714 = .float ($width/$height)
|
||||
|
||||
[XCXAspectV102J]
|
||||
moduleMatches = 0x7672271D
|
||||
|
||||
# Code cave
|
||||
codeCaveSize = 0x0000028
|
||||
|
||||
_widthScaleRatio = 0x0000000
|
||||
0x0000000 = .float ($width/$gameWidth)
|
||||
_heightScaleRatio = 0x0000004
|
||||
0x0000004 = .float ($height/$gameHeight)
|
||||
|
||||
_aspectChangeCave = 0x0000008
|
||||
0x0000008 = lis r7, _widthScaleRatio@ha
|
||||
0x000000C = lfs f8, _widthScaleRatio@l(r7)
|
||||
0x0000010 = fmuls f13, f13, f8
|
||||
0x0000014 = lis r7, _heightScaleRatio@ha
|
||||
0x0000018 = lfs f8, _heightScaleRatio@l(r7)
|
||||
0x000001C = fmuls f9, f9, f8
|
||||
|
||||
0x0000020 = fdivs f13, f13, f9
|
||||
0x0000024 = blr
|
||||
|
||||
# Code changes
|
||||
0x0315BE80 = bla _aspectChangeCave
|
||||
0x1003E714 = .float $width/$height
|
Loading…
x
Reference in New Issue
Block a user