Commit 694e9d44 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Rewrite auto for loop

parent 88db1ef7
......@@ -1106,51 +1106,55 @@ static bool DetectRegionByFN(const std::string& fn, unsigned* const region)
return false;
}
typedef struct
{
const unsigned type;
const char *name;
} CartName;
static bool InitCommon(const unsigned cart_type, const unsigned smpc_area)
{
unsigned i;
ss_dbg_mask = MDFN_GetSettingUI("ss.dbg_mask");
//
{
log_cb(RETRO_LOG_INFO, "[Mednafen]: Region: 0x%01x.\n", smpc_area);
const struct
{
const unsigned type;
const char* name;
} CartNames[] =
{
{ CART_NONE, _("None") },
{ CART_BACKUP_MEM, _("Backup Memory") },
{ CART_EXTRAM_1M, _("1MiB Extended RAM") },
{ CART_EXTRAM_4M, _("4MiB Extended RAM") },
{ CART_KOF95, _("King of Fighters '95 ROM") },
{ CART_ULTRAMAN, _("Ultraman ROM") },
{ CART_MDFN_DEBUG, _("Mednafen Debug") },
const CartName CartNames[] =
{
{ CART_NONE, "None" },
{ CART_BACKUP_MEM, "Backup Memory" },
{ CART_EXTRAM_1M, "1MiB Extended RAM" },
{ CART_EXTRAM_4M, "4MiB Extended RAM" },
{ CART_KOF95, "King of Fighters '95 ROM" },
{ CART_ULTRAMAN, "Ultraman ROM" },
{ CART_MDFN_DEBUG, "Mednafen Debug" }
};
const char* cn = _("Unknown");
const char* cn = "Unknown";
for(auto const& cne : CartNames)
{
if(cne.type == cart_type)
for(i = 0; i < ARRAY_SIZE(CartNames); i++)
{
CartName cne = CartNames[i];
if(cne.type != cart_type)
continue;
cn = cne.name;
break;
}
}
log_cb(RETRO_LOG_INFO, "[Mednafen]: Cart: %s.\n", cn);
}
//
for(unsigned c = 0; c < 2; c++)
for(i = 0; i < 2; i++)
{
CPU[c].Init();
CPU[c].SetMD5((bool)c);
CPU[i].Init();
CPU[i].SetMD5((bool)i);
}
//
// Initialize backup memory.
//
memset(BackupRAM, 0x00, sizeof(BackupRAM));
for(unsigned i = 0; i < 0x40; i++)
for(i = 0; i < 0x40; i++)
BackupRAM[i] = BRAM_Init_Data[i & 0x0F];
// Call InitFastMemMap() before functions like SOUND_Init()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment