title_name = "Gears of War 3" # Disc (TU6); XBL Marketplace (TU1)
title_id = "4D5308AB" # MS-2219
hash = "7775898137CE1CE3" # default.xex
#media_id = [
#    "4C93A17D", # XBL Marketplace (World)
#    "02EEE060", # Disc (USA)
#    "5AC92688", # Disc (Japan): http://redump.org/disc/61129
#    "6EF14DF9", # Disc (Spain): http://redump.org/disc/72050
#    "58122AD6", # Disc (World): http://redump.org/disc/55016
#]

[[patch]]
    name = "Unlock FPS"
    desc = "See note about framerate patches in the README."
    author = "illusion, boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x8254e4a8
        value = 0x60000000
    [[patch.be8]]
        address = 0x82b09e5f
        value = 0x01

[[patch]]
    name = "Disable Lens Flares"
    desc = "Fixes unoccluded bright lights on-screen."
    author = "illusion, boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x82873d28
        value = 0x39400000

[[patch]]
    name = "Disable Ambient Occlusion"
    desc = "Fixes various artifacts when using upscaling."
    author = "illusion, boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x8237271c
        value = 0x39600000
    [[patch.be32]]
        address = 0x82774444
        value = 0x39600000
    [[patch.be32]]
        address = 0x827db8b8
        value = 0x39600000

[[patch]]
    name = "Disable Motion Blur"
    desc = "Solves most ghosting and artifacting caused by quickly panning cameras."
    author = "boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x82440f60
        value = 0x39600000
    [[patch.be32]]
        address = 0x827b4c9c
        value = 0x39600000

[[patch]]
    name = "16x Anisotropic Filtering"
    author = "boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x8297a65c
        value = 0x38a00010

[[patch]]
    name = "Resolution Scaling Fix / Disable All Post-Processing"
    desc = "Dramatically changes the overall look of the game, but fixes all edge-detection overcorrection and color smearing."
    author = "boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x827cab9c
        value = 0x38a00001
    [[patch.be32]]
        address = 0x827cacf8
        value = 0x38a00000
    [[patch.be32]]
        address = 0x827cafe0
        value = 0x38800004

[[patch]]
    name = "Disable Depth of Field"
    author = "boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x8237271c
        value = 0x39600000
    [[patch.be32]]
        address = 0x824caf60
        value = 0x39600000

[[patch]]
    name = "Disable Bloom"
    author = "boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x82372718
        value = 0x39400000

[[patch]]
    name = "Performance Patch, Option A: Low Settings (No Dynamic Shadows)"
    desc = "Significantly improves performance if GPU limited. Not recommended on high-end GPUs. Most effective on NVIDIA GPUs, as it struggles with UE3 dynamic shadows when using Vulkan FBO or D3D12 RTV render paths."
    author = "Sowa_95"
    is_enabled = false

    [[patch.be32]]
        address = 0x827e0a88
        value = 0x39600000
    [[patch.be8]]
        address = 0x8237d02c # Light Environment Shadows
        value = 0x00

[[patch]]
    name = "Performance Patch, Option B: Optimized Settings (Smart Shadow Cuts)"
    desc = "Recommended for most people who want a big FPS boost without major visual loss. Some cutscenes and specific situations may be missing shadows, but the change is generally mild. Can nearly double average FPS, with the largest gains typically on NVIDIA GPUs."
    author = "boma"
    is_enabled = false

    [[patch.be32]]
        address = 0x827c9078 # Ignore occlusion queries from gumming up InitViews
        value = 0x39600001 # li r11, 1
    [[patch.be32]]
        address = 0x827caf2c # Skip allocate query pool
        value = 0x39600001 # li r11, 1
    [[patch.be32]]
        address = 0x827e2af0 # projected shadow render, gathering draw lists
        value = 0x4bb2edb0 # b 0x823118a0 code cave
    [[patch.be32]]
        address = 0x823118a0 # load flags
        value = 0x815e04e0 # lwz r10, 0x4e0(r30)
    [[patch.be32]]
        address = 0x823118a4 # whole-scene & preshadow mask
        value = 0x5549014c # rlwinm r9, r10, 0, 5, 6
    [[patch.be32]]
        address = 0x823118a8
        value = 0x2b290000 # cmplwi cr6, r9, 0
    [[patch.be32]]
        address = 0x823118ac # not per-object, allow, send back to render
        value = 0x409a000c # bne cr6 0xc
    [[patch.be32]]
        address = 0x823118b0 # not to exceed more than 20 shadow depth calls per frame
        value = 0x2f100014 # cmpwi cr6, r16, 20
    [[patch.be32]]
        address = 0x823118b4 # if more than 12, jump to skip stub
        value = 0x4098000c
    [[patch.be32]]
        address = 0x823118b8 # recreate overwritten insruction
        value = 0x396b0001 # addi r11, r16, 1
    [[patch.be32]]
        address = 0x823118bc # resume original shadow render flow
        value = 0x484d1238 # b 0x827e2af4
    [[patch.be32]]
        address = 0x823118c0 # skip stub
        value = 0x484d128c # b 0x827e2b4c
    [[patch.be32]]
        address = 0x827dcf3c # Skip pre-allocated shadow caching which blows up NVIDIA when upscaling
        value = 0x3aa00001
    [[patch.be32]]
        address = 0x829b29d4 # OneFrameRenderLag = FALSE
        value = 0x38600000

[[patch]]
    name = "Disable Coalesced hash check"
    desc = "Allows for Coalesced modifications. Not required on base version of the game."
    author = "Sowa_95"
    is_enabled = false

    [[patch.be8]]
        address = 0x82cf94b7
        value = 0x00

[[patch]]
    name = "Show FPS"
    author = "Sowa_95"
    is_enabled = false

    [[patch.be8]]
        address = 0x83439898
        value = 0x01
    [[patch.be8]]
        address = 0x834398ac # Frametime
        value = 0x01
