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.

48 APPLE II COMPUTER GRAPHICS3 PLOT 2, 14 VLIN 11, 14 AT 215 COLOR = 126 FOR I = 1 TO 57 READ Xl , X2, Y8 HLIN Xl, X2 AT Y9 NEXT I1 COLOR = 1311 FOR I = 1 TO 335 DATA 17 , 19, 13 ,24 , 26, 13 , 16,2, 14, 23 , 27, 14, 15 ,27 , 1536 DATA 15, 26, 16, 15, 25, 17, . ..Listing 6-3.Although this is easier for the programmer, the advantage of speedyexecution has been sacrificed. Unless the program is to be run only a fewtimes, it is usu<strong>al</strong>ly b<strong>et</strong>ter fo r the programmer to expend the extra effort inorder to enhance the efficiency of the execution.De<strong>al</strong>ing with MemoryThe basic scheme behind this second technique and its variations is todraw your figure on the screen initi<strong>al</strong>ly, and then save the contents of Low­Res screen memory. Then, when you wish to use that figure in a program,you need only replace the contents of memory with the data <strong>al</strong>readysaved.The fi rst step is to draw your picture on the screen. This may be doneusing PLOT, HLIN, and VLIN as in the previous discussion, or by using aneditor. An editor is a program which simplifies creating, <strong>al</strong>tering, andsaving either text or <strong>graphics</strong>. A sample Low-Res editor is provided inListing 6-4. The editor will l<strong>et</strong> you plot and erase blocks in any of the Low­Res colors anywhere on the screen, except in the bottom four lines of text.1 HOME : GR2 PF = :X = 2 :Y = 23 GOSUB 234 C = PEEK ( 49152) : IF C > 127 THENC$ = CHR$ (C-128) : POKE -16368, :GOTO 65 PLOT X, Y: COLOR = : PLOT X, Y:COLOR = CN : GOTO 4

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

Saved successfully!

Ooh no, something went wrong!