(360/PS3) Some changes needed for FBA on consoles in specific

This commit is contained in:
TwinAphex51224 2012-03-11 22:39:12 +01:00
parent 7f4d701b19
commit a328bd578e
7 changed files with 21 additions and 2 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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];

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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
{