From ee072544481298fc7ffb6e5703bd1d6dd79fbbb2 Mon Sep 17 00:00:00 2001 From: Nemoumbra Date: Wed, 2 Jul 2025 00:02:33 +0300 Subject: [PATCH] Constified some config values while preserving the comments --- Core/HLE/NetAdhocCommon.cpp | 7 ------- Core/HLE/NetAdhocCommon.h | 20 +++++++++++++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Core/HLE/NetAdhocCommon.cpp b/Core/HLE/NetAdhocCommon.cpp index dfb1f83f1e..242735a3c6 100644 --- a/Core/HLE/NetAdhocCommon.cpp +++ b/Core/HLE/NetAdhocCommon.cpp @@ -36,13 +36,6 @@ void netAdhocValidateLoopMemory() { int netAdhocEnterGameModeTimeout = 15000000; // 15 sec as default timeout, to wait for all players to join -// TODO: constify -int adhocDefaultTimeout = 5000000; //2000000 usec // For some unknown reason, sometimes it tooks more than 2 seconds for Adhocctl Init to connect to AdhocServer on localhost (normally only 10 ms), and sometimes it tooks more than 1 seconds for built-in AdhocServer to be ready (normally only 1 ms) -int adhocDefaultDelay = 10000; //10000 -int adhocExtraDelay = 20000; //20000 -int adhocEventPollDelay = 100000; //100000; // Same timings with PSP_ADHOCCTL_RECV_TIMEOUT ? -int adhocEventDelay = 2000000; //2000000 on real PSP ? - std::recursive_mutex adhocEvtMtx; int IsAdhocctlInCB = 0; diff --git a/Core/HLE/NetAdhocCommon.h b/Core/HLE/NetAdhocCommon.h index 91deac1d39..4dc5be4093 100644 --- a/Core/HLE/NetAdhocCommon.h +++ b/Core/HLE/NetAdhocCommon.h @@ -29,12 +29,18 @@ void netAdhocValidateLoopMemory(); extern int netAdhocEnterGameModeTimeout; -// TODO: constify -extern int adhocDefaultTimeout; //3000000 usec -extern int adhocDefaultDelay; //10000 -extern int adhocExtraDelay; //20000 -extern int adhocEventPollDelay; //100000; // Seems to be the same with PSP_ADHOCCTL_RECV_TIMEOUT -extern int adhocEventDelay; //1000000 +// Old comments regarding the value of adhocDefaultTimeout: +// 3000000 usec +//2000000 usec // For some unknown reason, sometimes it tooks more than 2 seconds for Adhocctl Init to connect to AdhocServer on localhost (normally only 10 ms), and sometimes it tooks more than 1 seconds for built-in AdhocServer to be ready (normally only 1 ms) +constexpr int adhocDefaultTimeout = 5000000; + +constexpr int adhocDefaultDelay = 10000; //10000 +constexpr int adhocExtraDelay = 20000; //20000 +constexpr int adhocEventPollDelay = 100000; //100000; // Seems to be the same with PSP_ADHOCCTL_RECV_TIMEOUT + +// Old comments regarding the value of adhocEventDelay: +//1000000 +constexpr int adhocEventDelay = 2000000; //2000000 on real PSP ? extern std::recursive_mutex adhocEvtMtx; @@ -45,4 +51,4 @@ extern int IsAdhocctlInCB; extern u32 matchingThreadHackAddr; extern u32_le matchingThreadCode[3]; -extern bool g_adhocServerConnected; \ No newline at end of file +extern bool g_adhocServerConnected;