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
A game's row can explain a long start. Its startNotice is a sentence the activity strip shows under "<game> is running" for startNoticeMinutes after the game's process appears, 15 when the row does not say, for a game whose own loading outlasts Highball's start sheet: Microsoft Flight Simulator 2024 on the arm64 engine prepares its shaders for 6 to 7 minutes behind a still window, and nothing said why. Steam and Epic launches take it from the game's row. Rows without one are unchanged. Tested on the M4 together with the next commit: 536 tests pass.
Gauthier Piarrette8920934360f9
diff --git a/Sources/HighballApp/ActivityStrip.swift b/Sources/HighballApp/ActivityStrip.swiftindex 0aecb15..cf8aa21 100644--- a/Sources/HighballApp/ActivityStrip.swift+++ b/Sources/HighballApp/ActivityStrip.swift@@ -159,16 +159,22 @@ struct ActivityStrip: View {}private func sessionRow(_ session: GameSession) -> some View {- HStack(spacing: 10) {- Circle().fill(HB.good).frame(width: 8, height: 8).padding(.horizontal, 4)- Text(String(format: L("%@ is running"), session.title)).font(.callout.weight(.medium)).lineLimit(1)- Spacer(minLength: 12)- TimelineView(.periodic(from: .now, by: 15)) { ctx in+ TimelineView(.periodic(from: .now, by: 15)) { ctx in+ HStack(spacing: 10) {+ Circle().fill(HB.good).frame(width: 8, height: 8).padding(.horizontal, 4)+ VStack(alignment: .leading, spacing: 1) {+ Text(String(format: L("%@ is running"), session.title)).font(.callout.weight(.medium)).lineLimit(1)+ // The game's own loading after its process appeared, which nothing else explains.+ if let notice = session.notice(at: ctx.date) {+ Text(notice).font(.caption).foregroundStyle(.secondary).lineLimit(2)+ }+ }+ Spacer(minLength: 12)Text(ActivityText.minutes(since: session.started, now: ctx.date).map { String(format: L("%d min"), $0) } ?? L("just started")).font(.caption.monospacedDigit()).foregroundStyle(.secondary)+ Button(L("Stop")) { state.stopSession(session) }.controlSize(.small)}- Button(L("Stop")) { state.stopSession(session) }.controlSize(.small)+ .padding(.horizontal, 14).padding(.vertical, 8)}- .padding(.horizontal, 14).padding(.vertical, 8)}}diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swiftindex e059b4f..c7e6a0f 100644--- a/Sources/HighballApp/AppState.swift+++ b/Sources/HighballApp/AppState.swift@@ -2445,7 +2445,8 @@ final class AppState {}guard handedOff else { return }beginSession(GameSession(title: game.name, bottleName: bottle.name, appid: game.appid, markers: markers,- renderer: servedRenderer.rawValue), processList: box.processList)+ renderer: servedRenderer.rawValue, startNotice: entry?.startNotice,+ startNoticeMinutes: entry?.startNoticeMinutes), processList: box.processList)}}@@ -2684,7 +2685,8 @@ final class AppState {}}// The variables this game's recipe scoped to it (highball#198), on top of Legendary's.- let gameEnvironment = bottle.settings.environment(forGame: gameDB.byEpicAppName[game.app_name]?.id)+ let row = gameDB.byEpicAppName[game.app_name]+ let gameEnvironment = bottle.settings.environment(forGame: row?.id)watchedLaunch(box) {try await runner.start(executable, arguments: arguments,renderer: renderer, extraEnvironment: info.environment.merging(gameEnvironment) { _, new in new },@@ -2704,7 +2706,8 @@ final class AppState {}guard handedOff else { return }beginSession(GameSession(title: game.app_title, bottleName: bottle.name, appid: nil, markers: markers,- renderer: (renderer ?? bottle.settings.renderer).rawValue), processList: box.processList)+ renderer: (renderer ?? bottle.settings.renderer).rawValue, startNotice: row?.startNotice,+ startNoticeMinutes: row?.startNoticeMinutes), processList: box.processList)}}diff --git a/Sources/HighballKit/Sessions.swift b/Sources/HighballKit/Sessions.swiftindex a26896e..ca18f49 100644--- a/Sources/HighballKit/Sessions.swift+++ b/Sources/HighballKit/Sessions.swift@@ -13,9 +13,21 @@ public struct GameSession: Identifiable, Sendable, Equatable {public let started: Date/// The renderer the launch used, for the post-play report.public let renderer: String?- public init(id: UUID = UUID(), title: String, bottleName: String, appid: Int?, markers: [String], started: Date = Date(), renderer: String? = nil) {+ /// The row's start notice (GameDBEntry.startNotice) and how long it stays.+ public let startNotice: String?+ public let startNoticeMinutes: Int+ public init(id: UUID = UUID(), title: String, bottleName: String, appid: Int?, markers: [String], started: Date = Date(), renderer: String? = nil,+ startNotice: String? = nil, startNoticeMinutes: Int? = nil) {self.id = id; self.title = title; self.bottleName = bottleName; self.appid = appid; self.markers = markers; self.started = startedself.renderer = renderer+ self.startNotice = startNotice.flatMap { $0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty ? nil : $0 }+ self.startNoticeMinutes = startNoticeMinutes ?? 15+ }++ /// The start notice to show at `now`, nil without one or once its time is over.+ public func notice(at now: Date) -> String? {+ guard let startNotice, now.timeIntervalSince(started) < Double(startNoticeMinutes) * 60 else { return nil }+ return startNotice}}diff --git a/Sources/HighballKit/SteamLibrary.swift b/Sources/HighballKit/SteamLibrary.swiftindex 5c140f0..ec30157 100644--- a/Sources/HighballKit/SteamLibrary.swift+++ b/Sources/HighballKit/SteamLibrary.swift@@ -217,6 +217,13 @@ public struct GameDBEntry: Codable, Sendable {/// A native macOS edition. Highball marks the ones on Steam (the same purchase); `available:/// false` marks a Mac port that no longer runs, which outranks the store's flag (MacSteamBuild).public var nativeMac: NativeMacInfo?+ /// A sentence the activity strip shows under the running game while it starts, for a game+ /// whose own loading is long enough that a player would think it failed: Microsoft Flight+ /// Simulator 2024 on the arm64 engine prepares its shaders for 6 to 7 minutes behind a still+ /// window, after its process has appeared and Highball's start sheet has closed. Shown for+ /// `startNoticeMinutes` after that, 15 when the row does not say. Data, not code.+ public var startNotice: String?+ public var startNoticeMinutes: Int?/// Any kind of block: kernel anti-cheat, or a publisher that stops the game on macOS on purpose/// (World of Warships). The game cannot run, so no renderer advice and no Play.diff --git a/Tests/HighballKitTests/StartNoticeTests.swift b/Tests/HighballKitTests/StartNoticeTests.swiftnew file mode 100644index 0000000..08b4974--- /dev/null+++ b/Tests/HighballKitTests/StartNoticeTests.swift@@ -0,0 +1,29 @@+import XCTest+@testable import HighballKit++/// A game whose own loading outlasts Highball's start sheet (Microsoft Flight Simulator 2024 on+/// the arm64 engine prepares its shaders for minutes behind a still window) says so under+/// "is running", in its row's words, for a while.+final class StartNoticeTests: XCTestCase {+ private let t0 = Date(timeIntervalSince1970: 1_800_000_000)++ func testTheRowsNoticeShowsForItsMinutes() throws {+ let json = #"{"id":"microsoft-flight-simulator-2024","title":"Microsoft Flight Simulator 2024","steam_appid":2537590,"status":"community","startNotice":"Each start takes 10 to 15 minutes.","startNoticeMinutes":20}"#+ let row = try JSONDecoder().decode(GameDBEntry.self, from: Data(json.utf8))+ let s = GameSession(title: row.title, bottleName: "b", appid: row.steam_appid, markers: [], started: t0,+ startNotice: row.startNotice, startNoticeMinutes: row.startNoticeMinutes)+ XCTAssertEqual(s.notice(at: t0), "Each start takes 10 to 15 minutes.")+ XCTAssertEqual(s.notice(at: t0 + 19 * 60), "Each start takes 10 to 15 minutes.")+ XCTAssertNil(s.notice(at: t0 + 20 * 60), "gone once its time is over")+ }++ func testFifteenMinutesWhenTheRowDoesNotSayAndNothingWithoutANotice() throws {+ let s = GameSession(title: "g", bottleName: "b", appid: nil, markers: [], started: t0, startNotice: "Slow first start.")+ XCTAssertNotNil(s.notice(at: t0 + 14 * 60))+ XCTAssertNil(s.notice(at: t0 + 15 * 60))+ XCTAssertNil(GameSession(title: "g", bottleName: "b", appid: nil, markers: [], started: t0).notice(at: t0))+ XCTAssertNil(GameSession(title: "g", bottleName: "b", appid: nil, markers: [], started: t0, startNotice: " ").notice(at: t0), "a blank notice is none")+ let plain = try JSONDecoder().decode(GameDBEntry.self, from: Data(#"{"id":"x","title":"X","status":"community"}"#.utf8))+ XCTAssertNil(plain.startNotice, "rows without one decode as before")+ }+}