1
0
mirror of https://github.com/libretro/RetroArch synced 2025-02-19 12:41:00 +00:00

Fix load state issue

This commit is contained in:
Francisco Javier Trujillo Mata 2019-02-26 22:11:56 +01:00
parent 0e7d5ed32b
commit 3ec2ec2e11
2 changed files with 15 additions and 12 deletions
frontend/drivers
libretro-common/vfs

@ -195,17 +195,15 @@ static void create_path_names(void)
{
char cwd[FILENAME_MAX];
getcwd(cwd, sizeof(cwd));
strcat(cwd, "app");
if (strncmp(cwd, "mc0:", 4) || strncmp(cwd, "mc1:", 4)) {
/* For now the save and load states just working in MCs */
strlcpy(cwd, "mc0:/", sizeof(cwd));
}
strcat(cwd, "RETROARCH");
strlcpy(eboot_path, cwd, sizeof(eboot_path));
strlcpy(g_defaults.dirs[DEFAULT_DIR_PORT], eboot_path, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
strcat(cwd, "/data/retroarch");
strlcpy(user_path, cwd, sizeof(user_path));
// strlcpy(eboot_path, "mc0:/RETROARCH", sizeof(eboot_path));
// strlcpy(g_defaults.dirs[DEFAULT_DIR_PORT], eboot_path, sizeof(g_defaults.dirs[DEFAULT_DIR_PORT]));
// strlcpy(user_path, "mc0:/RETROARCH/data/retroarch", sizeof(user_path));
strlcpy(user_path, eboot_path, sizeof(user_path));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE], g_defaults.dirs[DEFAULT_DIR_PORT],
"CORES", sizeof(g_defaults.dirs[DEFAULT_DIR_CORE]));
fill_pathname_join(g_defaults.dirs[DEFAULT_DIR_CORE_INFO], g_defaults.dirs[DEFAULT_DIR_PORT],

@ -222,7 +222,12 @@ int64_t retro_vfs_file_seek_internal(libretro_vfs_implementation_file *stream, i
#elif defined(__CELLOS_LV2__) || defined(_MSC_VER) && _MSC_VER <= 1310
return fseek(stream->fp, (long)offset, whence);
#elif defined(PS2)
return fioLseek(fileno(stream->fp), (off_t)offset, whence);
int64_t ret = fioLseek(fileno(stream->fp), (off_t)offset, whence);
/* fioLseek could return positive numbers */
if (ret > 0) {
ret = 0;
}
return ret;
#elif defined(ORBIS)
int ret = orbisLseek(stream->fd, offset, whence);
if (ret < 0)
@ -924,9 +929,9 @@ int retro_vfs_mkdir_impl(const char *dir)
#elif defined(VITA) || defined(PSP)
int ret = sceIoMkdir(dir, 0777);
#elif defined(PS2)
int ret =fileXioMkdir(dir, 0777);
int ret = fileXioMkdir(dir, 0777);
#elif defined(ORBIS)
int ret =orbisMkdir(dir, 0755);
int ret = orbisMkdir(dir, 0755);
#elif defined(__QNX__)
int ret = mkdir(dir, 0777);
#else