mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-26 00:45:49 +00:00
Rearranged network's After PSPAction creation/registration so that newer one have higher value to prevent network's callbacks triggering the wrong after action after loading from old save state.
This commit is contained in:
parent
f927ca795c
commit
90ff382c59
@ -141,10 +141,6 @@ void __NetApctlInit() {
|
||||
netApctlState = PSP_NET_APCTL_STATE_DISCONNECTED;
|
||||
apctlHandlers.clear();
|
||||
memset(&netApctlInfo, 0, sizeof(netApctlInfo));
|
||||
|
||||
// Init Apctl Callbacks
|
||||
apctlThreadHackAddr = __CreateHLELoop(apctlThreadCode, "sceNetApctl", "__NetApctlCallbacks", "apctlThreadHack");
|
||||
actionAfterApctlMipsCall = __KernelRegisterActionType(AfterApctlMipsCall::Create);
|
||||
}
|
||||
|
||||
static void __ResetInitNetLib() {
|
||||
@ -155,6 +151,18 @@ static void __ResetInitNetLib() {
|
||||
memset(¶meter, 0, sizeof(parameter));
|
||||
}
|
||||
|
||||
void __NetCallbackInit() {
|
||||
// Init Network Callbacks
|
||||
dummyThreadHackAddr = __CreateHLELoop(dummyThreadCode, "sceNetAdhoc", "__NetTriggerCallbacks", "dummythreadhack");
|
||||
matchingThreadHackAddr = __CreateHLELoop(matchingThreadCode, "sceNetAdhocMatching", "__NetMatchingCallbacks", "matchingThreadHack");
|
||||
apctlThreadHackAddr = __CreateHLELoop(apctlThreadCode, "sceNetApctl", "__NetApctlCallbacks", "apctlThreadHack");
|
||||
|
||||
// Newer one should be placed last to prevent callbacks going to the wrong after action after loading from old save state
|
||||
actionAfterMatchingMipsCall = __KernelRegisterActionType(AfterMatchingMipsCall::Create);
|
||||
actionAfterAdhocMipsCall = __KernelRegisterActionType(AfterAdhocMipsCall::Create);
|
||||
actionAfterApctlMipsCall = __KernelRegisterActionType(AfterApctlMipsCall::Create);
|
||||
}
|
||||
|
||||
void __NetInit() {
|
||||
// Windows: Assuming WSAStartup already called beforehand
|
||||
portOffset = g_Config.iPortOffset;
|
||||
@ -172,6 +180,7 @@ void __NetInit() {
|
||||
|
||||
__ResetInitNetLib();
|
||||
__NetApctlInit();
|
||||
__NetCallbackInit();
|
||||
}
|
||||
|
||||
void __NetApctlShutdown() {
|
||||
|
@ -199,12 +199,6 @@ void __NetAdhocInit() {
|
||||
adhocctlHandlers.clear();
|
||||
__AdhocServerInit();
|
||||
|
||||
// Init Adhoc Callbacks
|
||||
dummyThreadHackAddr = __CreateHLELoop(dummyThreadCode, "sceNetAdhoc", "__NetTriggerCallbacks", "dummythreadhack");
|
||||
matchingThreadHackAddr = __CreateHLELoop(matchingThreadCode, "sceNetAdhocMatching", "__NetMatchingCallbacks", "matchingThreadHack");
|
||||
actionAfterMatchingMipsCall = __KernelRegisterActionType(AfterMatchingMipsCall::Create);
|
||||
actionAfterAdhocMipsCall = __KernelRegisterActionType(AfterAdhocMipsCall::Create);
|
||||
|
||||
// Create built-in AdhocServer Thread
|
||||
if (g_Config.bEnableWlan && g_Config.bEnableAdhocServer) {
|
||||
adhocServerRunning = true;
|
||||
|
@ -55,6 +55,11 @@ extern int adhocEventDelayMS; // This will affect the duration of "Connecting...
|
||||
extern std::recursive_mutex adhocEvtMtx;
|
||||
extern int IsAdhocctlInCB;
|
||||
|
||||
extern u32 dummyThreadHackAddr;
|
||||
extern u32_le dummyThreadCode[3];
|
||||
extern u32 matchingThreadHackAddr;
|
||||
extern u32_le matchingThreadCode[3];
|
||||
|
||||
int NetAdhocMatching_Term();
|
||||
int NetAdhocctl_Term();
|
||||
int NetAdhoc_Term();
|
||||
|
Loading…
x
Reference in New Issue
Block a user