Better error handling

This commit is contained in:
Lior Halphon 2020-04-25 17:12:53 +03:00
parent a35164dc0a
commit 7760e11544
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,5 @@
set -e
./build/bin/tester/sameboy_tester --jobs 5 \
--length 40 .github/actions/cgb_sound.gb \
--length 10 .github/actions/cgb-acid2.gbc \

View File

@ -322,15 +322,15 @@ int main(int argc, char **argv)
if (dmg) {
GB_init(&gb, GB_MODEL_DMG_B);
if (GB_load_boot_rom(&gb, boot_rom_path? boot_rom_path : executable_relative_path("dmg_boot.bin"))) {
perror("Failed to load boot ROM");
if (GB_load_boot_rom(&gb, boot_rom_path ?: executable_relative_path("dmg_boot.bin"))) {
fprintf(stderr, "Failed to load boot ROM from '%s'\n", boot_rom_path ?: executable_relative_path("dmg_boot.bin"));
exit(1);
}
}
else {
GB_init(&gb, GB_MODEL_CGB_E);
if (GB_load_boot_rom(&gb, boot_rom_path? boot_rom_path : executable_relative_path("cgb_boot.bin"))) {
perror("Failed to load boot ROM");
if (GB_load_boot_rom(&gb, boot_rom_path ?: executable_relative_path("cgb_boot.bin"))) {
fprintf(stderr, "Failed to load boot ROM from '%s'\n", boot_rom_path ?: executable_relative_path("cgb_boot.bin"));
exit(1);
}
}