Commit a4359341 authored by Mikhail Tergoev's avatar Mikhail Tergoev

Gamemoderun fix

parent a1ca24cf
......@@ -15,8 +15,6 @@ import tarfile
from filelock import FileLock
#To enable debug logging, copy "user_settings.sample.py" to "user_settings.py"
#and edit it if needed.
CURRENT_PREFIX_VERSION="5.6-GE-2"
......@@ -98,7 +96,6 @@ class Proton:
self.fonts_dir = self.path("dist/share/fonts/")
self.version_file = self.path("version")
self.default_pfx_dir = self.path("dist/share/default_pfx/")
self.user_settings_file = self.path("user_settings.py")
self.wine_bin = self.bin_dir + "wine"
self.wineserver_bin = self.bin_dir + "wineserver"
self.dist_lock = FileLock(self.path("dist.lock"), timeout=-1)
......@@ -385,24 +382,6 @@ class Session:
def init_session(self):
self.env["WINEPREFIX"] = g_compatdata.prefix_dir
#load environment overrides
if os.path.exists(g_proton.user_settings_file):
try:
import user_settings
for key, value in user_settings.user_settings.items():
self.env.setdefault(key, value)
except:
log("************************************************")
log("THERE IS AN ERROR IN YOUR user_settings.py FILE:")
log("%s" % sys.exc_info()[1])
log("************************************************")
if "PROTON_LOG" in self.env and nonzero(self.env["PROTON_LOG"]):
# self.env.setdefault("WINEDEBUG", "+timestamp,+pid,+tid,+seh,+debugstr,+loaddll,+mscoree")
self.env.setdefault("DXVK_LOG_LEVEL", "info")
self.env.setdefault("VKD3D_DEBUG", "warn")
self.env.setdefault("WINE_MONO_TRACE", "E:System.NotImplementedException")
#default wine-mono override for FNA games
self.env.setdefault("WINE_MONO_OVERRIDES", "Microsoft.Xna.Framework.*,Gac=n")
......@@ -474,96 +453,11 @@ class Session:
f.write("\tWINEESYNC=\"" + self.env["WINEESYNC"] + "\" \\\n")
if "WINEFSYNC" in self.env:
f.write("\tWINEFSYNC=\"" + self.env["WINEFSYNC"] + "\" \\\n")
if "SteamGameId" in self.env:
f.write("\tSteamGameId=\"" + self.env["SteamGameId"] + "\" \\\n")
if "SteamAppId" in self.env:
f.write("\tSteamAppId=\"" + self.env["SteamAppId"] + "\" \\\n")
if "WINEDLLOVERRIDES" in self.env:
f.write("\tWINEDLLOVERRIDES=\"" + self.env["WINEDLLOVERRIDES"] + "\" \\\n")
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" in self.env:
f.write("\tSTEAM_COMPAT_CLIENT_INSTALL_PATH=\"" + self.env["STEAM_COMPAT_CLIENT_INSTALL_PATH"] + "\" \\\n")
if "WINE_LARGE_ADDRESS_AWARE" in self.env:
f.write("\tWINE_LARGE_ADDRESS_AWARE=\"" + self.env["WINE_LARGE_ADDRESS_AWARE"] + "\" \\\n")
def dump_dbg_scripts(self):
exe_name = os.path.basename(sys.argv[2])
tmpdir = self.env.get("PROTON_DEBUG_DIR", "/tmp") + "/proton_" + os.environ["USER"] + "/"
makedirs(tmpdir)
with open(tmpdir + "winedbg", "w") as f:
f.write("#!/bin/bash\n")
f.write("#Run winedbg with args\n\n")
f.write("cd \"" + os.getcwd() + "\"\n")
self.dump_dbg_env(f)
f.write("\t\"" + g_proton.wine_bin + "\" winedbg \"$@\"\n")
os.chmod(tmpdir + "winedbg", 0o755)
with open(tmpdir + "winedbg_run", "w") as f:
f.write("#!/bin/bash\n")
f.write("#Run winedbg and prepare to run game or given program\n\n")
f.write("cd \"" + os.getcwd() + "\"\n")
f.write("DEF_CMD=(")
first = True
for arg in sys.argv[2:]:
if first:
f.write("\"" + arg + "\"")
first = False
else:
f.write(" \"" + arg + "\"")
f.write(")\n")
self.dump_dbg_env(f)
f.write("\t\"" + g_proton.wine_bin + "\" winedbg \"${@:-${DEF_CMD[@]}}\"\n")
os.chmod(tmpdir + "winedbg_run", 0o755)
with open(tmpdir + "gdb_attach", "w") as f:
f.write("#!/bin/bash\n")
f.write("#Run winedbg in gdb mode and auto-attach to already-running program\n\n")
f.write("cd \"" + os.getcwd() + "\"\n")
f.write("EXE_NAME=${1:-\"" + exe_name + "\"}\n")
f.write("WPID_HEX=$(\"" + tmpdir + "winedbg\" --command 'info process' | grep -i \"$EXE_NAME\" | cut -f2 -d' ' | tr -d '0')\n")
f.write("if [ -z \"$WPID_HEX\" ]; then \n")
f.write(" echo \"Program does not appear to be running: \\\"$EXE_NAME\\\"\"\n")
f.write(" exit 1\n")
f.write("fi\n")
f.write("WPID_DEC=$(printf %d 0x$WPID_HEX)\n")
self.dump_dbg_env(f)
f.write("\t\"" + g_proton.wine_bin + "\" winedbg --gdb $WPID_DEC\n")
os.chmod(tmpdir + "gdb_attach", 0o755)
with open(tmpdir + "gdb_run", "w") as f:
f.write("#!/bin/bash\n")
f.write("#Run winedbg in gdb mode and prepare to run game or given program\n\n")
f.write("cd \"" + os.getcwd() + "\"\n")
f.write("DEF_CMD=(")
first = True
for arg in sys.argv[2:]:
if first:
f.write("\"" + arg + "\"")
first = False
else:
f.write(" \"" + arg + "\"")
f.write(")\n")
self.dump_dbg_env(f)
f.write("\t\"" + g_proton.wine_bin + "\" winedbg --gdb \"${@:-${DEF_CMD[@]}}\"\n")
os.chmod(tmpdir + "gdb_run", 0o755)
with open(tmpdir + "run", "w") as f:
f.write("#!/bin/bash\n")
f.write("#Run game or given command in environment\n\n")
f.write("cd \"" + os.getcwd() + "\"\n")
f.write("DEF_CMD=(")
first = True
for arg in sys.argv[2:]:
if first:
f.write("\"" + arg + "\"")
first = False
else:
f.write(" \"" + arg + "\"")
f.write(")\n")
self.dump_dbg_env(f)
f.write("\t\"" + g_proton.wine_bin + "\" steam.exe \"${@:-${DEF_CMD[@]}}\"\n")
os.chmod(tmpdir + "run", 0o755)
def run_proc(self, args, local_env=None):
if local_env is None:
......@@ -573,7 +467,6 @@ class Session:
def run(self):
self.run_proc([g_proton.wine_bin] + sys.argv[2:] + self.cmdlineappend)
if __name__ == "__main__":
if not "STEAM_COMPAT_DATA_PATH" in os.environ:
log("No compat data path?")
......@@ -595,19 +488,6 @@ if __name__ == "__main__":
if sys.argv[1] == "run":
#start target app
g_session.run()
elif sys.argv[1] == "waitforexitandrun":
#wait for wineserver to shut down
g_session.run_proc([g_proton.wineserver_bin, "-w"])
#then run
g_session.run()
elif sys.argv[1] == "getcompatpath":
#linux -> windows path
path = subprocess.check_output([g_proton.wine_bin, "winepath", "-w", sys.argv[2]], env=g_session.env, stderr=g_session.log_file)
sys.stdout.buffer.write(path)
elif sys.argv[1] == "getnativepath":
#windows -> linux path
path = subprocess.check_output([g_proton.wine_bin, "winepath", sys.argv[2]], env=g_session.env, stderr=g_session.log_file)
sys.stdout.buffer.write(path)
else:
log("Need a verb.")
sys.exit(1)
......
......@@ -70,7 +70,7 @@ export WINE_MONO_TRACE="E:System.NotImplementedException"
#"/usr/bin/xterm" -geometry 130x13 -sb -e 'echo "--------------------------------------------------------PORTWINE-LINUX.RU--------------------------------------------------------" && "${PROTONRUN}" "run" "${gamestart}" "${launch_parameters}" &>> "${PORT_WINE_PATH}/${portname}.log"'
"${PROTONRUN}" "run" "${gamestart}" ${launch_parameters} >> "${PORT_WINE_PATH}/${portname}.log" 2>&1 | ${var_gamemode}
${var_gamemode} "${PROTONRUN}" "run" "${gamestart}" ${launch_parameters} >> "${PORT_WINE_PATH}/${portname}.log" 2>&1
KILL9_WINEDEVICE | pwzen
STOP_PORTWINE | pwzen
......
......@@ -59,10 +59,9 @@ read "var_dxvk_on" < "${config_path}/dxvk_on"
export "var_dxvk_on"
if [ -x "`which "gamemoderun" 2>/dev/null`" ]
then
# LD_PRELOAD="$LD_PRELOAD:/usr/${LIB}/libgamemodeauto.so"
var_gamemode="gamemoderun"
export var_gamemode=gamemoderun
else
var_gamemode=`echo " "`
export var_gamemode=""
echo "Gamemod not installed!"
fi
########################################################################
......
......@@ -2,5 +2,5 @@
# Author: Tergoev M.A.
. "$(dirname $(readlink -f "$0"))/runlib"
START_PORTWINE
"${PROTONRUN}" "run" "${gamestart}" ${launch_parameters} >&2 | ${var_gamemode} > /dev/null & KILL9_WINEDEVICE
"${var_gamemode}" "${PROTONRUN}" "run" "${gamestart}" ${launch_parameters} & KILL9_WINEDEVICE >&2
STOP_PORTWINE
......@@ -10,8 +10,8 @@ export PATH_TO_GAME="${PORT_WINE_PATH}/data/pfx/drive_c/Program Files (x86)/${ga
export gamestart="${PATH_TO_GAME}/.exe"
########################################################################
export MESA_GL_VERSION_OVERRIDE=4.4COMPAT
export STAGING_SHARED_MEMORY=0
export PROTON_FORCE_LARGE_ADDRESS_AWARE=1
export STAGING_SHARED_MEMORY=1
export PROTON_FORCE_LARGE_ADDRESS_AWARE=0
export PROTON_USE_SECCOMP=0
export PROTON_NO_ESYNC=1
export WINEDLLOVERRIDES="winemenubuilder.exe=d"
......
......@@ -2,5 +2,5 @@
# Author: PortWINE-Linux.ru
. "$(dirname $(readlink -f "$0"))/runlib"
START_PORTWINE
"${PROTONRUN}" "run" "explorer" | ${var_gamemode} > /dev/null & KILL9_WINEDEVICE
${var_gamemode} "${PROTONRUN}" "run" "explorer" & KILL9_WINEDEVICE
STOP_PORTWINE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment