diff --git a/src/citra_qt/configuration/configure_debug.ui b/src/citra_qt/configuration/configure_debug.ui index c38583c51..8ca7a03df 100644 --- a/src/citra_qt/configuration/configure_debug.ui +++ b/src/citra_qt/configuration/configure_debug.ui @@ -228,10 +228,10 @@ - <html><head/><body><p>Introduces a random delay to the first ever launched app thread, which helps randomness seeding from the system tick. If lle system modules are enabled, the delay will be increased. Disable for more consistent boot times.</p></body></html> + <html><head/><body><p>Introduces a delay to the first ever launched app thread if LLE modules are enabled, to allow them to initialize.</p></body></html> - Delay app main thread start + Delay app main thread start with LLE modules enabled diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 3574d490d..dc8107670 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -412,40 +412,33 @@ void Thread::BoostPriority(u32 priority) { std::shared_ptr SetupMainThread(KernelSystem& kernel, u32 entry_point, u32 priority, std::shared_ptr owner_process) { - constexpr const s64 sleep_random_deviation_ns = 250'000'000LL; - constexpr const s64 sleep_normal_thread_base_ns = 250'000'000LL; - constexpr const s64 sleep_app_thread_base_ns = 2'500'000'000LL; - constexpr const u32 system_module_tid_high = 0x00040130; + constexpr s64 sleep_app_thread_ns = 2'600'000'000LL; + constexpr u32 system_module_tid_high = 0x00040130; const bool is_lle_service = static_cast(owner_process->codeset->program_id >> 32) == system_module_tid_high; - s64 sleep_base_time_ns = 0; + s64 sleep_time_ns = 0; if (!is_lle_service && Settings::values.delay_main_thread_start) { if (kernel.GetAppMainThreadExtendedSleep()) { - sleep_base_time_ns = sleep_app_thread_base_ns; + sleep_time_ns = sleep_app_thread_ns; kernel.SetAppMainThreadExtendedSleep(false); - } else { - sleep_base_time_ns = sleep_normal_thread_base_ns; } - std::random_device rand_device; - sleep_base_time_ns += (static_cast(rand_device()) % (sleep_random_deviation_ns * 2)) - - sleep_random_deviation_ns; } // Initialize new "main" thread auto thread_res = kernel.CreateThread("main", entry_point, priority, 0, owner_process->ideal_processor, - Memory::HEAP_VADDR_END, owner_process, sleep_base_time_ns == 0); + Memory::HEAP_VADDR_END, owner_process, sleep_time_ns == 0); std::shared_ptr thread = std::move(thread_res).Unwrap(); thread->context.fpscr = FPSCR_DEFAULT_NAN | FPSCR_FLUSH_TO_ZERO | FPSCR_ROUND_TOZERO | FPSCR_IXC; // 0x03C00010 - if (sleep_base_time_ns != 0) { + if (sleep_time_ns != 0) { thread->status = ThreadStatus::WaitSleep; - thread->WakeAfterDelay(sleep_base_time_ns); + thread->WakeAfterDelay(sleep_time_ns); } // Note: The newly created thread will be run when the scheduler fires.