title_name = "Saints Row" # TU1
title_id = "545107D1" # TQ-2001
hash = [
    "2537D5F11410BE0A", # default.xex
    "2C1C83BE7103BB3D"  # PhantasyRow.xex
]
#media_id = "24367742" # Disc (USA, Europe): http://redump.org/disc/11811

[[patch]]
    name = "Tree LODs"
    desc = "Makes the game always display the high-detail models of the trees."
    author = "Tervel"
    is_enabled = false

    [[patch.f32]]
        address = 0x827cc500
        value = -1.0

[[patch]]
    name = "Enable MP actions in SP"
    desc = "Lets you perform the D-pad actions from MP in SP (tauting and healing)"
    author = "Tervel"
    is_enabled = false

    [[patch.be32]]
        address = 0x8217a468
        value = 0x60000000
    [[patch.be32]]
        address = 0x8217aaf4
        value = 0x60000000
    [[patch.be32]]
        address = 0x821779d0
        value = 0x60000000

[[patch]]
    name = "Disable Item Glow"
    desc = "Gets rid of the glow that is normally applied on dropped items such as cash and weapons"
    author = "Tervel"
    is_enabled = false

    [[patch.be32]]
        address = 0x8241b328
        value = 0x4e800020
    [[patch.be8]]
        address = 0x827cd14f
        value = 0x00

[[patch]]
    name = "Disable Aim Assist"
    author = "Tervel"
    is_enabled = false

    [[patch.be32]]
        address = 0x82079cbc
        value = 0x60000000

[[patch]]
    name = "Unlock FPS"
    author = "illusion"
    is_enabled = false

    [[patch.be32]]
        address = 0x82211ef0
        value = 0x38600000
    [[patch.be32]]
        address = 0x82211ef4
        value = 0x906bfffc

    [[patch.be32]]
        address = 0x82385700
        value = 0x38600000
    [[patch.be32]]
        address = 0x82385704
        value = 0x906bfffc

[[patch]]
    name = "Havok physics FPS fix"
    desc = "Fixes Cutscene Objects desyncing and doors teleporting on high fps, at the cost of framerates."
    author = "Clippy95" # Initially found by uzis for SR2 PC, SR1 X360 address provided by Tervel.
    is_enabled = false

    [[patch.be32]]
        address = 0x82646344
        value = 0x4bb61348 # b 0x821a768c
    [[patch.be32]]
        address = 0x821a7660
        value = 0x4e800020 # blr
    [[patch.be32]]
        address = 0x821a768c
        value = 0xd01aa69c # stfs f0,-0x5964(r26)
    [[patch.be32]]
        address = 0x821a7690
        value = 0x3c608209 # lis r3,-0x7df7
    [[patch.be32]]
        address = 0x821a7694
        value = 0xc023b6dc # lfs f1,-0x4924(r3)
    [[patch.be32]]
        address = 0x821a7698
        value = 0xc043b6bc # lfs f2,-0x4944(r3)
    [[patch.be32]]
        address = 0x821a769c
        value = 0xc083b938 # lfs f4,-0x46c8(r3)
    [[patch.be32]]
        address = 0x821a76a0
        value = 0x3c608200 # lis r3,0x820
    [[patch.be32]]
        address = 0x821a76a4
        value = 0xc0630adc # lfs f3,0xadc(r3)
    [[patch.be32]]
        address = 0x821a76a8
        value = 0xfc000840 # fcmpo cr0,f0,f1
    [[patch.be32]]
        address = 0x821a76ac
        value = 0x4080001c # bge 0x821a76c8
    [[patch.be32]]
        address = 0x821a76b0
        value = 0xfc001040 # fcmpo cr0,f0,f2
    [[patch.be32]]
        address = 0x821a76b4
        value = 0x40810014 # ble 0x821a76c8
    [[patch.be32]]
        address = 0x821a76b8
        value = 0xeca01824 # fdivs f5,f0,f3
    [[patch.be32]]
        address = 0x821a76bc
        value = 0x3c60835f # lis r3,0x835f
    [[patch.be32]]
        address = 0x821a76c0
        value = 0xd0a32684 # stfs f5,0x2684(r3)
    [[patch.be32]]
        address = 0x821a76c4
        value = 0x4849ec84 # b 0x82646348
    [[patch.be32]]
        address = 0x821a76c8
        value = 0x3c60835f # lis r3,0x835f
    [[patch.be32]]
        address = 0x821a76cc
        value = 0xd0832684 # stfs f4,0x2684(r3)
    [[patch.be32]]
        address = 0x821a76d0
        value = 0x4849ec78 # b 0x82646348
    [[patch.be32]]
        address = 0x821a76d4
        value = 0x4849ec74
    [[patch.be32]]
        address = 0x82195324
        value = 0x60000000
    [[patch.be32]]
        address = 0x8225bd8c
        value = 0x60000000

