Fixed a bug where the SDL port exited on “warning” logs when loading ROMs

This commit is contained in:
Lior Halphon 2017-05-27 19:16:07 +03:00
parent 9b89d76b3b
commit 1e228e1d9b
1 changed files with 6 additions and 5 deletions

View File

@ -385,18 +385,19 @@ restart:
GB_set_sample_rate(&gb, have_aspec.freq);
}
bool error = false;
start_capturing_logs();
if (dmg) {
GB_load_boot_rom(&gb, executable_relative_path("dmg_boot.bin"));
error = GB_load_boot_rom(&gb, executable_relative_path("dmg_boot.bin"));
}
else {
GB_load_boot_rom(&gb, executable_relative_path("cgb_boot.bin"));
error = GB_load_boot_rom(&gb, executable_relative_path("cgb_boot.bin"));
}
end_capturing_logs(true, true);
end_capturing_logs(true, error);
start_capturing_logs();
GB_load_rom(&gb, filename);
end_capturing_logs(true, true);
error = GB_load_rom(&gb, filename);
end_capturing_logs(true, error);
size_t path_length = strlen(filename);