menu: FC option to store file name.

This commit is contained in:
sorgelig
2021-03-23 13:55:06 +08:00
parent 054756a493
commit abceab97bd
2 changed files with 30 additions and 6 deletions

View File

@@ -1020,6 +1020,7 @@ void HandleUI(void)
static char title[32] = {};
static uint32_t saved_menustate = 0;
static char addon[1024];
static int store_name;
static char cp_MenuCancel;
@@ -1967,6 +1968,7 @@ void HandleUI(void)
{
if (p[0] == 'F' && (select || recent))
{
store_name = 0;
opensave = 0;
ioctl_index = menusub + 1;
int idx = 1;
@@ -1976,6 +1978,11 @@ void HandleUI(void)
opensave = 1;
idx++;
}
else if (p[1] == 'C')
{
store_name = 1;
idx++;
}
if (p[idx] >= '0' && p[idx] <= '9') ioctl_index = p[idx] - '0';
substrcpy(ext, p, 1);
@@ -2170,6 +2177,13 @@ void HandleUI(void)
printf("File selected: %s\n", selPath);
memcpy(Selected_F[ioctl_index & 15], selPath, sizeof(Selected_F[ioctl_index & 15]));
if (store_name)
{
char str[64];
sprintf(str, "%s.f%d", user_io_get_core_name_ex(), ioctl_index);
FileSaveConfig(str, selPath, sizeof(selPath));
}
char idx = user_io_ext_idx(selPath, fs_pFileExt) << 6 | ioctl_index;
if (addon[0] == 'f' && addon[1] != '1') process_addon(addon, idx);
@@ -2184,7 +2198,7 @@ void HandleUI(void)
pcecd_set_image(0, "");
pcecd_reset();
}
user_io_store_filename(selPath);
if(!store_name) user_io_store_filename(selPath);
user_io_file_tx(selPath, idx, opensave);
if (user_io_use_cheats()) cheats_init(selPath, user_io_get_file_crc());
}

View File

@@ -534,10 +534,10 @@ static void parse_config()
}
}
if (i>=2 && p && p[0])
if (i >= 2 && p && p[0])
{
//skip Disable/Hide masks
while((p[0] == 'H' || p[0] == 'D' || p[0] == 'h' || p[0] == 'd') && strlen(p)>=2) p += 2;
while ((p[0] == 'H' || p[0] == 'D' || p[0] == 'h' || p[0] == 'd') && strlen(p) >= 2) p += 2;
if (p[0] == 'P') p += 2;
if (p[0] == 'R' || p[0] == 'T')
@@ -573,7 +573,7 @@ static void parse_config()
if (p[0] == 'J')
{
int n = 1;
if (p[1] == 'D') { joy_transl = 0; n++; }
if (p[1] == 'D') { joy_transl = 0; n++; }
if (p[1] == 'A') { joy_transl = 1; n++; }
if (p[1] == 'N') { joy_transl = 2; n++; }
@@ -589,11 +589,11 @@ static void parse_config()
uint32_t status = user_io_8bit_set_status(0, 0);
printf("found OX option: %s, 0x%08X\n", p, status);
unsigned long x = getStatus(p+1, status);
unsigned long x = getStatus(p + 1, status);
if (is_x86())
{
if (p[2] == '2') x86_set_fdd_boot(!(x&1));
if (p[2] == '2') x86_set_fdd_boot(!(x & 1));
}
}
@@ -616,6 +616,16 @@ static void parse_config()
{
use_cheats = 1;
}
if (p[0] == 'F' && p[1] == 'C')
{
static char str[1024];
sprintf(str, "%s.f%c", user_io_get_core_name_ex(), p[2]);
if (FileLoadConfig(str, str, sizeof(str)))
{
user_io_file_tx(str, p[2] - '0');
}
}
}
i++;
} while (p || i<3);