Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

Database rows can gate their renderer on the macOS version

Gauthier Piarrettedcfe40e8aa75
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index eeda04a..ce672bb 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -854,7 +854,7 @@ final class AppState {
}
let steam = bottle.driveC.appending(path: "Program Files (x86)/Steam/steam.exe")
let entry = gameDB[game.appid]
- let renderer = entry?.renderer
+ let renderer = entry?.effectiveRenderer()
// Per-game launch args ride the db (e.g. windowed for legacy CS:GO on macOS 26, #21).
let extraArgs = entry?.effectiveLaunchArgs() ?? []
let markers = SessionWatch.markers(installdir: game.installdir)
diff --git a/Sources/HighballApp/GameDetailView.swift b/Sources/HighballApp/GameDetailView.swift
index ea83eb5..f4f1419 100644
--- a/Sources/HighballApp/GameDetailView.swift
+++ b/Sources/HighballApp/GameDetailView.swift
@@ -32,7 +32,7 @@ struct GameDetailView: View {
.overlay(Capsule().stroke(color.opacity(0.8), lineWidth: 1))
.foregroundStyle(color)
}
- if let r = entry?.renderer {
+ if let r = entry?.effectiveRenderer() {
Text(r.rawValue.uppercased())
.font(.system(size: 10.5, weight: .medium).monospaced())
.foregroundStyle(.secondary)
diff --git a/Sources/HighballKit/SteamLibrary.swift b/Sources/HighballKit/SteamLibrary.swift
index 2c783ae..09dd8d5 100644
--- a/Sources/HighballKit/SteamLibrary.swift
+++ b/Sources/HighballKit/SteamLibrary.swift
@@ -86,9 +86,21 @@ public struct GameDBEntry: Codable, Sendable {
/// must not change behaviour for users where the game already works (14.x fullscreen is
/// fine); nil means the args apply everywhere.
public var launchArgsMinMacOS: String?
+ /// `renderer` applies at or above this macOS version ("15.0"); below it `rendererBelow`
+ /// applies instead (nil there means the bottle's own setting). DXMT wants macOS 15 or newer
+ /// and paints nothing on 14, so a verdict taken on a newer OS must not send an older Mac to
+ /// a black screen. Data, not code: the row decides.
+ public var rendererMinMacOS: String?
+ public var rendererBelow: Renderer?
public var isBlocked: Bool { status == "blocked-anticheat" }
+ /// The renderer the row recommends on the given OS version, nil for "the bottle's own".
+ public func effectiveRenderer(osMajor: Int = ProcessInfo.processInfo.operatingSystemVersion.majorVersion) -> Renderer? {
+ guard let gate = rendererMinMacOS, let want = Int(gate.split(separator: ".").first ?? "") else { return renderer }
+ return osMajor >= want ? renderer : rendererBelow
+ }
+
/// The launch args that apply on the given OS version. Pure for testability.
public func effectiveLaunchArgs(osMajor: Int = ProcessInfo.processInfo.operatingSystemVersion.majorVersion) -> [String] {
guard let args = launchArgs else { return [] }
diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swift
index 7cf0f45..01abe9b 100644
--- a/Tests/HighballKitTests/RegressionTests.swift
+++ b/Tests/HighballKitTests/RegressionTests.swift
@@ -1352,4 +1352,17 @@ extension RegressionTests {
from: Data(#"{"name":"o","engineID":"e"}"#.utf8))
XCTAssertEqual(decoded?.rendererExplicit, false)
}
+
+ func testRendererGateByMacOSVersion() throws {
+ var e = try JSONDecoder().decode(GameDBEntry.self, from: Data("""
+ {"id":"x","title":"X","steam_appid":1,"status":"verified-local","renderer":"dxmt","rendererMinMacOS":"15.0","rendererBelow":"dxvk"}
+ """.utf8))
+ XCTAssertEqual(e.effectiveRenderer(osMajor: 26), .dxmt)
+ XCTAssertEqual(e.effectiveRenderer(osMajor: 15), .dxmt)
+ XCTAssertEqual(e.effectiveRenderer(osMajor: 14), .dxvk)
+ e.rendererBelow = nil
+ XCTAssertNil(e.effectiveRenderer(osMajor: 14), "no fallback named: the bottle's own setting")
+ e.rendererMinMacOS = nil
+ XCTAssertEqual(e.effectiveRenderer(osMajor: 14), .dxmt, "no gate: the renderer applies everywhere")
+ }
}