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 8-Hl-RES GRAPHICS 75The row and column addresses depend on which box you will use toplot the <strong>al</strong>ien, but the address for the position in the box is fixed by therow's position in the figure. The position address for row one is © ($©), forrow two it is 1©24 ($4©©), fo r row three it is 2©48 ($8©©), and so forth, asshown in the Hi-Res memory map (see Figure 8-3). The following programtakes advantage of those facts as it plots the <strong>al</strong>ien in any box you chooseon the mixed mode Hi-Res screen.1 REM ALIEN PLOT2 REM3 REM INITIALIZATION4 DIM RA% (2)5 FOR I = 1 TO 2 : READ RA%(I) :NEXT I6 REM7 REM INPUT ROW AND COLUMN8 HGR : HOME : VTAB (24)9 INPUT "ROW NUMBER? (1-2) ";R$1 R% = VAL (R$)11 IF .t:t/0 < 1 OR R% > 2 THEN PRINTCHR$ (7) : GOTO 912 INPUT "COLUMN NUMBER? (1-4)";C$13 C% = VAL (C$)14 IF C% < 1 OR C% > 4 THEN PRINTCHR$ (7) : GOTO 1215 BA% = RA% (R%) + C%-116 POKE BA%,2817 POKE BA% + 124, 6218 POKE BA% + 248, 7319 POKE BA% + 372, 732 POKE BA% + 496, 6221 POKE BA% + 512, 2822 POKE BA% + 6144, 3423 POKE BA% + 7168,6524 REM25 PRINT "PLOT ANOTHER? (Y/N) ": GET A$26 IF A$ < > "N" GOTO 927 TEXT : HOME28 END29 DATA 8192,832, 8448,8576, 874,8832,896,988,8232, 8363 DATA 8488,8616,8744,8872,9'9128, 8272,84,8528, 8656Listing 8-2. Alien plot.Lines 4© through 6© dimension and initi<strong>al</strong>ize an array containing th<strong>et</strong>wenty row addresses. Line 8© s<strong>et</strong>s the mixed Hi-Res <strong>graphics</strong> mode with

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

Saved successfully!

Ooh no, something went wrong!