DEMO STYLE TEXT : C64 Assembly

With thanks to Shallan for his help in this

We have all seen the fancy demos that have been created on the C64 over the years. Some of the most artistic and entrancing graphics and text swirling around the screen. In this tutorial I am going to take you through how to make a fancy text effect similar to those shown in the demos.

Creating a Character Map in CharPad

In order to render the text we need to create a graphic in CharPad. Charpad is a free utility which allows us to create tile maps and character sets. It can be downloaded from the official website.

A really good starting tutorial on how to use Charpad (including how to rip sprites from C64 games running on VICE) can be found below.

With CharPad I have used a few downloadable Character sets, these have been directly ripped from C64 games and contain the letters of the alphabet. Think of these like ‘fonts’ in an editor like Microsoft Word.

A selection of these can be found at the Commodore 64 resources webpage.

The end result is the following:

We can see the character set and using it I created a very basic message on the Map Editor. I then exported both the character set and the map to binary in a folder location.

With these two resources set up, its time to begin coding.

Set Up

Here we start as in the previous tutorial defining the space for the Screen RAM and Color RAM. We begin our entry call with BasicUpstart2. Then we import the Map we created in CharPad. I have given this a label of TextMap. Next we create our ColorRamp, this is a series of colour data which we use to color the TextMap data. These colours move in sequence. Beginning with white ($01), yellow($07) and so on.

The Main Body

Here we set the location of the Character Set which we created in CharPad. We then load these into the Screen RAM. We set the Border and Background to black and jump to the subroutine to Clear the Screen.

Then then begin to draw our Text Map to the screen. I have used a shortcut convention for this loop. Some coders use a symbol as a label. In this case a !. You then can use a notation at the end for branch if not equal (bne) for the symbol – or +. The minus sign means – go to the preceding label with this symbol and the plus sign means to go to the next label with this symbol.

We then load in 80 characters from the Text Map – beginning at the twelfth row of the screen.

We then set up a loop which runs through the color ramp every frame. This is then used to color the Screen Ram in.

We then use a technique which waits until the Raster Line hits the screen at a particular point before continuing. This is a handy way to pause execution of code, a drawback is that you can do nothing while this is taking place so it’s useful for Demo Screens but perhaps not for games.

We then Have the Subroutine for Clearing the screen – similar to the previous tutorial, loading in a blank character ths filling the four positions at once.

Finally we import the Character Map assigning memory space to it.

We should see the following :

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s