diff options
author | B. Watson <urchlay@slackware.uk> | 2024-05-24 04:22:02 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-05-24 04:25:34 -0400 |
commit | 79ba7b783def208893d13fe785e7d8bde76740a2 (patch) | |
tree | e24a0748b8d045465f700b6f2953e6e8d3761ddf /unprotbas.c | |
parent | 0044a85e0ab54ebec7e1ba47f4a4a6ac2ad29360 (diff) | |
download | bw-atari8-tools-79ba7b783def208893d13fe785e7d8bde76740a2.tar.gz |
unprotbas: add -p/-pc/-pv to docs, plus verbose operation for them.
Diffstat (limited to 'unprotbas.c')
-rw-r--r-- | unprotbas.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/unprotbas.c b/unprotbas.c index 8540e6a..a95e9a6 100644 --- a/unprotbas.c +++ b/unprotbas.c @@ -239,7 +239,8 @@ void breakcode(void) { } data[oldpos + 2] = 0; - fprintf(stderr, "set invalid line pointer at line %d\n", lineno); + if(verbose) + fprintf(stderr, "set invalid line length 0 at line %d, file offset %04x\n", lineno, oldpos + 2); } /* sometimes the variable name table isn't large enough to hold @@ -579,6 +580,9 @@ void scramble_vars(void) { for(i = vnstart; i < vvstart - 1; i++) data[i] = '\x9b'; + + if(verbose) + fprintf(stderr, "replaced %d byte variable name table with EOLs.\n", i); } void print_help(void) { @@ -704,6 +708,15 @@ int main(int argc, char **argv) { if(lomem) die("This doesn't look like an Atari BASIC program (no $0000 signature)"); if(protect_code || protect_vars) { + if(verbose) { + fprintf(stderr, "%s: protecting program, ", self); + if(protect_vars && !protect_code) + fprintf(stderr, "variables only.\n"); + else if(protect_code && !protect_vars) + fprintf(stderr, "code only.\n"); + else + fprintf(stderr, "both code and variables.\n"); + } if(protect_vars) scramble_vars(); if(protect_code) breakcode(); } else { |