One of the reasons I bought a 2068 was to use the advanced video modes described in appendix C of the basic manual. I was disappointed when I found it impossible to access these modes using only BASIC. After learning machine code I was able to use the Dual Screen Mode in my BASIC programs. The following listing uses the 2 screens to do simple straight line animation to demonstrate this mode. You will have to do a little programming to change the pictures that will be drawn, but that should present no problem for most readers. Once you type in the program, save it before you run it. The program uses a short machine code routine and if you made a typing error, the program might crash. There is an error checking routine in the program, but it will not detect transposed digits. When you run this program don’t use the BREAK key, because if you do the computer will “hang”. Most of the time the computer is displaying the 2nd screen and if there is an error message it will be printed on the first screen, you will not see it. If you can’t resist hitting the BREAK key, be prepared to enter OUT 255,0 “blind” in order to switch to screen 1. Try running the program to see what it draws.
CHANGING THE PROGRAM; The only programming change you will have to make is in the three DATA statements. The first number is how many “frames” the program will draw. The second digit is the number of DRAW statements it takes to make the picture. The second DATA statement contains the PLOT and DRAW coordinates to create the first frame. The third DATA statement contains the information to draw the last frame. The computer works out all the intermediate frames. Please note that you must start your drawing with a PLOT and use only DRAW statements thereafter. You also must have the same number of lines in the first and last drawings. Have fun with the program. Next issue I’ll have two programs that manipulate REM statements.
1 REM triangle to square
100 DATA 20,4
105 REM
DATA STATEMENTS CONTAIN THE
COORDINATES OF THE PLOT AND
DRAW STATEMENTS
110 DATA 70,40,100,0,0,100,-100,0,0,-100
120 DATA 70,40,100,0,-50,87,-25,-44,-25,-43
130 REM
SET UP M-C
140 GO SUB 520
150 REM
SETS DUAL SCREEN MODE
160 RANDOMIZE USR 60000: OUT 255,1
170 RESTORE 100
180 REM
INITALIZES VARIABLES
190 READ FRAMES
200 READ POINTS
205 LET POINTS=POINTS+1
210 DIM A(POINTS,2)
220 DIM B(POINTS,2)
230 FOR A=1 TO POINTS
240 READ A(A,1): READ A(A,2)
250 NEXT A
260 FOR A=1 TO POINTS
270 READ B(A,1): READ B(A,2)
280 NEXT A
290 REM
MAKES THE "B" ARRAY CONTAIN
THE OFFSET OF OFFSET OF
EACH PLOT-DRAW POINT
300 FOR A=1 TO POINTS
310 LET B=(B(A,1)-A(A,1))
320 LET B(A,1)=B/(FRAMES-1)
330 LET B=(B(A,2)-A(A,2))
340 LET B(A,2)=B/(FRAMES-1)
350 NEXT A
360 REM
DRAWS EACH FRAME OF
THE PICTURE
370 FOR A=1 TO FRAMES
380 CLS
390 PLOT A(1,1),A(1,2)
400 FOR C=2 TO POINTS
410 DRAW A(C,1),A(C,2)
420 NEXT C
430 OUT 255,0: RANDOMIZE USR 60041: OUT 255,1
440 REM
CHANGES COORDINATES FOR
NEXT FRAME
450 FOR B=1 TO POINTS
460 LET A(B,1)=A(B,1)+B(B,1)
470 LET A(B,2)=A(B,2)+B(B,2)
480 NEXT B
490 NEXT A
500 OUT 255,0
510 STOP
520 REM
POKES MACHINE CODE
530 RESTORE 600
540 LET C=0
550 FOR A=60000 TO 60052
560 READ B: POKE A,B
570 LET C=C+B
580 NEXT A
590 IF C<>7805 THEN STOP
600 RETURN
610 DATA 62,128,243,245,219,255,203,255,211,255,219,244,50,72,238,62,1,211,244,241,205,142,14,62,128,50,194,92,58,72,238,211,244,219,255,203,191,211,255,251,0,33,0,64,17,0,96,1,0,27,237,176,201
9998 STOP
9999 SAVE *"ANIM" LINE 1
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.