diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-16 04:06:01 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-16 04:06:01 -0400 |
commit | b8f164529b1ec7f2946200f68156046bae58c5ec (patch) | |
tree | a4c7364873b896a983a07510fa431c1f51af076c | |
parent | 7c52caa25312980a2fe9e065a8c2f3ed54673287 (diff) | |
download | bw-atari8-tools-b8f164529b1ec7f2946200f68156046bae58c5ec.tar.gz |
listbas: print BASIC XL tokens like BASIC XL does (lowercase w/initial cap).
-rw-r--r-- | listbas.c | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -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(); } |