See the change? BASIC now thinks it has less memory to work with. The memory you just claimed from BASIC is where you are going to put your character set, safe from actions of BASIC.
The next step is to put your characters into RAM. When you begin, there is random data beginning at 12288 ($3000 HEX). You must put character patterns in RAM (in the same style as the ones in ROM) for the VIC-II chip to use.
The following program moves 64 characters from ROM to your character set RAM:
5 PRINTCHR$(142) :REM SWITCH TO UPPER CASE 10 POKE52,48:POKE 56,48:CLR :REM RESERVE MEMORY FOR CHARACTERS 20 POKE56334,PEEK(56334)AND254 :REM TURN OFF KEYSCAN INTERRUPT TIMER 30 POKE1,PEEK(1)AND251 :REM SWITCH IN CHARACTER 40 FORI=0TO511:POKEI+12288,PEEK(I+53248):NEXT 50 POKE1,PEEK(1)OR4 :REM SWITCH IN I/O 60 POKE56334,PEEK(56334)OR1 :REM RESTART KEYSCAN INTERRUPT TIMER 70 END
Now POKE location 53272 with (PEEK(53272)AND240)+12. Nothing happens, right? Well, almost nothing. The Commodore 64 is now getting it's character information from your RAM, instead of from ROM. But since we copied the characters from ROM exactly, no difference can be seen... yet.
You can easily change the characters now. Clear the screen and type an @ sign. Move the cursor down a couple of lines, then type:
FOR I=12288 TO 12288+7:POKE I,255-PEEK(I):NEXTYou just created a reversed @ sign!
TIP: Reversed characters are just characters with their bit patterns in character memory reversed. |
Now move the cursor up to the program again and hit <RETURN> again to re-reverse the character (bring it back to normal). By looking at the table of screen display codes, you can figure out where in RAM each character is. Just remember that each character takes eight memory locations to store. Here's a few examples just to get you started:
This page has been created by Sami Rautiainen. | |
Read the small print. | Last updated September 23, 2004. |