Page 1 of 1

Vic20 code editors / IDE for Mac

Posted: Tue Nov 21, 2023 4:38 am
by ChipBug
Hi

Apologies first off if this question has been asked 100 times before, however I can't seem to find an answer.

I want to write some simple enough programs for the Vic using my Mac for editing. I tried using textEdit (plain text) and saving as .prg, but when I loaded on Vice xVic the program loaded as garbage.

What Mac compatible tools might there be for creating Vic prg files?

Thanks

Re: Vic20 code editors / IDE for Mac

Posted: Tue Nov 21, 2023 5:06 am
by Mike
ChipBug wrote:I tried using textEdit (plain text) and saving as .prg, but when I loaded on Vice xVic the program loaded as garbage.
BASIC programs are not saved as plain text, but in tokenized form. All BASIC keywords are substituted by single bytes. This tokenization procedure happens upon line entry in the screen editor.
What Mac compatible tools might there be for creating Vic prg files?
Your VICE distro comes with the petcat tool. When you run your text files through this, you get their tokenized form.
Apologies first off if this question has been asked 100 times before, however I can't seem to find an answer.
The "Emulation and Cross Development" section is there to deal with exactly that kind of stuff.

Welcome to Denial! :mrgreen:

Re: Vic20 code editors / IDE for Mac

Posted: Tue Nov 21, 2023 9:49 am
by chysn
I use macOS for VIC-20 development, and my toolchain consists of:

Editor: BBEdit by Bare Bones Software (https://www.barebones.com/products/bbedit/)
Plug-In: 65C02 Language Module (https://www.barebones.com/support/bbedi ... brary.html)
Emulator: VICE 3.7.1 (https://vice-emu.sourceforge.io/macosx.html)
File Manipulation: cbm-shell (https://cbmshell.readthedocs.io/en/latest/index.html)

I automate most non-coding tasks with shell scripts. For converting BASIC text to tokenized BASIC, like Mike said, use petcat. From the console, that looks like:

Code: Select all

/Applications/vice-x86-64-gtk3-3.7.1/bin/petcat -w2 -o vic/filename.prg -- src/filename.bas
The -w2 above specifies CBM BASIC V2

To go the other way, de-tokenizing a program file generated by the VIC-20 (or petcat), use

Code: Select all

/Applications/vice-x86-64-gtk3-3.7.1/bin/petcat -2 filename.prg
Your path to VICE may vary depending on version.

Re: Vic20 code editors / IDE for Mac

Posted: Tue Nov 21, 2023 11:18 am
by beamrider
I would also take a look at Microsoft's "Visual Studio Code", it's a really great editor.

Re: Vic20 code editors / IDE for Mac

Posted: Tue Nov 21, 2023 1:21 pm
by srowe
chysn wrote: Tue Nov 21, 2023 9:49 am
I automate most non-coding tasks with shell scripts. For converting BASIC text to tokenized BASIC, like Mike said, use petcat.
You can also do this with cbm-shell

Code: Select all

cbm-shell "unlist example.txt example.prg" quit

Re: Vic20 code editors / IDE for Mac

Posted: Tue Nov 21, 2023 1:57 pm
by chysn
beamrider wrote: Tue Nov 21, 2023 11:18 am I would also take a look at Microsoft's "Visual Studio Code", it's a really great editor.
Yeah, Code is pretty great. It's what I use for my actual job. If you go with Code, there's a C64 BASIC V2 extension for syntax highlighting, and several choices for 6502 code (although I think the ca65 one is the best). My opinion is that, while Code is a better editor overall, its workspace-centric organization isn't as ideal for the smaller footprint of VIC-20 projects. BBEdit feels a bit more nimble to me for my 6502 work*. But my observation is that developers of all kinds have really embraced Code over the last few years.

I used to use Eclipse, and the youngsters on my staff made fun of me for it. Apparently, there's such thing as an old man's IDE now!
srowe wrote: Tue Nov 21, 2023 1:21 pm
chysn wrote: Tue Nov 21, 2023 9:49 am
I automate most non-coding tasks with shell scripts. For converting BASIC text to tokenized BASIC, like Mike said, use petcat.
You can also do this with cbm-shell

Code: Select all

cbm-shell "unlist example.txt example.prg" quit
Whaaat?! I did not know that. cbm-shell gets more and more amazing.

________________
* Er... play.