diff --git a/360/main.c b/360/main.c index c8e549986c..23d466fc29 100644 --- a/360/main.c +++ b/360/main.c @@ -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; diff --git a/360/menu.cpp b/360/menu.cpp index 389dac5c76..b6e47f3510 100644 --- a/360/menu.cpp +++ b/360/menu.cpp @@ -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); diff --git a/console/console_ext.c b/console/console_ext.c index f8be615c33..3d7a4a5605 100644 --- a/console/console_ext.c +++ b/console/console_ext.c @@ -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]; diff --git a/console/console_ext.h b/console/console_ext.h index 3b87a42836..db91077aaf 100644 --- a/console/console_ext.h +++ b/console/console_ext.h @@ -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 diff --git a/general.h b/general.h index 336f0299e6..f22ba18949 100644 --- a/general.h +++ b/general.h @@ -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; diff --git a/ps3/main.c b/ps3/main.c index b5229ab098..a85931f2ed 100644 --- a/ps3/main.c +++ b/ps3/main.c @@ -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; diff --git a/ps3/menu.c b/ps3/menu.c index 6b9aa2693f..5d018311c4 100644 --- a/ps3/menu.c +++ b/ps3/menu.c @@ -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 {