PCXT: Fix overlap in OSD menu between ROMs (Fx) and images (Sx) saved in config (#694)

* PCXT: Fix overlap in OSD menu between ROMs (Fx) and images (Sx) saved in config

* PCXT: Menu is not hidden when an image is selected
This commit is contained in:
Aitor Gómez
2022-09-15 19:03:09 +02:00
committed by GitHub
parent a845f8407f
commit 5728bdda78
3 changed files with 40 additions and 2 deletions

View File

@@ -1687,13 +1687,32 @@ void HandleUI(void)
strcat(s, " ");
strcat(s, x86_get_image_name(num));
}
else if (is_pcxt() && pcxt_get_image_name(num))
else if (is_pcxt() && (p[0] == 'S') && pcxt_get_image_name(num))
{
strcpy(s, " ");
substrcpy(s + 1, p, 2);
strcat(s, " ");
strcat(s, pcxt_get_image_name(num));
}
else if (is_pcxt() && (p[0] == 'F'))
{
strcpy(s, " ");
substrcpy(s + 1, p, 2);
static char str[1024];
sprintf(str, "%s.f%c", user_io_get_core_name(), p[idx]);
if (FileLoadConfig(str, str, sizeof(str)) && str[0])
{
strcat(s, " ");
strcat(s, GetNameFromPath(str));
}
else
{
strcat(s, " *.");
pos = s + strlen(s);
substrcpy(pos, p, 1);
strcpy(pos, GetExt(pos));
}
}
else
{
if (strlen(s))
@@ -2278,7 +2297,7 @@ void HandleUI(void)
}
menustate = MENU_GENERIC_MAIN1;
if (selPath[0] && !is_x86()) MenuHide();
if (selPath[0] && !is_x86() && !is_pcxt()) MenuHide();
printf("Image selected: %s\n", selPath);
memcpy(Selected_S[(int)ioctl_index], selPath, sizeof(Selected_S[(int)ioctl_index]));