mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-04 18:05:06 +01:00
fixed ROM file extension detection
This commit is contained in:
parent
cf7332859c
commit
8ef3139f9e
@ -291,8 +291,9 @@ int FileSelector(void)
|
||||
{
|
||||
/* get ROM filename without extension */
|
||||
sprintf (text, "%s", filelist[selection].filename);
|
||||
if (strlen(text) >= 4)
|
||||
text[strlen(text) - 4] = 0;
|
||||
int i = strlen(text) - 1;
|
||||
while (i && (text[i] != '.')) i--;
|
||||
if (i) text[i] = 0;
|
||||
|
||||
/* ROM database informations */
|
||||
sprintf (fname, "%s/db/%s.xml", DEFAULT_PATH, text);
|
||||
@ -471,6 +472,7 @@ int FileSelector(void)
|
||||
|
||||
/* clear selection by default */
|
||||
selection = offset = 0;
|
||||
old = -1;
|
||||
|
||||
/* select previous directory */
|
||||
for (i=0; i<maxfiles; i++)
|
||||
@ -534,6 +536,7 @@ int FileSelector(void)
|
||||
|
||||
/* clear selection by default */
|
||||
selection = offset = 0;
|
||||
old = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -218,7 +218,9 @@ void reloadrom (int size, char *name)
|
||||
|
||||
/* ROM filename without extension*/
|
||||
sprintf(rom_filename,"%s",name);
|
||||
rom_filename[strlen(rom_filename) - 4] = 0;
|
||||
int i = strlen(rom_filename) - 1;
|
||||
while (i && (rom_filename[i] != '.')) i--;
|
||||
if (i) rom_filename[i] = 0;
|
||||
|
||||
if (hotswap)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user