mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Merge pull request #8375 from fjtrujy/feature/PS2DefaultDir
[PS2] Fix Load/Save state
This commit is contained in:
commit
d619f14839
@ -193,6 +193,17 @@ static const char *getMountParams(const char *command, char *BlockDevice)
|
||||
|
||||
static void create_path_names(void)
|
||||
{
|
||||
char cwd[FILENAME_MAX];
|
||||
getcwd(cwd, sizeof(cwd));
|
||||
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]));
|
||||
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],
|
||||
|
@ -35,6 +35,7 @@ typedef struct ps2_video
|
||||
GSTEXTURE *menuTexture;
|
||||
GSTEXTURE *coreTexture;
|
||||
bool clearVRAM;
|
||||
bool clearVRAM_font; /* I need to create this additional field to be used in the font driver*/
|
||||
struct retro_hw_render_interface_gskit_ps2 iface; /* Palette in the cores */
|
||||
|
||||
bool menuVisible;
|
||||
@ -184,6 +185,7 @@ static void clearVRAMIfNeeded(ps2_video_t *ps2, void *frame, int width, int heig
|
||||
if (ps2->clearVRAM) {
|
||||
gsKit_vram_clear(ps2->gsGlobal);
|
||||
ps2->iface.updatedPalette = true;
|
||||
ps2->clearVRAM_font = true; /* we need to upload also palette in the font driver */
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +196,8 @@ static void refreshScreen(ps2_video_t *ps2)
|
||||
}
|
||||
gsKit_queue_exec(ps2->gsGlobal);
|
||||
|
||||
/* Here we are just puting in false the ps2->clearVRAM field
|
||||
however, the ps2->clearVRAM_font should be done in the ps2_font driver */
|
||||
ps2->clearVRAM = false;
|
||||
}
|
||||
|
||||
|
@ -108,8 +108,9 @@ static void ps2_font_render_msg(
|
||||
if (ps2) {
|
||||
int x = FONTM_TEXTURE_LEFT_MARGIN;
|
||||
int y = ps2->ps2_video->gsGlobal->Height - FONTM_TEXTURE_BOTTOM_MARGIN;
|
||||
if (ps2->ps2_video->clearVRAM) {
|
||||
if (ps2->ps2_video->clearVRAM_font) {
|
||||
ps2_upload_font(ps2->ps2_video->gsGlobal, ps2->gsFontM);
|
||||
ps2->ps2_video->clearVRAM_font = false;
|
||||
}
|
||||
gsKit_fontm_print_scaled(ps2->ps2_video->gsGlobal, ps2->gsFontM, x, y, FONTM_TEXTURE_ZPOSITION,
|
||||
FONTM_TEXTURE_SCALED , FONTM_TEXTURE_COLOR, msg);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user