diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 42c70cecec..aa4ab0c2ab 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -468,7 +468,8 @@ void __NetApctlCallbacks() } // Must be delayed long enough whenever there is a pending callback. - hleDelayResult(0, "Prevent Apctl thread from blocking", delayus); + sceKernelDelayThread(delayus); + hleSkipDeadbeef();; } static inline u32 AllocUser(u32 size, bool fromTop, const char *name) { @@ -758,6 +759,9 @@ static int sceNetApctlInit(int stackSize, int initPriority) { if (netApctlInited) return ERROR_NET_APCTL_ALREADY_INITIALIZED; + apctlEvents.clear(); + netApctlState = PSP_NET_APCTL_STATE_DISCONNECTED; + // Set default value before connected to an AP memset(&netApctlInfo, 0, sizeof(netApctlInfo)); // NetApctl_InitInfo(); std::string APname = "Wifi"; // fake AP/hotspot @@ -778,7 +782,6 @@ static int sceNetApctlInit(int stackSize, int initPriority) { } netApctlInited = true; - netApctlState = PSP_NET_APCTL_STATE_DISCONNECTED; return 0; } diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 4ad4c8faa5..56e3e5e652 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -248,6 +248,7 @@ static u32 sceNetAdhocctlInit(int stackSize, int prio, u32 productAddr) { Memory::ReadStruct(productAddr, &product_code); } + adhocctlEvents.clear(); netAdhocctlInited = true; //needed for cleanup during AdhocctlTerm even when it failed to connect to Adhoc Server (since it's being faked as success) // Create fake PSP Thread for callback @@ -3007,6 +3008,7 @@ int sceNetAdhocMatchingInit(u32 memsize) { fakePoolSize = memsize; // Initialize Library + matchingEvents.clear(); netAdhocMatchingInited = true; // Return Success @@ -4077,7 +4079,8 @@ void __NetTriggerCallbacks() } // Must be delayed long enough whenever there is a pending callback. Should it be 100-500ms for Adhocctl Events? or Not Less than the delays on sceNetAdhocctl HLE? - hleDelayResult(0, "Prevent Adhocctl thread from blocking", delayus); + sceKernelDelayThread(delayus); + hleSkipDeadbeef(); } void __NetMatchingCallbacks() //(int matchingId) @@ -4108,7 +4111,8 @@ void __NetMatchingCallbacks() //(int matchingId) } // Must be delayed long enough whenever there is a pending callback. Should it be 10-100ms for Matching Events? or Not Less than the delays on sceNetAdhocMatching HLE? - hleDelayResult(0, "Prevent AdhocMatching thread from blocking", delayus); + sceKernelDelayThread(delayus); + hleSkipDeadbeef(); } const HLEFunction sceNetAdhoc[] = { diff --git a/Core/HLE/sceNp.cpp b/Core/HLE/sceNp.cpp index 639776485d..cd0fc9a26b 100644 --- a/Core/HLE/sceNp.cpp +++ b/Core/HLE/sceNp.cpp @@ -162,6 +162,7 @@ static int sceNpAuthInit(u32 poolSize, u32 stackSize, u32 threadPrio) npAuthMemStat.npMemSize = poolSize; npAuthMemStat.npMaxMemSize = poolSize / 2; // Dummy npAuthMemStat.npFreeMemSize = poolSize - 16; // Dummy. + npAuthEvents.clear(); npAuthInited = true; return 0;