# Dying Light: Platinum Edition 1.0.5
# BID: 8C93B930348C9787

DECLARATIONS:
  -
    type: variable
    name: dr_timing1
    value_type: float
    default_value: 0.034
    evaluate: "1.02 / FPS_TARGET"
  -
    type: variable
    name: dr_timing2
    value_type: float
    default_value: 0.028
    evaluate: "0.84 / FPS_TARGET"
  -
    type: variable
    name: dr_timing3
    value_type: float
    default_value: 0.0289855
    evaluate: "0.87 / FPS_TARGET"
  -
    type: variable
    name: dr_timing4
    value_type: float
    default_value: 0.0263158
    evaluate: "0.79 / FPS_TARGET"
  -
    type: variable
    name: dr_timing5
    value_type: float
    default_value: 0.0324675
    evaluate: "0.974 / FPS_TARGET"
MASTER_WRITE:
  # Disable Dynamic GPU Clocks
  -
    type: asm_a64
    main_offset: 0x1DE89CC
    instructions: [
      [nop]
    ]
  # Redirect Dynamic Resolution Timings
  -
    type: asm_a64
    main_offset: 0x1DE89A8
    instructions: [
      [adrp, x10, $dr_timing1],
      [ldr, w10, [x10, $dr_timing1]]
    ]
  -
    type: asm_a64
    main_offset: 0x1DE8A08
    instructions: [
      [adrp, x10, $dr_timing2],
      [ldr, w10, [x10, $dr_timing2]]
    ]
  -
    type: asm_a64
    main_offset: 0x1DE80C8
    instructions: [
      [adrp, x11, $dr_timing3],
      [ldr, w12, [x11, $dr_timing3]],
      [adrp, x11, $dr_timing4],
      [ldr, w11, [x11, $dr_timing4]]
    ]
  -
    type: asm_a64
    main_offset: 0x1DE80F8
    instructions: [
      [adrp, x11, $dr_timing5],
      [ldr, w11, [x11, $dr_timing5]]
    ]

