POLY-SCROLL demonstrates a screen utility for a T/S 2068 Demo used at the T/S Computerfest in Ohio.
PS uses the alternate display file (Display File 2) to present pictures or data to the observer while it is preparing the next screen on the standard display file (Display File 1). Reference Appendix C: Display Modes and Memory of the 2068 User Manual. Using the alternate display file instead of the standard display file has several advantages: the computer can be writing on the screen (DF-1) with the usual BASIC commands, while you look at DF-2. Your screen will not be affected by what is going on with DF-1 until you scroll the data to DF-2. You can LOAD SCREEN$ or other data and not have your picture interrupted with the BASIC LOADer messages printed on DF-1. You are in direct control of what the observer can see (or not see).
The program is mostly BASIC, with 3 short machine code routines–Col, Row, and Vid (as used in the program listing). These routines are POKEd into memory locations starting from a user defined value, BASE (line 60). The machine code is totally relocatable using the LOADer (lines 8000 to 8140). The LOADer has a built in checker to validate the code as it is POKEd into memory. If there is an error, a warning will be given and the line with the error will be identified. The present Demo uses a BASE value of 48500. If you are not using the 2040 type printer, the printer buffer location (23296) would work very well.
COL and ROW each transfer a column or row of picture element data from display file 1 to display file 2. Each is very fast. Each of these routines use locations 23727 and 23728 to define the row and column respectively, that is to be transferred. Rows are defined as 1 (bottom) to 24 (top), and columns are 2 (right) to 33 (left). The top, left location is row 24, column 33 and the bottom, right is row 1, column 2. The reason for this odd arrangement is that ROW and COL use a ROM call based on this arrangement. By transferring rows and columns from Display File 1 to Display File 2 in different orders, you can scroll data onto the screen from top to bottom, bottom to top, left to right, ect. The BASIC used to do this is found in lines 9100 to 9210. A total of twelve different scrolls are presented!
VID is the machine code that prepares the TS 2068 for the use of the alternate display file. This routine relocates the Function Dispatcher and Machine Stack.
After you type in the program, it will self-save by typing RUN 9999 [ENTER]. To run, just RUN [ENTER]. The program will demonstrate all 12 screen scrolls and pause after the last. Press ENTER to start the demo again. Any other key will return you to the standard display file and the program will “STOP”.
1 REM ***********************
P O L Y -- S C R O L L
by S D Lemke
Lemke Software Development
2144 White Oak
Wichita, Ks. 67207
********************************
10 REM BASE = 48500
20 REM RND 48525 -- Column
30 REM RND 48552 -- Row
40 REM RND 48587 -- vid mode
50 REM ***********************
60 LET base=48500: LET b1=INT (base/256): LET b2=base-256*b1: LET base2=base+15: LET b3=INT (base2/256): LET b4=base2-256*b3
70 LET col=base+25
80 LET row=base+52
90 LET vid=base+87
100 REM ***********************
200 GO SUB 8000: RANDOMIZE USR vid: OUT 255,0: CLS : GO SUB 9100: OUT 255,1
210 PAPER 1: BORDER 1: INK 9: CLS
220 PRINT "This program uses the alternate Display File to display data or text. All the usual Basic print and draw commands can be used.": GO SUB 9100: PAUSE 300
310 PAPER 2: INK 9: CLS
320 PRINT ''''"Each time you execute a ROW or Column Machine Code routine, 1 Row or Column is copied from Display File 1 to Display File 2": GO SUB 9110: PAUSE 300
410 PAPER 3: INK 9: CLS
420 PRINT AT 6,0;" While the reader is reading the present screen, you can have the program prepare the next screen."
425 PLOT 0,0: DRAW 255,0: DRAW 0,175: DRAW -255,0: DRAW 0,-175: GO SUB 9120: PAUSE 300
510 PAPER 4: INK 9: CLS
520 PRINT AT 10,0;" This provides the programmer a powerful tool for creating fast and exiting games and demos.": GO SUB 9130: PAUSE 300
610 PAPER 5: INK 9: CLS
620 PRINT AT 13,0;"This program will demonstrate a total of 12 different ways that you can scoll a screen!": GO SUB 9140: PAUSE 300
710 PAPER 6: INK 9: CLS
720 PRINT AT 15,0;"I hope that you enjoy using the POLY-SCROLL screen utility.": GO SUB 9150: PAUSE 240
810 PAPER 7: INK 1: CLS
820 CIRCLE 128,88,40: CIRCLE 128,88,41: PRINT AT 10,16;"1": CIRCLE 110,100,3: CIRCLE 146,100,3: CIRCLE 112,99,1: CIRCLE 148,99,1: PLOT 110,70: DRAW 36,0,.5: GO SUB 9160: PAUSE 200
910 PAPER 0: INK 9: CLS
920 PRINT AT 1,0;" One advantage of using DF-2 to display data is that you can nowload in data, pictures, etc. andnot have your display affected by the LOAD titles printed on DF-1": GO SUB 9170: PAUSE 300
1010 PAPER 1: INK 9: CLS
1020 PRINT AT 5,0;"After the LOAD is complete you can scroll your data/picture to DF-2 for viewing!": GO SUB 9180: PAUSE 300
1110 PAPER 2: INK 9: CLS
1120 PRINT AT 8,0;"When customizing this program for your own use, delete lines 210 thru 1320 of this demo.": GO SUB 9190: PAUSE 240
1210 PAPER 3: INK 9: CLS
1220 PRINT AT 11,0;"Set BASE such that it will not be over written and destroyed by your program. If you are not using the 2040 printer, then theprinter buffer location (23296) is a good value for BASE": GO SUB 9200: PAUSE 330
1310 PAPER 4: INK 9: CLS
1320 PRINT AT 10,0;"Press ENTER to Start Demo over again, any other key to STOP": GO SUB 9210: PAUSE 0: LET i$=INKEY$: IF i$=CHR$ 13 THEN GO TO 210
7998 OUT 255,0: STOP
7999 REM POKE/LOAD Machine Code
8000 PAPER 1: INK 9: BORDER 1: CLS : PRINT TAB 11; FLASH 1;"WORKING"
8100 LET sum=0: RESTORE 9000: FOR i=vid TO vid+38: READ a: POKE i,a: LET sum=sum+a: NEXT i: IF sum<>6207 THEN LET l=9000: GO TO 9800
8110 LET sum=0: RESTORE 9010: FOR i=base TO base+24: READ a: POKE i,a: LET sum=sum+a: NEXT i: IF sum<>2787 THEN LET l=9010: GO TO 9800
8120 LET sum=0: RESTORE 9020: FOR i=col TO col+26: READ a: POKE i,a: LET sum=sum+a: NEXT i: IF sum<>(2694+b1+b2+b3+b4) THEN LET l=9020: GO TO 9800
8130 LET sum=0: RESTORE 9030: FOR i=row TO row+34: READ a: POKE i,a: LET sum=sum+a: NEXT i: IF sum<>(3347+b1+b2+b3+b4) THEN LET l=9030: GO TO 9800
8140 RETURN
9000 DATA 46,0,62,1,211,244,219,255,203,255,211,255,62,6,245,251,205,142,14,0,219,255,203,191,211,255,175,211,244,241,254,128,32,4,50,91,104,251,201
9010 DATA 33,176,92,78,33,175,92,70,120,205,41,9,229,193,201,124,15,15,15,230,3,246,88,103,201
9020 DATA 205,b2,b1,6,192,229,205,b4,b3,126,17,0,32,25,119,225,126,25,119,17,224,31,237,82,16,235,201
9030 DATA 205,b2,b1,6,8,197,6,32,229,229,205,b4,b3,126,17,0,32,25,119,225,126,25,119,225,35,16,237,193,17,224,0,25,16,227,201
9098 REM Scroll Subroutines
9099 REM Columns ==>>
9100 PRINT AT 20,3;"Left to Right --- No. 1": FOR c=33 TO 2 STEP -1: POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: NEXT c: RETURN
9109 REM Columns <<==
9110 PRINT AT 20,3;"Right to Left --- No. 2": FOR c=2 TO 33: POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: NEXT c: RETURN
9119 REM Rows Upward
9120 PRINT AT 20,2;"Bottom to Top --- No. 3": FOR r=1 TO 24: POKE 23727,r: POKE 23728,33: RANDOMIZE USR row: NEXT r: RETURN
9129 REM Rows Downward
9130 PRINT AT 20,2;"Top to Bottom --- No. 4": FOR r=24 TO 1 STEP -1: POKE 23727,r: POKE 23728,33: RANDOMIZE USR row: NEXT r: RETURN
9139 REM Diag L>R T>B
9140 PRINT AT 20,0;"Diagonal: L>R and T>B --- No. 5": LET c=33: FOR r=24 TO 1 STEP -1: POKE 23727,r: POKE 23728,33: RANDOMIZE USR row
9142 IF c>=2 THEN POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: LET c=c-1
9144 IF c>=2 AND r>=17 THEN POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: LET c=c-1
9146 NEXT r: RETURN
9149 REM Diag R>L T>B
9150 PRINT AT 20,0;"Diagonal: R>L and T>B --- No. 6": LET c=2: FOR r=24 TO 1 STEP -1: POKE 23727,r: POKE 23728,33: RANDOMIZE USR row
9152 IF c<=33 THEN POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: LET c=c+1
9154 IF c<=33 AND r>=17 THEN POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: LET c=c+1
9156 NEXT r: RETURN
9159 REM Diag R>L B>T
9160 PRINT AT 20,0;"Diagonal: R>L and B>T --- No. 7": LET r=1: FOR c=2 TO 33: POKE 23727,24: POKE 23728,c: RANDOMIZE USR col
9162 IF r>=17 THEN POKE 23727,24: POKE 23728,c+1: RANDOMIZE USR col: LET c=c+1
9164 IF r<=24 THEN POKE 23727,r: POKE 23728,33: RANDOMIZE USR row: LET r=r+1
9166 NEXT c: RETURN
9169 REM Diag L>R B>T
9170 PRINT AT 20,0;"Diagonal: L>R and B>T --- No. 8": LET r=1: FOR c=33 TO 2 STEP -1: POKE 23727,24: POKE 23728,c: RANDOMIZE USR col
9172 IF r>=17 THEN POKE 23727,24: POKE 23728,c-1: RANDOMIZE USR col: LET c=c-1
9174 IF r<=24 THEN POKE 23727,r: POKE 23728,33: RANDOMIZE USR row: LET r=r+1
9176 NEXT c: RETURN
9179 REM Around - Inward
9180 PRINT AT 20,0;"Around: Outside In --- No. 9": LET r=2: LET l=33: LET t=24: LET b=1: FOR x=1 TO 16: POKE 23727,24: POKE 23728,l: RANDOMIZE USR col: LET l=l-1
9182 POKE 23727,t: POKE 23728,33: RANDOMIZE USR row: LET t=t-1
9184 POKE 23727,24: POKE 23728,r: RANDOMIZE USR col: LET r=r+1
9186 POKE 23727,b: POKE 23728,33: RANDOMIZE USR row: LET b=b+1
9188 NEXT x: RETURN
9189 REM Around - Outward
9190 PRINT AT 20,0;"Inside to Outside --- No. 10": LET r=18: LET l=17: LET t=17: LET b=8: FOR x=1 TO 16: POKE 23727,24: POKE 23728,l: RANDOMIZE USR col: LET l=l-1
9192 POKE 23727,t: POKE 23728,33: RANDOMIZE USR row: LET t=t-1
9194 POKE 23727,24: POKE 23728,r: RANDOMIZE USR col: LET r=r+1
9196 POKE 23727,b: POKE 23728,33: RANDOMIZE USR row: LET b=b+1
9198 NEXT x: RETURN
9199 REM Columns => <=
9200 PRINT AT 20,0;"Left and Right to Center --- 11": FOR c=33 TO 2 STEP -1: POKE 23727,24: POKE 23728,c: RANDOMIZE USR col: POKE 23727,24: POKE 23728,2+33-c: RANDOMIZE USR col: NEXT c: RETURN
9209 REM Rows Up/Down
9210 PRINT AT 20,0;"Top and Bottom to Center --- 12": FOR r=1 TO 24: POKE 23727,r: POKE 23728,33: RANDOMIZE USR row: POKE 23727,25-r: POKE 23728,33: RANDOMIZE USR row: NEXT r: RETURN
9800 CLS : PRINT "You have an error in line ";l: BEEP 1,1: STOP
9998 STOP
9999 SAVE "Poly-Scrol" LINE 1
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.