# NieR:Automata The End of YoRHa Edition US/EU 1.0.3
# BID: 3C10EC35C5EF4C36

DECLARATIONS:
  -
    type: variable
    name: dr_target_bad
    value_type: float
    default_value: 45
    evaluate: "1.35 * FRAMETIME_TARGET"
  -
    type: variable
    name: dr_target_optimal
    value_type: float
    default_value: 32.01
    evaluate: "0.9603 * FRAMETIME_TARGET"
  -
    type: variable
    name: dr_target_good
    value_type: float
    default_value: 30
    evaluate: "0.9 * FRAMETIME_TARGET"
MASTER_WRITE:
  # Redirect DR timings
  ## REF: 8C 46 A8 52  83 01 27 1E
  -
    type: asm_a64
    main_offset: 0x9BF434
    instructions: [
      [adrp, x12, $dr_target_bad],
      [ldr, s3, [x12, $dr_target_bad]]
    ]
  ## REF: AC 47 81 52 0C 40 A8 72, first result
  -
    type: asm_a64
    main_offset: 0x9BF484
    instructions: [
      [adrp, x12, $dr_target_optimal],
      [ldr, w12, [x12, $dr_target_optimal]]
    ]
  ## REF: AC 47 81 52 0C 40 A8 72, second result
  -
    type: asm_a64
    main_offset: 0x9BF4D4
    instructions: [
      [fcsel, s3, s4, s0, gt],
      [adrp, x12, $dr_target_optimal],
      [ldr, s0, [x12, $dr_target_optimal]],
      [adrp, x12, $dr_target_good]
    ]
  ## REF: 00 D0 27 1E 60 20 20 1E
  -
    type: asm_a64
    main_offset: 0x9BF4F8
    instructions: [
      [ldr, s0, [x12, $dr_target_good]]
    ]