diff --git a/src/MarioKart8/Graphics/patch_AspectRatio.asm b/src/MarioKart8/Graphics/patch_AspectRatio.asm new file mode 100644 index 00000000..362ada98 --- /dev/null +++ b/src/MarioKart8/Graphics/patch_AspectRatio.asm @@ -0,0 +1,68 @@ +[MK8_AspectRatio_Shared] +moduleMatches = 0x9F0A90B7,0xD09700CE,0x1D398493,0xBA6B1E20,0x62A5F023,0x2A2DC82C + +.origin = codecave + +aspectRatio: +.float ((($gameHeight/$height)*$width)/$gameWidth) + +scaleAspectRatioCalc: +fdivs f9, f13, f12 +lis r7, aspectRatio@ha +lfs f12, aspectRatio@l(r7) +fmuls f7, f9, f12 +blr + + +[MK8_AspectRatio_V42] +moduleMatches = 0x9F0A90B7 + +0x024AEF70 = bla scaleAspectRatioCalc + +0x100C359C = .float ($width/$height) +0x10121E30 = .float ($width/$height) + + +[MK8_AspectRatio_V41] +moduleMatches = 0xD09700CE + +0x024AEBEC = bla scaleAspectRatioCalc + +0x100C359C = .float ($width/$height) +0x10121E30 = .float ($width/$height) + + +[MK8_AspectRatio_V4] +moduleMatches = 0x1D398493 + +0x024AEBEC = bla scaleAspectRatioCalc + +0x100C359C = .float ($width/$height) +0x10121D30 = .float ($width/$height) + + +[MK8_AspectRatio_V3] +moduleMatches = 0xBA6B1E20 + +0x024642E8 = bla scaleAspectRatioCalc + +0x100AC25C = .float ($width/$height) +0x1010A730 = .float ($width/$height) + + +[MK8_AspectRatio_V2] +moduleMatches = 0x62A5F023 + +0x024376D4 = bla scaleAspectRatioCalc + +0x1009E9DC = .float ($width/$height) +0x100FC030 = .float ($width/$height) + + +[MK8_AspectRatio_V1] +moduleMatches = 0x2A2DC82C + +0x02416760 = bla scaleAspectRatioCalc + +0x10097D94 = .float ($width/$height) +0x100F3430 = .float ($width/$height) diff --git a/src/MarioKart8/Graphics/patch_DisableFXAA.asm b/src/MarioKart8/Graphics/patch_DisableFXAA.asm new file mode 100644 index 00000000..4c4ac62c --- /dev/null +++ b/src/MarioKart8/Graphics/patch_DisableFXAA.asm @@ -0,0 +1,10 @@ +[MK8_DisableFXAA_V42] +moduleMatches = 0x9F0A90B7 + +0x027DF528 = blr + + +[MK8_DisableFXAA_V41] +moduleMatches = 0xD09700CE + +0x027DF2F4 = blr diff --git a/src/MarioKart8/Graphics/patch_LevelOfDetail.asm b/src/MarioKart8/Graphics/patch_LevelOfDetail.asm new file mode 100644 index 00000000..c3d78dec --- /dev/null +++ b/src/MarioKart8/Graphics/patch_LevelOfDetail.asm @@ -0,0 +1,4 @@ +[MK8_LevelOfDetail_V42_V41] +moduleMatches = 0x9F0A90B7,0xD09700CE + +0x10121DF0 = .float $levelOfDetail \ No newline at end of file diff --git a/src/MarioKart8/Graphics/patches.txt b/src/MarioKart8/Graphics/patches.txt deleted file mode 100644 index ba3f8e83..00000000 --- a/src/MarioKart8/Graphics/patches.txt +++ /dev/null @@ -1,114 +0,0 @@ -[MK8AspectVer1] -moduleMatches = 0x2A2DC82C -0x10097D94 = .float $width/$height -0x100F3430 = .float $width/$height - -#aspect scaling -codeCaveSize = 0x18 - -_scaleAspect = 0x00000004 -0x00000000 = .float (($gameHeight/$height)*$width)/$gameWidth -_scaleAddr = 0x00000000 -0x00000004 = fdivs f9, f13, f12 -0x00000008 = lis r7, _scaleAddr@ha -0x0000000C = lfs f12, _scaleAddr@l(r7) -0x00000010 = fmuls f7, f9, f12 -0x00000014 = blr - -#replace math with branch -0x02416760 = bla _scaleAspect - -[MK8AspectVer2] -moduleMatches = 0x62A5F023 -0x1009E9DC = .float $width/$height -0x100FC030 = .float $width/$height - -#aspect scaling -codeCaveSize = 0x18 - -_scaleAspect = 0x00000004 -0x00000000 = .float (($gameHeight/$height)*$width)/$gameWidth -_scaleAddr = 0x00000000 -0x00000004 = fdivs f9, f13, f12 -0x00000008 = lis r7, _scaleAddr@ha -0x0000000C = lfs f12, _scaleAddr@l(r7) -0x00000010 = fmuls f7, f9, f12 -0x00000014 = blr - -#replace math with branch -0x024376D4 = bla _scaleAspect - -[MK8AspectVer3] -moduleMatches = 0xBA6B1E20 -0x100AC25C = .float $width/$height -0x1010A730 = .float $width/$height - -#aspect scaling -codeCaveSize = 0x18 - -_scaleAspect = 0x00000004 -0x00000000 = .float (($gameHeight/$height)*$width)/$gameWidth -_scaleAddr = 0x00000000 -0x00000004 = fdivs f9, f13, f12 -0x00000008 = lis r7, _scaleAddr@ha -0x0000000C = lfs f12, _scaleAddr@l(r7) -0x00000010 = fmuls f7, f9, f12 -0x00000014 = blr - -#replace math with branch -0x024642E8 = bla _scaleAspect - -[MK8AspectVer4] -moduleMatches = 0x1D398493 -0x100C359C = .float $width/$height -0x10121D30 = .float $width/$height - -#aspect scaling -codeCaveSize = 0x18 - -_scaleAspect = 0x00000004 -0x00000000 = .float (($gameHeight/$height)*$width)/$gameWidth -_scaleAddr = 0x00000000 -0x00000004 = fdivs f9, f13, f12 -0x00000008 = lis r7, _scaleAddr@ha -0x0000000C = lfs f12, _scaleAddr@l(r7) -0x00000010 = fmuls f7, f9, f12 -0x00000014 = blr - -#replace math with branch -0x024AEBEC = bla _scaleAspect - -[MK8AspectVer4_1] -moduleMatches = 0xD09700CE -0x100C359C = .float $width/$height -0x10121E30 = .float $width/$height - -#aspect scaling -codeCaveSize = 0x18 - -_scaleAspect = 0x00000004 -0x00000000 = .float (($gameHeight/$height)*$width)/$gameWidth -_scaleAddr = 0x00000000 -0x00000004 = fdivs f9, f13, f12 -0x00000008 = lis r7, _scaleAddr@ha -0x0000000C = lfs f12, _scaleAddr@l(r7) -0x00000010 = fmuls f7, f9, f12 -0x00000014 = blr - -#replace math with branch -0x024AEBEC = bla _scaleAspect - -# FXAA In-Game - -[MK8FXAAVer4_1] -moduleMatches = 0xD09700CE - -0x027DF2F4 = blr - -# Level of Detail - -[MK8LODVer4_1] -moduleMatches = 0xD09700CE - -0x10121DF0 = .float $levelOfDetail - diff --git a/src/MarioKart8/Mods/60FPSMultiplayer/patch_60FPSFullDraw.asm b/src/MarioKart8/Mods/60FPSMultiplayer/patch_60FPSFullDraw.asm new file mode 100644 index 00000000..c6e5cba3 --- /dev/null +++ b/src/MarioKart8/Mods/60FPSMultiplayer/patch_60FPSFullDraw.asm @@ -0,0 +1,10 @@ +[MK8_60FPSFullDraw_V42] +moduleMatches = 0x9F0A90B7 + +0x024AF384 = b .+0x54 + + +[MK8_60FPSFullDraw_V41] +moduleMatches = 0xD09700CE + +0x024AF000 = b .+0x54 diff --git a/src/MarioKart8/Mods/60FPSMultiplayer/patches.txt b/src/MarioKart8/Mods/60FPSMultiplayer/patches.txt deleted file mode 100644 index eb435ec2..00000000 --- a/src/MarioKart8/Mods/60FPSMultiplayer/patches.txt +++ /dev/null @@ -1,3 +0,0 @@ -[MK8FullDrawVer4_1] -moduleMatches = 0xD09700CE -0x24AF000 = b .+0x54 \ No newline at end of file