mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Io: Improve non-async open timing.
This commit is contained in:
parent
c829ccb87d
commit
52283a50dc
1 changed files with 10 additions and 5 deletions
|
@ -1479,8 +1479,11 @@ static u32 sceIoOpen(const char *filename, int flags, int mode) {
|
||||||
} else if (error == (int)SCE_KERNEL_ERROR_NODEV) {
|
} else if (error == (int)SCE_KERNEL_ERROR_NODEV) {
|
||||||
return hleLogError(SCEIO, error, "device not found");
|
return hleLogError(SCEIO, error, "device not found");
|
||||||
} else if (error == (int)SCE_KERNEL_ERROR_ERRNO_FILE_NOT_FOUND) {
|
} else if (error == (int)SCE_KERNEL_ERROR_ERRNO_FILE_NOT_FOUND) {
|
||||||
// TODO: Depends on filesys.
|
// UMD: Varies between 5-10ms, could take longer if disc spins up.
|
||||||
return hleLogWarning(SCEIO, hleDelayResult(error, "file opened", 10000), "file not found");
|
// TODO: Bad filename at root (disc0:/no.exist) should take ~200us.
|
||||||
|
// Card: Path depth matters, but typically between 10-13ms on a standard Pro Duo.
|
||||||
|
int delay = pspFileSystem.FlagsFromFilename(filename) & FileSystemFlags::UMD ? 6000 : 10000;
|
||||||
|
return hleLogWarning(SCEIO, hleDelayResult(error, "file opened", delay), "file not found");
|
||||||
} else {
|
} else {
|
||||||
return hleLogError(SCEIO, hleDelayResult(error, "file opened", 10000));
|
return hleLogError(SCEIO, hleDelayResult(error, "file opened", 10000));
|
||||||
}
|
}
|
||||||
|
@ -1489,11 +1492,13 @@ static u32 sceIoOpen(const char *filename, int flags, int mode) {
|
||||||
int id = __IoAllocFd(f);
|
int id = __IoAllocFd(f);
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
kernelObjects.Destroy<FileNode>(f->GetUID());
|
kernelObjects.Destroy<FileNode>(f->GetUID());
|
||||||
return hleLogError(SCEIO, hleDelayResult(id, "file opened", 10000), "out of fds");
|
return hleLogError(SCEIO, hleDelayResult(id, "file opened", 1000), "out of fds");
|
||||||
} else {
|
} else {
|
||||||
asyncParams[id].priority = asyncDefaultPriority;
|
asyncParams[id].priority = asyncDefaultPriority;
|
||||||
// TODO: Depends on filesys. Timing is not accurate, aiming low for now.
|
// UMD: Speed varies from 1-6ms.
|
||||||
return hleLogSuccessI(SCEIO, hleDelayResult(id, "file opened", 1000));
|
// Card: Path depth matters, but typically between 10-13ms on a standard Pro Duo.
|
||||||
|
int delay = pspFileSystem.FlagsFromFilename(filename) & FileSystemFlags::UMD ? 4000 : 10000;
|
||||||
|
return hleLogSuccessI(SCEIO, hleDelayResult(id, "file opened", delay));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue