diff --git a/README.md b/README.md
index cc71ab86..8712e5a9 100644
--- a/README.md
+++ b/README.md
@@ -206,9 +206,10 @@ the Wine prefix. Removing the option will revert to the previous behavior.
| :-------------------- | :----------------------------- | :----------- |
| | PROTON_LOG | Convenience method for dumping a useful debug log to `$HOME/steam-$APPID.log`. For more thorough logging, use `user_settings.py`. |
| | PROTON_DUMP_DEBUG_COMMANDS | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. |
-| | PROTON_DEBUG_DIR | Root directory for the Proton debug scripts, `/tmp` by default. |
+| | PROTON_DEBUG_DIR | Root directory for the Proton debug scripts, `/tmp` by default. |
| wined3d | PROTON_USE_WINED3D | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11 and d3d10. This used to be called `PROTON_USE_WINED3D11`, which is now an alias for this same option. |
| nod3d11 | PROTON_NO_D3D11 | Disable d3d11.dll, for games which can fall back to and run better with d3d9. |
| noesync | PROTON_NO_ESYNC | Do not use eventfd-based in-process synchronization primitives. |
+| forcelgadd | PROTON_FORCE_LARGE_ADDRESS_AWARE | Force Wine to enable the LARGE_ADDRESS_AWARE flag for all executables. |
diff --git a/proton b/proton
index 46643d09..d56a5ec4 100755
--- a/proton
+++ b/proton
@@ -220,10 +220,17 @@ if not check_environment("PROTON_USE_WINED3D", "wined3d"):
check_environment("PROTON_USE_WINED3D11", "wined3d")
check_environment("PROTON_NO_D3D11", "nod3d11")
check_environment("PROTON_NO_ESYNC", "noesync")
+check_environment("PROTON_FORCE_LARGE_ADDRESS_AWARE", "forcelgadd")
if not "noesync" in config_opts:
env["WINEESYNC"] = "1"
+if "forcelgadd" in config_opts:
+ #forcelgadd should be used just for testing whether a game is helped by
+ #setting LARGE_ADDRESS_AWARE. If it does, then add an AppDefault in the
+ #registry, so that it doesn't impact every executable in the prefix.
+ env["WINE_LARGE_ADDRESS_AWARE"] = "1"
+
lfile = None
if "SteamGameId" in env:
if env["WINEDEBUG"] != "-all":
@@ -466,6 +473,8 @@ def dump_dbg_env(f):
f.write("\tWINEDLLOVERRIDES=\"" + env["WINEDLLOVERRIDES"] + "\" \\\n")
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" in env:
f.write("\tSTEAM_COMPAT_CLIENT_INSTALL_PATH=\"" + env["STEAM_COMPAT_CLIENT_INSTALL_PATH"] + "\" \\\n")
+ if "WINE_LARGE_ADDRESS_AWARE" in env:
+ f.write("\tWINE_LARGE_ADDRESS_AWARE=\"" + env["WINE_LARGE_ADDRESS_AWARE"] + "\" \\\n")
def dump_dbg_scripts():
exe_name = os.path.basename(sys.argv[2])