Hello, everyone. This is Tyer Loner Des and today we’re going to be looking at my very first demo for the Commodore 64. This demo uses Basic to draw my logo to the screen before fading it in and adding a little sparkle effect at the end. In this video, I will be going over the different parts of the demo, as well as the challenges that I encountered while coding this project.
The first thing I built for the demo was a pair of look-up tables: one for the screen memory, and one for the color memory. Instead of doing math to have to figure out what number to poke to change. either a character or color at a specific point on the screen, I instead generated a couple of digital grids to make things easier on myself. This helped me to keep track of where I was poking to without needing to do any confusing math. It also made following my draft of the logo on 1-inch graph paper a cinch, and the “FOR” loops I used ended up being more compact.
Speaking of variables, I predefined five of them at the start as the five characters that I would be using throughout the program, with one exception. Variable ‘A’ is a full block, with variables ‘B’ through ‘E’ being the four corner triangle characters available in the base character ROM. I did also end up using the ‘Space’ character at the end, but I opted for using one of its multiple poke codes instead. of creating a new variable at the beginning of the program. Specifically, I used code 32. Another feature of this demo is the use of color fades. This one is actually pretty easy as all I had to do was repeat lines of color poking code a few lines later on in between lines of code generated later. It is easily my favorite part of the demo. Another little thing I had done in this regard was poking the border color yellow during the sparkle effect before poking it back to black afterwards.
Finally, I made a bit of use of timers throughout the demo, especially during the screen draws. I put timers in between color changes and also added much shorter timers to the sparkle effect to give it just enough time to be noticeable without being sluggish. It honestly made me feel like an animator in the best way possible; wait a minute.
As fun as this demo was, it wouldn’t be an exciting story without a few hiccups. The first and most glaring is that this was my first time really coding in Commodore Basic. I had a little prior experience in Visual Basic and Scratch, but nothing that would prepare me for what I was about to do. Indeed, if it weren’t for the awesome community around this beautiful, 8-bit machine and the helpful documentation that came with the computer, I would not have had the confidence and knowledge to make this dream become a reality. I especially want to shout out and thank Retro Coders, Commodore, and Pickled Light for all of the love, work, and support they offer through the various resources they provide.
The second challenge I ran into had to do with the arrays themselves. When I first generated them, I created them with the horizontal dimensions first, and then the vertical dimensions. This resulted in Basic giving me errors and it took a while before I realized that I had, essentially, flipped the screen orientation in the look-up table. Swapping the horizontal and vertical dimensions gave me the desired effect. The third challenge took me a bit longer to figure out. After completing my first few iterations, I wanted to start adding color changes to the logo. The problem I was having was that the characters were immediately printing to the screen in orange and this was after I had declared the text color to be black! After a great deal of trial and error and some back and forth with a fellow C64 enjoyer, I finally figured out the issue; sort of. I’ll explain it as I understand it.
Basically, when I wanted the characters to be drawn on the screen, I wanted them to be black so that they blended in with the background. From there, I could fade into brown and then orange. I wanted some text to print to screen during the period of time Basic was loading the two arrays and I wanted to make it orange to match the logo. This was fine. What was not fine was that orange then became the color that the characters would then print to. I also had a ‘clear screen command’ nestled in a print statement right before I started drawing characters. I had tried changing the text color to black, both at the beginning with a change to orange for the text, and also at the ‘clear screen’ print statement. I even tried filling in all of the color memory with black prior to that print statement. What ended up working was my moving that ‘FOR’ loop from before clearing the screen to after that line and that seemed to fix the issue.
As I was working on recording for this video, after having already typed up the script, I came across the problem and now have a proper explanation to what happened. To explain why the characters were appearing orange when the default is light blue is actually a simple quirk of the Clear Screen function. Clearing the screen effectively removes all character and color data off of the screen and resets the default text color to the one most recently active. You can see in the demonstration on screen that poked characters are not themselves affected by the color of the text, but rather by the default color and that the default color can be changed if you set the text color to something else and then clear the screen. I didn’t change the current code to reflect this change but I am considering other ways to reduce lines of code and possibly a bit more speed. I would implement these changes then.
Now that I have finished my first demo on the Commodore 64, what are my thoughts? Well, it was pretty easy to pick up and learn, that’s for sure. Now, I don’t know how much of that was because. I did some work with type-in programs first or that I had been watching retro computing videos for almost two years now. Regardless, I had fun doing it. In fact, I had way more fun trying to figure this program out than when I had dabbled in Scratch and Visual Basic. I think some of it boils down to the nature of programming directly on a microcomputer. I liken it more to learning to play an instrument like a guitar, whereas Scratch or Visual Basic are more like trying to learn to use a DAW to make music. Both are equally valid methods and I’ve had fun with both. But I enjoy the tactile nature of using a C64 instead of an emulator or a programming studio on a PC. They are abstractions and not the real thing. Also, they can be more frustrating to deal with than simply having the device right there on your desk. Not only that, but the C64, like my guitar, has some very real and tangible limitations. Even though I do have a C64 Ultimate and thus have access to things like the turbo mode and the REU, I’m still limited to the inherent restrictions of the original chipset. This means that I no longer have an endless expanse of possibilities at my fingertips. Instead, all of my limits are in my head. This frees me to do my best work, because I can focus on what few tools are at my disposal, not on a sea of options that might be nice. I do plan on making a game or two in Basic using the techniques I’ve covered today. I also want to remake this demo in 6510 Assembly. I already have Turbo Macro Pro setup; it just needs me to learn the code. I’ve also played around with the idea of creating graphic novels using this demo as a base. That could prove to be a very interesting outlet. For right now, though, I’ll be signing off. Thanks for watching!
Soli Deo Gloria,
Tyer Loner Des
