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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 9-Hl-RES COLOR 95Thanks to the delay loop in line 1©©, you will be able to see <strong>al</strong>l theaction when the program runs. The fi rst dot appears in its proper viol<strong>et</strong>,but then the next dot comes on- not as the expected green, but as white,and the first dot turns white with it. The remaining dots <strong>al</strong>so display white,regardless of the color s<strong>et</strong> in the program. Remember, any time two consecutivedots in a row are on, they display white, so if you wish to <strong>al</strong>ternatecolors across a line, you must leave one or more black dots b<strong>et</strong>weeneach color and the next (see Figure 9-5).m 1 m 1 m 1 mFigure 9-5. Alternating colors.Even if you leave black dots b<strong>et</strong>ween colored dots, you are still notcompl<strong>et</strong>ely safe. The next listing ostensibly plots viol<strong>et</strong> in col umn ©, blue incolumn 2, viol<strong>et</strong> in column 4, blue again in column 6, and so on acrossthe line.l HGR2 Cl = 2:C2 = 63 FOR X = TO 276 STEP 44 HCOLOR = Cl : HP LOT X , Y: REM VIOLET5 GOSUB l6 HCOLOR = C2 : HP LOT X + 2, Y: REM BLUE7 GOSUB l8 NEXT X9 ENDl FOR I = 1 TO 2 : NEXT I : RETURNListing 9-6.When the program runs, a viol<strong>et</strong> (group 1) dot will appear in column ©,then a blue dot will appear in column 2. Since blue is in group 2, theentire byte will become group 2 and the viol<strong>et</strong> dot will change to blue<strong>al</strong>so. Next, a viol<strong>et</strong> dot will be plotted in column 4, turning the previoustwo dots viol<strong>et</strong>, and then a blue dot will be plotted in column 6 to turneverything blue again. Column 8 is in the next byte of memory so whenthe viol<strong>et</strong> dot is plotted there, the previous four dots are unaffected.Column 1 © displays blue, and then column 12 displays viol<strong>et</strong> so that th<strong>et</strong>hree dots in that byte are <strong>al</strong>l viol<strong>et</strong>. Column 14 begins the third byte, and,as it displays blue, the previous three dots remain viol<strong>et</strong>. The fi n<strong>al</strong> patternis a line which has <strong>al</strong>ternating viol<strong>et</strong> and blue segments.This demonstrates a propensity of Hi-Res <strong>graphics</strong> c<strong>al</strong>led "clashing."Clashing is the inadvertent switching of a dot from one color group to theother and occu rs when you attempt to plot colors from opposite colorgroups within the same byte-the <strong>computer</strong> simply cannot and will not doit-so the attempt turns the first colors plotted into colors from the secondgroup plotted. You cannot mix green with orange or blue in the samebyte, nor can you put orange or blue in the same byte as viol<strong>et</strong>. Clashing is

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

Saved successfully!

Ooh no, something went wrong!