mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
(360/PS3) Some changes needed for FBA on consoles in specific
This commit is contained in:
parent
7f4d701b19
commit
a328bd578e
@ -178,6 +178,7 @@ static void set_default_settings (void)
|
||||
g_console.custom_viewport_height = 0;
|
||||
g_console.custom_viewport_x = 0;
|
||||
g_console.custom_viewport_y = 0;
|
||||
g_console.extract_zip_files_enable = can_extract_zip_files();
|
||||
|
||||
//g_extern
|
||||
g_extern.state_slot = 0;
|
||||
|
@ -315,7 +315,7 @@ HRESULT CSSNESFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandled )
|
||||
{
|
||||
memset(strbuffer, 0, sizeof(strbuffer));
|
||||
wcstombs(strbuffer, (const wchar_t *)m_romlist.GetText(index), sizeof(strbuffer));
|
||||
if(strstr(strbuffer, ".zip") || strstr(strbuffer, ".ZIP"))
|
||||
if((strstr(strbuffer, ".zip") || strstr(strbuffer, ".ZIP")) && g_console.extract_zip_files_enable)
|
||||
{
|
||||
char path_tmp[1024];
|
||||
sprintf(path_tmp, "%s\\%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), strbuffer);
|
||||
|
@ -109,6 +109,21 @@ void ssnes_console_set_default_keybind_names_for_emulator(void)
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
|
||||
/* if 0, the emulator core uses zlib internally and therefore we can't extract zip files to the cache partitions. If 1, zip files can be extracted to the cache partitions */
|
||||
|
||||
int can_extract_zip_files(void)
|
||||
{
|
||||
bool retval = 1;
|
||||
|
||||
const char *id = snes_library_id();
|
||||
|
||||
// FBA Next
|
||||
if (strstr(id, "FBA"))
|
||||
retval = 0;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int ssnes_extract_currentfile_in_zip(unzFile uf)
|
||||
{
|
||||
char filename_inzip[PATH_MAX];
|
||||
|
@ -33,6 +33,7 @@ void ssnes_console_name_from_id(char *name, size_t size);
|
||||
void ssnes_console_set_default_keybind_names_for_emulator(void);
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
int can_extract_zip_files(void);
|
||||
int ssnes_extract_zipfile(const char *zip_path);
|
||||
#endif
|
||||
|
||||
|
@ -189,6 +189,7 @@ struct console_settings
|
||||
bool block_config_read;
|
||||
bool default_sram_dir_enable;
|
||||
bool default_savestate_dir_enable;
|
||||
bool extract_zip_files_enable;
|
||||
bool frame_advance_enable;
|
||||
bool gamma_correction_enable;
|
||||
bool initialize_ssnes_enable;
|
||||
|
@ -155,6 +155,7 @@ static void set_default_settings(void)
|
||||
g_console.custom_viewport_y = 0;
|
||||
strlcpy(g_console.rsound_ip_address, "0.0.0.0", sizeof(g_console.rsound_ip_address));
|
||||
g_console.custom_bgm_enable = true;
|
||||
g_console.extract_zip_files_enable = can_extract_zip_files();
|
||||
|
||||
// g_extern
|
||||
g_extern.state_slot = 0;
|
||||
|
@ -2001,7 +2001,7 @@ static void select_rom(void)
|
||||
|
||||
snprintf(rom_path_temp, sizeof(rom_path_temp), "%s/%s", FILEBROWSER_GET_CURRENT_DIRECTORY_NAME(browser), FILEBROWSER_GET_CURRENT_FILENAME(browser));
|
||||
|
||||
if(strstr(rom_path_temp, ".zip") || strstr(rom_path_temp, ".ZIP"))
|
||||
if((strstr(rom_path_temp, ".zip") || strstr(rom_path_temp, ".ZIP")) && g_console.extract_zip_files_enable)
|
||||
ssnes_extract_zipfile(rom_path_temp);
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user