# Marvel Ultimate Alliance 3: The Black Order 4.0.1
# BID: E853C44FDF18B88F
# Credits to Hazerou for finding offsets for FPS lock and speed

DECLARATIONS:
  -
    type: variable
    name: dr_target
    value_type: float
    default_value: 0.0166666666
    evaluate: "0.5 / FPS_TARGET"
MASTER_WRITE:
# Redirect reading DR GPU time factor to MAIN + 0x4FC0E00
  -
    type: asm_a64
    main_offset: 0x470E80
    instructions: [
      [adrp, x9, $dr_target],
      [ldr, s2, [x9, $dr_target]]
    ]
ALL_FPS:
  # Internal Vsync
  -
    type: evaluate_write
    address: [MAIN, 0x45A7410]
    value_type: int32
    value: [VSYNC_TARGET, VSYNC_TARGET]
  # Game Speed = FPS
  -
    type: evaluate_write
    address: [MAIN, 0x45A71F0]
    value_type: float
    value: FPS_TARGET
