Below you will find pages that utilize the taxonomy term “VIC-20”
wAx the VIC-20
Wax
Over the years, I’ve looked for an Assembler for the VIC-20. Sure, there are great cross-assemblers like Kick Assembler, but I wanted something that would run on the VIC-20 itself.
Is the VIC-20 a good machine on which to write assembly? Maybe not ON the machine. The 22-column screen is a bit limiting, but after spending so much time in Turbo Macro Pro on the C64, I wanted to see what I could do on the VIC-20 natively.
Quick Post: Printing binary numbers in Commodore BASIC 2.0
Commodore BASIC 2.0
A lot of fun with binary numbers can be had by printing them to the screen. This is a quick post to show how to do that with Commodore BASIC 2.0. This is a follow up to Quick Post: XOR in Commodore BASIC 2.0.
We’ll be using both of these in upcoming posts, so it’s good to have them handy.
5 REM PRINT ALL 8 BIT NUMBERS IN BINARY
10 FOR N= 0 TO 255
20 FORI=7 TO 0 STEP-1
25 B=0
30 IF N AND 2^I THEN B=1
40 PRINTMID$(STR$(B),2);
50 NEXT
60 PRINTN
70 NEXT
This prints all the numbers from 0 to 255 in binary. It’s a little slow, but it’s easy to understand and fun to watch.
Building a software serial bridge
Modern and retro mix
One of my favorite peices of retro clone hardware is Bob Corsham’s KIM-1 Clone. I’ve featured it many places like the 6502 speed series.
I have the latest model of this board, and he made an interesting design choice. It actually has an FTDI chip on board and you use that via USB to connect via a modern computer with an FTDI driver. This is very convenient for working with a modern computer, but then eliminates the ability to use a real serial port.
Blinkenlights
In the world of tech, including vintage tech, the lure of the blinkenlight is strong.
And if you don’t like blinkenlights, can we even be friends?
My PiDP-8 might be the ultimate in blinkenlight flexing, BUT we can probably do some other fun stuff if we use math. And science!
40 years on, this is still the best maze algorithm
My friend Robin’s favorite demo is 10 print. And what’s not to love about 10 print? After all, there’s even a book about it.
My Favorite Demo
My favorite demo is more complex but still simple enough to understand. The Maze Generator, from Compute! December 1981 by Charles Bond has been a favorite of mine since it came out. In the filing cabinet of my mind, I even remember it as the “Page 54 Maze”.
Validating Pilish
Have you ever sat down at your old Olympia typewriter and felt compelled to write poetry in which each word is the same length as successive digits of Pi?
Me too!!!
This is called a Pilish:
The idea of writing a sentence (or longer piece of poetry or prose) in which the lengths of successive words represent the digits of the number π (=3.14159265358979…) has been around since the early 1900’s. - Writing in Pilish
My mostly retro writing platform contenders in National Novel Writing Month for 2022 NaNoWriMo
I’ve participated in National Novel Writing Month for the last two years. While I don’t have aspirations of being a fiction author, I think there is a ton of value in writing 1500 words daily. Good writing or bad, 45000 words in a month is worth the effort.
In 2021, I used a DOS 386 with Wordperfect 6.22 to complete the writing for the month and produced a pretty terrible Techno/Wilderness thriller that no one should be subjected to reading. Using a 386 Laptop was a fantastic experience, and WordPerfect for DOS remains one of the best distraction-free word processors ever created.
Adding very large integers in 8 Bit BASIC
As we’ve discussed, large integer math is a pretty interesting problem, even for modern computers.
What if we wanted to add very, very, very large integers without using scientific notation, but this time let’s do it extra slowly. Extra slow… this seems like a job for BASIC!!
Strings
We’re going to need to use strings. On the Commodore BASICs of the 80s, strings have a max length of 255, so the largest sum we’ll be able to represent is:
VIC’s Revenge, the drop-in replacement for the VIC-20 VIC chip Part 1: Introduction, design goals, and FAQs
I’m doing a year-long project to reverse engineer the output and functionality of a VIC-20’s video chip, and create a drop-in replacement. At the start of this project (a few days ago), I only actually know how to do a percentage of the things I’ll need to complete this project. Writing a long series on how things work as I learn will help the project along. Plus, maybe having all of this information in one place would be nice, right?
64 Bit Addition and Products on Commodore: The Wheat and Chessboard problem
Dealing with large numbers in computing has been an attractive problem area for a long time. Using an average calculator might lead you to believe that it’s too tricky for most applications.
But it’s not that difficult. And to prove it, we’re going to implement this calculation on machines with 8 Bit registers (I mean, cmon, on this site, you can’t even pretend to be shocked).
Vicky-20 S Video Mod Results
I’m very pleased with my PAL VIC-20 replica, the Vicky-20. It’s almost a year old and the VIC-20 that sits on my desk all the time.
I’ve wanted the absolute best video out of this thing I could muster. This board is fortunately VERY easy to modify.
Connections
Sure, you need an S-Video Cable for this. You can use a 5 Pin DIN to RCA jack from the Amazonies for a few bucks. This works without modification with my RetroTink 2X Pro
Yet another version of the 100 door problem; this time, let's extend Commodore BASIC to add PRINT @, shall we?
I stumbled across a ZX Spectrum version of the 100 Door problem that got me thinking. Wouldn’t it be nice to have PRINT AT
in Commodore BASIC?
We do this in Assembly all the time.
We already know from several previous articles that moving the cursor is pretty straightforward using a Kernal routine:
Load the row number in X, the column number to Y, clear carry, and jump to $fff0
. Simple.
The terrible random number generation in the Commodore 64 (and 128)
Quite a while ago, I started playing with random numbers on 8 Bit machines. I don’t think anyone is doing “serious” work on these machines, but playing with Ciphers and Crypto got me at least curious about how a Commodore 64 generates random numbers.
There are many ways to determine randomness. Humans are pretty good at picking out patterns in visual representations. Luckily our beloved machines have easy screen memory access. Let’s poke some random stuff to the screen and see what we see.
Permutations of 1 to 9 in Python, BASIC, and 6502 Assembly
Someone asked me this week if I would help him with a graph theory problem on 8-Bit machines. The first task was to get all permutations of 1 to 9. Since the total permutations is 9! (362,880) I knew this would take a while.
Learning without learning, the standard library problem
There are no shortcuts to pretty much anything worth doing. If you fail to learn the basics, then when you get to more advanced things, the basics will feel like black magic, and the thing you’re working on will only make sense on the surface.
Can you do Advent of Code on 8-Bit Machines?
There’s a wonderful yearly online event called Advent Of Code (#adventofcode). Each day there are two code challenges that follow a holiday narrative. Some of them are easy, and some of them are quite difficult.
This year I’ve attempted to do as much of it as I can on 8-Bit Machines. Mostly Commodore 64 because it’s what I know the best, and also what I like most to actually code on.
Calculating Pi via the Gregory-Leibniz series in BASIC on the Tandy Color Computer 2
Back in March, we did a simple set of programs to brute force calculate Pi using a simple and well-known series. It works, even if it’s inefficient.
Speaking of inefficient, it’s September and that means it’s time for #Septandy! I have a Tandy Color Computer 2 - 16k of RAM version. There are versions of this machine with more RAM and an enhanced version of BASIC called “Extended BASIC”, but I’ve had this machine since the 80s and it is the most entry-level version Tandy made.
Just for fun, the 100 door problem on several different systems
What’s the 100 door problem?
It’s a just for fun problem in “beginning” math and computer courses. The idea is simple:
There are 100 closed doors in a row.
You walk past the doors 100 times (100 passes)
The first time, visit every door. If the door is closed, open it. If it is open, close it. In programming, you’d probably call this toggling the door so let’s call it that.
Running Commodore 64 BASIC Programs on a PET
The Commodore 64 and PET are fairly similar systems. Other than a few memory location differences, many BASIC programs written for the Commodore 64 that don’t use graphics can run on a PET.
There is one caveat. The PET doesn’t relocate a saved BASIC program to the beginning of BASIC, like all of the Commodore lines after it. So if you find yourself trying to load a program on your PET written on one of its younger siblings, you may wonder why it loads, but you can’t find it.
Making and breaking Ciphers on the Commodore 64, er VIC-20 - Lagged Fibonacci Sequence and a little Monte Carlo while embracing contraints
We’re on ANOTHER random number generation technique today. Let’s work on the Lagged Fibonacci Sequence, a fun way to use the Fibonacci Sequence on itself to generate pseudo-random numbers.
One of our long term goals is to add a bunch of tools to our toolbox. Making reusable components makes doing more complicated things easier. You can rifle through your toolbox in hopes of an “Oh, I already have something we can use for this part!”.
Running the 8 Bit Show and Tell VIC-20 Super Expander Programming Challenge on the Commodore 64
One of my favorite videos on the whole internet lately is this hidden gem by Robin. In it, he executes a programming challenge he found on Twitter to draw a pattern without using IF statements.
His approach is one of my favorite math tricks of all time, and I was excited to see him use it in practice. I’ve only used it for you know… math tests.
Here’s the video if you’ve not seen it. Watch it, we’ll wait…
Quick Post: Modulus in BASIC 2 without a cartridge
I posted this on Twitter a few weeks ago, but a young lady has been exploring programming in Python and also with Commodore BASIC which is pretty neato. She’s 11 and asked if there was a way to do modulo functions on Commodore BASIC because she’s using her Dad’s VIC-20 and Simon’s BASIC is obviously not available for the VIC-20.
The answer is pretty simple and will actually work in most programming languages.
If we wanted to do A mod B
(or A%B
in a lot of newer programming languages) we can do it in one line. We’re really just looking for the remainder of a division that we’ll call R