Skip to content

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

recipes: an opt-in fix is offered under Advanced, never applied by Play (highball-db#60)

Gauthier Piarretteefb3a5069751
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index 9404835..c5c6a63 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -274,7 +274,9 @@ final class AppState {
renderer = instead
}
}
- if let recipe = fixRecipe(for: item),
+ // An opt-in fix is the owner's call from the page, never Play's: it helps some Macs and
+ // breaks others (RaceRoom's newer Direct3D 9, highball-db#60). Play leaves it alone.
+ if let recipe = fixRecipe(for: item), !recipe.isOptIn,
!bottle.settings.recipes.contains(recipe.id) || !recipe.artifactsPresent(driveC: bottle.driveC),
let engine = engine(for: bottle) {
// The engine comes first, whatever the steps: a recipe of plain notes that names r7
diff --git a/Sources/HighballKit/GamePageCopy.swift b/Sources/HighballKit/GamePageCopy.swift
index e20a4bc..a500d55 100644
--- a/Sources/HighballKit/GamePageCopy.swift
+++ b/Sources/HighballKit/GamePageCopy.swift
@@ -79,7 +79,14 @@ public enum GamePageCopy {
if let args = entry?.effectiveLaunchArgs(osMajor: osMajor), !args.isEmpty {
items.append(WillDo(text: "Start it with \(args.joined(separator: " "))"))
}
- if let recipe {
+ if let recipe, recipe.isOptIn {
+ // Play does not touch an opt-in fix; the page says so rather than listing steps
+ // Play will not take.
+ items.append(WillDo(text: applied
+ ? "Keep the \(recipe.title) fix you applied under Advanced"
+ : "Leave the optional \(recipe.title) fix alone; it is under Advanced for when the notes say your Mac needs it",
+ done: applied))
+ } else if let recipe {
for step in recipe.steps {
guard let text = describe(step) else { continue }
items.append(WillDo(text: text, cost: applied ? nil : step.slowHint, done: applied))
diff --git a/Sources/HighballKit/Recipe.swift b/Sources/HighballKit/Recipe.swift
index 714b2a3..21a1588 100644
--- a/Sources/HighballKit/Recipe.swift
+++ b/Sources/HighballKit/Recipe.swift
@@ -254,6 +254,13 @@ public struct Recipe: Codable, Sendable, Identifiable {
public var knownIssues: [KnownIssue]?
public var lastVerified: Verification?
public var blocked: Blocked?
+ /// True for a fix Play must never apply on its own: it helps some Macs and breaks others,
+ /// so the page offers it under Advanced and the notes say when to try it. The first one is
+ /// RaceRoom's newer Direct3D 9 layer (highball-db#60): it rendered the game for one reporter
+ /// and drew it in grayscale for another. An opt-in recipe still counts as the game's fix
+ /// for the page's wording and for artifact checks once applied.
+ public var optIn: Bool?
+ public var isOptIn: Bool { optIn ?? false }
/// What an installed runtime leaves behind, so the Dependencies panel can tell "installed"
/// from "our recipe ran": a file under drive_c, or a registry value in system.reg (exact
/// match or a minimum for dword values). Any one marker satisfied means installed. Data, so
diff --git a/Tests/HighballKitTests/GamePageCopyTests.swift b/Tests/HighballKitTests/GamePageCopyTests.swift
index 1393fd9..233c2a3 100644
--- a/Tests/HighballKitTests/GamePageCopyTests.swift
+++ b/Tests/HighballKitTests/GamePageCopyTests.swift
@@ -38,6 +38,30 @@ final class GamePageCopyTests: XCTestCase {
XCTAssertEqual(GamePageCopy.verdict(e, myChip: "Apple M1", today: today).headline, "Can't run: Vanguard.")
}
+ /// An opt-in fix is never Play's to apply (highball-db#60): the page says so instead of
+ /// listing steps Play will not take, and decoding keeps the flag.
+ func testAnOptInFixIsLeftToTheOwner() throws {
+ let e = try entry(#"{"id":"x","title":"X","steam_appid":1,"status":"community","renderer":"dxvk"}"#)
+ var recipe = Recipe(id: "x", kind: .game, title: "Modern Direct3D 9", steps: [
+ .copy(from: "renderers/d9vk-modern/wine/x86_64-windows/d3d9.dll", to: "game/d3d9.dll", asNative: true),
+ ])
+ recipe.optIn = true
+ XCTAssertTrue(recipe.isOptIn)
+ let items = GamePageCopy.willDo(e, recipe: recipe, applied: false, bottleRenderer: .dxvk, osMajor: 26)
+ XCTAssertEqual(items.map(\.text), [
+ "Use DXVK (Vulkan on Metal), the way it was verified",
+ "Leave the optional Modern Direct3D 9 fix alone; it is under Advanced for when the notes say your Mac needs it",
+ ])
+ let done = GamePageCopy.willDo(e, recipe: recipe, applied: true, bottleRenderer: .dxvk, osMajor: 26)
+ XCTAssertEqual(done[1].text, "Keep the Modern Direct3D 9 fix you applied under Advanced")
+ XCTAssertTrue(done[1].done)
+ let json = #"{"id":"x","kind":"game","title":"t","optIn":true,"steps":[{"type":"note","text":"n"}]}"#
+ let decoded = try JSONDecoder.highball.decode(Recipe.self, from: Data(json.utf8))
+ XCTAssertTrue(decoded.isOptIn)
+ let plain = try JSONDecoder.highball.decode(Recipe.self, from: Data(#"{"id":"y","kind":"game","title":"t","steps":[{"type":"note","text":"n"}]}"#.utf8))
+ XCTAssertFalse(plain.isOptIn, "absent means Play applies it, as every recipe before")
+ }
+
func testWillDoListsRendererArgsAndRecipeSteps() throws {
let e = try entry(#"{"id":"x","title":"X","steam_appid":1,"status":"verified-local","renderer":"dxmt","launchArgs":["-windowed"]}"#)
let recipe = Recipe(id: "x", kind: .game, title: "X fix", steps: [