From a3ec898c30a82c5d1f13bd9cae7a3c3f03f0024f Mon Sep 17 00:00:00 2001 From: bmjask <11672696+bmjask@users.noreply.github.com> Date: Sat, 21 Nov 2026 11:56:16 -0500 Subject: [PATCH 1/2] Olympus: report supported runtime features --- crates/xcl/src/hle/xgameruntime/mod.rs | 30 ++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/crates/xcl/src/hle/xgameruntime/mod.rs b/crates/xcl/src/hle/xgameruntime/mod.rs index 46f0fda..710ab40 100644 --- a/crates/xcl/src/hle/xgameruntime/mod.rs +++ b/crates/xcl/src/hle/xgameruntime/mod.rs @@ -151,8 +151,21 @@ pub unsafe extern "system" fn XGameRuntimeUninitialize() { INIT_COUNT.fetch_sub(1, Ordering::AcqRel); } -pub unsafe extern "system" fn XGameRuntimeIsFeatureAvailable(_feature: u32) -> bool { - true +pub unsafe extern "system" fn XGameRuntimeIsFeatureAvailable(feature: u32) -> bool { + matches!( + feature, + 2 // XAsync + | 3 // XAsyncProvider + | 5 // XGame + | 7 // XGameSave + | 11 // XPackage + | 12 // XPersistentLocalStorage + | 15 // XSystem + | 16 // XTaskQueue + | 17 // XThread + | 18 // XUser + | 19 // XError + ) } // --------------------------------------------------------------------------------------- @@ -591,6 +604,19 @@ pub unsafe extern "system" fn XStoreCloseContextHandle(_h: *mut c_void) {} mod tests { use super::*; + #[test] + fn feature_availability_reports_only_implemented_families() { + let expected = [2, 3, 5, 7, 11, 12, 15, 16, 17, 18, 19]; + for feature in 0..=21 { + assert_eq!( + unsafe { XGameRuntimeIsFeatureAvailable(feature) }, + expected.contains(&feature), + "unexpected availability for public feature {feature}" + ); + } + assert!(!unsafe { XGameRuntimeIsFeatureAvailable(u32::MAX) }); + } + #[test] fn user_add_and_queries() { let _g = crate::hle::xgameruntime::xasync::ASYNC_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner()); From 83f476b90f7c81b42820315782064114d4984fa4 Mon Sep 17 00:00:00 2001 From: bmjask <11672696+bmjask@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:35:28 -0500 Subject: [PATCH 2/2] Olympus: align runtime feature availability --- crates/xcl/src/hle/xgameruntime/mod.rs | 49 ++++++++++++++++---------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/crates/xcl/src/hle/xgameruntime/mod.rs b/crates/xcl/src/hle/xgameruntime/mod.rs index 710ab40..80bbe29 100644 --- a/crates/xcl/src/hle/xgameruntime/mod.rs +++ b/crates/xcl/src/hle/xgameruntime/mod.rs @@ -152,20 +152,7 @@ pub unsafe extern "system" fn XGameRuntimeUninitialize() { } pub unsafe extern "system" fn XGameRuntimeIsFeatureAvailable(feature: u32) -> bool { - matches!( - feature, - 2 // XAsync - | 3 // XAsyncProvider - | 5 // XGame - | 7 // XGameSave - | 11 // XPackage - | 12 // XPersistentLocalStorage - | 15 // XSystem - | 16 // XTaskQueue - | 17 // XThread - | 18 // XUser - | 19 // XError - ) + matches!(feature, 0 | 2..=13 | 15..=21) } // --------------------------------------------------------------------------------------- @@ -605,15 +592,39 @@ mod tests { use super::*; #[test] - fn feature_availability_reports_only_implemented_families() { - let expected = [2, 3, 5, 7, 11, 12, 15, 16, 17, 18, 19]; - for feature in 0..=21 { + fn feature_availability_covers_the_public_feature_enum() { + let features = [ + (0, "XAccessibility"), + (1, "XAppCapture"), + (2, "XAsync"), + (3, "XAsyncProvider"), + (4, "XDisplay"), + (5, "XGame"), + (6, "XGameInvite"), + (7, "XGameSave"), + (8, "XGameUI"), + (9, "XLauncher"), + (10, "XNetworking"), + (11, "XPackage"), + (12, "XPersistentLocalStorage"), + (13, "XSpeechSynthesizer"), + (14, "XStore"), + (15, "XSystem"), + (16, "XTaskQueue"), + (17, "XThread"), + (18, "XUser"), + (19, "XError"), + (20, "XGameEvent"), + (21, "XGameStreaming"), + ]; + for (feature, name) in features { assert_eq!( unsafe { XGameRuntimeIsFeatureAvailable(feature) }, - expected.contains(&feature), - "unexpected availability for public feature {feature}" + feature != 1 && feature != 14, + "unexpected availability for {name} ({feature})" ); } + assert!(!unsafe { XGameRuntimeIsFeatureAvailable(22) }); assert!(!unsafe { XGameRuntimeIsFeatureAvailable(u32::MAX) }); }