From 9260e8c457244be13664c507f3f4cfb1baba1b16 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Fri, 28 Jul 2023 23:39:03 +0800 Subject: [PATCH] neogeo: select CD by folder if only one cue/chd is present. --- menu.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/menu.cpp b/menu.cpp index 1c6ed16..25bda69 100644 --- a/menu.cpp +++ b/menu.cpp @@ -2187,11 +2187,14 @@ void HandleUI(void) if (is_x86() || is_pcxt()) strcpy(Selected_tmp, x86_get_image_path(ioctl_index)); if (is_psx() && (ioctl_index == 2 || ioctl_index == 3)) fs_Options |= SCANO_SAVES; - if (is_pce() || is_megacd() || is_x86() || (is_psx() && !(fs_Options & SCANO_SAVES))) + if (is_pce() || is_megacd() || is_x86() || (is_psx() && !(fs_Options & SCANO_SAVES)) || is_neogeo()) { //look for CHD too - strcat(fs_pFileExt, "CHD"); - strcat(ext, "CHD"); + if (!strcasestr(ext, "CHD")) + { + 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)); @@ -4969,7 +4972,7 @@ void HandleUI(void) char type = flist_SelectedItem()->de.d_type; memcpy(name, flist_SelectedItem()->de.d_name, sizeof(name)); - if ((fs_Options & SCANO_UMOUNT) && (is_megacd() || is_pce() || (is_psx() && !(fs_Options & SCANO_SAVES)) || is_saturn()) && type == DT_DIR && strcmp(flist_SelectedItem()->de.d_name, "..")) + if ((fs_Options & SCANO_UMOUNT) && (is_megacd() || is_pce() || is_neogeo() || (is_psx() && !(fs_Options & SCANO_SAVES)) || is_saturn()) && type == DT_DIR && strcmp(flist_SelectedItem()->de.d_name, "..")) { int len = strlen(selPath); strcat(selPath, "/");