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.

56 APPLE II COMPUTER GRAPHICSThis mod ification will create a data fi le on the disk which contains thesame list of addresses and v<strong>al</strong>ues that you printed out with Low-Res Scan#1 . Line 40 requires that you give the data fi le a name, and line 140 printsan "*" to mark the end of the fi le. To test the program, load it intomemory and type:GRBLOAD APPLERUNSo that your filename is the same as the one used in the next example,enter APPLE.OTA when the <strong>computer</strong> requests a fi lename. After that, thedisk will spin intermittently as the screen memory is being scanned andsaved; the speaker will beep to sign<strong>al</strong> the end of the run.The data may be read from the fi le APPLE. OT A and POK Ed into theproper locations by using a subroutine such as:1000 GR1010 D$ = CHR$ (13) + CHR$ (4)1020 FL$ = "APPLE .DTA"1030 PRINT D$ "OPEN" FL$1040 PRINT D$ "READ" FL$1050 INPUT L$1060 IF L$ = "* " GOTO 1110 : REM THE* .MARKS THE END OF THE FILE1070 L = VAL (L$)1080 INPUT V1090 POKE L ,V1100 GOTO 10501110 REM1120 PRINT D$ "CLOSE" FL$1130 RETURNListing 7-4.To test this subroutine, enter it and these extra lines.10 REM YOUR PROGRAM20 GOSUB 10003 0 ENDWhen you run the program, the <strong>graphics</strong> screen will be s<strong>et</strong> and cleared,then the disk will spin, and the <strong>apple</strong> will appear. If your data fi le is notc<strong>al</strong>led APPLE.OTA, change line 1030 to assign FL$ the proper name.This m<strong>et</strong>hod is nice because you do not have to key in the largeamounts of data, but unfortunately disk access is very slow and delays theexecution of the program which uses the <strong>graphics</strong>. Moreover, this procedurenot only requires that the user have a disk drive, but <strong>al</strong>so opens aPandora's box of problems such as having the disk in a different drive or

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

Saved successfully!

Ooh no, something went wrong!