[Core/CD] added CD hardware model auto-detection when BIOS is loaded as normal ROM file

This commit is contained in:
ekeeke 2023-11-26 17:41:12 +01:00
parent 52b4f78b82
commit 02c9dac337

View File

@ -419,17 +419,17 @@ int load_bios(int system)
if (size > 0) if (size > 0)
{ {
/* auto-detect CD hardware model */ /* auto-detect CD hardware model */
if (!memcmp (&scd.bootrom[0x120], "WONDER-MEGA BOOT", 16)) if (!memcmp(&scd.bootrom[0x120], "WONDER-MEGA BOOT", 16))
{ {
/* Wondermega CD hardware */ /* Wondermega CD hardware */
scd.type = CD_TYPE_WONDERMEGA; scd.type = CD_TYPE_WONDERMEGA;
} }
else if (!memcmp (&scd.bootrom[0x120], "WONDERMEGA2 BOOT", 16)) else if (!memcmp(&scd.bootrom[0x120], "WONDERMEGA2 BOOT", 16))
{ {
/* Wondermega M2 / X'Eye CD hardware */ /* Wondermega M2 / X'Eye CD hardware */
scd.type = CD_TYPE_WONDERMEGA_M2; scd.type = CD_TYPE_WONDERMEGA_M2;
} }
else if (!memcmp (&scd.bootrom[0x120], "CDX BOOT ROM ", 16)) else if (!memcmp(&scd.bootrom[0x120], "CDX BOOT ROM ", 16))
{ {
/* CDX / Multi-Mega CD hardware */ /* CDX / Multi-Mega CD hardware */
scd.type = CD_TYPE_CDX; scd.type = CD_TYPE_CDX;
@ -792,6 +792,28 @@ int load_rom(char *filename)
/* enable CD hardware */ /* enable CD hardware */
system_hw = SYSTEM_MCD; system_hw = SYSTEM_MCD;
/* auto-detect CD hardware model */
if (strstr(rominfo.domestic, "WONDER-MEGA BOOT"))
{
/* Wondermega CD hardware */
scd.type = CD_TYPE_WONDERMEGA;
}
else if (strstr(rominfo.domestic, "WONDERMEGA2 BOOT"))
{
/* Wondermega M2 / X'Eye CD hardware */
scd.type = CD_TYPE_WONDERMEGA_M2;
}
else if (strstr(rominfo.domestic, "CDX BOOT ROM"))
{
/* CDX / Multi-Mega CD hardware */
scd.type = CD_TYPE_CDX;
}
else
{
/* default CD hardware */
scd.type = CD_TYPE_DEFAULT;
}
/* boot from CD hardware */ /* boot from CD hardware */
scd.cartridge.boot = 0x00; scd.cartridge.boot = 0x00;