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.

76 APPLE II COMPUTER GRAPHICSthe cursor at the bottom of the text window. Lines 9© through 15© acceptyour input for the row and column numbers and, after checking to insur<strong>et</strong>hey are v<strong>al</strong>id, converts them to a base address for the box ind icated. Line15© c<strong>al</strong>culates the base address by adding the row address for the box[RA%(R%)] to the column address (which happens to be one less than thecolumn number). Having added the row and column addresses for thebox, it only remains to add the address for the position in the box for eachbyte of the <strong>al</strong>ien (how do <strong>al</strong>iens taste?). The fi n<strong>al</strong> address is c<strong>al</strong>culated andthe proper v<strong>al</strong>ue POKEd into it in lines 16© through 23©, lines 25© and 26©give you a chance to plot another one, and then lines 27© and 28© wrapup the program. The data in lines 29© and 3©© are the row addresses readin line 5©. The plotting speed may be enhanced somewhat by c<strong>al</strong>culating<strong>al</strong>l of the fi n<strong>al</strong> addresses before starting to POKE any of them.Example 4Write a simple BASIC program to plot the cannon given in Figure 8-7.Figure 8-7. Hi-Res cannon.(From Cannonb<strong>al</strong>l Blitz by Olaf Lubek, with permission.]

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

Saved successfully!

Ooh no, something went wrong!