Several keys points to making a game on the Commodore 64 are necessary to understand as you begin your journey. I have listed many of these in a bulleted list below.
Banking Memory
Raster Interrupt / Timers
Map / Tiles
Scrolling / Single Screens
C64 Graphics, Sprites, and Memory
Commodore 64 Bank Memory
Characters and Sprite Multicolors
Animation of Sprites
Sprite Collision Detection
Game Plot / Story
Weapons / Tools
Replay value
Commodore 64 Memory
Setting up a game on the Commodore 64 is best done using Assembly language. Now while it is possible to create a simple game in Basic, you are often limited in speed, memory, and graphics. So using the computer’s native Assembly language will steer your ship in the right direction.
Be aware though, that learning Assembly language is not for the faint of heart. It is a solid skill to master, but it is not impossible. Although this is not a complete guide to Assembly language for the Commodore 64, be sure to check out the Machine Language Project and Machine Language tutorial on this site to learn more.
Commodore 64 Rasters and Timers
Raster interrupts allow game routines to run in the background without affecting assembly language code that is running. For example you have a main subroutine and want to have a separate routine for scrolling to exist in another area of memory that won’t slow down the game.
By using a raster interrupt you can tell the computer to occur every 1/60 of a second.
Many popular, commercial games utilize a raster interrupt to manage game characters, screen shifting, and other things to allow the game to run more smoothly. Scrolling the screen is managed much better by using an interrupt routine. This is because the screen is updated every 60 seconds and when you scroll it, the timer clock is being affected causing the screen to appear jerky.
Commodore 64 Map and Tiles
The majority of Commodore 64 games include a map or a maze environment that a player can walk around in. The best games include a nicely detailed map that includes locked doors, hidden passages, traps, sleeping dragons, and many other things to keep the adventures alive.
A map can be created on scratch paper or even graph paper. Just remember that each area that is filled for a regular screen character exists as 8 x 8 with a total of 64 pixels that can be utilized. Keep in mind, also that there are wonderful tools to create maps, such as CharPad, so that you do not have to resort to old school game design.
Scrolling a Commodore 64 Game Map
Having the ability in your game to allow for scrolling the screen can make a game very enjoyable to your player. Although single screen games also have their share of enjoyment, I cannot even count the many, amazing games I have played that involved the screen being shifted to the left, right, or up and down position while moving my game character through a larger world.
Shifting a game screen requires a specific technique that involves capturing data from a game file, and even reading pointer addresses within your code. When the player is walking to edge of the screen, the data in that area must be then copied to the next blocks from the game map so that each new line of pixels come alive on the screen. To learn more about this, be sure to check out my guide on Commodore 64 Screen Scrolling.
A single screen does not require any special scrolling ability. Keep in mind that a screen can be created in single characters (8 x 8) tiles or double wide (4 x 4) tiles. With double wide, 4 tiles are placed side by side in a rectangular shape to produce a more defined tile. With 8 x 8 tiles, however the graphics are all created inside an individual character (such as is seen on the default Commodore 64/VIC screen) at power up.
C64 Graphics, Sprites, and Memory
Graphics – the character generator ROM is unavailable and must be copied from ROM memory to RAM. So you cannot direct overwrite any of the characters you see on screen to create your own until the character data is copied over where it can be replaced. Visit the page Character ROM Graphics to learn more.
Sprites – these are blocks that are defined into game characters that move over the background without affecting the foreground data there. Yet in Bank 0, they are also limited and must be relocated to allow more sprites to be available in memory.
Game code routines – the rest of the memory exists in a small 8K block that will eventually overwrite data once the limit is reached.
When a cartridge is plugged into the console port, memory is occupied from $8000 through $9000. The Basic ROM is contained in $A000 through $B000. The character ROM set is contained in bytes $C000 through $D000. Finally the Kernal ROM exists in $E000 through $F0000.
According to the book Mapping the Commodore 64, the cassette I/O Buffer contains memory from $33C – $3FB (828-1019). So if the cassette recorder is not in use, this memory is available to be used by Basic and can be beneficial when you want to know How to create a Commodore 64 game. Keep in mind though that only short assembly language routines can be placed here. Often in many Basic programming examples, Basic sprites are relocated to exist here instead.
Commodore 64 Bank Memory
00 (bit value of 0) Bank 3 | 49152-65535, $C000 – $FFFF
01 (bit value of 1) Bank 2 | 32768 – 49151, $8000 – $BFFF
10 (bit value of 2) Bank 1 | 16384 – 32767, $4000 – $7FFF
11 (bit value of 3) Bank 0 | 0 – 16383, $0000 – $3FFF
Basic programming text is actually stored in memory locations $0800 – $9FFF (2048-40959)
The character ROM images reside in memory locations $1000 – $1FFF (4096-8191)
[…] memory that do not conflict with the screen data. This independence gives it a great advantage when creating games. Any data or graphics remains in its own independent […]