From 2b45c4095d22bb6abb0b5df5a7cb849f6844d43e Mon Sep 17 00:00:00 2001 From: Rajko Stojadinovic Date: Thu, 1 Feb 2018 11:40:29 +0100 Subject: [PATCH] Update Botw patches.txt (except FPS++) for 1.5.0 --- Enhancement/BreathOfTheWild_30FPS/patches.txt | 7 ++++ Source/BreathOfTheWild/patches.txt | 16 +++++++++ .../BreathOfTheWild_LwzxNullCheck/patches.txt | 35 ++++++++++++++++++- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/Enhancement/BreathOfTheWild_30FPS/patches.txt b/Enhancement/BreathOfTheWild_30FPS/patches.txt index 1c8ef045..b9194f6c 100644 --- a/Enhancement/BreathOfTheWild_30FPS/patches.txt +++ b/Enhancement/BreathOfTheWild_30FPS/patches.txt @@ -60,3 +60,10 @@ moduleMatches = 0xFD091F9F,0xD472D8A5 ;0x031FA004 = nop ;disables gx2 fence 0x031FA1D4 = nop ;disables wait for vsync 0x031FA1F8 = nop ;disables wait for vsync loop + +[BotwNoVsyncV208] +moduleMatches = 0x6267BFD0 + +;0x031FAB00 = nop ;disables gx2 fence +0x031FACD0 = nop ;disables wait for vsync +0x031FACF4 = nop ;disables wait for vsync loop \ No newline at end of file diff --git a/Source/BreathOfTheWild/patches.txt b/Source/BreathOfTheWild/patches.txt index a101a2d7..357c7eee 100644 --- a/Source/BreathOfTheWild/patches.txt +++ b/Source/BreathOfTheWild/patches.txt @@ -152,3 +152,19 @@ _aspectAddr = 0x101BF878 # 3d aspect (calculated every frame) 0x0386C314 = lis r28, ha16(_aspectAddr) 0x0386C318 = lfs f12, _aspectAddr(r28) + +[BotwAspectsV208] +moduleMatches = 0x6267BFD0 +# rodata constants +0x101BF8E8 = .float +0x1030A57C = .float +0x1036DD4C = .float +_aspectAddr = 0x101BF8E8 + +# menu link aspect (calculated every load) +0x02E2C564 = lis r9, _aspectAddr@ha +0x02E2C578 = lfs f4, _aspectAddr@l(r9) + +# 3d aspect (calculated every frame) +0x0386D01C = lis r28, ha16(_aspectAddr) +0x0386D020 = lfs f12, _aspectAddr(r28) diff --git a/Workaround/BreathOfTheWild_LwzxNullCheck/patches.txt b/Workaround/BreathOfTheWild_LwzxNullCheck/patches.txt index 499d8277..9b9c56e3 100644 --- a/Workaround/BreathOfTheWild_LwzxNullCheck/patches.txt +++ b/Workaround/BreathOfTheWild_LwzxNullCheck/patches.txt @@ -293,4 +293,37 @@ _lwzCheck = 0x00000020 ; null checked version of 'lwz r8, 0(r31)' 0x038E3BE4 = bla _lwzCheck 0x038E3C50 = bla _lwzxCheck -0x038E3C5C = bla _lwzCheck \ No newline at end of file +0x038E3C5C = bla _lwzCheck + +[BotwPlsNoCrashV208] +moduleMatches = 0x6267BFD0 +#restore the 2 instructions possibly overwritten by cemu itself +0x038E46CC = stwu r1, -0x28(r1) +0x038E46D0 = mflr r0 + +#null check functions +codeCaveSize = 0x40 + +_lwzxCheck = 0x00000000 ; null checked version of 'lwzx r31, r9, r0' +0x00000000 = add r30, r9, r0 +0x00000004 = xor r31, r31, r31 +0x00000008 = cmpwi r30, 0 +0x0000000C = beq .+0x8 +0x00000010 = lwzx r31, r9, r0 +0x00000014 = blr + +_lwzCheck = 0x00000020 ; null checked version of 'lwz r8, 0(r31)' +0x00000020 = xor r8, r8, r8 +0x00000024 = oris r8, r8, 0xD15A +0x00000028 = ori r8, r8, 0xB1ED +0x0000002C = cmpwi r31, 0 +0x00000030 = beq .+0x8 +0x00000034 = lwz r8, 0(r31) +0x00000038 = blr + +#replace simple loads with calls to these funcs +0x038E4874 = bla _lwzxCheck +0x038E4880 = bla _lwzCheck + +0x038E48EC = bla _lwzxCheck +0x038E48F8 = bla _lwzCheck \ No newline at end of file