[[patch]]
    name = "Skip Logos"
    desc = "Skips the intro videos & legal disclaimers. Updated to not break loading screens."
    author = "illusion, Tervel"
    is_enabled = false

    [[patch.be32]]
        address = 0x82293344
        value = 0x3ba00003
    [[patch.be32]]
        address = 0x8220f88c
        value = 0x60000000

[[patch]]
    name = "Enable r_ugly_mode"
    desc = "Higher FPS but worse graphics. Might crash when starting a game."
    author = "Hasster"
    is_enabled = false

    [[patch.be8]]
        address = 0x835f2164
        value = 0x01
    [[patch.be32]]
        address = 0x827f7a5c
        value = 0x00000000

[[patch]]
    name = "Enable Debug Console"
    desc = "Requires keyboard_mode to be changed from 0 to 2 in the Xenia Canary config, press ~ to open and close the console."
    author = "emoose, expanded by Clippy95"
    is_enabled = false

    [[patch.be32]]
        address = 0x8265f694
        value = 0x48000aa4
    [[patch.be32]]
        address = 0x82660134
        value = 0x480b8ef9
    [[patch.be32]]
        address = 0x82660268
        value = 0x480b8e14
    [[patch.be32]]
        address = 0x8263e334
        value = 0x4bb693b0 # b 821a76e4
    [[patch.be32]]
        address = 0x821a76e4
        value = 0x8b1e000b # lbz r24,0xb(r30)
    [[patch.be32]]
        address = 0x821a76e8
        value = 0x6b180001 # xori r24,r24,0x1 # originally set to 0 to close the console window, now just xor to open/close.
    [[patch.be32]]
        address = 0x821a76ec
        value = 0x9b1e000b # stb r24,0xb(r30)
    [[patch.be32]]
        address = 0x821a76f0
        value = 0x48496c48 # b 0x8263e338
    [[patch.be32]]
        address = 0x82198b58
        value = 0x60000000
    [[patch.be32]]
        address = 0x82198b60
        value = 0x60000000
    [[patch.be32]]
        address = 0x8263d150
        value = 0x60000000
    [[patch.be32]]
        address = 0x8263d228
        value = 0x8263e330 # Allow to open/close console with ~ key
    [[patch.be32]]
        address = 0x8263d188
        value = 0x8263e224 # Stop ESC from closing/opening console.

[[patch]]
    name = "Loose VPP Content loading" # loose->dlcs->vpps
    desc = "Allows loading of loose files e.g xtbls, pegs, lua & more, just by dragging the files into the game directory without the need to pack them into VPPs, use Alternative Loose VPP Content loading only if this causes issues!"
    author = "Clippy95, Scanti"
    is_enabled = false

    [[patch.be8]]
        address = 0x821954ef
        value = 0x01
    [[patch.be8]]
        address = 0x821954f3
        value = 0x00
    [[patch.be8]]
        address = 0x8264ec43
        value = 0x01
    [[patch.be8]]
        address = 0x8264ec3b
        value = 0x01

[[patch]]
    name = "Alternative Loose VPP Content loading" # loose->vdir->dlcs->vpps
    desc = "Use this if 'Loose VPP Content loading' causes issues, DO NOT USE both patches in conjunction!"
    author = "Clippy95, Scanti, Tervel"
    is_enabled = false

    [[patch.be32]]
        address = 0x821954b0
        value = 0x480121b4
    [[patch.be32]]
        address = 0x821a7660
        value = 0x4e800020
    [[patch.be32]]
        address = 0x821a7664
        value = 0x38a00001
    [[patch.be32]]
        address = 0x821a7668
        value = 0x38800000
    [[patch.be32]]
        address = 0x821a766c
        value = 0x38800001
    [[patch.be32]]
        address = 0x821a7670
        value = 0x484a7759
    [[patch.be32]]
        address = 0x821a7674
        value = 0x38a00000
    [[patch.be32]]
        address = 0x821a7678
        value = 0x38800000
    [[patch.be32]]
        address = 0x821a7680
        value = 0x484a7749
    [[patch.be32]]
        address = 0x821a7688
        value = 0x4bfede2c
    [[patch.be8]]
        address = 0x821954ef
        value = 0x01
    [[patch.be8]]
        address = 0x821954f3
        value = 0x00

