}\r
}\r
\r
+/* check if the name begins with BIOS name */\r
+static int emu_isBios(const char *name)\r
+{\r
+ int i;\r
+ for (i = 0; i < sizeof(biosfiles_us)/sizeof(biosfiles_us[0]); i++)\r
+ if (strstr(name, biosfiles_us[i]) != NULL) return 1;\r
+ for (i = 0; i < sizeof(biosfiles_eu)/sizeof(biosfiles_eu[0]); i++)\r
+ if (strstr(name, biosfiles_eu[i]) != NULL) return 1;\r
+ for (i = 0; i < sizeof(biosfiles_jp)/sizeof(biosfiles_jp[0]); i++)\r
+ if (strstr(name, biosfiles_jp[i]) != NULL) return 1;\r
+ return 0;\r
+}\r
+\r
/* checks if romFileName points to valid MegaCD image\r
* if so, checks for suitable BIOS */\r
int emu_cdCheck(int *pregion)\r
\r
menu_romload_end();\r
\r
- // emu_ReadConfig() might have messed currentConfig.lastRomFile\r
- strncpy(currentConfig.lastRomFile, romFileName, sizeof(currentConfig.lastRomFile)-1);\r
- currentConfig.lastRomFile[sizeof(currentConfig.lastRomFile)-1] = 0;\r
+ if (!emu_isBios(romFileName))\r
+ {\r
+ // emu_ReadConfig() might have messed currentConfig.lastRomFile\r
+ strncpy(currentConfig.lastRomFile, romFileName, sizeof(currentConfig.lastRomFile)-1);\r
+ currentConfig.lastRomFile[sizeof(currentConfig.lastRomFile)-1] = 0;\r
+ }\r
\r
if (PicoPatches) {\r
PicoPatchPrepare();\r