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.

58 APPLE II COMPUTER GRAPHICSmuch like it did when you created the data fi le using the previous m<strong>et</strong>hod .When the program is finished, the speaker will beep and the <strong>computer</strong> willpri nt the tot<strong>al</strong> number of bytes that it saved -write this number downsomeplace. APPLE.EXC is a text fi le which contains a number of DATAstatements, compl<strong>et</strong>e with line numbers. Those DATA statements may beeasily appended to your programs. To demonstrate, type:NEWlYJ GR2Y, COUNT = xxx3Y' FOR I = 1 TO COUNT4Y, READ L,V: POKE L ,V5YJ NEXT IlYJYJ ENDEXEC APPLE .EXCThe v<strong>al</strong>ue assigned to COUNT in line 2(/) should be the number you wrotedown after running Listing 7-5, for that is the number of data bytes in the<strong>apple</strong> figure.When the disk stops spinning, type:LISTand you will see the program lines you entered above plus sever<strong>al</strong> DATAstatements beginning at line 1(/Jf/Jf/Jf/J.When you are ready, type:RUNand the <strong>computer</strong> will draw the <strong>apple</strong> on the Low-Res screen.Since the DATA lines are now part of the code, the program does notneed to access the disk for the locations and v<strong>al</strong>ues. This eliminates thedifficulties inherent in using disk data fi les.We have <strong>al</strong>ready stored the data for a figure in two places-the disk andthe program code. There is y<strong>et</strong> another place to store that info rmation, andthat is within the <strong>computer</strong> itself.Moving MemoryWhat we will do is store the entire <strong>apple</strong> screen in memory somewhereother than the Low-Res screen memory area. Then when you wish todisplay the figure, you need only copy the information from the storagearea to Low-Res memory. We will perform the copying fu nction using aBASIC routine, and then <strong>al</strong>so do it using a machine language subroutine.The fi rst task is to load the <strong>apple</strong> figure into a safe, unused memoryrange. We will use the top $4(/)(/) bytes of user memory, from $92(/)(/) to$95FF (37376-38399). The addresses given here are fo r a 48K Apple II +,

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

Saved successfully!

Ooh no, something went wrong!