Vic20 code editors / IDE for Mac

You need an actual VIC.

Moderator: Moderators

Post Reply
ChipBug
Vic 20 Newbie
Posts: 1
Joined: Tue Nov 21, 2023 4:31 am
Location: London

Vic20 code editors / IDE for Mac

Post 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
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Vic20 code editors / IDE for Mac

Post 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:
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Vic20 code editors / IDE for Mac

Post 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.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Vic20 code editors / IDE for Mac

Post by beamrider »

I would also take a look at Microsoft's "Visual Studio Code", it's a really great editor.
User avatar
srowe
Vic 20 Scientist
Posts: 1340
Joined: Mon Jun 16, 2014 3:19 pm

Re: Vic20 code editors / IDE for Mac

Post 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
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Vic20 code editors / IDE for Mac

Post 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.
Post Reply