Add more delay as ForceUMDDelay

Also add setting in libretro
This commit is contained in:
sum2012 2023-10-23 20:03:42 +08:00
parent 92c1eb4efa
commit 6a844dd985
3 changed files with 5 additions and 2 deletions

View File

@ -128,6 +128,7 @@ enum IOTimingMethods {
IOTIMING_FAST = 0,
IOTIMING_HOST = 1,
IOTIMING_REALISTIC = 2,
IOTIMING_UMDSLOWREALISTIC = 3,
};
enum class AutoLoadSaveState {

View File

@ -341,7 +341,7 @@ static void IoAsyncCleanupThread(int fd) {
}
static int GetIOTimingMethod() {
if (PSP_CoreParameter().compat.flags().ForceUMDDelay) {
if (PSP_CoreParameter().compat.flags().ForceUMDDelay || PSP_CoreParameter().compat.flags().ForceUMDReadSpeed || g_Config.iIOTimingMethod == IOTIMING_UMDSLOWREALISTIC) {
return IOTIMING_REALISTIC;
} else {
return g_Config.iIOTimingMethod;
@ -1586,7 +1586,7 @@ static u32 sceIoOpen(const char *filename, int flags, int mode) {
// UMD: Speed varies from 1-6ms.
// Card: Path depth matters, but typically between 10-13ms on a standard Pro Duo.
int delay;
if (PSP_CoreParameter().compat.flags().ForceUMDReadSpeed || g_Config.iIOTimingMethod == 3) {
if (PSP_CoreParameter().compat.flags().ForceUMDReadSpeed || g_Config.iIOTimingMethod == IOTIMING_UMDSLOWREALISTIC) {
delay = 500000;
}
else {

View File

@ -523,6 +523,8 @@ static void check_variables(CoreParameter &coreParam)
g_Config.iIOTimingMethod = IOTIMING_HOST;
else if (!strcmp(var.value, "Simulate UMD delays"))
g_Config.iIOTimingMethod = IOTIMING_REALISTIC;
else if (!strcmp(var.value, "Simulate UMD slow reading speed"))
g_Config.iIOTimingMethod = IOTIMING_UMDSLOWREALISTIC;
}
var.key = "ppsspp_force_lag_sync";