CharPad Tutorial Example

The purpose of this CharPad tutorial for C64 is to help you utilize a map for your Commodore 64 system built into CharPad 2.0 and above and see it loaded onto your screen. CharPad was created by Subchrist Software as far back as 2003. The example in this article covers the 2.0 releases.

In addition to using the built in maps that come with CharPad, you can also create your own directly from scratch since it has built in painting tools that can be used to fill a grid (known as a tile) with character patterns. The tiles which can be any selected size from 1×2 up to even 10 x 10 on the lastest versions. This CharPad tutorial for C64 covers how to utilize a 4×4 tileset to design a map for your project or game.

Getting Started

To load an existing map into CharPad you can use the menu controls that consist of File, View, Edit, Tools, and Help.

CharPad has its own menu controls ranging from File, View, Edit, Tools, and Help. We will explore these soon, but first let’s load an existing map into the tool’s memory. Click on the File menu and select Open Project. Once a Windows dialog box appears, you can search through a folder that should show the name ‘CharPad 2.0’ or something similiar and then click into the folder called Examples/Examples Rips. Depending on the version you downloaded you should see a similiar screenshot as seen below.

CharPad 2.0 Example

For our example, we will open the folder called Examples – Rips and then open the folder called Robocop to see that tileset. I have selected the file ‘Robocop L2.ctm’. Once you are successful with this part of the CharPad tutorial for C64 you should see a similar looking image below.

The following PDFs below contain all the code for the scrolling map example for the CharPad tutorial for C64 example. You can also download each document individually.


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]


[wonderplugin_pdf src=”” width=”100%” height=”600px” style=”border:0;”]

Click the button below to download all the files in a complete project that can be run inside of the CBM Prg Studio editor and your output will appear in the VICE C64 emulator once you compile and run the program for the CharPad tutorial for C64.

Here is a screenshot of the output of the Project 2 CharPad example obtained when clicking on the button to download it. It is currently setup to read any 4×4 map, but with the right modifications made it could read other maps of different sizes (such as a 2×2) as well. This project can be loaded into an emulator such as VICE C64 or even from an original Commodore 64 system.

The Character set utilizes all of the individual characters on your screen to make up the display you see (also known as redefined characters).

The Character Set Attributes are known as the “color data” (materials) that are used to fill the color of the characters seen on the map. They can also be used to setup specific collisions ranging in numbers from 0-7 and using letters from A-F. An example would be when a sprite bumps up against a wall. A collision could track that wall and prevent access through it.

The Tileset is used to append a set of characters together that can be placed individually on a map (such as a 4×4 tile). An important tip is to “reuse” tiles since the character set only consist of 255 characters in quantity.

The Map is created with the tilesets placed side by side using the character set data to reproduce an environment a sprite can move around in.

Below is a list of a similar video where I demonstrate several ways to access the character data and embed it into a project.

Character SetĀ 

Character Set Attributes

Tile Set


Each of these binary files can be generated by going to the menu section and selecting File/Import/Export/Raw Binary File, and then you would be sure to save all of the following as listed below:

  • Export Character Set
  • Export Character Set Attributes
  • Export Tile Set
  • Export Map

The following folder directory is an example of the project download that are accessed directly in the project using the ‘incbin’ statement.

In order to make sure that the binary data can be saved, it is important to go to the menu Tools/Compress Data. This is to reduce any duplicate character data that exists. When the character data exceeds 255, the export data saves will not work properly since the data has breached the limits of low byte data bytes between 0 through 255.

Below is a screenshot of the Tools menu.

Finally here is a complete overview of what each particular subroutine does in the CharPad map scrolling project.

Project Breakdown Disassembly


93-151: Setup bank memory and character set pointers
157-166: Screen multicolors
172-172: Parameters to adjust scrolling

Map Position

Draw the first map display on the screen when the program first starts up

204-207: Point to Screen 1

Main Loop

Execute WaitFrame (manages timing), UpdateScroll(handles all the scrolling, PlayerStateIdle(Main loop where joystick controls the map)

Game_Interrupts.asm (Lines):

Turns off the interrupts and sets a raster line for the first interrupt

First Interrupt (controls the screen backbuffer switching and initializes the horizonal/vertical scroll settings, and calls the joystick.

Creates Score screen (at bottom)

168-197: IrqScoreBoard
Manages the scrolling bits


Essentially manages loading/copying of zeropage pointers



WaitFrame (Lines):

10-19: Manage the raster timing for the project

30-66: Joystick control and data saves exist here

CopyChars (Lines):

86-116: Used to copy character set to memory



JoystickReady: Lines:

Manages flags to control if the screen scrolls or not

43-71: Controls the screen movement to the right

79-104: Controls the screen movement to the left

113-124: Controls the screen movement down

133-143: Controls the screen movement up

152-206: Main entry for the joystick control (main loop)

215-240: Joystick scrolls screen to the right

249-270: Joystick scrolls screen to the left

277-286: Joystick scrolls screen up

294-304: Joystick scrolls screen down



12-24: Pointer to the current screen (main or backbuffer)

49-51: Screen selector that can point to (main scree, backbuffer or score screen)

Read the address in memory for the screen (used for collision detection and other things)

32-129: Manages screen movement in all directions (right, left, up, down, and checks if the screen has stopped scrolling).

141-192: All functions calls for Scrolling Up and tasks exist here.

201-253: All function calls for Scrolling Down and tasks exist here

261-315: All function calls for Scrolling Left and tasks exist here

324-378: All function calls for Scrolling Right and tasks exist here

386-544: Moves the pixels (characters) up on the screen

553-709: Moves the pixels (characters) down the screen

720-857: Moves the pixels (characters) left on the screen

865-927: Moves the color ram data left on the screen

937-1078: Moves the pixels (characters) right on the screen

1087-1150: Moves the color ram data right on the screen

1157-1220: Moves the color ram data up on the screen

1226-1290: Moves the color ram data down the screen

1298-1336: Draws the characters at the top of the screen

1351-1392: Draws the characters at the bottom of the screen

1400-1416: Draws the colors (in the VERTICAL_COLOR_BUFFER at the top of the screen)

1425-1444: Draws the colors (in the VERTICAL_COLOR_BUFFER) at the bottom of the screen

Draws the horizontal buffer to the backbuffer (used for screen swapping)

1554-1599: Draws the contents of the left buffer to the backbuffer (using the HORIZONTAL_COLOR_BUFFER)

1607-1703: Draws the the contents of the right buffer to the backbuffer (using the HORIZONTAL_BUFFER)

1709-1754: Draws the contents of the right colors to the backbuffer (using the HORIZONTAL_COLOR_BUFFER)

1766-1918: Copy data from the VERTICAL_BUFFER to the VERTICAL_COLOR_BUFFER)

1933-2031: Copy data from the HORIZONTAL_BUFFER and VERTICAL_BUFFER for edge drawing

2064-2165: Copy data needed for the left buffer


22-69: Reads the character set and map into pointers

90-138: Draws the map data to the screen

156-259: Places the 4×4 tiles on the screen


All VIC registers and color data are found here

Feel free to use the form below if you get stuck on anything or having a question. We are here to help!