2025-09-05 17:12:01 +03:00

130 lines
3.0 KiB
YAML

# Xenoblade Chronicles 2 2.1.0
# BID: F77F1559371C0EC6
unsafeCheck: true
MASTER_WRITE:
# Dynamic speed
# Jump before pushing frame to the end of .plt, which is 0x8B3900 (backup: MOV W8, #0x21A0)
-
type: asm_a64
main_offset: 0x700164
instructions: [
[b, 0x8b3900]
]
# Game speed math, write data to unused .bss, tick at 0x15ECF00, game speed at tick at 0x15ECF08, take min delta from 0x15ECF10
-
type: asm_a64
main_offset: 0x8B3900
instructions: [
[bl, 0x8b2700],
[adrp, x2, 0x15ec000],
[ldr, x1, [x2, 0xf00]],
[str, x0, [x2, 0xf00]],
[cbnz, x1, +12],
[mov, w8, 0x21a0],
[b, 0x700168],
[sub, x0, x0, x1],
[bl, 0x8b2710],
[fmov, s2, 15.0],
[mov, w1, 1000],
[udiv, x0, x0, x1],
[scvtf, s0, x0],
[mov, w1, 0x2400],
[movk, w1, 0x4974, 16],
[fmov, s1, w1],
[b, +96],
[adrp, x0, 0xb8f000],
[ldr, x0, [x0, 0xd0]],
[cbz, x0, -56],
[str, s0, [x0, 0x78]],
[str, s0, [x0, 0x7c]],
[adrp, x0, 0xc22000],
[ldr, x0, [x0, 0x2c8]],
[str, s0, [x0, 0x80]],
[adrp, x0, 0x15ec000],
[str, s0, [x0, 0xf08]],
[b, -88],
[fmov, s1, 1.0], #
[fdiv, s2, s1, s2],
[fcmp, s0, s2],
[b.lt, +12],
[fmov, s0, s2],
[b, -64],
[adrp, x0, 0x15ec000],
[ldr, s2, [x0, 0xf10]],
[fcmp, s0, s2],
[b.hi, -80],
[fmov, s0, s2],
[b, -88],
[fdiv, s0, s0, s1],
[b, -52]
]
# Patch wind speed to take game speed from MAIN + 0x15ECF08
-
type: asm_a64
main_offset: 0x747DD8
instructions: [
[adrp, x8, 0x15ec000],
[ldr, s6, [x8, 0xf08]]
]
# Redirect DR timing to MAIN + 0x15ECF18
-
type: asm_a64
main_offset: 0x6AA14C
instructions: [
[adrp, x8, 0x15ec000],
[ldr, s0, [x8, 0xf18]]
]
# Default values
-
type: bytes
main_offset: 0x15ECF08
value_type: float
value: [0.0333333333, 0.0333333333, 0.0333333333, 0.0166666666]
ALL_FPS:
-
type: evaluate_write
address: [MAIN, 0xB74BF0]
value_type: uint32
value: ["VSYNC_TARGET", "VSYNC_TARGET"]
-
type: evaluate_write
address: [MAIN, 0x15ECF10]
value_type: float
value: "1 / FPS_TARGET"
-
type: evaluate_write
address: [MAIN, 0x15ECF18]
value_type: float
value: "(1 / FPS_TARGET) / VSYNC_TARGET"
# Cutscenes in 30 FPS
-
type: compare
compare_type: "=="
compare_value_type: uint8
compare_value: 1
compare_address: [MAIN, 0xBD7F40]
address: [MAIN]
value_type: refresh_rate
value: 30
-
type: compare
compare_type: "=="
compare_value_type: uint8
compare_value: 1
compare_address: [MAIN, 0xBD7F40]
address: [MAIN, 0x15ECF10]
value_type: float
value: 0.0333333333
-
type: compare
compare_type: "=="
compare_value_type: uint8
compare_value: 1
compare_address: [MAIN, 0xBD7F40]
address: [MAIN, 0x15ECF18]
value_type: float
value: 0.0333333333