diff --git a/SaltySD/exceptions.txt b/SaltySD/exceptions.txt index a415f7b..8ea870c 100644 --- a/SaltySD/exceptions.txt +++ b/SaltySD/exceptions.txt @@ -58,7 +58,3 @@ X0100423009358000 ;Splatoon 3 ;10.0.0 upwards crashes after online match X0100C2500FC20000 - -;Hollow Knight: Silksong -;1.0.28324 crash on boot -X010013C00E930000 diff --git a/SaltySD/plugins/FPSLocker/patches/010000B01A452000/7C724F497564C027.yaml b/SaltySD/plugins/FPSLocker/patches/010000B01A452000/7C724F497564C027.yaml index 824e73d..b2b2708 100644 --- a/SaltySD/plugins/FPSLocker/patches/010000B01A452000/7C724F497564C027.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010000B01A452000/7C724F497564C027.yaml @@ -1,8 +1,6 @@ # Jujutsu Kaisen Cursed Clash US 1.4.0 # BID: 7C724F497564C027 -unsafeCheck: true - ALL_FPS: # r.DynamicRes.FrameTimeBudget - @@ -26,8 +24,10 @@ ALL_FPS: - type: write address: [MAIN, 0x849B7A8, 0x9C4] + address_unsafe: true value_type: uint32 value: 7 - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/0100011005D92000/A3A998AF3252D110.yaml b/SaltySD/plugins/FPSLocker/patches/0100011005D92000/A3A998AF3252D110.yaml index fbe3e82..9d5bc71 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100011005D92000/A3A998AF3252D110.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100011005D92000/A3A998AF3252D110.yaml @@ -1,42 +1,24 @@ # Batman - The Telltale Series 1.0.4 # BID: A3A998AF3252D110 -unsafeCheck: true - -MASTER_WRITE: -# Remove double buffer +DECLARATIONS: - - type: asm_a64 - main_offset: 0x6440 - instructions: [ - [mov, w2, 3], - [madd, x1, x8, x2, x9] - ] - - - type: bytes - main_offset: 0xC5A6D8 - value_type: uint32 - value: 0x188CC50 - - - type: bytes - main_offset: 0x1758A90 - value_type: uint32 - value: 0x188CC50 - - - type: asm_a64 - main_offset: 0xC56550 + type: code + name: tripleBuffer instructions: [ + [stp, x29, x30, [sp, -16], "!"], + [mov, x29, sp], [ldr, x0, [x26, 0x10]], - [cbz, x0, +24], + [cbz, x0, :goto1], [adrp, x8, 0x1758000], [ldr, x8, [x8, 0x90]], [ldr, x8, [x8]], [blr, x8], - [b, +16], - [mov, w0, 0xc0], + [b, :goto2], + :goto1, [mov, w0, 0xc0], [bl, 0x735480], [str, x0, [x26, 0x10]], - [ldr, x22, [x27]], + :goto2, [ldr, x22, [x27]], [adrp, x27, 0x1757000], [ldr, x21, [x25]], [ldr, x27, [x27, 0xf38]], @@ -62,13 +44,34 @@ MASTER_WRITE: [mov, x1, x23], [blr, x8], [adrp, x22, 0x1758000], - [b, 0x5eec] + [ldp, x29, x30, [sp], 16], + [ret] + ] + +MASTER_WRITE: +# Remove double buffer + - + type: asm_a64 + main_offset: 0x6440 + instructions: [ + [mov, w2, 3], + [madd, x1, x8, x2, x9] ] + - + type: bytes + main_offset: 0xC5A6D8 + value_type: uint32 + value: 0x188CC50 + - + type: bytes + main_offset: 0x1758A90 + value_type: uint32 + value: 0x188CC50 - type: asm_a64 main_offset: 0x5EE8 instructions: [ - [b, 0xc56550] + [bl, _tripleBuffer()] ] - type: asm_a64 @@ -82,10 +85,4 @@ MASTER_WRITE: instructions: [ [mov, x2, 0x1950000] ] -ALL_FPS: - # dummy - - - type: write - address: [MAIN, 0x188CF00] - value_type: uint8 - value: 0 + diff --git a/SaltySD/plugins/FPSLocker/patches/010008301AA96000/88CC45A195E0BDA8.yaml b/SaltySD/plugins/FPSLocker/patches/010008301AA96000/88CC45A195E0BDA8.yaml index ffdae14..ec4f803 100644 --- a/SaltySD/plugins/FPSLocker/patches/010008301AA96000/88CC45A195E0BDA8.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010008301AA96000/88CC45A195E0BDA8.yaml @@ -1,8 +1,13 @@ # Tiebreak+: Official Game of the ATP and WTA 1.3.0 # BID: 88CC45A195E0BDA8 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.03333333333 + evaluate: "0.8 / FPS_TARGET" # we are using this trick because function is overengineered and it's not easy to just use standard 1 / FPS_TARGET MASTER_WRITE: # Triple buffer # REF: 00 40 00 00 00 04 00 00 00 88 00 00 02 00 00 00 @@ -17,20 +22,7 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x147BE04 instructions: [ - [adrp, x8, 0x30c3000], - [ldr, s3, [x8, 0xf00]], + [adrp, x8, $dr_target], + [ldr, s3, [x8, $dr_target]], [nop] ] - ## Default values - - - type: bytes - main_offset: 0x30C3F00 - value_type: float - value: 0.03333333333 -ALL_FPS: - # Adjust Dynamic Resolution target, we are using this trick because function is overengineered and it's not easy to just use standard 1 / FPS_TARGET - - - type: evaluate_write - address: [MAIN, 0x30C3F00] - value_type: float - value: "0.8 / FPS_TARGET" diff --git a/SaltySD/plugins/FPSLocker/patches/010009D018A06000/010009D018A06000/33614E4F6B3267B3.yaml b/SaltySD/plugins/FPSLocker/patches/010009D018A06000/010009D018A06000/33614E4F6B3267B3.yaml new file mode 100644 index 0000000..c16de64 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/010009D018A06000/010009D018A06000/33614E4F6B3267B3.yaml @@ -0,0 +1,25 @@ +# SWORD ART ONLINE Fractured Daydream JAP 1.4.1.1 +# BID: 33614E4F6B3267B3 + +ALL_FPS: + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x90A0758, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 1)", "TruncDec(FRAMETIME_TARGET, 1)"] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x90DB2B0, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + # r.VSync + - + type: write + address: [MAIN, 0x88DAF88, 0] + value_type: uint32 + value: [0, 0] + - + type: block + what: timing \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/010009D018A06000/C2F2C4B700B30598.yaml b/SaltySD/plugins/FPSLocker/patches/010009D018A06000/C2F2C4B700B30598.yaml index 644fe70..624deff 100644 --- a/SaltySD/plugins/FPSLocker/patches/010009D018A06000/C2F2C4B700B30598.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010009D018A06000/C2F2C4B700B30598.yaml @@ -1,8 +1,6 @@ # SWORD ART ONLINE Fractured Daydream JAP 1.3.0 # BID: C2F2C4B700B30598 -unsafeCheck: true - ALL_FPS: # r.DynamicRes.FrameTimeBudget - @@ -24,4 +22,4 @@ ALL_FPS: value: [0, 0] - type: block - what: timing \ No newline at end of file + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/01000AA013A5E000/B26DE1669B729335.yaml b/SaltySD/plugins/FPSLocker/patches/01000AA013A5E000/B26DE1669B729335.yaml index 9105c85..cb2f5a2 100644 --- a/SaltySD/plugins/FPSLocker/patches/01000AA013A5E000/B26DE1669B729335.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01000AA013A5E000/B26DE1669B729335.yaml @@ -1,13 +1,12 @@ # Breathedge 1.0.2 # BID: B26DE1669B729335 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate - type: write address: [MAIN, 0x55CB668, 0x7F0] + address_unsafe: true value_type: uint32 value: 7 # t.MaxFPS diff --git a/SaltySD/plugins/FPSLocker/patches/01000AD01F94A000/505069EBC0B82A6F.yaml b/SaltySD/plugins/FPSLocker/patches/01000AD01F94A000/505069EBC0B82A6F.yaml new file mode 100644 index 0000000..4c3977a --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01000AD01F94A000/505069EBC0B82A6F.yaml @@ -0,0 +1,25 @@ +# Tony Hawk's Pro Skater 3 + 4 1.06 +# BID: 505069EBC0B82A6F + +ALL_FPS: + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x77EC4B8, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(FRAMETIME_TARGET, 2)"] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x781A6A0, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + # r.VSync + - + type: write + address: [MAIN, 0x7014598, 0] + value_type: uint32 + value: [0, 0] + - + type: block + what: timing \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/01000B202041A000/725731C74E4CA6A9.yaml b/SaltySD/plugins/FPSLocker/patches/01000B202041A000/725731C74E4CA6A9.yaml index 41df9a0..438f83c 100644 --- a/SaltySD/plugins/FPSLocker/patches/01000B202041A000/725731C74E4CA6A9.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01000B202041A000/725731C74E4CA6A9.yaml @@ -1,12 +1,11 @@ # DreadOut Remastered Collection 1.0.2 # BID: 725731C74E4CA6A9 -unsafeCheck: false - ALL_FPS: # REF: DynamicResolution::.cctor - type: evaluate_write address: [MAIN, 0x3E01640, 0, 0xB8, 8] + address_unsafe: true value_type: double value: [FPS_TARGET, FRAMETIME_TARGET] \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/010010A01BBF4000/47A022F858BA09B1.yaml b/SaltySD/plugins/FPSLocker/patches/010010A01BBF4000/47A022F858BA09B1.yaml index bfeb5f7..d610bb9 100644 --- a/SaltySD/plugins/FPSLocker/patches/010010A01BBF4000/47A022F858BA09B1.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010010A01BBF4000/47A022F858BA09B1.yaml @@ -1,12 +1,11 @@ # The Forest Quartet 4.0.2 # BID: 47A022F858BA09B1 -unsafeCheck: false - ALL_FPS: # DynamicResolution_TypeInfo - type: evaluate_write address: [MAIN, 0x4B320A0, 0xB8, 0] + address_unsafe: true value_type: double value: ["0.96 * FRAMETIME_TARGET", "(0.96 * FRAMETIME_TARGET) - 0.75"] diff --git a/SaltySD/plugins/FPSLocker/patches/010010F01418E000/49CF6B0B0A62F9E2.yaml b/SaltySD/plugins/FPSLocker/patches/010010F01418E000/49CF6B0B0A62F9E2.yaml index 6003f85..18c357d 100644 --- a/SaltySD/plugins/FPSLocker/patches/010010F01418E000/49CF6B0B0A62F9E2.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010010F01418E000/49CF6B0B0A62F9E2.yaml @@ -1,8 +1,6 @@ # Remnant: From The Ashes 1.0.1 # BID: 49CF6B0B0A62F9E2 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.MaxGPUTime ((1000/FPS) * 0.93) - diff --git a/SaltySD/plugins/FPSLocker/patches/010018601E9E0000/31A37D73E22F1059.yaml b/SaltySD/plugins/FPSLocker/patches/010018601E9E0000/31A37D73E22F1059.yaml index 0de0257..eb9f87f 100644 --- a/SaltySD/plugins/FPSLocker/patches/010018601E9E0000/31A37D73E22F1059.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010018601E9E0000/31A37D73E22F1059.yaml @@ -1,13 +1,12 @@ # Bakery Simulator 1.1.0 # BID: 31A37D73E22F1059 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x5F9B6A8, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/01001A700C832000/97FC79E063E26C9B.yaml b/SaltySD/plugins/FPSLocker/patches/01001A700C832000/97FC79E063E26C9B.yaml index bfc8bf5..cf26cc7 100644 --- a/SaltySD/plugins/FPSLocker/patches/01001A700C832000/97FC79E063E26C9B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01001A700C832000/97FC79E063E26C9B.yaml @@ -1,8 +1,6 @@ # Fate/EXTELLA LINK 1.0.2 # BID: 97FC79E063E26C9B -unsafeCheck: true - MASTER_WRITE: # Remove double buffer - @@ -11,11 +9,3 @@ MASTER_WRITE: instructions: [ [mov, x8, 0x300000003] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x4740500] - value_type: uint8 - value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/01001C700873E000/C0F144F5139F542E.yaml b/SaltySD/plugins/FPSLocker/patches/01001C700873E000/C0F144F5139F542E.yaml index 1d98122..08fc383 100644 --- a/SaltySD/plugins/FPSLocker/patches/01001C700873E000/C0F144F5139F542E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01001C700873E000/C0F144F5139F542E.yaml @@ -1,8 +1,6 @@ # GOD EATER 3 2.5.1 # BID: C0F144F5139F542E -unsafeCheck: true - MASTER_WRITE: # Remove double buffer - @@ -11,10 +9,3 @@ MASTER_WRITE: instructions: [ [mov, x8, 0x300000003] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0xA7FA900] - value_type: uint8 - value: 0 diff --git a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/26AB1CB54DD4508D.yaml b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/26AB1CB54DD4508D.yaml index 93b85e4..e8040ad 100644 --- a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/26AB1CB54DD4508D.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/26AB1CB54DD4508D.yaml @@ -1,8 +1,6 @@ # Goat Simulator 3 1.0.7.3 # BID: 26AB1CB54DD4508D -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget - diff --git a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/8D4FD57DB7D63120.yaml b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/8D4FD57DB7D63120.yaml index 5c17673..e7d7373 100644 --- a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/8D4FD57DB7D63120.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/8D4FD57DB7D63120.yaml @@ -1,8 +1,6 @@ # Goat Simulator 3 1.0.7.6 # BID: 8D4FD57DB7D63120 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget - diff --git a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/A5DA93E6537350D8.yaml b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/A5DA93E6537350D8.yaml index beb9f20..656d9a0 100644 --- a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/A5DA93E6537350D8.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/A5DA93E6537350D8.yaml @@ -1,8 +1,6 @@ # Goat Simulator 3 1.0.7.4 # BID: A5DA93E6537350D8 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget - diff --git a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/C606C7DC1C0EC88F.yaml b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/C606C7DC1C0EC88F.yaml index a5bf855..072a7d8 100644 --- a/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/C606C7DC1C0EC88F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01001CC01B2D4000/C606C7DC1C0EC88F.yaml @@ -1,8 +1,6 @@ # Goat Simulator 3 1.0.7.5 # BID: C606C7DC1C0EC88F -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget - diff --git a/SaltySD/plugins/FPSLocker/patches/010020F014DBE000/2B37ED2A971948F3.yaml b/SaltySD/plugins/FPSLocker/patches/010020F014DBE000/2B37ED2A971948F3.yaml index d7ae55d..cbe26d8 100644 --- a/SaltySD/plugins/FPSLocker/patches/010020F014DBE000/2B37ED2A971948F3.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010020F014DBE000/2B37ED2A971948F3.yaml @@ -1,8 +1,43 @@ # Sherlock Holmes: The Devil's Daughter 1.0.0 # BID: 2B37ED2A971948F3 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 38 + evaluate: "1.14 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 22 + evaluate: "0.66 * FRAMETIME_TARGET" + - + type: variable + name: dr_target3 + value_type: float + default_value: 43.5 + evaluate: "1.305 * FRAMETIME_TARGET" + - + type: variable + name: dr_target4 + value_type: float + default_value: 58 + evaluate: "1.74 * FRAMETIME_TARGET" + - + type: variable + name: dr_target5 + value_type: float + default_value: 47 + evaluate: "1.41 * FRAMETIME_TARGET" + - + type: variable + name: dr_target6 + value_type: float + default_value: 34 + evaluate: "1.02 * FRAMETIME_TARGET" MASTER_WRITE: # Redirect Dynamic Resolution timings to MAIN + 0x3189F00 # 38.0 @@ -10,47 +45,43 @@ MASTER_WRITE: type: asm_a64 main_offset: 0xFFEAFC instructions: [ - [adrp, x10, 0x3189000], - [ldr, s1, [x10, 0xf00]] + [adrp, x10, $dr_target1], + [ldr, s1, [x10, $dr_target1]] ] # 22.0 - type: asm_a64 main_offset: 0xFFEB0C instructions: [ - [ldr, s1, [x10, 0xf04]] + [ldr, s1, [x10, $dr_target2]] ] # 43.5 - type: asm_a64 main_offset: 0xFFEAD4 instructions: [ - [adrp, x10, 0x3189000], - [ldr, s1, [x10, 0xf08]] + [adrp, x10, $dr_target3], + [ldr, s1, [x10, $dr_target3]] ] # 58.0 - type: asm_a64 main_offset: 0xFFEAE4 instructions: [ - [adrp, x10, 0x3189000], - [ldr, s1, [x10, 0xf0c]] + [adrp, x10, $dr_target4], + [ldr, s1, [x10, $dr_target4]] ] # 47.0 | 34.0 - type: asm_a64 main_offset: 0xFFEB20 instructions: [ - [adrp, x11, 0x3189000], - [ldr, s1, [x11, 0xf10]], - [ldr, w12, [x11, 0xf14]] + [adrp, x11, $dr_target5], + [ldr, s1, [x11, $dr_target5]], + [adrp, x11, $dr_target6], + [fcmp, s0, s1], + [ldr, s1, [x11, $dr_target6]] ] - # Default values: - - - type: bytes - main_offset: 0x3189F00 - value_type: float - value: [38.0, 22.0, 43.5, 58.0, 47.0, 34.0] ALL_FPS: # UGameEngine::GetMaxTickRate() # Bool Lock FPS @@ -59,10 +90,3 @@ ALL_FPS: address: [MAIN, 0x30D1B7C] value_type: uint8 value: 0 - # Dynamic Resolution - - - type: evaluate_write - address: [MAIN, 0x3189F00] - value_type: float - value: ["(38.0 / (1000/30)) * FRAMETIME_TARGET", "(22.0 / (1000/30)) * FRAMETIME_TARGET", "(43.5 / (1000/30)) * FRAMETIME_TARGET", "(58.0 / (1000/30)) * FRAMETIME_TARGET", "(47.0 / (1000/30)) * FRAMETIME_TARGET", "(34.0 / (1000/30)) * FRAMETIME_TARGET"] - diff --git a/SaltySD/plugins/FPSLocker/patches/010021601C496000/7A450848CFDEC18E.yaml b/SaltySD/plugins/FPSLocker/patches/010021601C496000/7A450848CFDEC18E.yaml index 51a151c..01326a5 100644 --- a/SaltySD/plugins/FPSLocker/patches/010021601C496000/7A450848CFDEC18E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010021601C496000/7A450848CFDEC18E.yaml @@ -2,8 +2,6 @@ # BID: 7A450848CFDEC18E # Some prerendered cutscenes are still pushed at 30 FPS -unsafeCheck: true - MASTER_WRITE: # Block updating DR timings, REF: 00 01 27 1E 48 40 A8 52 - @@ -40,10 +38,10 @@ ALL_FPS: value: FPS_LOCK_TARGET # Renderer thread delay - - type: write + type: evaluate_write address: [MAIN, 0x5704028] value_type: float - value: 0.01 + value: "0.66 / FPS_TARGET" # DR timings - type: evaluate_write @@ -53,4 +51,3 @@ ALL_FPS: - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100217014266000/2F81A2EC9B298B37.yaml b/SaltySD/plugins/FPSLocker/patches/0100217014266000/2F81A2EC9B298B37.yaml new file mode 100644 index 0000000..5b2d0f0 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100217014266000/2F81A2EC9B298B37.yaml @@ -0,0 +1,25 @@ +# DRAGON QUEST TREASURES 1.0.1 +# BID: 2F81A2EC9B298B37 + +ALL_FPS: + # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS + - + type: write + address: [MAIN, 0x7E110D8, 0x7C0] + address_unsafe: true + value_type: uint32 + # Default is 0x47, bUseFixedFrameRate |= 0x40 + # By writing 7 we are making sure that other flags are maintained: + # bAllowMultiThreadedAnimationUpdate |= 4 + # bOptimizeAnimBlueprintMemberVariableAccess |= 2 + # bCanBlueprintsTickByDefault |= 1 + value: 7 + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x7E119A8, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + - + type: block + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/010024700901A000/9CDFB0CD24CAE030.yaml b/SaltySD/plugins/FPSLocker/patches/010024700901A000/9CDFB0CD24CAE030.yaml index 89fbda4..a582c4b 100644 --- a/SaltySD/plugins/FPSLocker/patches/010024700901A000/9CDFB0CD24CAE030.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010024700901A000/9CDFB0CD24CAE030.yaml @@ -1,8 +1,6 @@ # Gal*Gun 2 1.0.4 # BID: 9CDFB0CD24CAE030 -unsafeCheck: false - ALL_FPS: # r.VSync - @@ -20,6 +18,7 @@ ALL_FPS: - type: write address: [MAIN, 0x44E6030, 0x764] + address_unsafe: true value_type: float value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/0CC82881FF112C6D.yaml b/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/0CC82881FF112C6D.yaml index 2e5bda2..585bcbc 100644 --- a/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/0CC82881FF112C6D.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/0CC82881FF112C6D.yaml @@ -1,8 +1,6 @@ # GUNDAM BREAKER 4 1.9.0 # BID: 0CC82881FF112C6D -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget - diff --git a/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/F898CCE9C3A291AF.yaml b/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/F898CCE9C3A291AF.yaml index 64f535b..d272130 100644 --- a/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/F898CCE9C3A291AF.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010025C0145D4000/F898CCE9C3A291AF.yaml @@ -1,8 +1,6 @@ # GUNDAM BREAKER 4 1.5.0 # BID: F898CCE9C3A291AF -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget - diff --git a/SaltySD/plugins/FPSLocker/patches/010027400CDC6000/4979B200D53BB282.yaml b/SaltySD/plugins/FPSLocker/patches/010027400CDC6000/4979B200D53BB282.yaml index 3ed3361..3f9f810 100644 --- a/SaltySD/plugins/FPSLocker/patches/010027400CDC6000/4979B200D53BB282.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010027400CDC6000/4979B200D53BB282.yaml @@ -3,28 +3,20 @@ # Game is using double buffer, buffers are not allocated in loop. # So it's not possible to get stable FPS lock between 30 and 60 without changing refresh rate. -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_scale + value_type: double + default_value: 1000000 + evaluate: "30000000 / FPS_TARGET" MASTER_WRITE: - # Change location of GPU frametime double divider to MAIN+0x32C6D00 + # Change location of GPU frametime double divider - type: asm_a64 main_offset: 0x921768 instructions: [ - [adrp, x8, 0x32c6000], - [ldr, d1, [x8, 0xd00]] + [adrp, x8, $dr_scale], + [ldr, d1, [x8, $dr_scale]] ] - # Default value - - - type: bytes - main_offset: 0x32C6D00 - value_type: double - value: 1000000 -ALL_FPS: - # GPU Frametime divider = (30/FPS) * 1000000 - - - type: evaluate_write - address: [MAIN, 0x32C6D00] - value_type: double - value: "(30 / FPS_TARGET) * 1000000" - diff --git a/SaltySD/plugins/FPSLocker/patches/010029B0118E8000/799D1061182C1302.yaml b/SaltySD/plugins/FPSLocker/patches/010029B0118E8000/799D1061182C1302.yaml index 76b77ca..309f584 100644 --- a/SaltySD/plugins/FPSLocker/patches/010029B0118E8000/799D1061182C1302.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010029B0118E8000/799D1061182C1302.yaml @@ -2,8 +2,6 @@ # BID: 799D1061182C1302 # Thanks to theboy181 for finding instruction responsible for calculating frame time which I used to find where is FPS target stored -unsafeCheck: true - MASTER_WRITE: # Remove FPS Lock - @@ -23,11 +21,13 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0xED96A8, 0x30] + address_unsafe: true value_type: uint32 value: "19200000 / FPS_TARGET" - type: evaluate_write address: [MAIN, 0xED96A8, 0x28] + address_unsafe: true value_type: uint32 value: "1920000 / FPS_TARGET" # FPS 2D Game Speed Target @@ -42,4 +42,3 @@ ALL_FPS: address: [MAIN, 0xEFFC60, 0x50] value_type: float value: "1 / FPS_TARGET" - diff --git a/SaltySD/plugins/FPSLocker/patches/01002C0015644000/3A3C781930CB8201.yaml b/SaltySD/plugins/FPSLocker/patches/01002C0015644000/3A3C781930CB8201.yaml index 322da2e..8169c35 100644 --- a/SaltySD/plugins/FPSLocker/patches/01002C0015644000/3A3C781930CB8201.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01002C0015644000/3A3C781930CB8201.yaml @@ -2,13 +2,12 @@ # BID: 3A3C781930CB8201 # WARNING: Enemy Movement Speed is not scaling properly to framerate. At 60 FPS it's multiple times slower, looking like enemies are practically walking in place. -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x5F32908, 0x7B8] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -31,3 +30,4 @@ ALL_FPS: - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/471546458FD9E43D.yaml b/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/471546458FD9E43D.yaml index 946cd7f..baada89 100644 --- a/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/471546458FD9E43D.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/471546458FD9E43D.yaml @@ -2,27 +2,19 @@ # BID: 471546458FD9E43D # REF: 01 04 0C 5E 00 10 2E 1E -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET MASTER_WRITE: -# Redirect DR frametime target to MAIN+0x36D4F00 +# Redirect DR frametime target - type: asm_a64 main_offset: 0x17358B4 instructions: [ - [adrp, x13, 0x36d4000], - [ldr, s2, [x13, 0xf00]] + [adrp, x13, $dr_target], + [ldr, s2, [x13, $dr_target]] ] - # default value - - - type: bytes - main_offset: 0x36D4F00 - value_type: float - value: 33.3333333333 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x36D4F00] - value_type: float - - value: FRAMETIME_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/9ACB108D8DC59245.yaml b/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/9ACB108D8DC59245.yaml new file mode 100644 index 0000000..c459826 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01002C101C1AA000/9ACB108D8DC59245.yaml @@ -0,0 +1,20 @@ +# Expeditions: A Mudrunner Game 1.18.0.0 +# BID: 9ACB108D8DC59245 +# REF: 01 04 0C 5E 00 10 2E 1E + +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET +MASTER_WRITE: +# Redirect DR frametime target + - + type: asm_a64 + main_offset: 0x1737634 + instructions: [ + [adrp, x13, $dr_target], + [ldr, s2, [x13, $dr_target]] + ] diff --git a/SaltySD/plugins/FPSLocker/patches/01002FC012548000/7C724F497564C027.yaml b/SaltySD/plugins/FPSLocker/patches/01002FC012548000/7C724F497564C027.yaml index b146e09..ab60f41 100644 --- a/SaltySD/plugins/FPSLocker/patches/01002FC012548000/7C724F497564C027.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01002FC012548000/7C724F497564C027.yaml @@ -1,8 +1,6 @@ # Jujutsu Kaisen Cursed Clash JP 1.4.0 # BID: 7C724F497564C027 -unsafeCheck: true - ALL_FPS: # r.DynamicRes.FrameTimeBudget - @@ -26,8 +24,10 @@ ALL_FPS: - type: write address: [MAIN, 0x849B7A8, 0x9C4] + address_unsafe: true value_type: uint32 value: 7 - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/0100309016E7A000/14C878ECCA9D7CB5.yaml b/SaltySD/plugins/FPSLocker/patches/0100309016E7A000/14C878ECCA9D7CB5.yaml index 38c0ad1..4266ec9 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100309016E7A000/14C878ECCA9D7CB5.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100309016E7A000/14C878ECCA9D7CB5.yaml @@ -1,13 +1,12 @@ # Demon Slayer -Kimetsu no Yaiba- The Hinokami Chronicles 1.53 # BID: 14C878ECCA9D7CB5 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to unlock framerate - type: write address: [MAIN, 0xB314540, 0x7F8] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/0100321017CC0000/D147CAEF2BC74574.yaml b/SaltySD/plugins/FPSLocker/patches/0100321017CC0000/D147CAEF2BC74574.yaml index 34d0a5d..280abe8 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100321017CC0000/D147CAEF2BC74574.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100321017CC0000/D147CAEF2BC74574.yaml @@ -1,15 +1,13 @@ # Hammerwatch Anniversary Edition 1.0.3 # BID: D147CAEF2BC74574 -unsafeCheck: true - MASTER_WRITE: - # Rewrite "v_fps_limit 30" to 62 + # Rewrite "v_fps_limit 30" to 99 - type: bytes main_offset: 0xE028B5 value_type: uint16 - value: 0x3236 + value: 0x3939 # Change egl Interval to lock game by default to 30 FPS - type: asm_a64 @@ -23,11 +21,3 @@ MASTER_WRITE: instructions: [ [mov, w1, 2] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x15ABF3C0] - value_type: uint8 - value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/0100367016DF0000/38896FEC1B4ADB1C.yaml b/SaltySD/plugins/FPSLocker/patches/0100367016DF0000/38896FEC1B4ADB1C.yaml index 9169907..acb8cfd 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100367016DF0000/38896FEC1B4ADB1C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100367016DF0000/38896FEC1B4ADB1C.yaml @@ -1,15 +1,13 @@ # Hammerwatch 2 1.0.4 # BID: 38896FEC1B4ADB1C -unsafeCheck: true - MASTER_WRITE: - # Rewrite "v_fps_limit 30" to 62 + # Rewrite "v_fps_limit 30" to 99 - type: bytes main_offset: 0x7C7597 value_type: uint16 - value: 0x3236 + value: 0x3939 # Change egl Interval to lock game by default to 30 FPS - type: asm_a64 @@ -23,11 +21,3 @@ MASTER_WRITE: instructions: [ [mov, w1, 2] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x161BCF8] - value_type: uint8 - value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/01003980174BC000/217C9ECF258C0312.yaml b/SaltySD/plugins/FPSLocker/patches/01003980174BC000/217C9ECF258C0312.yaml index 2197d01..ff7ab5a 100644 --- a/SaltySD/plugins/FPSLocker/patches/01003980174BC000/217C9ECF258C0312.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01003980174BC000/217C9ECF258C0312.yaml @@ -1,13 +1,12 @@ # Dusk Diver 2 1.0.1 # BID: 217C9ECF258C0312 -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x77C7098, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -30,3 +29,4 @@ ALL_FPS: - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/010039B015CB6000/39DC785D9073C22B.yaml b/SaltySD/plugins/FPSLocker/patches/010039B015CB6000/39DC785D9073C22B.yaml index 423ec07..a46c02a 100644 --- a/SaltySD/plugins/FPSLocker/patches/010039B015CB6000/39DC785D9073C22B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010039B015CB6000/39DC785D9073C22B.yaml @@ -1,50 +1,48 @@ # Eiyuden Chronicle: Rising 1.02 # BID: 39DC785D9073C22B -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: double + default_value: 31 + evaluate: "0.93 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: double + default_value: 29 + evaluate: "0.87 * FRAMETIME_TARGET" + - + type: code + name: drMaxTarget + instructions: [ + [adrp, x19, $dr_target1], + [ldr, d1, [x19, $dr_target1]], + [ret] + ] + - + type: code + name: drMinTarget + instructions: [ + [adrp, x8, $dr_target2], + [ldr, d1, [x8, $dr_target2]], + [ret] + ] MASTER_WRITE: - # Redirect DynamicResolution$$LowerResSW Max Target in MS to MAIN+0x3BE1200 + # Redirect DynamicResolution$$LowerResSW Max Target in MS - type: asm_a64 main_offset: 0x2426988 instructions: [ - [b, 0x2426a94] + [bl, _drMaxTarget()] ] - - - - type: asm_a64 - main_offset: 0x2426A94 - instructions: [ - [adrp, x19, 0x3be1000], - [ldr, d1, [x19, 0x200]], - [b, 0x242698c] - ] - # Redirect DynamicResolution$$LowerResSW Min Target in MS to MAIN+0x3BE1208 + # Redirect DynamicResolution$$LowerResSW Min Target - type: asm_a64 main_offset: 0x24269F4 instructions: [ - [b, 0x2426ea4] + [bl, _drMinTarget()] ] - - - type: asm_a64 - main_offset: 0x2426EA4 - instructions: [ - [adrp, x8, 0x3be1000], - [ldr, d1, [x8, 0x208]], - [b, 0x24269f8] - ] - # Write default values - - - type: bytes - main_offset: 0x3BE1200 - value_type: double - value: [31, 29] -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x3BE1200] - value_type: double - value: ["0.93 * FRAMETIME_TARGET", "0.87 * FRAMETIME_TARGET"] diff --git a/SaltySD/plugins/FPSLocker/patches/01003AE01AA76000/6C46135714ABB870.yaml b/SaltySD/plugins/FPSLocker/patches/01003AE01AA76000/6C46135714ABB870.yaml index 44e319e..716dfb5 100644 --- a/SaltySD/plugins/FPSLocker/patches/01003AE01AA76000/6C46135714ABB870.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01003AE01AA76000/6C46135714ABB870.yaml @@ -1,8 +1,6 @@ # Fate/Samurai Remnant 1.3.2 # BID: 6C46135714ABB870 -unsafeCheck: true - # Disable setting double buffer, REF: 28 63 A8 9B B8 5F 6E 29 2B F7 01 51 B9 83 57 B8 MASTER_WRITE: - diff --git a/SaltySD/plugins/FPSLocker/patches/01003CC00D0BE000/F6FB99E54347E740.yaml b/SaltySD/plugins/FPSLocker/patches/01003CC00D0BE000/F6FB99E54347E740.yaml index 5f077c6..68769eb 100644 --- a/SaltySD/plugins/FPSLocker/patches/01003CC00D0BE000/F6FB99E54347E740.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01003CC00D0BE000/F6FB99E54347E740.yaml @@ -4,58 +4,45 @@ unsafeCheck: true +DECLARATIONS: + - + type: variable + name: fps_lock + value_type: double + default_value: 0.03333333333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET MASTER_WRITE: - # Redirect FPS Lock and Dynamic Resolution target values to MAIN + 0x21036F00 - type: asm_a64 main_offset: 0x13281C instructions: [ - [adrp, x8, 0x21036000], - [ldr, x8, [x8, 0xf00]] + [adrp, x8, $fps_lock], + [ldr, x8, [x8, $fps_lock]] ] - type: asm_a64 main_offset: 0x3E324C instructions: [ - [adrp, x8, 0x21036000], - [ldr, x8, [x8, 0xf00]] + [adrp, x8, $fps_lock], + [ldr, x8, [x8, $fps_lock]] ] - # NOP updating Dynamic Resolution target value - type: asm_a64 main_offset: 0x2D94E8 instructions: [ - [adrp, x9, 0x21036000], - [ldr, w9, [x9, 0xf08]] + [adrp, x9, $dr_target], + [ldr, w9, [x9, $dr_target]] ] - type: asm_a64 main_offset: 0x597C5C instructions: [ - [adrp, x9, 0x21036000], - [ldr, w9, [x9, 0xf08]] + [adrp, x9, $dr_target], + [ldr, w9, [x9, $dr_target]] ] - # Default values - - - type: bytes - main_offset: 0x21036F00 - value_type: double - value: 0.03333333333333333 - - - type: bytes - main_offset: 0x21036F08 - value_type: float - value: 33.333333333333 -ALL_FPS: - # FPS Lock - - - type: evaluate_write - address: [MAIN, 0x21036F00] - value_type: double - value: "1 / FPS_TARGET" - - - type: evaluate_write - address: [MAIN, 0x21036F08] - value_type: float - - value: FRAMETIME_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/01003E800A102000/283095029A5AB467.yaml b/SaltySD/plugins/FPSLocker/patches/01003E800A102000/283095029A5AB467.yaml index 063a0ff..a69df16 100644 --- a/SaltySD/plugins/FPSLocker/patches/01003E800A102000/283095029A5AB467.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01003E800A102000/283095029A5AB467.yaml @@ -2,8 +2,13 @@ # BID: 283095029A5AB467 # Double buffer is reserved line by line inside class array, so requires ton of patching -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET MASTER_WRITE: # Force game to use dynamic speed instead of fixed speed - @@ -12,25 +17,11 @@ MASTER_WRITE: instructions: [ [mov, w8, 2] ] - # Redirect DR timing to MAIN + 0x9DBAEB8 + # Redirect DR timing - type: asm_a64 main_offset: 0xE88250 instructions: [ - [adrp, x8, 0x9dba000], - [ldr, s0, [x8, 0xeb8]] + [adrp, x8, $dr_target], + [ldr, s0, [x8, $dr_target]] ] - # Default value - - - type: bytes - main_offset: 0x9DBAEB8 - value_type: float - value: 33.3333333333 -ALL_FPS: - # DR timing - - - type: evaluate_write - address: [MAIN, 0x9DBAEB8] - value_type: float - value: FRAMETIME_TARGET - diff --git a/SaltySD/plugins/FPSLocker/patches/010040401D564000/1053EA8AD2A50F15.yaml b/SaltySD/plugins/FPSLocker/patches/010040401D564000/1053EA8AD2A50F15.yaml index 5225bc6..f9b345d 100644 --- a/SaltySD/plugins/FPSLocker/patches/010040401D564000/1053EA8AD2A50F15.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010040401D564000/1053EA8AD2A50F15.yaml @@ -1,8 +1,6 @@ # MotoGP 24 1.0.5 # BID: 1053EA8AD2A50F15 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010040601A9B8000/9ACE779510EC93C9.yaml b/SaltySD/plugins/FPSLocker/patches/010040601A9B8000/9ACE779510EC93C9.yaml index 0d3195e..af86de7 100644 --- a/SaltySD/plugins/FPSLocker/patches/010040601A9B8000/9ACE779510EC93C9.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010040601A9B8000/9ACE779510EC93C9.yaml @@ -1,12 +1,10 @@ -# Tamagotchi Plaza 1.0.2 +# たまごっちのプチプチおみせっち おまちど~さま! 1.0.2 # BID: 9ACE779510EC93C9 -unsafeCheck: true - ALL_FPS: # UnityEngine.Rendering.OnDemandRendering_TypeInfo - type: write address: [MAIN, 0x683BB20, 0xB8, 0] value_type: int32 - value: -1 \ No newline at end of file + value: -1 diff --git a/SaltySD/plugins/FPSLocker/patches/010042D00D900000/EC593A5F9552100A.yaml b/SaltySD/plugins/FPSLocker/patches/010042D00D900000/EC593A5F9552100A.yaml index 02d7f5e..48d1187 100644 --- a/SaltySD/plugins/FPSLocker/patches/010042D00D900000/EC593A5F9552100A.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010042D00D900000/EC593A5F9552100A.yaml @@ -1,10 +1,21 @@ # LEGO Star Wars: The Skywalker Saga 1.10.0 # BID: EC593A5F9552100A -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 24 + evaluate: "0.72 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 31 + evaluate: "0.93 * FRAMETIME_TARGET" MASTER_WRITE: - # redirect reading Dynamic Resolution timing min & max to MAIN + 0xC3C0A50 + # redirect reading Dynamic Resolution timing min & max - type: asm_a64 main_offset: 0x6171A0 @@ -12,33 +23,21 @@ MASTER_WRITE: [nop], [ldr, s3, [x11, 0xe04]], [fadd, s1, s1, s3], - [adrp, x12, 0xc3c0000], - [ldr, s2, [x12, 0xa50]] + [adrp, x12, $dr_target1], + [ldr, s2, [x12, $dr_target1]] ] - type: asm_a64 main_offset: 0x6171F0 instructions: [ - [adrp, x11, 0xc3c0000], - [ldr, s2, [x11, 0xa54]] + [adrp, x11, $dr_target2], + [ldr, s2, [x11, $dr_target2]] ] - # Default DR timings - - - type: bytes - main_offset: 0xC3C0A50 - value_type: float - value: [24, 31] ALL_FPS: # g_video_swap_mode + ## Setting it to 1 to enable 120 FPS results in resolution range being always forced to docked mode - type: write address: [MAIN, 0xAA62FF0] value_type: int32 value: 2 - # Min + max dynamic resolution timing in ms - - - type: evaluate_write - address: [MAIN, 0xC3C0A50] - value_type: float - value: ["0.72 * FRAMETIME_TARGET", "0.93 * FRAMETIME_TARGET"] - diff --git a/SaltySD/plugins/FPSLocker/patches/010044500CF8E000/9B3DDF2FB9100E51.yaml b/SaltySD/plugins/FPSLocker/patches/010044500CF8E000/9B3DDF2FB9100E51.yaml index be80392..6f175a2 100644 --- a/SaltySD/plugins/FPSLocker/patches/010044500CF8E000/9B3DDF2FB9100E51.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010044500CF8E000/9B3DDF2FB9100E51.yaml @@ -1,8 +1,6 @@ # Hellblade: Senua's Sacrifice 1.1.0 # BID: 9B3DDF2FB9100E51 -unsafeCheck: false - ALL_FPS: # Custom Dynamic Resolution implementation - Frame Time (MAX/MIN) # MAX = (1/FPS) * 0.95 @@ -11,7 +9,7 @@ ALL_FPS: type: evaluate_write address: [MAIN, 0x520BBE0, 0x40] value_type: float - value: ["(1 / FPS_TARGET) * 0.95", "(1 / FPS_TARGET) * 0.9"] + value: ["0.95 / FPS_TARGET", "0.9 / FPS_TARGET"] # t.MaxFPS - type: evaluate_write diff --git a/SaltySD/plugins/FPSLocker/patches/010044700DEB0001/3DEF0E36AA8C6592.yaml b/SaltySD/plugins/FPSLocker/patches/010044700DEB0001/3DEF0E36AA8C6592.yaml index 9082aa0..c400b7c 100644 --- a/SaltySD/plugins/FPSLocker/patches/010044700DEB0001/3DEF0E36AA8C6592.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010044700DEB0001/3DEF0E36AA8C6592.yaml @@ -1,28 +1,22 @@ # Assassin's Creed The Rebel Collection - Assassin's Creed Rogue 1.0.0 # BID: 3DEF0E36AA8C6592 -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_scale + value_type: float + default_value: 1000 + evaluate: "30000 / FPS_TARGET" MASTER_WRITE: -# Patch code to divide last frametime by float scale factor stored in MAIN+0x61EE400 +# Patch code to divide last frametime by float scale factor # To match it to Dynamic Resolution calculations - type: asm_a64 main_offset: 0x9F1DDC instructions: [ - [adrp, x8, 0x61ee000], - [ldr, s1, [x8, 0x400]] + [adrp, x8, $dr_scale], + [ldr, s1, [x8, $dr_scale]] ] -# Write default dynamic resolution timing factor - - - type: bytes - main_offset: 0x61EE400 - value_type: float - value: 1000 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x61EE400] - value_type: float - value: "(FPS_TARGET / 30) * 1000" diff --git a/SaltySD/plugins/FPSLocker/patches/0100453019AA8000/2A720C7CE5C84905.yaml b/SaltySD/plugins/FPSLocker/patches/0100453019AA8000/2A720C7CE5C84905.yaml index 1fe8177..0757116 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100453019AA8000/2A720C7CE5C84905.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100453019AA8000/2A720C7CE5C84905.yaml @@ -3,6 +3,167 @@ unsafeCheck: true +DECLARATIONS: + - + type: variable + name: last_tick + value_type: uint64 + default_value: 0 + - + type: variable + name: frame_target + value_type: uint32 + default_value: 33333333 + evaluate: "FRAMETIME_TARGET * 1000000" + - + type: variable + name: speed_factor + value_type: float + default_value: 1.0 + - + type: variable + name: current_fps + value_type: float + default_value: 30.0 + - + type: variable + name: current_frametime + value_type: float + default_value: 0.0333333333 + - + type: variable + name: dr_target + value_type: float + default_value: 0.0333333333 + evaluate: "1 / FPS_TARGET" + - + type: const + name: nanoseconds_in_sec + value: 1000000000 + - + type: const + name: max_delta + value: 66666666 + - + type: variable + name: microseconds_in_sec + value_type: double + default_value: 1000000.0 + - + type: code + name: dynamicSpeed + instructions: [ + [stp, x29, x30, [sp, -16], "!"], + [mov, x29, sp], + [blr, x8], + [mrs, x0, cntpct_el0], + [adrp, x8, $last_tick], + [ldr, x7, [x8, $last_tick]], + [str, x0, [x8, $last_tick]], + [cbz, x7, :goto1], + [sub, x0, x0, x7], + [bl, _convertTickToTimeSpan()], + [adrp, x8, $frame_target], + [ldr, w1, [x8, $frame_target]], + [cmp, x1, x0], + [b.lt, :goto2], + [mov, x0, x1], + :goto2, [mov, x1, $max_delta], + [movk, x1, $max_delta, 16], + [cmp, x1, x0], + [b.gt, :goto3], + [mov, x0, x1], + :goto3, [ucvtf, d0, x0], + [adrp, x0, $microseconds_in_sec], + [ldr, d1, [x0, $microseconds_in_sec]], + [fdiv, d0, d0, d1], + [mov, x0, 1000], + [ucvtf, d1, x0], + [fdiv, d1, d1, d0], + [adrp, x0, $current_fps], + [fcvt, s1, d1], + [str, s1, [x0, $current_fps]], + [fmov, s2, 30.0], + [fdiv, s2, s2, s1], + [adrp, x0, $speed_factor], + [str, s2, [x0, $speed_factor]], + [mov, x1, 1000], + [ucvtf, d1, x1], + [fdiv, d1, d0, d1], + [fcvt, s1, d1], + [adrp, x0, $current_frametime], + [str, s1, [x0, $current_frametime]], + :goto1, [ldp, x29, x30, [sp], 16], + [ret] + ] + - + type: code + name: battleFix + instructions: [ + [adrp, x9, $speed_factor], + [ldr, s0, [x9, $speed_factor]], + [ret] + ] + - + type: code + name: cameraRotationFix + instructions: [ + [adrp, x8, $speed_factor], + [ldr, s8, [x8, $speed_factor]], + [fmul, s0, s8, s0], + [fcmp, s0, 0.0], + [b.ge, :goto1], + [fneg, s0, s0], + [fsqrt, s0, s0], + [fneg, s0, s0], + [ret], + :goto1, [fsqrt, s0, s0], + [ret] + ] + - + type: code + name: fnSiteFix + instructions: [ + [ldr, s0, [x19, 0xd0]], + [adrp, x0, $speed_factor], + [ldr, s1, [x0, $speed_factor]], + [fmul, s0, s0, s1], + [ret] + ] + - + type: code + name: longJumpFix + instructions: [ + [fmov, s11, 30.0], + [fadd, s11, s11, s11], + [ret] + ] + - + type: code + name: qteFix + instructions: [ + [adrp, x20, $speed_factor], + [ldr, s1, [x20, $speed_factor]], + [ldr, s2, [x19, 0x120]], + [fmul, s1, s2, s1], + [ret] + ] + - + type: code + name: fogSpeedFix + instructions: [ + [fsqrt, s2, s2], + [fmadd, s0, s1, s2, s0], + [ret] + ] + - + type: code + name: overdriveFix + instructions: [ + [adrp, x0, $current_frametime], + [ldr, s0, [x0, $current_frametime]], + [ret] + ] MASTER_WRITE: # Dynamic speed mod for stuff like UI, lipsync, grass and rain ## Redirect nvnQueuePresentTexture call to code cave at MAIN+0x1735050 @@ -10,106 +171,51 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x95EED8 instructions: [ - [b, 0x1735050] + [bl, _dynamicSpeed()] ] - ## Code Cave (save floats for speed factor to MAIN+0x47BE268, frametime as FPS in MAIN+0x47BE26C, frametime in s in MAIN+0x47BE270) - - - type: asm_a64 - main_offset: 0x1735050 - instructions: [ - [blr, x8], - [bl, 0x1732500], - [adrp, x8, 0x47be000], - [ldr, x7, [x8, 0x260]], - [str, x0, [x8, 0x260]], - [cbnz, x7, +8], - [b, 0x95eedc], - [sub, x0, x0, x7], - [bl, 0x1732510], - [adrp, x8, 0x47be000], - [ldr, w1, [x8, 0x300]], - [cmp, x1, x0], - [b.lt, +8], - [mov, x0, x1], - [mov, x1, 0x40aa], - [movk, x1, 0x3f9, 16], - [cmp, x1, x0], - [b.gt, +8], - [mov, x0, x1], - [ucvtf, d0, x0], - [adrp, x0, 0x17eb000], - [ldr, d1, [x0, 0xd58]], - [fdiv, d0, d0, d1], - [mov, x0, 1000], - [ucvtf, d1, x0], - [fdiv, d1, d1, d0], - [adrp, x0, 0x47be000], - [fcvt, s1, d1], - [str, s1, [x0, 0x26c]], - [fmov, s2, 30.0], - [fdiv, s2, s2, s1], - [str, s2, [x0, 0x268]], - [mov, x1, 1000], - [ucvtf, d1, x1], - [fdiv, d1, d0, d1], - [fcvt, s1, d1], - [str, s1, [x0, 0x270]], - [b, 0x95eedc] - ] - ## Default values for code cave - - - type: bytes - main_offset: 0x47BE268 - value_type: float - value: [1.0, 30.0, 0.033333333333] - - - type: bytes - main_offset: 0x47BE300 - value_type: uint32 - value: 33333333 ## Function 1 to speed factor // Usage unknown - type: asm_a64 main_offset: 0x286968 instructions: [ - [adrp, x21, 0x47be000], + [adrp, x21, $speed_factor], [ldr, x0, [x8, 0xe18]], - [ldr, s10, [x21, 0x268]] + [ldr, s10, [x21, $speed_factor]] ] ## Function 3 to speed factor // Usage unknown - type: asm_a64 main_offset: 0xA16F00 instructions: [ - [adrp, x0, 0x47be000], - [ldr, s8, [x0, 0x268]] + [adrp, x0, $speed_factor], + [ldr, s8, [x0, $speed_factor]] ] ## Function 4 to FPS // UI Speed - type: asm_a64 main_offset: 0xA1F060 instructions: [ - [adrp, x0, 0x47be000], + [adrp, x0, $current_fps], [fmov, s0, w8], - [ldr, s0, [x0, 0x26c]] + [ldr, s0, [x0, $current_fps]] ] ## Function 5 to FPS // Usage unknown - type: asm_a64 main_offset: 0x2672DC instructions: [ - [adrp, x0, 0x47ae000], + [adrp, x0, $current_fps], [fmov, s0, w8], [ldrh, w8, [x19, 0x68]], - [ldr, s5, [x0, 0x26c]] + [ldr, s5, [x0, $current_fps]] ] ## Function 6 to FPS - type: asm_a64 main_offset: 0x26DB70 instructions: [ - [adrp, x0, 0x47be000], - [ldr, s0, [x0, 0x26c]], + [adrp, x0, $current_fps], + [ldr, s0, [x0, $current_fps]], [fcvtzu, w0, s0], [mov, w9, 6], [udiv, w8, w0, w9] @@ -119,29 +225,20 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x1E2924 instructions: [ - [adrp, x9, 0x47be000] + [adrp, x9, $current_frametime] ] - type: asm_a64 main_offset: 0x1E2938 instructions: [ - [ldr, s0, [x9, 0x270]] + [ldr, s0, [x9, $current_frametime]] ] # Adjust various elements related to fighting - type: asm_a64 main_offset: 0x1E8F48 instructions: [ - [b, 0x1735174] - ] - ## Code cave - - - type: asm_a64 - main_offset: 0x1735174 - instructions: [ - [adrp, x9, 0x47be000], - [ldr, s0, [x9, 0x268]], - [b, 0x1e8f4c] + [bl, _battleFix()] ] ## Fix gun speed - @@ -155,39 +252,15 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x13A90B4 instructions: [ - [adrp, x8, 0x47be000], - [ldr, s0, [x8, 0xf00]] - ] - ## Default value - - - type: bytes - main_offset: 0x47BEF00 - value_type: float - value: 0.01666666666 - # Adjust camera speed rotation dynamically - ## Code cave - - - type: asm_a64 - main_offset: 0x1735108 - instructions: [ - [adrp, x8, 0x47be000], - [ldr, s8, [x8, 0x268]], - [fmul, s0, s8, s0], - [fcmp, s0, 0.0], - [b.ge, +20], - [fneg, s0, s0], - [fsqrt, s0, s0], - [fneg, s0, s0], - [ret], - [fsqrt, s0, s0], - [ret] + [adrp, x8, $dr_target], + [ldr, s0, [x8, $dr_target]] ] ## Connect function 1 - type: asm_a64 main_offset: 0x1E17A0 instructions: [ - [bl, 0x1735108] + [bl, _cameraRotationFix()] ] ## Connect function 2 - @@ -200,139 +273,55 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x1E17BC instructions: [ - [bl, 0x1735108] - ] - # Force 1s sleep to synchronize audio if cutscene detected - ## Use function responsible for writing type 4 of cutscene - - - type: asm_a64 - main_offset: 0x2FB0D8 - instructions: [ - [b, 0x1735158] - ] - ### Code cave - - - type: asm_a64 - main_offset: 0x1735158 - instructions: [ - [mov, w20, 4], - [adrp, x0, 0x1fef000], - [str, w20, [x0, 0xaf4]], - [mov, x0, 0xca00], - [movk, x0, 0x3b9a, 16], - [bl, 0x17320d0], - [b, 0x2fb0dc] + [bl, _cameraRotationFix()] ] # Adjust Field Action gauge bar speed - type: asm_a64 main_offset: 0xE5E00 instructions: [ - [adrp, x0, 0x47be000], + [adrp, x0, $speed_factor], [adrp, x9, 0x1d54000], - [ldr, s8, [x0, 0x268]] + [ldr, s8, [x0, $speed_factor]] ] ## Fix for FN Site - type: asm_a64 main_offset: 0xE5858 instructions: [ - [b, 0x17350e8] - ] - ### Code cave - - - type: asm_a64 - main_offset: 0x17350E8 - instructions: [ - [ldr, s0, [x19, 0xd0]], - [adrp, x0, 0x47be000], - [ldr, s1, [x0, 0x268]], - [fmul, s0, s0, s1], - [b, 0xe585c] + [bl, _fnSiteFix()] ] # Fix long jump when not running - type: asm_a64 main_offset: 0x23EF70 instructions: [ - [b, 0x17350fc] - ] - ## Code cave - - - type: asm_a64 - main_offset: 0x17350FC - instructions: [ - [fmov, s11, 30.0], - [fadd, s11, s11, s11], - [b, 0x23ef74] + [bl, _longJumpFix()] ] # Adjust QTE Speed - ## Code cave - - - type: asm_a64 - main_offset: 0x1735134 - instructions: [ - [adrp, x20, 0x47be000], - [ldr, s1, [x20, 0x268]], - [b, 0x17351a8] - ] - - - type: asm_a64 - main_offset: 0x17351A8 - instructions: [ - [ldr, s2, [x19, 0x120]], - [fmul, s1, s2, s1], - [b, 0x5c6284] - ] ## Connect function - type: asm_a64 main_offset: 0x5C6280 instructions: [ - [b, 0x1735134] - ] - # Adjust Overdrive counter, Follow Ball speed - ## Code cave - - - type: asm_a64 - main_offset: 0x1735180 - instructions: [ - [adrp, x0, 0x47be000], - [ldr, s0, [x0, 0x270]], - [ret] - ] - ## Connect function - - - type: asm_a64 - main_offset: 0x67354 - instructions: [ - [bl, 0x1734e00] + [bl, _qteFix()] ] # Fix fog speed - type: asm_a64 main_offset: 0x296AE0 instructions: [ - [adrp, x8, 0x47be000], - [ldr, s2, [x8, 0x268]], - [bl, 0x17351b4] + [adrp, x8, $speed_factor], + [ldr, s2, [x8, $speed_factor]], + [bl, _fogSpeedFix()] ] - ## Code cave - type: asm_a64 - main_offset: 0x17351B4 + main_offset: 0x676D4 instructions: [ - [fsqrt, s2, s2], - [fmadd, s0, s1, s2, s0], - [ret] + [bl, _overdriveFix()] ] ALL_FPS: - # FPS Target - - - type: evaluate_write - address: [MAIN, 0x47BE300] - value_type: uint32 - value: "FRAMETIME_TARGET * 1000000" # FPS Lock # ref: 00 01 00 b9 2a 01 00 b9 c0 03 5f d6 - @@ -340,12 +329,6 @@ ALL_FPS: address: [MAIN, 0x1D943A0] value_type: int32 value: [1, 1] - # DR Target - - - type: evaluate_write - address: [MAIN, 0x47BEF00] - value_type: float - value: "1 / FPS_TARGET" # Lock game to 30 FPS when complex/prerendered cutscene is played ## Adjusts DR target - @@ -354,7 +337,7 @@ ALL_FPS: compare_value_type: uint32 compare_type: ">" compare_value: 2 - address: [MAIN, 0x47BEF00] + address: [VARIABLE, dr_target] value_type: float value: 0.03333333333 ## Force OS to run at 60 Hz with interval 2 @@ -364,6 +347,5 @@ ALL_FPS: compare_value_type: uint32 compare_type: ">" compare_value: 2 - address: [MAIN] value_type: refresh_rate value: 30 diff --git a/SaltySD/plugins/FPSLocker/patches/010047401EA8E000/928AF9461536F5E3.yaml b/SaltySD/plugins/FPSLocker/patches/010047401EA8E000/928AF9461536F5E3.yaml index 093e645..d07bf98 100644 --- a/SaltySD/plugins/FPSLocker/patches/010047401EA8E000/928AF9461536F5E3.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010047401EA8E000/928AF9461536F5E3.yaml @@ -1,8 +1,6 @@ # Deliver Us The Moon 1.0.0 # BID: 928AF9461536F5E3 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010049B017774000/2F81A2EC9B298B37.yaml b/SaltySD/plugins/FPSLocker/patches/010049B017774000/2F81A2EC9B298B37.yaml index e5bbcde..5b2d0f0 100644 --- a/SaltySD/plugins/FPSLocker/patches/010049B017774000/2F81A2EC9B298B37.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010049B017774000/2F81A2EC9B298B37.yaml @@ -1,13 +1,12 @@ # DRAGON QUEST TREASURES 1.0.1 # BID: 2F81A2EC9B298B37 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x7E110D8, 0x7C0] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/01004AB00A260000/DF3766A2BB651A3E.yaml b/SaltySD/plugins/FPSLocker/patches/01004AB00A260000/DF3766A2BB651A3E.yaml index 49fe823..bd8ca14 100644 --- a/SaltySD/plugins/FPSLocker/patches/01004AB00A260000/DF3766A2BB651A3E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01004AB00A260000/DF3766A2BB651A3E.yaml @@ -1,7 +1,19 @@ # Dark Souls Remastered 1.0.3 # BID: DF3766A2BB651A3E -unsafeCheck: false +DECLARATIONS: + - + type: variable + name: fps_target + value_type: double + default_value: 30 + evaluate: FPS_LOCK_TARGET + - + type: variable + name: game_speed + value_type: float + default_value: 0.0333333333 + evaluate: "1/FPS_TARGET" MASTER_WRITE: # Redirect FPS target to MAIN+0x55E9A00 @@ -9,63 +21,41 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x706FA4 instructions: [ - [adrp, x1, 0x55e9000] + [adrp, x1, $fps_target] ] - type: asm_a64 main_offset: 0x7070B0 instructions: [ - [ldr, d0, [x1, 0xa00]] + [ldr, d0, [x1, $fps_target]] ] # Redirect game speed to MAIN+0x55E9A08 - type: asm_a64 main_offset: 0x667900 instructions: [ - [adrp, x8, 0x55e9000], - [ldr, s8, [x8, 0xa08]] + [adrp, x8, $game_speed], + [ldr, s8, [x8, $game_speed]] ] - # Write default value - - - type: bytes - main_offset: 0x55E9A00 - value_type: double - value: 30 - - - type: bytes - main_offset: 0x55E9A08 - value_type: float - value: 0.0333333333 ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x55E9A00] - value_type: double - value: FPS_LOCK_TARGET - - - type: evaluate_write - address: [MAIN, 0x55E9A08] - value_type: float - value: "1/FPS_TARGET" - type: compare compare_address: [MAIN, 0x4543788, 0x470] + compare_address_unsafe: true compare_type: "==" compare_value_type: int32 compare_value: 1 - address: [MAIN, 0x55E9A00] - value_type: double + address: [VARIABLE, fps_target] value: 30 - type: compare compare_address: [MAIN, 0x4543788, 0x470] + compare_address_unsafe: true compare_type: "==" compare_value_type: int32 compare_value: 1 - address: [MAIN, 0x55E9A08] - value_type: float + address: [VARIABLE, game_speed] value: 0.0333333333 - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/A6CE40DC3AEDB1BE.yaml b/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/A6CE40DC3AEDB1BE.yaml new file mode 100644 index 0000000..32c444a --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/A6CE40DC3AEDB1BE.yaml @@ -0,0 +1,106 @@ +# Kirby and the Forgotten Land 1.1.0 +# BID: A6CE40DC3AEDB1BE +# Thanks to Hazerou for finding interval offsets + +MASTER_WRITE: + # Remove double buffer + ## REF: 08 07 40 B9 49 00 80 52 + - + type: asm_a64 + main_offset: 0x747C04 + instructions: [ + [mov, w9, 3] + ] + # Fix helper functions to not corrupt stack + ## REF: 42 00 80 52 BF FF 30 A9 + - + type: asm_a64 + main_offset: 0x747CE0 + instructions: [ + [mov, w2, 3] + ] + ## REF: 08 65 45 F9 42 00 80 52, first result + - + type: asm_a64 + main_offset: 0x75ADFC + instructions: [ + [mov, w2, 3] + ] + ## REF: 09 C0 9D 52 09 01 A0 72 E1 03 00 91 F6 03 00 91, beginning of function + - + type: asm_a64 + main_offset: 0x676AC8 + instructions: [ + [sub, sp, sp, 0x50], + [stp, x22, x21, [sp, 0x20]], + [stp, x20, x19, [sp, 0x30]], + [stp, x29, x30, [sp, 0x40]], + [add, x29, sp, 0x40] + ] + ## REF: 00 61 00 91 42 00 80 52 + - + type: asm_a64 + main_offset: 0x676B1C + instructions: [ + [mov, w2, 3] + ] + ## REF: End of function from code above, first ldp x29 x30 + - + type: asm_a64 + main_offset: 0x676B40 + instructions: [ + [ldp, x29, x30, [sp, 0x40]], + [ldp, x20, x19, [sp, 0x30]], + [ldp, x22, x21, [sp, 0x20]], + [add, sp, sp, 0x50] + ] + ## REF: 42 00 80 52 F6 03 00 91 + - + type: asm_a64 + main_offset: 0x74C280 + instructions: [ + [mov, w2, 3] + ] + ## REF: 42 00 80 52 16 69 69 F8, second result + - + type: asm_a64 + main_offset: 0x75AE68 + instructions: [ + [mov, w2, 3] + ] + ## REF: 42 00 80 52 08 05 40 F9 + - + type: asm_a64 + main_offset: 0x7C2E64 + instructions: [ + [mov, w2, 3] + ] + # Block transparency in some 2D elements to avoid issue with flickering at triple buffer + ## REF: 49 91 89 B9 4A 41 48 B9 + - + type: asm_a64 + main_offset: 0x6A757C + instructions: [ + [mov, x9, 0x102], + [ldr, w10, [x10, 0x840]], + [add, x20, x8, 0x820], + [lsl, x12, x10, 3], + [str, x9, [x20]] + ] +ALL_FPS: + # Interval (Setting it to 0 unlocks framerate and sets dynamic game speed) + ## REF: 17 6C 90 52 57 01 A0 72 08 7C 01 A9, first STR above it + - + type: write + address: [MAIN, 0xA76728, 0x50] + address_unsafe: true + value_type: int32 + value: 0 + # Dynamic Resolution GPU Frametiming Max / Min (Max = 1.95 * (30/FPS), Min = 1.7 * (30/FPS)) + ## REF: 88 F2 80 B9 F3 03 00 AA 1F 05 00 71, last result, first STR above it + - + type: evaluate_write + address: [MAIN, 0xA767B0, 0x140, 0x1B0, 0x20, 0x34] + address_unsafe: true + value_type: float + value: ["(30 / FPS_TARGET) * 1.95", "(30 / FPS_TARGET) * 1.7"] \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/D9BA7DB72FFAFECD.yaml b/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/D9BA7DB72FFAFECD.yaml index 46ad46c..51926ad 100644 --- a/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/D9BA7DB72FFAFECD.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01004D300C5AE000/D9BA7DB72FFAFECD.yaml @@ -2,8 +2,6 @@ # BID: D9BA7DB72FFAFECD # Thanks to Hazerou for finding interval offsets -unsafeCheck: false - MASTER_WRITE: # Remove double buffer - @@ -84,12 +82,15 @@ ALL_FPS: - type: write address: [MAIN, 0xA72628, 0x50] + address_unsafe: true value_type: int32 value: 0 # Dynamic Resolution GPU Frametiming Max / Min (Max = 1.95 * (30/FPS), Min = 1.7 * (30/FPS)) - type: evaluate_write address: [MAIN, 0xA726B0, 0x140, 0x1B0, 0x20, 0x34] + address_unsafe: true value_type: float value: ["(30 / FPS_TARGET) * 1.95", "(30 / FPS_TARGET) * 1.7"] + diff --git a/SaltySD/plugins/FPSLocker/patches/010050F00BC1A000/6BEC9B23B09DF46C.yaml b/SaltySD/plugins/FPSLocker/patches/010050F00BC1A000/6BEC9B23B09DF46C.yaml index 8ef09f2..5137348 100644 --- a/SaltySD/plugins/FPSLocker/patches/010050F00BC1A000/6BEC9B23B09DF46C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010050F00BC1A000/6BEC9B23B09DF46C.yaml @@ -1,45 +1,44 @@ # Resident Evil 1.0.0 # BID: 6BEC9B23B09DF46C -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: cutscene_flag + value_type: uint32 + default_value: 0 + - + type: code + name: signalCutscene + instructions: [ + [add, x29, sp, 0x10], + [mov, w1, 1], + [adrp, x19, $cutscene_flag], + [str, w1, [x19, $cutscene_flag]], + [ret] + ] + - + type: code + name: designalCutscene + instructions: [ + [mov, w1, wzr], + [adrp, x2, $cutscene_flag], + [str, w1, [x2, $cutscene_flag]], + [ret] + ] MASTER_WRITE: # Detect prerendered cutscenes - type: asm_a64 - main_offset: 0xB1A810 + main_offset: 0xB1A818 instructions: [ - [b, 0xb31be8] - ] - - - type: asm_a64 - main_offset: 0xB31BE8 - instructions: [ - [str, x19, [sp, -0x20], "!"], - [mov, w1, 1], - [adrp, x19, 0x24e7000], - [str, w1, [x19, 0xff0]], - [mov, x19, x0], - [mov, w0, 0xca00], - [movk, w0, 0x3b9a, 16], - [svc, 0xb], - [mov, x0, x19], - [b, 0xb1a814] + [bl, _signalCutscene()] ] - type: asm_a64 main_offset: 0xB1A9BC instructions: [ - [b, 0xb31c10] - ] - - - type: asm_a64 - main_offset: 0xB31C10 - instructions: [ - [mov, w1, wzr], - [adrp, x2, 0x24e7000], - [str, w1, [x2, 0xff0]], - [b, 0xb24ec0] + [b, _designalCutscene()] ] ALL_FPS: # Internal FPS Lock @@ -51,9 +50,7 @@ ALL_FPS: - type: compare compare_type: "==" - compare_value_type: uint32 compare_value: 1 - compare_address: [MAIN, 0x24E7FF0] - address: [MAIN] + compare_address: [VARIABLE, cutscene_flag] value_type: refresh_rate value: 30 diff --git a/SaltySD/plugins/FPSLocker/patches/010050F01DF9C000/5F765D2CC4CDEF1C.yaml b/SaltySD/plugins/FPSLocker/patches/010050F01DF9C000/5F765D2CC4CDEF1C.yaml index 23f7cce..8b2b1ab 100644 --- a/SaltySD/plugins/FPSLocker/patches/010050F01DF9C000/5F765D2CC4CDEF1C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010050F01DF9C000/5F765D2CC4CDEF1C.yaml @@ -1,17 +1,28 @@ # REYNATIS (US/EU) 1.0.10 # BID: 5F765D2CC4CDEF1C -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: double + default_value: 31 + evaluate: "0.93 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: double + default_value: 29 + evaluate: "(0.93 * FRAMETIME_TARGET) - 2" MASTER_WRITE: - # Redirect reading DR timing in DynamicResolution::LowerResSW() to MAIN + 0x7C22F00 + # Redirect reading DR timing in DynamicResolution::LowerResSW() # REF: 01 f0 67 1e - type: asm_a64 main_offset: 0x38E7ECC instructions: [ - [adrp, x20, 0x7c22000], - [ldr, d1, [x20, 0xf00]], + [adrp, x20, $dr_target1], + [ldr, d1, [x20, $dr_target1]], [fcmpe, d0, d1], [ldp, s9, s8, [x19, 0x40]], [b.le, 0x38e7f34], @@ -21,19 +32,5 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x38E7F34 instructions: [ - [ldr, d1, [x20, 0xf08]] + [ldr, d1, [x20, $dr_target2]] ] - # Default handheld value - - - type: bytes - main_offset: 0x7C22F00 - value_type: double - value: [31, 29] -ALL_FPS: - # Dynamic Resolution Timing - - - type: evaluate_write - address: [MAIN, 0x7C22F00] - value_type: double - value: ["0.93 * FRAMETIME_TARGET", "(0.93 * FRAMETIME_TARGET) - 2"] - diff --git a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/20503FA77FA416B7.yaml b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/20503FA77FA416B7.yaml index 01d6d9c..67d03f9 100644 --- a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/20503FA77FA416B7.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/20503FA77FA416B7.yaml @@ -1,13 +1,12 @@ # DRAGON BALL Z: KARAKOT + A NEW POWER AWAKENS SET 1.50 # BID: 20503FA77FA416B7 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate in cutscenes to unlock framerate - type: write address: [MAIN, 0x9456538, 0x810] + address_unsafe: true value_type: uint32 # Default is 0x47 in cutscenes, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/389E38618E93A5E0.yaml b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/389E38618E93A5E0.yaml index 234c808..dd12698 100644 --- a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/389E38618E93A5E0.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/389E38618E93A5E0.yaml @@ -1,13 +1,12 @@ # DRAGON BALL Z: KARAKOT + A NEW POWER AWAKENS SET 1.51 # BID: 389E38618E93A5E0 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate in cutscenes to unlock framerate - type: write address: [MAIN, 0x9456538, 0x810] + address_unsafe: true value_type: uint32 # Default is 0x47 in cutscenes, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/72F6F8B54276185C.yaml b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/72F6F8B54276185C.yaml index 9b1319e..ecba64a 100644 --- a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/72F6F8B54276185C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/72F6F8B54276185C.yaml @@ -1,13 +1,12 @@ # DRAGON BALL Z: KARAKOT + A NEW POWER AWAKENS SET 1.52 # BID: 72F6F8B54276185C -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate in cutscenes to unlock framerate - type: write address: [MAIN, 0x945A538, 0x810] + address_unsafe: true value_type: uint32 # Default is 0x47 in cutscenes, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -32,4 +31,4 @@ ALL_FPS: type: write address: [MAIN, 0x88C6FD8, 0] value_type: int32 - value: [0, 0] \ No newline at end of file + value: [0, 0] diff --git a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/BC99D4D0A9474360.yaml b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/BC99D4D0A9474360.yaml index 87af62e..6a68d02 100644 --- a/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/BC99D4D0A9474360.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010051C0134F8000/BC99D4D0A9474360.yaml @@ -1,13 +1,12 @@ # DRAGON BALL Z: KARAKOT + A NEW POWER AWAKENS SET 1.60 # BID: BC99D4D0A9474360 -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate in cutscenes to unlock framerate - type: write address: [MAIN, 0x996A558, 0x810] + address_unsafe: true value_type: uint32 # Default is 0x47 in cutscenes, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -32,4 +31,4 @@ ALL_FPS: type: write address: [MAIN, 0x8DD7418, 0] value_type: int32 - value: [0, 0] \ No newline at end of file + value: [0, 0] diff --git a/SaltySD/plugins/FPSLocker/patches/010053E002EA2000/76EC789B99A25BA5.yaml b/SaltySD/plugins/FPSLocker/patches/010053E002EA2000/76EC789B99A25BA5.yaml index 8c497f0..8c6e502 100644 --- a/SaltySD/plugins/FPSLocker/patches/010053E002EA2000/76EC789B99A25BA5.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010053E002EA2000/76EC789B99A25BA5.yaml @@ -2,8 +2,6 @@ # BID: 76EC789B99A25BA5 # REF: aql::GraphicsContext::initialize -unsafeCheck: true - MASTER_WRITE: # Remove double buffer - @@ -12,10 +10,3 @@ MASTER_WRITE: instructions: [ [mov, x8, 3] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x25CCF00] - value_type: uint8 - value: 0 diff --git a/SaltySD/plugins/FPSLocker/patches/01005420101DA000/134EC3D8BE75126F.yaml b/SaltySD/plugins/FPSLocker/patches/01005420101DA000/134EC3D8BE75126F.yaml index 1e5b580..b35d5b9 100644 --- a/SaltySD/plugins/FPSLocker/patches/01005420101DA000/134EC3D8BE75126F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01005420101DA000/134EC3D8BE75126F.yaml @@ -4,63 +4,50 @@ # Fishing timer is decreasing 2x faster at 60 FPS # Bike is turning 2x faster at 60 FPS -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 33333333 + evaluate: "FRAMETIME_TARGET * 930000" + - + type: variable + name: frame_time + value_type: float + default_value: 0.0333333333 + - + type: code + name: dynamicSpeed + instructions: [ + [str, d0, [x8, 0x20]], + [fcvt, s4, d0], + [adrp, x8, $frame_time], + [str, s4, [x8, $frame_time]], + [ret] + ] MASTER_WRITE: - # Move loading FPS lock time to MAIN+0x2B31200 + # Move loading FPS lock time - type: asm_a64 main_offset: 0x511818 instructions: [ - [adrp, x9, 0x2b31000], - [ldr, w9, [x9, 0x200]] + [adrp, x9, $fps_lock], + [ldr, w9, [x9, $fps_lock]] ] - # Default value - - - type: bytes - main_offset: 0x2B31200 - value_type: uint32 - value: 33333333 - # Write game's loop time as float to MAIN+0x2B31204 + # Write game's loop time as float - type: asm_a64 main_offset: 0x511884 instructions: [ - [b, 0x5117f4] + [bl, _dynamicSpeed()] ] - - - type: asm_a64 - main_offset: 0x5117F4 - instructions: [ - [str, d0, [x8, 0x20]], - [fcvt, s4, d0], - [b, 0x511a84] - ] - - - type: asm_a64 - main_offset: 0x511A84 - instructions: [ - [adrp, x8, 0x2b31000], - [str, s4, [x8, 0x204]], - [b, 0x511888] - ] - - # Read lowest timing float factor from MAIN+0x2B31204 + - # Read lowest timing float factor type: asm_a64 main_offset: 0x5E5EC instructions: [ - [adrp, x8, 0x2b31000], + [adrp, x8, $frame_time], [fminnm, s1, s1, s2], - [ldr, s2, [x8, 0x204]] + [ldr, s2, [x8, $frame_time]] ] - - # Default value - type: bytes - main_offset: 0x2B31204 - value_type: float - value: 0.0333333333 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x2B31200] - value_type: uint32 - value: 11111111 diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/153DB27728D41305.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/153DB27728D41305.yaml index 195f410..8fc82ab 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100544020572000/153DB27728D41305.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/153DB27728D41305.yaml @@ -1,8 +1,6 @@ # Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.1.0 # BID: 153DB27728D41305 -unsafeCheck: false - MASTER_WRITE: # Redirect DR to MAIN + 0x2F11FF0 # REF: A9 24 89 52 49 A2 A7 72 @@ -26,6 +24,7 @@ ALL_FPS: - type: write address: [MAIN, 0x2ED8D10, 0xE0, 0x284] + address_unsafe: true value_type: uint8 value: 0 # DR Target diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/1CEA83A1E6684665.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/1CEA83A1E6684665.yaml index 827c75b..7b827aa 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100544020572000/1CEA83A1E6684665.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/1CEA83A1E6684665.yaml @@ -1,37 +1,31 @@ # Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.3.0 # BID: 1CEA83A1E6684665 -unsafeCheck: false +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.035714 + evaluate: "1.01 / FPS_TARGET" MASTER_WRITE: - # Redirect DR to MAIN + 0x2F5CFF0 + # Redirect DR # REF: A9 24 89 52 49 A2 A7 72, second REF - type: asm_a64 main_offset: 0x10AAEE4 instructions: [ - [adrp, x9, 0x2f5c000], - [ldr, s1, [x9, 0xff0]], + [adrp, x9, $dr_target], + [ldr, s1, [x9, $dr_target]], [nop] ] - ## Default value - - - type: bytes - main_offset: 0x2F5CFF0 - value_type: float - value: 0.035714 ALL_FPS: # Disable FPS Lock # REF: 88 46 40 F9 03 11 40 F9, first ADRP+LDR above it - type: write address: [MAIN, 0x2F23C00, 0xE0, 0x294] + address_unsafe: true value_type: uint8 value: 0 - # DR Target - - - type: evaluate_write - address: [MAIN, 0x2F5CFF0] - value_type: float - value: "1.01 / FPS_TARGET" - diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/29F67D61B0AD1500.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/29F67D61B0AD1500.yaml index 256930e..d69b548 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100544020572000/29F67D61B0AD1500.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/29F67D61B0AD1500.yaml @@ -1,8 +1,6 @@ # Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.2.0 # BID: 29F67D61B0AD1500 -unsafeCheck: false - MASTER_WRITE: # Redirect DR to MAIN + 0x2F4CFF0 # REF: A9 24 89 52 49 A2 A7 72, second REF @@ -26,6 +24,7 @@ ALL_FPS: - type: write address: [MAIN, 0x2F13D80, 0xE0, 0x284] + address_unsafe: true value_type: uint8 value: 0 # DR Target diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/3B2CB1C8865E7B1E.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/3B2CB1C8865E7B1E.yaml index 6410cb0..da2e92b 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100544020572000/3B2CB1C8865E7B1E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/3B2CB1C8865E7B1E.yaml @@ -1,8 +1,6 @@ # Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.2.1 # BID: 3B2CB1C8865E7B1E -unsafeCheck: false - MASTER_WRITE: # Redirect DR to MAIN + 0x2F4CFF0 # REF: A9 24 89 52 49 A2 A7 72, second REF @@ -26,6 +24,7 @@ ALL_FPS: - type: write address: [MAIN, 0x2F13D80, 0xE0, 0x284] + address_unsafe: true value_type: uint8 value: 0 # DR Target diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/5E43788065113530.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/5E43788065113530.yaml index 32d45d0..2cfc421 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100544020572000/5E43788065113530.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/5E43788065113530.yaml @@ -1,13 +1,12 @@ # Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.0.2 # BID: 5E43788065113530 -unsafeCheck: false - ALL_FPS: # Disable FPS Lock # REF: 88 46 40 F9 03 11 40 F9, first ADRP+LDR above it - type: write address: [MAIN, 0x2E8DCF0, 0xE0, 0x284] + address_unsafe: true value_type: uint8 value: 0 \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/9B9CCD97EB6EF789.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/9B9CCD97EB6EF789.yaml new file mode 100644 index 0000000..d76bb62 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/9B9CCD97EB6EF789.yaml @@ -0,0 +1,30 @@ +# Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.4.2 +# BID: 9B9CCD97EB6EF789 + +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.035714 + evaluate: "1.01 / FPS_TARGET" +MASTER_WRITE: + # Redirect DR + # REF: A9 24 89 52 49 A2 A7 72, second REF + - + type: asm_a64 + main_offset: 0x10EC6A4 + instructions: [ + [adrp, x9, $dr_target], + [ldr, s1, [x9, $dr_target]], + [nop] + ] +ALL_FPS: + # Disable FPS Lock + # REF: 88 46 40 F9 03 11 40 F9, first ADRP+LDR above it + - + type: write + address: [MAIN, 0x2FC3CB0, 0xE0, 0x294] + address_unsafe: true + value_type: uint8 + value: 0 \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100544020572000/A947DDE7826A3562.yaml b/SaltySD/plugins/FPSLocker/patches/0100544020572000/A947DDE7826A3562.yaml index 8db0285..bc4aa78 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100544020572000/A947DDE7826A3562.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100544020572000/A947DDE7826A3562.yaml @@ -1,13 +1,12 @@ # Atelier Yumia: The Alchemist of Memories & the Envisioned Land 1.0.1 # BID: A947DDE7826A3562 -unsafeCheck: false - ALL_FPS: # Disable FPS Lock # REF: 88 46 40 F9 03 11 40 F9, first ADRP+LDR above it - type: write address: [MAIN, 0x2E8AB00, 0xE0, 0x284] + address_unsafe: true value_type: uint8 value: 0 \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/010054A020574000/6CB3E54C5F648410.yaml b/SaltySD/plugins/FPSLocker/patches/010054A020574000/6CB3E54C5F648410.yaml index e64833a..9fa3a01 100644 --- a/SaltySD/plugins/FPSLocker/patches/010054A020574000/6CB3E54C5F648410.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010054A020574000/6CB3E54C5F648410.yaml @@ -1,38 +1,31 @@ # 유미아의 아틀리에 ~추억의 연금술사와 창환의 땅~ 1.3.0 # BID: 6CB3E54C5F648410 -unsafeCheck: false +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.035714 + evaluate: "1.01 / FPS_TARGET" MASTER_WRITE: - # Redirect DR to MAIN + 0x2F5CFF0 + # Redirect DR # REF: A9 24 89 52 49 A2 A7 72, second REF - type: asm_a64 main_offset: 0x10AAEE4 instructions: [ - [adrp, x9, 0x2f5c000], - [ldr, s1, [x9, 0xff0]], + [adrp, x9, $dr_target], + [ldr, s1, [x9, $dr_target]], [nop] ] - ## Default value - - - type: bytes - main_offset: 0x2F5CFF0 - value_type: float - value: 0.035714 ALL_FPS: # Disable FPS Lock # REF: 88 46 40 F9 03 11 40 F9, first ADRP+LDR above it - type: write address: [MAIN, 0x2F23C00, 0xE0, 0x294] + address_unsafe: true value_type: uint8 value: 0 - # DR Target - - - type: evaluate_write - address: [MAIN, 0x2F5CFF0] - value_type: float - value: "1.01 / FPS_TARGET" - - diff --git a/SaltySD/plugins/FPSLocker/patches/0100559011740000/D2FD97779381FB9A.yaml b/SaltySD/plugins/FPSLocker/patches/0100559011740000/D2FD97779381FB9A.yaml index e63757a..c85000b 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100559011740000/D2FD97779381FB9A.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100559011740000/D2FD97779381FB9A.yaml @@ -1,13 +1,12 @@ # Monster Hunter Rise JP 16.02 # BID: D2FD97779381FB9A -unsafeCheck: false - ALL_FPS: # Internal FPS lock - type: evaluate_write address: [MAIN, 0x12B2E5C8, 0x434] + address_unsafe: true value_type: float value: FPS_LOCK_TARGET - diff --git a/SaltySD/plugins/FPSLocker/patches/010055D009F78000/89048449BA238C8C.yaml b/SaltySD/plugins/FPSLocker/patches/010055D009F78000/89048449BA238C8C.yaml index 9ef3513..f89947d 100644 --- a/SaltySD/plugins/FPSLocker/patches/010055D009F78000/89048449BA238C8C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010055D009F78000/89048449BA238C8C.yaml @@ -1,34 +1,32 @@ # Fire Emblem: Three Houses 1.2.0 # BID: 89048449BA238C8C -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 34 + evaluate: "0.99 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 25 + evaluate: "0.84 * FRAMETIME_TARGET" MASTER_WRITE: - # Redirect DR timing targets to MAIN + 0x21E4F30 + # Redirect DR timing targets - type: asm_a64 main_offset: 0x4C82D0 instructions: [ - [adrp, x10, 0x21e4000], - [ldr, s2, [x10, 0xf30]] + [adrp, x10, $dr_target1], + [ldr, s2, [x10, $dr_target1]] ] - type: asm_a64 main_offset: 0x4C8300 instructions: [ - [adrp, x8, 0x21e4000], - [ldr, s2, [x8, 0xf34]] + [adrp, x8, $dr_target2], + [ldr, s2, [x8, $dr_target2]] ] - # Default values - - - type: bytes - main_offset: 0x21E4F30 - value_type: float - value: [34, 25] -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x21E4F30] - value_type: float - value: ["0.99 * FRAMETIME_TARGET", "0.84 * FRAMETIME_TARGET"] - diff --git a/SaltySD/plugins/FPSLocker/patches/010056B015FE8000/E43525F22282A477.yaml b/SaltySD/plugins/FPSLocker/patches/010056B015FE8000/E43525F22282A477.yaml index 6b0c129..d59cd02 100644 --- a/SaltySD/plugins/FPSLocker/patches/010056B015FE8000/E43525F22282A477.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010056B015FE8000/E43525F22282A477.yaml @@ -1,49 +1,54 @@ # NieR:Automata The End of YoRHa Edition US/EU 1.0.2 # BID: E43525F22282A477 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target_bad + value_type: float + default_value: 45 + evaluate: "1.35 * FRAMETIME_TARGET" + - + type: variable + name: dr_target_optimal + value_type: float + default_value: 32.01 + evaluate: "0.9603 * FRAMETIME_TARGET" + - + type: variable + name: dr_target_good + value_type: float + default_value: 30 + evaluate: "0.9 * FRAMETIME_TARGET" MASTER_WRITE: - # Redirect DR timings to MAIN + 0x2BE6F00, [Bad, Optimal, Good] + # Redirect DR timings - type: asm_a64 main_offset: 0x9BF3E4 instructions: [ - [adrp, x12, 0x2be6000], - [ldr, s3, [x12, 0xf00]] + [adrp, x12, $dr_target_bad], + [ldr, s3, [x12, $dr_target_bad]] ] - type: asm_a64 main_offset: 0x9BF434 instructions: [ - [adrp, x12, 0x2be6000], - [ldr, w12, [x12, 0xf04]] + [adrp, x12, $dr_target_optimal], + [ldr, w12, [x12, $dr_target_optimal]] ] - type: asm_a64 main_offset: 0x9BF484 instructions: [ [fcsel, s3, s4, s0, gt], - [adrp, x12, 0x2be6000], - [ldr, s0, [x12, 0xf04]], - [nop] + [adrp, x12, $dr_target_optimal], + [ldr, s0, [x12, $dr_target_optimal]], + [adrp, x12, $dr_target_good] ] - type: asm_a64 main_offset: 0x9BF4A8 instructions: [ - [ldr, s0, [x12, 0xf08]] + [ldr, s0, [x12, $dr_target_good]] ] - # Default values - - - type: bytes - main_offset: 0x2BE6F00 - value_type: float - value: [45, 32.01, 30] -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x2BE6F00] - value_type: float - value: ["1.35 * FRAMETIME_TARGET", "0.9603 * FRAMETIME_TARGET", "0.9 * FRAMETIME_TARGET"] diff --git a/SaltySD/plugins/FPSLocker/patches/010056E00853A000/746F0D697EEEE2DD.yaml b/SaltySD/plugins/FPSLocker/patches/010056E00853A000/746F0D697EEEE2DD.yaml index e22db50..d3b76aa 100644 --- a/SaltySD/plugins/FPSLocker/patches/010056E00853A000/746F0D697EEEE2DD.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010056E00853A000/746F0D697EEEE2DD.yaml @@ -1,12 +1,11 @@ # A Hat in Time 1.0.4 # BID: 746F0D697EEEE2DD -unsafeCheck: false - ALL_FPS: # MaxSmoothedFrameRate - type: evaluate_write address: [MAIN, 0x2265248, 0x71C] + address_unsafe: true value_type: float value: FPS_LOCK_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/0100582010AE0000/B3967105033ACC08.yaml b/SaltySD/plugins/FPSLocker/patches/0100582010AE0000/B3967105033ACC08.yaml index 5e261a4..9f0ea28 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100582010AE0000/B3967105033ACC08.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100582010AE0000/B3967105033ACC08.yaml @@ -1,8 +1,61 @@ # Crysis 2 Remastered 1.3.0 # BID: B3967105033ACC08 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 31.5 + evaluate: "0.945 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 32.5 + evaluate: "0.975 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target3 + value_type: float + default_value: 33 + evaluate: "0.99 * FRAMETIME_TARGET" + - + type: variable + name: dr_target4 + value_type: float + default_value: 35 + evaluate: "0.99 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target5 + value_type: float + default_value: 32 + evaluate: "0.96 * FRAMETIME_TARGET" + - + type: variable + name: dr_target6 + value_type: float + default_value: 33.5 + evaluate: "0.96 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target7 + value_type: float + default_value: 28.75 + evaluate: "0.8625 * FRAMETIME_TARGET" + - + type: variable + name: dr_target8 + value_type: float + default_value: 29.75 + evaluate: "0.8625 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END MASTER_WRITE: # Redirect Dynamic Resolution Timings to read always not from .text - @@ -22,63 +75,32 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x2EE9A38 instructions: [ - [adrp, x11, 0x453b000] + [adrp, x11, $dr_target1] ] - type: asm_a64 main_offset: 0x2EE9A40 instructions: [ - [adrp, x12, 0x453b000], - [ldr, s1, [x11, 0x300]], - [ldr, s2, [x12, 0x304]] + [adrp, x12, $dr_target2], + [ldr, s1, [x11, $dr_target1]], + [ldr, s2, [x12, $dr_target2]] ] - type: asm_a64 main_offset: 0x2EE9A50 instructions: [ - [adrp, x13, 0x453b000], - [add, x13, x13, 0x308] + [adrp, x13, $dr_target3], + [add, x13, x13, $dr_target3] ] - type: asm_a64 main_offset: 0x2EE9A7C instructions: [ - [adrp, x9, 0x453b000], - [add, x9, x9, 0x310], - [adrp, x11, 0x453b000], - [add, x11, x11, 0x318] + [adrp, x9, $dr_target5], + [add, x9, x9, $dr_target5], + [adrp, x11, $dr_target7], + [add, x11, x11, $dr_target7] ] -# Write default values - # MAIN + 0x333FAFC - - - type: bytes - main_offset: 0x453B300 - value_type: float - value: 31.5 - # MAIN + 0x333F844 - - - type: bytes - main_offset: 0x453B304 - value_type: float - value: 32.5 - # MAIN + 0x333E360 - - - type: bytes - main_offset: 0x453B308 - value_type: float - value: [33, 35] - # MAIN + 0x333E258 - - - type: bytes - main_offset: 0x453B310 - value_type: float - value: [32, 33.5] - # MAIN + 0x333E9F8 - - - type: bytes - main_offset: 0x453B318 - value_type: float - value: [28.75, 29.75] ALL_FPS: # sys_MaxFPS - @@ -88,40 +110,10 @@ ALL_FPS: value: FPS_LOCK_TARGET # Renderer thread delay - - type: write + type: evaluate_write address: [MAIN, 0x444A0D8] value_type: float - value: 0.01 - # MAIN + 0x333FAFC - - - type: evaluate_write - address: [MAIN, 0x453B300] - value_type: float - value: "0.945 * FRAMETIME_TARGET" - # MAIN + 0x333F844 - - - type: evaluate_write - address: [MAIN, 0x453B304] - value_type: float - value: "0.975 * FRAMETIME_TARGET" - # MAIN + 0x333E360 - - - type: evaluate_write - address: [MAIN, 0x453B308] - value_type: float - value: ["0.99 * FRAMETIME_TARGET", "0.99 * FRAMETIME_TARGET"] - # MAIN + 0x333E258 - - - type: evaluate_write - address: [MAIN, 0x453B310] - value_type: float - value: ["0.96 * FRAMETIME_TARGET", "0.96 * FRAMETIME_TARGET"] - # MAIN + 0x333E9F8 - - - type: evaluate_write - address: [MAIN, 0x453B318] - value_type: float - value: ["0.8625 * FRAMETIME_TARGET", "0.8625 * FRAMETIME_TARGET"] + value: "0.66 / FPS_TARGET" - type: block what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/01005AE0209A8000/36B692C0FA9F6F46.yaml b/SaltySD/plugins/FPSLocker/patches/01005AE0209A8000/36B692C0FA9F6F46.yaml index bb95d83..1b2e093 100644 --- a/SaltySD/plugins/FPSLocker/patches/01005AE0209A8000/36B692C0FA9F6F46.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01005AE0209A8000/36B692C0FA9F6F46.yaml @@ -1,8 +1,19 @@ # WARRIORS: Abyss 1.4.0 # BID: 36B692C0FA9F6F46 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 50 + evaluate: "1.5 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 40 + evaluate: "1.2 * FRAMETIME_TARGET" MASTER_WRITE: # REF: 09 49 A8 52 21 01 27 1E 00 20 21 1E # Use FPS Target instead of vsync value for Dynamic Resolution max delta @@ -13,27 +24,21 @@ MASTER_WRITE: [adrp, x1, 0x1021000], [ldr, s1, [x1, 0xe10]] ] - # Redirect DR Targets to MAIN+0x1477F00 + # Redirect DR Targets - type: asm_a64 main_offset: 0x6E3B94 instructions: [ - [adrp, x9, 0x14bf000], - [ldr, s1, [x9, 0xf00]] + [adrp, x9, $dr_target1], + [ldr, s1, [x9, $dr_target1]] ] - type: asm_a64 main_offset: 0x6E3BA4 instructions: [ - [adrp, x9, 0x14bf000], - [ldr, s1, [x9, 0xf04]] + [adrp, x9, $dr_target2], + [ldr, s1, [x9, $dr_target2]] ] - # Default values - - - type: bytes - main_offset: 0x14BFF00 - value_type: float - value: [50, 40] ALL_FPS: # REF: 00 00 F0 42 78 00 00 00 00 00 F0 42 04 00 00 00 # FPS Lock @@ -68,9 +73,3 @@ ALL_FPS: address: [MAIN, 0x1021E18] value_type: float value: "FPS_TARGET" - - - type: evaluate_write - address: [MAIN, 0x14BFF00] - value_type: float - - value: ["1.5 * FRAMETIME_TARGET", "1.2 * FRAMETIME_TARGET"] diff --git a/SaltySD/plugins/FPSLocker/patches/01005EA01C0FC001/D91C67509C6AED8D.yaml b/SaltySD/plugins/FPSLocker/patches/01005EA01C0FC001/D91C67509C6AED8D.yaml index c3645be..0ceb09a 100644 --- a/SaltySD/plugins/FPSLocker/patches/01005EA01C0FC001/D91C67509C6AED8D.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01005EA01C0FC001/D91C67509C6AED8D.yaml @@ -1,8 +1,6 @@ # SONIC GENERATIONS 1.0.1/1.1.0 # BID: D91C67509C6AED8D -unsafeCheck: true - MASTER_WRITE: # NOP internal FPS Lock # REF: 00 00 23 1E E1 02 27 1E 00 08 21 1E @@ -20,11 +18,3 @@ MASTER_WRITE: instructions: [ [mov, w20, 2] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x5226F00] - value_type: uint8 - value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/3E961285846C72A5.yaml b/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/3E961285846C72A5.yaml index 6903b51..5e05f79 100644 --- a/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/3E961285846C72A5.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/3E961285846C72A5.yaml @@ -1,13 +1,12 @@ # Warhammer 40,000: Boltgun 1.0.0.7 # BID: 3E961285846C72A5 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to unlock framerate - type: write address: [MAIN, 0x63A69F8, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/7C992B6A003C599F.yaml b/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/7C992B6A003C599F.yaml index fc18676..391628b 100644 --- a/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/7C992B6A003C599F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/7C992B6A003C599F.yaml @@ -1,13 +1,12 @@ # Warhammer 40,000: Boltgun 1.0.0.3 # BID: 7C992B6A003C599F -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to unlock framerate - type: write address: [MAIN, 0x710C9C8, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/B8630C6EE3A22FE8.yaml b/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/B8630C6EE3A22FE8.yaml index 36e5535..1395d69 100644 --- a/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/B8630C6EE3A22FE8.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01005FD017E60000/B8630C6EE3A22FE8.yaml @@ -1,13 +1,12 @@ # Warhammer 40,000: Boltgun 1.0.0.6 # BID: B8630C6EE3A22FE8 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to unlock framerate - type: write address: [MAIN, 0x63A69F8, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/010060700AC50000/E853C44FDF18B88F.yaml b/SaltySD/plugins/FPSLocker/patches/010060700AC50000/E853C44FDF18B88F.yaml index bb73ddd..50a5caa 100644 --- a/SaltySD/plugins/FPSLocker/patches/010060700AC50000/E853C44FDF18B88F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010060700AC50000/E853C44FDF18B88F.yaml @@ -2,25 +2,24 @@ # BID: E853C44FDF18B88F # Credits to Hazerou for finding offsets for FPS lock and speed -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.0166666666 + evaluate: "0.5 / FPS_TARGET" MASTER_WRITE: # Redirect reading DR GPU time factor to MAIN + 0x4FC0E00 - type: asm_a64 main_offset: 0x470E80 instructions: [ - [adrp, x9, 0x4fc0000], - [ldr, s2, [x9, 0xe00]] + [adrp, x9, $dr_target], + [ldr, s2, [x9, $dr_target]] ] -# Default value (= 0.5 / FPS) - - - type: bytes - main_offset: 0x4FC0E00 - value_type: float - value: 0.0166666666 ALL_FPS: - # Internal Vsync (default value) + # Internal Vsync - type: evaluate_write address: [MAIN, 0x45A7410] @@ -32,10 +31,3 @@ ALL_FPS: address: [MAIN, 0x45A71F0] value_type: float value: FPS_TARGET - # DR GPU time factor - - - type: evaluate_write - address: [MAIN, 0x4FC0E00] - value_type: float - value: "0.5 / FPS_TARGET" - diff --git a/SaltySD/plugins/FPSLocker/patches/0100628004BCE000/81DA4F9E1E961CA6.yaml b/SaltySD/plugins/FPSLocker/patches/0100628004BCE000/81DA4F9E1E961CA6.yaml index 6530471..cc1faf9 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100628004BCE000/81DA4F9E1E961CA6.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100628004BCE000/81DA4F9E1E961CA6.yaml @@ -1,29 +1,20 @@ # Nights Of Azure 2: Bride of the New Moon 1.0.1 # BID: 81DA4F9E1E961CA6 -unsafeCheck: true - +DECLARATIONS: + - + type: code + name: tripleBuffer + instructions: [ + [mov, w22, 3], + [str, w22, [x1, 8]], + [b, 0xa305c0] + ] MASTER_WRITE: # Remove double buffer - type: asm_a64 main_offset: 0x7E4ED8 instructions: [ - [bl, 0xa31900] + [bl, _tripleBuffer()] ] - - - type: asm_a64 - main_offset: 0xA31900 - instructions: [ - [mov, w22, 3], - [str, w22, [x1, 8]], - [b, 0xa305c0] - ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x13E5400] - value_type: uint8 - value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/010064C01A9BA000/1BA8D8FD3897F22F.yaml b/SaltySD/plugins/FPSLocker/patches/010064C01A9BA000/1BA8D8FD3897F22F.yaml new file mode 100644 index 0000000..ce2f05b --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/010064C01A9BA000/1BA8D8FD3897F22F.yaml @@ -0,0 +1,10 @@ +# Tamagotchi Plaza 1.0.4 +# BID: 1BA8D8FD3897F22F + +ALL_FPS: + # UnityEngine.Rendering.OnDemandRendering_TypeInfo + - + type: write + address: [MAIN, 0x683EB68, 0xB8, 0] + value_type: int32 + value: -1 \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100650018FE0000/7A450848CFDEC18E.yaml b/SaltySD/plugins/FPSLocker/patches/0100650018FE0000/7A450848CFDEC18E.yaml index 51a151c..7aa5975 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100650018FE0000/7A450848CFDEC18E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100650018FE0000/7A450848CFDEC18E.yaml @@ -2,8 +2,6 @@ # BID: 7A450848CFDEC18E # Some prerendered cutscenes are still pushed at 30 FPS -unsafeCheck: true - MASTER_WRITE: # Block updating DR timings, REF: 00 01 27 1E 48 40 A8 52 - @@ -40,10 +38,10 @@ ALL_FPS: value: FPS_LOCK_TARGET # Renderer thread delay - - type: write + type: evaluate_write address: [MAIN, 0x5704028] value_type: float - value: 0.01 + value: "0.66 / FPS_TARGET" # DR timings - type: evaluate_write diff --git a/SaltySD/plugins/FPSLocker/patches/0100651014DBA000/789C2939A757C0CD.yaml b/SaltySD/plugins/FPSLocker/patches/0100651014DBA000/789C2939A757C0CD.yaml index 65ce71c..5b071a2 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100651014DBA000/789C2939A757C0CD.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100651014DBA000/789C2939A757C0CD.yaml @@ -1,8 +1,19 @@ # Sherlock Holmes: Crimes and Punishments 1.0.0 # BID: 789C2939A757C0CD -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 38 + evaluate: "1.14 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 32 + evaluate: "0.96 * FRAMETIME_TARGET" MASTER_WRITE: # Redirect Dynamic Resolution timings to MAIN + 0x23774F00 # 38.0 @@ -10,24 +21,18 @@ MASTER_WRITE: type: asm_a64 main_offset: 0xF57294 instructions: [ - [adrp, x9, 0x23774000], + [adrp, x9, $dr_target1], [fmul, s0, s0, s1], - [ldr, s1, [x9, 0xf00]] + [ldr, s1, [x9, $dr_target1]] ] # 32.0 - type: asm_a64 main_offset: 0xF572B8 instructions: [ - [ldr, s1, [x9, 0xf04]], - [nop] + [adrp, x9, $dr_target2], + [ldr, s1, [x9, $dr_target2]] ] - # Default values: - - - type: bytes - main_offset: 0x23774F00 - value_type: float - value: [38.0, 32.0] ALL_FPS: # UGameEngine::GetMaxTickRate() # Bool Lock FPS @@ -36,9 +41,3 @@ ALL_FPS: address: [MAIN, 0x2E61108] value_type: uint8 value: 0 - # Dynamic Resolution - - - type: evaluate_write - address: [MAIN, 0x23774F00] - value_type: float - value: ["(38.0 / (1000/30)) * FRAMETIME_TARGET", "(32.0 / (1000/30)) * FRAMETIME_TARGET"] diff --git a/SaltySD/plugins/FPSLocker/patches/0100670014482000/824B38A25986B2AB.yaml b/SaltySD/plugins/FPSLocker/patches/0100670014482000/824B38A25986B2AB.yaml index 15f4ddb..c20bc99 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100670014482000/824B38A25986B2AB.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100670014482000/824B38A25986B2AB.yaml @@ -2,30 +2,23 @@ # BID: 824B38A25986B2AB # Scenes exclusively 2D are tied to framerate, so at 60 FPS they are 2x faster. -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_scale + value_type: float + default_value: 1 + evaluate: "FPS_TARGET / 30" MASTER_WRITE: -# Patch code to multiply last frametime by float scale factor stored in MAIN+0x3B4D800 +# Patch code to multiply last frametime by float scale factor # To match it to Dynamic Resolution calculations - type: asm_a64 main_offset: 0xB40638 instructions: [ - [adrp, x9, 0x3b4d000], - [ldr, s0, [x9, 0x800]], + [adrp, x9, $dr_scale], + [ldr, s0, [x9, $dr_scale]], [fmul, s9, s8, s0], [nop] ] -# Write default dynamic resolution timing factor - - - type: bytes - main_offset: 0x3B4D800 - value_type: float - value: 1 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x3B4D800] - value_type: float - value: "FPS_TARGET / 30" - diff --git a/SaltySD/plugins/FPSLocker/patches/0100670014482001/2B59D6C677258A2A.yaml b/SaltySD/plugins/FPSLocker/patches/0100670014482001/2B59D6C677258A2A.yaml index 24be0c4..955d659 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100670014482001/2B59D6C677258A2A.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100670014482001/2B59D6C677258A2A.yaml @@ -2,17 +2,23 @@ # BID: 2B59D6C677258A2A # Scenes exclusively 2D are tied to framerate, so at 60 FPS they are 2x faster. -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_scale + value_type: float + default_value: 1 + evaluate: "FPS_TARGET / 30" MASTER_WRITE: -# Patch code to multiply last frametime by float scale factor stored in MAIN+0x4276B00 +# Patch code to multiply last frametime by float scale factor # To match it to Dynamic Resolution calculations - type: asm_a64 main_offset: 0xBDBE44 instructions: [ - [adrp, x8, 0x4276000], - [ldr, s0, [x8, 0xb00]] + [adrp, x8, $dr_scale], + [ldr, s0, [x8, $dr_scale]] ] - type: asm_a64 @@ -21,16 +27,3 @@ MASTER_WRITE: [fmul, s0, s8, s0], [nop] ] -# Write default dynamic resolution timing factor - - - type: bytes - main_offset: 0x4276B00 - value_type: float - value: 1 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x4276B00] - value_type: float - value: "FPS_TARGET / 30" - diff --git a/SaltySD/plugins/FPSLocker/patches/0100670014482002/0AE4D1770B196094.yaml b/SaltySD/plugins/FPSLocker/patches/0100670014482002/0AE4D1770B196094.yaml index c049e8e..5ca3dc6 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100670014482002/0AE4D1770B196094.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100670014482002/0AE4D1770B196094.yaml @@ -2,28 +2,20 @@ # BID: 0AE4D1770B196094 # Scenes exclusively 2D are tied to framerate, so at 60 FPS they are 2x faster. -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_scale + value_type: float + default_value: 1000 + evaluate: "30000 / FPS_TARGET" MASTER_WRITE: -# Patch code to divide last frametime by float scale factor stored in MAIN+0x4422800 +# Patch code to divide last frametime by float scale factor # To match it to Dynamic Resolution calculations - type: asm_a64 main_offset: 0xAD51A0 instructions: [ - [adrp, x8, 0x4422000], - [ldr, s1, [x8, 0x800]] + [adrp, x8, $dr_scale], + [ldr, s1, [x8, $dr_scale]] ] -# Write default dynamic resolution timing factor - - - type: bytes - main_offset: 0x4422800 - value_type: float - value: 1000 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x4422800] - value_type: float - value: "(FPS_TARGET / 30) * 1000" - diff --git a/SaltySD/plugins/FPSLocker/patches/010067B017588000/E5EFB5ABA3601B97.yaml b/SaltySD/plugins/FPSLocker/patches/010067B017588000/E5EFB5ABA3601B97.yaml index 6f1de13..c477970 100644 --- a/SaltySD/plugins/FPSLocker/patches/010067B017588000/E5EFB5ABA3601B97.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010067B017588000/E5EFB5ABA3601B97.yaml @@ -3,8 +3,13 @@ # Some things are still tied to framerate, but nothing game breaking it seems. # Game is using double buffer, trying to enable triple buffer results in crash. -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.0333333333 + evaluate: "1/FPS_TARGET" MASTER_WRITE: # Swap 30 FPS target with 60 - @@ -51,21 +56,15 @@ MASTER_WRITE: instructions: [ [mov, w21, 2] ] - # Redirect DR timing target to MAIN + 0x1C5DF00 + # Redirect DR timing target - type: asm_a64 main_offset: 0xA38B18 instructions: [ - [adrp, x1, 0x1c5d000], - [ldr, s0, [x1, 0xf00]] + [adrp, x1, $dr_target], + [ldr, s0, [x1, $dr_target]] ] ALL_FPS: - # DR timing = 1/FPS - - - type: evaluate_write - address: [MAIN, 0x1C5DF00] - value_type: float - value: "1 / FPS_TARGET" # vsync target - type: evaluate_write @@ -73,3 +72,4 @@ ALL_FPS: value_type: uint32 value: "VSYNC_TARGET - 1" + diff --git a/SaltySD/plugins/FPSLocker/patches/010071F0228CA000/DE26B43C3D21B3A3.yaml b/SaltySD/plugins/FPSLocker/patches/010071F0228CA000/DE26B43C3D21B3A3.yaml index d235e76..e155513 100644 --- a/SaltySD/plugins/FPSLocker/patches/010071F0228CA000/DE26B43C3D21B3A3.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010071F0228CA000/DE26B43C3D21B3A3.yaml @@ -1,13 +1,12 @@ # Labirynth Of The Demon King 1.81 # BID: DE26B43C3D21B3A3 -unsafeCheck: false - ALL_FPS: # Disable FixedFrameRate - type: write address: [MAIN, 0x59ED248, 0x7A4] + address_unsafe: true value_type: uint32 value: 7 # t.MaxFPS diff --git a/SaltySD/plugins/FPSLocker/patches/010072900AFF0000/FE757B10B45C3444.yaml b/SaltySD/plugins/FPSLocker/patches/010072900AFF0000/FE757B10B45C3444.yaml index 143fa54..5d6c314 100644 --- a/SaltySD/plugins/FPSLocker/patches/010072900AFF0000/FE757B10B45C3444.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010072900AFF0000/FE757B10B45C3444.yaml @@ -1,87 +1,74 @@ # Gear.Club Unlimited 2 1.7.2 # BID: FE757B10B45C3444 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: vsync_target + value_type: uint32 + default_value: 2 + evaluate: VSYNC_TARGET + - + type: variable + name: dr_target + value_type: float + default_value: 33 + evaluate: "1.1 * FPS_TARGET" + - + type: code + name: getVsyncTarget + instructions: [ + [adrp, x1, $vsync_target], + [ldr, w1, [x1, $vsync_target]], + [mov, w19, w1], + [ret] + ] + - + type: code + name: getDrTarget + instructions: [ + [adrp, x0, $dr_target], + [ldr, s0, [x0, $dr_target]], + [ret] + ] MASTER_WRITE: -# Edit Eden.Graphics.IGraphicsQualityProfile::set_VSyncCount to get interval from MAIN + 0x5FBAF20 +# Edit Eden.Graphics.IGraphicsQualityProfile::set_VSyncCount # If not edited, light is flickering at > 30 FPS - type: asm_a64 main_offset: 0x14B4990 instructions: [ - [adrp, x1, 0x5fba000], - [ldr, w1, [x1, 0xf20]], + [adrp, x1, $vsync_target], + [ldr, w1, [x1, $vsync_target]], [str, w1, [x0, 0x54]], [ret] ] -# Edit UnityEngine.QualitySettings::set_vSyncCount to get interval from MAIN + 0x5FBAF20 +# Edit UnityEngine.QualitySettings::set_vSyncCount # If not edited, light is flickering at > 30 FPS - type: asm_a64 main_offset: 0x1B46EE4 instructions: [ - [adrp, x0, 0x5fba000], - [ldr, w0, [x0, 0xf20]], + [adrp, x0, $vsync_target], + [ldr, w0, [x0, $vsync_target]], [ldp, x29, x30, [sp, 0x20]], [ldp, x20, x19, [sp, 0x10]], [add, sp, sp, 0x30], [br, x1] ] -# Edit Eden.Graphics.GraphicsQualityManager::SetTargetFrameRate to get interval from MAIN + 0x5FBAF20 +# Edit Eden.Graphics.GraphicsQualityManager::SetTargetFrameRate # If not edited, it locks to 30 FPS - type: asm_a64 main_offset: 0x14AB578 instructions: [ - [bl, 0x3445ce8] + [bl, _getVsyncTarget()] ] - - - type: asm_a64 - main_offset: 0x3445CE8 - instructions: [ - [adrp, x1, 0x5fba000], - [ldr, w1, [x1, 0xf20]], - [mov, w19, w1], - [ret] - ] -# Edit Eden.Graphics.DynamicResolutionScaler::UpdateScaling to get DR target timing from MAIN + 0x5FBAF28 +# Edit Eden.Graphics.DynamicResolutionScaler::UpdateScaling # If not edited, performance is much worse at > 30 FPS - type: asm_a64 main_offset: 0x14988BC instructions: [ - [bl, 0x3445cf8] + [bl, _getDrTarget()] ] - - - type: asm_a64 - main_offset: 0x3445CF8 - instructions: [ - [adrp, x0, 0x5fba000], - [ldr, s0, [x0, 0xf28]], - [ret] - ] -# Default values - - - type: bytes - main_offset: 0x5FBAF20 - value_type: uint32 - value: 2 - - - type: bytes - main_offset: 0x5FBAF28 - value_type: float - value: 33 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x5FBAF20] - value_type: uint32 - value: VSYNC_TARGET - - - type: evaluate_write - address: [MAIN, 0x5FBAF28] - value_type: float - value: "1.1 * FPS_TARGET" - - diff --git a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/42350FCC758887D1.yaml b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/42350FCC758887D1.yaml index 81eb566..2f040e9 100644 --- a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/42350FCC758887D1.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/42350FCC758887D1.yaml @@ -1,8 +1,6 @@ # F1 Manager 2024 1.4 # BID: 42350FCC758887D1 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/53C0F2107412F0E2.yaml b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/53C0F2107412F0E2.yaml index 2bbcd85..7880372 100644 --- a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/53C0F2107412F0E2.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/53C0F2107412F0E2.yaml @@ -1,8 +1,6 @@ # F1 Manager 2024 1.8 # BID: 53C0F2107412F0E2 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/645C3BE90D4ED3D5.yaml b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/645C3BE90D4ED3D5.yaml index a2c44ff..047b7b2 100644 --- a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/645C3BE90D4ED3D5.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/645C3BE90D4ED3D5.yaml @@ -1,8 +1,6 @@ # F1 Manager 2024 1.3 # BID: 645C3BE90D4ED3D5 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/A245DABD986CBC85.yaml b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/A245DABD986CBC85.yaml index 1549d64..78dd757 100644 --- a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/A245DABD986CBC85.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/A245DABD986CBC85.yaml @@ -1,8 +1,6 @@ # F1 Manager 2024 1.7 # BID: A245DABD986CBC85 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/CA23556FE5EF2EB1.yaml b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/CA23556FE5EF2EB1.yaml index 5e0a4cf..78bf1b1 100644 --- a/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/CA23556FE5EF2EB1.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010072E01CE0E000/CA23556FE5EF2EB1.yaml @@ -1,8 +1,6 @@ # F1 Manager 2024 1.5 # BID: CA23556FE5EF2EB1 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010073601DF1A000/E8BF195297B63BA2.yaml b/SaltySD/plugins/FPSLocker/patches/010073601DF1A000/E8BF195297B63BA2.yaml index d5b047d..7981a88 100644 --- a/SaltySD/plugins/FPSLocker/patches/010073601DF1A000/E8BF195297B63BA2.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010073601DF1A000/E8BF195297B63BA2.yaml @@ -1,7 +1,13 @@ # Amber Isle 1.0.3 # BID: E8BF195297B63BA2 -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_target + value_type: double + default_value: 25.333333333333336 + evaluate: "FRAMETIME_TARGET * 0.76" MASTER_WRITE: # Redirect all hardcoded doubles in DynamicResolutionHandler::Update to MAIN+0x909EF00 @@ -10,48 +16,37 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x21FE1E4 instructions: [ - [adrp, x8, 0x909e000], - [ldr, d0, [x8, 0xf00]] + [adrp, x8, $dr_target], + [ldr, d0, [x8, $dr_target]] ] - type: asm_a64 main_offset: 0x21FE3E0 instructions: [ - [adrp, x8, 0x909e000], - [ldr, d1, [x8, 0xf00]] + [adrp, x8, $dr_target], + [ldr, d1, [x8, $dr_target]] ] - type: asm_a64 main_offset: 0x21FE43C instructions: [ - [adrp, x8, 0x909e000], - [ldr, d1, [x8, 0xf00]] + [adrp, x8, $dr_target], + [ldr, d1, [x8, $dr_target]] ] - type: asm_a64 main_offset: 0x21FE7D4 instructions: [ - [adrp, x8, 0x909e000], - [ldr, d0, [x8, 0xf00]] + [adrp, x8, $dr_target], + [ldr, d0, [x8, $dr_target]] ] ## REF: c8 aa 8a f2 28 07 f8 f2 - type: asm_a64 main_offset: 0x21fE550 instructions: [ - [adrp, x8, 0x909e000], - [ldr, d0, [x8, 0xf00]], + [adrp, x8, $dr_target], + [ldr, d0, [x8, $dr_target]], [fneg, d0, d0] ] - # default value - - - type: bytes - main_offset: 0x909EF00 - value_type: double - value: 25.333333333333336 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x909EF00] - value_type: double - value: "FRAMETIME_TARGET * 0.76" + diff --git a/SaltySD/plugins/FPSLocker/patches/010073C01B7FE000/F294A4EBE966E8A9.yaml b/SaltySD/plugins/FPSLocker/patches/010073C01B7FE000/F294A4EBE966E8A9.yaml index c52bc7c..87f9f6e 100644 --- a/SaltySD/plugins/FPSLocker/patches/010073C01B7FE000/F294A4EBE966E8A9.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010073C01B7FE000/F294A4EBE966E8A9.yaml @@ -1,8 +1,6 @@ -# The Smurfs 2: The Prisoner of the Green Stone 1.03.03 +# The Smurfs 2: The Prisoner of the Green Stone 1.03.03/1.04 # BID: F294A4EBE966E8A9 -unsafeCheck: true - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/010073F0197DA000/955DF07AA5F4497B.yaml b/SaltySD/plugins/FPSLocker/patches/010073F0197DA000/955DF07AA5F4497B.yaml index 43323e1..f916dde 100644 --- a/SaltySD/plugins/FPSLocker/patches/010073F0197DA000/955DF07AA5F4497B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010073F0197DA000/955DF07AA5F4497B.yaml @@ -1,13 +1,12 @@ # Redemption Reapers 1.4.0 # BID: 955DF07AA5F4497B -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate - type: write address: [MAIN, 0x751C478, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -30,3 +29,4 @@ ALL_FPS: - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/010074F013262000/82D187FE9EF9BE92.yaml b/SaltySD/plugins/FPSLocker/patches/010074F013262000/82D187FE9EF9BE92.yaml index 4541462..5f88380 100644 --- a/SaltySD/plugins/FPSLocker/patches/010074F013262000/82D187FE9EF9BE92.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010074F013262000/82D187FE9EF9BE92.yaml @@ -1,41 +1,42 @@ # Xenoblade Chronicles 3 2.2.0/2.2.1 # BID: 82D187FE9EF9BE92 -unsafeCheck: false - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 0.0166666666 + evaluate: "(1 / FPS_TARGET) / VSYNC_TARGET" + - + type: const + name: default_frametime + value: 0x3d088889 + - + type: code + name: etherFix + instructions: [ + [ldr, x21, [x0]], + [mov, w8, $default_frametime], + [movk, w8, $default_frametime, 16], + [str, w8, [x21, 0x214]], + [ret] + ] MASTER_WRITE: - # Redirect DR frametime target reading to .bss code cave [MAIN, 0x236AB00] + # Redirect DR frametime target reading - type: asm_a64 main_offset: 0x124F518 instructions: [ - [adrp, x8, 0x236a000], - [ldr, s0, [x8, 0xb00]] + [adrp, x8, $dr_target], + [ldr, s0, [x8, $dr_target]] ] - # Original DR frametime target - - - type: bytes - main_offset: 0x236AB00 - value_type: float - value: - - 0.0166666666 # Fix crash when gathering big amount of ether for > 30 FPS - - # Code cave at 0x1295DA0 + - type: asm_a64 main_offset: 0x67360 instructions: [ - [bl, 0x1295da0] - ] - - # Push fixed 1/30 float to game speed pointer late enough to not affect it - type: asm_a64 - main_offset: 0x1295DA0 - instructions: [ - [ldr, x21, [x0]], - [fmov, s1, 1.0], - [fmov, s2, 30.0], - [fdiv, s1, s1, s2], - [str, s1, [x21, 0x214]], - [ret] + [bl, _etherFix()] ] ALL_FPS: # vsync @@ -44,16 +45,11 @@ ALL_FPS: address: [MAIN, 0x1B42DB0] value_type: int32 value: [VSYNC_TARGET, VSYNC_TARGET] - # DR Timing (relative to vsync) - - - type: evaluate_write - address: [MAIN, 0x236AB00] - value_type: float - value: "((1 / FPS_TARGET) / VSYNC_TARGET) * 0.78" # UI speed - type: evaluate_write address: [MAIN, 0x1BA1A90, 128] + address_unsafe: true value_type: float value: "1 / FPS_TARGET" - @@ -66,30 +62,28 @@ ALL_FPS: value_type: int32 value: [2, 2] - - type: evaluate_compare + type: compare compare_address: [MAIN, 0x1BA1A98] compare_type: "!=" compare_value_type: int8 compare_value: 0 - address: [MAIN, 0x236AB00] - value_type: float - value: "((1 / 30) / 2) * 0.78" - - - type: evaluate_compare - compare_address: [MAIN, 0x1BA1A98] - compare_type: "!=" - compare_value_type: int8 - compare_value: 0 - address: [MAIN, 0x1BA1A90, 128] - value_type: float - value: "1 / 30" + address: [VARIABLE, dr_target] + value: 0.0166666666 + - + type: compare + compare_address: [MAIN, 0x1BA1A98] + compare_type: "!=" + compare_value_type: int8 + compare_value: 0 + address: [MAIN, 0x1BA1A90, 128] + address_unsafe: true + value_type: float + value: 0.0333333333 - type: compare compare_address: [MAIN, 0x1BA1A98] compare_type: "!=" compare_value_type: int8 compare_value: 0 - address: [MAIN] value_type: refresh_rate value: 30 - diff --git a/SaltySD/plugins/FPSLocker/patches/010075101EF84000/109D974E180A5AA1.yaml b/SaltySD/plugins/FPSLocker/patches/010075101EF84000/109D974E180A5AA1.yaml index 7fd7e03..b861064 100644 --- a/SaltySD/plugins/FPSLocker/patches/010075101EF84000/109D974E180A5AA1.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010075101EF84000/109D974E180A5AA1.yaml @@ -1,13 +1,12 @@ # Stray 1.6.0 # BID: 109D974E180A5AA1 -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate - type: write address: [MAIN, 0x5DC7368, 0x7A4] + address_unsafe: true value_type: int32 value: 7 # r.VSync diff --git a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/061A7341077C0974.yaml b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/061A7341077C0974.yaml index 8d38091..89e393c 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/061A7341077C0974.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/061A7341077C0974.yaml @@ -1,8 +1,6 @@ # FANTASY LIFE i: The Girl Who Steals Time 1.4.0 # BID: 061A7341077C0974 -unsafeCheck: true - ALL_FPS: # t.MaxFPS - @@ -18,4 +16,4 @@ ALL_FPS: value: [0, 0] - type: block - what: timing \ No newline at end of file + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/66BC954F5323014C.yaml b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/66BC954F5323014C.yaml index 8e76498..749f7ec 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/66BC954F5323014C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/66BC954F5323014C.yaml @@ -1,13 +1,12 @@ # FANTASY LIFE i: The Girl Who Steals Time 1.2.1 # BID: 66BC954F5323014C -unsafeCheck: false - ALL_FPS: # Disable FixedFrameRate - type: write address: [MAIN, 0xACC63E0, 0xAA4] + address_unsafe: true value_type: uint32 value: 7 # t.MaxFPS diff --git a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/74BCAC96835DB9AE.yaml b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/74BCAC96835DB9AE.yaml new file mode 100644 index 0000000..8ae3651 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/74BCAC96835DB9AE.yaml @@ -0,0 +1,19 @@ +# FANTASY LIFE i: The Girl Who Steals Time 1.5.0 +# BID: 74BCAC96835DB9AE + +ALL_FPS: + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0xAE6F938, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + # r.VSync + - + type: write + address: [MAIN, 0x9E4F728, 0] + value_type: uint32 + value: [0, 0] + - + type: block + what: timing \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/9DBA6AA32721CAB9.yaml b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/9DBA6AA32721CAB9.yaml index fbe97c6..7d77a61 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/9DBA6AA32721CAB9.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/9DBA6AA32721CAB9.yaml @@ -1,13 +1,12 @@ # FANTASY LIFE i: The Girl Who Steals Time 1.3.0 # BID: 9DBA6AA32721CAB9 -unsafeCheck: false - ALL_FPS: # Disable FixedFrameRate - type: write address: [MAIN, 0xACF23E0, 0xAA4] + address_unsafe: true value_type: uint32 value: 7 # t.MaxFPS diff --git a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/A697413E1DA7851A.yaml b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/A697413E1DA7851A.yaml index a0925c2..dcd7b2b 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/A697413E1DA7851A.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100755017EE0000/A697413E1DA7851A.yaml @@ -1,13 +1,12 @@ # FANTASY LIFE i: The Girl Who Steals Time 1.1.0 # BID: A697413E1DA7851A -unsafeCheck: false - ALL_FPS: # Disable FixedFrameRate - type: write address: [MAIN, 0xAB873E0, 0xAA4] + address_unsafe: true value_type: uint32 value: 7 # t.MaxFPS diff --git a/SaltySD/plugins/FPSLocker/patches/010077B00E046000/D2775FAFCF4835CB.yaml b/SaltySD/plugins/FPSLocker/patches/010077B00E046000/D2775FAFCF4835CB.yaml index 1e36520..f1e3f24 100644 --- a/SaltySD/plugins/FPSLocker/patches/010077B00E046000/D2775FAFCF4835CB.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010077B00E046000/D2775FAFCF4835CB.yaml @@ -1,13 +1,12 @@ # Spyro Reignited Trilogy 1.01 # BID: D2775FAFCF4835CB -unsafeCheck: false - ALL_FPS: # Disable bSmoothFrameRate and bUseFixedFrameRate to untie game speed from framerate - type: write address: [MAIN, 0x69DA1A8, 0x778] + address_unsafe: true value_type: uint32 # Default is 0x67, bSmoothFrameRate |= 0x20, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/56405C9D6C8C0A6A.yaml b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/56405C9D6C8C0A6A.yaml index 7bf45f5..a8a41f4 100644 --- a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/56405C9D6C8C0A6A.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/56405C9D6C8C0A6A.yaml @@ -3,32 +3,34 @@ # Double buffer is hardcoded in class, getting triple buffer is hard. # Some graphical effects like aura have wrong speed outside of 15, 20, 30 and 60 FPS -unsafeCheck: false - ALL_FPS: # Search those in Edizon by searching for 1/60 in title menu, then 1/30 when FPS lock is applied. # FPS Lock - type: write address: [MAIN, 0x4AD6D78, 0x698] + address_unsafe: true value_type: float value: 0.0 # Unknown - type: write address: [MAIN, 0x4AD6D78, 0x6A4] + address_unsafe: true value_type: float value: 0.0 # Game Battle Speed Factor - type: evaluate_write address: [MAIN, 0x4AD6D78, 0x6B0] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Cutscenes Speed Factor - type: evaluate_write address: [MAIN, 0x4AD6D78, 0x6B4] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Target Speed @@ -43,5 +45,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x24044B0, 0x754] + address_unsafe: true value_type: float value: "FPS_TARGET" diff --git a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/7640CE319C043D56.yaml b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/7640CE319C043D56.yaml index 045e1c1..ea6d498 100644 --- a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/7640CE319C043D56.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/7640CE319C043D56.yaml @@ -3,32 +3,34 @@ # Double buffer is hardcoded in class, getting triple buffer is hard. # Some graphical effects like aura have wrong speed outside of 15, 20, 30 and 60 FPS -unsafeCheck: false - ALL_FPS: # Search those in Edizon by searching for 1/60 in title menu, then 1/30 when FPS lock is applied. # FPS Lock - type: write address: [MAIN, 0x4AC8AD8, 0x698] + address_unsafe: true value_type: float value: 0.0 # Unknown - type: write address: [MAIN, 0x4AC8AD8, 0x6A4] + address_unsafe: true value_type: float value: 0.0 # Game Battle Speed Factor - type: evaluate_write address: [MAIN, 0x4AC8AD8, 0x6B0] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Cutscenes Speed Factor - type: evaluate_write address: [MAIN, 0x4AC8AD8, 0x6B4] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Target Speed @@ -43,5 +45,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x23D53C8, 0x1844] + address_unsafe: true value_type: float value: "FPS_TARGET" \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/8263E738648A23E3.yaml b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/8263E738648A23E3.yaml index 51b8758..7b4de42 100644 --- a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/8263E738648A23E3.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/8263E738648A23E3.yaml @@ -3,32 +3,34 @@ # Double buffer is hardcoded in class, getting triple buffer is hard. # Some graphical effects like aura have wrong speed outside of 15, 20, 30 and 60 FPS -unsafeCheck: false - ALL_FPS: # Search those in Edizon by searching for 1/60 in title menu, then 1/30 when FPS lock is applied. # FPS Lock - type: write address: [MAIN, 0x4AE9D78, 0x698] + address_unsafe: true value_type: float value: 0.0 # Unknown - type: write address: [MAIN, 0x4AE9D78, 0x6A4] + address_unsafe: true value_type: float value: 0.0 # Game Battle Speed Factor - type: evaluate_write address: [MAIN, 0x4AE9D78, 0x6B0] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Cutscenes Speed Factor - type: evaluate_write address: [MAIN, 0x4AE9D78, 0x6B4] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Target Speed @@ -43,5 +45,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x23F53C0, 0x1844] + address_unsafe: true value_type: float value: "FPS_TARGET" diff --git a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/82C912DDD4663022.yaml b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/82C912DDD4663022.yaml index ab9dcaa..cb0d503 100644 --- a/SaltySD/plugins/FPSLocker/patches/010078D000F88000/82C912DDD4663022.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010078D000F88000/82C912DDD4663022.yaml @@ -3,32 +3,34 @@ # Double buffer is hardcoded in class, getting triple buffer is hard. # Some graphical effects like aura have wrong speed outside of 15, 20, 30 and 60 FPS -unsafeCheck: false - ALL_FPS: # Search those in Edizon by searching for 1/60 in title menu, then 1/30 when FPS lock is applied. # FPS Lock - type: write address: [MAIN, 0x4AC8AD8, 0x698] + address_unsafe: true value_type: float value: 0.0 # Unknown - type: write address: [MAIN, 0x4AC8AD8, 0x6A4] + address_unsafe: true value_type: float value: 0.0 # Game Battle Speed Factor - type: evaluate_write address: [MAIN, 0x4AC8AD8, 0x6B0] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Cutscenes Speed Factor - type: evaluate_write address: [MAIN, 0x4AC8AD8, 0x6B4] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Target Speed @@ -43,5 +45,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x23D53C8, 0x1844] + address_unsafe: true value_type: float value: "FPS_TARGET" \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/010079C017F5E001/F47C697C2B59443B.yaml b/SaltySD/plugins/FPSLocker/patches/010079C017F5E001/F47C697C2B59443B.yaml index 9af86b5..2e92e3a 100644 --- a/SaltySD/plugins/FPSLocker/patches/010079C017F5E001/F47C697C2B59443B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010079C017F5E001/F47C697C2B59443B.yaml @@ -1,8 +1,6 @@ # Lara Croft and the Temple of Osiris 1.1_65791 # BID: F47C697C2B59443B -unsafeCheck: true - MASTER_WRITE: # Disable internal FPS lock # EnableFramerateManager @@ -17,4 +15,4 @@ ALL_FPS: type: evaluate_write address: [MAIN, 0x41416F0, 0x28] value_type: float - value: FPS_TARGET \ No newline at end of file + value: FPS_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/010079C017F5E002/BD5CD5189BC90093.yaml b/SaltySD/plugins/FPSLocker/patches/010079C017F5E002/BD5CD5189BC90093.yaml index 28c5368..b805bcd 100644 --- a/SaltySD/plugins/FPSLocker/patches/010079C017F5E002/BD5CD5189BC90093.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010079C017F5E002/BD5CD5189BC90093.yaml @@ -1,12 +1,10 @@ # Lara Croft and the Guardian of Light 1.1_65791 # BID: BD5CD5189BC90093 -unsafeCheck: false - ALL_FPS: # DynamicResolutionScaling\FPSTarget - type: evaluate_write address: [MAIN, 0x1EAE7E8, 0x28] value_type: float - value: FPS_TARGET \ No newline at end of file + value: FPS_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/01007EF00011E000/DE0B6AC4EFC1DDA7.yaml b/SaltySD/plugins/FPSLocker/patches/01007EF00011E000/DE0B6AC4EFC1DDA7.yaml index c21cadd..d0e6cfc 100644 --- a/SaltySD/plugins/FPSLocker/patches/01007EF00011E000/DE0B6AC4EFC1DDA7.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01007EF00011E000/DE0B6AC4EFC1DDA7.yaml @@ -1,8 +1,80 @@ # The Legend of Zelda: Breath of the Wild 1.8.2 # BID: DE0B6AC4EFC1DDA7 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: game_speed + value_type: float + default_value: 1.0 + - + type: variable + name: min_delta + value_type: float + default_value: 1.0 + evaluate: 30 / FPS_TARGET + - + type: variable + name: dr_factor + value_type: float + default_value: 100.0 + evaluate: (FPS_TARGET / 30) * 100 + - + type: variable + name: frame_tick + value_type: uint64 + default_value: 0 + - + type: const + name: default_frame_nanoseconds + value: 33333333 + - + type: code + name: dynamicSpeed + instructions: [ + [stp, x29, x30, [sp, -16], "!"], + [mov, x29, sp], + [blr, x8], + [mrs, x2, cntpct_el0], + [adrp, x8, $frame_tick], + [ldr, x1, [x8, $frame_tick]], + [cmp, x1, xzr], + [str, x2, [x8, $frame_tick]], + [b.eq, :goto4], + [sub, x0, x2, x1], + [bl, _convertTickToTimeSpan()], + [ucvtf, s0, x0], + [mov, w0, $default_frame_nanoseconds], + [movk, w0, $default_frame_nanoseconds, 16], + [ucvtf, s1, w0], + [fdiv, s0, s0, s1], + [fmov, s1, 2.0], + [fcmp, s0, s1], + [b.lt, :goto2], + [fmov, s0, s1], + :goto2, [adrp, x8, $min_delta], + [ldr, s1, [x8, $min_delta]], + [fcmp, s0, s1], + [b.gt, :goto3], + [fmov, s0, s1], + :goto3, [adrp, x8, $game_speed], + [str, s0, [x8, $game_speed]], + :goto4, [ldp, x29, x30, [sp], 16], + [ret] + ] + - + type: variable + name: cutscene_state + value_type: uint8 + default_value: 1 + - + type: code + name: signalCutscene + instructions: [ + [adrp, x7, $cutscene_state], + [strb, w1, [x7, $cutscene_state]], + [b, 0xbf7f78] + ] MASTER_WRITE: # Remove double buffer ## REF: 61 F6 42 39 @@ -12,125 +84,64 @@ MASTER_WRITE: instructions: [ [mov, w1, 1] ] - # Change pointer of time factor for DR calculations to MAIN + 0x1D36FF4 + # Change pointer of time factor for DR calculations to $dr_factor ## REF: 01 01 27 1E 08 59 A8 52 03 08 21 1E, replace hardcoded 100.0 float - type: asm_a64 main_offset: 0x1153314 instructions: [ - [adrp, x8, 0x1d36000], + [adrp, x8, $dr_factor], [fmul, s3, s0, s1], - [ldr, s1, [x8, 0xff4]] + [ldr, s1, [x8, $dr_factor]] ] # Dynamic speed - ## Replace nvnQueuePresentTexture call to code cave at MAIN+0x148D964 + ## Replace nvnQueuePresentTexture call to code cave _dynamicSpeed() - type: asm_a64 main_offset: 0xD874FC instructions: [ - [b, 0x148d964] + [bl, _dynamicSpeed()] ] - ## Patch game speed function to use speed from MAIN+0x1D36FF0 + ## Patch game speed function to use speed from $game_speed - type: asm_a64 main_offset: 0x14092A8 instructions: [ - [b, 0x14092b4] + [b, +12] ] - type: asm_a64 main_offset: 0x14092CC instructions: [ - [adrp, x9, 0x1d36000], - [ldr, s1, [x9, 0xff0]] + [adrp, x9, $game_speed], + [ldr, s1, [x9, $game_speed]] ] - ## Patch UI speed function to use speeed from MAIN+0x1D36FF0 + ## Patch UI speed function to use speeed from $game_speed - type: asm_a64 main_offset: 0x116D0D8 instructions: [ - [adrp, x7, 0x1d36000] + [adrp, x7, $game_speed] ] - type: asm_a64 main_offset: 0x116D0E4 instructions: [ - [ldr, s0, [x7, 0xff0]] - ] - ## CODE CAVE - - - type: asm_a64 - main_offset: 0x148D964 - instructions: [ - [blr, x8], - [mrs, x2, cntpct_el0], - [adrp, x8, 0x1d36000], - [ldr, x1, [x8, 0xff8]], - [cmp, x1, xzr], - [b.ne, 0x148d984], - [str, x2, [x8, 0xff8]], - [b, 0xd87500], - [sub, x0, x2, x1], - [bl, 0x148c860], # BL nn::os::ConvertToTimeSpan(nn::os::Tick) - [ucvtf, s0, x0], - [mov, w0, 0xa055], - [movk, w0, 0x1fc, 16], - [ucvtf, s1, w0], - [fdiv, s0, s0, s1], - [fmov, s1, 2.0], - [fcmp, s0, s1], - [b.lt, 0x148d9b0], - [fmov, s0, s1], - [adrp, x8, 0x1d36000], - [ldr, s1, [x8, 0xfec]], - [fcmp, s0, s1], - [b.gt, 0x148d9c4], - [fmov, s0, s1], - [str, s0, [x8, 0xff0]], - [b, 0x148d97c], - [adrp, x0, 0x1d36000], - [ldr, w0, [x0, 0xff0]], - [ret], - [adrp, x7, 0x1d36000], - [str, w1, [x7, 0xfe8]], - [b, 0xbf7f78] + [ldr, s0, [x7, $game_speed]] ] # Signal Cutscenes playing - type: asm_a64 main_offset: 0xC00680 instructions: [ - [bl, 0x148d9d8] + [bl, _signalCutscene()] ] - type: asm_a64 main_offset: 0xC00E40 instructions: [ - [bl, 0x148d9d8] + [bl, _signalCutscene()] ] - # Default speed - - - type: bytes - main_offset: 0x1D36FF0 - value_type: float - value: 1.0 - - - type: bytes - main_offset: 0x1D36FEC - value_type: float - value: 1.0 - # Default cutscene state - - - type: bytes - main_offset: 0x1D36FE8 - value_type: uint8 - value: 1 - # Default DR factor - - - type: bytes - main_offset: 0x1D36FF4 - value_type: float - value: 100.0 ALL_FPS: # Scrolling speed ## REF: 68 16 41 B9 D8 22 D5 1A @@ -140,25 +151,11 @@ ALL_FPS: address: [MAIN, 0x1C4BA40] value_type: float value: "30 / FPS_TARGET" - # Min Delta - - - type: evaluate_write - address: [MAIN, 0x1D36FEC] - value_type: float - value: "30 / FPS_TARGET" - # DR factor - - - type: evaluate_write - address: [MAIN, 0x1D36FF4] - value_type: float - value: "(FPS_TARGET / 30) * 100" # Prerendered cutscenes must be played at 30 FPS - type: compare - compare_address: [MAIN, 0x1D36FE8] + compare_address: [VARIABLE, cutscene_state] compare_type: "==" - compare_value_type: uint8 compare_value: 0 - address: [MAIN] value_type: refresh_rate value: 30 diff --git a/SaltySD/plugins/FPSLocker/patches/0100803005D52000/62B7F19804BCB70E.yaml b/SaltySD/plugins/FPSLocker/patches/0100803005D52000/62B7F19804BCB70E.yaml index 98679be..8ae845a 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100803005D52000/62B7F19804BCB70E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100803005D52000/62B7F19804BCB70E.yaml @@ -1,8 +1,6 @@ # ぎゃる☆がん2 1.0.4 # BID: 62B7F19804BCB70E -unsafeCheck: false - ALL_FPS: # r.VSync - @@ -20,6 +18,7 @@ ALL_FPS: - type: write address: [MAIN, 0x44E6030, 0x764] + address_unsafe: true value_type: float value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/010082901D6F2000/FCA830BAE649B898.yaml b/SaltySD/plugins/FPSLocker/patches/010082901D6F2000/FCA830BAE649B898.yaml index e26edd2..dba0243 100644 --- a/SaltySD/plugins/FPSLocker/patches/010082901D6F2000/FCA830BAE649B898.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010082901D6F2000/FCA830BAE649B898.yaml @@ -1,35 +1,32 @@ # Neptunia Game Maker R:Evolution 1.00 # BID: FCA830BAE649B898 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 33.33 + evaluate: "TruncDec(FRAMETIME_TARGET, 2)" + - + type: variable + name: dr_target2 + value_type: float + default_value: 28.57 + evaluate: "TruncDec(1000 / (FPS_TARGET + 5), 2)" MASTER_WRITE: # Redirect DR timing range to MAIN + 0x878B800 - type: asm_a64 main_offset: 0x4451E88 instructions: [ - [adrp, x8, 0x878b000], - [ldr, w8, [x8, 0x800]] + [adrp, x8, $dr_target1], + [ldr, w8, [x8, $dr_target1]] ] - type: asm_a64 main_offset: 0x4451ED4 instructions: [ - [adrp, x8, 0x878b000], - [ldr, w8, [x8, 0x804]] + [adrp, x8, $dr_target2], + [ldr, w8, [x8, $dr_target2]] ] - # Default values - - - type: bytes - main_offset: 0x878B800 - value_type: float - value: [33.33, 28.57] -ALL_FPS: - # DR timing - - - type: evaluate_write - address: [MAIN, 0x878B800] - value_type: float - value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(1000 / (FPS_TARGET + 5), 2)"] - diff --git a/SaltySD/plugins/FPSLocker/patches/010082F015576000/8BFBF5B8A7098443.yaml b/SaltySD/plugins/FPSLocker/patches/010082F015576000/8BFBF5B8A7098443.yaml index eb227a6..e040790 100644 --- a/SaltySD/plugins/FPSLocker/patches/010082F015576000/8BFBF5B8A7098443.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010082F015576000/8BFBF5B8A7098443.yaml @@ -1,54 +1,41 @@ # 零 ~濡鴉ノ巫女~ 1.0.5 # BID: 8BFBF5B8A7098443 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: min_delta + value_type: float + default_value: 0.0333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 33333333 + evaluate: "1000000000 / FPS_TARGET" MASTER_WRITE: - # Redirect min delta to MAIN + 0x1BC4FF0 + # Redirect min delta # REF: 00 D9 21 7E 28 19 20 1E - type: asm_a64 main_offset: 0x39ABF8 instructions: [ - [adrp, x27, 0x1bc4000], - [ldr, s8, [x27, 0xff0]] + [adrp, x27, $min_delta], + [ldr, s8, [x27, $min_delta]] ] - # Redirect FPS Lock to MAIN + 0x1BC4FF4 + # Redirect FPS Lock # REF: 69 AA 40 B9 0A 40 99 52 - type: asm_a64 main_offset: 0x39B2D8 instructions: [ - [adrp, x9, 0x1BC4000], - [ldr, w9, [x9, 0xff4]], + [adrp, x9, $fps_lock], + [ldr, w9, [x9, $fps_lock]], [nop], [nop] ] - # Default values - - - type: bytes - main_offset: 0x1BC4FF0 - value_type: float - value: 0.0333333333 - - - type: bytes - main_offset: 0x1BC4FF4 - value_type: uint32 - value: 33333333 ALL_FPS: - # Min delta - - - type: evaluate_write - address: [MAIN, 0x1BC4FF0] - value_type: float - value: "1 / FPS_TARGET" - # FPS Lock - - - type: evaluate_write - address: [MAIN, 0x1BC4FF4] - value_type: uint32 - value: "1000000000 / FPS_TARGET" - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100830004FB6000/40F973CE3B5EC8D7.yaml b/SaltySD/plugins/FPSLocker/patches/0100830004FB6000/40F973CE3B5EC8D7.yaml index 580cb12..5fc0986 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100830004FB6000/40F973CE3B5EC8D7.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100830004FB6000/40F973CE3B5EC8D7.yaml @@ -1,13 +1,12 @@ # LA Noire 1.2 # BID: 40F973CE3B5EC8D7 -unsafeCheck: false - ALL_FPS: # Game speed - type: evaluate_write address: [MAIN, 0x1A32900, 0xA0] + address_unsafe: true value_type: float value: "(FPS_TARGET * 2) / 1.001" # Frameskipping (otherwise you will get slowdowns at framedrops) diff --git a/SaltySD/plugins/FPSLocker/patches/0100853015E86000/D5C5F47DFABD0812.yaml b/SaltySD/plugins/FPSLocker/patches/0100853015E86000/D5C5F47DFABD0812.yaml index 291cd17..775b95c 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100853015E86000/D5C5F47DFABD0812.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100853015E86000/D5C5F47DFABD0812.yaml @@ -1,28 +1,21 @@ # No Man's Sky 5.7.5 # BID: D5C5F47DFABD0812 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 30 + evaluate: FPS_TARGET MASTER_WRITE: - # Redirect DR frametime target to MAIN+0x47E0FF0 + # Redirect DR frametime target # REF: 08 4E A8 52 00 01 27 1E 48 8F A8 52, ADRP + ADD + LDR above that - type: asm_a64 main_offset: 0x1F9BC40 instructions: [ - [adrp, x9, 0x47e0000], - [ldr, s0, [x9, 0xff0]], + [adrp, x9, $dr_target], + [ldr, s0, [x9, $dr_target]], [nop] ] - # default value - - - type: bytes - main_offset: 0x47E0FF0 - value_type: float - value: 30 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x47E0FF0] - value_type: float - value: FPS_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/010085401A454000/7C724F497564C027.yaml b/SaltySD/plugins/FPSLocker/patches/010085401A454000/7C724F497564C027.yaml index 52a6935..03a26d3 100644 --- a/SaltySD/plugins/FPSLocker/patches/010085401A454000/7C724F497564C027.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010085401A454000/7C724F497564C027.yaml @@ -1,8 +1,6 @@ # Jujutsu Kaisen Cursed Clash EUR 1.4.0 # BID: 7C724F497564C027 -unsafeCheck: true - ALL_FPS: # r.DynamicRes.FrameTimeBudget - @@ -26,8 +24,10 @@ ALL_FPS: - type: write address: [MAIN, 0x849B7A8, 0x9C4] + address_unsafe: true value_type: uint32 value: 7 - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/010086C00AF7C000/C7DAB27F22ACD2ED.yaml b/SaltySD/plugins/FPSLocker/patches/010086C00AF7C000/C7DAB27F22ACD2ED.yaml index 942bd40..b83e77c 100644 --- a/SaltySD/plugins/FPSLocker/patches/010086C00AF7C000/C7DAB27F22ACD2ED.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010086C00AF7C000/C7DAB27F22ACD2ED.yaml @@ -3,8 +3,6 @@ # Game is using double buffer, nvnWindowBuilderSetTextures has hardcoded values. # So it's not possible to get stable FPS lock between 30 and 60 without changing refresh rate. -unsafeCheck: true - MASTER_WRITE: # Change main loop delay from 31.6 ms to 4.2 ms - @@ -26,10 +24,3 @@ MASTER_WRITE: [nop], [nop] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x6AE8500] - value_type: uint8 - value: 0 diff --git a/SaltySD/plugins/FPSLocker/patches/01008C8012920000/8C93B930348C9787.yaml b/SaltySD/plugins/FPSLocker/patches/01008C8012920000/8C93B930348C9787.yaml index e3ab117..c0fba1e 100644 --- a/SaltySD/plugins/FPSLocker/patches/01008C8012920000/8C93B930348C9787.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01008C8012920000/8C93B930348C9787.yaml @@ -1,8 +1,37 @@ # Dying Light: Platinum Edition 1.0.5 # BID: 8C93B930348C9787 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_timing1 + value_type: float + default_value: 0.034 + evaluate: "1.02 / FPS_TARGET" + - + type: variable + name: dr_timing2 + value_type: float + default_value: 0.028 + evaluate: "0.84 / FPS_TARGET" + - + type: variable + name: dr_timing3 + value_type: float + default_value: 0.0289855 + evaluate: "0.87 / FPS_TARGET" + - + type: variable + name: dr_timing4 + value_type: float + default_value: 0.0263158 + evaluate: "0.79 / FPS_TARGET" + - + type: variable + name: dr_timing5 + value_type: float + default_value: 0.0324675 + evaluate: "0.974 / FPS_TARGET" MASTER_WRITE: # Disable Dynamic GPU Clocks - @@ -11,71 +40,35 @@ MASTER_WRITE: instructions: [ [nop] ] - # Redirect Dynamic Resolution Timings to MAIN+0x4113D00 + # Redirect Dynamic Resolution Timings - type: asm_a64 main_offset: 0x1DE89A8 instructions: [ - [adrp, x10, 0x4113000], - [ldr, w10, [x10, 0xd00]] + [adrp, x10, $dr_timing1], + [ldr, w10, [x10, $dr_timing1]] ] - type: asm_a64 main_offset: 0x1DE8A08 instructions: [ - [adrp, x10, 0x4113000], - [ldr, w10, [x10, 0xd04]] + [adrp, x10, $dr_timing2], + [ldr, w10, [x10, $dr_timing2]] ] - type: asm_a64 main_offset: 0x1DE80C8 instructions: [ - [adrp, x11, 0x4113000], - [ldr, w12, [x11, 0xd08]], - [ldr, w11, [x11, 0xd0c]], - [nop] + [adrp, x11, $dr_timing3], + [ldr, w12, [x11, $dr_timing3]], + [adrp, x11, $dr_timing4], + [ldr, w11, [x11, $dr_timing4]] ] - type: asm_a64 main_offset: 0x1DE80F8 instructions: [ - [adrp, x11, 0x4113000], - [ldr, w11, [x11, 0xd10]] + [adrp, x11, $dr_timing5], + [ldr, w11, [x11, $dr_timing5]] ] -# Write default values - # MAIN + 0x1DE89AC - - - type: bytes - main_offset: 0x4113D00 - value_type: float - value: 0.034 - # MAIN + 0x1DE8A0C - - - type: bytes - main_offset: 0x4113D04 - value_type: float - value: 0.028 - # MAIN + 0x1DE80D4 - - - type: bytes - main_offset: 0x4113D08 - value_type: float - value: 0.0289855 - # MAIN + 0x1DE80D0 - - - type: bytes - main_offset: 0x4113D0C - value_type: float - value: 0.0263158 - # MAIN + 0x1DE80D0 - - - type: bytes - main_offset: 0x4113D10 - value_type: float - value: 0.0324675 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x4113D00] - value_type: float - value: ["(1 / FPS_TARGET) * 1.02", "(1 / FPS_TARGET) * 0.84", "(1 / FPS_TARGET) * 0.87", "(1 / FPS_TARGET) * 0.79", "(1 / FPS_TARGET) * 0.974"] + diff --git a/SaltySD/plugins/FPSLocker/patches/01008CB0156BC000/7735C8DD89D145F2.yaml b/SaltySD/plugins/FPSLocker/patches/01008CB0156BC000/7735C8DD89D145F2.yaml index 8f915b3..8000a70 100644 --- a/SaltySD/plugins/FPSLocker/patches/01008CB0156BC000/7735C8DD89D145F2.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01008CB0156BC000/7735C8DD89D145F2.yaml @@ -2,90 +2,94 @@ # BID: 7735C8DD89D145F2 # "Beyond the Reverie" dream has broken text fade effects above 30 FPS. -unsafeCheck: true - +DECLARATIONS: + - + type: const + name: tick_frequency + value: 19200000 + - + type: variable + name: last_tick + value_type: uint64 + default_value: 0 + - + type: variable + name: actual_frametime + value_type: float + default_value: 0.033333333333 + - + type: variable + name: min_delta + value_type: float + default_value: 0.033333333333 + evaluate: "1/FPS_TARGET" + - + type: code + name: dynamicSpeed + instructions: [ + [adrp, x9, $min_delta], + [ldr, s1, [x9, $min_delta]], + [fmov, s3, 1.0], + [fmov, s2, 15.0], + [fdiv, s2, s3, s2], + [mrs, x8, cntpct_el0], + [adrp, x9, $last_tick], + [ldr, x10, [x9, $last_tick]], + [str, x8, [x9, $last_tick]], + [cmp, x10, xzr], + [b.eq, :goto3], + [sub, x10, x8, x10], + [ucvtf, s3, x10], + [mov, w9, $tick_frequency], + [movk, w9, $tick_frequency, 16], + [ucvtf, s4, w9], + [fdiv, s4, s3, s4], + [fcmp, s4, s1], + [b.hi, :goto1], + [fmov, s4, s1], + [b, :goto2], + :goto1, [fcmp, s4, s2], + [b.lt, :goto2], + [fmov, s4, s2], + :goto2, [adrp, x9, $actual_frametime], + [str, s4, [x9, $actual_frametime]], + :goto3, [mov, w8, 0x1af0], + [ret] + ] MASTER_WRITE: - # Force FPS lock to 60 + # Force FPS lock to 120 - type: asm_a64 main_offset: 0x81AB0 instructions: [ - [movk, w8, 0x3c88, 16] + [movk, w8, 0x3c08, 16] ] - # Force refreshing camera to 60 Hz + # Force refreshing camera to 120 Hz - type: asm_a64 main_offset: 0x81AE4 instructions: [ - [movk, w9, 0x3c88, 16] + [movk, w9, 0x3c08, 16] ] # Properly scale frametime for FPS drops - type: asm_a64 main_offset: 0x81AEC instructions: [ - [movk, w10, 0xbc88, 16] + [movk, w10, 0xbc08, 16] ] # Read actual frametime instead of hardcoded 1/30 - # Store actual frametime as float in seconds to MAIN+0x7A52478 - # It sets minimum delta to 1/60 and maximum delta to 1/15 - type: asm_a64 main_offset: 0x8192C instructions: [ - [b, 0xd68334] + [bl, _dynamicSpeed()] ] - - - type: asm_a64 - main_offset: 0xD682D0 - instructions: [ - [adrp, x9, 0xf06000], - [ldr, s1, [x9, 0xf00]], - [ldr, s2, [x9, 0xe08]], - [bl, 0xd667e0], - [adrp, x9, 0x7a52000], - [ldr, x10, [x9, 0x470]], - [str, x0, [x9, 0x470]], - [sub, x10, x0, x10], - [ucvtf, s3, x10], - [mov, w9, 0x7c00], - [movk, w9, 0x4b92, 16], - [fmov, s4, w9], - [fdiv, s4, s3, s4], - [adrp, x9, 0x7a52000], - [fcmp, s4, s1], - [b.hi, +12], - [fmov, s4, s1], - [b, +16], - [fcmp, s4, s2], - [b.lt, +8], - [fmov, s4, s2], - [str, s4, [x9, 0x478]], - [mov, w8, 0x1af0], - [mov, x0, x20], - [b, 0x81930], - [mov, x20, x0], - [b, -104] - ] - # Read actual frametime as float in seconds from MAIN+0x7A52478 + # Read actual frametime as float in seconds - type: asm_a64 main_offset: 0x81B50 instructions: [ - [adrp, x11, 0x7a52000], - [ldr, w11, [x11, 0x478]] + [adrp, x11, $actual_frametime], + [ldr, w11, [x11, $actual_frametime]] ] - # Default value - - - type: bytes - main_offset: 0x7A52478 - value_type: float - value: 0.033333333333 -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x7A52500] - value_type: uint8 - value: 0 - diff --git a/SaltySD/plugins/FPSLocker/patches/01008D4007A1E000/C3D46BB3C7059DB1.yaml b/SaltySD/plugins/FPSLocker/patches/01008D4007A1E000/C3D46BB3C7059DB1.yaml index 19b737c..230ad6e 100644 --- a/SaltySD/plugins/FPSLocker/patches/01008D4007A1E000/C3D46BB3C7059DB1.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01008D4007A1E000/C3D46BB3C7059DB1.yaml @@ -1,8 +1,6 @@ # Outlast 1.0.1 # BID: C3D46BB3C7059DB1 -unsafeCheck: true - MASTER_WRITE: # Remove double buffer - @@ -29,10 +27,3 @@ MASTER_WRITE: instructions: [ [mov, w1, 3] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x36BF100] - value_type: uint8 - value: 0 diff --git a/SaltySD/plugins/FPSLocker/patches/01008E101E868000/42AD50169E847BA2.yaml b/SaltySD/plugins/FPSLocker/patches/01008E101E868000/42AD50169E847BA2.yaml index 14ce64d..7ae17be 100644 --- a/SaltySD/plugins/FPSLocker/patches/01008E101E868000/42AD50169E847BA2.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01008E101E868000/42AD50169E847BA2.yaml @@ -1,8 +1,6 @@ # Bum Simulator 1.0.2 # BID: 42AD50169E847BA2 -unsafeCheck: false - ALL_FPS: # t.MaxFPS - diff --git a/SaltySD/plugins/FPSLocker/patches/01008E101E868000/CE6953FB28A66265.yaml b/SaltySD/plugins/FPSLocker/patches/01008E101E868000/CE6953FB28A66265.yaml new file mode 100644 index 0000000..5b68031 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01008E101E868000/CE6953FB28A66265.yaml @@ -0,0 +1,19 @@ +# Bum Simulator 1.0.3 +# BID: CE6953FB28A66265 + +ALL_FPS: + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x5C858B8, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + # r.VSync + - + type: write + address: [MAIN, 0x5489408, 0] + value_type: uint32 + value: [0, 0] + - + type: block + what: timing \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/01008F600F2D0000/EB57CF3434044523.yaml b/SaltySD/plugins/FPSLocker/patches/01008F600F2D0000/EB57CF3434044523.yaml index 63d0f67..9b49e0f 100644 --- a/SaltySD/plugins/FPSLocker/patches/01008F600F2D0000/EB57CF3434044523.yaml +++ b/SaltySD/plugins/FPSLocker/patches/01008F600F2D0000/EB57CF3434044523.yaml @@ -2,13 +2,12 @@ # BID: EB57CF3434044523 # Game stores textures inside fixed size class, so it's hard to get triple buffer -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate and bSmoothFrameRate - type: write address: [MAIN, 0x54C75F0, 0x770] + address_unsafe: true value_type: uint32 value: 7 # t.MaxFPS diff --git a/SaltySD/plugins/FPSLocker/patches/010091B01A438000/A735894277FF90F3.yaml b/SaltySD/plugins/FPSLocker/patches/010091B01A438000/A735894277FF90F3.yaml index 3fa0c35..600cebe 100644 --- a/SaltySD/plugins/FPSLocker/patches/010091B01A438000/A735894277FF90F3.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010091B01A438000/A735894277FF90F3.yaml @@ -1,53 +1,41 @@ # 零 ~月蝕的假面~ 1.0.3 # BID: A735894277FF90F3 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: min_delta + value_type: float + default_value: 0.0333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 33333333 + evaluate: "1000000000 / FPS_TARGET" MASTER_WRITE: - # Redirect min delta to MAIN + 0x1FE0FF0 + # Redirect min delta # REF: 00 D9 21 7E 28 19 20 1E - type: asm_a64 main_offset: 0x16D9B4 instructions: [ - [adrp, x27, 0x1fe0000], - [ldr, s8, [x27, 0xff0]] + [adrp, x27, $min_delta], + [ldr, s8, [x27, $min_delta]] ] - # Redirect FPS Lock to MAIN + 0x1FE0FF4 + # Redirect FPS Lock # REF: 69 B2 40 B9 0A 40 99 52 - type: asm_a64 main_offset: 0x16DDD0 instructions: [ - [adrp, x9, 0x1fe0000], - [ldr, w9, [x9, 0xff4]], + [adrp, x9, $fps_lock], + [ldr, w9, [x9, $fps_lock]], [nop], [nop] ] - # Default values - - - type: bytes - main_offset: 0x1FE0FF0 - value_type: float - value: 0.0333333333 - - - type: bytes - main_offset: 0x1FE0FF4 - value_type: uint32 - value: 33333333 ALL_FPS: - # Min delta - - - type: evaluate_write - address: [MAIN, 0x1FE0FF0] - value_type: float - value: "1 / FPS_TARGET" - # FPS Lock - - - type: evaluate_write - address: [MAIN, 0x1FE0FF4] - value_type: uint32 - value: "1000000000 / FPS_TARGET" - type: block what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100926016012000/30997D8F7566EBB5.yaml b/SaltySD/plugins/FPSLocker/patches/0100926016012000/30997D8F7566EBB5.yaml index 38a61b9..295fb4a 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100926016012000/30997D8F7566EBB5.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100926016012000/30997D8F7566EBB5.yaml @@ -1,12 +1,11 @@ # PowerWash Simulator 1.10.0 # BID: 30997D8F7566EBB5 -unsafeCheck: false - ALL_FPS: # FuturLab.SingletonMonoBehaviour_TypeInfo (don't block FPSlocker internal lock because game's lock is kinda shit) - type: evaluate_write address: [MAIN, 0x6043ED0, 0xB8, 0, 0x28] + address_unsafe: true value_type: int32 value: FPS_LOCK_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100926016012000/561B0F485E699E4E.yaml b/SaltySD/plugins/FPSLocker/patches/0100926016012000/561B0F485E699E4E.yaml index ca77963..c6a5c89 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100926016012000/561B0F485E699E4E.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100926016012000/561B0F485E699E4E.yaml @@ -1,12 +1,11 @@ # PowerWash Simulator 1.11.0 # BID: 561B0F485E699E4E -unsafeCheck: false - ALL_FPS: # FuturLab.SingletonMonoBehaviour_TypeInfo (don't block FPSlocker internal lock because game's lock is kinda shit) - type: evaluate_write address: [MAIN, 0x606A350, 0xB8, 0, 0x28] + address_unsafe: true value_type: int32 value: FPS_LOCK_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100926016012000/7FF42DE6AA57290B.yaml b/SaltySD/plugins/FPSLocker/patches/0100926016012000/7FF42DE6AA57290B.yaml index c4174cb..32c0c7c 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100926016012000/7FF42DE6AA57290B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100926016012000/7FF42DE6AA57290B.yaml @@ -1,12 +1,11 @@ # PowerWash Simulator 1.9.1 # BID: 7FF42DE6AA57290B -unsafeCheck: false - ALL_FPS: # FuturLab.SingletonMonoBehaviour_TypeInfo (don't block FPSlocker internal lock because game's lock is kinda shit) - type: evaluate_write address: [MAIN, 0x5FA0BD8, 0xB8, 0, 0x28] + address_unsafe: true value_type: int32 value: FPS_LOCK_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100926016012000/8EACFE3E9E92B0FE.yaml b/SaltySD/plugins/FPSLocker/patches/0100926016012000/8EACFE3E9E92B0FE.yaml index b11f77e..3cc5bfd 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100926016012000/8EACFE3E9E92B0FE.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100926016012000/8EACFE3E9E92B0FE.yaml @@ -1,12 +1,11 @@ # PowerWash Simulator 1.7.0 # BID: 8EACFE3E9E92B0FE -unsafeCheck: false - ALL_FPS: # FuturLab.SingletonMonoBehaviour_TypeInfo (don't block FPSlocker internal lock because game's lock is kinda shit) - type: evaluate_write address: [MAIN, 0x5F1DC68, 0xB8, 0, 0x28] + address_unsafe: true value_type: int32 value: FPS_LOCK_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/0100926016012000/B2395B882C2BCB24.yaml b/SaltySD/plugins/FPSLocker/patches/0100926016012000/B2395B882C2BCB24.yaml index ef88a53..f499e0f 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100926016012000/B2395B882C2BCB24.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100926016012000/B2395B882C2BCB24.yaml @@ -1,12 +1,11 @@ # PowerWash Simulator 1.9.2 # BID: B2395B882C2BCB24 -unsafeCheck: false - ALL_FPS: # FuturLab.SingletonMonoBehaviour_TypeInfo (don't block FPSlocker internal lock because game's lock is kinda shit) - type: evaluate_write address: [MAIN, 0x5FA0BD8, 0xB8, 0, 0x28] + address_unsafe: true value_type: int32 value: FPS_LOCK_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/010097000BC10000/FB4239AA962B429B.yaml b/SaltySD/plugins/FPSLocker/patches/010097000BC10000/FB4239AA962B429B.yaml index 59681c3..7d552aa 100644 --- a/SaltySD/plugins/FPSLocker/patches/010097000BC10000/FB4239AA962B429B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/010097000BC10000/FB4239AA962B429B.yaml @@ -1,45 +1,44 @@ # resident evil 0 1.0.0 # BID: FB4239AA962B429B -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: cutscene_flag + value_type: uint32 + default_value: 0 + - + type: code + name: signalCutscene + instructions: [ + [add, x29, sp, 0x10], + [adrp, x8, $cutscene_flag], + [mov, w1, 1], + [str, w1, [x8, $cutscene_flag]], + [ret] + ] + - + type: code + name: designalCutscene + instructions: [ + [mov, w3, wzr], + [adrp, x4, $cutscene_flag], + [str, w3, [x4, $cutscene_flag]], + [ret] + ] MASTER_WRITE: # Detect prerendered cutscenes - type: asm_a64 - main_offset: 0x9F2540 + main_offset: 0x9F2548 instructions: [ - [b, 0xa05fa8] - ] - - - type: asm_a64 - main_offset: 0xA05FA8 - instructions: [ - [adrp, x8, 0x1bc2000], - [mov, w1, 1], - [str, w1, [x8, 0xff0]], - [str, x19, [sp, -0x20], "!"], - [mov, x19, x0], - [mov, w0, 0xca00], - [movk, w0, 0x3b9a, 16], - [svc, 0xb], - [mov, x0, x19], - [b, 0x9f2544] + [bl, _signalCutscene()] ] - type: asm_a64 main_offset: 0x9F26EC instructions: [ - [b, 0xa05fd0] - ] - - - type: asm_a64 - main_offset: 0xA05FD0 - instructions: [ - [mov, w3, wzr], - [adrp, x4, 0x1bc2000], - [str, w3, [x4, 0xff0]], - [b, 0x9fcc10] + [b, _designalCutscene()] ] ALL_FPS: # Internal FPS Lock @@ -51,10 +50,7 @@ ALL_FPS: - type: compare compare_type: "==" - compare_value_type: uint32 compare_value: 1 - compare_address: [MAIN, 0x1BC2FF0] - address: [MAIN] + compare_address: [VARIABLE, cutscene_flag] value_type: refresh_rate - value: 30 diff --git a/SaltySD/plugins/FPSLocker/patches/0100982019374000/9DD9149968A0B8D3.yaml b/SaltySD/plugins/FPSLocker/patches/0100982019374000/9DD9149968A0B8D3.yaml deleted file mode 100644 index 5bf4556..0000000 --- a/SaltySD/plugins/FPSLocker/patches/0100982019374000/9DD9149968A0B8D3.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Thirsty Suitors NS27619.127559 -# BID: 9DD9149968A0B8D3 - -# Values found by referencing DynamicResolution::DetermineResolutionScale function - -unsafeCheck: false - -ALL_FPS: - # Dynamic resolution targets (max ms, optimal ms, min ms, crit ms) - # max ms = 0.925 * (1000/FPS) - # optimal ms = 0.9 * (1000/FPS) - # min ms = 0.875 * (1000/FPS) - # crit ms = 0.85 * (1000/FPS) - - - type: evaluate_write - address: [MAIN, 0x4E1BF70, 0x7B0, 0x7F0, 0x20, 0x30] - value_type: float - value: ["0.925 * FRAMETIME_TARGET", "0.9 * FRAMETIME_TARGET", "0.875 * FRAMETIME_TARGET", "0.85 * FRAMETIME_TARGET"] diff --git a/SaltySD/plugins/FPSLocker/patches/0100A21017C42000/693314C08EA157F3.yaml b/SaltySD/plugins/FPSLocker/patches/0100A21017C42000/693314C08EA157F3.yaml index ed1cec3..e38d04d 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100A21017C42000/693314C08EA157F3.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100A21017C42000/693314C08EA157F3.yaml @@ -3,6 +3,13 @@ unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_target + value_type: double + default_value: 28.57142857142857 + evaluate: "1000 / (FPS_TARGET + 5)" MASTER_WRITE: # Redirect updating various deltas to read frametime target from UnityEngine.Application::targetFrameRate, REF: 08 10 91 52 08 A1 A7 72 - @@ -25,13 +32,19 @@ MASTER_WRITE: [fmov, s0, 1.0], [fdiv, s0, s0, s1] ] - # Redirect Dynamic Resolution GPU Timing target in DynamicResolutionScaler::Update to MAIN+0x5ACEF08 + # Default value + - + type: bytes + main_offset: 0x5659068 + value_type: uint32 + value: 30 + # Redirect Dynamic Resolution GPU Timing target in DynamicResolutionScaler::Update - type: asm_a64 main_offset: 0x389C824 instructions: [ - [adrp, x8, 0x5ace000], - [ldr, x8, [x8, 0xf08]], + [adrp, x8, $dr_target], + [ldr, x8, [x8, $dr_target]], [nop], [nop] ] @@ -39,8 +52,8 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x389C8A4 instructions: [ - [adrp, x8, 0x5ace000], - [ldr, x8, [x8, 0xf08]], + [adrp, x8, $dr_target], + [ldr, x8, [x8, $dr_target]], [ldr, s0, [x19, 0x28]], [nop], [nop] @@ -49,22 +62,11 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x389C918 instructions: [ - [adrp, x8, 0x5ace000], - [ldr, x8, [x8, 0xf08]], + [adrp, x8, $dr_target], + [ldr, x8, [x8, $dr_target]], [nop], [nop] ] - # Default values - - - type: bytes - main_offset: 0x5659068 - value_type: uint32 - value: 30 - - - type: bytes - main_offset: 0x5ACEF08 - value_type: double - value: 28.57142857142857 ALL_FPS: # UnityEngine.Application::targetFrameRate - @@ -72,10 +74,4 @@ ALL_FPS: address: [MAIN, 0x5659068] value_type: uint32 value: FPS_TARGET - # GPU Timing Target - - - type: evaluate_write - address: [MAIN, 0x5ACEF08] - value_type: double - value: "1000 / (FPS_TARGET + 5)" diff --git a/SaltySD/plugins/FPSLocker/patches/0100A2902051A000/3D6E4BDE905836BC.yaml b/SaltySD/plugins/FPSLocker/patches/0100A2902051A000/3D6E4BDE905836BC.yaml new file mode 100644 index 0000000..a9d3db8 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100A2902051A000/3D6E4BDE905836BC.yaml @@ -0,0 +1,25 @@ +# Poppy Playtime: Chapter 4 1.2 +# BID: 3D6E4BDE905836BC + +ALL_FPS: + # r.VSync + - + type: write + address: [MAIN, 0x7F07990, 0] + value_type: int32 + value: [0, 0] + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x8EC3E30, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(FRAMETIME_TARGET, 2)"] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x8EFF150, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + - + type: block + what: timing \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100A6301214E000/8C08B9719E085F91.yaml b/SaltySD/plugins/FPSLocker/patches/0100A6301214E000/8C08B9719E085F91.yaml index 3450a4c..239d4d3 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100A6301214E000/8C08B9719E085F91.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100A6301214E000/8C08B9719E085F91.yaml @@ -3,13 +3,12 @@ # Game has many things hardcoded to vSyncCount, so if game can't remain FPS target that is rounded up to 60/30/20/15, some elements are slowed down. # Thanks to ~systemdev for figuring out basic of patching this game. -unsafeCheck: false - ALL_FPS: # UnityEngine.QualitySettings::vSyncCount - type: evaluate_write address: [MAIN, 0x65ABCA0, 0x30, 0x68] + address_unsafe: true value_type: uint32 value: VSYNC_TARGET # Internal vSyncCount @@ -22,5 +21,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x6157F28, 0xB8, 0, 0x20] + address_unsafe: true value_type: float value: "(30 / FPS_TARGET) * 0.14" diff --git a/SaltySD/plugins/FPSLocker/patches/0100A9001C042000/3565E26E8827C846.yaml b/SaltySD/plugins/FPSLocker/patches/0100A9001C042000/3565E26E8827C846.yaml index 04bd755..ee0fdcf 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100A9001C042000/3565E26E8827C846.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100A9001C042000/3565E26E8827C846.yaml @@ -1,35 +1,33 @@ # Neptunia: Sisters VS Sisters 1.0.0 # BID: 3565E26E8827C846 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 33.33 + evaluate: "TruncDec(FRAMETIME_TARGET, 2)" + - + type: variable + name: dr_target2 + value_type: float + default_value: 28.57 + evaluate: "TruncDec(1000 / (FPS_TARGET + 5), 2)" MASTER_WRITE: - # Redirect DR timing range to MAIN + 0x86B9F00 + # Redirect DR timing range - type: asm_a64 main_offset: 0x3DC5E90 instructions: [ - [adrp, x8, 0x86b9000], - [ldr, w8, [x8, 0xf00]] + [adrp, x8, $dr_target1], + [ldr, w8, [x8, $dr_target1]] ] - type: asm_a64 main_offset: 0x3DC5EFC instructions: [ - [adrp, x8, 0x86b9000], - [ldr, w8, [x8, 0xf04]] + [adrp, x8, $dr_target2], + [ldr, w8, [x8, $dr_target2]] ] - # Default values - - - type: bytes - main_offset: 0x86B9F00 - value_type: float - value: [33.33, 28.57] -ALL_FPS: - # DR timing - - - type: evaluate_write - address: [MAIN, 0x86B9F00] - value_type: float - value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(1000 / (FPS_TARGET + 5), 2)"] diff --git a/SaltySD/plugins/FPSLocker/patches/0100B04011742000/C9A3DD7702075ECD.yaml b/SaltySD/plugins/FPSLocker/patches/0100B04011742000/C9A3DD7702075ECD.yaml index 28cf44f..6c57c67 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B04011742000/C9A3DD7702075ECD.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B04011742000/C9A3DD7702075ECD.yaml @@ -1,13 +1,12 @@ # Monster Hunter Rise 16.0.2 # BID: C9A3DD7702075ECD -unsafeCheck: false - ALL_FPS: # Internal FPS lock - type: evaluate_write address: [MAIN, 0x1295B3F0, 0x434] + address_unsafe: true value_type: float value: FPS_LOCK_TARGET - diff --git a/SaltySD/plugins/FPSLocker/patches/0100B16009C10000/490D681909609015.yaml b/SaltySD/plugins/FPSLocker/patches/0100B16009C10000/490D681909609015.yaml index 53d5e6b..55f72a9 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B16009C10000/490D681909609015.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B16009C10000/490D681909609015.yaml @@ -1,13 +1,12 @@ -# SSINNER: Sacrifice for Redemption 1.1.0319 +# SINNER: Sacrifice for Redemption 1.1.0319 # BID: 490D681909609015 -unsafeCheck: true - ALL_FPS: # Disable bSmoothFrameRate and bUseFixedFrameRate to untie game speed from framerate - type: write address: [MAIN, 0x5CCE320, 0x750] + address_unsafe: true value_type: uint32 # Default is 0x67, bSmoothFrameRate |= 0x20, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/0100B2002330E000/637F8C946F7C512D.yaml b/SaltySD/plugins/FPSLocker/patches/0100B2002330E000/637F8C946F7C512D.yaml new file mode 100644 index 0000000..b88774f --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100B2002330E000/637F8C946F7C512D.yaml @@ -0,0 +1,25 @@ +# Mandragora: Whispers of the Witch Tree JPN 1.5.3.135819 +# BID: 637F8C946F7C512D + +ALL_FPS: + # r.VSync + - + type: write + address: [MAIN, 0x7CA62C8, 0] + value_type: int32 + value: [0, 0] + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x84723A8, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(FRAMETIME_TARGET, 2)"] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x8497A90, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + - + type: block + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100B2B00E7AA000/FAD1AF4EDC6DB267.yaml b/SaltySD/plugins/FPSLocker/patches/0100B2B00E7AA000/FAD1AF4EDC6DB267.yaml index 42cb969..59542f0 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B2B00E7AA000/FAD1AF4EDC6DB267.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B2B00E7AA000/FAD1AF4EDC6DB267.yaml @@ -1,13 +1,12 @@ # Dusk Diver 1.0.6 # BID: FAD1AF4EDC6DB267 -unsafeCheck: true - ALL_FPS: # Disable bSmoothFrameRate and bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x5379338, 0x780] + address_unsafe: true value_type: uint32 # Default is 0x67, bSmoothFrameRate |= 0x20, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -30,3 +29,4 @@ ALL_FPS: - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/0100B7C01D480000/0100B7C01D480000/E8EA74BE6221F2E4.yaml b/SaltySD/plugins/FPSLocker/patches/0100B7C01D480000/E8EA74BE6221F2E4.yaml similarity index 100% rename from SaltySD/plugins/FPSLocker/patches/0100B7C01D480000/0100B7C01D480000/E8EA74BE6221F2E4.yaml rename to SaltySD/plugins/FPSLocker/patches/0100B7C01D480000/E8EA74BE6221F2E4.yaml diff --git a/SaltySD/plugins/FPSLocker/patches/0100B8901AE88000/8AF36A929664A94D.yaml b/SaltySD/plugins/FPSLocker/patches/0100B8901AE88000/8AF36A929664A94D.yaml index 3f4b134..b6970a6 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B8901AE88000/8AF36A929664A94D.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B8901AE88000/8AF36A929664A94D.yaml @@ -1,8 +1,6 @@ # Daydream: Forgotten Sorrow 1.0.1 # BID: 8AF36A929664A94D -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/0100B8E016F76000/992787E2B5425994.yaml b/SaltySD/plugins/FPSLocker/patches/0100B8E016F76000/992787E2B5425994.yaml index 4a9b72c..3c8e329 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B8E016F76000/992787E2B5425994.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B8E016F76000/992787E2B5425994.yaml @@ -3,47 +3,53 @@ unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_target_bad + value_type: float + default_value: 45 + evaluate: "1.35 * FRAMETIME_TARGET" + - + type: variable + name: dr_target_optimal + value_type: float + default_value: 32.01 + evaluate: "0.9603 * FRAMETIME_TARGET" + - + type: variable + name: dr_target_good + value_type: float + default_value: 30 + evaluate: "0.9 * FRAMETIME_TARGET" MASTER_WRITE: # Redirect DR timings to MAIN + 0x2BE8F00, [Bad, Optimal, Good] - type: asm_a64 main_offset: 0x9C07A4 instructions: [ - [adrp, x12, 0x2be8000], - [ldr, s3, [x12, 0xf00]] + [adrp, x12, $dr_target_bad], + [ldr, s3, [x12, $dr_target_bad]] ] - type: asm_a64 main_offset: 0x9C07F4 instructions: [ - [adrp, x12, 0x2be8000], - [ldr, w12, [x12, 0xf04]] + [adrp, x12, $dr_target_optimal], + [ldr, w12, [x12, $dr_target_optimal]] ] - type: asm_a64 main_offset: 0x9C0844 instructions: [ [fcsel, s3, s4, s0, gt], - [adrp, x12, 0x2be8000], - [ldr, s0, [x12, 0xf04]], - [nop] + [adrp, x12, $dr_target_optimal], + [ldr, s0, [x12, $dr_target_optimal]], + [adrp, x12, $dr_target_good] ] - type: asm_a64 main_offset: 0x9C0868 instructions: [ - [ldr, s0, [x12, 0xf08]] + [ldr, s0, [x12, $dr_target_good]] ] - # Default values - - - type: bytes - main_offset: 0x2BE8F00 - value_type: float - value: [45, 32.01, 30] -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x2BE8F00] - value_type: float - value: ["1.35 * FRAMETIME_TARGET", "0.9603 * FRAMETIME_TARGET", "0.9 * FRAMETIME_TARGET"] - diff --git a/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/007EA5E2E2541C6F.yaml b/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/007EA5E2E2541C6F.yaml index bdaded5..05706cc 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/007EA5E2E2541C6F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/007EA5E2E2541C6F.yaml @@ -1,44 +1,42 @@ # FAIRY TAIL 2 1.4.2 # BID: 007EA5E2E2541C6F -unsafeCheck: false - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 0.043478 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 0.037037 + evaluate: "1 / (FPS_TARGET + 5)" MASTER_WRITE: - # Redirect Dynamic Resolution target to MAIN+0x2C53F00 + # Redirect Dynamic Resolution target # REF: 6A C8 82 52 - type: asm_a64 main_offset: 0x138238C instructions: [ - [adrp, x10, 0x2c53000], - [ldr, w10, [x10, 0xf00]] + [adrp, x10, $dr_target1], + [ldr, w10, [x10, $dr_target1]] ] - type: asm_a64 main_offset: 0x13823A8 instructions: [ - [adrp, x10, 0x2c53000], - [ldr, w10, [x10, 0xf04]] - ] - # Default values - - - type: bytes - main_offset: 0x2C53F00 - value_type: float - value: [0.043478, 0.037037] + [adrp, x10, $dr_target2], + [ldr, w10, [x10, $dr_target2]] + ] ALL_FPS: # FPS Lock # REF: 1F 00 00 71 C8 03 80 52, first ADRP+ADD above it - type: evaluate_write address: [MAIN, 0x2C0B558, 0x170, 0x18C] + address_unsafe: true value_type: int32 - value: FPS_LOCK_TARGET - # Dynamic Resolution Target - # Game proritizes resolution over framerate, I changed it to prefer framerate - - - type: evaluate_write - address: [MAIN, 0x2C53F00] - value_type: float - - value: ["1 / FPS_TARGET", "1 / (FPS_TARGET + 5)"] + value: FPS_LOCK_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/A588F7BB864AAD5F.yaml b/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/A588F7BB864AAD5F.yaml index 069e075..0e15ce6 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/A588F7BB864AAD5F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100B9801F872000/A588F7BB864AAD5F.yaml @@ -1,8 +1,6 @@ # FAIRY TAIL 2 1.4.1 # BID: A588F7BB864AAD5F -unsafeCheck: false - MASTER_WRITE: # Redirect Dynamic Resolution target to MAIN+0x2C53F00 # REF: 6AC88252 @@ -32,6 +30,7 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x2C0B558, 0x170, 0x18C] + address_unsafe: true value_type: int32 value: FPS_LOCK_TARGET # Dynamic Resolution Target diff --git a/SaltySD/plugins/FPSLocker/patches/0100BD601EC3E000/5AF163DEF288F098.yaml b/SaltySD/plugins/FPSLocker/patches/0100BD601EC3E000/5AF163DEF288F098.yaml index 8b3af5e..699ace7 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100BD601EC3E000/5AF163DEF288F098.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100BD601EC3E000/5AF163DEF288F098.yaml @@ -1,13 +1,12 @@ # Poppy Playtime: Chapter 3 1.0.0.2 # BID: 5AF163DEF288F098 -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate - type: write address: [MAIN, 0x778C438, 0xAA4] + address_unsafe: true value_type: int32 value: 6 # r.VSync @@ -30,4 +29,4 @@ ALL_FPS: value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] - type: block - what: timing \ No newline at end of file + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100BEB015604000/B38D51E0391187EC.yaml b/SaltySD/plugins/FPSLocker/patches/0100BEB015604000/B38D51E0391187EC.yaml index 065dd68..3d6029e 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100BEB015604000/B38D51E0391187EC.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100BEB015604000/B38D51E0391187EC.yaml @@ -2,54 +2,41 @@ # FATAL FRAME: MAIDEN OF BLACK WATER 1.0.4 # BID: B38D51E0391187EC -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: min_delta + value_type: float + default_value: 0.0333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 33333333 + evaluate: "1000000000 / FPS_TARGET" MASTER_WRITE: - # Redirect min delta to MAIN + 0x1BC4FF0 + # Redirect min delta # REF: 00 D9 21 7E 28 19 20 1E - type: asm_a64 main_offset: 0x39ABF8 instructions: [ - [adrp, x27, 0x1bc4000], - [ldr, s8, [x27, 0xff0]] + [adrp, x27, $min_delta], + [ldr, s8, [x27, $min_delta]] ] - # Redirect FPS Lock to MAIN + 0x1BC4FF4 + # Redirect FPS Lock # REF: 69 AA 40 B9 0A 40 99 52 - type: asm_a64 main_offset: 0x39B2D8 instructions: [ - [adrp, x9, 0x1bc4000], - [ldr, w9, [x9, 0xff4]], + [adrp, x9, $fps_lock], + [ldr, w9, [x9, $fps_lock]], [nop], [nop] ] - # Default values - - - type: bytes - main_offset: 0x1BC4FF0 - value_type: float - value: 0.0333333333 - - - type: bytes - main_offset: 0x1BC4FF4 - value_type: uint32 - value: 33333333 ALL_FPS: - # Min delta - - - type: evaluate_write - address: [MAIN, 0x1BC4FF0] - value_type: float - value: "1 / FPS_TARGET" - # FPS Lock - - - type: evaluate_write - address: [MAIN, 0x1BC4FF4] - value_type: uint32 - value: "1000000000 / FPS_TARGET" - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100C09014530000/D92F465FE9920BB6.yaml b/SaltySD/plugins/FPSLocker/patches/0100C09014530000/D92F465FE9920BB6.yaml index 5587979..5484693 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100C09014530000/D92F465FE9920BB6.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100C09014530000/D92F465FE9920BB6.yaml @@ -1,29 +1,22 @@ # Boomerang X 1.0.2 # BID: D92F465FE9920BB6 -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 28 + evaluate: FPS_TARGET MASTER_WRITE: - # Patch `DynamicResolution.Settings$$get_TargetFPS` to redirect reading targetFPS to unused .bss region [MAIN, 0x5E9AFF0] + # Patch `DynamicResolution.Settings$$get_TargetFPS` to redirect reading targetFPS - type: asm_a64 main_offset: 0x3821020 instructions: [ - [adrp, x0, 0x5e9a000], - [ldr, s0, [x0, 0xff0]], + [adrp, x0, $dr_target], + [ldr, s0, [x0, $dr_target]], [ret] ] - # Write default value of `DynamicResolution.Settings$$get_TargetFPS` to redirected address - - - type: bytes - main_offset: 0x5E9AFF0 - value_type: float - value: 28 -ALL_FPS: - # DynamicResolution.Settings$$get_TargetFPS - - - type: evaluate_write - address: [MAIN, 0x5E9AFF0] - value_type: float - value: FPS_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/0100C1101EE5A000/950FB0C3D58D6A7B.yaml b/SaltySD/plugins/FPSLocker/patches/0100C1101EE5A000/950FB0C3D58D6A7B.yaml index 1f62fcd..b01de64 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100C1101EE5A000/950FB0C3D58D6A7B.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100C1101EE5A000/950FB0C3D58D6A7B.yaml @@ -1,8 +1,6 @@ -# High On Life 1.0.3 +# High On Life 1.0.3/1.0.4 # BID: 950FB0C3D58D6A7B -unsafeCheck: true - ALL_FPS: # r.VSync - diff --git a/SaltySD/plugins/FPSLocker/patches/0100C6C010AE4000/FE211DBFAD6EA549.yaml b/SaltySD/plugins/FPSLocker/patches/0100C6C010AE4000/FE211DBFAD6EA549.yaml index d6cd145..381a29f 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100C6C010AE4000/FE211DBFAD6EA549.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100C6C010AE4000/FE211DBFAD6EA549.yaml @@ -1,8 +1,6 @@ # Clive 'N' Wrench 1.0.6 # BID: FE211DBFAD6EA549 -unsafeCheck: false - ALL_FPS: # Dynamic Resolution GPU Frame Timing target in ms = 0.9 * (1000/FPS) # It was derived by hooking `PSH.DynamicResolutionManager$$ScaleResolutionToAchieveFrameRate` before its first use @@ -11,5 +9,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x3E8B368, 0x20, 0x620, 0x18] + address_unsafe: true value_type: double value: "0.9 * FRAMETIME_TARGET" diff --git a/SaltySD/plugins/FPSLocker/patches/0100CA3014ADE000/372AB37327DB2C31.yaml b/SaltySD/plugins/FPSLocker/patches/0100CA3014ADE000/372AB37327DB2C31.yaml index 75ab540..470b311 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100CA3014ADE000/372AB37327DB2C31.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100CA3014ADE000/372AB37327DB2C31.yaml @@ -1,7 +1,13 @@ # Umurangi Generation 1.6.6.0 # BID: 372AB37327DB2C31 -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: fps_lock + value_type: float + default_value: 0.03333333333 + evaluate: "1 / FPS_TARGET" MASTER_WRITE: # Read FPS Lock from MAIN+0x49FCFF0 @@ -11,20 +17,11 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x2DF1E60 instructions: [ - [adrp, x8, 0x49fc000], - [ldr, s1, [x8, 0xff0]], + [adrp, x8, $fps_lock], + [ldr, s1, [x8, $fps_lock]], [nop] ] - ## Default value - - - type: bytes - main_offset: 0x49FCFF0 - value_type: float - value: 0.03333333333 ALL_FPS: - # FPS Lock - - type: evaluate_write - address: [MAIN, 0x49FCFF0] - value_type: float - value: "1 / FPS_TARGET" + type: block + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100CA800F9B2000/A1E1EFBA68B846A9.yaml b/SaltySD/plugins/FPSLocker/patches/0100CA800F9B2000/A1E1EFBA68B846A9.yaml index 4fbdece..e3f1ec3 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100CA800F9B2000/A1E1EFBA68B846A9.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100CA800F9B2000/A1E1EFBA68B846A9.yaml @@ -1,8 +1,6 @@ # Sherlock Holmes The Awakened 1.0.1 # BID: A1E1EFBA68B846A9 -unsafeCheck: true - ALL_FPS: # t.MaxFPS - diff --git a/SaltySD/plugins/FPSLocker/patches/0100CD3010AE2000/53EA0196A4AEB260.yaml b/SaltySD/plugins/FPSLocker/patches/0100CD3010AE2000/53EA0196A4AEB260.yaml index f45ffb3..21b1068 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100CD3010AE2000/53EA0196A4AEB260.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100CD3010AE2000/53EA0196A4AEB260.yaml @@ -1,8 +1,45 @@ # Crysis 3 Remastered 1.3.0 # BID: 53EA0196A4AEB260 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 28.5 + evaluate: "0.855 * FRAMETIME_TARGET" + - + type: variable + name: dr_target2 + value_type: float + default_value: 33.5 + evaluate: "1.005 * FRAMETIME_TARGET" + - + type: variable + name: dr_target3 + value_type: float + default_value: 30.5 + evaluate: "0.915 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target4 + value_type: float + default_value: 32.5 + evaluate: "0.975 * FRAMETIME_TARGET" + - + type: variable + name: dr_target5 + value_type: float + default_value: 31.5 + evaluate: "0.945 * FRAMETIME_TARGET" + - + type: variable + name: dr_target6 + value_type: float + default_value: 33.25 + evaluate: "0.945 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END MASTER_WRITE: # Redirect Dynamic Resolution Timings to read always not from .text - @@ -23,50 +60,20 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x136A520 instructions: [ - [adrp, x8, 0x3608000], - [ldr, s0, [x8, 0xe00]], - [ldr, s1, [x8, 0xe04]], - [ldr, s2, [x8, 0xe08]], - [nop], - [nop] + [adrp, x8, $dr_target1], + [ldr, s0, [x8, $dr_target1]], + [adrp, x8, $dr_target2], + [ldr, s1, [x8, $dr_target2]], + [adrp, x8, $dr_target3], + [ldr, s2, [x8, $dr_target3]] ] - type: asm_a64 main_offset: 0x136A554 instructions: [ - [adrp, x9, 0x3608000], - [add, x9, x9, 0xe0c] + [adrp, x9, $dr_target4], + [add, x9, x9, $dr_target4] ] -# Write default values - - - type: bytes - main_offset: 0x3443CA4 - value_type: float - value: 28.5 - # MAIN + 0x22EA494 - - - type: bytes - main_offset: 0x3608E00 - value_type: float - value: 33.5 - # MAIN + 0x22EAE14 - - - type: bytes - main_offset: 0x3608E04 - value_type: float - value: 30.5 - # MAIN + 0x22EAB58 - - - type: bytes - main_offset: 0x3608E08 - value_type: float - value: 32.5 - # MAIN + 0x22E9E48 - - - type: bytes - main_offset: 0x3608E0C - value_type: float - value: [31.5, 33.25] ALL_FPS: # sys_MaxFPS - @@ -74,42 +81,12 @@ ALL_FPS: address: [MAIN, 0x34382D8] value_type: int32 value: FPS_LOCK_TARGET - # Renderer thread delay (default value) + # Renderer thread delay - - type: write + type: evaluate_write address: [MAIN, 0x3466BB0] value_type: float - value: 0.01 - - - type: evaluate_write - address: [MAIN, 0x3443CA4] - value_type: float - value: "0.855 * FRAMETIME_TARGET" - # MAIN + 0x22EA494 - - - type: evaluate_write - address: [MAIN, 0x3608E00] - value_type: float - value: "1.005 * FRAMETIME_TARGET" - # MAIN + 0x22EAE14 - - - type: evaluate_write - address: [MAIN, 0x3608E04] - value_type: float - value: "0.915 * FRAMETIME_TARGET" - # MAIN + 0x22EAB58 - - - type: evaluate_write - address: [MAIN, 0x3608E08] - value_type: float - value: "0.975 * FRAMETIME_TARGET" - # MAIN + 0x22E9E48 - - - type: evaluate_write - address: [MAIN, 0x3608E0C] - value_type: float - value: ["0.945 * FRAMETIME_TARGET", "0.945 * FRAMETIME_TARGET"] + value: "0.66 / FPS_TARGET" - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100CD4012DCA000/B067B077906C6208.yaml b/SaltySD/plugins/FPSLocker/patches/0100CD4012DCA000/B067B077906C6208.yaml index b48a0f1..fe074bb 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100CD4012DCA000/B067B077906C6208.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100CD4012DCA000/B067B077906C6208.yaml @@ -4,60 +4,61 @@ unsafeCheck: true +DECLARATIONS: + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 30 + evaluate: FPS_LOCK_TARGET + - + type: variable + name: fps_lock2 + value_type: uint32 + default_value: 60 + evaluate: FPS_LOCK_TARGET + # DON'T PUT ANYTHING BETWEEN - END + - + type: variable + name: game_speed + value_type: float + default_value: 0.0333333333 + evaluate: "1/FPS_TARGET" MASTER_WRITE: # Redirect adjusting game speed to FPS Lock stored in MAIN + 0x2B92800, REF: 20 79 68 BC 01 10 2E 1E 00 D8 21 7E - type: asm_a64 main_offset: 0xB8ED98 instructions: [ - [adrp, x9, 0x2b92000], - [add, x9, x9, 0x800] + [adrp, x9, $fps_lock], + [add, x9, x9, $fps_lock] ] # Redirect FPS Lock to MAIN + 0x2B92800, REF: C8 32 40 B9 E8 C2 00 B9 - type: asm_a64 main_offset: 0x89668C instructions: [ - [adrp, x8, 0x2b92000], - [ldr, w8, [x8, 0x800]] + [adrp, x8, $fps_lock], + [ldr, w8, [x8, $fps_lock]] ] # Redirect game speed to MAIN + 0x2B92808, REF: 00 28 21 1E 00 A0 00 BD C0 03 5F D6 - type: asm_a64 main_offset: 0x11139A0 instructions: [ - [adrp, x8, 0x2b92000], + [adrp, x8, $game_speed], [ldr, s0, [x0, 0xa0]], - [ldr, s1, [x8, 0x808]] + [ldr, s1, [x8, $game_speed]] ] - # Default FPS Targets - - - type: bytes - main_offset: 0x2B92800 - value_type: uint32 - value: [30, 60] - - - type: bytes - main_offset: 0x2B92808 - value_type: float - value: 0.0333333333 ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x2B92800] - value_type: uint32 - value: FPS_LOCK_TARGET - # Adjust max delta for menus, 0 - 30 FPS, 1 - 60 FPS, REF: 20 79 68 BC 01 10 2E 1E 00 D8 21 7E type: evaluate_write address: [MAIN, 0x254EA80] value_type: uint32 value: "FPS_TARGET / 60" - - - type: write - address: [MAIN, 0x2B92808] - value_type: float - value: "1 / FPS_TARGET" - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/0100CF401A98E000/5ECFB8F85105FE3C.yaml b/SaltySD/plugins/FPSLocker/patches/0100CF401A98E000/5ECFB8F85105FE3C.yaml index 517f339..465c620 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100CF401A98E000/5ECFB8F85105FE3C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100CF401A98E000/5ECFB8F85105FE3C.yaml @@ -1,34 +1,28 @@ # Contra: Operation Galuga 1.0.882291 # BID: 5ECFB8F85105FE3C -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET + - + type: code + name: drAdjust + instructions: [ + [adrp, x8, $dr_target], + [ldr, s0, [x8, $dr_target]], + [str, s0, [x19, 0x3c]], + [ret] + ] + MASTER_WRITE: # Redirect DR Timing target to MAIN + 0x6D91A00, REF: 61 36 40 BD 60 3E 40 BD - type: asm_a64 main_offset: 0x3534598 instructions: [ - [bl, 0x487b144] + [bl, _drAdjust()] ] - - - type: asm_a64 - main_offset: 0x487B144 - instructions: [ - [adrp, x8, 0x6d91000], - [ldr, s0, [x8, 0xa00]], - [str, s0, [x19, 0x3c]], - [ret] - ] - # Default value - - - type: bytes - main_offset: 0x6D91A00 - value_type: float - value: 33.3333333333 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x6D91A00] - value_type: float - value: FRAMETIME_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/0100D210177C6000/9510D677DCCE4447.yaml b/SaltySD/plugins/FPSLocker/patches/0100D210177C6000/9510D677DCCE4447.yaml index 0094bde..44ab6be 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100D210177C6000/9510D677DCCE4447.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100D210177C6000/9510D677DCCE4447.yaml @@ -1,12 +1,11 @@ # Oddworld Soulstorm 1.1.3 # BID: 9510D677DCCE4447 -unsafeCheck: false - ALL_FPS: # Dynamic Resolution frame time target in ms cutted to 1 decimal - type: evaluate_write address: [MAIN, 0x75DA2D0, 0, 0x10, 0x90, 0x28, 0x1C] + address_unsafe: true value_type: float value: "TruncDec(FRAMETIME_TARGET, 1)" diff --git a/SaltySD/plugins/FPSLocker/patches/0100D3C010DE8000/59159483CF88330F.yaml b/SaltySD/plugins/FPSLocker/patches/0100D3C010DE8000/59159483CF88330F.yaml index 466a99f..ff4d0e1 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100D3C010DE8000/59159483CF88330F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100D3C010DE8000/59159483CF88330F.yaml @@ -2,63 +2,51 @@ # BID: 59159483CF88330F # Button polling is 2x more sensitive to holding any button -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 33333333 + evaluate: "FRAMETIME_TARGET * 930000" + - + type: variable + name: frame_time + value_type: float + default_value: 0.0333333333 + - + type: code + name: dynamicSpeed + instructions: [ + [str, x0, [x19, 8]], + [fcvt, s4, d0], + [adrp, x8, $frame_time], + [str, s4, [x8, $frame_time]], + [ret] + ] MASTER_WRITE: - # Move loading FPS lock time to MAIN+0x3AF0800 + # Move loading FPS lock time - type: asm_a64 main_offset: 0x5F02F8 instructions: [ - [adrp, x9, 0x3af0000], - [ldr, w9, [x9, 0x800]] + [adrp, x9, $fps_lock], + [ldr, w9, [x9, $fps_lock]] ] - # Default value - - - type: bytes - main_offset: 0x3AF0800 - value_type: uint32 - value: 33333333 - # Write game's loop time as float to MAIN+0x3AF0804 + # Write game's loop time as float - type: asm_a64 main_offset: 0x5F0348 instructions: [ - [b, 0x5f00b4] + [bl, _dynamicSpeed()] ] - - - type: asm_a64 - main_offset: 0x5F00B4 - instructions: [ - [str, x0, [x19, 8]], - [fcvt, s4, d0], - [b, 0x5f02d4] - ] - - - type: asm_a64 - main_offset: 0x5F02D4 - instructions: [ - [adrp, x8, 0x3af0000], - [str, s4, [x8, 0x804]], - [b, 0x5f034c] - ] - - # Read lowest timing float factor from MAIN+0x3AF0804 + - # Read lowest timing float factor type: asm_a64 main_offset: 0x65548 instructions: [ - [adrp, x8, 0x3af0000], + [adrp, x8, $frame_time], [fminnm, s0, s0, s2], - [ldr, s2, [x8, 0x804]] + [ldr, s2, [x8, $frame_time]] ] - - # Default value - type: bytes - main_offset: 0x3AF0804 - value_type: float - value: 0.0333333333 -ALL_FPS: - - - type: write - address: [MAIN, 0x3AF0800] - value_type: uint32 - value: 11111111 + diff --git a/SaltySD/plugins/FPSLocker/patches/0100D5801E904000/89349071D2B0BFF7.yaml b/SaltySD/plugins/FPSLocker/patches/0100D5801E904000/89349071D2B0BFF7.yaml new file mode 100644 index 0000000..9f52539 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100D5801E904000/89349071D2B0BFF7.yaml @@ -0,0 +1,16 @@ +# Caravan SandWitch 1.0.7 +# BID: 89349071D2B0BFF7 + +ALL_FPS: + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x7A4B210, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(FRAMETIME_TARGET, 2)"] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x7A84920, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/5D63D46226DB106F.yaml b/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/5D63D46226DB106F.yaml index 05c7754..bf8b697 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/5D63D46226DB106F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/5D63D46226DB106F.yaml @@ -1,13 +1,12 @@ # Twilight Monk 1.0.0 # BID: 5D63D46226DB106F -unsafeCheck: false - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x5DBD688, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x46, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: diff --git a/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/6D560144F6B09A98.yaml b/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/6D560144F6B09A98.yaml new file mode 100644 index 0000000..aa0e830 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/6D560144F6B09A98.yaml @@ -0,0 +1,36 @@ +# Twilight Monk 1.4.0 +# BID: 6D560144F6B09A98 + +ALL_FPS: + # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS + - + type: write + address: [MAIN, 0x5E09268, 0x7A4] + address_unsafe: true + value_type: uint32 + # Default is 0x46, bUseFixedFrameRate |= 0x40 + # By writing 6 we are making sure that other flags are maintained: + # bAllowMultiThreadedAnimationUpdate |= 4 + # bOptimizeAnimBlueprintMemberVariableAccess |= 2 + value: 6 + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x5DDBEC8, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(FRAMETIME_TARGET, 2)"] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x5E09B88, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + # r.VSync + - + type: evaluate_write + address: [MAIN, 0x560DA68, 0] + value_type: uint32 + value: [0, 0] + - + type: block + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/E9A189C0CA87A30C.yaml b/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/E9A189C0CA87A30C.yaml index b92d2ca..92695db 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/E9A189C0CA87A30C.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100D7C021496000/E9A189C0CA87A30C.yaml @@ -1,16 +1,15 @@ # Twilight Monk 1.3.0 # BID: E9A189C0CA87A30C -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x5E04268, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x46, bUseFixedFrameRate |= 0x40 - # By writing 7 we are making sure that other flags are maintained: + # By writing 6 we are making sure that other flags are maintained: # bAllowMultiThreadedAnimationUpdate |= 4 # bOptimizeAnimBlueprintMemberVariableAccess |= 2 value: 6 @@ -34,4 +33,4 @@ ALL_FPS: value: [0, 0] - type: block - what: timing \ No newline at end of file + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/0100D9601A994000/28ED06F94D767478.yaml b/SaltySD/plugins/FPSLocker/patches/0100D9601A994000/28ED06F94D767478.yaml index 4cf5b22..f73aa36 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100D9601A994000/28ED06F94D767478.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100D9601A994000/28ED06F94D767478.yaml @@ -1,8 +1,6 @@ # ONE PIECE ODYSSEY Deluxe Edition US/EU/JP 1.0.0 # BID: 28ED06F94D767478 -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 2 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/0100DAE019110000/0248DC99035AD28A.yaml b/SaltySD/plugins/FPSLocker/patches/0100DAE019110000/0248DC99035AD28A.yaml index ab548fe..79f4bad 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100DAE019110000/0248DC99035AD28A.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100DAE019110000/0248DC99035AD28A.yaml @@ -1,54 +1,41 @@ # PROJECT ZERO: Mask of the Lunar Eclipse West 1.0.3 # BID: 0248DC99035AD28A -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: min_delta + value_type: float + default_value: 0.0333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 33333333 + evaluate: "1000000000 / FPS_TARGET" MASTER_WRITE: - # Redirect min delta to MAIN + 0x1FE0FF0 + # Redirect min delta # REF: 00 D9 21 7E 28 19 20 1E - type: asm_a64 main_offset: 0x16D9B4 instructions: [ - [adrp, x27, 0x1fe0000], - [ldr, s8, [x27, 0xff0]] + [adrp, x27, $min_delta], + [ldr, s8, [x27, $min_delta]] ] - # Redirect FPS Lock to MAIN + 0x1FE0FF4 + # Redirect FPS Lock # REF: 69 B2 40 B9 0A 40 99 52 - type: asm_a64 main_offset: 0x16DDD0 instructions: [ - [adrp, x9, 0x1fe0000], - [ldr, w9, [x9, 0xff4]], + [adrp, x9, $fps_lock], + [ldr, w9, [x9, $fps_lock]], [nop], [nop] ] - # Default values - - - type: bytes - main_offset: 0x1FE0FF0 - value_type: float - value: 0.0333333333 - - - type: bytes - main_offset: 0x1FE0FF4 - value_type: uint32 - value: 33333333 ALL_FPS: - # Min delta - - - type: evaluate_write - address: [MAIN, 0x1FE0FF0] - value_type: float - value: "1 / FPS_TARGET" - # FPS Lock - - - type: evaluate_write - address: [MAIN, 0x1FE0FF4] - value_type: uint32 - value: "1000000000 / FPS_TARGET" - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100DCA0064A6000/79E5950FFA85ACF6.yaml b/SaltySD/plugins/FPSLocker/patches/0100DCA0064A6000/79E5950FFA85ACF6.yaml index 33ea598..f979776 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100DCA0064A6000/79E5950FFA85ACF6.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100DCA0064A6000/79E5950FFA85ACF6.yaml @@ -2,30 +2,28 @@ # BID: 79E5950FFA85ACF6 # Credits for finding FPS Lock goes to theboy181 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: fps_target + value_type: float + default_value: 33.333333 + evaluate: "1000 / FPS_LOCK_TARGET" MASTER_WRITE: # Redirect reading FPS Lock to MAIN+0x1D164DC - type: asm_a64 main_offset: 0x7A3E9C instructions: [ - [adrp, x12, 0x1d16000] + [adrp, x12, $fps_target] ] - # Default value - - type: bytes - main_offset: 0x1D164DC - value_type: float - value: 33.33333333 + type: asm_a64 + main_offset: 0x7A3EA8 + instructions: [ + [ldr, s0, [x12, $fps_target]] + ] ALL_FPS: - # FPS Lock in ms - - - type: evaluate_write - address: [MAIN, 0x1D164DC] - value_type: float - value: "1000 / FPS_LOCK_TARGET" - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100DE70085E8000/F18ACDA7A11CB287.yaml b/SaltySD/plugins/FPSLocker/patches/0100DE70085E8000/F18ACDA7A11CB287.yaml index 75b51e4..71a52ac 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100DE70085E8000/F18ACDA7A11CB287.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100DE70085E8000/F18ACDA7A11CB287.yaml @@ -1,8 +1,6 @@ # Outlast 2 1.0.0 # BID: F18ACDA7A11CB287 -unsafeCheck: true - MASTER_WRITE: # Remove double buffer - @@ -11,7 +9,6 @@ MASTER_WRITE: instructions: [ [cmp, x26, 3] ] - value: 0xF1000F5F - type: asm_a64 main_offset: 0xF45E64 @@ -30,10 +27,3 @@ MASTER_WRITE: instructions: [ [mov, w1, 3] ] -ALL_FPS: - # DUMMY - - - type: write - address: [MAIN, 0x408B900] - value_type: uint8 - value: 0 diff --git a/SaltySD/plugins/FPSLocker/patches/0100E2701A888000/8322528255D2CC63.yaml b/SaltySD/plugins/FPSLocker/patches/0100E2701A888000/8322528255D2CC63.yaml index cc70830..eb1903e 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100E2701A888000/8322528255D2CC63.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100E2701A888000/8322528255D2CC63.yaml @@ -2,8 +2,19 @@ # BID: 8322528255D2CC63 # To update dynamic resolution offsets look at fb::renderer::ResolutionScaler::update -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target_max + value_type: double + default_value: 34 + evaluate: "1.02 * FRAMETIME_TARGET" + - + type: variable + name: dr_target_min + value_type: double + default_value: 32 + evaluate: "0.96 * FRAMETIME_TARGET" MASTER_WRITE: # Change double buffer to triple buffer - @@ -13,57 +24,33 @@ MASTER_WRITE: [mov, w8, 3] ] # Allow changing dynamic resolution timings - # Max - changed address to MAIN + 0x7D05200 + # Max - type: asm_a64 main_offset: 0x25992CC instructions: [ - [adrp, x8, 0x7d05000], + [adrp, x8, $dr_target_max], [adrp, x22, 0x5ddf000], - [ldr, d2, [x8, 0x200]] + [ldr, d2, [x8, $dr_target_max]] ] # Min - changed address to MAIN + 0x7D05208 - type: asm_a64 main_offset: 0x2599344 instructions: [ - [adrp, x10, 0x7d05000], - [ldr, d5, [x10, 0x208]] + [adrp, x10, $dr_target_min], + [ldr, d5, [x10, $dr_target_min]] ] - type: asm_a64 main_offset: 0x2599380 instructions: [ - [adrp, x10, 0x7d05000] + [adrp, x10, $dr_target_min] ] - type: asm_a64 main_offset: 0x2599390 instructions: [ - [ldr, d6, [x10, 0x208]] + [ldr, d6, [x10, $dr_target_min]] ] - # Default values - - - type: bytes - main_offset: 0x7D05200 - value_type: double - value: 34.0 - - - type: bytes - main_offset: 0x7D05208 - value_type: double - value: 32.0 -ALL_FPS: - # Max Dynamic Resolution Timing - - - type: evaluate_write - address: [MAIN, 0x7D05200] - value_type: double - value: "1.02 * FRAMETIME_TARGET" - # Min Dynamic Resolution Timing - - - type: evaluate_write - address: [MAIN, 0x7D05208] - value_type: double - value: "0.96 * FRAMETIME_TARGET" diff --git a/SaltySD/plugins/FPSLocker/patches/0100E5900F49A000/A8BA2A8F93AAE647.yaml b/SaltySD/plugins/FPSLocker/patches/0100E5900F49A000/A8BA2A8F93AAE647.yaml index c573c3c..036a23d 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100E5900F49A000/A8BA2A8F93AAE647.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100E5900F49A000/A8BA2A8F93AAE647.yaml @@ -1,28 +1,20 @@ # Othercide 1.3.0.5/1.3.1.0 # BID: A8BA2A8F93AAE647 -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 41 + evaluate: "0.97 * FRAMETIME_TARGET" MASTER_WRITE: - # Redirect DynamicResolutionManager$$Update Timing to be read from MAIN+0x72C6500 + # Redirect DynamicResolutionManager$$Update Timing - type: asm_a64 main_offset: 0x2B0188C instructions: [ - [adrp, x8, 0x72c6000], - [ldr, s1, [x8, 0x500]] + [adrp, x8, $dr_target], + [ldr, s1, [x8, $dr_target]] ] - # Write default value - - - type: bytes - main_offset: 0x72C6500 - value_type: float - value: 41 -ALL_FPS: - # Game's priority is resolution over framerate with factor 1.23, I am changing that to 0.97 - - - type: evaluate_write - address: [MAIN, 0x72C6500] - value_type: float - value: "0.97 * FRAMETIME_TARGET" - diff --git a/SaltySD/plugins/FPSLocker/patches/0100E6300AA3A000/AAC6FB02E03062EF.yaml b/SaltySD/plugins/FPSLocker/patches/0100E6300AA3A000/AAC6FB02E03062EF.yaml index 50ba91b..298e97c 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100E6300AA3A000/AAC6FB02E03062EF.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100E6300AA3A000/AAC6FB02E03062EF.yaml @@ -1,42 +1,23 @@ # Batman: The Enemy Within 1.0.3 # BID: AAC6FB02E03062EF -unsafeCheck: true - -MASTER_WRITE: -# Remove double buffer +DECLARATIONS: - - type: asm_a64 - main_offset: 0x64A8 - instructions: [ - [mov, w2, 3], - [madd, x1, x8, x2, x9] - ] - - - type: bytes - main_offset: 0xC526D0 - value_type: uint32 - value: 0x1887D70 - - - type: bytes - main_offset: 0x1751C50 - value_type: uint32 - value: 0x1887D70 - - - type: asm_a64 - main_offset: 0xC4EDE0 + type: code + name: tripleBuffer instructions: [ + [stp, x29, x30, [sp, -16], "!"], [ldr, x0, [x26, 0x10]], - [cbz, x0, +24], + [cbz, x0, :goto1], [adrp, x8, 0x1751000], [ldr, x8, [x8, 0x150]], [ldr, x8, [x8]], [blr, x8], - [b, +16], - [mov, w0, 0xc0], + [b, :goto2], + :goto1, [mov, w0, 0xc0], [bl, 0x72bb40], [str, x0, [x26, 0x10]], - [ldr, x22, [x27]], + :goto2, [ldr, x22, [x27]], [adrp, x27, 0x1750000], [ldr, x21, [x25]], [ldr, x27, [x27, 0xff8]], @@ -62,13 +43,34 @@ MASTER_WRITE: [mov, x1, x23], [blr, x8], [adrp, x22, 0x1751000], - [b, 0x5edc] + [ldp, x29, x30, [sp], 16], + [ret] ] + +MASTER_WRITE: +# Remove double buffer + - + type: asm_a64 + main_offset: 0x64A8 + instructions: [ + [mov, w2, 3], + [madd, x1, x8, x2, x9] + ] + - + type: bytes + main_offset: 0xC526D0 + value_type: uint32 + value: 0x1887D70 + - + type: bytes + main_offset: 0x1751C50 + value_type: uint32 + value: 0x1887D70 - type: asm_a64 main_offset: 0x5ED8 instructions: [ - [b, 0xc4ede0] + [bl, _tripleBuffer()] ] - type: asm_a64 @@ -82,10 +84,5 @@ MASTER_WRITE: instructions: [ [mov, x2, 0x1950000] ] -ALL_FPS: - # dummy - - - type: write - address: [MAIN, 0x1887F00] - value_type: uint8 - value: 0 + + diff --git a/SaltySD/plugins/FPSLocker/patches/0100E66010ADE000/45CE2B6625A35771.yaml b/SaltySD/plugins/FPSLocker/patches/0100E66010ADE000/45CE2B6625A35771.yaml index 80551dc..c32fbd3 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100E66010ADE000/45CE2B6625A35771.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100E66010ADE000/45CE2B6625A35771.yaml @@ -1,8 +1,55 @@ # Crysis Remastered 1.8.0 # BID: 45CE2B6625A35771 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_target1 + value_type: float + default_value: 28.5 + evaluate: "0.855 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target2 + value_type: float + default_value: 32 + evaluate: "0.96 * FRAMETIME_TARGET" + - + type: variable + name: dr_target3 + value_type: float + default_value: 33 + evaluate: "0.96 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target4 + value_type: float + default_value: 29.5 + evaluate: "0.885 * FRAMETIME_TARGET" + - + type: variable + name: dr_target5 + value_type: float + default_value: 32 + evaluate: "0.885 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: dr_target6 + value_type: float + default_value: 33.5 + evaluate: "1.005 * FRAMETIME_TARGET" + - + type: variable + name: dr_target7 + value_type: float + default_value: 36 + evaluate: "1.005 * FRAMETIME_TARGET" + # DON'T PUT ANYTHING BETWEEN - END MASTER_WRITE: # Redirect Dynamic Resolution Timings to read always not from .text - @@ -11,60 +58,35 @@ MASTER_WRITE: instructions: [ [fmov, s0, s1] ] -# Redirect Dynamic Resolution Timings readings to MAIN+0x3DFAE00 + # Redirect Dynamic Resolution Timings readings - type: asm_a64 main_offset: 0x27CE450 instructions: [ - [adrp, x13, 0x3dfa000], - [ldr, s1, [x13, 0xe00]] + [adrp, x13, $dr_target1], + [ldr, s1, [x13, $dr_target1]] ] - type: asm_a64 main_offset: 0x27CE484 instructions: [ - [adrp, x9, 0x3dfa000], - [add, x9, x9, 0xe04] + [adrp, x9, $dr_target2], + [add, x9, x9, $dr_target2] ] - type: asm_a64 main_offset: 0x27CE490 instructions: [ - [adrp, x10, 0x3dfa000], - [add, x10, x10, 0xe0c] + [adrp, x10, $dr_target4], + [add, x10, x10, $dr_target4] ] - type: asm_a64 main_offset: 0x27CE468 instructions: [ - [adrp, x8, 0x3dfa000], - [add, x8, x8, 0xe14] + [adrp, x8, $dr_target6], + [add, x8, x8, $dr_target6] ] -# Write default values - # MAIN + 0x2C11728 - - - type: bytes - main_offset: 0x3DFAE00 - value_type: float - value: 28.5 - # MAIN + 0x2C12B98 - - - type: bytes - main_offset: 0x3DFAE04 - value_type: float - value: [32, 33] - # MAIN + 0x2C13130 - - - type: bytes - main_offset: 0x3DFAE0C - value_type: float - value: [29.5, 32] - # MAIN + 0x2C12EF8 - - - type: bytes - main_offset: 0x3DFAE14 - value_type: float - value: [33.5, 36] ALL_FPS: # sys_MaxFPS - @@ -74,35 +96,10 @@ ALL_FPS: value: FPS_LOCK_TARGET # Renderer thread delay - - type: write + type: evaluate_write address: [MAIN, 0x3CCF6A0] value_type: float - value: 0.01 - # MAIN + 0x2C11728 - - - type: evaluate_write - address: [MAIN, 0x3DFAE00] - value_type: float - value: "0.855 * FRAMETIME_TARGET" - # MAIN + 0x2C12B98 - - - type: evaluate_write - address: [MAIN, 0x3DFAE04] - value_type: float - value: ["0.96 * FRAMETIME_TARGET", "0.96 * FRAMETIME_TARGET"] - # MAIN + 0x2C13130 - - - type: evaluate_write - address: [MAIN, 0x3DFAE0C] - value_type: float - value: ["0.885 * FRAMETIME_TARGET", "0.885 * FRAMETIME_TARGET"] - # MAIN + 0x2C12EF8 - - - type: evaluate_write - address: [MAIN, 0x3DFAE14] - value_type: float - value: ["1.005 * FRAMETIME_TARGET", "1.005 * FRAMETIME_TARGET"] + value: "0.66 * (1/FPS_TARGET)" - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100E9001A94C000/ACBD89C999804FD2.yaml b/SaltySD/plugins/FPSLocker/patches/0100E9001A94C000/ACBD89C999804FD2.yaml index dc64c21..04e89c1 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100E9001A94C000/ACBD89C999804FD2.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100E9001A94C000/ACBD89C999804FD2.yaml @@ -1,8 +1,6 @@ -# TinTin Reporter - Cigars of the Pharaoh 1.4.0 +# TinTin Reporter - Cigars of the Pharaoh 1.4.0/1.4.1 # BID: ACBD89C999804FD2 -unsafeCheck: true - ALL_FPS: # r.DynamicRes.FrameTimeBudget (default is 50 ms xD) - @@ -25,3 +23,4 @@ ALL_FPS: - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/0100E95004038000/F77F1559371C0EC6.yaml b/SaltySD/plugins/FPSLocker/patches/0100E95004038000/F77F1559371C0EC6.yaml index 1663d45..ae46218 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100E95004038000/F77F1559371C0EC6.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100E95004038000/F77F1559371C0EC6.yaml @@ -1,103 +1,125 @@ # Xenoblade Chronicles 2 2.1.0 # BID: F77F1559371C0EC6 -unsafeCheck: true - -MASTER_WRITE: - # Dynamic speed - # Jump before pushing frame to the end of .plt, which is 0x8B3900 (backup: MOV W8, #0x21A0) +DECLARATIONS: - - type: asm_a64 - main_offset: 0x700164 - instructions: [ - [b, 0x8b3900] - ] - # Game speed math, write data to unused .bss, tick at 0x15ECF00, game speed at tick at 0x15ECF08, take min delta from 0x15ECF10 + type: variable + name: last_tick + value_type: uint64 + default_value: 0 - - type: asm_a64 - main_offset: 0x8B3900 + type: variable + name: game_speed + value_type: float + default_value: 0.03333333333 + - + type: variable + name: min_delta + value_type: float + default_value: 0.03333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: max_delta + value_type: float + default_value: 30 + evaluate: "FPS_TARGET / 2" + - + type: variable + name: dr_target + value_type: float + default_value: 0.0166666666 + evaluate: "(1 / FPS_TARGET) / VSYNC_TARGET" + - + type: const + name: microseconds_in_sec + value: 1000000 + - + type: const + name: nano_in_micro + value: 1000 + - + type: code + name: dynamicSpeed instructions: [ - [bl, 0x8b2700], - [adrp, x2, 0x15ec000], - [ldr, x1, [x2, 0xf00]], - [str, x0, [x2, 0xf00]], - [cbnz, x1, +12], - [mov, w8, 0x21a0], - [b, 0x700168], + [stp, x29, x30, [sp, -16], "!"], + [mov, x29, sp], + [mrs, x0, cntpct_el0], + [adrp, x2, $last_tick], + [ldr, x1, [x2, $last_tick]], + [str, x0, [x2, $last_tick]], + [cbz, x1, :goto3], [sub, x0, x0, x1], - [bl, 0x8b2710], - [fmov, s2, 15.0], - [mov, w1, 1000], + [bl, _convertTickToTimeSpan()], + [adrp, x1, $max_delta], + [ldr, s2, [x1, $max_delta]], + [mov, w1, $nano_in_micro], [udiv, x0, x0, x1], - [scvtf, s0, x0], - [mov, w1, 0x2400], - [movk, w1, 0x4974, 16], - [fmov, s1, w1], - [b, +96], - [adrp, x0, 0xb8f000], + [ucvtf, s0, x0], + [mov, w1, $microseconds_in_sec], + [movk, w1, $microseconds_in_sec, 16], + [ucvtf, s1, w1], + [b, :goto2], + :goto4, [adrp, x0, 0xb8f000], [ldr, x0, [x0, 0xd0]], - [cbz, x0, -56], + [cbz, x0, :goto3], [str, s0, [x0, 0x78]], [str, s0, [x0, 0x7c]], [adrp, x0, 0xc22000], [ldr, x0, [x0, 0x2c8]], [str, s0, [x0, 0x80]], - [adrp, x0, 0x15ec000], - [str, s0, [x0, 0xf08]], - [b, -88], - [fmov, s1, 1.0], # + [adrp, x0, $game_speed], + [str, s0, [x0, $game_speed]], + [b, :goto3], + :goto5, [fmov, s1, 1.0], [fdiv, s2, s1, s2], [fcmp, s0, s2], - [b.lt, +12], + [b.lt, :goto6], [fmov, s0, s2], - [b, -64], - [adrp, x0, 0x15ec000], - [ldr, s2, [x0, 0xf10]], + [b, :goto4], + :goto6, [adrp, x0, $min_delta], + [ldr, s2, [x0, $min_delta]], [fcmp, s0, s2], - [b.hi, -80], + [b.hi, :goto4], [fmov, s0, s2], - [b, -88], - [fdiv, s0, s0, s1], - [b, -52] + [b, :goto4], + :goto2, [fdiv, s0, s0, s1], + [b, :goto5], + :goto3, [mov, w8, 0x21a0], + [ldp, x29, x30, [sp], 16], + [ret], ] - # Patch wind speed to take game speed from MAIN + 0x15ECF08 +MASTER_WRITE: + # Dynamic speed + # Jump before pushing frame + - + type: asm_a64 + main_offset: 0x700164 + instructions: [ + [bl, _dynamicSpeed()] + ] + # Patch wind speed to take game speed - type: asm_a64 main_offset: 0x747DD8 instructions: [ - [adrp, x8, 0x15ec000], - [ldr, s6, [x8, 0xf08]] + [adrp, x8, $game_speed], + [ldr, s6, [x8, $game_speed]] ] - # Redirect DR timing to MAIN + 0x15ECF18 + # Redirect DR timing - type: asm_a64 main_offset: 0x6AA14C instructions: [ - [adrp, x8, 0x15ec000], - [ldr, s0, [x8, 0xf18]] + [adrp, x8, $dr_target], + [ldr, s0, [x8, $dr_target]] ] - # Default values - - - type: bytes - main_offset: 0x15ECF08 - value_type: float - value: [0.0333333333, 0.0333333333, 0.0333333333, 0.0166666666] ALL_FPS: - type: evaluate_write address: [MAIN, 0xB74BF0] value_type: uint32 value: ["VSYNC_TARGET", "VSYNC_TARGET"] - - - type: evaluate_write - address: [MAIN, 0x15ECF10] - value_type: float - value: "1 / FPS_TARGET" - - - type: evaluate_write - address: [MAIN, 0x15ECF18] - value_type: float - value: "(1 / FPS_TARGET) / VSYNC_TARGET" # Cutscenes in 30 FPS - type: compare @@ -105,8 +127,23 @@ ALL_FPS: compare_value_type: uint8 compare_value: 1 compare_address: [MAIN, 0xBD7F40] - address: [MAIN] value_type: refresh_rate + value: 60 + - + type: compare + compare_type: "==" + compare_value_type: uint8 + compare_value: 1 + compare_address: [MAIN, 0xBD7F40] + address: [VARIABLE, min_delta] + value: 0.0333333333 + - + type: compare + compare_type: "==" + compare_value_type: uint8 + compare_value: 1 + compare_address: [MAIN, 0xBD7F40] + address: [VARIABLE, max_delta] value: 30 - type: compare @@ -114,16 +151,14 @@ ALL_FPS: compare_value_type: uint8 compare_value: 1 compare_address: [MAIN, 0xBD7F40] - address: [MAIN, 0x15ECF10] - value_type: float - value: 0.0333333333 + address: [MAIN, 0xB74BF0] + value_type: uint32 + value: [2, 2] - type: compare compare_type: "==" compare_value_type: uint8 compare_value: 1 compare_address: [MAIN, 0xBD7F40] - address: [MAIN, 0x15ECF18] - value_type: float - value: 0.0333333333 - + address: [VARIABLE, dr_target] + value: 0.0166666666 diff --git a/SaltySD/plugins/FPSLocker/patches/0100ED7012DB2000/1A971CC40B6D5B3F.yaml b/SaltySD/plugins/FPSLocker/patches/0100ED7012DB2000/1A971CC40B6D5B3F.yaml index 5742e09..100b7c2 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100ED7012DB2000/1A971CC40B6D5B3F.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100ED7012DB2000/1A971CC40B6D5B3F.yaml @@ -2,63 +2,59 @@ # BID: 1A971CC40B6D5B3F # Cursor speed is tied to framerate, main menu animations speed is not adjusted properly in range from 35 to 55 FPS -unsafeCheck: true - +DECLARATIONS: + # DON'T PUT ANYTHING BETWEEN - START + - + type: variable + name: fps_lock + value_type: uint32 + default_value: 30 + evaluate: FPS_LOCK_TARGET + - + type: variable + name: fps_lock2 + value_type: uint32 + default_value: 60 + evaluate: FPS_LOCK_TARGET + # DON'T PUT ANYTHING BETWEEN - END + - + type: variable + name: game_speed + value_type: float + default_value: 0.0333333333 + evaluate: "1/FPS_TARGET" MASTER_WRITE: - # Redirect adjusting game speed to FPS Lock stored in MAIN + 0x2BFB700, REF: 20 79 68 BC 01 10 2E 1E 00 D8 21 7E + # Redirect adjusting game speed to FPS Lock, REF: 20 79 68 BC 01 10 2E 1E 00 D8 21 7E - type: asm_a64 main_offset: 0xB8F528 instructions: [ - [adrp, x9, 0x2bfb000], - [add, x9, x9, 0x700] + [adrp, x9, $fps_lock], + [add, x9, x9, $fps_lock] ] - # Redirect FPS Lock to MAIN + 0x2BFB700, REF: C8 32 40 B9 E8 C2 00 B9 + # Redirect FPS Lock, REF: C8 32 40 B9 E8 C2 00 B9 - type: asm_a64 main_offset: 0x8966BC instructions: [ - [adrp, x8, 0x2bfb000], - [ldr, w8, [x8, 0x700]] + [adrp, x8, $fps_lock], + [ldr, w8, [x8, $fps_lock]] ] - # Redirect game speed to MAIN + 0x2BFB708, REF: 00 28 21 1E 00 A0 00 BD C0 03 5F D6 + # Redirect game speed, REF: 00 28 21 1E 00 A0 00 BD C0 03 5F D6 - type: asm_a64 main_offset: 0x1109040 instructions: [ - [adrp, x8, 0x2bfb000], + [adrp, x8, $game_speed], [ldr, s0, [x0, 0xa0]], - [ldr, s1, [x8, 0x708]] + [ldr, s1, [x8, $game_speed]] ] - # Default FPS Targets - - - type: bytes - main_offset: 0x2BFB700 - value_type: uint32 - value: [30, 60] - # Default game speed - - - type: bytes - main_offset: 0x2BFB708 - value_type: float - value: 0.0333333333 ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x2BFB700] - value_type: uint32 - value: FPS_LOCK_TARGET - # Adjust min delta for menus, 0 - 30 FPS, 1 - 60 FPS, REF: 20 79 68 BC 01 10 2E 1E 00 D8 21 7E type: evaluate_write address: [MAIN, 0x254D2A0] value_type: uint32 value: "FPS_TARGET / 60" - - - type: evaluate_write - address: [MAIN, 0x2BFB708] - value_type: float - value: 1 / FPS_TARGET - type: block what: timing - diff --git a/SaltySD/plugins/FPSLocker/patches/0100F2600D710000/4CCD2F6D331DD104.yaml b/SaltySD/plugins/FPSLocker/patches/0100F2600D710000/4CCD2F6D331DD104.yaml index fbd657c..8ffcc1c 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F2600D710000/4CCD2F6D331DD104.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F2600D710000/4CCD2F6D331DD104.yaml @@ -1,48 +1,42 @@ # Contra: Rogue Corps 1.3.0 # BID: 4CCD2F6D331DD104 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: dr_factor + value_type: float + default_value: 1000000 + evaluate: "30000000 / FPS_TARGET" + - + type: code + name: fpsTarget + instructions: [ + [adrp, x8, 0xd94000], + [ldr, w8, [x8, 0x628]], + [ret] + ] MASTER_WRITE: - # Read FPS target from code cave at MAIN + 0xA13170 + # Read FPS target from code cave - type: asm_a64 main_offset: 0x2004 instructions: [ - [b, 0xa13170] + [bl, _fpsTarget()] ] - # CODE CAVE - read FPS target from MAIN + 0xD94628 - - - type: asm_a64 - main_offset: 0xA13170 - instructions: [ - [adrp, x8, 0xd94000], - [ldr, w8, [x8, 0x628]], - [b, 0x2008] - ] - # Redirect DR time factor to MAIN + 0x2ECAB38 + # Redirect DR time factor - type: asm_a64 main_offset: 0x2140 instructions: [ - [adrp, x8, 0x2eca000], - [ldr, s9, [x8, 0xb38]] + [adrp, x8, $dr_factor], + [ldr, s9, [x8, $dr_factor]] ] - # Default value - - - type: bytes - main_offset: 0x2ECAB38 - value_type: float - value: 1000000 ALL_FPS: - type: evaluate_write address: [MAIN, 0xD94628] value_type: uint32 value: FPS_TARGET - - - type: evaluate_write - address: [MAIN, 0x2ECAB38] - value_type: float - value: "(30 / FPS_TARGET) * 1000000" + diff --git a/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/5CB42B1CF25469FB.yaml b/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/5CB42B1CF25469FB.yaml index d54a121..96107b3 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/5CB42B1CF25469FB.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/5CB42B1CF25469FB.yaml @@ -4,8 +4,65 @@ Addons: - atmosphere/contents/0100F2C0115B6000/exefs/main.npdm -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: fps_target + value_type: float + default_value: 30 + evaluate: FPS_TARGET + - + type: variable + name: cutscene_flag + value_type: uint8 + default_value: 0 + - + type: variable + name: dr_factor + value_type: float + default_value: 0.001 + evaluate: 0.001 * (FPS_TARGET / 30) + - + type: const + name: nanoseconds_in_s + value: 1000000000 + - + type: code + name: cutscene_1 + instructions: [ + [stp, x29, x30, [sp, -16], "!"], + [mov, x29, sp], + [mov, w2, 1], + [adrp, x3, $cutscene_flag], + [strb, w2, [x3, $cutscene_flag]], + [bl, 0x5f888], #Jump to original BL + [ldp, x29, x30, [sp], 16], + [ret] + ] + - + type: code + name: cutscene_2 + instructions: [ + [adrp, x3, $cutscene_flag], + [strb, w0, [x3, $cutscene_flag]], + [b, _setUserInactivityDetectionTimeExtended()], + ] + - + type: code + name: blackBackgroundFix + instructions: [ + [fcmp, s1, 0.0], + [b.ne, :goto1], + [ldurh, w8, [x25, -6]], + [cmp, w8, 5], + [b.ne, :goto1], + [ldurh, w8, [x25, -8]], + [cmp, w8, 5], + [b.ne, :goto1], + [fmov, s8, 1.0], + :goto1, [fmadd, s9, s0, s8, s1], + [ret] + ] MASTER_WRITE: # Remove double buffer ## REF: A0 2A 40 F9 61 A2 40 39 @@ -17,20 +74,19 @@ MASTER_WRITE: ] # Code Injected, $x1 + 0xD8 - last frametime without compensation long ticks, $x0 + 0x50 - fps target used for calculation int, # $x0 + 0x24 - our fps target used for calculation but as float, originally is stored there 30 FPS int that seems to do nothing outside of this function - ## MAIN + 0x3ACCFFC = FPS target for reference ## REF: nvnWindowSetPresentInterval - type: asm_a64 main_offset: 0x2D4E68 instructions: [ - [adrp, x2, 0x3acc000], - [ldr, s9, [x2, 0xffc]], + [adrp, x2, $fps_target], + [ldr, s9, [x2, $fps_target]], [mov, x20, x0], [mov, x21, x1], [ldr, x0, [x1, 0xd8]], - [bl, 0x2ba4830], # BL nn::os::ConvertToTimeSpan(nn::os::Tick) - [mov, w2, 0xca00], - [movk, w2, 0x3b9a, 16], + [bl, _convertTickToTimeSpan()], + [mov, w2, $nanoseconds_in_s], + [movk, w2, $nanoseconds_in_s, 16], [scvtf, s2, w2], [scvtf, s1, x0], [fdiv, s1, s2, s1], @@ -75,14 +131,14 @@ MASTER_WRITE: instructions: [ [nop] ] - # When prerendered cutscene is active write flag to MAIN + 0x3ACCFFB + # When prerendered cutscene is active write flag to cutscene_flag ## REF: 68 52 40 79 08 01 19 32 68 52 00 79 ## BL to Code Cave 1 - type: asm_a64 main_offset: 0x2B238B4 instructions: [ - [bl, 0x2d4eb8] + [bl, _cutscene_1()] ] ## REF: 68 52 40 79 08 79 18 12 68 52 00 79, inside call ## B to Code Cave 2 @@ -90,35 +146,16 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x2B210CC instructions: [ - [b, 0x2d4ec8] + [b, _cutscene_2()] ] - ## CODE CAVE 1, offset +0x50 relative to start of previous code cave - - - type: asm_a64 - main_offset: 0x2D4EB8 - instructions: [ - [mov, w2, 1], - [adrp, x3, 0x3acc000], - [strb, w2, [x3, 0xffb]], - [b, 0x5f888] # Jump to original BL as B - ] - ## CODE CAVE 2, offset +0x10 relative to start of previous code cave - - - type: asm_a64 - main_offset: 0x2D4EC8 - instructions: [ - [adrp, x3, 0x3acc000], - [strb, w0, [x3, 0xffb]], - [b, 0x2ba5e80] # B nn::oe::SetUserInactivityDetectionTimeExtended(bool) - ] - # Adjust DR timing to factor from MAIN + 0x3ACCFF4 + # Adjust DR timing to factor from dr_factor # REF: 88 02 15 CB 00 01 23 9E - type: asm_a64 main_offset: 0xEED54 instructions: [ - [adrp, x8, 0x3acc000], - [ldr, s1, [x8, 0xff4]] + [adrp, x8, $dr_factor], + [ldr, s1, [x8, $dr_factor]] ] # Fix black background for D-pad menu ## REF: 21 03 5E BC @@ -126,62 +163,14 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x387390 instructions: [ - [b, 0x2d4ed4], # Jump to Code Cave 3 + [bl, _blackBackgroundFix()], # Jump to Code Cave 3 [fcmp, s0, 0.0] ] - ## CODE CAVE 3, offset +0xC relative to start of previous code cave - - - type: asm_a64 - main_offset: 0x2D4ED4 - instructions: [ - [fcmp, s1, 0.0], - [b.ne, +32], - [ldurh, w8, [x25, -6]], - [cmp, w8, 5], - [b.ne, +20], - [ldurh, w8, [x25, -8]], - [cmp, w8, 5], - [b.ne, +8], - [fmov, s8, 1.0], - [fmadd, s9, s0, s8, s1], - [b, 0x387394] # Go back - ] - # Default values - ## FPS Target - - - type: bytes - main_offset: 0x3ACCFFC - value_type: float - value: 30 - ## Cutscene flag - - - type: bytes - main_offset: 0x3ACCFFB - value_type: uint8 - value: 0 - ## Dynamic Resolution timing factor - - - type: bytes - main_offset: 0x3ACCFF4 - value_type: float - value: 0.001 ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x3ACCFFC] - value_type: float - value: FPS_TARGET - - - type: evaluate_write - address: [MAIN, 0x3ACCFF4] - value_type: float - value: "0.001 * (FPS_TARGET / 30)" - type: compare - compare_address: [MAIN, 0x3ACCFFB] - compare_value_type: uint8 + compare_address: [VARIABLE, cutscene_flag] compare_value: 1 compare_type: "==" - address: [MAIN] value_type: refresh_rate value: 30 diff --git a/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/9B4E43650501A4D4.yaml b/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/9B4E43650501A4D4.yaml index 23b1299..dd5f3ce 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/9B4E43650501A4D4.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F2C0115B6000/9B4E43650501A4D4.yaml @@ -175,3 +175,4 @@ ALL_FPS: address: [MAIN] value_type: refresh_rate value: 30 + diff --git a/SaltySD/plugins/FPSLocker/patches/0100F3200E7CA000/EAA0B789264F2A75.yaml b/SaltySD/plugins/FPSLocker/patches/0100F3200E7CA000/EAA0B789264F2A75.yaml index 4a46200..8117423 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F3200E7CA000/EAA0B789264F2A75.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F3200E7CA000/EAA0B789264F2A75.yaml @@ -1,36 +1,43 @@ # The Settlers: New Allies 1.0.7 # BID: EAA0B789264F2A75 -unsafeCheck: true - +DECLARATIONS: + - + type: variable + name: fps_lock + value_type: float + default_value: 30 + evaluate: FPS_LOCK_TARGET + - + type: variable + name: frametime_target + value_type: float + default_value: 0.0333333333 + evaluate: "1 / FPS_TARGET" + - + type: code + name: readVariables + instructions: [ + [adrp, x8, $fps_lock], + [ldr, s0, [x8, $fps_lock]], + [adrp, x8, $frametime_target], + [ldr, s8, [x8, $frametime_target]], + [ret] + ] MASTER_WRITE: - # Redirect FPS Lock to float MAIN+B75F200, frametime and DR target to float MAIN+B75F204 + # Redirect FPS Lock to fps_lock, frametime and DR target to frametime_target # REF: 08 14 40 BD 00 10 2E 1E 00 18 28 1E - type: asm_a64 - main_offset: 0x36A3F8 + main_offset: 0x36A400 instructions: [ - [adrp, x8, 0xb75f000], - [ldr, s0, [x8, 0x200]], - [ldr, s8, [x8, 0x204]] + [bl, _readVariables()] ] # REF: 00 14 40 BD 09 10 2E 1E (1 instruction before that) - type: asm_a64 main_offset: 0x34A0EB4 instructions: [ - [adrp, x0, 0xb75f000], - [ldr, s0, [x0, 0x204]] + [adrp, x0, $frametime_target], + [ldr, s0, [x0, $frametime_target]] ] - # Default values - - - type: bytes - main_offset: 0xB75F200 - value_type: float - value: [30, 0.0333333333] -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0xB75F200] - value_type: float - value: [FPS_LOCK_TARGET, "1 / FPS_TARGET"] diff --git a/SaltySD/plugins/FPSLocker/patches/0100F3400332C000/E3938FA78579C1CA.yaml b/SaltySD/plugins/FPSLocker/patches/0100F3400332C000/E3938FA78579C1CA.yaml index f899a34..f143741 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F3400332C000/E3938FA78579C1CA.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F3400332C000/E3938FA78579C1CA.yaml @@ -1,7 +1,94 @@ # Xenoblade2 2.0.2 # BID: E3938FA78579C1CA -unsafeCheck: true +DECLARATIONS: + - + type: variable + name: last_tick + value_type: uint64 + default_value: 0 + - + type: variable + name: game_speed + value_type: float + default_value: 0.03333333333 + - + type: variable + name: min_delta + value_type: float + default_value: 0.03333333333 + evaluate: "1 / FPS_TARGET" + - + type: variable + name: max_delta + value_type: float + default_value: 30 + evaluate: "FPS_TARGET / 2" + - + type: variable + name: dr_target + value_type: float + default_value: 0.0166666666 + evaluate: "(1 / FPS_TARGET) / VSYNC_TARGET" + - + type: const + name: microseconds_in_sec + value: 1000000 + - + type: const + name: milliseconds_in_sec + value: 1000 + - + type: code + name: dynamicSpeed + instructions: [ + [stp, x29, x30, [sp, -16], "!"], + [mov, x29, sp], + [mrs, x0, cntpct_el0], + [adrp, x2, $last_tick], + [ldr, x1, [x2, $last_tick]], + [str, x0, [x2, $last_tick]], + [cbz, x1, :goto3], + [sub, x0, x0, x1], + [bl, _convertTickToTimeSpan()], + [adrp, x1, $max_delta], + [ldr, s2, [x1, $max_delta], + [mov, w1, $milliseconds_in_sec], + [udiv, x0, x0, x1], + [ucvtf, s0, x0], + [mov, w1, $microseconds_in_sec], + [movk, w1, $microseconds_in_sec, 16], + [ucvtf, s1, w1], + [b, :goto2], + :goto4, [adrp, x0, 0xb8f000], + [ldr, x0, [x0, 0xd0]], + [cbz, x0, :goto3], + [str, s0, [x0, 0x78]], + [str, s0, [x0, 0x7c]], + [adrp, x0, 0xc22000], + [ldr, x0, [x0, 0x2c8]], + [str, s0, [x0, 0x80]], + [adrp, x0, $game_speed], + [str, s0, [x0, $game_speed]], + [b, :goto3], + :goto5, [fmov, s1, 1.0], + [fdiv, s2, s1, s2], + [fcmp, s0, s2], + [b.lt, :goto6], + [fmov, s0, s2], + [b, :goto4], + :goto6, [adrp, x0, $min_delta], + [ldr, s2, [x0, $min_delta]], + [fcmp, s0, s2], + [b.hi, :goto4], + [fmov, s0, s2], + [b, :goto4], + :goto2, [fdiv, s0, s0, s1], + [b, :goto5], + :goto3, [mov, w8, 0x21a0], + [ldp, x29, x30, [sp], 16], + [ret], + ] MASTER_WRITE: # Dynamic speed @@ -10,94 +97,30 @@ MASTER_WRITE: type: asm_a64 main_offset: 0x700050 instructions: [ - [b, 0x8b3448] - ] - # Game speed math, write data to unused .bss, tick at 0x15ECF00, game speed at 0x15ECF08, take min delta from 0x15ECF10 - - - type: asm_a64 - main_offset: 0x8B3448 - instructions: [ - [bl, 0x8b2258], - [adrp, x2, 0x15ec000], - [ldr, x1, [x2, 0xf00]], - [str, x0, [x2, 0xf00]], - [cbnz, x1, +12], - [mov, w8, 0x21a0], - [b, 0x700054], - [sub, x0, x0, x1], - [bl, 0x8b2268], - [fmov, s2, 15.0], - [mov, w1, 1000], - [udiv, x0, x0, x1], - [scvtf, s0, x0], - [mov, w1, 0x2400], - [movk, w1, 0x4974, 16], - [fmov, s1, w1], - [b, +96], - [adrp, x0, 0xb8f000], - [ldr, x0, [x0, 0xd0]], - [cbz, x0, -56], - [str, s0, [x0, 0x78]], - [str, s0, [x0, 0x7c]], - [adrp, x0, 0xc22000], - [ldr, x0, [x0, 0x2c8]], - [str, s0, [x0, 0x80]], - [adrp, x0, 0x15ec000], - [str, s0, [x0, 0xf08]], - [b, -88], - [fmov, s1, 1.0], - [fdiv, s2, s1, s2], - [fcmp, s0, s2], - [b.lt, +12], - [fmov, s0, s2], - [b, -64], - [adrp, x0, 0x15ec000], - [ldr, s2, [x0, 0xf10]], - [fcmp, s0, s2], - [b.hi, -80], - [fmov, s0, s2], - [b, -88], - [fdiv, s0, s0, s1], - [b, -52] + [bl, _dynamicSpeed()] ] # Patch wind speed to take game speed from MAIN + 0x15ECF08 - type: asm_a64 main_offset: 0x747CC4 instructions: [ - [adrp, x8, 0x15ec000], - [ldr, s6, [x8, 0xf08]] + [adrp, x8, $game_speed], + [ldr, s6, [x8, $game_speed]] ] # Redirect DR timing to MAIN + 0x15ECF18 - type: asm_a64 main_offset: 0x6AA038 instructions: [ - [adrp, x8, 0x15ec000], - [ldr, s0, [x8, 0xf18]] + [adrp, x8, $dr_target], + [ldr, s0, [x8, $dr_target]] ] - # Default values - - - type: bytes - main_offset: 0x15ECF08 - value_type: float - value: [0.0333333333, 0.0333333333, 0.0333333333, 0.0166666666, 0.0333333333] ALL_FPS: - type: evaluate_write address: [MAIN, 0xB74BC0] value_type: uint32 value: ["VSYNC_TARGET", "VSYNC_TARGET"] - - - type: evaluate_write - address: [MAIN, 0x15ECF10] - value_type: float - value: "1 / FPS_TARGET" - - - type: evaluate_write - address: [MAIN, 0x15ECF18] - value_type: float - value: "(1 / FPS_TARGET) / VSYNC_TARGET" # Cutscenes in 30 FPS - type: compare @@ -105,8 +128,23 @@ ALL_FPS: compare_value_type: uint8 compare_value: 1 compare_address: [MAIN, 0xBD7F40] - address: [MAIN] value_type: refresh_rate + value: 60 + - + type: compare + compare_type: "==" + compare_value_type: uint8 + compare_value: 1 + compare_address: [MAIN, 0xBD7F40] + address: [VARIABLE, min_delta] + value: 0.0333333333 + - + type: compare + compare_type: "==" + compare_value_type: uint8 + compare_value: 1 + compare_address: [MAIN, 0xBD7F40] + address: [VARIABLE, max_delta] value: 30 - type: compare @@ -114,16 +152,14 @@ ALL_FPS: compare_value_type: uint8 compare_value: 1 compare_address: [MAIN, 0xBD7F40] - address: [MAIN, 0x15ECF10] - value_type: float - value: 0.0333333333 + address: [MAIN, 0xB74BC0] + value_type: uint32 + value: [2, 2] - type: compare compare_type: "==" compare_value_type: uint8 compare_value: 1 compare_address: [MAIN, 0xBD7F40] - address: [MAIN, 0x15ECF18] - value_type: float - value: 0.0333333333 - + address: [VARIABLE, dr_target] + value: 0.0166666666 diff --git a/SaltySD/plugins/FPSLocker/patches/0100F4F014108000/2284DFB25F387719.yaml b/SaltySD/plugins/FPSLocker/patches/0100F4F014108000/2284DFB25F387719.yaml index 3b09e7e..da3ad0f 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F4F014108000/2284DFB25F387719.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F4F014108000/2284DFB25F387719.yaml @@ -1,13 +1,12 @@ # Mythic Ocean 1.0.1 # BID: 2284DFB25F387719 -unsafeCheck: true - ALL_FPS: # Disable bUseFixedFrameRate to untie game speed from framerate and unlock FPS - type: write address: [MAIN, 0x63CEE78, 0x7A4] + address_unsafe: true value_type: uint32 # Default is 0x47, bUseFixedFrameRate |= 0x40 # By writing 7 we are making sure that other flags are maintained: @@ -30,3 +29,4 @@ ALL_FPS: - type: block what: timing + diff --git a/SaltySD/plugins/FPSLocker/patches/0100F6701FED4000/EBB5459731354538.yaml b/SaltySD/plugins/FPSLocker/patches/0100F6701FED4000/EBB5459731354538.yaml new file mode 100644 index 0000000..8d65b3e --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100F6701FED4000/EBB5459731354538.yaml @@ -0,0 +1,10 @@ +# The Legend of Heroes: Trails through Daybreak II 1.0.2 +# BID: EBB5459731354538 + +ALL_FPS: + # REF: 88 01 80 52 C1 03 80 52 28 4D 28 9B 29 00 80 52, first ADRP + ADD below it + - + type: evaluate_write + address: [MAIN, 0x6E2998, 0x34] + value_type: uint32 + value: FPS_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100F8F00C4F2000/BC714E2D7D32AB41.yaml b/SaltySD/plugins/FPSLocker/patches/0100F8F00C4F2000/BC714E2D7D32AB41.yaml index 668edd3..e07d2f1 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100F8F00C4F2000/BC714E2D7D32AB41.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100F8F00C4F2000/BC714E2D7D32AB41.yaml @@ -2,12 +2,11 @@ # BID: BC714E2D7D32AB41 # Game stores textures inside fixed size class, so it's hard to get triple buffer -unsafeCheck: false - ALL_FPS: # Max time delta - type: evaluate_write address: [MAIN, 0x1225EC8, 0x1C] + address_unsafe: true value_type: float value: ["(1 / FPS_TARGET) - 0.0001"] \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100FAD01861C000/D84426C8D6B8D947.yaml b/SaltySD/plugins/FPSLocker/patches/0100FAD01861C000/D84426C8D6B8D947.yaml index cfbc4f6..5568bab 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100FAD01861C000/D84426C8D6B8D947.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100FAD01861C000/D84426C8D6B8D947.yaml @@ -1,12 +1,11 @@ # Broken Roads 1.2.11059 # BID: D84426C8D6B8D947 -unsafeCheck: false - ALL_FPS: # Kittehface.Framework20.ResolutionScaler_TypeInfo - type: evaluate_write address: [MAIN, 0x688C058, 0xB8, 0x10] + address_unsafe: true value_type: float value: FRAMETIME_TARGET \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100FBD00F5F6000/5EFAB20F5C1F0F68.yaml b/SaltySD/plugins/FPSLocker/patches/0100FBD00F5F6000/5EFAB20F5C1F0F68.yaml index ff30cac..cac4912 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100FBD00F5F6000/5EFAB20F5C1F0F68.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100FBD00F5F6000/5EFAB20F5C1F0F68.yaml @@ -2,8 +2,6 @@ # BID: 5EFAB20F5C1F0F68 # Game stores textures inside fixed size class, so it's hard to get triple buffer -unsafeCheck: false - ALL_FPS: # r.DynamicRes.FrameTimeBudget (1000/FPS) cutted to 1 decimals - diff --git a/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/54551AEABF6E1F41.yaml b/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/54551AEABF6E1F41.yaml index b0c78e2..0ab0cd8 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/54551AEABF6E1F41.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/54551AEABF6E1F41.yaml @@ -1,27 +1,21 @@ # SnowRunner 1.0.40 # BID: 54551AEABF6E1F41 -# Just search for 0x42055555 - -unsafeCheck: true +# Just search for 0x42055555 in case of REF not working +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET MASTER_WRITE: -# Redirect DR frametime target to MAIN+0x30A7F00 +# Redirect DR frametime target +## REF: 01 04 0C 5E 00 10 2E 1E - type: asm_a64 main_offset: 0x193CEA8 instructions: [ - [adrp, x10, 0x30a7000], - [ldr, s2, [x10, 0xf00]] + [adrp, x10, $dr_target], + [ldr, s2, [x10, $dr_target]] ] - # default value - - - type: bytes - main_offset: 0x30A7F00 - value_type: float - value: 33.3333333333 -ALL_FPS: - - - type: evaluate_write - address: [MAIN, 0x30A7F00] - value_type: float - value: FRAMETIME_TARGET diff --git a/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/B37F6B200EF31DFC.yaml b/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/B37F6B200EF31DFC.yaml new file mode 100644 index 0000000..ffd095d --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100FBD013AB6000/B37F6B200EF31DFC.yaml @@ -0,0 +1,21 @@ +# SnowRunner 1.0.41 +# BID: B37F6B200EF31DFC +# Just search for 0x42055555 in case of REF not working + +DECLARATIONS: + - + type: variable + name: dr_target + value_type: float + default_value: 33.333333 + evaluate: FRAMETIME_TARGET +MASTER_WRITE: +# Redirect DR frametime target +## REF: 01 04 0C 5E 00 10 2E 1E + - + type: asm_a64 + main_offset: 0x1944014 + instructions: [ + [adrp, x10, $dr_target], + [ldr, s2, [x10, $dr_target]] + ] \ No newline at end of file diff --git a/SaltySD/plugins/FPSLocker/patches/0100FF500E34A000/92C78BB3DCBBC3F7.yaml b/SaltySD/plugins/FPSLocker/patches/0100FF500E34A000/92C78BB3DCBBC3F7.yaml index 17cdb3c..315b151 100644 --- a/SaltySD/plugins/FPSLocker/patches/0100FF500E34A000/92C78BB3DCBBC3F7.yaml +++ b/SaltySD/plugins/FPSLocker/patches/0100FF500E34A000/92C78BB3DCBBC3F7.yaml @@ -1,8 +1,6 @@ # Xenoblade Chronicles 1.1.2 # BID: 92C78BB3DCBBC3F7 -unsafeCheck: false - ALL_FPS: - type: evaluate_write @@ -13,5 +11,6 @@ ALL_FPS: - type: evaluate_write address: [MAIN, 0x14016D8, 0x70] + address_unsafe: true value_type: float value: "1 / FPS_TARGET" diff --git a/SaltySD/saltysd_bootstrap.elf b/SaltySD/saltysd_bootstrap.elf index 756ba52..e69f4f1 100644 Binary files a/SaltySD/saltysd_bootstrap.elf and b/SaltySD/saltysd_bootstrap.elf differ diff --git a/SaltySD/saltysd_bootstrap32_3k.elf b/SaltySD/saltysd_bootstrap32_3k.elf index 88b44ce..baef19b 100644 Binary files a/SaltySD/saltysd_bootstrap32_3k.elf and b/SaltySD/saltysd_bootstrap32_3k.elf differ diff --git a/SaltySD/saltysd_bootstrap32_5k.elf b/SaltySD/saltysd_bootstrap32_5k.elf index bc03cf9..57c8a22 100644 Binary files a/SaltySD/saltysd_bootstrap32_5k.elf and b/SaltySD/saltysd_bootstrap32_5k.elf differ diff --git a/SaltySD/saltysd_core.elf b/SaltySD/saltysd_core.elf index c086731..d0df4f0 100644 Binary files a/SaltySD/saltysd_core.elf and b/SaltySD/saltysd_core.elf differ diff --git a/SaltySD/saltysd_core32.elf b/SaltySD/saltysd_core32.elf index 3ce5f77..479943b 100644 Binary files a/SaltySD/saltysd_core32.elf and b/SaltySD/saltysd_core32.elf differ diff --git a/atmosphere/contents/0000000000534C56/exefs.nsp b/atmosphere/contents/0000000000534C56/exefs.nsp index ac81c53..21b9f11 100644 Binary files a/atmosphere/contents/0000000000534C56/exefs.nsp and b/atmosphere/contents/0000000000534C56/exefs.nsp differ diff --git a/atmosphere/contents/010000000000bd00/exefs.nsp b/atmosphere/contents/010000000000bd00/exefs.nsp index bf607c0..435568d 100644 Binary files a/atmosphere/contents/010000000000bd00/exefs.nsp and b/atmosphere/contents/010000000000bd00/exefs.nsp differ diff --git a/atmosphere/kips/loader.kip b/atmosphere/kips/loader.kip index ef95c06..00253bf 100644 Binary files a/atmosphere/kips/loader.kip and b/atmosphere/kips/loader.kip differ diff --git a/config/sys-clk/config.ini b/config/sys-clk/config.ini index 6d21803..6dcec87 100644 --- a/config/sys-clk/config.ini +++ b/config/sys-clk/config.ini @@ -2,3 +2,4 @@ gpu_dvfs=2 reversenx_sync=1 uncapped_clocks=1 +gpu_dvfs_offset=0 diff --git a/switch/.overlays/FPSLocker.ovl b/switch/.overlays/FPSLocker.ovl index 9ce3f76..981f32f 100644 Binary files a/switch/.overlays/FPSLocker.ovl and b/switch/.overlays/FPSLocker.ovl differ