Don't segfault if the specified bios files aren't found.

This commit is contained in:
thelemonman 2013-10-12 20:29:43 +00:00
parent f8778ef3f2
commit fd424a1e3a
1 changed files with 12 additions and 6 deletions

View File

@ -2235,9 +2235,12 @@ static void PrepareBiosARM7()
{
//read arm7 bios from inputfile and flag it if it succeeds
FILE *arm7inf = fopen(CommonSettings.ARM7BIOS,"rb");
if (fread(MMU.ARM7_BIOS,1,16384,arm7inf) == 16384)
NDS_ARM7.BIOS_loaded = true;
fclose(arm7inf);
if (arm7inf)
{
if (fread(MMU.ARM7_BIOS,1,16384,arm7inf) == 16384)
NDS_ARM7.BIOS_loaded = true;
fclose(arm7inf);
}
}
//choose to use SWI emulation or routines from bios
@ -2290,9 +2293,12 @@ static void PrepareBiosARM9()
{
//read arm9 bios from inputfile and flag it if it succeeds
FILE* arm9inf = fopen(CommonSettings.ARM9BIOS,"rb");
if (fread(MMU.ARM9_BIOS,1,4096,arm9inf) == 4096)
NDS_ARM9.BIOS_loaded = true;
fclose(arm9inf);
if (arm9inf)
{
if (fread(MMU.ARM9_BIOS,1,4096,arm9inf) == 4096)
NDS_ARM9.BIOS_loaded = true;
fclose(arm9inf);
}
}
//choose to use SWI emulation or routines from bios