diff --git a/README.md b/README.md index 17e9757..64087a5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ### Ultra - это функциональная кастомная прошивка для Nintendo Switch, с акцентом на разгон и улучшение пользовательского опыта. -### [UltraNX 3.1|R1+](https://github.com/Ultra-NX/UltraNX/releases/tag/3.1-R1) Поддерживает все HOS до 23.0.1 включительно +### [UltraNX 3.1|R2](https://github.com/Ultra-NX/UltraNX/releases/tag/3.1-R2) Поддерживает все HOS до 23.0.1 включительно @@ -52,7 +52,7 @@ * [sys-patch](https://github.com/impeeza/sys-patch) - Патчит систему на работу неподписанного софта вместо сигпатчей. * [Mission Control](https://github.com/ndeadly/MissionControl) - Модуль, позволяющий подключать практически любые геймпады к консоли по Bluetooth. * [sys-con](https://github.com/o0Zz/sys-con) - Модуль, позволяющий подключать практически любые геймпады к консоли по USB. - * [disable remap dialog](https://github.com/ndeadly/disable_remap_dialog) - Модуль, скрывающий предупреждение о переназначенных кнопках при каждом запуске игры. + * [disable remap dialog](https://github.com/ndeadly/mc_exefs_patches) - Модуль, скрывающий предупреждение о переназначенных кнопках при каждом запуске игры. * [Ultrahand Overlay](https://github.com/ppkantorski/Ultrahand-Overlay) - Специальное оверлей-меню для взаимодействия с системой: разгон, управление режимами через ReverseNX, включение читов, прочее. Также позволяет использовать самописные пакеты, например - Ultra Tuner. - [Horizon OC](https://github.com/Horizon-OC/Horizon-OC) - Оверлей для управления модулем sys-clk. - [Status Monitor](https://github.com/ppkantorski/Status-Monitor-Overlay) - Оверлей позволяющий следить за параметрами консоли в реальном времени. Может выступать в качестве счетчика FPS. Сменить пресет Micro-оверлея можно в Tuner. diff --git a/README_ENG.md b/README_ENG.md index bed2150..1d307cf 100644 --- a/README_ENG.md +++ b/README_ENG.md @@ -6,7 +6,7 @@ # ### Ultra is a feature-rich custom firmware for the Nintendo Switch, focused on overclocking and a smoother user experience. -### [UltraNX 3.1|R1+](https://github.com/Ultra-NX/UltraNX/releases/tag/3.1-R1) Supports all HOS up to and including 23.0.1 +### [UltraNX 3.1|R2](https://github.com/Ultra-NX/UltraNX/releases/tag/3.1-R2) Supports all HOS up to and including 23.0.1 @@ -48,7 +48,7 @@ * [sys-patch](https://github.com/impeeza/sys-patch) - Patches the system to run unsigned software instead of sigpatches. * [Mission Control](https://github.com/ndeadly/MissionControl) - A module that lets you connect almost any controller to the console via Bluetooth. * [sys-con](https://github.com/o0Zz/sys-con) - A module that allows you to connect almost any gamepads to the console via USB. - * [disable remap dialog](https://github.com/ndeadly/disable_remap_dialog) - A module that hides the remap warning every time you launch a game. + * [disable remap dialog](https://github.com/ndeadly/mc_exefs_patches) - A module that hides the remap warning every time you launch a game. * [Ultrahand Overlay](https://github.com/ppkantorski/Ultrahand-Overlay) - Special overlay-menu for interacting with the system: overclocking, controlling modes via ReverseNX, enabling cheats, etc. Also allows to use your own packages, for example, Ultra Tuner. - [Horizon OC](https://github.com/Horizon-OC/Horizon-OC) - Overlay for controlling sys-clk module. - [Status Monitor](https://github.com/ppkantorski/Status-Monitor-Overlay) - Overlay that allows you to monitor console parameters in real time. It can act as an FPS counter. You change preset of Micro-overlay appearance in Tuner. diff --git a/SaltySD/plugins/FPSLocker/patches/010020100CF62000/D3016FC0C0402DFB.yaml b/SaltySD/plugins/FPSLocker/patches/010020100CF62000/D3016FC0C0402DFB.yaml new file mode 100644 index 0000000..35b48a9 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/010020100CF62000/D3016FC0C0402DFB.yaml @@ -0,0 +1,1183 @@ +# NARUTO -나루토- 질풍전 나루티밋 스톰 4 ROAD TO BORUTO 1.1.0 +# BID: D3016FC0C0402DFB +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Gameplay timing = original 30 FPS game. Resolution unchanged (EdiZon cheats). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# pr*/rl* = script Press/Release edge of the current logic step +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: prStep + value_type: uint32 + default_value: 0 +- type: variable + name: prHold + value_type: uint32 + default_value: 0 +- type: variable + name: prEdge + value_type: uint32 + default_value: 0 +- type: variable + name: rlStep + value_type: uint32 + default_value: 0 +- type: variable + name: rlHold + value_type: uint32 + default_value: 0 +- type: variable + name: rlEdge + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step +- type: code + name: fsStart + instructions: [ + [mov, x16, 0xcdd8], + [movk, x16, 0x105, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x8440], + [movk, x9, 0x131, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x60]], + [str, w12, [x13]], + [str, w15, [x9, 0x60]], + [ldr, w12, [x9, 0x64]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x64]], + [ldr, w12, [x9, 0x70]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0xac90], + [movk, x9, 0x23c, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0xce24], + [movk, x16, 0x105, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x60]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x64]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0xac90], + [movk, x9, 0x23c, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x9010], + [movk, x9, 0xf2, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xf018], + [movk, x0, 0x23d, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x22c0], + [movk, x9, 0xf8, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0xcdd8], + [movk, x30, 0x105, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x60]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x64]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [add, x9, x9, 0xb0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0xaeb0], + [movk, x16, 0x92, 16], + [sub, x16, x30, x16], + [mov, x9, 0x99a0], + [movk, x9, 0xf9, 16], + [add, x9, x16, x9], + [br, x9], + :skip, + [ldp, x29, x30, [sp, 0x10]], + [ldr, x19, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: load Advance() and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [ldr, x0, [x8]], + [ldr, x10, [x0]], + [ldr, x8, [x10, 0xc8]], + [mov, w1, 0], + [mov, w2, 1], + [ret] + ] +# script GetPadRepeat: only in the last logic step +- type: code + name: repeatGate + instructions: [ + [ldr, w8, [x8, 0x2f8]], + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbz, w9, :o], + [mov, w8, 0], + [mov, w0, 0], + :o, + [ret] + ] + +MASTER_WRITE: +# engine starts in 60 FPS logic mode (was LDR W1, [X20, 0xC]) +- type: asm_a64 + main_offset: 0x105C2B0 + instructions: [[mov, w1, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0x105CDD4 + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0x105CE20 + instructions: [[bl, _afterLogic()]] +# ParticleDefferedRendering (was BL 0xF999A0) +- type: asm_a64 + main_offset: 0x92AEAC + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0xAC89F0 + instructions: [[sub, x9, x21, x9], [ucvtf, s0, x9], [fdiv, s0, s0, s8], [bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0xAC8A04 + value_type: uint32 + value: 0x1E216800 # fmaxnm s0, s0, s1 +- type: asm_a64 + main_offset: 0xAC8A08 + instructions: [[blr, x8], [nop], [nop]] +# engine bug: VSync counter could skip the signal when the present interval changes (black screen at boot / freeze on FPS change) +- type: asm_a64 + main_offset: 0xEEF580 + instructions: [[cbz, w9, +32], [add, w23, w23, 1], [cmp, w23, w9], [b.lo, +20], [nop]] +# "end of motion" events (frame 9999): motion length in 30 FPS frames +- type: asm_a64 + main_offset: 0x81BADC + instructions: [[mov, w7, 100], [udiv, w7, w25, w7], [nop]] +# GetPadTrigger binding: read Hold instead of Trigger +- type: asm_a64 + main_offset: 0x668F74 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x668F8C + instructions: [[ldr, w8, [x8, 0x2e8]]] +# edge = hold & ~last hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x668F94 + instructions: [[adrp, x9, $fsF], [ldr, w12, [x9, $fsR]], [cbnz, w12, +48], [ldr, w0, [x9, $fsStep]], [ldr, w10, [x9, $prStep]], [ldr, w11, [x9, $prHold]], [cmp, w10, w0], [b.eq, +20]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x668FB4 + value_type: uint32 + value: 0x0A2B028B # bic w11, w20, w11 +- type: asm_a64 + main_offset: 0x668FB8 + instructions: [[str, w0, [x9, $prStep]], [str, w20, [x9, $prHold]], [str, w11, [x9, $prEdge]], [ldr, w20, [x9, $prEdge]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# GetPadRepeat binding (was LDR W8, [X8, 0x2F8]) +- type: asm_a64 + main_offset: 0x66901C + instructions: [[bl, _repeatGate()]] +# GetPadRelease binding: release = last hold & ~hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x669094 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x6690AC + instructions: [[ldr, w8, [x8, 0x2e8]]] +- type: asm_a64 + main_offset: 0x6690B4 + instructions: [[adrp, x9, $fsF], [ldr, w12, [x9, $fsR]], [cbnz, w12, +48], [ldr, w0, [x9, $fsStep]], [ldr, w10, [x9, $rlStep]], [cmp, w10, w0], [b.eq, +24], [ldr, w11, [x9, $rlHold]]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x6690D4 + value_type: uint32 + value: 0x0A34016B # bic w11, w11, w20 +- type: asm_a64 + main_offset: 0x6690D8 + instructions: [[str, w0, [x9, $rlStep]], [str, w20, [x9, $rlHold]], [str, w11, [x9, $rlEdge]], [ldr, w20, [x9, $rlEdge]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# gameplay timing: durations stored in 30 FPS frames are converted with 30 instead of the runtime FPS (228 sites) +- type: asm_a64 + main_offset: 0x7DAE4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x853D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8BE88 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xA3088 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3188 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3284 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3384 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA60D0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA92EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA9330 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xAFF74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0018 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB00BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0160 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB2D68 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xB43D0 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xBAE7C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF30 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF6C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xE0C08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xF4024 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFC258 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10727C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10AAE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10AB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C874 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C8E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x13B8D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x153180 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1531A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x162300 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x16FB10 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x17319C + instructions: [[mov, w23, 30]] +- type: asm_a64 + main_offset: 0x1731C0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x190674 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDC0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDD4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1B32C8 + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B332C + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B8DAC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1B920C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1BD580 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1DAB68 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB84 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB330 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB3A4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB858 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDD6C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDDE0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDE08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0638 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0644 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0654 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0D70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0DE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E1298 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E302C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1ECB1C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1F4578 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4584 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4594 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200660 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x20066C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200688 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200698 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26884C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x268894 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2688EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B4F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B714 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B870 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B8AC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B994 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D6F8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D9EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DA28 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DBCC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DC98 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD8C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26E394 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E884 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E890 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E8A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26F778 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2704F0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270574 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2705C8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270614 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x288CBC + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x29C2D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x29C2E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2B41D0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2BA250 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB418 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2DB808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB81C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2E7B74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x30DE64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x313EB0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x348F84 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x38D3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E5DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E6EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E984 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38F904 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x393178 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3AC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3C50 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A8554 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3C2D40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x40C494 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x41A114 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x41F044 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C56C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C5E0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C6BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C72C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x46DA3C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4BA890 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4C92E8 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x4DEA84 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x51F6A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x51F714 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5200A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5202B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E2B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x6E2E70 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x6E2EFC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x78C0F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x7CD244 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD3F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD478 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF87C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x802AA0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x80C024 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x81BBEC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81BCF0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81CE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x820C44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C5C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821018 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82102C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82103C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821048 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830BD8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830CA8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x837DDC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838570 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83893C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838D0C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8395A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8397B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A128 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A204 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A2E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5E0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B958 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B9BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8407D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84085C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x840A10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842C20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842CD0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D24 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D50 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842DF8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84571C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B04 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A00C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A01C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A028 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x86E7D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x86FB58 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8700D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8716DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x872400 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x873F74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x876A64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x896FF4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89729C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F520 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F5B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8B6170 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8D7934 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8D9350 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8DC510 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE54 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEEC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFC8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFE8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF010 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF038 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF0D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF130 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFBC7E8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10C4F74 + instructions: [[mov, w9, 30]] diff --git a/SaltySD/plugins/FPSLocker/patches/01003F800CF5C000/D3016FC0C0402DFB.yaml b/SaltySD/plugins/FPSLocker/patches/01003F800CF5C000/D3016FC0C0402DFB.yaml new file mode 100644 index 0000000..8eab210 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01003F800CF5C000/D3016FC0C0402DFB.yaml @@ -0,0 +1,1183 @@ +# NARUTO SHIPPUDEN: Ultimate Ninja STORM 4 ROAD TO BORUTO 1.3.0 +# BID: D3016FC0C0402DFB +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Gameplay timing = original 30 FPS game. Resolution unchanged (EdiZon cheats). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# pr*/rl* = script Press/Release edge of the current logic step +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: prStep + value_type: uint32 + default_value: 0 +- type: variable + name: prHold + value_type: uint32 + default_value: 0 +- type: variable + name: prEdge + value_type: uint32 + default_value: 0 +- type: variable + name: rlStep + value_type: uint32 + default_value: 0 +- type: variable + name: rlHold + value_type: uint32 + default_value: 0 +- type: variable + name: rlEdge + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step +- type: code + name: fsStart + instructions: [ + [mov, x16, 0xcdd8], + [movk, x16, 0x105, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x8440], + [movk, x9, 0x131, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x60]], + [str, w12, [x13]], + [str, w15, [x9, 0x60]], + [ldr, w12, [x9, 0x64]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x64]], + [ldr, w12, [x9, 0x70]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0xac90], + [movk, x9, 0x23c, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0xce24], + [movk, x16, 0x105, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x60]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x64]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0xac90], + [movk, x9, 0x23c, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x9010], + [movk, x9, 0xf2, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xf018], + [movk, x0, 0x23d, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x22c0], + [movk, x9, 0xf8, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0xcdd8], + [movk, x30, 0x105, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x60]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x64]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [add, x9, x9, 0xb0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0xaeb0], + [movk, x16, 0x92, 16], + [sub, x16, x30, x16], + [mov, x9, 0x99a0], + [movk, x9, 0xf9, 16], + [add, x9, x16, x9], + [br, x9], + :skip, + [ldp, x29, x30, [sp, 0x10]], + [ldr, x19, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: load Advance() and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [ldr, x0, [x8]], + [ldr, x10, [x0]], + [ldr, x8, [x10, 0xc8]], + [mov, w1, 0], + [mov, w2, 1], + [ret] + ] +# script GetPadRepeat: only in the last logic step +- type: code + name: repeatGate + instructions: [ + [ldr, w8, [x8, 0x2f8]], + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbz, w9, :o], + [mov, w8, 0], + [mov, w0, 0], + :o, + [ret] + ] + +MASTER_WRITE: +# engine starts in 60 FPS logic mode (was LDR W1, [X20, 0xC]) +- type: asm_a64 + main_offset: 0x105C2B0 + instructions: [[mov, w1, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0x105CDD4 + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0x105CE20 + instructions: [[bl, _afterLogic()]] +# ParticleDefferedRendering (was BL 0xF999A0) +- type: asm_a64 + main_offset: 0x92AEAC + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0xAC89F0 + instructions: [[sub, x9, x21, x9], [ucvtf, s0, x9], [fdiv, s0, s0, s8], [bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0xAC8A04 + value_type: uint32 + value: 0x1E216800 # fmaxnm s0, s0, s1 +- type: asm_a64 + main_offset: 0xAC8A08 + instructions: [[blr, x8], [nop], [nop]] +# engine bug: VSync counter could skip the signal when the present interval changes (black screen at boot / freeze on FPS change) +- type: asm_a64 + main_offset: 0xEEF580 + instructions: [[cbz, w9, +32], [add, w23, w23, 1], [cmp, w23, w9], [b.lo, +20], [nop]] +# "end of motion" events (frame 9999): motion length in 30 FPS frames +- type: asm_a64 + main_offset: 0x81BADC + instructions: [[mov, w7, 100], [udiv, w7, w25, w7], [nop]] +# GetPadTrigger binding: read Hold instead of Trigger +- type: asm_a64 + main_offset: 0x668F74 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x668F8C + instructions: [[ldr, w8, [x8, 0x2e8]]] +# edge = hold & ~last hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x668F94 + instructions: [[adrp, x9, $fsF], [ldr, w12, [x9, $fsR]], [cbnz, w12, +48], [ldr, w0, [x9, $fsStep]], [ldr, w10, [x9, $prStep]], [ldr, w11, [x9, $prHold]], [cmp, w10, w0], [b.eq, +20]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x668FB4 + value_type: uint32 + value: 0x0A2B028B # bic w11, w20, w11 +- type: asm_a64 + main_offset: 0x668FB8 + instructions: [[str, w0, [x9, $prStep]], [str, w20, [x9, $prHold]], [str, w11, [x9, $prEdge]], [ldr, w20, [x9, $prEdge]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# GetPadRepeat binding (was LDR W8, [X8, 0x2F8]) +- type: asm_a64 + main_offset: 0x66901C + instructions: [[bl, _repeatGate()]] +# GetPadRelease binding: release = last hold & ~hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x669094 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x6690AC + instructions: [[ldr, w8, [x8, 0x2e8]]] +- type: asm_a64 + main_offset: 0x6690B4 + instructions: [[adrp, x9, $fsF], [ldr, w12, [x9, $fsR]], [cbnz, w12, +48], [ldr, w0, [x9, $fsStep]], [ldr, w10, [x9, $rlStep]], [cmp, w10, w0], [b.eq, +24], [ldr, w11, [x9, $rlHold]]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x6690D4 + value_type: uint32 + value: 0x0A34016B # bic w11, w11, w20 +- type: asm_a64 + main_offset: 0x6690D8 + instructions: [[str, w0, [x9, $rlStep]], [str, w20, [x9, $rlHold]], [str, w11, [x9, $rlEdge]], [ldr, w20, [x9, $rlEdge]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# gameplay timing: durations stored in 30 FPS frames are converted with 30 instead of the runtime FPS (228 sites) +- type: asm_a64 + main_offset: 0x7DAE4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x853D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8BE88 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xA3088 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3188 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3284 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3384 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA60D0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA92EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA9330 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xAFF74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0018 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB00BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0160 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB2D68 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xB43D0 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xBAE7C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF30 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF6C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xE0C08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xF4024 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFC258 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10727C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10AAE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10AB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C874 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C8E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x13B8D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x153180 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1531A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x162300 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x16FB10 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x17319C + instructions: [[mov, w23, 30]] +- type: asm_a64 + main_offset: 0x1731C0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x190674 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDC0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDD4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1B32C8 + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B332C + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B8DAC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1B920C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1BD580 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1DAB68 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB84 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB330 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB3A4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB858 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDD6C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDDE0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDE08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0638 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0644 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0654 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0D70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0DE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E1298 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E302C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1ECB1C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1F4578 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4584 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4594 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200660 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x20066C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200688 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200698 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26884C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x268894 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2688EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B4F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B714 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B870 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B8AC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B994 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D6F8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D9EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DA28 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DBCC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DC98 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD8C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26E394 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E884 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E890 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E8A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26F778 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2704F0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270574 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2705C8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270614 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x288CBC + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x29C2D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x29C2E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2B41D0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2BA250 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB418 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2DB808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB81C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2E7B74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x30DE64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x313EB0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x348F84 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x38D3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E5DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E6EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E984 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38F904 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x393178 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3AC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3C50 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A8554 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3C2D40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x40C494 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x41A114 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x41F044 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C56C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C5E0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C6BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C72C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x46DA3C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4BA890 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4C92E8 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x4DEA84 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x51F6A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x51F714 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5200A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5202B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E2B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x6E2E70 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x6E2EFC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x78C0F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x7CD244 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD3F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD478 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF87C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x802AA0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x80C024 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x81BBEC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81BCF0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81CE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x820C44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C5C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821018 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82102C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82103C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821048 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830BD8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830CA8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x837DDC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838570 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83893C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838D0C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8395A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8397B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A128 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A204 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A2E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5E0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B958 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B9BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8407D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84085C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x840A10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842C20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842CD0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D24 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D50 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842DF8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84571C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B04 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A00C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A01C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A028 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x86E7D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x86FB58 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8700D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8716DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x872400 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x873F74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x876A64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x896FF4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89729C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F520 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F5B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8B6170 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8D7934 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8D9350 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8DC510 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE54 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEEC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFC8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFE8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF010 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF038 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF0D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF130 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFBC7E8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10C4F74 + instructions: [[mov, w9, 30]] diff --git a/SaltySD/plugins/FPSLocker/patches/01005A20190A6000/1DB3976BC6F11C20.yaml b/SaltySD/plugins/FPSLocker/patches/01005A20190A6000/1DB3976BC6F11C20.yaml new file mode 100644 index 0000000..a717287 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01005A20190A6000/1DB3976BC6F11C20.yaml @@ -0,0 +1,550 @@ +# NARUTO X BORUTO Ultimate Ninja STORM CONNECTIONS 1.7.1 +# BID: 1DB3976BC6F11C20 +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Movies play in the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# mvStamp = logic step of the last movie scene update, mvForced = the game was switched to its 30 FPS mode for a movie +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: mvStamp + value_type: uint32 + default_value: 4026531840 +- type: variable + name: mvForced + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step; +# while a movie plays: one step per frame and the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode) +- type: code + name: fsStart + instructions: [ + [mov, x16, 0x2e0], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x3cb0], + [movk, x9, 0x12f, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [ldr, w11, [x17, $mvStamp]], + [ldr, w9, [x17, $fsStep]], + [sub, w9, w9, w11], + [cmp, w9, 8], + [b.hi, :nomv], + [mov, x10, 1], + [mov, x12, 0], + [ldr, w11, [x17, $mvForced]], + [cbnz, w11, :mvdone], + [mov, w11, 1], + [str, w11, [x17, $mvForced]], + [mov, w13, 30], + [b, :setfps], + :nomv, + [ldr, w11, [x17, $mvForced]], + [cbz, w11, :mvdone], + [str, w15, [x17, $mvForced]], + [mov, w13, 60], + :setfps, + [stp, x10, x12, [sp, -0x20], "!"], + [stp, x16, x30, [sp, 0x10]], + [mov, x0, 0x4668], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [cbz, x0, :nofps], + [mov, w1, w13], + [mov, x9, 0x81e8], + [movk, x9, 0x117, 16], + [add, x9, x16, x9], + [blr, x9], + :nofps, + [ldp, x16, x30, [sp, 0x10]], + [ldp, x10, x12, [sp]], + [add, sp, sp, 0x20], + [adrp, x17, $fsF], + [mov, w15, 0], + :mvdone, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x70]], + [str, w12, [x13]], + [str, w15, [x9, 0x70]], + [ldr, w12, [x9, 0x74]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x74]], + [ldr, w12, [x9, 0x80]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (particle delete queue + deferred particle deletion as after a drawn frame, clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0x2a4], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x70]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x74]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x44e8], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldrb, w9, [x9]], + [tbz, w9, 0, :nopt], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x3f30], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x5998], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + :nopt, + [mov, x9, 0xd720], + [movk, x9, 0x116, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xeb28], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x2f70], + [movk, x9, 0x11c, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0x2e0], + [movk, x30, 0xe3, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x74]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x80]], + [add, x15, x15, x12], + [add, x9, x9, 0xc0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# layer job wait: only in the first logic step of a frame (the layer threads are started only with drawing) +- type: code + name: layerWaitGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsF]], + [cbnz, w9, :skip], + [mov, w1, 0], + [mov, x10, 0x94e0], + [movk, x10, 0x87, 16], + [sub, x10, x30, x10], + [mov, x9, 0x1d7c], + [movk, x9, 0x11c, 16], + [add, x9, x10, x9], + [mov, x30, x16], + [br, x9], + :skip, + [mov, x30, x16], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0x64], + [movk, x16, 0x88, 16], + [sub, x16, x30, x16], + [mov, x20, 0x4000], + [movk, x20, 0x214, 16], + [add, x20, x16, x20], + [ret], + :skip, + [ldp, x20, x19, [sp, 0x10]], + [ldp, x30, x21, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: set its arguments and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [mov, x0, x22], + [mov, w1, 1], + [mov, w2, 1], + [ret] + ] +# particle delete queue: do not queue the same effect twice (several logic steps run before one queue flush) +- type: code + name: deleteQueueOnce + instructions: [ + [ldp, x10, x11, [x19, 0xe0]], + :l, + [cmp, x10, x11], + [b.eq, :push], + [ldr, x12, [x10, 0x8]], + [cmp, x12, x20], + [b.eq, :dup], + [add, x10, x10, 0x10], + [b, :l], + :push, + [ldp, x9, x8, [x19, 0xe8]], + [ret], + :dup, + [add, x30, x30, 0x130], + [ret] + ] +# movie draw task (exists only while a movie plays): remember the logic step +- type: code + name: movieStamp + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsStep]], + [str, w9, [x17, $mvStamp]], + [mov, x9, x30], + [mov, x30, x16], + [mov, x10, 0xc310], + [movk, x10, 0x1c6, 16], + [add, x10, x9, x10], + [ldr, x0, [x10]], + [br, x9] + ] + +MASTER_WRITE: +# logic runs in 60 FPS mode (was BL to the FPS setting getter) +- type: asm_a64 + main_offset: 0x886DC0 + instructions: [[mov, w0, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0xE302DC + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0xE302A0 + instructions: [[bl, _afterLogic()]] +# layer job wait task (was MOV W1, WZR; B 0x11C1D7C) +- type: asm_a64 + main_offset: 0x8794D8 + instructions: [[mov, x16, x30], [bl, _layerWaitGate()]] +# ParticleDefferedRendering (was ADRP X20, 0x2144000) +- type: asm_a64 + main_offset: 0x880060 + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0x96D2CC + instructions: [[bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0x96D2D4 + value_type: uint32 + value: 0x1E216900 # fmaxnm s0, s8, s1 +- type: asm_a64 + main_offset: 0x96D2D8 + instructions: [[ldr, x8, [x8, 0xc8]], [blr, x8], [nop]] +# particle delete request: queue push (was LDP X9, X8, [X19, 0xE8]) +- type: asm_a64 + main_offset: 0x11E4FEC + instructions: [[bl, _deleteQueueOnce()]] +# movie draw task (was ADRP X0, 0x2149000; LDR X0, [X0, 0x578]) +- type: asm_a64 + main_offset: 0x4DD260 + instructions: [[mov, x16, x30], [bl, _movieStamp()]] diff --git a/SaltySD/plugins/FPSLocker/patches/0100606026F12000/84E182F72EE1DA4F.yaml b/SaltySD/plugins/FPSLocker/patches/0100606026F12000/84E182F72EE1DA4F.yaml new file mode 100644 index 0000000..177952f --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100606026F12000/84E182F72EE1DA4F.yaml @@ -0,0 +1,25 @@ +# FINAL FANTASY RESONANCE 1.0.1 +# BID: 84E182F72EE1DA4F + +ALL_FPS: + # r.DynamicRes.FrameTimeBudget + - + type: evaluate_write + address: [MAIN, 0x8BE8128, 0] + value_type: float + value: ["TruncDec(FRAMETIME_TARGET, 2)", "TruncDec(FRAMETIME_TARGET, 2)"] + # r.VSync + - + type: write + address: [MAIN, 0x7C13290, 0] + value_type: int32 + value: [0, 0] + # t.MaxFPS + - + type: evaluate_write + address: [MAIN, 0x8C29B00, 0] + value_type: float + value: [FPS_LOCK_TARGET, FPS_LOCK_TARGET] + - + type: block + what: timing diff --git a/SaltySD/plugins/FPSLocker/patches/01006CF00CF60000/D3016FC0C0402DFB.yaml b/SaltySD/plugins/FPSLocker/patches/01006CF00CF60000/D3016FC0C0402DFB.yaml new file mode 100644 index 0000000..8eab210 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/01006CF00CF60000/D3016FC0C0402DFB.yaml @@ -0,0 +1,1183 @@ +# NARUTO SHIPPUDEN: Ultimate Ninja STORM 4 ROAD TO BORUTO 1.3.0 +# BID: D3016FC0C0402DFB +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Gameplay timing = original 30 FPS game. Resolution unchanged (EdiZon cheats). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# pr*/rl* = script Press/Release edge of the current logic step +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: prStep + value_type: uint32 + default_value: 0 +- type: variable + name: prHold + value_type: uint32 + default_value: 0 +- type: variable + name: prEdge + value_type: uint32 + default_value: 0 +- type: variable + name: rlStep + value_type: uint32 + default_value: 0 +- type: variable + name: rlHold + value_type: uint32 + default_value: 0 +- type: variable + name: rlEdge + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step +- type: code + name: fsStart + instructions: [ + [mov, x16, 0xcdd8], + [movk, x16, 0x105, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x8440], + [movk, x9, 0x131, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x60]], + [str, w12, [x13]], + [str, w15, [x9, 0x60]], + [ldr, w12, [x9, 0x64]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x64]], + [ldr, w12, [x9, 0x70]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0xac90], + [movk, x9, 0x23c, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0xce24], + [movk, x16, 0x105, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x60]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x64]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0xac90], + [movk, x9, 0x23c, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x9010], + [movk, x9, 0xf2, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xf018], + [movk, x0, 0x23d, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x22c0], + [movk, x9, 0xf8, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0xcdd8], + [movk, x30, 0x105, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xe620], + [movk, x9, 0x23d, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x60]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x64]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [add, x9, x9, 0xb0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0xaeb0], + [movk, x16, 0x92, 16], + [sub, x16, x30, x16], + [mov, x9, 0x99a0], + [movk, x9, 0xf9, 16], + [add, x9, x16, x9], + [br, x9], + :skip, + [ldp, x29, x30, [sp, 0x10]], + [ldr, x19, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: load Advance() and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [ldr, x0, [x8]], + [ldr, x10, [x0]], + [ldr, x8, [x10, 0xc8]], + [mov, w1, 0], + [mov, w2, 1], + [ret] + ] +# script GetPadRepeat: only in the last logic step +- type: code + name: repeatGate + instructions: [ + [ldr, w8, [x8, 0x2f8]], + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbz, w9, :o], + [mov, w8, 0], + [mov, w0, 0], + :o, + [ret] + ] + +MASTER_WRITE: +# engine starts in 60 FPS logic mode (was LDR W1, [X20, 0xC]) +- type: asm_a64 + main_offset: 0x105C2B0 + instructions: [[mov, w1, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0x105CDD4 + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0x105CE20 + instructions: [[bl, _afterLogic()]] +# ParticleDefferedRendering (was BL 0xF999A0) +- type: asm_a64 + main_offset: 0x92AEAC + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0xAC89F0 + instructions: [[sub, x9, x21, x9], [ucvtf, s0, x9], [fdiv, s0, s0, s8], [bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0xAC8A04 + value_type: uint32 + value: 0x1E216800 # fmaxnm s0, s0, s1 +- type: asm_a64 + main_offset: 0xAC8A08 + instructions: [[blr, x8], [nop], [nop]] +# engine bug: VSync counter could skip the signal when the present interval changes (black screen at boot / freeze on FPS change) +- type: asm_a64 + main_offset: 0xEEF580 + instructions: [[cbz, w9, +32], [add, w23, w23, 1], [cmp, w23, w9], [b.lo, +20], [nop]] +# "end of motion" events (frame 9999): motion length in 30 FPS frames +- type: asm_a64 + main_offset: 0x81BADC + instructions: [[mov, w7, 100], [udiv, w7, w25, w7], [nop]] +# GetPadTrigger binding: read Hold instead of Trigger +- type: asm_a64 + main_offset: 0x668F74 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x668F8C + instructions: [[ldr, w8, [x8, 0x2e8]]] +# edge = hold & ~last hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x668F94 + instructions: [[adrp, x9, $fsF], [ldr, w12, [x9, $fsR]], [cbnz, w12, +48], [ldr, w0, [x9, $fsStep]], [ldr, w10, [x9, $prStep]], [ldr, w11, [x9, $prHold]], [cmp, w10, w0], [b.eq, +20]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x668FB4 + value_type: uint32 + value: 0x0A2B028B # bic w11, w20, w11 +- type: asm_a64 + main_offset: 0x668FB8 + instructions: [[str, w0, [x9, $prStep]], [str, w20, [x9, $prHold]], [str, w11, [x9, $prEdge]], [ldr, w20, [x9, $prEdge]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# GetPadRepeat binding (was LDR W8, [X8, 0x2F8]) +- type: asm_a64 + main_offset: 0x66901C + instructions: [[bl, _repeatGate()]] +# GetPadRelease binding: release = last hold & ~hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x669094 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x6690AC + instructions: [[ldr, w8, [x8, 0x2e8]]] +- type: asm_a64 + main_offset: 0x6690B4 + instructions: [[adrp, x9, $fsF], [ldr, w12, [x9, $fsR]], [cbnz, w12, +48], [ldr, w0, [x9, $fsStep]], [ldr, w10, [x9, $rlStep]], [cmp, w10, w0], [b.eq, +24], [ldr, w11, [x9, $rlHold]]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x6690D4 + value_type: uint32 + value: 0x0A34016B # bic w11, w11, w20 +- type: asm_a64 + main_offset: 0x6690D8 + instructions: [[str, w0, [x9, $rlStep]], [str, w20, [x9, $rlHold]], [str, w11, [x9, $rlEdge]], [ldr, w20, [x9, $rlEdge]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# gameplay timing: durations stored in 30 FPS frames are converted with 30 instead of the runtime FPS (228 sites) +- type: asm_a64 + main_offset: 0x7DAE4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x853D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8BE88 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xA3088 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3188 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3284 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3384 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA60D0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA92EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA9330 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xAFF74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0018 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB00BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0160 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB2D68 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xB43D0 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xBAE7C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF30 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF6C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xE0C08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xF4024 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFC258 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10727C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10AAE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10AB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C874 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C8E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x13B8D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x153180 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1531A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x162300 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x16FB10 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x17319C + instructions: [[mov, w23, 30]] +- type: asm_a64 + main_offset: 0x1731C0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x190674 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDC0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDD4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1B32C8 + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B332C + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B8DAC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1B920C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1BD580 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1DAB68 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB84 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB330 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB3A4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB858 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDD6C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDDE0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDE08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0638 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0644 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0654 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0D70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0DE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E1298 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E302C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1ECB1C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1F4578 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4584 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4594 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200660 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x20066C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200688 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200698 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26884C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x268894 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2688EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B4F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B714 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B870 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B8AC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B994 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D6F8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D9EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DA28 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DBCC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DC98 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD8C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26E394 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E884 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E890 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E8A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26F778 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2704F0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270574 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2705C8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270614 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x288CBC + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x29C2D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x29C2E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2B41D0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2BA250 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB418 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2DB808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB81C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2E7B74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x30DE64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x313EB0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x348F84 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x38D3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E5DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E6EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E984 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38F904 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x393178 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3AC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3C50 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A8554 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3C2D40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x40C494 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x41A114 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x41F044 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C56C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C5E0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C6BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C72C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x46DA3C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4BA890 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4C92E8 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x4DEA84 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x51F6A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x51F714 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5200A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5202B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E2B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x6E2E70 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x6E2EFC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x78C0F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x7CD244 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD3F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD478 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF87C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x802AA0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x80C024 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x81BBEC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81BCF0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81CE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x820C44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C5C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821018 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82102C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82103C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821048 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830BD8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830CA8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x837DDC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838570 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83893C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838D0C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8395A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8397B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A128 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A204 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A2E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5E0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B958 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B9BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8407D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84085C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x840A10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842C20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842CD0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D24 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D50 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842DF8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84571C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B04 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A00C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A01C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A028 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x86E7D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x86FB58 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8700D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8716DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x872400 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x873F74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x876A64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x896FF4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89729C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F520 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F5B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8B6170 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8D7934 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8D9350 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8DC510 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE54 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEEC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFC8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFE8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF010 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF038 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF0D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF130 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFBC7E8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10C4F74 + instructions: [[mov, w9, 30]] diff --git a/SaltySD/plugins/FPSLocker/patches/010084D00CF5E000/D3016FC0C0402DFB.yaml b/SaltySD/plugins/FPSLocker/patches/010084D00CF5E000/D3016FC0C0402DFB.yaml new file mode 100644 index 0000000..11aa504 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/010084D00CF5E000/D3016FC0C0402DFB.yaml @@ -0,0 +1,1061 @@ +# NARUTO SHIPPUDEN: Ultimate Ninja STORM 4 ROAD TO BORUTO 1.3.0 +# BID: D3016FC0C0402DFB +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Gameplay timing = original 30 FPS game. Resolution unchanged (EdiZon cheats). +# Frame skip state lives in the unused tail of the game's .bss (main+0x498B9F00). + +DECLARATIONS: +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step +- type: code + name: fsStart + instructions: [ + [mov, x17, 0xd138], + [movk, x17, 0x4885, 16], + [add, x17, x30, x17], + [mov, w15, 0], + [str, w15, [x17, 0x0]], + [str, w15, [x17, 0x18]], + [ldr, w9, [x17, 0x1c]], + [add, w9, w9, 1], + [str, w9, [x17, 0x1c]], + [stp, x17, x30, [sp, -0x10], "!"], + [mov, x9, 0x1ad0], + [movk, x9, 0x485a, 16], + [sub, x9, x17, x9], + [blr, x9], + [ldp, x17, x30, [sp, 0]], + [add, sp, sp, 0x10], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, 0x8]], + [str, x10, [x17, 0x8]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, 0x10]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [str, x12, [x17, 0x10]], + [sub, w10, w10, 1], + [str, w10, [x17, 0x4]], + [cbz, w10, :done], + [mov, x9, 0xb8f0], + [movk, x9, 0x474d, 16], + [sub, x9, x17, x9], + [ldr, x9, [x9, 0]], + [ldr, x9, [x9, 0]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, 0x30], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x60]], + [str, w12, [x13, 0]], + [str, w15, [x9, 0x60]], + [ldr, w12, [x9, 0x64]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x64]], + [ldr, w12, [x9, 0x70]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0xf280], + [movk, x9, 0x474e, 16], + [sub, x9, x17, x9], + [ldr, x9, [x9, 0]], + [ldr, x9, [x9, 0]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, 0x60], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13, 0]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, 0x18]], + :done, + [ret], + :one, + [str, x15, [x17, 0x10]], + [str, w15, [x17, 0x4]], + [ret] + ] +# after logic tasks: run another logic step (clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x17, 0xd0ec], + [movk, x17, 0x4885, 16], + [add, x17, x30, x17], + [mov, w15, 0], + [ldr, w10, [x17, 0x4]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, 0x4]], + [mov, w9, 1], + [str, w9, [x17, 0x0]], + [ldr, w9, [x17, 0x1c]], + [add, w9, w9, 1], + [str, w9, [x17, 0x1c]], + [cbnz, w10, :norest], + [ldr, w12, [x17, 0x18]], + [cbz, w12, :norest], + [mov, x9, 0xb8f0], + [movk, x9, 0x474d, 16], + [sub, x9, x17, x9], + [ldr, x9, [x9, 0]], + [ldr, x9, [x9, 0]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, 0x30], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13, 0]], + [str, w12, [x9, 0x60]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x64]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x70]], + [add, x9, x9, 0xb0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0xf280], + [movk, x9, 0x474e, 16], + [sub, x9, x17, x9], + [ldr, x9, [x9, 0]], + [ldr, x9, [x9, 0]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfcc]], + [ldr, x9, [x9, 0xb20]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, 0x60], + :rlB, + [ldr, w12, [x13, 0]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, 0x18]], + :norest, + [stp, x17, x30, [sp, -0x10], "!"], + [mov, x9, 0xf00], + [movk, x9, 0x4899, 16], + [sub, x9, x17, x9], + [blr, x9], + [ldr, x17, [sp, 0]], + [mov, x0, 0xaef8], + [movk, x0, 0x474d, 16], + [sub, x0, x17, x0], + [ldr, x0, [x0, 0]], + [ldr, x0, [x0, 0]], + [mov, x9, 0x7c50], + [movk, x9, 0x4893, 16], + [sub, x9, x17, x9], + [blr, x9], + [ldp, x17, x30, [sp, 0]], + [add, sp, sp, 0x10], + [mov, x30, 0xd138], + [movk, x30, 0x4885, 16], + [sub, x30, x17, x30], + [ret], + :draw, + [str, w15, [x17, 0x0]], + [mov, x15, 0], + [mov, x9, 0xb8f0], + [movk, x9, 0x474d, 16], + [sub, x9, x17, x9], + [ldr, x9, [x9, 0]], + [ldr, x9, [x9, 0]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x60]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x64]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [add, x9, x9, 0xb0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, 0x20]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [mov, x17, 0xf060], + [movk, x17, 0x48f8, 16], + [add, x17, x30, x17], + [ldr, w9, [x17, 0x4]], + [cbnz, w9, :skip], + [mov, x9, 0x570], + [movk, x9, 0x4892, 16], + [sub, x9, x17, x9], + [br, x9], + :skip, + [ldp, x29, x30, [sp, 0x10]], + [ldr, x19, [sp, 0]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: load Advance() and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [mov, x17, 0x1510], + [movk, x17, 0x48df, 16], + [add, x17, x30, x17], + [mov, w9, 0], + [ldr, w10, [x17, 0x20]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [ldr, x0, [x8, 0]], + [ldr, x10, [x0, 0]], + [ldr, x8, [x10, 0xc8]], + [mov, w1, 0], + [mov, w2, 1], + [ret] + ] +# script GetPadRepeat: only in the last logic step +- type: code + name: repeatGate + instructions: [ + [ldr, w8, [x8, 0x2f8]], + [mov, x17, 0xef0], + [movk, x17, 0x4925, 16], + [add, x17, x30, x17], + [ldr, w9, [x17, 0x4]], + [cbz, w9, :o], + [mov, w8, 0], + [mov, w0, 0], + :o, + [ret] + ] + +MASTER_WRITE: +# engine starts in 60 FPS logic mode (was LDR W1, [X20, 0xC]) +- type: asm_a64 + main_offset: 0x105C2B0 + instructions: [[mov, w1, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0x105CDD4 + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0x105CE20 + instructions: [[bl, _afterLogic()]] +# ParticleDefferedRendering (was BL 0xF999A0) +- type: asm_a64 + main_offset: 0x92AEAC + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0xAC89F0 + instructions: [[sub, x9, x21, x9], [ucvtf, s0, x9], [fdiv, s0, s0, s8], [bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0xAC8A04 + value_type: uint32 + value: 0x1E216800 # fmaxnm s0, s0, s1 +- type: asm_a64 + main_offset: 0xAC8A08 + instructions: [[blr, x8], [nop], [nop]] +# engine bug: VSync counter could skip the signal when the present interval changes (black screen at boot / freeze on FPS change) +- type: asm_a64 + main_offset: 0xEEF580 + instructions: [[cbz, w9, +32], [add, w23, w23, 1], [cmp, w23, w9], [b.lo, +20], [nop]] +# "end of motion" events (frame 9999): motion length in 30 FPS frames +- type: asm_a64 + main_offset: 0x81BADC + instructions: [[mov, w7, 100], [udiv, w7, w25, w7], [nop]] +# GetPadTrigger binding: read Hold instead of Trigger +- type: asm_a64 + main_offset: 0x668F74 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x668F8C + instructions: [[ldr, w8, [x8, 0x2e8]]] +# edge = hold & ~last hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x668F94 + instructions: [[adrp, x9, 0x498b9000], [add, x9, x9, 0xf00], [ldr, w12, [x9, 0x14]], [cbnz, w12, +40], [ldr, w0, [x9, 0x2c]], [ldp, w10, w11, [x9, 0]], [cmp, w10, w0], [b.eq, +16]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x668FB4 + value_type: uint32 + value: 0x0A2B028B # bic w11, w20, w11 +- type: asm_a64 + main_offset: 0x668FB8 + instructions: [[stp, w0, w20, [x9, 0]], [str, w11, [x9, 8]], [ldr, w20, [x9, 8]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# GetPadRepeat binding (was LDR W8, [X8, 0x2F8]) +- type: asm_a64 + main_offset: 0x66901C + instructions: [[bl, _repeatGate()]] +# GetPadRelease binding: release = last hold & ~hold, once per logic step, only in the last step +- type: asm_a64 + main_offset: 0x669094 + instructions: [[ldr, x8, [x8, 0x30]]] +- type: asm_a64 + main_offset: 0x6690AC + instructions: [[ldr, w8, [x8, 0x2e8]]] +- type: asm_a64 + main_offset: 0x6690B4 + instructions: [[adrp, x9, 0x498b9000], [add, x9, x9, 0xf00], [ldr, w12, [x9, 0x14]], [cbnz, w12, +48], [ldr, w0, [x9, 0x2c]], [ldr, w10, [x9, 0x64]], [cmp, w10, w0], [b.eq, +24], [ldr, w11, [x9, 0x68]]] +# BIC is not supported by asm_a64 +- type: bytes + main_offset: 0x6690D8 + value_type: uint32 + value: 0x0A34016B # bic w11, w11, w20 +- type: asm_a64 + main_offset: 0x6690DC + instructions: [[str, w0, [x9, 0x64]], [str, w20, [x9, 0x68]], [str, w11, [x9, 0x6c]], [ldr, w20, [x9, 0x6c]], [b, 0x669024], [mov, w20, 0], [b, 0x669024]] +# gameplay timing: durations stored in 30 FPS frames are converted with 30 instead of the runtime FPS (228 sites) +- type: asm_a64 + main_offset: 0x7DAE4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x853D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8BE88 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xA3088 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3188 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3284 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA3384 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xA60D0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA92EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xA9330 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xAFF74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0018 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB00BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB0160 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xB2D68 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xB43D0 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0xBAE7C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF30 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xBAF6C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xE0C08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0xF4024 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFC258 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10727C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10AAE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x10AB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11BB58 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C874 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x11C8E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1217D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x13B8D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x153180 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1531A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x162300 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x16FB10 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x17319C + instructions: [[mov, w23, 30]] +- type: asm_a64 + main_offset: 0x1731C0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x190674 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDC0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19DDD4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x19F3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1B32C8 + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B332C + instructions: [[mov, w8, 30]] +- type: asm_a64 + main_offset: 0x1B8DAC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1B920C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1BD580 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1DAB68 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DAB84 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB330 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB3A4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DB858 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDD6C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDDE0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1DDE08 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0638 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0644 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0654 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0D70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E0DE4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E1298 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E302C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1E30C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1ECB1C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x1F4578 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4584 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x1F4594 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200660 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x20066C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200688 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x200698 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26884C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x268894 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2688EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B4F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B714 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B870 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B8AC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26B994 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D6F8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26D9EC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DA28 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DBCC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DC98 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26DD8C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x26E394 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E3B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E884 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E890 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26E8A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x26F778 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2704F0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270574 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2705C8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x270614 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x288CBC + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x29C2D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x29C2E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2B41D0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2BA250 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB418 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x2DB808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2DB81C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x2E7B74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x30DE64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x313EB0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x348F84 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x38D3C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E5DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E6EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38E984 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x38F904 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x393178 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3AC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A3C50 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3A8554 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x3C2D40 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x40C494 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x41A114 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x41F044 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C56C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C5E0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C6BC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x43C72C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x46DA3C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4BA890 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x4C92E8 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x4DEA84 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x51F6A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x51F714 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5200A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x5202B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6C8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53D6D8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E2B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x53E3A0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x6E2E70 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x6E2EFC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x78C0F4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x7CD244 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD3F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CD478 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF808 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x7CF87C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x802AA0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x80C024 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x81BBEC + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81BCF0 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x81CE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x820C44 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C5C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x820C70 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821018 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82102C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x82103C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x821048 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830BD8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x830CA8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x837DDC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838570 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83893C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x838D0C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8395A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8397B0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A128 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A204 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A2E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A3E8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5E0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83A5F4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B958 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x83B9BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8407D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84085C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x840A10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842C20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842CD0 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D24 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842D50 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x842DF8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84571C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494A8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494B4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494C4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494D4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8494E4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B04 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B10 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x849B20 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A00C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A01C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x84A028 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x86E7D4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x86FB58 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8700D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8716DC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x872400 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x873F74 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x876A64 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x896FF4 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89729C + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0BC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89A0EC + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F520 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x89F5B8 + instructions: [[mov, w0, 30]] +- type: asm_a64 + main_offset: 0x8B6170 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8D7934 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8D9350 + instructions: [[mov, w10, 30]] +- type: asm_a64 + main_offset: 0x8DC510 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE54 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE74 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEE9C + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEEC4 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFC8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DEFE8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF010 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF038 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF0D8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x8DF130 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0xFBC7E8 + instructions: [[mov, w9, 30]] +- type: asm_a64 + main_offset: 0x10C4F74 + instructions: [[mov, w9, 30]] diff --git a/SaltySD/plugins/FPSLocker/patches/0100D010190A8000/1DB3976BC6F11C20.yaml b/SaltySD/plugins/FPSLocker/patches/0100D010190A8000/1DB3976BC6F11C20.yaml new file mode 100644 index 0000000..d470c93 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100D010190A8000/1DB3976BC6F11C20.yaml @@ -0,0 +1,550 @@ +# 나루토 X 보루토 나루티밋 스톰 커넥션즈 1.7.1 +# BID: 1DB3976BC6F11C20 +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Movies play in the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# mvStamp = logic step of the last movie scene update, mvForced = the game was switched to its 30 FPS mode for a movie +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: mvStamp + value_type: uint32 + default_value: 4026531840 +- type: variable + name: mvForced + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step; +# while a movie plays: one step per frame and the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode) +- type: code + name: fsStart + instructions: [ + [mov, x16, 0x2e0], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x3cb0], + [movk, x9, 0x12f, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [ldr, w11, [x17, $mvStamp]], + [ldr, w9, [x17, $fsStep]], + [sub, w9, w9, w11], + [cmp, w9, 8], + [b.hi, :nomv], + [mov, x10, 1], + [mov, x12, 0], + [ldr, w11, [x17, $mvForced]], + [cbnz, w11, :mvdone], + [mov, w11, 1], + [str, w11, [x17, $mvForced]], + [mov, w13, 30], + [b, :setfps], + :nomv, + [ldr, w11, [x17, $mvForced]], + [cbz, w11, :mvdone], + [str, w15, [x17, $mvForced]], + [mov, w13, 60], + :setfps, + [stp, x10, x12, [sp, -0x20], "!"], + [stp, x16, x30, [sp, 0x10]], + [mov, x0, 0x4668], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [cbz, x0, :nofps], + [mov, w1, w13], + [mov, x9, 0x81e8], + [movk, x9, 0x117, 16], + [add, x9, x16, x9], + [blr, x9], + :nofps, + [ldp, x16, x30, [sp, 0x10]], + [ldp, x10, x12, [sp]], + [add, sp, sp, 0x20], + [adrp, x17, $fsF], + [mov, w15, 0], + :mvdone, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x70]], + [str, w12, [x13]], + [str, w15, [x9, 0x70]], + [ldr, w12, [x9, 0x74]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x74]], + [ldr, w12, [x9, 0x80]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (particle delete queue + deferred particle deletion as after a drawn frame, clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0x2a4], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x70]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x74]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x44e8], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldrb, w9, [x9]], + [tbz, w9, 0, :nopt], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x3f30], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x5998], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + :nopt, + [mov, x9, 0xd720], + [movk, x9, 0x116, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xeb28], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x2f70], + [movk, x9, 0x11c, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0x2e0], + [movk, x30, 0xe3, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x74]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x80]], + [add, x15, x15, x12], + [add, x9, x9, 0xc0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# layer job wait: only in the first logic step of a frame (the layer threads are started only with drawing) +- type: code + name: layerWaitGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsF]], + [cbnz, w9, :skip], + [mov, w1, 0], + [mov, x10, 0x94e0], + [movk, x10, 0x87, 16], + [sub, x10, x30, x10], + [mov, x9, 0x1d7c], + [movk, x9, 0x11c, 16], + [add, x9, x10, x9], + [mov, x30, x16], + [br, x9], + :skip, + [mov, x30, x16], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0x64], + [movk, x16, 0x88, 16], + [sub, x16, x30, x16], + [mov, x20, 0x4000], + [movk, x20, 0x214, 16], + [add, x20, x16, x20], + [ret], + :skip, + [ldp, x20, x19, [sp, 0x10]], + [ldp, x30, x21, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: set its arguments and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [mov, x0, x22], + [mov, w1, 1], + [mov, w2, 1], + [ret] + ] +# particle delete queue: do not queue the same effect twice (several logic steps run before one queue flush) +- type: code + name: deleteQueueOnce + instructions: [ + [ldp, x10, x11, [x19, 0xe0]], + :l, + [cmp, x10, x11], + [b.eq, :push], + [ldr, x12, [x10, 0x8]], + [cmp, x12, x20], + [b.eq, :dup], + [add, x10, x10, 0x10], + [b, :l], + :push, + [ldp, x9, x8, [x19, 0xe8]], + [ret], + :dup, + [add, x30, x30, 0x130], + [ret] + ] +# movie draw task (exists only while a movie plays): remember the logic step +- type: code + name: movieStamp + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsStep]], + [str, w9, [x17, $mvStamp]], + [mov, x9, x30], + [mov, x30, x16], + [mov, x10, 0xc310], + [movk, x10, 0x1c6, 16], + [add, x10, x9, x10], + [ldr, x0, [x10]], + [br, x9] + ] + +MASTER_WRITE: +# logic runs in 60 FPS mode (was BL to the FPS setting getter) +- type: asm_a64 + main_offset: 0x886DC0 + instructions: [[mov, w0, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0xE302DC + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0xE302A0 + instructions: [[bl, _afterLogic()]] +# layer job wait task (was MOV W1, WZR; B 0x11C1D7C) +- type: asm_a64 + main_offset: 0x8794D8 + instructions: [[mov, x16, x30], [bl, _layerWaitGate()]] +# ParticleDefferedRendering (was ADRP X20, 0x2144000) +- type: asm_a64 + main_offset: 0x880060 + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0x96D2CC + instructions: [[bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0x96D2D4 + value_type: uint32 + value: 0x1E216900 # fmaxnm s0, s8, s1 +- type: asm_a64 + main_offset: 0x96D2D8 + instructions: [[ldr, x8, [x8, 0xc8]], [blr, x8], [nop]] +# particle delete request: queue push (was LDP X9, X8, [X19, 0xE8]) +- type: asm_a64 + main_offset: 0x11E4FEC + instructions: [[bl, _deleteQueueOnce()]] +# movie draw task (was ADRP X0, 0x2149000; LDR X0, [X0, 0x578]) +- type: asm_a64 + main_offset: 0x4DD260 + instructions: [[mov, x16, x30], [bl, _movieStamp()]] diff --git a/SaltySD/plugins/FPSLocker/patches/0100D2D0190A4000/1DB3976BC6F11C20.yaml b/SaltySD/plugins/FPSLocker/patches/0100D2D0190A4000/1DB3976BC6F11C20.yaml new file mode 100644 index 0000000..a717287 --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100D2D0190A4000/1DB3976BC6F11C20.yaml @@ -0,0 +1,550 @@ +# NARUTO X BORUTO Ultimate Ninja STORM CONNECTIONS 1.7.1 +# BID: 1DB3976BC6F11C20 +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Movies play in the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# mvStamp = logic step of the last movie scene update, mvForced = the game was switched to its 30 FPS mode for a movie +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: mvStamp + value_type: uint32 + default_value: 4026531840 +- type: variable + name: mvForced + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step; +# while a movie plays: one step per frame and the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode) +- type: code + name: fsStart + instructions: [ + [mov, x16, 0x2e0], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x3cb0], + [movk, x9, 0x12f, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [ldr, w11, [x17, $mvStamp]], + [ldr, w9, [x17, $fsStep]], + [sub, w9, w9, w11], + [cmp, w9, 8], + [b.hi, :nomv], + [mov, x10, 1], + [mov, x12, 0], + [ldr, w11, [x17, $mvForced]], + [cbnz, w11, :mvdone], + [mov, w11, 1], + [str, w11, [x17, $mvForced]], + [mov, w13, 30], + [b, :setfps], + :nomv, + [ldr, w11, [x17, $mvForced]], + [cbz, w11, :mvdone], + [str, w15, [x17, $mvForced]], + [mov, w13, 60], + :setfps, + [stp, x10, x12, [sp, -0x20], "!"], + [stp, x16, x30, [sp, 0x10]], + [mov, x0, 0x4668], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [cbz, x0, :nofps], + [mov, w1, w13], + [mov, x9, 0x81e8], + [movk, x9, 0x117, 16], + [add, x9, x16, x9], + [blr, x9], + :nofps, + [ldp, x16, x30, [sp, 0x10]], + [ldp, x10, x12, [sp]], + [add, sp, sp, 0x20], + [adrp, x17, $fsF], + [mov, w15, 0], + :mvdone, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x70]], + [str, w12, [x13]], + [str, w15, [x9, 0x70]], + [ldr, w12, [x9, 0x74]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x74]], + [ldr, w12, [x9, 0x80]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (particle delete queue + deferred particle deletion as after a drawn frame, clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0x2a4], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x70]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x74]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x44e8], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldrb, w9, [x9]], + [tbz, w9, 0, :nopt], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x3f30], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x5998], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + :nopt, + [mov, x9, 0xd720], + [movk, x9, 0x116, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xeb28], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x2f70], + [movk, x9, 0x11c, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0x2e0], + [movk, x30, 0xe3, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x74]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x80]], + [add, x15, x15, x12], + [add, x9, x9, 0xc0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# layer job wait: only in the first logic step of a frame (the layer threads are started only with drawing) +- type: code + name: layerWaitGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsF]], + [cbnz, w9, :skip], + [mov, w1, 0], + [mov, x10, 0x94e0], + [movk, x10, 0x87, 16], + [sub, x10, x30, x10], + [mov, x9, 0x1d7c], + [movk, x9, 0x11c, 16], + [add, x9, x10, x9], + [mov, x30, x16], + [br, x9], + :skip, + [mov, x30, x16], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0x64], + [movk, x16, 0x88, 16], + [sub, x16, x30, x16], + [mov, x20, 0x4000], + [movk, x20, 0x214, 16], + [add, x20, x16, x20], + [ret], + :skip, + [ldp, x20, x19, [sp, 0x10]], + [ldp, x30, x21, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: set its arguments and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [mov, x0, x22], + [mov, w1, 1], + [mov, w2, 1], + [ret] + ] +# particle delete queue: do not queue the same effect twice (several logic steps run before one queue flush) +- type: code + name: deleteQueueOnce + instructions: [ + [ldp, x10, x11, [x19, 0xe0]], + :l, + [cmp, x10, x11], + [b.eq, :push], + [ldr, x12, [x10, 0x8]], + [cmp, x12, x20], + [b.eq, :dup], + [add, x10, x10, 0x10], + [b, :l], + :push, + [ldp, x9, x8, [x19, 0xe8]], + [ret], + :dup, + [add, x30, x30, 0x130], + [ret] + ] +# movie draw task (exists only while a movie plays): remember the logic step +- type: code + name: movieStamp + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsStep]], + [str, w9, [x17, $mvStamp]], + [mov, x9, x30], + [mov, x30, x16], + [mov, x10, 0xc310], + [movk, x10, 0x1c6, 16], + [add, x10, x9, x10], + [ldr, x0, [x10]], + [br, x9] + ] + +MASTER_WRITE: +# logic runs in 60 FPS mode (was BL to the FPS setting getter) +- type: asm_a64 + main_offset: 0x886DC0 + instructions: [[mov, w0, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0xE302DC + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0xE302A0 + instructions: [[bl, _afterLogic()]] +# layer job wait task (was MOV W1, WZR; B 0x11C1D7C) +- type: asm_a64 + main_offset: 0x8794D8 + instructions: [[mov, x16, x30], [bl, _layerWaitGate()]] +# ParticleDefferedRendering (was ADRP X20, 0x2144000) +- type: asm_a64 + main_offset: 0x880060 + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0x96D2CC + instructions: [[bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0x96D2D4 + value_type: uint32 + value: 0x1E216900 # fmaxnm s0, s8, s1 +- type: asm_a64 + main_offset: 0x96D2D8 + instructions: [[ldr, x8, [x8, 0xc8]], [blr, x8], [nop]] +# particle delete request: queue push (was LDP X9, X8, [X19, 0xE8]) +- type: asm_a64 + main_offset: 0x11E4FEC + instructions: [[bl, _deleteQueueOnce()]] +# movie draw task (was ADRP X0, 0x2149000; LDR X0, [X0, 0x578]) +- type: asm_a64 + main_offset: 0x4DD260 + instructions: [[mov, x16, x30], [bl, _movieStamp()]] diff --git a/SaltySD/plugins/FPSLocker/patches/0100FA10190A0000/1DB3976BC6F11C20.yaml b/SaltySD/plugins/FPSLocker/patches/0100FA10190A0000/1DB3976BC6F11C20.yaml new file mode 100644 index 0000000..ad9983e --- /dev/null +++ b/SaltySD/plugins/FPSLocker/patches/0100FA10190A0000/1DB3976BC6F11C20.yaml @@ -0,0 +1,550 @@ +# NARUTO X BORUTO ナルティメットストームコネクションズ 1.7.1 +# BID: 1DB3976BC6F11C20 +# FPS-independent game speed (frame skip): set any FPS target (20-60), FPS can be changed in-game. +# Logic always runs 60 steps/s; missing steps are run before each drawn frame. +# Movies play in the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode). +# Frame skip state is kept in DECLARATIONS variables. + +DECLARATIONS: +# frame skip state: F = repeated logic step, R = logic steps left, tick/acc = time, Saved/save* = hidden button edges, Step = logic step counter, Press = press delivered in this step; +# mvStamp = logic step of the last movie scene update, mvForced = the game was switched to its 30 FPS mode for a movie +- type: variable + name: fsF + value_type: uint32 + default_value: 0 +- type: variable + name: fsR + value_type: uint32 + default_value: 0 +- type: variable + name: fsTick + value_type: uint64 + default_value: 0 +- type: variable + name: fsAcc + value_type: int64 + default_value: 0 +- type: variable + name: fsSaved + value_type: uint32 + default_value: 0 +- type: variable + name: fsStep + value_type: uint32 + default_value: 0 +- type: variable + name: fsPress + value_type: uint32 + default_value: 0 +- type: variable + name: mvStamp + value_type: uint32 + default_value: 4026531840 +- type: variable + name: mvForced + value_type: uint32 + default_value: 0 +- type: variable + name: saveA0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveA4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB0 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB1 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB2 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB3 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB4 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB5 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB6 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB7 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB8 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB9 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB10 + value_type: uint64 + default_value: 0 +- type: variable + name: saveB11 + value_type: uint64 + default_value: 0 +# frame start: measure time, decide how many logic steps to run, hide button edges until the last step; +# while a movie plays: one step per frame and the game's own 30 FPS mode (its movie playback flickers in the 60 FPS mode) +- type: code + name: fsStart + instructions: [ + [mov, x16, 0x2e0], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [str, w15, [x17, $fsF]], + [str, w15, [x17, $fsSaved]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x3cb0], + [movk, x9, 0x12f, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [adrp, x17, $fsF], + [mov, w15, 0], + [mov, x10, x0], + [ldr, x11, [x17, $fsTick]], + [str, x10, [x17, $fsTick]], + [cbz, x11, :one], + [sub, x11, x10, x11], + [ldr, x12, [x17, $fsAcc]], + [add, x12, x12, x11], + [mov, x9, 0xe200], + [movk, x9, 0x4, 16], + [sdiv, x10, x12, x9], + [cmp, x10, 1], + [b.ge, :c1], + [mov, x10, 1], + :c1, + [cmp, x10, 4], + [b.le, :ok], + [mov, x10, 4], + [mov, x12, 0], + [b, :store], + :ok, + [mul, x13, x10, x9], + [sub, x12, x12, x13], + [mov, x13, 0], + [sub, x13, x13, x9], + [cmp, x12, x13], + [csel, x12, x12, x13, ge], + :store, + [ldr, w11, [x17, $mvStamp]], + [ldr, w9, [x17, $fsStep]], + [sub, w9, w9, w11], + [cmp, w9, 8], + [b.hi, :nomv], + [mov, x10, 1], + [mov, x12, 0], + [ldr, w11, [x17, $mvForced]], + [cbnz, w11, :mvdone], + [mov, w11, 1], + [str, w11, [x17, $mvForced]], + [mov, w13, 30], + [b, :setfps], + :nomv, + [ldr, w11, [x17, $mvForced]], + [cbz, w11, :mvdone], + [str, w15, [x17, $mvForced]], + [mov, w13, 60], + :setfps, + [stp, x10, x12, [sp, -0x20], "!"], + [stp, x16, x30, [sp, 0x10]], + [mov, x0, 0x4668], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [cbz, x0, :nofps], + [mov, w1, w13], + [mov, x9, 0x81e8], + [movk, x9, 0x117, 16], + [add, x9, x16, x9], + [blr, x9], + :nofps, + [ldp, x16, x30, [sp, 0x10]], + [ldp, x10, x12, [sp]], + [add, sp, sp, 0x20], + [adrp, x17, $fsF], + [mov, w15, 0], + :mvdone, + [str, x12, [x17, $fsAcc]], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [cbz, w10, :done], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :slA, + [ldr, w12, [x9, 0x70]], + [str, w12, [x13]], + [str, w15, [x9, 0x70]], + [ldr, w12, [x9, 0x74]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x74]], + [ldr, w12, [x9, 0x80]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slA], + :sA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :sB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :sB], + [cbz, w14, :sB], + [cmp, w14, 8], + [b.le, :snb], + [mov, w14, 8], + :snb, + [add, x13, x17, $saveB0], + :slB, + [ldr, w12, [x9, 0x10]], + [str, w12, [x13]], + [str, w15, [x9, 0x10]], + [ldr, w12, [x9, 0x14]], + [str, w12, [x13, 4]], + [str, w15, [x9, 0x14]], + [ldr, w12, [x9, 0x20]], + [str, w12, [x13, 8]], + [str, w15, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :slB], + :sB, + [mov, w12, 1], + [str, w12, [x17, $fsSaved]], + :done, + [ret], + :one, + [str, x15, [x17, $fsAcc]], + [str, w15, [x17, $fsR]], + [ret] + ] +# after logic tasks: run another logic step (particle delete queue + deferred particle deletion as after a drawn frame, clear draw lists, show button edges in the last step) or continue to drawing +- type: code + name: afterLogic + instructions: [ + [mov, x16, 0x2a4], + [movk, x16, 0xe3, 16], + [sub, x16, x30, x16], + [adrp, x17, $fsF], + [mov, w15, 0], + [ldr, w10, [x17, $fsR]], + [cbz, w10, :draw], + [sub, w10, w10, 1], + [str, w10, [x17, $fsR]], + [mov, w9, 1], + [str, w9, [x17, $fsF]], + [ldr, w9, [x17, $fsStep]], + [add, w9, w9, 1], + [str, w9, [x17, $fsStep]], + [cbnz, w10, :norest], + [ldr, w12, [x17, $fsSaved]], + [cbz, w12, :norest], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rA], + [add, x9, x9, 0x10], + [add, x13, x17, $saveA0], + [mov, w14, 3], + :rlA, + [ldr, w12, [x13]], + [str, w12, [x9, 0x70]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x74]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x80]], + [add, x9, x9, 0xc0], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlA], + :rA, + [mov, x9, 0x4668], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :rB], + [ldrb, w14, [x9, 0xfdc]], + [ldr, x9, [x9, 0xb38]], + [cbz, x9, :rB], + [cbz, w14, :rB], + [cmp, w14, 8], + [b.le, :rnb], + [mov, w14, 8], + :rnb, + [add, x13, x17, $saveB0], + :rlB, + [ldr, w12, [x13]], + [str, w12, [x9, 0x10]], + [ldr, w12, [x13, 4]], + [str, w12, [x9, 0x14]], + [ldr, w12, [x13, 8]], + [str, w12, [x9, 0x20]], + [add, x9, x9, 0x60], + [add, x13, x13, 0xc], + [sub, w14, w14, 1], + [cbnz, w14, :rlB], + :rB, + [str, w15, [x17, $fsSaved]], + :norest, + [stp, x16, x30, [sp, -0x10], "!"], + [mov, x9, 0x44e8], + [movk, x9, 0x214, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldrb, w9, [x9]], + [tbz, w9, 0, :nopt], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x3f30], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0x44f0], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [mov, x9, 0x5998], + [movk, x9, 0x11e, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + :nopt, + [mov, x9, 0xd720], + [movk, x9, 0x116, 16], + [add, x9, x16, x9], + [blr, x9], + [ldr, x16, [sp]], + [mov, x0, 0xeb28], + [movk, x0, 0x214, 16], + [add, x0, x16, x0], + [ldr, x0, [x0]], + [ldr, x0, [x0]], + [mov, x9, 0x2f70], + [movk, x9, 0x11c, 16], + [add, x9, x16, x9], + [blr, x9], + [ldp, x16, x30, [sp]], + [add, sp, sp, 0x10], + [mov, x30, 0x2e0], + [movk, x30, 0xe3, 16], + [add, x30, x16, x30], + [ret], + :draw, + [str, w15, [x17, $fsF]], + [mov, x15, 0], + [mov, x9, 0xda70], + [movk, x9, 0x215, 16], + [add, x9, x16, x9], + [ldr, x9, [x9]], + [ldr, x9, [x9]], + [cbz, x9, :tz], + [add, x9, x9, 0x10], + [mov, w14, 3], + :tl, + [ldr, w12, [x9, 0x70]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x74]], + [add, x15, x15, x12], + [ldr, w12, [x9, 0x80]], + [add, x15, x15, x12], + [add, x9, x9, 0xc0], + [sub, w14, w14, 1], + [cbnz, w14, :tl], + :tz, + [cbz, x15, :nf], + [mov, x15, 1], + :nf, + [str, w15, [x17, $fsPress]], + [ldr, x0, [x19, 0x58]], + [ret] + ] +# layer job wait: only in the first logic step of a frame (the layer threads are started only with drawing) +- type: code + name: layerWaitGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsF]], + [cbnz, w9, :skip], + [mov, w1, 0], + [mov, x10, 0x94e0], + [movk, x10, 0x87, 16], + [sub, x10, x30, x10], + [mov, x9, 0x1d7c], + [movk, x9, 0x11c, 16], + [add, x9, x10, x9], + [mov, x30, x16], + [br, x9], + :skip, + [mov, x30, x16], + [ret] + ] +# ParticleDefferedRendering task: run only in the last logic step +- type: code + name: pdrGate + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsR]], + [cbnz, w9, :skip], + [mov, x16, 0x64], + [movk, x16, 0x88, 16], + [sub, x16, x30, x16], + [mov, x20, 0x4000], + [movk, x20, 0x214, 16], + [add, x20, x16, x20], + [ret], + :skip, + [ldp, x20, x19, [sp, 0x10]], + [ldp, x30, x21, [sp]], + [add, sp, sp, 0x20], + [ret] + ] +# Scaleform Advance: set its arguments and return the minimum dt (1/30 s) in a frame that delivers a button press +- type: code + name: flashDt + instructions: [ + [adrp, x17, $fsF], + [mov, w9, 0], + [ldr, w10, [x17, $fsPress]], + [cbz, w10, :o], + [movk, w9, 0x8889, 0], + [movk, w9, 0x3d08, 16], + :o, + [mov, x0, x22], + [mov, w1, 1], + [mov, w2, 1], + [ret] + ] +# particle delete queue: do not queue the same effect twice (several logic steps run before one queue flush) +- type: code + name: deleteQueueOnce + instructions: [ + [ldp, x10, x11, [x19, 0xe0]], + :l, + [cmp, x10, x11], + [b.eq, :push], + [ldr, x12, [x10, 0x8]], + [cmp, x12, x20], + [b.eq, :dup], + [add, x10, x10, 0x10], + [b, :l], + :push, + [ldp, x9, x8, [x19, 0xe8]], + [ret], + :dup, + [add, x30, x30, 0x130], + [ret] + ] +# movie draw task (exists only while a movie plays): remember the logic step +- type: code + name: movieStamp + instructions: [ + [adrp, x17, $fsF], + [ldr, w9, [x17, $fsStep]], + [str, w9, [x17, $mvStamp]], + [mov, x9, x30], + [mov, x30, x16], + [mov, x10, 0xc310], + [movk, x10, 0x1c6, 16], + [add, x10, x9, x10], + [ldr, x0, [x10]], + [br, x9] + ] + +MASTER_WRITE: +# logic runs in 60 FPS mode (was BL to the FPS setting getter) +- type: asm_a64 + main_offset: 0x886DC0 + instructions: [[mov, w0, 60]] +# frame start (was BL to an empty function) +- type: asm_a64 + main_offset: 0xE302DC + instructions: [[bl, _fsStart()]] +# after logic tasks (was LDR X0, [X19, 0x58]) +- type: asm_a64 + main_offset: 0xE302A0 + instructions: [[bl, _afterLogic()]] +# layer job wait task (was MOV W1, WZR; B 0x11C1D7C) +- type: asm_a64 + main_offset: 0x8794D8 + instructions: [[mov, x16, x30], [bl, _layerWaitGate()]] +# ParticleDefferedRendering (was ADRP X20, 0x2144000) +- type: asm_a64 + main_offset: 0x880060 + instructions: [[bl, _pdrGate()]] +# Scaleform movies: dt = max(real dt, 1/30) in a frame with a button press (fixes button polling) +- type: asm_a64 + main_offset: 0x96D2CC + instructions: [[bl, _flashDt()], [fmov, s1, w9]] +# FMAXNM is not supported by asm_a64 +- type: bytes + main_offset: 0x96D2D4 + value_type: uint32 + value: 0x1E216900 # fmaxnm s0, s8, s1 +- type: asm_a64 + main_offset: 0x96D2D8 + instructions: [[ldr, x8, [x8, 0xc8]], [blr, x8], [nop]] +# particle delete request: queue push (was LDP X9, X8, [X19, 0xE8]) +- type: asm_a64 + main_offset: 0x11E4FEC + instructions: [[bl, _deleteQueueOnce()]] +# movie draw task (was ADRP X0, 0x2149000; LDR X0, [X0, 0x578]) +- type: asm_a64 + main_offset: 0x4DD260 + instructions: [[mov, x16, x30], [bl, _movieStamp()]] diff --git a/atmosphere/kips/hoc.kip b/atmosphere/kips/hoc.kip index 0c7e6b7..cb23a0f 100644 Binary files a/atmosphere/kips/hoc.kip and b/atmosphere/kips/hoc.kip differ diff --git a/atmosphere/package3 b/atmosphere/package3 index f3811d0..700607f 100644 Binary files a/atmosphere/package3 and b/atmosphere/package3 differ diff --git a/switch/.overlays/FPSLocker.ovl b/switch/.overlays/FPSLocker.ovl index 1b31b92..1129830 100644 Binary files a/switch/.overlays/FPSLocker.ovl and b/switch/.overlays/FPSLocker.ovl differ diff --git a/switch/DBI/DBI.nro b/switch/DBI/DBI.nro index 378de3c..66906f0 100644 Binary files a/switch/DBI/DBI.nro and b/switch/DBI/DBI.nro differ