From 7f6b17b717144c65b58bbd6698d79166f42c4f24 Mon Sep 17 00:00:00 2001 From: rfandango Date: Fri, 14 Aug 2026 17:19:42 +0100 Subject: [PATCH] [Kernel] Allow guest sockets again by default and quirk them off for the titles that hang --- .../xendroid/compose/settings/SettingDescriptions.kt | 2 ++ .../java/xendroid/compose/settings/SettingsSchema.kt | 1 + .../xendroid/compose/settings/SettingsSchemaTest.kt | 10 +++++----- .../src/main/cpp/xenia/src/xenia/game_quirks.cc | 2 ++ .../src/main/cpp/xenia/src/xenia/kernel/xam/xam_net.cc | 9 +++++---- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/xendroid/compose/settings/SettingDescriptions.kt b/app/src/main/java/xendroid/compose/settings/SettingDescriptions.kt index 782e6e117..f91e206ab 100644 --- a/app/src/main/java/xendroid/compose/settings/SettingDescriptions.kt +++ b/app/src/main/java/xendroid/compose/settings/SettingDescriptions.kt @@ -62,6 +62,8 @@ object SettingDescriptions { "kernel_cert_monitor" to "Reports the certification monitor as present to the game (debug/testing feature)", "kernel_debug_monitor" to "Reports a debug monitor (remote debugger) as attached to the game", "kernel_display_gamma_type" to "Display gamma curve reported to games; BT.709 best matches a 360 on an HDTV", + "network_enabled" to "Lets games open network sockets. They cannot reach a real peer, but " + + "some games crash when socket creation fails. Turn off only for a game that hangs online", "kernel_pix" to "Exposes the PIX GPU profiler interface to the game for debug captures", "license_mask" to "Content license mask: 0 = none, 1 = full-version license (unlocks XBLA trials), -1 = all", "log_safepoint_pc" to "Records where each guest thread last reached a yield point, so a freeze report can say where a stuck thread actually is instead of only where it last called from. Slows the emulator slightly; turn on only when chasing a freeze", diff --git a/app/src/main/java/xendroid/compose/settings/SettingsSchema.kt b/app/src/main/java/xendroid/compose/settings/SettingsSchema.kt index fda0c60cc..3035d3043 100644 --- a/app/src/main/java/xendroid/compose/settings/SettingsSchema.kt +++ b/app/src/main/java/xendroid/compose/settings/SettingsSchema.kt @@ -94,6 +94,7 @@ object SettingsSchema { b("Kernel", "allow_incompatible_title_update", "Allow incompatible title update", true), b("Kernel", "apply_title_update", "Apply title update", true), b("Kernel", "kernel_debug_monitor", "Kernel debug monitor", false), + b("Kernel", "network_enabled", "Networking", true), )), SettingsCategory("Controller", listOf( diff --git a/app/src/test/java/xendroid/compose/settings/SettingsSchemaTest.kt b/app/src/test/java/xendroid/compose/settings/SettingsSchemaTest.kt index a4d70834a..7d4fbd910 100644 --- a/app/src/test/java/xendroid/compose/settings/SettingsSchemaTest.kt +++ b/app/src/test/java/xendroid/compose/settings/SettingsSchemaTest.kt @@ -13,19 +13,19 @@ class SettingsSchemaTest { private val all = SettingsSchema.allSettings - // 100 Bool + 12 IntRange + 21 ListChoice + 2 Action = 135. Display|host_present_from_non_ui_thread + // 101 Bool + 12 IntRange + 21 ListChoice + 2 Action = 136. Display|host_present_from_non_ui_thread // is intentionally absent (forced true natively; not a valid user choice). - @Test fun total_entry_count_is_135() { - assertEquals(135, all.size) + @Test fun total_entry_count_is_136() { + assertEquals(136, all.size) assertEquals( - 135, + 136, all.count { it is Setting.Bool } + all.count { it is Setting.IntRange } + all.count { it is Setting.ListChoice } + all.count { it is Setting.Action }, ) } @Test fun counts_by_type_match_verified_inventory() { - assertEquals(100, all.count { it is Setting.Bool }) + assertEquals(101, all.count { it is Setting.Bool }) assertEquals(12, all.count { it is Setting.IntRange }) assertEquals(21, all.count { it is Setting.ListChoice }) assertEquals(2, all.count { it is Setting.Action }) diff --git a/emulator-core/src/main/cpp/xenia/src/xenia/game_quirks.cc b/emulator-core/src/main/cpp/xenia/src/xenia/game_quirks.cc index 4723ac45e..f5df05283 100644 --- a/emulator-core/src/main/cpp/xenia/src/xenia/game_quirks.cc +++ b/emulator-core/src/main/cpp/xenia/src/xenia/game_quirks.cc @@ -34,6 +34,8 @@ static const Quirk kQuirks[] = { "ir3 cannot compile fmadz"}, {0x494707D4, "vulkan_in_pass_resolve", true, "in-pass resolves tuned here"}, {0x49470804, "vulkan_in_pass_resolve", true, "in-pass resolves tuned here"}, + {0x494707D4, "network_enabled", false, "hangs on a blocking recvfrom"}, + {0x49470804, "network_enabled", false, "hangs on a blocking recvfrom"}, {0x4E4D083A, "spirv_multiply_zero_test_on_bits", true, "ir3 cannot compile fmadz"}, }; diff --git a/emulator-core/src/main/cpp/xenia/src/xenia/kernel/xam/xam_net.cc b/emulator-core/src/main/cpp/xenia/src/xenia/kernel/xam/xam_net.cc index 3c42d9d49..dca9ce2ed 100644 --- a/emulator-core/src/main/cpp/xenia/src/xenia/kernel/xam/xam_net.cc +++ b/emulator-core/src/main/cpp/xenia/src/xenia/kernel/xam/xam_net.cc @@ -19,11 +19,12 @@ #include "xenia/kernel/xthread.h" #include "xenia/xbox.h" -DEFINE_bool(network_enabled, false, +DEFINE_bool(network_enabled, true, "Let titles open host sockets. The XNet address and session layer " - "is stubbed, so guest traffic cannot reach a peer; enabling this " - "only binds real host ports and lets titles enter online paths " - "that may block indefinitely.", + "is stubbed, so guest traffic cannot reach a peer, but titles that " + "do not check for socket creation failure crash outright when this " + "is off. Turn it off only for titles that block indefinitely on a " + "socket that never answers.", "Kernel"); #ifdef XE_PLATFORM_WIN32