aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-16 04:06:01 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-16 04:06:01 -0400
commitb8f164529b1ec7f2946200f68156046bae58c5ec (patch)
treea4c7364873b896a983a07510fa431c1f51af076c
parent7c52caa25312980a2fe9e065a8c2f3ed54673287 (diff)
downloadbw-atari8-tools-b8f164529b1ec7f2946200f68156046bae58c5ec.tar.gz
listbas: print BASIC XL tokens like BASIC XL does (lowercase w/initial cap).
-rw-r--r--listbas.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/listbas.c b/listbas.c
index 0fdafed..eefe736 100644
--- a/listbas.c
+++ b/listbas.c
@@ -404,6 +404,19 @@ void print_ata_chr(unsigned char c) {
}
}
+void print_mixed_case(const char *name) {
+ char c;
+
+ if(*name == ' ')
+ outchr(*name++);
+ outchr(*name++);
+ while(( c = *name++)) {
+ if(c >= 'A' && c <= 'Z')
+ c |= 0x20;
+ outchr(c);
+ }
+}
+
void print_string(unsigned int pos, unsigned int len) {
inv = 0;
if(color) color_on(color_op);
@@ -435,7 +448,12 @@ CALLBACK(print_cmd) {
fprintf(outfh, "(bad cmd token $%02x) ", tok);
badtok = 1;
} else {
- fprintf(outfh, "%s ", name);
+ if(bas_type == B_BXL || bas_type == B_BXE) {
+ print_mixed_case(name);
+ outchr(' ');
+ } else {
+ fprintf(outfh, "%s ", name);
+ }
}
if(color) color_off();
}
@@ -529,7 +547,10 @@ CALLBACK(print_op) {
fprintf(outfh, "(bad op token $%02x)", tok);
badtok = 1;
} else {
- fprintf(outfh, "%s", name);
+ if(bas_type == B_BXL || bas_type == B_BXE)
+ print_mixed_case(name);
+ else
+ fprintf(outfh, "%s", name);
}
if(color) color_off();
}