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.

54 APPLE II COMPUTER GRAPHICScolor. The following program searches through Low-Res memory andpri nts a list giving the location of every non-zero byte and its address. Theprogram presumes that your printer is in slot 1, but that may be changedby <strong>al</strong>teri ng the v<strong>al</strong>ue assigned to SL in line 4(/J. If you do not have a pri nter,s<strong>et</strong> SL equ<strong>al</strong> to Ill.10 REM PRINT LOW-RES VALUES20 REM30 RE_M40 SL = 1: REM SL PRINTER SLOT #50 PR# SL60 REM70 REM80 FOR I = 1 TO 2090 READ S: REM STARTING ADDRESS OFSCREEN LINE100 FOR L = S TO S + 39110 IF PEEK (L) < > 0 THEN PRINT L ;II ' II ; PEEK (L) : COUNT = COUNT + 1120 NEXT L130 NEXT I140 PRINT "COUNT = II ; COUNT ; "EOJ"150 PR# 0160 END170 REM180 REM DATA TABLE190 REM200 DATA 1024, 1152, 1280 , 1408,1536210 DATA 1664,1792 , 1920 , 1064, 1192220 DATA 1320 ,1448,1576,1704,1832230 DATA 1960 ,1104,1232,1360 ,1488Listing 7-1. Low-Res scan #1.The program uses a data table to straighten out the convolutions of screenmemory. Each piece of data represents the starting address for a line onthe screen (see Figure 6-1), and the 4(/) bytes beginning with each of thoseaddresses are scanned by the FOR-NEXT loop in lines 1(/J(/J through 12(/J.This m<strong>et</strong>hod scans the screen from top to bottom, and without scanningthe memory which is not displayed. Line 11(/J pri nts the location (L) andconte nts (PEEK L) of any non-zero byte, and increments a counter. Onlythe top 2(/) lines are scanned, so none of the v<strong>al</strong>ues in the text window arepri nted. After the scanning is compl<strong>et</strong>e, line 14(/J prints the number of "on"bytes, and an end of job message. Scanning the <strong>apple</strong> will give you a list ofclose to 1 (/)9 addresses and v<strong>al</strong>ues, depending on where you placed your<strong>apple</strong> on the screen.Try the program out by loading it into memory and then typing:

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

Saved successfully!

Ooh no, something went wrong!