mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-14 06:45:09 +01:00
[Core/MCD] improved ROM file extension renaming to .iso for games with CD support
This commit is contained in:
parent
4a41e0cca7
commit
935a1f68dc
@ -735,19 +735,21 @@ int load_rom(char *filename)
|
|||||||
/* try to load CD BOOTROM */
|
/* try to load CD BOOTROM */
|
||||||
if (load_bios())
|
if (load_bios())
|
||||||
{
|
{
|
||||||
char *ptr;
|
|
||||||
char fname[256];
|
char fname[256];
|
||||||
|
int len = strlen(filename);
|
||||||
|
|
||||||
/* boot from cartridge */
|
/* boot from cartridge */
|
||||||
scd.cartridge.boot = 0x40;
|
scd.cartridge.boot = 0x40;
|
||||||
|
|
||||||
/* automatically load associated .iso image */
|
/* change ROM filename extension to .iso */
|
||||||
strncpy(fname, filename, 256);
|
while (len && (filename[len-1] != '.')) len--;
|
||||||
ptr = strchr(fname,'.');
|
if (len < 253)
|
||||||
if (ptr && (ptr < &fname[252]))
|
|
||||||
{
|
{
|
||||||
strcpy(ptr+1,"iso");
|
strncpy(fname, filename, len);
|
||||||
|
strcpy(&fname[len], "iso");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* automatically load associated .iso image */
|
||||||
cdd_load(fname, (char *)cdc.ram);
|
cdd_load(fname, (char *)cdc.ram);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user