diff --git a/menu.cpp b/menu.cpp index 178bf98..1c6ed16 100644 --- a/menu.cpp +++ b/menu.cpp @@ -393,7 +393,10 @@ void SelectFile(const char* path, const char* pFileExt, int Options, unsigned ch } else { - const char *home = is_menu() ? "Scripts" : user_io_get_core_path((is_pce() && !strncasecmp(pFileExt, "CUE", 3)) ? PCECD_DIR : NULL, 1); + const char *home = is_menu() ? "Scripts" : user_io_get_core_path( + (is_pce() && !strncasecmp(pFileExt, "CUE", 3)) ? PCECD_DIR : + (is_neogeo() && !strncasecmp(pFileExt, "CUE", 3)) ? NEOCD_DIR : + NULL, 1); home_dir = strrchr(home, '/'); if (home_dir) home_dir++; else home_dir = home; diff --git a/support/neogeo/neogeo_loader.cpp b/support/neogeo/neogeo_loader.cpp index d584fc6..d98b521 100644 --- a/support/neogeo/neogeo_loader.cpp +++ b/support/neogeo/neogeo_loader.cpp @@ -6,6 +6,7 @@ #include #include // clock_gettime, CLOCK_REALTIME #include "neogeo_loader.h" +#include "neogeocd.h" #include "../../sxmlc.h" #include "../../user_io.h" #include "../../fpga_io.h" @@ -1077,7 +1078,7 @@ int neogeo_romset_tx(char* name, int cd_en) crom_sz = 0; set_config(0, -1); - const char* home = HomeDir(); + const char* home = HomeDir(cd_en ? NEOCD_DIR : NULL); // Send cd_en to the FPGA before loading files set_config((cd_en & 1) << 31, 1 << 31); @@ -1153,7 +1154,11 @@ int neogeo_romset_tx(char* name, int cd_en) neogeo_tx(NULL, NULL, 0, -1, 0, 0); if (!cd_en) neogeo_tx(home, "sfix.sfix", NEO_FILE_FIX, 2, 0, 0); - neogeo_file_tx(home, "000-lo.lo", NEO_FILE_8BIT, 1, 0, 0x10000); + if (!neogeo_file_tx(home, "000-lo.lo", NEO_FILE_8BIT, 1, 0, 0x10000) && cd_en) + { + //fallback to original NeoGeo folder + neogeo_file_tx(HomeDir(), "000-lo.lo", NEO_FILE_8BIT, 1, 0, 0x10000); + } if (crom_start < 0x300000) crom_start = 0x300000; uint32_t crom_max = crom_start + crom_sz_max; diff --git a/support/neogeo/neogeocd.h b/support/neogeo/neogeocd.h index c4cb799..00b6109 100644 --- a/support/neogeo/neogeocd.h +++ b/support/neogeo/neogeocd.h @@ -10,4 +10,7 @@ int neocd_can_send_data(uint8_t type); int neocd_is_en(); void neocd_set_en(int enable); void set_poll_timer(); + +#define NEOCD_DIR "NeoGeo-CD" + #endif