Commodore PET User Manual page 315

Table of Contents

Advertisement

The header is made up of the word RANDOM as blanks outlined by reverse
blanks and situated in the middle of the screen. The display is created by clearing
the screen and then POKEing the reverse blanks to the appropriate screen posi-
tions. There are 122 reverse blanks used in the display. The display is shown
below with some of the screen positions relative to the first reverse blank shown.
269
29
Screen address 32768 (home position)
/
screen address 33133
01 2
/
i:1:;:
Il
40
80
120
160
200
240
ln the program. at line 70 a second table, H. is dimensioned to hold the rela-
tive positions of the 122 reverse blanks. Line 75 fills Table H with the relative posi-
tion numbers from DATA statements at lines 30 through 360. The order of the
numbers in the DATA statements is random but fixed; the header appears to fill
randomly to the viewer, but it in fact fills the same way each time. (This is in con-
trast to the random filling of the 1000 screen positions. which is different each
time.) The initialization routine at lines 200 through 260 fills Table Tas before. but
rather than doing so continuously it breaks every eight elements to POKE a
reverse blank from Table H to the screen for the header (1000+122=8 plus a
small remainderl. The header POKE address is formed as the sum of the screen
position relative to the first reverse blank and the actual memory address of the
first reverse blank (33133. where 32768 is the home position address). The
reverse blank value for POKEing is 160. as shown in Appendix A.
You can see by running this amended version of the program that there is no
longer any apparent delay during program initialization.
302

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents