aboutsummaryrefslogtreecommitdiff
path: root/listamsb.c
diff options
context:
space:
mode:
Diffstat (limited to 'listamsb.c')
-rw-r--r--listamsb.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/listamsb.c b/listamsb.c
index f11110a..6d125b9 100644
--- a/listamsb.c
+++ b/listamsb.c
@@ -99,7 +99,7 @@ int read_header(void) {
}
if(proglen < MIN_PROGLEN) {
- fprintf(stderr, "%s: not an AMSB file: program size in header too small (%d)\n",
+ fprintf(stderr, "%s: not an AMSB file: program size too small (%d). Atari BASIC file?\n",
self, proglen);
exit(1);
}
@@ -195,6 +195,12 @@ int next_line(void) {
unknown_token(lineno, byte, 0);
} else {
if(!byte) break;
+ if(byte < 0x20) {
+ /* ATASCII graphics outside of a string */
+ fprintf(stderr, "%s: line %d has character %d outside of a string, "
+ "maybe not an AMSB file?\n",
+ self, lineno, byte);
+ }
putc(byte, outfile);
}
}
@@ -267,10 +273,14 @@ void open_output() {
perror("/dev/null");
exit(1);
}
+ if(verbose)
+ fprintf(stderr, "using /dev/null for output (check_only)\n");
} else if(raw_output) {
if(isatty(fileno(stdout)))
die("refusing to write raw ATASCII to a terminal");
outfile = stdout;
+ if(verbose)
+ fprintf(stderr, "using stdout for output\n");
} else {
if(verbose)
fprintf(stderr, "using pipe for output: %s\n", pipe_command);
@@ -304,7 +314,7 @@ int main(int argc, char **argv) {
if(verbose)
fprintf(stderr, "file size matches proglen\n");
} else {
- fprintf(stderr, "%s: file size doesn't match length in header\n", self);
+ fprintf(stderr, "%s: actual program size doesn't match program size in header\n", self);
}
if(fgetc(infile) != EOF) {
@@ -312,12 +322,15 @@ int main(int argc, char **argv) {
}
if(unknowns) {
- fprintf(stderr, "%s: input has %d unknown tokens\n", self, unknowns);;
+ fprintf(stderr, "%s: file has %d unknown tokens\n", self, unknowns);;
rv = 2;
}
if(need_pclose) {
- if(pclose(outfile) != 0) {
+ int got = pclose(outfile);
+ if(verbose)
+ fprintf(stderr, "return value from pipe is %d\n", got);
+ if(got != 0) {
die("a8cat child process failed, do you have a8cat on your PATH?");
}
}