OSD: support for options SC and FSC.

This commit is contained in:
Sorgelig
2021-12-16 04:31:00 +08:00
parent 3a1ec245de
commit 4274a3018f
3 changed files with 92 additions and 35 deletions

View File

@@ -302,6 +302,11 @@ void StoreIdx_F(int idx, char *path)
strcpy(Selected_F[idx], path);
}
void StoreIdx_S(int idx, char *path)
{
strcpy(Selected_S[idx], path);
}
static char selPath[1024] = {};
static int changeDir(char *dir)
@@ -1954,12 +1959,13 @@ void HandleUI(void)
ioctl_index = menusub + 1;
int idx = 1;
if (p[1] == 'S')
if (p[idx] == 'S')
{
opensave = 1;
idx++;
}
else if (p[1] == 'C')
if (p[idx] == 'C')
{
store_name = 1;
idx++;
@@ -1991,8 +1997,17 @@ void HandleUI(void)
}
else if (p[0] == 'S' && (select || recent))
{
store_name = 0;
int idx = 1;
if (p[idx] == 'C')
{
store_name = 1;
idx++;
}
ioctl_index = 0;
if ((p[1] >= '0' && p[1] <= '9') || is_x86()) ioctl_index = p[1] - '0';
if ((p[idx] >= '0' && p[idx] <= '9') || is_x86()) ioctl_index = p[idx] - '0';
substrcpy(ext, p, 1);
while (strlen(ext) % 3) strcat(ext, " ");
@@ -2006,12 +2021,10 @@ void HandleUI(void)
if (is_pce() || is_megacd() || is_x86())
{
//if (!strncasecmp(fs_pFileExt, "CUE", 3))
//{
//look for CHD too
strcat(fs_pFileExt, "CHD");
strcat(ext, "CHD");
//}
//look for CHD too
strcat(fs_pFileExt, "CHD");
strcat(ext, "CHD");
int num = ScanDirectory(Selected_tmp, SCANF_INIT, fs_pFileExt, 0);
memcpy(Selected_tmp, Selected_S[(int)ioctl_index], sizeof(Selected_tmp));
@@ -2200,6 +2213,13 @@ void HandleUI(void)
case MENU_GENERIC_IMAGE_SELECTED:
{
if (store_name)
{
char str[64];
sprintf(str, "%s.s%d", user_io_get_core_name(), ioctl_index);
FileSaveConfig(str, selPath, sizeof(selPath));
}
menustate = MENU_GENERIC_MAIN1;
if (selPath[0] && !is_x86()) MenuHide();