Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
fix: bottles identify as an AMD GPU to Windows games (NVAPI class)
Gauthier Piarrette4fd3d8fce93b
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swiftindex e841562..1cd138c 100644--- a/Sources/HighballApp/AppState.swift+++ b/Sources/HighballApp/AppState.swift@@ -309,6 +309,7 @@ final class AppState {guard r.exitStatus == 0 else {throw HighballError.processFailed(command: "wineboot -u", status: r.exitStatus, output: "see \(r.log.path)")}+ try? await runner.setGpuIdentity()await MainActor.run { self.appendLog("bottle repaired — Windows environment refreshed") }}}diff --git a/Sources/HighballKit/BottleStore.swift b/Sources/HighballKit/BottleStore.swiftindex 6fa3b2e..fc8c477 100644--- a/Sources/HighballKit/BottleStore.swift+++ b/Sources/HighballKit/BottleStore.swift@@ -63,6 +63,7 @@ public struct BottleStore: Sendable {throw HighballError.processFailed(command: "wineboot -u", status: result.exitStatus, output: "see \(result.log.path)")}if windowsVersion != .win10 { try await runner.setWindowsVersion(windowsVersion) }+ try? await runner.setGpuIdentity()return bottle}diff --git a/Sources/HighballKit/WineRunner.swift b/Sources/HighballKit/WineRunner.swiftindex a857e96..c61d1af 100644--- a/Sources/HighballKit/WineRunner.swift+++ b/Sources/HighballKit/WineRunner.swift@@ -143,6 +143,14 @@ public struct WineRunner: Sendable {try await regAdd(key: #"HKCU\Control Panel\Desktop"#, name: "LogPixels", type: "REG_DWORD", data: on ? "192" : "96")}+ /// Wine's fallback D3D reports a fake NVIDIA GPU from its card table, which makes some+ /// games (CS:GO and friends) demand NVAPI and die. Pin an AMD identity instead, matching+ /// what DXMT already advertises. Applied at bottle creation and by Repair.+ public func setGpuIdentity() async throws {+ try await regAdd(key: #"HKCU\Software\Wine\Direct3D"#, name: "VideoPciVendorID", type: "REG_DWORD", data: String(0x1002))+ try await regAdd(key: #"HKCU\Software\Wine\Direct3D"#, name: "VideoPciDeviceID", type: "REG_DWORD", data: String(0x73df))+ }+public func setWindowsVersion(_ v: WindowsVersion) async throws {_ = try await run(["winecfg", "-v", v.rawValue], renderer: .wined3d, label: "winecfg")}diff --git a/Sources/highball/main.swift b/Sources/highball/main.swiftindex 76f0566..857b06a 100644--- a/Sources/highball/main.swift+++ b/Sources/highball/main.swift@@ -168,6 +168,7 @@ struct Bottle: AsyncParsableCommand {try? runner.kill()try? await Task.sleep(for: .seconds(2))let r = try await runner.wineboot()+ try? await runner.setGpuIdentity()print(r.exitStatus == 0 ? "repaired \(name)" : "wineboot exited with \(r.exitStatus) — see \(r.log.path)")}}