aboutsummaryrefslogtreecommitdiff
path: root/listamsb.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-02-26 17:11:46 -0500
committerB. Watson <urchlay@slackware.uk>2025-02-26 17:11:46 -0500
commita7acc764849e8d72b5a479599668888914ec4d6c (patch)
tree5f04f73bca583b2b68164363ac52ab3a1e2d8752 /listamsb.c
parent59406751d8bc07a64b944830560d1d709c105fd3 (diff)
downloadbw-atari8-tools-a7acc764849e8d72b5a479599668888914ec4d6c.tar.gz
listamsb: complain more about lines >255 bytes long.
Diffstat (limited to 'listamsb.c')
-rw-r--r--listamsb.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/listamsb.c b/listamsb.c
index efcaf00..207c3bb 100644
--- a/listamsb.c
+++ b/listamsb.c
@@ -33,11 +33,13 @@
even with cart-based AMSB2 and no DOS loaded. */
#define MAX_PROGLEN 30000
-/* there should never be a valid line of BASIC longer than this many
+/* there should never be a valid line of BASIC longer than MAX_LINE_LEN
bytes, since there would be no way to enter it in the editor. AMSB
uses the standard E: device, which limits you to 4 screen lines, or
- max 120 bytes. */
+ max 120 bytes. there *cannot* be a line longer than MAX_LINE_LEN_HARD,
+ because AMSB would crash when you try to LOAD such a program. */
#define MAX_LINE_LEN 0x80
+#define MAX_LINE_LEN_HARD 0xff
/* a program whose header has a length less than MIN_PROGLEN can't be
a real AMSB program. EMPTY_PROGLEN is what you get if you
@@ -273,9 +275,13 @@ int next_line(void) {
}
if(len > MAX_LINE_LEN) {
- fprintf(stderr, "%s: line %d is suspiciously long (length %d > %d)\n",
- self, lineno, len, MAX_LINE_LEN);
- warnings++;
+ int hard = len > MAX_LINE_LEN_HARD;
+ fprintf(stderr, "%s: line %d is %s long (length %d > %d)\n",
+ self,
+ lineno,
+ hard ? "impossibly" : "supiciously",
+ len,
+ hard ? MAX_LINE_LEN : MAX_LINE_LEN_HARD);
}
if(last_ptr != -1) {