Standard character mode is the mode the Commodore 64 is in when you first turn it on. It is the mode you will generally program in.
Characters can be taken from ROM or from RAM, but normally they are taken from ROM. When you want special graphics characters for a program, all you have to do is define the new character shapes in RAM, and tell the VIC-II chip to get its character information from there instead of the character ROM. This is covered in more detail in the next section.
In order to display characters on the screen in color, the VIC-II chip accesses the screen memory to determine the character code for that location on the screen. At the same time, it accesses the color memory to determine what color you want for the character displayed. The character code is translated by the VIC-II into the starting address of the 8-byte block holding your character pattern. The 8-byte block is located in character memory.
The translation isn't too complicated, but a number of items are com- bined to generate the desired address. First the character code you use to POKE screen memory is multiplied by 8. Next add the start of char- acter memory (see CHARACTER MEMORY section). Then the Bank Select Bits are taken into account by adding in the base address (see VIDEO BANK SELECTION section). Below is a simple formula to illustrate what happens:
CHARACTER ADDRESS = SCREEN CODE*8+(CHARACTER SET*2048)+(BANK*16384)
Each character is formed in an 8 by 8 grid of dots, where each dot may be either on or off. The Commodore 64 character images are stored in the Character Generator ROM chip. The characters are stored as a set of 8 bytes for each character, with each byte representing the dot pattern of a row in the character, and each bit representing a dot. A zero bit means that dot is off, and a one bit means the dot is on.
The character memory in ROM begins at location 53248 (when the I/O is switched off). The first 8 bytes from location 53248 ($D000) to 53255 ($D007) contain the pattern for the @ sign, which has a character code value of zero in the screen memory. The next 8 bytes, from location
|This page has been created by Sami Rautiainen.|
|Read the small print.||Last updated December 23, 2002.|