Classic Computer Magazine Archive COMPUTE! ISSUE 26 / JULY 1982 / PAGE 12

An Attack Of Hearts

When I do a POKE 756,226, enabling lowercase and control characters to be printed on the screen in graphics mode 1 or 2, the computer fills the screen with a bunch of hearts. How do I get rid of them?

Larry L.

The alternate character set for Graphics modes one and two is the bottom half of the full character set, i.e., lower-case, graphics, and control symbols. Unfortunately, the heart (CHR$(0)), maps into the place where SPACE is encoded, resulting in a screen full of hearts. The usual cure is to perform a SETCOLOR 0, 0, 0, since the SPACE (or heart) defaults to color register zero. This will make the hearts black, the default background color. Naturally, you'll have to change this if the background is not black.

Unfortunately, this prevents you from printing any text in the blacked-out color, reducing your available colors from five to four. A superior, if more complicated, procedure would be to modify the character set by zeroing out the heart character. This requires additional RAM to hold the new character set and POKEing 756 with the pointer to the custom character set. Here is an example program:

100 CHBAS = 756 : CHORG = 57344
110 CHSET = (PEEK (106) -8)*256
120 GRAPHICS 1
130 POKE 756, 226
140 ? #6 : ? #6;" now  |changing|" : ? #6;" |CHARACTER| SET"
150 FOR I = 0 TO 511 : REM ONLY HALF NEEDS TO BE TRANSFERRED
160 POKE CHSET + I, PEEK(CHORG + 512 + I)
170 NEXT I
180 POKE 756, CHSET/256
190 REM ‘FOR W = 1 TO 50 : NEXT W’ IS A PAUSE USED ONLY FOR EMPHASIS
195 REM NOT NEEDED FOR WORKING PROGRAM
200 FOR I = 0 TO 7 : POKE CHSET + I, 0 : FOR W = 1 TO 50 : NEXT W : NEXT I : REM ERASE HEART
210 ? #6 : ? #6; " |do| nE"
220 END