mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
sceNetCtlRegisterCallback and sceNetCtlRegisterCallbackV6 stored only the function and dropped its argument, and sceNetCtlCheckCallback returned 0 without calling anything, so a title that polls sceNetCtlCheckCallback until its callback reports IPOBTAINED never got the event. Each callback slot now keeps the function, its argument and the last event it received; unregistration clears the slot. With no IPv4 callback registered, sceNetCtlCheckCallback returns 0 without querying the host. Otherwise it takes the state from the same host-interface predicate as sceNetCtlGetState, IPOBTAINED (3) or DISCONNECTED (1) (shadPS4 src/core/libraries/network/net_ctl_codes.h L27-29 @15abf68c9b52), marks the IPv4 slots whose last event differs and calls them on the calling thread with their argument after the lock is released, so a callback can unregister itself. Delivery once per state change and slot follows KytyPS5 src/libs/network.cpp @9e41d8320a27 (NetCtlCallbackSlot L3447-3451, NetCtlCheckCallback L3648-3661, NetCtlRegisterCallback L3687-3707); shadPS4 net_ctl_obj.cpp L47-57 delivers on every check instead, and the debt entry records the difference and that KytyPS5 calls the callbacks under its lock. sceNetCtlTerm clears both tables, as KytyPS5 NetCtlTerm (L3625-3633) does. V6 slots keep their argument but get no event, since no source says which call delivers them. NetCtlCallback is now an APS5_VABI pointer, so the Windows build calls the guest function with the System V ABI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>