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
Vic20 code editors / IDE for Mac
Moderator: Moderators
- Mike
- Herr VC
- Posts: 4858
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Vic20 code editors / IDE for Mac
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.ChipBug wrote:I tried using textEdit (plain text) and saving as .prg, but when I loaded on Vice xVic the program loaded as garbage.
Your VICE distro comes with the petcat tool. When you run your text files through this, you get their tokenized form.What Mac compatible tools might there be for creating Vic prg files?
The "Emulation and Cross Development" section is there to deal with exactly that kind of stuff.Apologies first off if this question has been asked 100 times before, however I can't seem to find an answer.
Welcome to Denial!
- 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
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:
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
Your path to VICE may vary depending on version.
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
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
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
WIP: MIDIcast BASIC extension
he/him/his
Re: Vic20 code editors / IDE for Mac
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
- 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
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!
Whaaat?! I did not know that. cbm-shell gets more and more amazing.srowe wrote: ↑Tue Nov 21, 2023 1:21 pmYou can also do this with cbm-shell
Code: Select all
cbm-shell "unlist example.txt example.prg" quit
________________
* Er... play.