Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/HLE/NetAdhocCommon.cpp
3187 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
#include "Core/HLE/NetAdhocCommon.h"
19
20
#include "sceKernelMemory.h"
21
#include "Core/MemMapHelpers.h"
22
23
u32 dummyThreadHackAddr = 0;
24
u32_le dummyThreadCode[3];
25
26
27
void netAdhocValidateLoopMemory() {
28
// Allocate Memory if it wasn't valid/allocated after loaded from old SaveState
29
if (!dummyThreadHackAddr || strcmp("dummythreadhack", kernelMemory.GetBlockTag(dummyThreadHackAddr)) != 0) {
30
u32 blockSize = sizeof(dummyThreadCode);
31
dummyThreadHackAddr = kernelMemory.Alloc(blockSize, false, "dummythreadhack");
32
if (dummyThreadHackAddr)
33
Memory::Memcpy(dummyThreadHackAddr, dummyThreadCode, sizeof(dummyThreadCode));
34
}
35
}
36
37
int netAdhocEnterGameModeTimeout = 15000000; // 15 sec as default timeout, to wait for all players to join
38
39
std::recursive_mutex adhocEvtMtx;
40
41
int IsAdhocctlInCB = 0;
42
43
44
u32 matchingThreadHackAddr = 0;
45
u32_le matchingThreadCode[3];
46
47
bool g_adhocServerConnected = false;
48
49