[Wii/Gamecube] fixed Boot ROM selection not being always applied immediately

This commit is contained in:
EkeEke 2015-07-09 23:55:32 +02:00
parent 3878cda3cf
commit f4b9a15956
3 changed files with 74 additions and 47 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

View File

@ -1165,26 +1165,22 @@ static void rompathmenu ()
{ {
ret = GUI_RunMenu(m); ret = GUI_RunMenu(m);
switch (ret) if (ret < 0)
{
case -1:
{ {
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
return; return;
} }
default:
{
/* Initialize System ROM browser */ /* Initialize System ROM browser */
if (OpenDirectory(config.l_device, ret + FILETYPE_MAX)) if (OpenDirectory(config.l_device, ret + FILETYPE_MAX))
{ {
/* Get current System ROM path */
char *dir = GetCurrentDirectory();
/* Open System ROM browser */ /* Open System ROM browser */
GUI_DeleteMenu(m); GUI_DeleteMenu(m);
i = FileSelector(ret + FILETYPE_MAX); i = FileSelector(ret + FILETYPE_MAX);
/* Get current System ROM path */
char *dir = GetCurrentDirectory();
/* System ROM selected ? */ /* System ROM selected ? */
if (i >= 0) if (i >= 0)
{ {
@ -1194,8 +1190,19 @@ static void rompathmenu ()
/* mark System ROM as found */ /* mark System ROM as found */
strcpy(strstr(items[ret].text,":") + 2, "FOUND"); strcpy(strstr(items[ret].text,":") + 2, "FOUND");
/* Genesis BOOT ROM special case */ /* BOOT ROM special cases */
if (config.sys_rom[ret] == MD_BIOS) switch (ret)
{
case 0:
case 1:
case 2:
{
/* force CD BOOT ROM reloading */
system_bios &= ~0x10;
break;
}
case 3:
{ {
/* Genesis BOOT ROM must be reloaded */ /* Genesis BOOT ROM must be reloaded */
if (load_archive(MD_BIOS, boot_rom, 0x800, NULL) > 0) if (load_archive(MD_BIOS, boot_rom, 0x800, NULL) > 0)
@ -1203,15 +1210,39 @@ static void rompathmenu ()
/* check if BOOT ROM header is valid */ /* check if BOOT ROM header is valid */
if (!memcmp((char *)(boot_rom + 0x120),"GENESIS OS", 10)) if (!memcmp((char *)(boot_rom + 0x120),"GENESIS OS", 10))
{ {
/* mark Genesis BIOS as loaded */ /* mark Genesis BOOT ROM as loaded */
system_bios |= SYSTEM_MD; system_bios |= SYSTEM_MD;
} }
else else
{ {
/* mark Genesis BIOS as unloaded */ /* mark Genesis BOOT ROM as unloaded */
system_bios &= ~SYSTEM_MD; system_bios &= ~SYSTEM_MD;
} }
} }
break;
}
case 4:
case 5:
case 6:
{
/* force Master System BOOT ROM reloading */
system_bios &= ~SYSTEM_SMS;
break;
}
case 7:
{
/* force Game Gear BOOT ROM reloading */
system_bios &= ~SYSTEM_GG;
break;
}
default:
{
/* not a BOOT ROM */
break;
}
} }
} }
@ -1219,10 +1250,6 @@ static void rompathmenu ()
GUI_InitMenu(m); GUI_InitMenu(m);
} }
} }
}
}
GUI_DeleteMenu(m);
} }
/**************************************************************************** /****************************************************************************