Add check if input file specified and if it exists
This commit is contained in:
parent
021a46c4aa
commit
05f5bf4dcd
|
@ -159,9 +159,16 @@ void execute() {
|
|||
}
|
||||
}
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc < 2) {
|
||||
printf("%s: No input file specified\n", "yemu");
|
||||
return 1;
|
||||
}
|
||||
reset();
|
||||
// TODO make loading from rom
|
||||
FILE *infile = fopen(argv[1], "rb");
|
||||
if (infile == NULL) {
|
||||
perror("yemu");
|
||||
return 1;
|
||||
}
|
||||
char ch;
|
||||
int pos = 0;
|
||||
while (1) { // FIXME
|
||||
|
|
Loading…
Reference in New Issue