Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

feat(native): bridgeplay paths for np-native, shims and helper scripts

raymondchins2b647f2b38b3
diff --git a/bridge/fetch-valve.sh b/bridge/fetch-valve.sh
index cb32aea..d81a6c0 100755
--- a/bridge/fetch-valve.sh
+++ b/bridge/fetch-valve.sh
@@ -7,7 +7,7 @@ set -eu
here="$(cd "$(dirname "$0")" && pwd)"
repo="$(cd "$here/.." && pwd)"
-BRIDGE_DIR="${BRIDGE_DIR:-$HOME/Library/Application Support/notproton/bridge}"
+BRIDGE_DIR="${BRIDGE_DIR:-$HOME/Library/Application Support/bridgeplay/bridge}"
WORK="${WORK:-$repo/scratch/valve-fetch}"
MANIFEST="${MANIFEST:-$repo/app/Sources/NotProtonApp/Resources/valve-packages.manifest}"
[ -f "$MANIFEST" ] || { echo "==> no package manifest at $MANIFEST" >&2; exit 1; }
diff --git a/bridge/verify.sh b/bridge/verify.sh
index 9b87047..bec54b5 100755
--- a/bridge/verify.sh
+++ b/bridge/verify.sh
@@ -7,13 +7,13 @@
# It also looks for old copies of the bridge next to it, and for bridge files left
# in Steam Play prefixes.
#
-# The built files come from 'make bridge', the patched ntdlls from the NotProton app,
+# The built files come from 'make bridge', the patched ntdlls from the Bridgeplay app,
# and the Valve files from fetch-valve.sh.
set -eu
here="$(cd "$(dirname "$0")" && pwd)"
repo="$(cd "$here/.." && pwd)"
-BRIDGE_DIR="${BRIDGE_DIR:-$HOME/Library/Application Support/notproton/bridge}"
+BRIDGE_DIR="${BRIDGE_DIR:-$HOME/Library/Application Support/bridgeplay/bridge}"
ATTIC="${ATTIC:-$repo/scratch/bridge-attic}"
SUPPORT_DIR="${SUPPORT_DIR:-$(dirname "$BRIDGE_DIR")}"
BRIDGE_NAME="$(basename "$BRIDGE_DIR")"
diff --git a/controllers/dualsense/broker.m b/controllers/dualsense/broker.m
index b177cc9..e080853 100644
--- a/controllers/dualsense/broker.m
+++ b/controllers/dualsense/broker.m
@@ -745,9 +745,18 @@ int main(int argc, char **argv) {
}
}
printf("{\"ready\":true,\"port\":%u,\"pid\":%d}\n", port, getpid());
- NSString *calibrationPath = [NSHomeDirectory()
- stringByAppendingPathComponent:
- @"Library/Application Support/notproton/controllers/dualsense/calibration.json"];
+ // The notproton folder is read until the app moves it to bridgeplay.
+ NSString *supportPath = [NSHomeDirectory()
+ stringByAppendingPathComponent:@"Library/Application Support/bridgeplay"];
+ NSString *legacySupportPath = [NSHomeDirectory()
+ stringByAppendingPathComponent:@"Library/Application Support/notproton"];
+ BOOL isDirectory = NO;
+ if (![[NSFileManager defaultManager] fileExistsAtPath:supportPath isDirectory:&isDirectory]
+ && [[NSFileManager defaultManager] fileExistsAtPath:legacySupportPath isDirectory:&isDirectory]
+ && isDirectory)
+ supportPath = legacySupportPath;
+ NSString *calibrationPath = [supportPath
+ stringByAppendingPathComponent:@"controllers/dualsense/calibration.json"];
float pcmGain = 1;
double nextCalibration = 0;
double start = CFAbsoluteTimeGetCurrent(), nextStatus = 0;
diff --git a/controllers/dualsense/test-launch.py b/controllers/dualsense/test-launch.py
index 1e91d7c..97c60e4 100644
--- a/controllers/dualsense/test-launch.py
+++ b/controllers/dualsense/test-launch.py
@@ -12,7 +12,7 @@ import tempfile
import time
build = Path(os.environ["DSB_TEST_BUILD"]).resolve()
-with tempfile.TemporaryDirectory(prefix="notproton dualsense ") as tmp:
+with tempfile.TemporaryDirectory(prefix="bridgeplay dualsense ") as tmp:
root = Path(tmp)
shutil.copy2(build / "launch", root / "launch")
(root / "bridge.dylib").touch()
diff --git a/controllers/steam-input/README.md b/controllers/steam-input/README.md
index 624e694..296e6a5 100644
--- a/controllers/steam-input/README.md
+++ b/controllers/steam-input/README.md
@@ -39,8 +39,8 @@ headers are obtained through the project's pinned `lsteamclient/fetch.sh`.
The regular app payload includes `controllers/steam-input/rumble.dylib` and
installs/removes it with the other Bridgeplay runtime components. The run script
enables it for game sessions with direct controller access disabled. To opt
-out for a game, set `NOTPROTON_STEAM_RUMBLE=0 %command%` in Steam launch options.
-`NOTPROTON_RAW_CONTROLLERS=1` also bypasses it, preserving direct DualSense PCM.
+out for a game, set `BRIDGEPLAY_STEAM_RUMBLE=0 %command%` in Steam launch options.
+`BRIDGEPLAY_RAW_CONTROLLERS=1` also bypasses it, preserving direct DualSense PCM.
A missing adapter leaves the previous launch behavior intact.
## Validation and limits
diff --git a/controllers/steam-input/SteamSession.h b/controllers/steam-input/SteamSession.h
index 023eafa..b7812ed 100644
--- a/controllers/steam-input/SteamSession.h
+++ b/controllers/steam-input/SteamSession.h
@@ -53,7 +53,7 @@ struct SteamSession {
close();
return false;
}
- fprintf(stderr, "notproton-rumble: native Steam controller API ready (pid %d)\n", getpid());
+ fprintf(stderr, "bridgeplay-rumble: native Steam controller API ready (pid %d)\n", getpid());
return true;
}
void close() {
diff --git a/controllers/steam-input/rumble.cpp b/controllers/steam-input/rumble.cpp
index f5aeec7..ff410d6 100644
--- a/controllers/steam-input/rumble.cpp
+++ b/controllers/steam-input/rumble.cpp
@@ -132,7 +132,7 @@ static int lookupSlot(void *joystick) {
pthread_cond_signal(&wake);
}
pthread_mutex_unlock(&lock);
- fprintf(stderr, "notproton-rumble: Steam virtual gamepad slot %d mapped (pid %d)\n", found,
+ fprintf(stderr, "bridgeplay-rumble: Steam virtual gamepad slot %d mapped (pid %d)\n", found,
getpid());
}
return found;
@@ -189,7 +189,7 @@ static void *worker(void *) {
active[i] = handle;
static bool logged;
if (!logged) {
- fprintf(stderr, "notproton-rumble: forwarding rumble via Steam\n");
+ fprintf(stderr, "bridgeplay-rumble: forwarding rumble via Steam\n");
logged = true;
}
}
@@ -286,7 +286,7 @@ static void *resolve(void *library, const char *symbol) {
if (getenv("NOTPROTON_STEAM_RUMBLE_TRACE") && !strcmp(symbol, "SDL_JoystickRumble")) {
Dl_info diag{};
dladdr(original, &diag);
- fprintf(stderr, "notproton-rumble: resolve pid=%d enabled=%d source=%s root=%s app=%s\n",
+ fprintf(stderr, "bridgeplay-rumble: resolve pid=%d enabled=%d source=%s root=%s app=%s\n",
getpid(), enabled(), diag.dli_fname ? diag.dli_fname : "?",
getenv("CX_ROOT") ? getenv("CX_ROOT") : "?",
getenv("SteamAppId") ? getenv("SteamAppId") : "?");
diff --git a/controllers/steam-input/tests/launcher.py b/controllers/steam-input/tests/launcher.py
index 167489b..49fbab9 100644
--- a/controllers/steam-input/tests/launcher.py
+++ b/controllers/steam-input/tests/launcher.py
@@ -12,7 +12,7 @@ end = source.index("export NOTPROTON_RUMBLE_LIBRARY", start) + len(
"export NOTPROTON_RUMBLE_LIBRARY"
)
block = source[start:end]
-with tempfile.TemporaryDirectory(prefix="notproton rumble ") as tmp:
+with tempfile.TemporaryDirectory(prefix="bridgeplay rumble ") as tmp:
library = Path(tmp) / "controllers/steam-input/rumble.dylib"
library.parent.mkdir(parents=True)
library.touch()
diff --git a/dylib/tests/shortcutcheck.c b/dylib/tests/shortcutcheck.c
index 4da2474..12c5887 100644
--- a/dylib/tests/shortcutcheck.c
+++ b/dylib/tests/shortcutcheck.c
@@ -283,7 +283,7 @@ static void icon_checks(void) {
DIR *dir = opendir(resources.s);
int entries = 0;
for (struct dirent *e; dir && (e = readdir(dir));)
- if (e->d_name[0] != '.' || strncmp(e->d_name, ".notproton-icon-", 16) == 0) entries++;
+ if (e->d_name[0] != '.' || strncmp(e->d_name, ".bridgeplay-icon-", 17) == 0) entries++;
if (dir) closedir(dir);
check(entries == 1, "no temporary icon files left behind");
update(home.s, source.s);
diff --git a/helpers/game-host.c b/helpers/game-host.c
index 332b5e4..4012dd0 100644
--- a/helpers/game-host.c
+++ b/helpers/game-host.c
@@ -76,7 +76,10 @@ static const char *game_loader_for(const char *path, char *const argv[]) {
}
const char *loader_suffix = ".app/Contents/MacOS/wine";
size_t loader_length = strlen(loader), suffix_length = strlen(loader_suffix);
- if (!strstr(loader, "/Application Support/notproton/launchers/") ||
+ // Launchers live in the bridgeplay support folder, or in the notproton one on a home
+ // the app has not moved over yet.
+ if ((!strstr(loader, "/Application Support/bridgeplay/launchers/") &&
+ !strstr(loader, "/Application Support/notproton/launchers/")) ||
loader_length < suffix_length ||
strcmp(loader + loader_length - suffix_length, loader_suffix)) {
return NULL;
diff --git a/helpers/shortcuts.c b/helpers/shortcuts.c
index fe0a74d..8257fd4 100644
--- a/helpers/shortcuts.c
+++ b/helpers/shortcuts.c
@@ -80,7 +80,7 @@ static int same_entry(int parent, const char *name, int fd) {
static void replace_icon(int parent, const char *name, int app, int resources, const blob_t *icon) {
char temp[64];
- snprintf(temp, sizeof(temp), ".notproton-icon-%d-%08x", (int)getpid(), arc4random());
+ snprintf(temp, sizeof(temp), ".bridgeplay-icon-%d-%08x", (int)getpid(), arc4random());
int fd = openat(resources, temp, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW | O_CLOEXEC, 0644);
if (fd < 0) return;
size_t done = 0;
diff --git a/helpers/tests/game-host.py b/helpers/tests/game-host.py
index bbd0745..21079fc 100644
--- a/helpers/tests/game-host.py
+++ b/helpers/tests/game-host.py
@@ -17,7 +17,7 @@ with tempfile.TemporaryDirectory(prefix="dsb-host-") as tmp:
(prefix / "dosdevices/s:").symlink_to(t / "Games", target_is_directory=True)
(prefix / "dosdevices/c:").symlink_to("../drive_c", target_is_directory=True)
(prefix / "dosdevices/z:").symlink_to("/", target_is_directory=True)
- loader = t / "Application Support/notproton/launchers/999/Game.app/Contents/MacOS/wine"
+ loader = t / "Application Support/bridgeplay/launchers/999/Game.app/Contents/MacOS/wine"
loader.parent.mkdir(parents=True)
loader.write_text("")
loader.chmod(0o755)
@@ -120,6 +120,31 @@ with tempfile.TemporaryDirectory(prefix="dsb-host-") as tmp:
).strip()
== "original"
)
+ # A home the app has not moved over yet keeps its launchers under notproton.
+ legacy_loader = t / "Application Support/notproton/launchers/999/Game.app/Contents/MacOS/wine"
+ legacy_loader.parent.mkdir(parents=True)
+ legacy_loader.write_text("")
+ legacy_loader.chmod(0o755)
+ assert (
+ subprocess.check_output(
+ [str(t / "probe"), temp_loader, str(exe)],
+ env=dict(env, NOTPROTON_GAME_LOADER=str(legacy_loader)),
+ text=True,
+ ).strip()
+ == "game"
+ )
+ elsewhere = t / "Application Support/other/launchers/999/Game.app/Contents/MacOS/wine"
+ elsewhere.parent.mkdir(parents=True)
+ elsewhere.write_text("")
+ elsewhere.chmod(0o755)
+ assert (
+ subprocess.check_output(
+ [str(t / "probe"), temp_loader, str(exe)],
+ env=dict(env, NOTPROTON_GAME_LOADER=str(elsewhere)),
+ text=True,
+ ).strip()
+ == "original"
+ )
print(
"PASS: only actual game executables retain game identity; services, launcher, escapes and argument-only matches excluded"
)
diff --git a/lsteamclient/build.sh b/lsteamclient/build.sh
index c766171..5d0b3a4 100755
--- a/lsteamclient/build.sh
+++ b/lsteamclient/build.sh
@@ -34,7 +34,7 @@ WINE_SRC_REL=${WINE_SRC_REL:-../wine}
TREE=${TREE:-$repo/build/lsteamclient}
# The runner clone, never the installed CrossOver.
if [ -z "${CX_ROOT:-}" ]; then
- for clone in "$HOME/Library/Application Support/notproton/runners"/crossover-*/CrossOver; do
+ for clone in "$HOME/Library/Application Support/bridgeplay/runners"/crossover-*/CrossOver; do
[ -d "$clone" ] || continue
if [ -n "${CX_ROOT:-}" ]; then
echo "==> more than one runner clone is set up, set CX_ROOT to one of them" >&2
@@ -43,8 +43,8 @@ if [ -z "${CX_ROOT:-}" ]; then
CX_ROOT=$clone
done
fi
-CX_ROOT=${CX_ROOT:-$HOME/Library/Application Support/notproton/runners/(none set up)}
-BRIDGE_DIR=${BRIDGE_DIR:-$HOME/Library/Application Support/notproton/bridge}
+CX_ROOT=${CX_ROOT:-$HOME/Library/Application Support/bridgeplay/runners/(none set up)}
+BRIDGE_DIR=${BRIDGE_DIR:-$HOME/Library/Application Support/bridgeplay/bridge}
install=0
do_pe=1
diff --git a/lsteamclient/unixlib.cpp b/lsteamclient/unixlib.cpp
index 944ee88..a59ff43 100644
--- a/lsteamclient/unixlib.cpp
+++ b/lsteamclient/unixlib.cpp
@@ -740,7 +740,7 @@ static void sync_env_var( const char *name, bool unset, const char *val )
#ifdef __APPLE__
/* The FEX wine loader is hardened without allow-dyld-environment-variables, so
* dyld drops the insert list that would carry the overlay renderer and the
- * notproton shim. Load them by hand instead. */
+ * Bridgeplay overlay shim. Load them by hand instead. */
static void load_overlay_libraries( void )
{
const char *inserts = getenv( "STEAM_DYLD_INSERT_LIBRARIES" );
diff --git a/native-launch/apply-launch-options.py b/native-launch/apply-launch-options.py
index e38b8a3..a419170 100644
--- a/native-launch/apply-launch-options.py
+++ b/native-launch/apply-launch-options.py
@@ -5,14 +5,15 @@
For each app id in GAMES the LaunchOptions value becomes
- ~/.notproton/np-native NP_PAD_MODE=<mode> [SDL_JOYSTICK_MFI=0] \
+ ~/.bridgeplay/np-native NP_PAD_MODE=<mode> [SDL_JOYSTICK_MFI=0] \
MTL_HUD_ENABLED=1 [other VAR=VALUE kept from the old prefix] \
%command% <game flags that followed %command%>
The old prefix may be the `/usr/bin/arch ... -e VAR=VALUE` form, a
`/usr/bin/env VAR=VALUE` form, plain `VAR=VALUE` tokens or an earlier np-native
-line; anything else is reported and that app is left untouched. Running it
-twice changes nothing the second time.
+line, including one under the pre-3.0 ~/.notproton/np-native path; anything
+else is reported and that app is left untouched. Running it twice changes
+nothing the second time.
Steam rewrites localconfig.vdf on exit, so the script refuses to run while
steam_osx is up. --allow-running exists for tests on a copy and is refused
@@ -29,7 +30,8 @@ import sys
import tempfile
import time
-NP_NATIVE = os.path.join(os.path.expanduser("~"), ".notproton", "np-native")
+NP_NATIVE = os.path.join(os.path.expanduser("~"), ".bridgeplay", "np-native")
+LEGACY_NP_NATIVE = os.path.join(os.path.expanduser("~"), ".notproton", "np-native")
STEAM_DIR = os.path.join(os.path.expanduser("~"), "Library", "Application Support", "Steam")
# app id -> pad mode (from the per-game research in native-games.json)
@@ -58,7 +60,7 @@ NO_MFI = {"1145350", "570"}
MANAGED = {"DYLD_INSERT_LIBRARIES", "NP_PAD_MODE", "SDL_JOYSTICK_MFI", "MTL_HUD_ENABLED"}
ASSIGN = re.compile(r"^[A-Za-z_][A-Za-z0-9_]*=")
NP_NAME = re.compile(r"^[A-Z_][A-Z0-9_]*$") # what np-native accepts
-WRAPPERS = {"/usr/bin/arch", "/usr/bin/env", "arch", "env", NP_NATIVE}
+WRAPPERS = {"/usr/bin/arch", "/usr/bin/env", "arch", "env", NP_NATIVE, LEGACY_NP_NATIVE}
ARCH_FLAGS = {"-arm64", "-x86_64", "-arm64e", "-i386"}
LINE = re.compile(r'^(?P<ind>\s*)"(?P<key>(?:[^"\\]|\\.)*)"(?:(?P<sep>\s+)"(?P<val>(?:[^"\\]|\\.)*)")?\s*$')
diff --git a/native-launch/np-native.c b/native-launch/np-native.c
index 43f420f..c4cfeff 100644
--- a/native-launch/np-native.c
+++ b/native-launch/np-native.c
@@ -13,13 +13,19 @@
*
* Environment sources, highest precedence first:
* 1. VAR=VALUE launch-option arguments
- * 2. ~/Library/Application Support/notproton/gamefixes/native/<appid>.conf
- * 3. ~/Library/Application Support/notproton/gamefixes/native-default.conf
+ * 2. ~/Library/Application Support/bridgeplay/gamefixes/native/<appid>.conf
+ * 3. ~/Library/Application Support/bridgeplay/gamefixes/native-default.conf
* 4. the environment Steam passed in
+ * Until the app moves them over, ~/Library/Application Support/notproton and
+ * ~/.notproton are used when the bridgeplay ones do not exist.
+ *
+ * Settings are spelled BRIDGEPLAY_<X>; the shims read NOTPROTON_<X>, the upstream
+ * name, so each BRIDGEPLAY_<X> is also set as NOTPROTON_<X>. A NOTPROTON_<X> given
+ * in the same source wins, so options written before Bridgeplay 3.0 still apply.
*
* DYLD_INSERT_LIBRARIES is composed, never replaced:
- * gamepad shim (~/.notproton/libnp_gamepad.dylib, unless NP_PAD_MODE=off)
- * overlay shim (only when NOTPROTON_FRAMEGEN is set and not 0/off)
+ * gamepad shim (~/.bridgeplay/libnp_gamepad.dylib, unless NP_PAD_MODE=off)
+ * overlay shim (only when BRIDGEPLAY_FRAMEGEN is set and not 0/off)
* DYLD_INSERT_LIBRARIES given through the sources above
* DYLD_INSERT_LIBRARIES and STEAM_DYLD_INSERT_LIBRARIES received from Steam
* de-duplicated, ours first. STEAM_DYLD_INSERT_LIBRARIES is set to the same
@@ -49,9 +55,14 @@
extern char **environ;
#define FAIL_EXIT 127
-#define PAD_SHIM_REL "/.notproton/libnp_gamepad.dylib"
-#define OVERLAY_SHIM_REL "/Library/Application Support/notproton/overlay-shim.dylib"
-#define CONF_DIR_REL "/Library/Application Support/notproton/gamefixes"
+#define PAD_SHIM_REL "/.bridgeplay/libnp_gamepad.dylib"
+#define LEGACY_PAD_SHIM_REL "/.notproton/libnp_gamepad.dylib"
+#define SUPPORT_REL "/Library/Application Support/bridgeplay"
+#define LEGACY_SUPPORT_REL "/Library/Application Support/notproton"
+#define OVERLAY_SHIM_REL "/overlay-shim.dylib"
+#define CONF_DIR_REL "/gamefixes"
+#define PUBLIC_PREFIX "BRIDGEPLAY_"
+#define LEGACY_PREFIX "NOTPROTON_"
#define MAX_LIBS 64
static void die(const char *fmt, ...) __attribute__((noreturn, format(printf, 1, 2)));
@@ -253,6 +264,60 @@ static int file_exists(const char *p)
return stat(p, &st) == 0 && S_ISREG(st.st_mode);
}
+static int dir_exists(const char *p)
+{
+ struct stat st;
+ return stat(p, &st) == 0 && S_ISDIR(st.st_mode);
+}
+
+/* home + rel, or home + legacy when only that one exists. */
+static char *current_or_legacy(const char *home, const char *rel, const char *legacy,
+ int (*exists)(const char *))
+{
+ char *cur = join3(home, rel, ""), *old = join3(home, legacy, "");
+ if (!exists(cur) && exists(old)) {
+ free(cur);
+ return old;
+ }
+ free(old);
+ return cur;
+}
+
+/* NOTPROTON_<X> for a BRIDGEPLAY_<X> name, NULL for any other. */
+static char *legacy_name(const char *name)
+{
+ size_t n = strlen(PUBLIC_PREFIX);
+ if (strncmp(name, PUBLIC_PREFIX, n) != 0 || name[n] == '\0')
+ return NULL;
+ return join3(LEGACY_PREFIX, name + n, "");
+}
+
+/* The environment Steam passed in: BRIDGEPLAY_<X> becomes NOTPROTON_<X> unless that is set. */
+static void map_public_env(void)
+{
+ size_t count = 0;
+ for (char **e = environ; *e; e++)
+ count++;
+ char **copy = calloc(count + 1, sizeof(*copy));
+ if (!copy)
+ die("out of memory");
+ size_t n = 0;
+ for (char **e = environ; *e; e++)
+ if (strncmp(*e, PUBLIC_PREFIX, strlen(PUBLIC_PREFIX)) == 0 && strchr(*e, '='))
+ copy[n++] = xstrdup(*e);
+ for (size_t i = 0; i < n; i++) {
+ char *eq = strchr(copy[i], '=');
+ *eq = '\0';
+ char *legacy = legacy_name(copy[i]);
+ if (legacy && valid_name(legacy, strlen(legacy)) && !getenv(legacy) &&
+ setenv(legacy, eq + 1, 1) != 0)
+ die("setenv %s: %s", legacy, strerror(errno));
+ free(legacy);
+ free(copy[i]);
+ }
+ free(copy);
+}
+
/* Steam passes some games (Chained Beasts 3569420) as the .app bundle rather
* than its binary; a directory cannot be exec'd, so run the bundle's main
* executable instead. NULL when prog is not a bundle with one. */
@@ -349,6 +414,7 @@ static void xsetenv(const char *name, const char *value)
int main(int argc, char **argv)
{
const char *home = home_dir();
+ map_public_env();
static struct layer args_l = {.src = "launch options"};
static struct layer app_l, def_l;
@@ -389,7 +455,8 @@ int main(int argc, char **argv)
if (!valid_appid(appid))
appid = getenv("SteamGameId");
if (home) {
- char *conf_dir = join3(home, CONF_DIR_REL, "");
+ char *support = current_or_legacy(home, SUPPORT_REL, LEGACY_SUPPORT_REL, dir_exists);
+ char *conf_dir = join3(support, CONF_DIR_REL, "");
char *def_path = join3(conf_dir, "/native-default.conf", "");
load_conf(&def_l, def_path, home);
if (valid_appid(appid)) {
@@ -407,24 +474,32 @@ int main(int argc, char **argv)
user_dyld = layer_get(&def_l, "DYLD_INSERT_LIBRARIES");
char *user_dyld_c = user_dyld ? xstrdup(user_dyld) : NULL;
- /* apply lowest precedence first so higher layers win */
+ /* apply lowest precedence first so higher layers win; within a layer a
+ * NOTPROTON_<X> wins over the BRIDGEPLAY_<X> it would be set from */
struct layer *order[] = {&def_l, &app_l, &args_l};
for (int k = 0; k < 3; k++)
- for (int j = 0; j < order[k]->n; j++)
+ for (int j = 0; j < order[k]->n; j++) {
xsetenv(order[k]->names[j], order[k]->values[j]);
+ char *legacy = legacy_name(order[k]->names[j]);
+ if (legacy && !layer_get(order[k], legacy))
+ xsetenv(legacy, order[k]->values[j]);
+ free(legacy);
+ }
/* 3. compose DYLD_INSERT_LIBRARIES */
struct libs L = {.n = 0};
const char *pad_mode = getenv("NP_PAD_MODE");
if (home && !is_off(pad_mode)) {
- char *pad_shim = join3(home, PAD_SHIM_REL, "");
+ char *pad_shim = current_or_legacy(home, PAD_SHIM_REL, LEGACY_PAD_SHIM_REL, file_exists);
/* no NP_PAD_MODE and no shim installed: nothing was asked for */
if (file_exists(pad_shim) || (pad_mode && *pad_mode))
libs_add(&L, pad_shim); /* warns and skips when missing */
}
const char *framegen = getenv("NOTPROTON_FRAMEGEN");
- if (home && framegen && *framegen && !is_off(framegen))
- libs_add(&L, join3(home, OVERLAY_SHIM_REL, ""));
+ if (home && framegen && *framegen && !is_off(framegen)) {
+ char *support = current_or_legacy(home, SUPPORT_REL, LEGACY_SUPPORT_REL, dir_exists);
+ libs_add(&L, join3(support, OVERLAY_SHIM_REL, ""));
+ }
libs_add_list(&L, user_dyld_c);
libs_add_list(&L, steam_dyld_c);
libs_add_list(&L, steam_dyld2_c);
diff --git a/native-launch/tests/run.sh b/native-launch/tests/run.sh
index 1f15b7f..be6f89f 100644
--- a/native-launch/tests/run.sh
+++ b/native-launch/tests/run.sh
@@ -39,9 +39,9 @@ build "$here/probe.c" -o "$probe"
# fake HOME with real tiny dylibs where the launcher looks for them
H=$tmp/home
-mkdir -p "$H/.notproton" "$H/Library/Application Support/notproton/gamefixes/native" "$tmp/libs"
-pad=$H/.notproton/libnp_gamepad.dylib
-ov="$H/Library/Application Support/notproton/overlay-shim.dylib"
+mkdir -p "$H/.bridgeplay" "$H/Library/Application Support/bridgeplay/gamefixes/native" "$tmp/libs"
+pad=$H/.bridgeplay/libnp_gamepad.dylib
+ov="$H/Library/Application Support/bridgeplay/overlay-shim.dylib"
steamlib=$tmp/libs/steamoverlay.dylib
build -dynamiclib -DMARKER='"pad"' "$here/marker.c" -o "$pad"
build -dynamiclib -DMARKER='"overlay"' "$here/marker.c" -o "$ov"
@@ -50,7 +50,7 @@ build -dynamiclib -DMARKER='"user"' "$here/marker.c" -o "$tmp/libs/user.dylib"
for f in "$launcher" "$probe" "$tmp/probe-x86" "$pad" "$ov" "$steamlib" "$tmp/libs/user.dylib"; do
codesign -s - -f "$f" 2>/dev/null
done
-confdir="$H/Library/Application Support/notproton/gamefixes"
+confdir="$H/Library/Application Support/bridgeplay/gamefixes"
# run: clean env (env -i) with HOME pointing at the fake home; extra
# NAME=VALUE pairs before "--" go into the parent environment
@@ -127,7 +127,7 @@ rm -f "$confdir/native-default.conf" "$confdir/native/4242.conf"
# --- DYLD composition ------------------------------------------------------
V=NP_PROBE_VARS=DYLD_INSERT_LIBRARIES:STEAM_DYLD_INSERT_LIBRARIES
-run "$V" "DYLD_INSERT_LIBRARIES=$steamlib" -- NP_PAD_MODE=hid NOTPROTON_FRAMEGEN=1 "$probe"
+run "$V" "DYLD_INSERT_LIBRARIES=$steamlib" -- NP_PAD_MODE=hid BRIDGEPLAY_FRAMEGEN=1 "$probe"
expect_rc "dyld: exit 0" 0
expect "dyld: ours first, Steam's kept, all loaded" \
"DYLD_INSERT_LIBRARIES=$pad:$ov:$steamlib" \
@@ -136,7 +136,7 @@ expect "dyld: ours first, Steam's kept, all loaded" \
run "$V" "DYLD_INSERT_LIBRARIES=$pad:$steamlib" "STEAM_DYLD_INSERT_LIBRARIES=$steamlib" -- "$probe"
expect "dyld: de-duplicated, pad by default when shim exists" \
"DYLD_INSERT_LIBRARIES=$pad:$steamlib"
-run "$V" "STEAM_DYLD_INSERT_LIBRARIES=$steamlib" -- NP_PAD_MODE=off NOTPROTON_FRAMEGEN=0 "$probe"
+run "$V" "STEAM_DYLD_INSERT_LIBRARIES=$steamlib" -- NP_PAD_MODE=off BRIDGEPLAY_FRAMEGEN=0 "$probe"
expect "dyld: pad off, framegen 0, STEAM_DYLD_ only (SIP-stripped parent)" \
"DYLD_INSERT_LIBRARIES=$steamlib" "loaded:steam"
if has "loaded:pad" || has "loaded:overlay"; then bad "dyld: off shims still loaded"; else ok "dyld: off shims not loaded"; fi
@@ -235,5 +235,37 @@ expect "fail open: bad conf lines warned (file:line), good lines applied" \
"GOOD=1" "LATER=3" "arch=arm64"
rm -f "$confdir/native-default.conf"
+# --- BRIDGEPLAY_ names and the pre-3.0 layout ----------------------------------
+R=NP_PROBE_VARS=NOTPROTON_RETINA:BRIDGEPLAY_RETINA
+run "$R" -- NP_PAD_MODE=off BRIDGEPLAY_RETINA=1 "$probe"
+expect "names: a BRIDGEPLAY_ argument sets the NOTPROTON_ one" "NOTPROTON_RETINA=1" "BRIDGEPLAY_RETINA=1"
+run "$R" -- NP_PAD_MODE=off NOTPROTON_RETINA=0 BRIDGEPLAY_RETINA=1 "$probe"
+expect "names: NOTPROTON_ wins within one source" "NOTPROTON_RETINA=0"
+run "$R" BRIDGEPLAY_RETINA=1 -- NP_PAD_MODE=off "$probe"
+expect "names: a BRIDGEPLAY_ variable from Steam is mapped" "NOTPROTON_RETINA=1"
+run "$R" BRIDGEPLAY_RETINA=1 NOTPROTON_RETINA=0 -- NP_PAD_MODE=off "$probe"
+expect "names: a NOTPROTON_ variable from Steam is kept" "NOTPROTON_RETINA=0"
+printf 'BRIDGEPLAY_RETINA=0\n' >"$confdir/native-default.conf"
+run "$R" NOTPROTON_RETINA=1 -- NP_PAD_MODE=off "$probe"
+expect "names: a conf BRIDGEPLAY_ beats the environment's NOTPROTON_" "NOTPROTON_RETINA=0"
+printf 'NOTPROTON_RETINA=0\n' >"$confdir/native-default.conf"
+run "$R" -- NP_PAD_MODE=off BRIDGEPLAY_RETINA=1 "$probe"
+expect "names: a BRIDGEPLAY_ argument beats a conf NOTPROTON_" "NOTPROTON_RETINA=1"
+rm -f "$confdir/native-default.conf"
+run "$V" -- NP_PAD_MODE=off NOTPROTON_FRAMEGEN=1 "$probe"
+expect "names: NOTPROTON_FRAMEGEN still loads the overlay shim" "DYLD_INSERT_LIBRARIES=$ov"
+# A home the app has not moved over yet: only ~/.notproton and .../notproton exist.
+old_support="$H/Library/Application Support/notproton"
+mv "$H/.bridgeplay" "$H/.notproton"
+mv "$H/Library/Application Support/bridgeplay" "$old_support"
+printf 'FROM=old\n' >"$old_support/gamefixes/native-default.conf"
+run "$V" NP_PROBE_VARS=DYLD_INSERT_LIBRARIES:FROM -- NP_PAD_MODE=hid BRIDGEPLAY_FRAMEGEN=1 "$probe"
+expect "legacy layout: shims and confs come from the old folders" \
+ "DYLD_INSERT_LIBRARIES=$H/.notproton/libnp_gamepad.dylib:$old_support/overlay-shim.dylib" "FROM=old" \
+ "loaded:pad" "loaded:overlay"
+rm -f "$old_support/gamefixes/native-default.conf"
+mv "$H/.notproton" "$H/.bridgeplay"
+mv "$old_support" "$H/Library/Application Support/bridgeplay"
+
echo "==> np-native-tests: $pass passed, $fail failed"
[ "$fail" -eq 0 ]
diff --git a/native-shim/hid_profile.c b/native-shim/hid_profile.c
index 75a5d75..6c592c7 100644
--- a/native-shim/hid_profile.c
+++ b/native-shim/hid_profile.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
+#include <sys/stat.h>
#define PAGE_GD 0x01
#define PAGE_SIM 0x02
@@ -447,8 +448,12 @@ static void db_load_once(void) {
} else {
const char *home = getenv("HOME");
if (home) {
+ // The notproton folder is read until the app moves it to bridgeplay.
char buf[1024];
- snprintf(buf, sizeof buf, "%s/Library/Application Support/notproton/gamecontrollerdb.txt", home);
+ struct stat st;
+ snprintf(buf, sizeof buf, "%s/Library/Application Support/bridgeplay", home);
+ const char *dir = stat(buf, &st) == 0 ? "bridgeplay" : "notproton";
+ snprintf(buf, sizeof buf, "%s/Library/Application Support/%s/gamecontrollerdb.txt", home, dir);
db_load_file(buf);
}
}
diff --git a/native-shim/np_pad.h b/native-shim/np_pad.h
index 1a91414..e011f33 100644
--- a/native-shim/np_pad.h
+++ b/native-shim/np_pad.h
@@ -53,7 +53,8 @@ const char *np_profile_name(const np_profile *profile);
void np_xbox_encode(const np_pad_state *state, uint8_t out[NP_XBOX_REPORT_LEN]);
// Mapping database: $NP_GAMECONTROLLERDB, else
-// ~/Library/Application Support/notproton/gamecontrollerdb.txt, plus SDL_GAMECONTROLLERCONFIG.
+// ~/Library/Application Support/bridgeplay/gamecontrollerdb.txt (notproton until the app moves
+// it), plus SDL_GAMECONTROLLERCONFIG.
// Later lines win over earlier ones for the same GUID.
void np_db_load(void);
diff --git a/ntdll-patch/build-ntdll.sh b/ntdll-patch/build-ntdll.sh
index e99d334..11029cd 100755
--- a/ntdll-patch/build-ntdll.sh
+++ b/ntdll-patch/build-ntdll.sh
@@ -10,7 +10,7 @@ here="$(cd "$(dirname "$0")" && pwd)"
cd "$here"
CX_ROOT="${CX_ROOT:-/Applications/CrossOver Preview.app/Contents/SharedSupport/CrossOver}"
-BRIDGE_DIR="${BRIDGE_DIR:-$HOME/Library/Application Support/notproton/bridge}"
+BRIDGE_DIR="${BRIDGE_DIR:-$HOME/Library/Application Support/bridgeplay/bridge}"
OUT="${OUT:-$here/build}"
ROSETTA_CLEAN_X86_64=04c7200b6645decb7c2d1ba6b0195abc9af83257072558d11aa72cc067ac3377
@@ -218,4 +218,4 @@ for arch in $ARCHES; do
cp "$OUT/$arch/ntdll.dll" "$d/ntdll.dll"
echo "==> installed $arch $(sha "$d/ntdll.dll" | cut -c1-16) $d/ntdll.dll"
done
-echo "==> setting build $BUILD up in NotProton copies these into its runner clone"
+echo "==> setting build $BUILD up in Bridgeplay copies these into its runner clone"
diff --git a/overlay-shim/framegen.m b/overlay-shim/framegen.m
index 203a469..a4dfca3 100644
--- a/overlay-shim/framegen.m
+++ b/overlay-shim/framegen.m
@@ -4,7 +4,8 @@
// Enabled only by NOTPROTON_FRAMEGEN. Off, nothing in here runs: no hook is
// installed and no object is created, so the per-frame cost is the shim's own.
//
-// Environment
+// Environment (users set BRIDGEPLAY_FRAMEGEN*; the run script and np-native pass
+// each on under the NOTPROTON_ name read here)
// NOTPROTON_FRAMEGEN 0|off: disabled. 1|2: 2x, one generated frame at
// t=1/2. 3: 3x, two generated frames at t=1/3 and
// 2/3. adaptive: as many generated frames as fit
@@ -1923,7 +1924,7 @@ static void framegen_init(void)
else if (atoi(value) >= 3)
framegen_multiplier = fg_mult_3x;
else {
- shim_log("overlay_shim framegen: NOTPROTON_FRAMEGEN=%s not understood (0|1|2|3|adaptive), off\n",
+ shim_log("overlay_shim framegen: BRIDGEPLAY_FRAMEGEN=%s not understood (0|1|2|3|adaptive), off\n",
value);
return;
}
diff --git a/steam-shim/build.sh b/steam-shim/build.sh
index ec1e96b..eae0187 100755
--- a/steam-shim/build.sh
+++ b/steam-shim/build.sh
@@ -15,7 +15,7 @@ repo=$(cd "$here/.." && pwd)
WINE_BUILD=${WINE_BUILD:-$repo/scratch/wine-build-dual}
# Relative, since it ends up in the debug info.
WINE_SRC_REL=${WINE_SRC_REL:-../wine}
-BRIDGE_DIR=${BRIDGE_DIR:-$HOME/Library/Application Support/notproton/bridge}
+BRIDGE_DIR=${BRIDGE_DIR:-$HOME/Library/Application Support/bridgeplay/bridge}
install=0
[ "${1:-}" = "--install" ] && install=1