diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-16 04:17:09 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-16 04:17:09 -0400 |
commit | 9c2fb3b26b63eeebb272683aae25e80c4d60c462 (patch) | |
tree | 1b68d319b6b9732851055ff8cee9a1e6a6cba25a | |
parent | b8f164529b1ec7f2946200f68156046bae58c5ec (diff) | |
download | bw-atari8-tools-9c2fb3b26b63eeebb272683aae25e80c4d60c462.tar.gz |
listbas: initial support for BASIC XL token 0x5a (disk extensions). not working yet...
-rw-r--r-- | listbas.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -431,6 +431,25 @@ void print_string(unsigned int pos, unsigned int len) { if(color) color_off(); } +const char *get_bxl_ext_name(unsigned char tok) { + switch(tok) { + case 0x10: + return "Local"; + case 0x11: + return "Exit"; + case 0x12: + return "Procedure"; + case 0x13: + return "Call"; + case 0x14: + return "Sortup"; + case 0x15: + return "Sortdown"; + default: + return "(bad BXL ext token)"; + } +} + CALLBACK(print_lineno) { if(skip_lineno) return; if(color) color_on(color_lineno); @@ -444,10 +463,14 @@ CALLBACK(print_cmd) { if(tok == CMD_ILET) return; if(color) color_on(color_cmd); + if((!(name = cmd_tokens[tok]))) { fprintf(outfh, "(bad cmd token $%02x) ", tok); badtok = 1; } else { + if(bas_type == B_BXL && tok == 0x5a) + name = get_bxl_ext_name(program[pos + 1]); + if(bas_type == B_BXL || bas_type == B_BXE) { print_mixed_case(name); outchr(' '); @@ -455,6 +478,7 @@ CALLBACK(print_cmd) { fprintf(outfh, "%s ", name); } } + if(color) color_off(); } @@ -689,7 +713,7 @@ int main(int argc, char **argv) { list(); if(badtok) { - fprintf(stderr, "%s: Program has unknown tokens; maybe Turbo BASIC or BASIC XL/XE?\n", self); + fprintf(stderr, "%s: Program has unknown tokens; wrong BASIC dialect?\n", self); return 2; } |