12.07.2015 Views

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

williams-et-al-1983-apple-ii-computer-graphics

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 9-Hl-RES COLOR 83L<strong>et</strong>'s run a program which illustrates y<strong>et</strong> another characteristic of Hi-Res·color.10 HGR20 HCOLOR = 230 FOR I = 1 TO 10040 HPLOT I,050 NEXT I60 REM70 REM NOW TURN HALF OFF80 HCOLOR = 090 FOR I = 2 TO 100 STEP 2100 HPLOT I , 0110 NEXT I120 ENDListing 9-2. Horizont<strong>al</strong> line.An examination of the listing would lead one to believe that the programwill plot 100 consecutive horizont<strong>al</strong> blue dots, and then turn <strong>al</strong>l the evendots off. However, when the program is run, the blue line is drawn, andthen erased compl<strong>et</strong>ely! How can that be when you plot 100 dots and onlyerase 50? If you care to insert a delay loop and sign<strong>al</strong> in the program35 FOR J = 1 TO 500 : NEXT J: PRINT CHR$ (7) and count the dots as they areplotted, you will fi nd that only 50 dots are plotted in the fi rst place. Blue isonly available in even numbered columns (0,2,4, ... ), and so when theprogram attempts to plot blue on the odd numbered dots, it has no effectat <strong>al</strong>l. Viol<strong>et</strong> is <strong>al</strong>so available on only even dots, while odd dots maydisplay either green or orange.To summarize what you have seen so far, if a dot is plotted in an evennumbered column, it will be either viol<strong>et</strong> or blue, and if a dot is in an oddcolumn, it will be green or orange. The color bit selects which of theavailable colors each dot will display: if the color bit is off (group 1 ), evendots display viol<strong>et</strong> and odd dots display green; if the color bit is on (group2) then even dots are blue and odd dots are orange. The left-most columnof dots on the screen is counted as column zero, and columns 1 through279 follow sequenti<strong>al</strong>ly across the screen.Black is plotted by turning a dot off, and white is plotted by turning ontwo adjacent dots in the same row. L<strong>et</strong>'s experiment using the POKEstatement. Type:HGRPOKE 8192,1POKE 8192,2POKE 8192,3In the upper left corner of the Hi-Res screen you will display a single viol<strong>et</strong>dot, then a lone green dot, and fin<strong>al</strong>ly a white dot. How did the white dot

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!