Commit MetaInfo

Revision7645f90241d83f1b2a0be1de0f97443f46c266e2 (tree)
Time2019-01-24 20:18:29
Authoringlorion <homemicro@ingl...>
Commiteringlorion

Log Message

show error message if emulator is started without a ROM image present

Change Summary

Incremental Difference

diff -r b67edc8d079b -r 7645f90241d8 emulator/hm1000.c
--- a/emulator/hm1000.c Thu Jan 24 03:13:19 2019 -0800
+++ b/emulator/hm1000.c Thu Jan 24 03:18:29 2019 -0800
@@ -1021,6 +1021,13 @@
10211021
10221022 {
10231023 FILE *f = fopen("rom.bin", "rb");
1024+ if (!f) {
1025+ perror("rom.bin");
1026+ fprintf(stderr,
1027+ "Could not open rom.bin."
1028+ " The emulator will not work without it.\n");
1029+ return 1;
1030+ }
10241031 fread(rom, 1, ROM_SIZE, f);
10251032 fclose(f);
10261033 }
Show on old repository browser