Typing in & tokenizing Basic (was: Space Rescue)
Moderator: Moderators
Typing in & tokenizing Basic (was: Space Rescue)
Here's another one, Space Quest. Its from the July 84 issue of RUN magazine.
http://www.freedrive.com/file/1107431,s ... cue_0k.zip
OK, I used cut and paste on this one, It still took a couple of days to edit this thing, but I wanted to talk about something else.
When I cut and paste, the text that I paste is capitals, and pasting them in VICE garbles up the screen. It wants lower case letters to be pasted. So, what I usually do is copy and paste to a text file. Edit what needs to be edited and save the text file. Then I go here:
http://www.caseconvert.com/
This converts all caps to lower case and then I paste to VICE.
Is there another way that you guys do it?
Later,
Moved by Carlsson due to topic drift.
http://www.freedrive.com/file/1107431,s ... cue_0k.zip
OK, I used cut and paste on this one, It still took a couple of days to edit this thing, but I wanted to talk about something else.
When I cut and paste, the text that I paste is capitals, and pasting them in VICE garbles up the screen. It wants lower case letters to be pasted. So, what I usually do is copy and paste to a text file. Edit what needs to be edited and save the text file. Then I go here:
http://www.caseconvert.com/
This converts all caps to lower case and then I paste to VICE.
Is there another way that you guys do it?
Later,
Moved by Carlsson due to topic drift.
Rob
Thanks to Carlsson I have had some success with MS Office 2003 as it has an image program with scanning and OCR support.
I scan into the Document imaging program which creates a TIFF, run OCR then save the file into a word document.
I then highlight the text and select Format, Change Case, lowercase then copy paste into Vice and save to a .D64 for use on the Vic.
I scan into the Document imaging program which creates a TIFF, run OCR then save the file into a word document.
I then highlight the text and select Format, Change Case, lowercase then copy paste into Vice and save to a .D64 for use on the Vic.
Vic20-Ian
The best things in life are Vic-20
Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
The best things in life are Vic-20
Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
May I introduce you guys to the command line program PETCAT, which is part of the VICE distribution? Since you have Basic listings as mostly text files, you can start a command prompt and use this little program to generate a tokenized PRG out of a Basic listing. No more need to paste text directly into VICE. While the paste thing is great for short clips, any longer program would preferrably be tokenized outside the emulator.
Of course you can use PETCAT, put the PRG onto a SD card and transfer to your VIC-20 so you don't even need to touch the actual VICE emualtor.
Of course you can use PETCAT, put the PRG onto a SD card and transfer to your VIC-20 so you don't even need to touch the actual VICE emualtor.

Anders Carlsson






Is there any documentation on how to use PETCAT? I started it up, but all there was was a black command line interface and a blinking cursor. When I typed something a semi-colon was returned with some gobbledy gook after it.
I could find no documentation within the VICE archive.
EDIT: I did find this online.
http://swoolley.org/man.cgi/1/petcat
I could find no documentation within the VICE archive.
EDIT: I did find this online.
http://swoolley.org/man.cgi/1/petcat
Typing "petcat -?" will give you the syntax. For typical unexpanded VIC-20 use, I would do as follows:
1. Prepend the text file with the following line, which defines the load address:
program.prg ==1001==
2. petcat -w2 -o program.prg -- program.txt
Since the VIC-20 relinks programs, step 1 may not be strictly required except in certain cases. There is also a command line parameter -l which can be used to set the load address.
I believe in combination with a build tool like Make, you could set up chains of cross development that involves tokenizing Basic programs, assembling machine code programs w/ Basic included as binaries. The chain of build could even include c1541 to automatically push the files onto a D64 image.
1. Prepend the text file with the following line, which defines the load address:
program.prg ==1001==
2. petcat -w2 -o program.prg -- program.txt
Since the VIC-20 relinks programs, step 1 may not be strictly required except in certain cases. There is also a command line parameter -l which can be used to set the load address.
I believe in combination with a build tool like Make, you could set up chains of cross development that involves tokenizing Basic programs, assembling machine code programs w/ Basic included as binaries. The chain of build could even include c1541 to automatically push the files onto a D64 image.
Anders Carlsson






- Pedro Lambrini
- Vic 20 Scientist
- Posts: 1132
- Joined: Mon Dec 01, 2008 11:36 am
So, put simply, to get a BASIC program from paper to Vic all you have to do is enter it into a PC text editor, save the txt file, run Petcat with the following line: petcat -w2 -o program.prg -- program.txt, then stick the resulting prg file on a SD card and away we go?
How would one go about entering Petscii characters?
How would one go about entering Petscii characters?

"...That of the Eastern tribe being like a multitude of colours as if a rainbow had settled upon its brow..." Daniels 1:3
Cursor controls are encoded like {5 DOWN}, {HOME} etc. PETSCII graphics are encoded like {C-A}. Shifted letters are second nature.
Actually there are a few alternative programs, like Bastok, Tok64 (?) and so on but most of those probably are no longer supported. Then again you have programs like Schlowski's BasEdit (?) that is a full screen text editor that will tokenize for you. I can't recall to what point it lets you import text files.
Actually there are a few alternative programs, like Bastok, Tok64 (?) and so on but most of those probably are no longer supported. Then again you have programs like Schlowski's BasEdit (?) that is a full screen text editor that will tokenize for you. I can't recall to what point it lets you import text files.
Anders Carlsson






It should also be pointed out some magazines like COMPUTE! encoded all cursor controls and graphic characters, so to a great deal you could OCR one of those listings and tokenize it using the tool. For listings that came directly from the printer and are full of graphic characters, you are of course on your own as I don't know any "Commodore OCR" program that with precision can recognize those symbols.
Anders Carlsson





