naomi: crash on exit when M4 cart fails to load

avoid loading AW cart on Naomi and the other way around
This commit is contained in:
Flyinghead 2019-03-08 20:01:54 +01:00
parent 9178206c95
commit f1cea640e2
2 changed files with 14 additions and 2 deletions

View File

@ -62,7 +62,7 @@ private:
static const u8 k_sboxes[4][16];
u16 m4id;
u8 *m_key_data; // 2048 bytes
u8 *m_key_data = NULL; // 2048 bytes
u16 subkey1, subkey2;
u16 one_round[0x10000];

View File

@ -164,7 +164,19 @@ static bool naomi_cart_LoadZip(char *filename)
}
struct Game *game = &Games[gameid];
#if DC_PLATFORM == DC_PLATFORM_NAOMI
if (game->cart_type == AW)
{
msgboxf("Atomiswave cartridges are not supported by NAOMI", 0);
return false;
}
#else
if (game->cart_type != AW)
{
msgboxf("NAOMI cartridges are not supported by Atomiswave", 0);
return false;
}
#endif
Archive *archive = OpenArchive(filename);
if (archive != NULL)
printf("Opened %s\n", filename);