From c7078f31fd8246ae7421888def904adafac58866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jan 2025 13:47:59 +0100 Subject: [PATCH 1/6] Rename "networkInited" to g_adhocServerConnected, which is what it is --- Core/Dialog/PSPNetconfDialog.cpp | 1 - Core/HLE/proAdhoc.cpp | 8 ++++---- Core/HLE/sceMpeg.cpp | 2 +- Core/HLE/sceNetAdhoc.cpp | 8 ++++---- Core/HLE/sceNetAdhoc.h | 2 +- UI/PauseScreen.cpp | 10 ++++++++-- UI/PauseScreen.h | 1 + 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Core/Dialog/PSPNetconfDialog.cpp b/Core/Dialog/PSPNetconfDialog.cpp index 1ce932f197..16570b52e8 100644 --- a/Core/Dialog/PSPNetconfDialog.cpp +++ b/Core/Dialog/PSPNetconfDialog.cpp @@ -177,7 +177,6 @@ int PSPNetconfDialog::Update(int animSpeed) { else if (state == PSP_NET_APCTL_STATE_DISCONNECTED) { // When connecting with infrastructure, simulate a connection using the first network configuration entry. if (connResult < 0) { - // connResult = sceNetApctlConnect(1); connResult = hleCall(sceNetApctl, int, sceNetApctlConnect, 1); } } diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index 82a85859cc..9bdc4581f8 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -1372,7 +1372,7 @@ int friendFinder() { if (metasocket == (int)INVALID_SOCKET && netAdhocctlInited && isAdhocctlNeedLogin) { if (g_Config.bEnableWlan) { if (initNetwork(&product_code) == 0) { - networkInited = true; + g_adhocServerConnected = true; INFO_LOG(Log::sceNet, "FriendFinder: Network [RE]Initialized"); // At this point we are most-likely not in a Group within the Adhoc Server, so we should probably reset AdhocctlState adhocctlState = ADHOCCTL_STATE_DISCONNECTED; @@ -1380,7 +1380,7 @@ int friendFinder() { isAdhocctlBusy = false; } else { - networkInited = false; + g_adhocServerConnected = false; shutdown((int)metasocket, SD_BOTH); closesocket((int)metasocket); metasocket = (int)INVALID_SOCKET; @@ -1390,7 +1390,7 @@ int friendFinder() { // Prevent retrying to Login again unless it was on demand isAdhocctlNeedLogin = false; - if (networkInited) { + if (g_adhocServerConnected) { // Ping Server now = time_now_d() * 1000000.0; // Use time_now_d()*1000000.0 instead of CoreTiming::GetGlobalTimeUsScaled() if the game gets disconnected from AdhocServer too soon when FPS wasn't stable // original code : ((sceKernelGetSystemTimeWide() - lastping) >= ADHOCCTL_PING_TIMEOUT) @@ -1406,7 +1406,7 @@ int friendFinder() { if (iResult == SOCKET_ERROR) { ERROR_LOG(Log::sceNet, "FriendFinder: Socket Error (%i) when sending OPCODE_PING", error); if (error != EAGAIN && error != EWOULDBLOCK) { - networkInited = false; + g_adhocServerConnected = false; shutdown((int)metasocket, SD_BOTH); closesocket((int)metasocket); metasocket = (int)INVALID_SOCKET; diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index c4e479c495..69129f3d9e 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -1673,7 +1673,7 @@ static u32 sceMpegFinish() // TODO: Need to properly hook module load/unload for this to work right. //return ERROR_MPEG_NOT_YET_INIT; } else { - INFO_LOG(Log::ME, "sceMpegFinish(...)"); + INFO_LOG(Log::ME, "sceMpegFinish()"); __VideoPmpShutdown(); } isMpegInit = false; diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index ef1f7f7531..9b7c5593be 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -68,7 +68,7 @@ // TODO: Make accessor functions instead, and throw all this state in a struct. bool netAdhocInited; bool netAdhocctlInited; -bool networkInited = false; +bool g_adhocServerConnected = false; #define DISCOVER_DURATION_US 2000000 // 2 seconds is probably the normal time it takes for PSP to connect to a group (ie. similar to NetconfigDialog time) u64 netAdhocDiscoverStartTime = 0; @@ -371,7 +371,7 @@ static void __AdhocctlNotify(u64 userdata, int cyclesLate) { } // Retry until successfully sent. Login packet sent after successfully connected to Adhoc Server (indicated by networkInited), so we're not sending Login again here - if ((req.opcode == OPCODE_LOGIN && !networkInited) || (ret == SOCKET_ERROR && (sockerr == EAGAIN || sockerr == EWOULDBLOCK))) { + if ((req.opcode == OPCODE_LOGIN && !g_adhocServerConnected) || (ret == SOCKET_ERROR && (sockerr == EAGAIN || sockerr == EWOULDBLOCK))) { u64 now = (u64)(time_now_d() * 1000000.0); if (now - adhocctlStartTime <= static_cast(adhocDefaultTimeout) + 500) { // Try again in another 0.5ms until timedout. @@ -1306,7 +1306,7 @@ int sceNetAdhocctlInit(int stackSize, int prio, u32 productAddr) { // Need to make sure to be connected to Adhoc Server (indicated by networkInited) before returning to prevent GTA VCS failed to create/join a group and unable to see any game room int us = adhocDefaultDelay; - if (g_Config.bEnableWlan && !networkInited) { + if (g_Config.bEnableWlan && !g_adhocServerConnected) { AdhocctlRequest dummyreq = { OPCODE_LOGIN, {0} }; return hleLogSuccessOrWarn(Log::sceNet, WaitBlockingAdhocctlSocket(dummyreq, us, "adhocctl init")); } @@ -2582,7 +2582,7 @@ int NetAdhocctl_Term() { //May also need to clear Handlers adhocctlHandlers.clear(); // Free stuff here - networkInited = false; + g_adhocServerConnected = false; shutdown((int)metasocket, SD_BOTH); closesocket((int)metasocket); metasocket = (int)INVALID_SOCKET; diff --git a/Core/HLE/sceNetAdhoc.h b/Core/HLE/sceNetAdhoc.h index a734375bd7..61de14016b 100644 --- a/Core/HLE/sceNetAdhoc.h +++ b/Core/HLE/sceNetAdhoc.h @@ -125,7 +125,7 @@ int NetAdhoc_Term(); // May need to use these from sceNet.cpp extern bool netAdhocInited; extern bool netAdhocctlInited; -extern bool networkInited; +extern bool g_adhocServerConnected; extern bool netAdhocGameModeEntered; extern int netAdhocEnterGameModeTimeout; extern int adhocDefaultTimeout; //3000000 usec diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 34594c045f..3936bd31c0 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -44,6 +44,7 @@ #include "Core/HLE/sceUmd.h" #include "Core/HLE/sceNet.h" #include "Core/HLE/sceNetInet.h" +#include "Core/HLE/sceNetAdhoc.h" #include "GPU/GPUCommon.h" #include "GPU/GPUState.h" @@ -277,11 +278,12 @@ void GamePauseScreen::update() { finishNextFrame_ = false; } - if (netInited != lastNetInited_ || netInetInited != lastNetInetInited_) { + if (netInited != lastNetInited_ || netInetInited != lastNetInetInited_ || lastAdhocServerConnected_ != g_adhocServerConnected) { INFO_LOG(Log::sceNet, "Network status changed, recreating views"); RecreateViews(); lastNetInetInited_ = netInetInited; lastNetInited_ = netInited; + lastAdhocServerConnected_ = g_adhocServerConnected; } bool mustRunBehind = MustRunBehind(); @@ -384,7 +386,7 @@ void GamePauseScreen::CreateViews() { } } - if (netInited) { + if (netInited || g_adhocServerConnected) { leftColumnItems->Add(new NoticeView(NoticeLevel::INFO, nw->T("Network connected"), "")); if (!g_infraDNSConfig.revivalTeam.empty() && netInetInited) { @@ -399,6 +401,10 @@ void GamePauseScreen::CreateViews() { }); } } + + if (g_adhocServerConnected) { + leftColumnItems->Add(new TextView(std::string(nw->T("AdHoc Server")) + ": " + std::string(nw->T("Connected")))); + } } bool achievementsAllowSavestates = !Achievements::HardcoreModeActive() || g_Config.bAchievementsSaveStateInHardcoreMode; diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index 0f9ee53fb5..835f1f500a 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -66,4 +66,5 @@ private: UI::Button *playButton_ = nullptr; bool lastNetInited_ = false; bool lastNetInetInited_ = false; + bool lastAdhocServerConnected_ = false; }; From ac67d62e57dd3f62c7397cbceeba4323e7d4bd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jan 2025 14:14:37 +0100 Subject: [PATCH 2/6] Update infra-dns.json with SOCOM games, driver, etc --- assets/infra-dns.json | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/assets/infra-dns.json b/assets/infra-dns.json index 62f93ff47d..21691e345d 100644 --- a/assets/infra-dns.json +++ b/assets/infra-dns.json @@ -133,7 +133,7 @@ }, { "name": "Ratchet & Clank - Size Matters", - "dns": "67.222.156.251", + "dns": "67.222.156.250", "other_ids": [ "UCES00420", "UCUS98633" @@ -151,6 +151,46 @@ "revival_credits": { "group": "OutRun2006Tweaks" } + }, + { + "name": "SOCOM Fireteam Bravo", + "known_working_ids": [ + "UCKS45021", + "UCUS98615", + "UCES00038" + ], + "score": 4 + }, + { + "name": "SOCOM Fireteam Bravo 2", + "known_working_ids": [ + "UCUS98645", + "UCES00543" + ], + "score": 4 + }, + { + "name": "SOCOM Tactical Strike", + "known_working_ids": [ + "UCUS98649", + "UCES00855" + ], + "score": 3 + }, + { + "name": "Syphon Filter: Dark Mirror", + "known_working_ids": [ + "UCUS98641" + ], + "score": 5 + }, + { + "name": "Driver '76", + "known_working_ids": [ + "ULUS10235", + "ULES00740" + ], + "connect_adhoc_for_grouping": true } ] } From f69f94284f8ae88b7620bfe1ddc5e5b27ab3be5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jan 2025 14:20:18 +0100 Subject: [PATCH 3/6] Move the hardcoded domains from sceNetResolver.cpp to the json. --- Core/HLE/sceNetResolver.cpp | 6 +----- assets/infra-dns.json | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Core/HLE/sceNetResolver.cpp b/Core/HLE/sceNetResolver.cpp index a8b5bd4b87..1b7a520f5e 100644 --- a/Core/HLE/sceNetResolver.cpp +++ b/Core/HLE/sceNetResolver.cpp @@ -67,11 +67,7 @@ static std::mutex g_netResolversLock; // Do we really need this? static bool g_netResolverInitialized = true; static int sceNetResolverInit() { - // TODO: Move this to infra-jns.config! This isn't ok. - // However obviously don't remove the mHostToAlias mechanism. - g_Config.mHostToAlias["socomftb2.psp.online.scea.com"] = "67.222.156.250"; - g_Config.mHostToAlias["socompsp-prod.muis.pdonline.scea.com"] = "67.222.156.250"; - + // Hardcoded mHostToAlias entries here have been moved to the infra-dns.json file. return hleLogSuccessInfoI(Log::sceNet, 0); } diff --git a/assets/infra-dns.json b/assets/infra-dns.json index 21691e345d..495df65199 100644 --- a/assets/infra-dns.json +++ b/assets/infra-dns.json @@ -159,7 +159,11 @@ "UCUS98615", "UCES00038" ], - "score": 4 + "score": 4, + "domains": { + "socomftb2.psp.online.scea.com": "67.222.156.250", + "socompsp-prod.muis.pdonline.scea.com": "67.222.156.250" + } }, { "name": "SOCOM Fireteam Bravo 2", @@ -167,7 +171,15 @@ "UCUS98645", "UCES00543" ], - "score": 4 + "other_ids": [ + "UCKS45043", + "UCUS80171" + ], + "score": 4, + "domains": { + "socomftb2.psp.online.scea.com": "67.222.156.250", + "socompsp-prod.muis.pdonline.scea.com": "67.222.156.250" + } }, { "name": "SOCOM Tactical Strike", @@ -175,7 +187,14 @@ "UCUS98649", "UCES00855" ], - "score": 3 + "other_ids": [ + "NPUG80220" + ], + "score": 3, + "domains": { + "socomftb2.psp.online.scea.com": "67.222.156.250", + "socompsp-prod.muis.pdonline.scea.com": "67.222.156.250" + } }, { "name": "Syphon Filter: Dark Mirror", From 58f336f64db661df351b42bfa0f2b4323c476849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jan 2025 14:20:48 +0100 Subject: [PATCH 4/6] Infrastructure: Only connect to adhoc server if connect_adhoc_for_grouping is set in the json --- Core/HLE/sceNet.cpp | 49 ++++++++++++++++++++++++++-------------- Core/HLE/sceNet.h | 8 ++++++- Core/HLE/sceNetAdhoc.cpp | 4 ++-- Core/HLE/sceNetAdhoc.h | 3 ++- Core/HLE/sceNetInet.h | 2 +- 5 files changed, 44 insertions(+), 22 deletions(-) diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 5a6e40d570..dc8c0ef243 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -69,7 +69,7 @@ std::string defaultNetSSID = "Wifi"; // fake AP/hotspot int netApctlInfoId = 0; SceNetApctlInfoInternal netApctlInfo; -bool netApctlInited; +bool g_netApctlInited; u32 netApctlState; u32 apctlProdCodeAddr = 0; u32 apctlThreadHackAddr = 0; @@ -185,6 +185,7 @@ bool LoadDNSForGameID(std::string_view gameID, InfraDNSConfig *dns) { dns->revivalTeamURL = revived.getStringOr("url", ""); } } + dns->connectAdHocForGrouping = def.getBool("connect_adhoc_for_grouping", false); } const JsonNode *games = root.getArray("games"); @@ -242,6 +243,7 @@ bool LoadDNSForGameID(std::string_view gameID, InfraDNSConfig *dns) { dns->gameName = game.getStringOr("name", ""); dns->dns = game.getStringOr("dns", dns->dns.c_str()); dns->dyn_dns = game.getStringOr("dyn_dns", ""); + dns->connectAdHocForGrouping = game.getBool("connect_adhoc_for_grouping", dns->connectAdHocForGrouping); if (game.hasChild("domains", JSON_OBJECT)) { const JsonGet domains = game.getDict("domains"); for (auto iter : domains.value_) { @@ -332,7 +334,7 @@ int ScheduleApctlState(int event, int newState, int usec, const char* reason) { } void __NetApctlInit() { - netApctlInited = false; + g_netApctlInited = false; netApctlState = PSP_NET_APCTL_STATE_DISCONNECTED; apctlStateEvent = CoreTiming::RegisterEvent("__ApctlState", __ApctlState); apctlHandlers.clear(); @@ -435,11 +437,11 @@ void __NetDoState(PointerWrap &p) { auto cur_netInited = netInited; auto cur_netInetInited = netInetInited; - auto cur_netApctlInited = netApctlInited; + auto cur_netApctlInited = g_netApctlInited; Do(p, netInited); Do(p, netInetInited); - Do(p, netApctlInited); + Do(p, g_netApctlInited); Do(p, apctlHandlers); Do(p, netMallocStat); if (s < 2) { @@ -488,7 +490,7 @@ void __NetDoState(PointerWrap &p) { if (p.mode == p.MODE_READ) { // Let's not change "Inited" value when Loading SaveState in the middle of multiplayer to prevent memory & port leaks - netApctlInited = cur_netApctlInited; + g_netApctlInited = cur_netApctlInited; netInetInited = cur_netInetInited; netInited = cur_netInited; @@ -1006,7 +1008,7 @@ void NetApctl_InitInfo(int confId) { } static int sceNetApctlInit(int stackSize, int initPriority) { - if (netApctlInited) { + if (g_netApctlInited) { return hleLogError(Log::sceNet, ERROR_NET_APCTL_ALREADY_INITIALIZED); } @@ -1038,16 +1040,22 @@ static int sceNetApctlInit(int stackSize, int initPriority) { memcpy(prodCode->data, discID.c_str(), std::min(ADHOCCTL_ADHOCID_LEN, (int)discID.size())); } - hleCall(sceNetAdhocctl, int, sceNetAdhocctlInit, stackSize, initPriority, apctlProdCodeAddr); - - netApctlInited = true; + // Actually connect sceNetAdhocctl. TODO: Can we move this to sceNetApctlConnect? Would be good because a lot of games call Init but not Connect on startup. + if (g_infraDNSConfig.connectAdHocForGrouping) { + hleCall(sceNetAdhocctl, int, sceNetAdhocctlInit, stackSize, initPriority, apctlProdCodeAddr); + } + g_netApctlInited = true; return hleLogSuccessInfoI(Log::sceNet, 0); } int NetApctl_Term() { // Note: Since we're borrowing AdhocServer for Grouping purpose, we should cleanup too - NetAdhocctl_Term(); + // Should we check the g_infraDNSConfig.connectAdHocForGrouping flag here? + if (g_netApctlInited) { + hleCall(sceNetAdhocctl, int, sceNetAdhocctlTerm); + } + if (apctlProdCodeAddr != 0) { userMemory.Free(apctlProdCodeAddr); apctlProdCodeAddr = 0; @@ -1061,9 +1069,8 @@ int NetApctl_Term() { apctlThreadID = 0; } - netApctlInited = false; + g_netApctlInited = false; netApctlState = PSP_NET_APCTL_STATE_DISCONNECTED; - return 0; } @@ -1275,12 +1282,18 @@ int sceNetApctlConnect(int confId) { // Is this confId is the index to the scanning's result data or sceNetApctlGetBSSDescIDListUser result? netApctlInfoId = confId; - // Note: We're borrowing AdhocServer for Grouping purpose, so we can simulate Broadcast over the internet just like Adhoc's pro-online implementation - int ret = hleCall(sceNetAdhocctl, int, sceNetAdhocctlConnect, "INFRA"); - if (netApctlState == PSP_NET_APCTL_STATE_DISCONNECTED) + // Note: We're borrowing AdhocServer for Grouping purpose, so we can simulate Broadcast over the internet just like Adhoc's pro-online implementation + int ret = 0; + if (g_infraDNSConfig.connectAdHocForGrouping) { + ret = hleCall(sceNetAdhocctl, int, sceNetAdhocctlConnect, "INFRA"); + } + + if (netApctlState == PSP_NET_APCTL_STATE_DISCONNECTED) { __UpdateApctlHandlers(0, PSP_NET_APCTL_STATE_JOINING, PSP_NET_APCTL_EVENT_CONNECT_REQUEST, 0); - //hleDelayResult(0, "give time to init/cleanup", adhocEventDelayMS * 1000); + } + + // hleDelayResult(0, "give time to init/cleanup", adhocEventDelayMS * 1000); // TODO: Blocks current thread and wait for a state change to prevent user-triggered connection attempt from causing events to piles up return hleLogSuccessInfoI(Log::sceNet, 0, "connect = %i", ret); } @@ -1289,7 +1302,9 @@ int sceNetApctlDisconnect() { // Like its 'sister' function sceNetAdhocctlDisconnect, we need to alert Apctl handlers that a disconnect took place // or else games like Phantasy Star Portable 2 will hang at certain points (e.g. returning to the main menu after trying to connect to PSN). // Note: Since we're borrowing AdhocServer for Grouping purpose, we should disconnect too - hleCall(sceNetAdhocctl, int, sceNetAdhocctlDisconnect); + if (g_infraDNSConfig.connectAdHocForGrouping) { + hleCall(sceNetAdhocctl, int, sceNetAdhocctlDisconnect); + } // Discards any pending events so we can disconnect immediately apctlEvents.clear(); diff --git a/Core/HLE/sceNet.h b/Core/HLE/sceNet.h index ca4d6ca2a4..cce03f278d 100644 --- a/Core/HLE/sceNet.h +++ b/Core/HLE/sceNet.h @@ -109,7 +109,7 @@ private: }; extern bool netInited; -extern bool netApctlInited; +extern bool g_netApctlInited; extern u32 netApctlState; extern SceNetApctlInfoInternal netApctlInfo; extern std::string defaultNetConfigName; @@ -127,6 +127,10 @@ void __NetDoState(PointerWrap &p); int NetApctl_GetState(); +inline bool __NetApctlConnected() { + return netApctlState >= PSP_NET_APCTL_STATE_GOT_IP; +} + int sceNetApctlConnect(int connIndex); // These return false if allowed to be consistent with the similar function for achievements. @@ -154,6 +158,8 @@ struct InfraDNSConfig { std::string revivalTeam; std::string revivalTeamURL; + + bool connectAdHocForGrouping; }; extern InfraDNSConfig g_infraDNSConfig; diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 9b7c5593be..4a0dfdcfc8 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -128,7 +128,6 @@ void ZeroNetAdhocMatchingThreads(); void SaveNetAdhocMatchingInited(); void RestoreNetAdhocMatchingInited(); - bool __NetAdhocConnected() { return netAdhocInited && netAdhocctlInited && (adhocctlState == ADHOCCTL_STATE_CONNECTED || adhocctlState == ADHOCCTL_STATE_GAMEMODE); } @@ -1278,8 +1277,9 @@ int sceNetAdhocctlInit(int stackSize, int prio, u32 productAddr) { // FIXME: Returning 0x8002013a (SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED) without adhoc module loaded first? // FIXME: Sometimes returning 0x80410601 (ERROR_NET_ADHOC_AUTH_ALREADY_INITIALIZED / Library module is already initialized ?) when AdhocctlTerm is not fully done? - if (netAdhocctlInited) + if (netAdhocctlInited) { return hleLogError(Log::sceNet, ERROR_NET_ADHOCCTL_ALREADY_INITIALIZED); + } auto product = PSPPointer::Create(productAddr); if (product.IsValid()) { diff --git a/Core/HLE/sceNetAdhoc.h b/Core/HLE/sceNetAdhoc.h index 61de14016b..f9037cc750 100644 --- a/Core/HLE/sceNetAdhoc.h +++ b/Core/HLE/sceNetAdhoc.h @@ -106,7 +106,7 @@ void __UpdateAdhocctlHandlers(u32 flags, u32 error); bool __NetAdhocConnected(); -// Called from netdialog +// Called from netdialog (and from sceNetApctl) // NOTE: use hleCall for sceNet* ones! int sceNetAdhocctlGetState(u32 ptrToStatus); int sceNetAdhocctlCreate(const char * groupName); @@ -116,6 +116,7 @@ int sceNetAdhocctlScan(); int sceNetAdhocctlGetScanInfo(u32 sizeAddr, u32 bufAddr); int sceNetAdhocctlDisconnect(); int sceNetAdhocctlInit(int stackSize, int prio, u32 productAddr); +int sceNetAdhocctlTerm(); int NetAdhocctl_Term(); int NetAdhocctl_GetState(); diff --git a/Core/HLE/sceNetInet.h b/Core/HLE/sceNetInet.h index 5452196a26..cc86c9a7dd 100644 --- a/Core/HLE/sceNetInet.h +++ b/Core/HLE/sceNetInet.h @@ -117,7 +117,7 @@ class PointerWrap; extern bool netInited; extern bool netInetInited; -extern bool netApctlInited; +extern bool g_netApctlInited; extern u32 netApctlState; extern SceNetApctlInfoInternal netApctlInfo; extern std::string defaultNetConfigName; From 6f0d28e0832c6ec56e9a9b12425e92acf815134c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jan 2025 16:00:29 +0100 Subject: [PATCH 5/6] Buildfix --- Core/HLE/sceNet.cpp | 4 ++++ Core/HLE/sceNet.h | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index dc8c0ef243..a2255f1e64 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -1317,6 +1317,10 @@ int NetApctl_GetState() { return netApctlState; } +bool __NetApctlConnected() { + return netApctlState >= PSP_NET_APCTL_STATE_GOT_IP; +} + static int sceNetApctlGetState(u32 pStateAddr) { //if (!netApctlInited) return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_IN_BSS, "apctl not in bss"); diff --git a/Core/HLE/sceNet.h b/Core/HLE/sceNet.h index cce03f278d..f5abfebd48 100644 --- a/Core/HLE/sceNet.h +++ b/Core/HLE/sceNet.h @@ -127,9 +127,7 @@ void __NetDoState(PointerWrap &p); int NetApctl_GetState(); -inline bool __NetApctlConnected() { - return netApctlState >= PSP_NET_APCTL_STATE_GOT_IP; -} +bool __NetApctlConnected(); int sceNetApctlConnect(int connIndex); From 51b651964b13ee5cfa725021fced702223e904d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 20 Jan 2025 20:58:36 +0100 Subject: [PATCH 6/6] Additinal infra-dns.json updates --- assets/infra-dns.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/assets/infra-dns.json b/assets/infra-dns.json index 495df65199..1296b3439e 100644 --- a/assets/infra-dns.json +++ b/assets/infra-dns.json @@ -209,6 +209,23 @@ "ULUS10235", "ULES00740" ], + "score": 5, + "connect_adhoc_for_grouping": true + }, + { + "name": "Rocky Balboa", + "other_ids": [ + "ULES00670" + ], + "score": 0, + "connect_adhoc_for_grouping": true + }, + { + "name": "Onore no Shinzuru", + "other_ids": [ + "ULJM05465" + ], + "score": 0, "connect_adhoc_for_grouping": true } ]