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.

108 APPLE II COMPUTER GRAPHICSRemember to l<strong>et</strong> the tape run for a moment on the record s<strong>et</strong>ting b<strong>et</strong>weentyping the second "W" and pressing the r<strong>et</strong>urn key.You may use the Monitor READ command to reload the table, butAPPLESOFT has a much b<strong>et</strong>ter m<strong>et</strong>hod using the SHLOAD command.SHLOAD loads the shape table from tape and stores it just below HIMEM.HIMEM is s<strong>et</strong> below the table to protect it, and the starting address of th<strong>et</strong>able is placed in $E8 and $E9. The beauty of this process is that <strong>al</strong>l thed<strong>et</strong>ails are taken care of automatic<strong>al</strong>ly. The only command you give isSHLOAD, and, unlike the Monitor command, SHLOAD may be used fromwithin a BASIC program. For our example, rewind your shape table tape,push the play button, typeSHLOADand everything is done for you. TA DA!!The table may <strong>al</strong>so be loaded directly as part of the program by using thePOKE statement. Listing 10-2 POKEs the data for our shape table, asks youto specify the sc<strong>al</strong>ing factor (1-255), and then draws the saucer on thescreen with ten different rotation v<strong>al</strong>ues.Learning by ROTROT = Ill causes the shape to be oriented in the same way as it wasdefined-no rotation. When ROT = 16, DRAW will show the shape rotated90 degrees clockwise from the origin<strong>al</strong>, ROT = 32 rotates 180 degrees, andROT = 48 rotates it 270 degrees clockwise (90 degrees counter-clockwise).ROT = 64 is back where it started, and so fo rth in increments of 16 <strong>al</strong>l theway through 256.The ROTation param<strong>et</strong>er is parti<strong>al</strong>ly dependent on the s<strong>et</strong>ting of SCALE.According to the APPLESOFT manu<strong>al</strong>, at SCALE = 1 , only the four rotationv<strong>al</strong>ues [Ill, 16,32,48] are recognized. However, as you can see by usingListing 10-2, the v<strong>al</strong>ues [8,24,40,56] <strong>al</strong>so work at SCALE = 1 . At SCALE = 2,sixteen rotations are available, with [4, 12,2©,28,36,44,52,60] being the addition<strong>al</strong>v<strong>al</strong>ues. The larger the sc<strong>al</strong>e, the more rotations available, up to apoint. If you s<strong>et</strong> ROT to a v<strong>al</strong>ue it does not recognize, it will rotate theshape to a v<strong>al</strong>ue it does recognize.Hopefu lly, this program will demonstrate and clarify <strong>al</strong>l of those rulesconcerning ROT. Please run the program and watch the v<strong>al</strong>ues of ROT atthe bottom of the screen, and the effects they have on the figure. You willhave to press res<strong>et</strong> to end the program.1 REM DEMONSTRATE2 REM POKING TABLE3 REM4 REM POKE ADDRESS5 REM OF TABLE

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

Saved successfully!

Ooh no, something went wrong!