Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/HLE/NetAdhocCommon.h
3186 views
1
// Copyright (c) 2025- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include "CommonTypes.h"
21
#include "Swap.h"
22
23
#include <mutex>
24
25
extern u32 dummyThreadHackAddr;
26
extern u32_le dummyThreadCode[3];
27
28
void netAdhocValidateLoopMemory();
29
30
extern int netAdhocEnterGameModeTimeout;
31
32
// Old comments regarding the value of adhocDefaultTimeout:
33
// 3000000 usec
34
//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)
35
constexpr int adhocDefaultTimeout = 5000000;
36
37
constexpr int adhocDefaultDelay = 10000; //10000
38
constexpr int adhocExtraDelay = 20000; //20000
39
constexpr int adhocEventPollDelay = 100000; //100000; // Seems to be the same with PSP_ADHOCCTL_RECV_TIMEOUT
40
41
// Old comments regarding the value of adhocEventDelay:
42
//1000000
43
constexpr int adhocEventDelay = 2000000; //2000000 on real PSP ?
44
45
extern std::recursive_mutex adhocEvtMtx;
46
47
// TODO: this one is broken, perhaps delete it entirely?
48
extern int IsAdhocctlInCB;
49
50
51
extern u32 matchingThreadHackAddr;
52
extern u32_le matchingThreadCode[3];
53
54
extern bool g_adhocServerConnected;
55
56
constexpr u32 defaultLastRecvDelta = 10000; //10000 usec worked well for games published by Falcom (ie. Ys vs Sora Kiseki, Vantage Master Portable)
57
58