90 APPLE II COMPUTER GRAPHICSblue as they are in an even column (zero) and a group 2 byte. When boxD is plotted in the second column of boxes from the left, those same dotsdisplay orange since they are now in an odd column of dots (seven). Thatpattern <strong>al</strong>ternates across the width of the screen.Another weakness of the program is that you are constrained to <strong>al</strong>waysselect the <strong>apple</strong>'s position in increments of a fu ll box.' That is, you may notchoose to draw the <strong>apple</strong> starting three and one-h<strong>al</strong>f boxes into the screen,but instead you must <strong>al</strong>ways use a whole number of boxes. There ar<strong>et</strong>echniques which l<strong>et</strong> you POKE the figure beginning with any of the 280columns and 160 rows on the screen, but they will not be pursued here, asthe results are b<strong>et</strong>ter accomplished using the m<strong>et</strong>hods discussed in thechapters covering Shapes and Byte-Move Graphics.Everything You Know Is F<strong>al</strong>seIn this section we appear to contradict a portion of what we have just toldyou. We have said (repeatedly) that there are 280 positions across the HiRes screen, but now we attempt to convince you that there are only 40positions, and <strong>al</strong>so that there are 560 positions, and som<strong>et</strong>imes 140 positions.ARRGH!! Hopefu lly, by temporari ly confusing the issue, we willclarify it. The purpose is to provide you with sever<strong>al</strong> clear and accu ratemodels fo r use ·with the Hi-Res screen- not physic<strong>al</strong> models, but ratherconceptu<strong>al</strong> ones which will help structure your thinking and simplify yourtask when designing Hi-Res output. Each model is based on a diffe rentnumber of positions across the screen, but they do use the same numberof positions down the screen: 160 rows of dots (1 92 fo r full screen).Why 4(1?The explanation of the 40 position model is easiest since you have <strong>al</strong>readyde<strong>al</strong>t with it, perhaps unknowingly. To process any dot, you must unavoidablyde<strong>al</strong> with the byte which contains that dot, and there are only 40bytes across each line of the screen. When you developed and plotted theHi-Res <strong>apple</strong>, your design was developed in one-byte increments andplotted with the consideration of having only 40 boxes or bytes across thescreen in which to draw the figure.What About 28(1?The 280-position model is still v<strong>al</strong>id. Each of the 40 bytes displays sevendots, and that yields 280 dots across the screen. The 280-dot concept isusefu l when you are designing your figures, but when you begin to digitiz<strong>et</strong>he data, you natur<strong>al</strong>ly adopt the 40-position model, perhaps without re<strong>al</strong>izingit. Refer to the section where you worked with the Hi-Res <strong>apple</strong>, and
CHAPTER 9-Hl-RES COLOR 91notice how the 28©-dot model led into the 4©-byte model with no troubleat <strong>al</strong>l when you began to digitize the figure.Only 1411When working with colors on the Hi-Res screen, most game programmersconsider the width of the screen to be composed of only 14© availabledots. Clearly, it requires two adjacent dots to display white, and if youwould display a line of green dots, then b<strong>et</strong>ween each green dot there is ablack one, so you can see that it takes two dots to display a color <strong>al</strong>so. Ifyou look back at Figure 9-2, the picture of the Hi-Res <strong>apple</strong>, you will se<strong>et</strong>hat only every second dot was used for the colored portions. Since a unitof color requires two dots, you may reasonably interpr<strong>et</strong> the screen to<strong>al</strong>low only 14© units of color across.Further, when you plotted the <strong>apple</strong> in different positions, the colorschanged depending on where it was plotted. In order to maintain theorigin<strong>al</strong> colors, any dot that was origin<strong>al</strong>ly even must <strong>al</strong>ways be plotted asan even dot, and the same idea fo llows for the odd dots. To accomplishthat, the figure must be moved in multiples of two dots at a time, so for thisreason <strong>al</strong>so, there are only 14© possible positions across the screen.Would Yau Believe 5611?Despite what the Apple documentation says, there are actu<strong>al</strong>ly 56© dotsavailable across the Hi-Res screen. By now you probably think we ar<strong>et</strong>ot<strong>al</strong>ly bonkers, so we will prove our point by demonstration. First, enterthe Monitor, and then the Hi-Res mode, by typing:CALL -151C5C57Next, clear the decks fo r action by typing:2 : 21< 2 . JFFEMIf this seems obscu re to you, perhaps another reading of the Monitor andSoft Switch chapters is needed.- Figure 9-3 shows the hex address of the fi rst byte for each of the fi rst 14screen lines, and the dot and bit patterns for 14 v<strong>al</strong>ues to be placed inthose locations.