Skip to content

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

Merge upstream NotProton 1.2.0 into Bridgeplay

raymondchins1ccd442aa053
diff --cc dylib/feats/compat_run.sh
index 5e49008,f013e8c..d342a86
--- a/dylib/feats/compat_run.sh
+++ b/dylib/feats/compat_run.sh
@@@ -1295,13 -693,12 +1374,14 @@@ import_prefix_settings()
'[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug]' '"Auto"="0"' '' \
'[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug]' '"Auto"="0"' '' \
'[HKEY_CURRENT_USER\Software\Wine\WineDbg]' '"ShowCrashDialog"=dword:00000000' '' \
- '[HKEY_CURRENT_USER\Software\Wine\Mac Driver]' "$retina_line" '' \
+ && video_lines && printf '%s\r\n' \
'[HKEY_LOCAL_MACHINE\Software\Classes\steam]' '"URL Protocol"=""' '' \
+ '[HKEY_LOCAL_MACHINE\Software\NVIDIA Corporation\Global\NGXCore]' \
+ '"FullPath"="C:\\Windows\\System32"' '' \
'[HKEY_LOCAL_MACHINE\Software\Classes\steam\shell\open\command]' \
'@="\"C:\\Program Files (x86)\\Steam\\steam.exe\" \"%1\""' '' \
- && hidraw_lines add "$controllers_add" && hidraw_lines remove "$controllers_remove"; } \
+ && hidraw_lines add "$controllers_add" && hidraw_lines remove "$controllers_remove" \
+ && winebus_lines; } \
> "$settings_file" 2>/dev/null; then
[ -z "$settings_file" ] || rm -f "$settings_file"
echo "=== could not write the prefix settings, launching without them ===" >> "$log" 2>&1 || true
@@@ -1772,10 -1189,10 +1866,10 @@@ if [ -n "$STEAM_COMPAT_DATA_PATH" ]; th
seed_prefix_from_template
stage_step="profile layout"
if ! lay_out_proton_profile; then
- show_alert "Saved-game folders need attention" "NotProton left the conflicting files in place. Open this prefix's notproton-run.log for details before trying again."
+ show_alert "Saved-game folders need attention" "Bridgeplay left the conflicting files in place. Open this prefix's notproton-run.log for details before trying again."
exit 1
fi
- echo "video: RetinaMode=${NOTPROTON_RETINA:-0}" >> "$log" 2>&1 || true
+ [ "$verb" != waitforexitandrun ] || echo "video: RetinaMode=${NOTPROTON_RETINA:-0}" >> "$log" 2>&1 || true
stage_step="game drive"
map_game_drive
stage_step="prefix settings"
@@@ -2255,7 -1617,7 +2349,7 @@@ els
echo "=== client staged no overlay renderer, overlay disabled ===" >> "$log" 2>&1 || true
fi
set -- --args "$shim_exe" "$@"
- for name in $(env | LC_ALL=C sed -nE 's/^(CX_APPLEGPTK_LIBD3DSHARED_PATH|SDL_GAMECONTROLLERCONFIG(_FILE)?|SDL_JOYSTICK_MFI|WINE_LARGE_ADDRESS_AWARE|WINE_CPU_TOPOLOGY|Steam[A-Za-z0-9]*|(CX_GRAPHICS|D3DM_|DXMT_|DXVK_|MVK_|VKD3D_|STAGING_|MTL_|ROSETTA_)[A-Z0-9_]*|NOTPROTON_FRAMEGEN(_[A-Z]+)?|NOTPROTON_NGX_SIGNER|NOTPROTON_NVAPI_DRIVER|NOTPROTON_DRIVER_VERSION|NOTPROTON_STDOUT_NULL|NOTPROTON_VSYNC|CX_ACTIVE_GRAPHICS_BACKEND)=.*/\1/p'); do
-for name in $(env | LC_ALL=C sed -nE 's/^(CX_APPLEGPTK_LIBD3DSHARED_PATH|Steam[A-Za-z0-9]*|(CX_GRAPHICS|D3DM_|DXMT_|DXVK_|FEX_|MTL_|ROSETTA_)[A-Z0-9_]*)=.*/\1/p'); do
++for name in $(env | LC_ALL=C sed -nE 's/^(CX_APPLEGPTK_LIBD3DSHARED_PATH|SDL_GAMECONTROLLERCONFIG(_FILE)?|SDL_JOYSTICK_MFI|WINE_LARGE_ADDRESS_AWARE|WINE_CPU_TOPOLOGY|Steam[A-Za-z0-9]*|(CX_GRAPHICS|D3DM_|DXMT_|DXVK_|FEX_|MVK_|VKD3D_|STAGING_|MTL_|ROSETTA_)[A-Z0-9_]*|NOTPROTON_FRAMEGEN(_[A-Z]+)?|NOTPROTON_NGX_SIGNER|NOTPROTON_NVAPI_DRIVER|NOTPROTON_DRIVER_VERSION|NOTPROTON_STDOUT_NULL|NOTPROTON_VSYNC|CX_ACTIVE_GRAPHICS_BACKEND)=.*/\1/p'); do
eval "value=\$$name"
# shellcheck disable=SC2154 # eval assigns value on the line above
set -- --env "$name=$value" "$@"
diff --cc dylib/feats/webpatch.c
index 512f09e,660ab66..4b52c3c
--- a/dylib/feats/webpatch.c
+++ b/dylib/feats/webpatch.c
@@@ -302,62 -297,13 +302,65 @@@ static int out_expand(np_out_t *o, cons
ARG "=>{" \
"const t=" ARG ".details,o=t.strLaunchOptions||\"\"," \
"fex=" NP_FEX_TOOLS ".indexOf(t.strCompatToolName||\"" NP_FALLBACK_TOOL "\")>=0," \
- "npZh=" NP_WEB_IS_ZH ",npIt=" NP_WEB_IS_IT ",npL=(en,zh,it)=>npZh?zh:npIt?it:en," \
- "L=MSCXLaunch(o,t.unAppID),g=L.g,s=L.s," \
+ "npZh=" NP_WEB_IS_ZH ",npIt=" NP_WEB_IS_IT ",npL=(en,zh,it)=>npZh?zh:npIt&&it?it:en," \
+ NP_CX_LAUNCH_PARSE \
+ "nat=t.unAppID<2147483648&&(t.vecPlatforms||[]).indexOf(\"osx\")>=0&&!t.strCompatToolName," \
+ "wv=w=>w.value===null?o.slice(w.start,w.end):w.value," \
+ "NE=E.c<0?[]:E.G.slice(0,E.c).filter(w=>/^[A-Za-z_]\\w*=/.test(wv(w)))," \
+ "A=k=>(nat?NE.filter(w=>wv(w).startsWith(k+\"=\")):E.e.filter(w=>o.startsWith(k+\"=\",w.start))).pop()," \
+ "g=k=>{const p=A(k);return p?wv(p).slice(k.length+1):\"\"}," \
+ "qv=v=>/^[\\w.,:=\\/+@%-]*$/.test(v)?v:\"'\"+v.replace(/'/g,\"'\\\\''\")+\"'\"," \
+ "sl=ps=>{const add=ps.filter(p=>p[1]).map(p=>p[0]+\"=\"+qv(p[1])).join(\" \");let r;" \
+ "if(!/%command%/i.test(o)){if(!add)return;r=add+\" %command%\"+(o.trim()?\" \"+o:\"\")}" \
+ "else{let at=E.p;r=o.slice(0,at)+(add?add+\" \":\"\");" \
+ "E.e.forEach(w=>{if(ps.some(p=>o.startsWith(p[0]+\"=\",w.start))){" \
+ "r+=o.slice(at,w.start);at=w.end;while(o[at]===\" \"||o[at]===\"\\t\")at++}});r+=o.slice(at)}" \
+ "SteamClient.Apps.SetAppLaunchOptions(t.unAppID,r.trim()===\"%command%\"?\"\":r)}," \
+ /* Native games run through np-native, which also forces arm64: <launcher> VAR=VALUE ... \
+ %command% <game args>. Assignments are read from any word before %command%, so the \
+ older "/usr/bin/arch ... -e VAR=VALUE" form is understood, and rewritten without the \
+ arch prefix and its DYLD_INSERT_LIBRARIES. */ \
+ "sn=ps=>{const c=E.c<0?null:E.G[E.c]," \
+ "L=Fx.h?Fx.h+\"/.notproton/np-native\":(c&&E.G.slice(0,E.c).map(wv)" \
+ ".find(x=>/\\/\\.notproton\\/np-native$/.test(x)))||\"\";" \
+ "if(!L||!c&&!ps.some(p=>p[1]))return;" \
+ "const kn=w=>{const x=wv(w);return x.slice(0,x.indexOf(\"=\"))};" \
+ "let vs=NE.filter(w=>kn(w)!==\"DYLD_INSERT_LIBRARIES\").map(w=>[kn(w),o.slice(w.start,w.end)]);" \
+ "ps.forEach(p=>{const i=vs.findIndex(x=>x[0]===p[0]);vs=vs.filter(x=>x[0]!==p[0]);" \
+ "if(p[1])vs.splice(i<0?vs.length:i,0,[p[0],p[0]+\"=\"+qv(p[1])])});" \
+ "const h=[qv(L)].concat(vs.map(x=>x[1])).join(\" \");" \
+ "SteamClient.Apps.SetAppLaunchOptions(t.unAppID," \
+ "c?o.slice(0,E.p)+h+\" \"+o.slice(c.start):h+\" %command%\"+(o.trim()?\" \"+o.trim():\"\"))}," \
+ "s=ps=>nat?sn(ps):sl(ps)," \
+ "Fx=globalThis.MSCXFx||{}," \
+ "dv=k=>{if(nat){const a=(Fx.na||{})[t.unAppID]||{},n=Fx.ng||{};" \
+ "return k in a?a[k]:k in n?n[k]:(Fx.d||{})[k]||\"\"}" \
+ "const a=(Fx.a||{})[t.unAppID]||{},en=Fx.e||{},x=en[t.strCompatToolName]||en[\"\"]||{};" \
+ "return k in a?a[k]:k in(Fx.g||{})?Fx.g[k]:k in x?x[k]:(Fx.d||{})[k]||\"\"}," \
+ "ev=k=>A(k)?g(k):dv(k)," \
"T=(ks,l,on,off)=>(0," RT ".jsx)(" BARREL ".Yh,{className:\"MSCXRow\",label:l," \
- "checked:g(ks[0])===on," \
- "onChange:v=>s(ks.map(k=>[k,v?on:(off||\"\")]))},ks[0])," \
- "D=(k,l)=>(0," RT ".jsx)(" BARREL ".Yh,{className:\"MSCXRow\",label:l," \
- "checked:\"0\"!==g(k),onChange:v=>s([[k,v?\"\":\"0\"]])},k)," \
+ "checked:ev(ks[0])===on," \
+ "onChange:v=>s(ks.map(k=>[k,v?(dv(k)===on?\"\":on):(dv(k)===on?(off||\"0\"):\"\")]))},ks[0])," \
+ /* A labelled dropdown: its label above it, full width, without a row box around it, \
+ like the section dropdowns. n turns a raw value, set or not, into an option's data, so \
+ picking what the confs already give drops the argument instead of writing it. */ \
+ "D=(k,l,O,n)=>(0," RT ".jsx)(" BARREL ".m,{label:l,strClassName:\"MSCXDrop\",rgOptions:O," \
+ "selectedOption:n(ev(k)),onChange:v=>s([[k,v.data===n(dv(k))?\"\":v.data]])},k)," \
+ "lc=z=>x=>(x||z).toLowerCase()," \
+ "fz=x=>{x=(x||\"\").toLowerCase();return x===\"1\"?\"2\":/^(0|off|false|no)?$/.test(x)?\"0\":x}," \
+ "fo=fz(ev(\"NOTPROTON_FRAMEGEN\"))!==\"0\"," \
+ "FG=()=>(0," RT ".jsxs)(" BARREL ".XY,{label:\"Frame Generation (Experimental. Adds input lag)\",children:[" \
+ "D(\"NOTPROTON_FRAMEGEN\",\"Mode\",[{data:\"0\",label:\"Off\"},{data:\"2\",label:\"2x\"}," \
+ "{data:\"3\",label:\"3x\"},{data:\"adaptive\",label:\"Adaptive (fills to display refresh)\"}],fz)," \
+ "fo&&D(\"NOTPROTON_FRAMEGEN_QUALITY\",\"Quality\",[{data:\"performance\",label:\"Performance\"}," \
+ "{data:\"balanced\",label:\"Balanced\"},{data:\"quality\",label:\"Quality\"}],lc(\"balanced\"))," \
+ "fo&&T([\"NOTPROTON_FRAMEGEN_UI\"],\"Protect UI (keeps static HUD and menus sharp)\",\"1\",\"0\")," \
+ "fo&&T([\"NOTPROTON_FRAMEGEN_FALLBACK\"],\"Fast-motion fallback (skips frames that would smear)\",\"1\",\"0\")," \
+ "fo&&D(\"NOTPROTON_FRAMEGEN_ENGINE\",\"Engine\",[{data:\"own\",label:\"Built-in optical flow\"}," \
+ "{data:\"metalfx\",label:\"MetalFX\"}],lc(\"own\"))]},\"fgn\")," \
++ /* A toggle that is on unless set to "0" (upstream 1.2.0: AVX2, FEX x87 precision). */ \
++ "X=(k,l)=>(0," RT ".jsx)(" BARREL ".Yh,{className:\"MSCXRow\",label:l," \
++ "checked:\"0\"!==ev(k),onChange:v=>s([[k,v?\"\":\"0\"]])},k)," \
"bv=g(\"CX_GRAPHICS_BACKEND\"),b=fex&&\"d3dmetal\"===bv?\"\":bv," \
"dm=!fex&&(\"\"===b||\"d3dmetal\"===b)," \
"dx=\"\"===b||\"dxmt\"===b," \
@@@ -397,7 -338,7 +400,7 @@@
"T([\"MTL_HUD_ENABLED\"],npL(\"Metal HUD\",\"Metal 性能监视器\",\"Metal HUD\"),\"1\")," \
"dm&&T([\"D3DM_ENABLE_METALFX\"],\"DLSS\",\"1\")," \
"\"dxmt\"===b&&T([\"DXMT_ENABLE_NVEXT\"],\"DLSS\",\"1\")," \
- "!fex&&T([\"ROSETTA_ADVERTISE_AVX\"],npL(\"Advertise AVX2 to Rosetta\",\"向 Rosetta 声明 AVX2 支持\",\"Segnala AVX2 a Rosetta\"),\"1\",\"0\")," \
- "!fex&&D(\"ROSETTA_ADVERTISE_AVX\",npL(\"Advertise AVX2 to Rosetta\",\"向 Rosetta 声明 AVX2 支持\",\"Segnala AVX2 a Rosetta\"))," \
++ "!fex&&X(\"ROSETTA_ADVERTISE_AVX\",npL(\"Advertise AVX2 to Rosetta\",\"向 Rosetta 声明 AVX2 支持\",\"Segnala AVX2 a Rosetta\"))," \
"T([\"WINEMSYNC\"],\"MSync\",\"1\",\"0\")," \
"T([\"NOTPROTON_RETINA\"],npL(\"High Resolution\",\"高分辨率\",\"Alta risoluzione\"),\"1\",\"0\")" \
"]},\"gfx\")," \
@@@ -407,11 -348,15 +410,16 @@@
"children:(0," RT ".jsx)(" BARREL ".m,{rgOptions:U," \
"selectedOption:sw?(U.find(u=>u.data&&+u.data===fn)||{data:String(fn)}).data:\"\"," \
"onChange:v=>s([[\"DXMT_METALFX_SPATIAL_SWAPCHAIN\",v.data?\"1\":\"\"],[\"DXMT_CONFIG\",fx(v.data)]])})},\"usf\")," \
+ "FG()," \
- "(0," RT ".jsx)(" BARREL ".XY,{label:npL(\"Controllers (May break Steam Input. Not recommended)\"," \
- "\"控制器(可能导致 Steam Input 失效,不推荐)\",\"Controller (pu\\u00f2 interferire con Steam Input, sconsigliato)\"),children:" \
- "T([\"NOTPROTON_RAW_CONTROLLERS\"],npL(\"Let games read controllers directly\"," \
- "\"允许游戏直接读取控制器\",\"Lascia che i giochi leggano direttamente i controller\"),\"1\",\"\")},\"ctl\")" \
+ "(0," RT ".jsxs)(" BARREL ".XY,{label:npL(\"Controllers\",\"控制器\",\"Controller\"),children:[" \
+ "T([\"NOTPROTON_RAW_CONTROLLERS\"],npL(\"Let games read controllers directly (May break Steam Input. Not recommended)\"," \
+ "\"允许游戏直接读取控制器(可能导致 Steam Input 失效,不推荐)\"," \
+ "\"Lascia che i giochi leggano direttamente i controller (pu\\u00f2 interferire con Steam Input, sconsigliato)\"),\"1\",\"\")," \
+ "T([\"NOTPROTON_DISABLE_HIDRAW\"],npL(\"Disable hidraw\",\"停用 hidraw\",\"Disable hidraw\"),\"1\",\"\")" \
+ "]},\"ctl\")," \
+ "fex&&(0," RT ".jsx)(" BARREL ".XY,{label:\"FEX\"," \
- "children:D(\"FEX_X87REDUCEDPRECISION\"," \
++ "children:X(\"FEX_X87REDUCEDPRECISION\"," \
+ "\"Reduced x87 Precision (Reducing precision improves game performance, is enabled by default in CrossOver Preview)\")},\"fex\")" \
"]})})}"
#define NP_CX_OPTIONS_CAPTURE(RT, BARREL) \
diff --cc dylib/tests/panel-behavior/behavior.js
index f12f40c,2ea6350..ccbbe95
--- a/dylib/tests/panel-behavior/behavior.js
+++ b/dylib/tests/panel-behavior/behavior.js
@@@ -19,8 -21,8 +19,8 @@@ for (const form of Object.keys(FORMS))
'a shortcut renders the panel before a tool name reaches the page');
let r = nodes('');
- t.ok(toggles(r).length === 6 && sections(r).length === 4, 'automatic shows six toggles in four sections');
- t.ok(toggles(r).length === 7 && sections(r).length === 3, 'automatic shows seven toggles in three sections');
- t.ok(r.filter(x => x.type === 'Dropdown').length === 2, 'two dropdowns');
++ t.ok(toggles(r).length === 7 && sections(r).length === 4, 'automatic shows seven toggles in four sections');
+ t.ok(r.filter(x => x.type === 'Dropdown').length === 3, 'three dropdowns');
t.ok(!('label' in r.find(x => x.type === 'Dropdown').props), 'the backend dropdown carries no label column');
r = nodes('CX_GRAPHICS_BACKEND=dxmt');
@@@ -90,242 -93,6 +91,242 @@@
written.length = 0;
raw('NOTPROTON_RAW_CONTROLLERS=1 WINEMSYNC=1').props.onChange(false);
t.ok(last().trim() === 'WINEMSYNC=1 %command%', `turning the controller row off removes its flag (${last()})`);
+ // Settings that come from the gamefix confs or the engine show as they will apply.
+ globalThis.MSCXFx = {
+ g: { MTL_HUD_ENABLED: '1', NOTPROTON_RETINA: '1' },
+ a: { 287700: { NOTPROTON_RETINA: '0' } },
+ e: { notproton: { WINEMSYNC: '1' }, '': { WINEMSYNC: '0' } },
+ d: { NOTPROTON_RAW_CONTROLLERS: '1' },
+ };
- const row = (o, l) => nodes(o).find(x => x.props.label === l);
++ const row = (o, l) => nodes(o).find(x => x.props.label === l || (typeof x.props.label === 'string' && x.props.label.startsWith(l + ' (')));
+ t.ok(row('', 'Metal HUD').props.checked === true, 'a global conf value reads as on');
+ t.ok(row('', 'High Resolution').props.checked === false, 'the per-app conf beats the global conf');
+ t.ok(row('', 'MSync').props.checked === true, 'the engine default reads as on');
+ t.ok(row('', 'Let games read controllers directly').props.checked === true, 'the run script default reads as on');
+ t.ok(row('MTL_HUD_ENABLED=0', 'Metal HUD').props.checked === false, 'the launch options beat the confs');
+ written.length = 0;
+ row('', 'Metal HUD').props.onChange(false);
+ t.ok(last().trim() === 'MTL_HUD_ENABLED=0 %command%', `turning a default off writes 0 (${last()})`);
+ written.length = 0;
+ row('MTL_HUD_ENABLED=0', 'Metal HUD').props.onChange(true);
+ t.ok(last() === '', `turning it back on drops the override (${JSON.stringify(last())})`);
+ written.length = 0;
+ row('', 'High Resolution').props.onChange(true);
+ t.ok(last().trim() === 'NOTPROTON_RETINA=1 %command%', `turning on what a conf turns off writes 1 (${last()})`);
+ written.length = 0;
+ row('', 'Let games read controllers directly').props.onChange(false);
+ t.ok(last().trim() === 'NOTPROTON_RAW_CONTROLLERS=0 %command%', `opting out of raw controllers writes 0 (${last()})`);
+ delete globalThis.MSCXFx;
+
+ // Frame generation: a mode for every backend, and the rest of its rows only once it is on.
+ const FGL = 'Frame Generation (Experimental. Adds input lag)';
+ const fgRows = o => {
+ const sec = nodes(o).find(x => x.type === 'Section' && x.props.label === FGL);
+ return sec ? walk(sec.props.children) : [];
+ };
+ const FGT = { ui: 'Protect UI (keeps static HUD and menus sharp)',
+ fb: 'Fast-motion fallback (skips frames that would smear)' };
- const fgrow = (o, l) => fgRows(o).find(x => x.props.label === l);
++ const fgrow = (o, l) => fgRows(o).find(x => x.props.label === l || (typeof x.props.label === 'string' && x.props.label.startsWith(l + ' (')));
+ for (const b of ['', 'd3dmetal', 'dxmt', 'dxvk', 'wined3d']) {
+ t.ok(fgrow(b ? 'CX_GRAPHICS_BACKEND=' + b : '', 'Mode') !== undefined,
+ `${b || 'automatic'} shows the frame generation mode`);
+ }
+ t.ok(nodes('').some(x => x.type === 'Section' && x.props.label === FGL),
+ 'the frame generation section warns about latency');
+ const mode = fgrow('', 'Mode');
+ t.ok(mode.type === 'Dropdown' && mode.props.className === undefined && mode.props.strClassName === 'MSCXDrop',
+ 'the mode is a dropdown with its label above it');
+ t.ok(mode.props.rgOptions.map(x => x.label).join(',') === 'Off,2x,3x,Adaptive (fills to display refresh)' &&
+ mode.props.rgOptions.map(x => x.data).join(',') === '0,2,3,adaptive',
+ `the modes name themselves (${mode.props.rgOptions.map(x => x.label).join(',')})`);
+ t.ok(mode.props.selectedOption === '0', 'frame generation is off by default');
+ t.ok(fgRows('').length === 1, 'off hides every other frame generation row');
+ t.ok(fgrow('NOTPROTON_FRAMEGEN=0', 'Quality') === undefined, 'an explicit 0 hides them too');
+ t.ok(fgrow('NOTPROTON_FRAMEGEN=off', 'Mode').props.selectedOption === '0', 'off reads as Off');
+ const ordered = fgRows('NOTPROTON_FRAMEGEN=2').map(x => x.props.label);
+ t.ok(ordered.join('|') === ['Mode', 'Quality', FGT.ui, FGT.fb, 'Engine'].join('|'),
+ `on shows five rows in order (${ordered.join('|')})`);
+ t.ok(fgRows('NOTPROTON_FRAMEGEN=2').every(x => x.type === 'Dropdown' ? x.props.strClassName === 'MSCXDrop'
+ : x.props.className === 'MSCXRow'),
+ 'frame generation toggles are rows and its dropdowns stack their label above');
+ for (const [v, want] of [['1', '2'], ['2', '2'], ['3', '3'], ['adaptive', 'adaptive'], ['Adaptive', 'adaptive']]) {
+ t.ok(fgrow('NOTPROTON_FRAMEGEN=' + v, 'Mode').props.selectedOption === want, `${v} reads as ${want}`);
+ }
+ for (const [v, want] of [['2', 'NOTPROTON_FRAMEGEN=2 %command%'], ['3', 'NOTPROTON_FRAMEGEN=3 %command%'],
+ ['adaptive', 'NOTPROTON_FRAMEGEN=adaptive %command%']]) {
+ written.length = 0;
+ fgrow('', 'Mode').props.onChange({ data: v });
+ t.ok(last().trim() === want, `picking ${v} writes it (${last()})`);
+ }
+ written.length = 0;
+ fgrow('NOTPROTON_FRAMEGEN=1 WINEMSYNC=1', 'Mode').props.onChange({ data: '0' });
+ t.ok(last().trim() === 'WINEMSYNC=1 %command%', `turning frame generation off removes its flag (${last()})`);
+ written.length = 0;
+ fgrow('NOTPROTON_FRAMEGEN=1', 'Mode').props.onChange({ data: '3' });
+ t.ok(last().trim() === 'NOTPROTON_FRAMEGEN=3 %command%', `a legacy 1 is replaced, not kept (${last()})`);
+ written.length = 0;
+ fgrow('NOTPROTON_FRAMEGEN=2 NOTPROTON_FRAMEGEN_QUALITY=quality', 'Mode').props.onChange({ data: '0' });
+ t.ok(last().trim() === 'NOTPROTON_FRAMEGEN_QUALITY=quality %command%',
+ `turning it off keeps the sub-settings for the next time (${last()})`);
+
+ const on = 'NOTPROTON_FRAMEGEN=2';
+ const quality = fgrow(on, 'Quality');
+ t.ok(quality.type === 'Dropdown' && quality.props.selectedOption === 'balanced', 'quality is balanced by default');
+ t.ok(quality.props.rgOptions.map(x => x.label + ':' + x.data).join(',') ===
+ 'Performance:performance,Balanced:balanced,Quality:quality', 'the qualities name themselves');
+ t.ok(fgrow(on + ' NOTPROTON_FRAMEGEN_QUALITY=performance', 'Quality').props.selectedOption === 'performance',
+ 'quality reads its flag');
+ written.length = 0;
+ fgrow(on, 'Quality').props.onChange({ data: 'quality' });
+ t.ok(last().trim() === 'NOTPROTON_FRAMEGEN_QUALITY=quality NOTPROTON_FRAMEGEN=2 %command%',
+ `quality writes its flag (${last()})`);
+ written.length = 0;
+ fgrow(on + ' NOTPROTON_FRAMEGEN_QUALITY=quality', 'Quality').props.onChange({ data: 'balanced' });
+ t.ok(last().trim() === on + ' %command%', `balanced drops the flag (${last()})`);
+
+ const engine = fgrow(on, 'Engine');
+ t.ok(engine.type === 'Dropdown' && engine.props.selectedOption === 'own', 'the engine is the built-in one by default');
+ t.ok(engine.props.rgOptions.map(x => x.label + ':' + x.data).join(',') ===
+ 'Built-in optical flow:own,MetalFX:metalfx', 'the engines name themselves');
+ t.ok(fgrow(on + ' NOTPROTON_FRAMEGEN_ENGINE=metalfx', 'Engine').props.selectedOption === 'metalfx',
+ 'the engine reads its flag');
+ written.length = 0;
+ fgrow(on, 'Engine').props.onChange({ data: 'metalfx' });
+ t.ok(last().includes('NOTPROTON_FRAMEGEN_ENGINE=metalfx '), `the engine writes its flag (${last()})`);
+ written.length = 0;
+ fgrow(on + ' NOTPROTON_FRAMEGEN_ENGINE=metalfx', 'Engine').props.onChange({ data: 'own' });
+ t.ok(last().trim() === on + ' %command%', `own drops the flag (${last()})`);
+
+ // Both toggles are on unless told otherwise, which only the run script defaults say.
+ globalThis.MSCXFx = { g: {}, a: {}, e: {},
+ d: { NOTPROTON_FRAMEGEN_UI: '1', NOTPROTON_FRAMEGEN_FALLBACK: '1' } };
+ for (const [k, l] of [['NOTPROTON_FRAMEGEN_UI', FGT.ui], ['NOTPROTON_FRAMEGEN_FALLBACK', FGT.fb]]) {
+ t.ok(fgrow(on, l).type === 'Toggle' && fgrow(on, l).props.checked === true, `${k} is on by default`);
+ t.ok(fgrow(on + ` ${k}=0`, l).props.checked === false, `${k} reads 0 as off`);
+ written.length = 0;
+ fgrow(on, l).props.onChange(false);
+ t.ok(last().trim() === `${k}=0 ${on} %command%`, `turning ${k} off writes 0 (${last()})`);
+ written.length = 0;
+ fgrow(on + ` ${k}=0`, l).props.onChange(true);
+ t.ok(last().trim() === `${on} %command%`, `turning ${k} back on drops it (${last()})`);
+ }
+ // A conf that turns frame generation on: Off has to say so, picking the conf's mode says nothing.
+ globalThis.MSCXFx = { g: { NOTPROTON_FRAMEGEN: '1', NOTPROTON_FRAMEGEN_QUALITY: 'performance',
+ NOTPROTON_FRAMEGEN_ENGINE: 'metalfx', NOTPROTON_FRAMEGEN_UI: '0' },
+ a: {}, e: {}, d: { NOTPROTON_FRAMEGEN_UI: '1', NOTPROTON_FRAMEGEN_FALLBACK: '1' } };
+ t.ok(fgrow('', 'Mode').props.selectedOption === '2', 'a global conf 1 reads frame generation as 2x');
+ t.ok(fgRows('').length === 5, 'a conf that turns it on shows every row');
+ t.ok(fgrow('', 'Quality').props.selectedOption === 'performance', 'quality reads the conf');
+ t.ok(fgrow('', 'Engine').props.selectedOption === 'metalfx', 'the engine reads the conf');
+ t.ok(fgrow('', FGT.ui).props.checked === false, 'the conf beats the run script default');
+ written.length = 0;
+ fgrow('', 'Mode').props.onChange({ data: '0' });
+ t.ok(last().trim() === 'NOTPROTON_FRAMEGEN=0 %command%', `off over a conf default writes 0 (${last()})`);
+ written.length = 0;
+ fgrow('NOTPROTON_FRAMEGEN=0', 'Mode').props.onChange({ data: '2' });
+ t.ok(last() === '', `the conf's own mode drops the override (${JSON.stringify(last())})`);
+ written.length = 0;
+ fgrow('', 'Quality').props.onChange({ data: 'balanced' });
+ t.ok(last().trim() === 'NOTPROTON_FRAMEGEN_QUALITY=balanced %command%',
+ `balanced over a conf default writes it (${last()})`);
+ delete globalThis.MSCXFx;
+
+ // Native macOS builds with nothing pinned run through np-native: HUD, frame generation, pads.
+ const HOME = '/Users/some one';
+ const NAT = "'/Users/some one/.notproton/np-native'";
+ const mac = (o, over) => details(o, Object.assign({ vecPlatforms: ['osx'], strCompatToolName: '' }, over || {}));
+ const nnodes = o => walk(P({ details: mac(o) }));
- const nrow = (o, l) => nnodes(o).find(x => x.props.label === l);
++ const nrow = (o, l) => nnodes(o).find(x => x.props.label === l || (typeof x.props.label === 'string' && x.props.label.startsWith(l + ' (')));
+ globalThis.MSCXFx = { g: { MTL_HUD_ENABLED: '1', NOTPROTON_FRAMEGEN: '2' }, a: { 287700: { WINEMSYNC: '1' } },
+ e: {}, d: { NOTPROTON_FRAMEGEN_UI: '1', NOTPROTON_FRAMEGEN_FALLBACK: '1' },
+ ng: {}, na: {}, h: HOME };
+ let n = nnodes('');
+ t.ok(P({ details: mac('') }) !== null && P({ details: mac('') }).props.className === 'MSCXPanel',
+ 'a mac build with nothing pinned renders the native panel');
+ t.ok(toggles(n).join('|') === 'Metal HUD' && sections(n).join(',') === 'Frame,Controllers',
+ `the native panel has the HUD, frame generation and controllers only (${toggles(n)} / ${sections(n)})`);
+ t.ok(n.filter(x => x.type === 'Dropdown').map(x => x.props.label).join(',') === 'Mode,Controller layer',
+ 'native dropdowns: the mode and the controller layer');
+ t.ok(nrow('', 'Metal HUD').props.checked === false && nrow('', 'Mode').props.selectedOption === '0',
+ 'the Wine confs do not reach a native game');
+ t.ok(nnodes('NOTPROTON_FRAMEGEN=3 %command%').filter(x => x.props.label === 'Quality').length === 1,
+ 'the native panel carries the same frame generation rows');
+ const pad = nrow('', 'Controller layer');
+ t.ok(pad.props.rgOptions.map(x => x.label + ':' + x.data).join(',') ===
+ 'Automatic:,Raw HID (Unity, SDL, Unreal):hid,GameController:gc,Off:off', 'the controller layers name themselves');
+ t.ok(pad.props.selectedOption === '', 'Automatic is selected when NP_PAD_MODE is unset everywhere');
+ t.ok(nrow(NAT + ' MTL_HUD_ENABLED=1 %command%', 'Controller layer').props.selectedOption === '',
+ 'Automatic stays selected when other variables are set');
+ t.ok(pad.props.strClassName === 'MSCXDrop', 'the controller layer is a stacked dropdown');
+ t.ok(nnodes('').some(x => x.type === 'Section' && x.props.label === 'Controllers'), 'the native controller section');
+ t.ok(P({ details: mac('', { unAppID: 3420702832 }) }).props.children.props.children.length > 4,
+ 'a mac shortcut still gets the full panel');
+ t.ok(P({ details: mac('', { strCompatToolName: 'notproton' }) }).props.children.props.children.length > 4,
+ 'a mac build with a tool pinned still gets the full panel');
+
+ const ARCH = '/usr/bin/arch -arm64 -x86_64 -e "DYLD_INSERT_LIBRARIES=/Users/x/Library/Application Support/a.dylib"' +
+ ' -e NP_PAD_MODE=hid -e MTL_HUD_ENABLED=1 %command% -novid';
+ const NEW = '/Users/someone/.notproton/np-native NP_PAD_MODE=hid MTL_HUD_ENABLED=1 %command% -novid';
+ for (const [name, o] of [['arch', ARCH], ['np-native', NEW]]) {
+ t.ok(nrow(o, 'Metal HUD').props.checked === true, `${name}: the HUD reads from -e/VAR pairs`);
+ t.ok(nrow(o, 'Controller layer').props.selectedOption === 'hid', `${name}: the controller layer reads hid`);
+ written.length = 0;
+ nrow(o, 'Controller layer').props.onChange({ data: 'gc' });
+ t.ok(last() === NAT + ' NP_PAD_MODE=gc MTL_HUD_ENABLED=1 %command% -novid',
+ `${name}: rewritten under the launcher, -novid kept (${last()})`);
+ written.length = 0;
+ nrow(o, 'Mode').props.onChange({ data: 'adaptive' });
+ t.ok(last() === NAT + ' NP_PAD_MODE=hid MTL_HUD_ENABLED=1 NOTPROTON_FRAMEGEN=adaptive %command% -novid',
+ `${name}: a new variable goes before %command% (${last()})`);
+ written.length = 0;
+ nrow(o, 'Metal HUD').props.onChange(false);
+ t.ok(last() === NAT + ' NP_PAD_MODE=hid %command% -novid', `${name}: turning the HUD off drops it (${last()})`);
+ }
+ for (const [name, o] of [['arch', ARCH], ['np-native', NEW]]) {
+ written.length = 0;
+ nrow(o, 'Controller layer').props.onChange({ data: '' });
+ t.ok(last() === NAT + ' MTL_HUD_ENABLED=1 %command% -novid',
+ `${name}: Automatic from hid drops NP_PAD_MODE, keeps np-native and -novid (${last()})`);
+ }
+ written.length = 0;
+ nrow(NAT + ' NP_PAD_MODE=gc %command% -novid +map x', 'Controller layer').props.onChange({ data: '' });
+ t.ok(last() === NAT + ' %command% -novid +map x', `Automatic as the last variable keeps the launcher (${last()})`);
+ written.length = 0;
+ nrow('/x/.notproton/np-native MTL_HUD_ENABLED=1 %command% -novid', 'Metal HUD').props.onChange(false);
+ t.ok(last() === NAT + ' %command% -novid', `no variable left keeps the launcher and the arguments (${last()})`);
+ written.length = 0;
+ nrow('', 'Controller layer').props.onChange({ data: 'off' });
+ t.ok(last() === NAT + ' NP_PAD_MODE=off %command%', `empty options get the launcher (${last()})`);
+ written.length = 0;
+ nrow('-novid', 'Mode').props.onChange({ data: '3' });
+ t.ok(last() === NAT + ' NOTPROTON_FRAMEGEN=3 %command% -novid', `bare game arguments follow %command% (${last()})`);
+
+ // Native defaults come from np-native's confs, the per-app one first.
+ globalThis.MSCXFx = { g: {}, a: {}, e: {}, d: { NOTPROTON_FRAMEGEN_UI: '1', NOTPROTON_FRAMEGEN_FALLBACK: '1' },
+ ng: { MTL_HUD_ENABLED: '1', NP_PAD_MODE: 'hid', NOTPROTON_FRAMEGEN: 'adaptive' },
+ na: { 287700: { NP_PAD_MODE: 'gc' } }, h: '/Users/me' };
+ t.ok(nrow('', 'Metal HUD').props.checked === true, 'native-default.conf reads the HUD as on');
+ t.ok(nrow('', 'Mode').props.selectedOption === 'adaptive', 'native-default.conf sets the mode');
+ t.ok(nrow('', 'Controller layer').props.selectedOption === 'gc', 'the per-app native conf beats the default');
+ t.ok(nrow('', FGT.ui).props.checked === true, 'the shim defaults hold for native games');
+ written.length = 0;
+ nrow('', 'Metal HUD').props.onChange(false);
+ t.ok(last() === '/Users/me/.notproton/np-native MTL_HUD_ENABLED=0 %command%',
+ `turning a native default off writes 0 under the home from the page (${last()})`);
+ written.length = 0;
+ nrow('NP_PAD_MODE=hid %command%', 'Controller layer').props.onChange({ data: 'gc' });
+ t.ok(last() === '/Users/me/.notproton/np-native %command%', `the conf's own layer drops the override (${last()})`);
+ // Without a home from the page the launcher already there is reused, and nothing is guessed.
+ globalThis.MSCXFx = { g: {}, a: {}, e: {}, d: {} };
+ written.length = 0;
+ nrow(NEW, 'Mode').props.onChange({ data: '2' });
+ t.ok(last() === '/Users/someone/.notproton/np-native NP_PAD_MODE=hid MTL_HUD_ENABLED=1 NOTPROTON_FRAMEGEN=2 %command% -novid',
+ `no home: the existing launcher path is kept (${last()})`);
+ written.length = 0;
+ nrow(ARCH, 'Mode').props.onChange({ data: '2' });
+ t.ok(written.length === 0, 'no home and no launcher: nothing is written');
+ delete globalThis.MSCXFx;
+
const css = nodes('').filter(x => x.type === 'style');
t.ok(css.length === 1 && css[0].props.children.includes('.MSCXPanel .MSCXRow{'),
'the panel carries one stylesheet defining the row rule');
diff --cc dylib/tests/panel-behavior/effective.js
index ea86313,0000000..49a0538
mode 100644,000000..100644
--- a/dylib/tests/panel-behavior/effective.js
+++ b/dylib/tests/panel-behavior/effective.js
@@@ -1,122 -1,0 +1,122 @@@
+// The conf defaults as the page receives them: the patched chunk is run the way Steam
+// serves it, from a home laid out like a real install, and the panel then rendered
+// against what that chunk defined.
+'use strict';
+const fs = require('fs');
+const os = require('os');
+const path = require('path');
+const vm = require('vm');
+const { execFileSync } = require('child_process');
+const { panel, walk, details, runner, FORMS } = require('./harness');
+
+const emit = process.argv[2];
+if (!emit) { console.error('usage: effective.js <emit>'); process.exit(2); }
+
+// A quote and a space in the home have to reach the page escaped and the launch options quoted.
+const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'np-effective-'));
+const home = path.join(tmp, 'home "q" x');
+const np = path.join(home, 'Library', 'Application Support', 'notproton');
+const put = (rel, text) => {
+ fs.mkdirSync(path.dirname(path.join(np, rel)), { recursive: true });
+ fs.writeFileSync(path.join(np, rel), text);
+};
+put('gamefixes/default.conf',
+ '# Global defaults for every game (lowest precedence: per-game confs and Steam launch options win).\n' +
+ 'MTL_HUD_ENABLED=1\nRETINA=1\n' +
+ '# Rosetta hides AVX/AVX2 unless asked; many games quit without it.\n' +
+ 'ROSETTA_ADVERTISE_AVX=1\n' +
+ '# Exposes DLSS through MetalFX (D3DMetal); only takes effect when DLSS is switched on in the game.\n' +
+ 'D3DM_ENABLE_METALFX=1\n' +
+ 'FRAMEGEN=1\nFRAMEGEN_QUALITY=quality\nFRAMEGEN_UI=0\nFRAMEGEN_FALLBACK=0\nFRAMEGEN_ENGINE=metalfx\n');
+put('gamefixes-default/1888930.conf', 'ROSETTA_ADVERTISE_AVX=1\n');
+put('gamefixes/1778821.conf', 'FRAMEGEN=0\n');
+// np-native's own confs: raw variable names, export and quotes allowed.
+put('gamefixes/native-default.conf', '# native\nexport MTL_HUD_ENABLED=1\nNP_PAD_MODE = "hid"\n' +
+ 'NOTPROTON_FRAMEGEN=3\nFRAMEGEN=2\nNOTPROTON_RETINA=1\n');
+put('gamefixes/native/1778820.conf', "NP_PAD_MODE='gc'\nNOTPROTON_FRAMEGEN_ENGINE=metalfx\n");
+// The first tool is the default one, and its name runs past the 16 characters a value may.
+put('tools',
+ 'notproton-winecx-11.17\twinecx-11.17\trosetta\tWineCX 11.17 (msync, D3DMetal)\n' +
+ 'notproton-winecx\twinecx-11.15\trosetta\tWineCX 11.15 (msync, D3DMetal)\n' +
+ 'notproton-winehq\twinehq-11.15\trosetta\tWineHQ 11.15 - Rosetta\n');
+
+// Steam's chunks end in a source map comment with no newline after it.
+const chunk = path.join(home, 'chunk.js');
+const fixture = path.join(__dirname, '..', 'webpatch-fixtures', 'gates.forcetool.js');
+const map = '//# sourceMappingURL=file:///home/buildbot/steamui/sourcemaps/chunk~2dcc5aaf7.js.map';
+fs.writeFileSync(chunk, fs.readFileSync(fixture, 'utf8').replace(/\n$/, '') + map);
+
+let failed = 0;
+const t0 = runner('chunk');
+let fx;
+try {
+ const out = execFileSync(emit, ['transform', chunk, 'notproton-winecx-11.17'],
+ { encoding: 'utf8', env: Object.assign({}, process.env, { HOME: home }) });
+ // Everything from the comment on is code the browser parses at the end of the chunk.
+ const tail = out.slice(out.lastIndexOf(map));
+ const ctx = vm.createContext({});
+ vm.runInContext(tail, ctx);
+ fx = ctx.MSCXFx;
+} finally {
+ fs.rmSync(tmp, { recursive: true, force: true });
+}
+t0.ok(fx !== undefined, 'the defaults survive the source map comment the chunk ends in');
+t0.ok(!!(fx && fx.e && fx.e['notproton-winecx-11.17'] && fx.e['notproton-winecx-11.17'].WINEMSYNC === '1'),
+ 'a tool name longer than a value still reaches the engine map');
+t0.ok(!!(fx && fx.e && fx.e[''] && fx.e[''].WINEMSYNC === '1'), 'the default tool stands in for an unpinned game');
+t0.ok(!!fx && fx.h === home, `the home reaches the page escaped (${fx && JSON.stringify(fx.h)})`);
+t0.ok(!!fx && JSON.stringify(fx.g).includes('"NOTPROTON_FRAMEGEN":"1"') &&
+ fx.g.NOTPROTON_FRAMEGEN_QUALITY === 'quality' && fx.g.NOTPROTON_FRAMEGEN_UI === '0' &&
+ fx.g.NOTPROTON_FRAMEGEN_FALLBACK === '0' && fx.g.NOTPROTON_FRAMEGEN_ENGINE === 'metalfx',
+ 'the FRAMEGEN conf keys map to their variables');
+t0.ok(!!fx && fx.d.NOTPROTON_FRAMEGEN_UI === '1' && fx.d.NOTPROTON_FRAMEGEN_FALLBACK === '1',
+ 'Protect UI and the fast-motion fallback default on');
+t0.ok(!!fx && JSON.stringify(fx.ng) === '{"MTL_HUD_ENABLED":"1","NP_PAD_MODE":"hid","NOTPROTON_FRAMEGEN":"3"}',
+ `native-default.conf is read the way np-native reads it (${fx && JSON.stringify(fx.ng)})`);
+t0.ok(!!fx && JSON.stringify(fx.na) === '{"1778820":{"NP_PAD_MODE":"gc","NOTPROTON_FRAMEGEN_ENGINE":"metalfx"}}',
+ `native/<appid>.conf lands per app (${fx && JSON.stringify(fx.na)})`);
+failed += t0.failed;
+
+const LABELS = ['Metal HUD', 'DLSS', 'Advertise AVX2 to Rosetta', 'MSync', 'High Resolution',
- 'Let games read controllers directly'];
++ 'Let games read controllers directly (May break Steam Input. Not recommended)'];
+globalThis.MSCXFx = fx;
+for (const form of Object.keys(FORMS)) {
+ const { render: P, written } = panel(emit, form);
+ const t = runner(form);
+ const rows = over => walk(P({ details: details('', Object.assign({ unAppID: 1778820 }, over)) }))
+ .filter(x => x.type === 'Toggle');
+ const checked = over => rows(over).filter(x => x.props.checked).map(x => x.props.label);
+ const on = checked({ strCompatToolName: '' });
+ t.ok(LABELS.every(l => on.includes(l)),
+ `a game on the default tool shows every conf and engine default on (${on.join(',')})`);
+ t.ok(checked({ strCompatToolName: 'notproton-winecx-11.17' }).includes('MSync'),
+ 'the default tool named outright reads MSync as on');
+ t.ok(!checked({ strCompatToolName: 'notproton-winehq' }).includes('MSync'),
+ 'a tool without msync reads MSync as off');
+ // Frame generation as the confs set it up.
+ const fg = (id, o, os) => walk(P({ details: details(o || '', Object.assign({ unAppID: id }, os || {})) }));
+ const lab = (ns, l) => ns.find(x => x.props.label === l);
+ let ns = fg(1778820);
+ t.ok(lab(ns, 'Mode').props.selectedOption === '2' && lab(ns, 'Quality').props.selectedOption === 'quality' &&
+ lab(ns, 'Engine').props.selectedOption === 'metalfx' &&
+ lab(ns, 'Protect UI (keeps static HUD and menus sharp)').props.checked === false &&
+ lab(ns, 'Fast-motion fallback (skips frames that would smear)').props.checked === false,
+ 'the global FRAMEGEN keys show through, 1 as 2x');
+ t.ok(lab(fg(1778821), 'Mode').props.selectedOption === '0' && !lab(fg(1778821), 'Quality'),
+ 'a per-app FRAMEGEN=0 turns it off and hides the rest');
+ // A native build reads np-native's confs and writes under the escaped home.
+ const mac = { vecPlatforms: ['osx'], strCompatToolName: '' };
+ ns = fg(1778820, '', mac);
+ t.ok(lab(ns, 'Metal HUD').props.checked === true && lab(ns, 'Mode').props.selectedOption === '3' &&
+ lab(ns, 'Controller layer').props.selectedOption === 'gc' && lab(ns, 'Engine').props.selectedOption === 'metalfx',
+ 'a native game shows the native confs, per app over default');
+ t.ok(lab(fg(999, '', mac), 'Controller layer').props.selectedOption === 'hid', 'another native game gets the default');
+ written.length = 0;
+ lab(fg(999, '-novid', mac), 'Metal HUD').props.onChange(false);
+ const want = "'" + home.replace(/'/g, "'\\''") + "/.notproton/np-native' MTL_HUD_ENABLED=0 %command% -novid";
+ t.ok(written.length === 1 && written[0].opts === want, `the launcher path is the user's home (${written[0] && written[0].opts})`);
+ failed += t.failed;
+}
+delete globalThis.MSCXFx;
+
+if (failed) { console.error(`effective: ${failed} check(s) failed`); process.exit(1); }
diff --cc dylib/tests/settingscheck.sh
index 56c4944,b567a03..6d9dc61
--- a/dylib/tests/settingscheck.sh
+++ b/dylib/tests/settingscheck.sh
@@@ -38,11 -39,10 +39,12 @@@ settings()
printf '%s\r\n' 'Windows Registry Editor Version 5.00' '' \
'[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug]' '"Auto"="0"' '' \
'[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug]' '"Auto"="0"' '' \
- '[HKEY_CURRENT_USER\Software\Wine\WineDbg]' '"ShowCrashDialog"=dword:00000000' '' \
- '[HKEY_CURRENT_USER\Software\Wine\Mac Driver]' "$1" '' \
- '[HKEY_LOCAL_MACHINE\Software\Classes\steam]' '"URL Protocol"=""' '' \
+ '[HKEY_CURRENT_USER\Software\Wine\WineDbg]' '"ShowCrashDialog"=dword:00000000' ''
+ [ -z "$1" ] || printf '%s\r\n' '[HKEY_CURRENT_USER\Software\Wine\Mac Driver]' "$1" ''
+ [ -z "$2" ] || printf '%s\r\n' '[HKEY_CURRENT_USER\Control Panel\Desktop]' "\"LogPixels\"=dword:$2" ''
+ printf '%s\r\n' '[HKEY_LOCAL_MACHINE\Software\Classes\steam]' '"URL Protocol"=""' '' \
+ '[HKEY_LOCAL_MACHINE\Software\NVIDIA Corporation\Global\NGXCore]' \
+ '"FullPath"="C:\\Windows\\System32"' '' \
'[HKEY_LOCAL_MACHINE\Software\Classes\steam\shell\open\command]' \
'@="\"C:\\Program Files (x86)\\Steam\\steam.exe\" \"%1\""' ''
}
diff --cc dylib/version.h
index c853aad,664bce1..796ab12
--- a/dylib/version.h
+++ b/dylib/version.h
@@@ -2,6 -2,6 +2,6 @@@
#ifndef NOTPROTON_VERSION_H
#define NOTPROTON_VERSION_H
- #define NOTPROTON_VERSION "1.1.9-winehq.1-ray.31"
-#define NOTPROTON_VERSION "1.2.0"
++#define NOTPROTON_VERSION "1.2.0-winehq.1-ray.32"
#endif // NOTPROTON_VERSION_H
diff --cc native-shim/build.sh
index c69efe5,0000000..66240bf
mode 100755,000000..100755
--- a/native-shim/build.sh
+++ b/native-shim/build.sh
@@@ -1,51 -1,0 +1,52 @@@
+#!/bin/bash
+# Builds libnp_gamepad.dylib (universal arm64 + x86_64: most native games run under
+# Rosetta) into native-shim/out/ and ad-hoc signs it.
+# Env: NP_MIN_MACOS sets -mmacosx-version-min (default: the compiler's default).
+set -euo pipefail
+
+here="$(cd "$(dirname "$0")" && pwd)"
+out="$here/out"
+obj="$out/obj"
+lib="$out/libnp_gamepad.dylib"
+arches=(-arch arm64 -arch x86_64)
+cflags=(-O2 -Wall -Werror -I"$here" "${arches[@]}")
+[ -n "${NP_MIN_MACOS:-}" ] && cflags+=(-mmacosx-version-min="$NP_MIN_MACOS")
+
+mkdir -p "$obj"
+rm -f "$obj"/*.o
+
+objects=()
+compile() { # source, extra flags...
+ local src="$1"; shift
- local o="$obj/$(basename "${src%.*}").o"
++ local o
++ o="$obj/$(basename "${src%.*}").o"
+ if ! clang "${cflags[@]}" "$@" -c "$here/$src" -o "$o"; then
+ echo "build.sh: FAILED compiling $src" >&2
+ exit 1
+ fi
+ objects+=("$o")
+}
+
+for src in gamepad_shim.c hid_profile.c; do
+ if [ ! -f "$here/$src" ]; then
+ echo "build.sh: FAILED: $src is missing" >&2
+ exit 1
+ fi
+done
+
+compile gamepad_shim.c
+compile hid_profile.c
+if [ -f "$here/gc_virtual.m" ]; then
+ compile gc_virtual.m -fobjc-arc
+else
+ echo "build.sh: warning: gc_virtual.m not found, building without the GameController path" >&2
+fi
+
+if ! clang -dynamiclib "${cflags[@]}" -o "$lib" "${objects[@]}" \
+ -framework IOKit -framework CoreFoundation -framework Foundation \
+ -framework GameController; then
+ echo "build.sh: FAILED linking $lib (undefined np_* symbols mean hid_profile.c or gc_virtual.m is incomplete)" >&2
+ exit 1
+fi
+codesign -s - -f "$lib"
+echo "build.sh: built $lib ($(lipo -archs "$lib"))"
diff --cc scripts/sync-upstream.sh
index 389f6fb,0000000..e4ef090
mode 100755,000000..100755
--- a/scripts/sync-upstream.sh
+++ b/scripts/sync-upstream.sh
@@@ -1,95 -1,0 +1,93 @@@
+#!/bin/sh
+# Merge new work from the projects this fork follows, keeping every local patch.
+#
+# scripts/sync-upstream.sh merge, then print what came in
+# scripts/sync-upstream.sh --check only report whether anything new is upstream
+#
+# Source: NotProtonNot/NotProton (remote upstream). The fork this one started from,
+# leonseemann/NotProton-WineHQ, was deleted in October 2026. Upstream is merged with a merge commit, never
+# rebased or taken with -X theirs, so local commits stay as they are. The only conflict
+# resolved automatically is dylib/version.h: the result is upstream's base version with
+# this fork's "-winehq.N-ray.M" suffix, M bumped so Sparkle sees a newer build. Any
+# other conflict aborts that merge and leaves the tree untouched.
+
+set -eu
+
+repo=$(cd "$(dirname "$0")/.." && pwd)
+cd "$repo"
+
+check_only=0
+case "${1:-}" in
+ --check) check_only=1 ;;
+ "") ;;
+ *) sed -n '2,5p' "$0" | sed 's/^# \{0,1\}//'; exit 1 ;;
+esac
+
+ensure_remote() {
+ url=$(git remote get-url "$1" 2>/dev/null || true)
+ [ -n "$url" ] || git remote add "$1" "$2"
+}
+ensure_remote upstream https://github.com/NotProtonNot/NotProton
+
+if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
+ echo "==> the tree has uncommitted changes, commit them first" >&2
+ exit 1
+fi
+
+git fetch -q upstream
+
+version_of() {
+ sed -n 's/^#define NOTPROTON_VERSION "\(.*\)"/\1/p'
+}
+
+pending=""
- for ref in upstream/main; do
- count=$(git rev-list --count "HEAD..$ref")
- [ "$count" -eq 0 ] || pending="$pending $ref:$count"
- done
++count=$(git rev-list --count "HEAD..upstream/main")
++[ "$count" -eq 0 ] || pending=" upstream/main:$count"
+
+if [ -z "$pending" ]; then
+ echo "==> up to date with upstream/main"
+ exit 0
+fi
+echo "==> new upstream commits:$pending"
+[ "$check_only" -eq 0 ] || exit 2
+
+ours_before=$(version_of <dylib/version.h)
+for entry in $pending; do
+ ref=${entry%%:*}
+ echo "==> merging $ref"
+ if git merge --no-ff --no-edit "$ref" >/dev/null 2>&1; then
+ continue
+ fi
+ conflicts=$(git diff --name-only --diff-filter=U)
+ if [ "$conflicts" != "dylib/version.h" ]; then
+ git merge --abort
+ echo "==> $ref conflicts with local patches in:" >&2
+ # shellcheck disable=SC2086 # one path per line
+ printf ' %s\n' $conflicts >&2
+ echo " nothing was merged from $ref; resolve it by hand" >&2
+ exit 1
+ fi
+ theirs=$(git show "$ref:dylib/version.h" | version_of)
+ base=${theirs%%-*}
+ suffix=${ours_before#*-}
+ ray=${suffix##*-ray.}
+ next="$base-${suffix%-ray.*}-ray.$((ray + 1))"
+ printf '%s\n' "// Build version string" "#ifndef NOTPROTON_VERSION_H" "#define NOTPROTON_VERSION_H" "" \
+ "#define NOTPROTON_VERSION \"$next\"" "" "#endif // NOTPROTON_VERSION_H" >dylib/version.h
+ git add dylib/version.h
+ git commit -q --no-edit
+ echo "==> version $ours_before -> $next"
+done
+
+ours_after=$(version_of <dylib/version.h)
+if [ "$ours_after" = "$ours_before" ]; then
+ # The merges were clean but a release still needs a newer version than the last one.
+ suffix=${ours_before#*-}
+ ray=${suffix##*-ray.}
+ next="${ours_before%-ray.*}-ray.$((ray + 1))"
+ sed -i '' "s/^#define NOTPROTON_VERSION \".*\"/#define NOTPROTON_VERSION \"$next\"/" dylib/version.h
+ git commit -q -m "chore: bump version to $next after upstream merge" dylib/version.h
+ echo "==> version $ours_before -> $next"
+fi
+
+echo "==> merged. Build and test, then publish with scripts/release-local.sh"