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 10-SHAPING UP 111Sections A and B contain the code to move up (00 ) fo r the first six bytes,arid section C contains the code to move left (11) for the fi rst five, whil<strong>et</strong>he sixth causes a move to the right. It may seem pr<strong>et</strong>ty silly to move to theleft in number 5 and then immediately right in number 6 instead of movingstraight up in both of them. Remember, however, that if number 5 wereonly to move up, it would be <strong>al</strong>l zeros- 00 000 000-and would erroneouslysign<strong>al</strong> the end of the shape, so the sm<strong>al</strong>l deception is necessary. Theremainder of the shape is digitized in the same manner as the saucer, soinstead of belaboring the point, just enter Monitor and type the shape tablegiven in Listing 1©-3.300 : 01 00 04 00 C4 C0 C0 C0308: C0 40 35 35 35 35 2B 4D310 : 09 89 3F 3F FF FF 3B FF318 : 2A 2D 2D 2D 2D 2D 2D 2D320 : lE 3F 3F 3F 3F 3F 3F 3F328: 17 2D 2D 2D 2D 2D 2D 2D330: 3E 3F 3F 3F 3F 3F 3F 37338 : 2D 2D 2D 2D 2D 2D 2D 15340 : 3F 3F 3F 3F 3F 3F 3F 3F348 : 2E 2D 2D 2D 2D 2D 2D 2D350 : 2D 15 3F 3F 3F 3F 3F 3F358 : 3F 3F 3F 0E 2D 2D 2D 2D360 : 2D 2D 2D 2D 3E 3F 3F 3F368 : 3F 3F 3F 3F 37 2D 2D 2D370 : 2D 2D 2D 2D 35 3F 3F 3F378 : 3F 3F 3F 3F 2E 2D 2D 2D380 : 2D 2D F5 3B 3F 3F 3F 4E388 : 2D 2D 05 00Listing 1 Cll-3. Apple shape table.The fi rst byte declares that there is one shape in the table, and thesecond byte is unused. The third and fourth bytes give you the offs<strong>et</strong> forthe fi rst (and only) shape: 4 (remember lo-byte/hi-byte), and the fo llowingbyte is the beginning of the shape.Save the table (if you have a disk) by typingBSAVE APPLESHAPE,A$300,L$8CTo see what you have accomplished, typePOKE 232, 0 :POKE 233 ,3HGR:SCALE = l:ROT = 0DRAW 1 AT 100,100The first line tells the system where to find the table, the second is obvious,and the third draws the shape from that table on the Hi-Res screen. If youmanaged to g<strong>et</strong> <strong>al</strong>l of the numbers keyed in correctly, you will see a little

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

Saved successfully!

Ooh no, something went wrong!