mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Actually run callbacks for async IO.
Probably needs to actually be delayed though.
This commit is contained in:
parent
8d946a7a3a
commit
be779d7f77
1 changed files with 7 additions and 3 deletions
|
@ -224,7 +224,7 @@ void __IoCompleteAsyncIO(SceUID id) {
|
||||||
FileNode *f = kernelObjects.Get < FileNode > (id, error);
|
FileNode *f = kernelObjects.Get < FileNode > (id, error);
|
||||||
if (f) {
|
if (f) {
|
||||||
if (f->callbackID) {
|
if (f->callbackID) {
|
||||||
// __KernelNotifyCallbackType(THREAD_CALLBACK_IO, __KernelGetCurThread(), f->callbackID, f->callbackArg);
|
__KernelNotifyCallback(THREAD_CALLBACK_IO, f->callbackID, f->callbackArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -714,9 +714,12 @@ u32 sceIoSetAsyncCallback(int id, u32 clbckId, u32 clbckArg)
|
||||||
FileNode *f = kernelObjects.Get < FileNode > (id, error);
|
FileNode *f = kernelObjects.Get < FileNode > (id, error);
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
|
// TODO: Check replacing / updating?
|
||||||
f->callbackID = clbckId;
|
f->callbackID = clbckId;
|
||||||
f->callbackArg = clbckArg;
|
f->callbackArg = clbckArg;
|
||||||
return 0;
|
// TODO: Not sure when this is unregistered?
|
||||||
|
error = __KernelRegisterCallback(THREAD_CALLBACK_IO, clbckId);
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -736,7 +739,8 @@ u32 sceIoOpenAsync(const char *filename, int flags, int mode)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(HLE, "sceIoOpenAsync() sorta implemented");
|
DEBUG_LOG(HLE, "sceIoOpenAsync() sorta implemented");
|
||||||
u32 fd = sceIoOpen(filename, flags, mode);
|
u32 fd = sceIoOpen(filename, flags, mode);
|
||||||
//__IoCompleteAsyncIO(fd); // The return value
|
// TODO: This can't actually have a callback yet, but if it's set before waiting, it should be called.
|
||||||
|
__IoCompleteAsyncIO(fd);
|
||||||
// We have to return an fd here, which may have been destroyed when we reach Wait if it failed.
|
// We have to return an fd here, which may have been destroyed when we reach Wait if it failed.
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue