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 7-PRESERVING YOUR PICTURES 55GRBLOAD APPLERUNThis will (1) s<strong>et</strong> the <strong>graphics</strong> screen, (2) load the picture of the <strong>apple</strong> backo nto the screen from disk, and (3) run the program in memory (hopefu llyListing 7-1 ). The list of addresses and v<strong>al</strong>ues will appear on your printer. Ifit does not, check your program against Listing 7-1 and make sure thatyou have the printer slot assigned correctly in line 40.What ta Do with DataThe list of addresses and v<strong>al</strong>ues printed by the Low-Res scan #1 may bewritten into a program as a data table and POKEd back into memory usinga BASIC subroutine similar to:l(il(il(il FOR I = 1 TO l(il71(il1(il READ L,V: POKE L ,V1(il2(il NEXT Il(il3(il RETURN1(il4(il DATA 1684,4,1685,64,1809,192,Listing 7-2.The data v<strong>al</strong>ues in line 1040 are those generated from Listing 7-1 . Thism<strong>et</strong>hod has the advantage of not using up disk space, but it has probablyoccurred to you that entering <strong>al</strong>l of those data v<strong>al</strong>ues by hand is veryinefficient, not to mention boring and prone to error. We have two <strong>al</strong>ternativesfor those of you with a disk drive.The Data FileInstead of printing the addresses and v<strong>al</strong>ues on paper, you can write themto a text file on the disk. Load Low-Res Scan #1 (Listing 7-1) and then typ<strong>et</strong>he following lines to modify it.1(il REM WRITE DATA FILE35 D$ = CHR$ (13) + CHR$ (4)4(ll INPUT "FILENAME :";FL$45 PRINT D$ "OPEN" FL$5(il PRINT D$ "DELETE" FL$55 PRINT D$ "OPEN" FL$6(il PRINT D$ "WRITE" FL$1l(il IF PEEK (L) < > ill THEN PRINT ,L :PRINT PEEK (L)14(il PRINT "* "15(il PRINT D$ "CLOSE" FL$155 PRINT CHR$ (7) : REM BEEP SPEAKERListing 7-3. Low-Res Scan #2 (modifications only].

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

Saved successfully!

Ooh no, something went wrong!