[[patch]]
    name = "Unlock All Cheats"
    desc = "Replaces Chicken Ned phone number with 1337, and unlocks all cheats when calling him."
    author = "Clippy95"
    is_enabled = false

    [[patch.array]]
        address = 0x82063d70
        value = "0x31333337000000" # 1337
    [[patch.be32]]
        address = 0x822e6ab0
        value = 0x3c608204  # lis r3, 0x8204
    [[patch.be32]]
        address = 0x822e6ab4
        value = 0x6063e528  # addi r3, r3, 0xE528 "cheats_unlock_all"
    [[patch.be32]]
        address = 0x822e6ab8
        value = 0x48356058 # call console command

[[patch]]
    name = "Aspect Ratio"
    desc = "To get proper Aspect Ratio FOV = Default * (Width/Height) / (16/9)"
    author = "Tervel"
    is_enabled = false

    [[patch.be8]]
        address = 0x827fdd2c
        value = 0x01
    [[patch.f32]]
        address = 0x8208c4b0
        value = 2.38888888889
    [[patch.f32]]
        address = 0x8208b94c # Gameplay FOV Multiplier
        value = 1.777741190  # Default: 1.3333334
    [[patch.f32]]
        address = 0x8208c818 # Cutscene FOV Multiplier
        value = 75.200706 # Default: 57.295776
    [[patch.be32]]
        address = 0x8228ee8c # NOP to prevent game from writing to UI X position.
        value = 0x60000000
    [[patch.f32]]
        address = 0x82ede18c # UI X positioning.
        value = 0.761905

[[patch]]
    name = "Set Aspect Ratio to true 21:9"
    desc = "Scales HUD correctly, Lowers resolution to 1280x540"
    author = "Tervel"
    is_enabled = false

    [[patch.be32]]
        address = 0x821952f4
        value = 0x39000500
    [[patch.be32]]
        address = 0x821952f8
        value = 0x39200224
    [[patch.be32]]
        address = 0x8219360c
        value = 0x60000000
    [[patch.be16]]
        address = 0x827f70ba
        value = 0x0224
    [[patch.be16]]
        address = 0x827f70ca
        value = 0x0224
    [[patch.be16]]
        address = 0x827f70da
        value = 0x0224
    [[patch.be16]]
        address = 0x827f70ea
        value = 0x0224
    [[patch.be16]]
        address = 0x827adb76
        value = 0x0224
    [[patch.be16]]
        address = 0x827f6f82
        value = 0x0224
    [[patch.be16]]
        address = 0x827f701e
        value = 0x0224
    [[patch.be16]]
        address = 0x827f702e
        value = 0x0224
    [[patch.f32]]
        address = 0x8208b94c # General FOV Multiplier
        value = 1.777741190
    [[patch.f32]]
        address = 0x8208c818 # Cutscene FOV Multiplier.
        value = 75.200706
    [[patch.be32]]
        address = 0x8228ee8c # NOP to prevent game from writing to UI X position.
        value = 0x60000000
    [[patch.f32]]
        address = 0x82ede18c # UI X positioning.
        value = 0.761905

[[patch]]
    name = "Better Drive Cam"
    author = "Clippy95"
    is_enabled = false

    [[patch.be32]]
        address = 0x8211d604
        value = 0x60000000
    [[patch.be32]]
        address = 0x8211d608
        value = 0x60000000
    [[patch.be32]]
        address = 0x8211d60c
        value = 0x60000000
    [[patch.be32]]
        address = 0x8211d610
        value = 0x60000000

[[patch]]
    name = "Raise vehicle camera rotation limit"
    author = "Clippy95"
    is_enabled = false

    [[patch.be32]]
        address = 0x82772d90
        value = 0xc108c88c
    [[patch.be32]]
        address = 0x8211fc8c
        value = 0xc00bc88c
    [[patch.be32]]
        address = 0x82772db0
        value = 0xc0c8b850
    [[patch.f32]]
        address = 0x8208c88c
        value = -0.5

[[patch]]
    name = "LUA debug_print to log"
    desc = "Prints mostly unused debug_print to Xenia's log, mostly useful in mod making."
    author = "Clippy95"
    is_enabled = false

    [[patch.be32]]
        address = 0x824f1164
        value = 0x482ae6f9 # bl DbgPrint
