From b8f164529b1ec7f2946200f68156046bae58c5ec Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 16 Jul 2024 04:06:01 -0400 Subject: listbas: print BASIC XL tokens like BASIC XL does (lowercase w/initial cap). --- listbas.c | 25 +++++++++++++++++++++++-- 1 file 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(); } -- cgit v1.2.3