Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
"store": "Filter Store"
},
"help": {
"advertiseAvxForRosetta": "Enables AVX instruction set support when running Windows games through Rosetta on Apple Silicon Macs. This may be required for some games like Death Stranding that need AVX support.",
"amdfsr": "AMD's FSR helps boost framerate by upscaling lower resolutions in Fullscreen Mode. Image quality increases from 5 to 1 at the cost of a slight performance hit. Enabling may improve performance.",
"custom_themes_path": "Do not use CSS files from untrusted sources. When in doubt, ask for a review in our Discord channel.",
"custom_themes_wiki": "Check the Wiki for more details on adding custom themes. Click here.",
Expand Down Expand Up @@ -927,6 +928,7 @@
"addgamestoapplications": "Add games to Applications automatically",
"addgamestostartmenu": "Add games to start menu automatically",
"addgamestosteam": "Add games to Steam automatically",
"advertiseAvxForRosetta": "Advertise AVX for Rosetta",
"autodxvk": "Auto Install/Update DXVK on Prefix",
"autodxvknvapi": "Auto Install/Update DXVK-NVAPI on Prefix",
"autoLaunchHyperPlay": "Auto Launch HyperPlay",
Expand Down
2 changes: 2 additions & 0 deletions src/backend/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ class GlobalConfigV0 extends GlobalConfig {

// @ts-expect-error TODO: We need to settle on *one* place to define settings defaults
return {
advertiseAvxForRosetta:
isMac && (defaultWine as WineInstallation)?.type === 'toolkit',
checkUpdatesInterval: 10,
enableUpdates: false,
addDesktopShortcuts: false,
Expand Down
6 changes: 4 additions & 2 deletions src/backend/game_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class GameConfigV0 extends GameConfig {
// The settings defined work as overrides.

const {
advertiseAvxForRosetta,
autoInstallDxvk,
autoInstallVkd3d,
preferSystemLibs,
Expand Down Expand Up @@ -236,6 +237,7 @@ class GameConfigV0 extends GameConfig {
const defaultSettings = {
autoInstallDxvk,
autoInstallVkd3d,
advertiseAvxForRosetta,
preferSystemLibs,
autoSyncSaves,
enableEsync,
Expand Down Expand Up @@ -288,8 +290,8 @@ class GameConfigV0 extends GameConfig {
}
}

public setSetting(key: string, value: unknown) {
this.config[key] = value
public setSetting(key: keyof GameSettings, value: unknown) {
this.config[key] = value as never
logInfo(`${this.appName}: Setting ${key} to ${JSON.stringify(value)}`)
return this.flush()
}
Expand Down
6 changes: 6 additions & 0 deletions src/backend/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ function setupWineEnvVars(
)
}
}

// Set Rosetta AVX setting for macOS
if (isMac && gameSettings.advertiseAvxForRosetta) {
ret.ROSETTA_ADVERTISE_AVX = '1'
}

return ret
}

Expand Down
1 change: 1 addition & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export interface GameInfo {
}

export interface GameSettings {
advertiseAvxForRosetta: boolean
autoInstallDxvk: boolean
autoInstallVkd3d: boolean
autoInstallDxvkNvapi: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import ContextProvider from 'frontend/state/ContextProvider'
import React, { useContext } from 'react'
import { useTranslation } from 'react-i18next'
import SettingsContext from '../SettingsContext'
import useSetting from 'frontend/hooks/useSetting'
import { ToggleSwitch } from 'frontend/components/UI'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCircleInfo } from '@fortawesome/free-solid-svg-icons'
import { defaultWineVersion } from '..'

const AdvertiseAvxForRosetta = () => {
const { t } = useTranslation()
const { platform } = useContext(ContextProvider)
const { isMacNative } = useContext(SettingsContext)
const isMac = platform === 'darwin'
const [wineVersion] = useSetting('wineVersion', defaultWineVersion)
const [advertiseAvxForRosetta, setAdvertiseAvxForRosetta] = useSetting(
'advertiseAvxForRosetta',
false
)

// Only show on macOS when using toolkit wine and not native games
if (!isMac || isMacNative || wineVersion.type !== 'toolkit') {
return <></>
}

return (
<div className="toggleRow">
<ToggleSwitch
htmlId="advertiseAvxForRosettaToggle"
value={advertiseAvxForRosetta || false}
handleChange={() => setAdvertiseAvxForRosetta(!advertiseAvxForRosetta)}
title={t('setting.advertiseAvxForRosetta', 'Advertise AVX for Rosetta')}
/>

<FontAwesomeIcon
className="helpIcon"
icon={faCircleInfo}
title={t(
'help.advertiseAvxForRosetta',
'Enables AVX instruction set support when running Windows games through Rosetta on Apple Silicon Macs. This may be required for some games like Death Stranding that need AVX support.'
)}
/>
</div>
)
}

export default AdvertiseAvxForRosetta
1 change: 1 addition & 0 deletions src/frontend/screens/Settings/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { default as AlternativeExe } from './AlternativeExe'
export { default as AdvertiseAvxForRosetta } from './AdvertiseAvxForRosetta'
export { default as AutoDXVK } from './AutoDXVK'
export { default as AutoDXVKNVAPI } from './AutoDXVKNVAPI'
export { default as AutoUpdateGames } from './AutoUpdateGames'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { useContext, useState, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import {
AlternativeExe,
AdvertiseAvxForRosetta,
AutoDXVK,
AutoDXVKNVAPI,
AutoVKD3D,
Expand Down Expand Up @@ -115,6 +116,7 @@ export default function GamesSettings() {
{!isCrossover && (
<>
<AutoDXVK />
<AdvertiseAvxForRosetta />
{isLinux && (
<>
<AutoDXVKNVAPI />
Expand Down