Skip to content

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

Play gives a pinned program the mode it chose. Play works out a launch's mode (the game page's Mode for this game, a Direct3D 12 take-over, a mode the engine lacks swapped for one it has) and passed it to Steam and Epic launches, but a pinned program was started with its own setting alone, so a program set to Wine's own Direct3D on its page ran in the environment's mode (Velocity Ultra on D3DMetal, highball-db#493). Pin.launching(with:) applies the chosen mode for that launch. 584 tests pass on the M4.

Gauthier Piarrette193b1b23e338
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swift
index fbe381d..9f4d79d 100644
--- a/Sources/HighballApp/AppState.swift
+++ b/Sources/HighballApp/AppState.swift
@@ -661,7 +661,7 @@ final class AppState {
throughEpicLauncherStandIn: fixRecipe(for: item)?.requires?.contains("rockstar") == true)
case .pin:
guard let pin = bottle.settings.pins.first(where: { $0.id == item.pinID }) else { return }
- launch(pin: pin, in: bottle)
+ launch(pin: pin.launching(with: renderer), in: bottle)
}
}
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swift
index df4af51..9604ec5 100644
--- a/Sources/HighballKit/Bottle.swift
+++ b/Sources/HighballKit/Bottle.swift
@@ -271,6 +271,17 @@ public struct Pin: Codable, Sendable, Identifiable, Hashable {
self.name = name; self.path = path; self.arguments = arguments; self.environment = environment; self.renderer = renderer
}
+ /// This pin as one Play of it runs: the mode Play chose for the program (its page's Mode for
+ /// this game, a Direct3D 12 take-over, a mode the engine lacks swapped for one it has) replaces
+ /// the pin's own for that launch only. Play dropped it for programs, so a program set to Wine's
+ /// own Direct3D on its page still ran with the environment's mode (highball-db#493).
+ public func launching(with renderer: Renderer?) -> Pin {
+ guard let renderer else { return self }
+ var pin = self
+ pin.renderer = renderer
+ return pin
+ }
+
/// Where the pin's executable actually lives for a given bottle.
public func executableURL(driveC: URL) -> URL {
let named = launchURL(driveC: driveC)
diff --git a/Tests/HighballKitTests/LaunchChecksTests.swift b/Tests/HighballKitTests/LaunchChecksTests.swift
index c1ee707..73561ba 100644
--- a/Tests/HighballKitTests/LaunchChecksTests.swift
+++ b/Tests/HighballKitTests/LaunchChecksTests.swift
@@ -62,6 +62,15 @@ final class LaunchChecksTests: XCTestCase {
XCTAssertEqual(WineRunner.joining(["WINEMSYNC": "0", "WINEESYNC": "0"], liveSync: .esync), ["WINEMSYNC": "0", "WINEESYNC": "1"])
}
+ /// highball-db#493: a program set to Wine's own Direct3D on its page ran with the environment's D3DMetal.
+ func testPlayGivesAProgramTheModeItChose() {
+ let pin = Pin(name: "Velocity Ultra", path: "/Volumes/x/game.exe", renderer: .dxvk)
+ XCTAssertEqual(pin.launching(with: .wined3d).renderer, .wined3d, "the page's mode wins for this launch")
+ XCTAssertEqual(pin.launching(with: nil).renderer, .dxvk, "nothing chosen, the pin keeps its own")
+ XCTAssertEqual(pin.launching(with: .wined3d).id, pin.id, "the same program")
+ XCTAssertNil(Pin(name: "x", path: "x.exe").launching(with: nil).renderer, "and with none, the environment decides")
+ }
+
/// A DualSense player had "Controllers through SDL" installed and no way back but regedit.
func testRegistryOnlyTweaksCanBeRemoved() throws {
let sdl = try JSONDecoder.highball.decode(Recipe.self, from: Data("""