I was having a play with converting the directory listing received from my 1541-II (which is essentially a BASIC program) and noticed that I went a little too far with emulating the behaviour of the output routine of the Commodore 64.
In order to illustrate what I mean, have a look at the picture below, particularly at the way the first filename is displayed on a C64 compared to what D64 Browser shows:
I had forged a special name in D64 Browser, putting a 0xa0 character after “TESTFILENAM” – which creates a shorthand version of the filename, then I also added 2 control codes. Obviously, as these control codes are outside a quoted name in the directory listing, the output routine used by the LIST command on the C64 interpreted them as control codes and enacted on them, instead of showing their quoted version.
One can very easily upset the directory listing output on a C64 if e.g. a 0x13 character (Home) is inserted after 0xa0 in a filename…
I will have to simplify/rewrite the implementation of the output routine as it appears I might have over-thought it slightly 🙂