Snial wrote:
And the best way to grab them is to list the program backwards....
Ah, that's clever!
Quote:
This was less effort than trying to figure out how to get macOS VICE to list to a file.
VICE seems the easy part of it; it supports sending (virtual)
printer output to a file. But it had not occurred to me that the VIC-20 doesn't have an
LLIST command, which means some trickery is necessary.
This post suggests:
carlsson wrote:
You access the printer with OPEN 1,4 or 1,5 depending how it is set up. Then you either PRINT#1 individual lines or use CMD1 to redirect screen output to the printer, so LIST will send its content to the printer. Use a final PRINT#1 without content to end the CMD command, then CLOSE 1.
VICE also comes with a filter called
petlp which I am guessing is what produced the following:
Attachment:
viceprnt-out01.png [ 5.55 KiB | Viewed 1999 times ]
Quote:
The awful screen width of the VIC-20 is amply demonstrated in the listing, which was a major handicap to actually porting it in the first place.
Indeed! The nostalgia from seeing that screen cannot overcome the internal horror that arises when I think about using it for any serious amount of programming. (And I am even again well used to 40-column systems at this point.)
Snial wrote:
I had started on a program to generate a plain text listing from a memory snapshot. Ideally though, listing to a .png file would be best (using a VIC-20 ROM file for the character bitmaps), because that way you'd be able to capture the graphics properly.
Ah, yes, that inevitable "graphics char" issue. I actually wrote some software to help with that.
bastok, written in Python, detokenizes Microsoft MSX-BASIC files and uses character substitution to replace screen/character codes embeded in string constants,
DATA statements and comments with selected Unicode characters. (It also has incomplete code to go back the other way, but the BASIC parser still needs a few hours of work that I've not yet got around to doing because the project I was doing this for kind of died.)
It should be pretty easy to add Commodore BASIC support to it, especially since that's also an MS-BASIC, and I'd even be happy to do the coding for that if someone wants to deal with testing, debugging, and selection of Unicode chars to map to/from PETSCII chars. (If I finish the code to get it working in the other direction, it would also be a much nicer way to do program development for BASIC machines, especially those with small memory since I designed this to "unsquash" program text into a multiline-format with lots of spaces and the reverse.)