Dandy Dissolver
- Type
- Graphics
- Category
- Screen transition (dissolve) demo
- Author
- Fred Pinho
- Published in
- Antic, January 1986 (Vol. 4, No. 9), "Dandy Dissolver"
- Year
- 1986
- Language
- Atari BASIC (with machine-language routines in DATA)
- Requirements
- 48K RAM, Atari BASIC (the companion routine maker needs a disk drive)
About the program
Page flipping, the instant switch from one pre-drawn screen to another, was a favourite Atari trick, but Fred Pinho thought it "lacks elegance". Film and TV editors move between scenes with dissolves. In this January 1986 Antic article he supplied two of them as machine-language routines that BASIC can call with USR. One is a spiral that eats outwards from the middle of the screen, and the other a horizontal sweep. Each copies a hidden screen onto the visible one, piece by piece, at a speed you choose.
Listing 1, given here, is the demonstration. It draws two hidden GRAPHICS 1 pictures with a redefined character set, shows a title screen and dissolves between them. Listing 2 in the magazine (DISOLV2.BAS) wrote the routines out as ready-to-ENTER BASIC subroutines on lines 32000–32200, in three versions: the sweep (all modes), a spiral for bit-mapped modes and a spiral for character modes.
Typing it in
Most of the program is DATA for the machine code, so type the numbers carefully and SAVE before you RUN. Line 830 contains a short machine-language string, CHAR$, that copies the ROM font. {inv} … {/inv} means press the Atari (inverse) key before and after, {CTRL-E} means hold CTRL and press E, and {CTRL-,}/{CTRL-.} are CTRL with comma/full stop. Antic printed TYPO II checksums beside each line of the magazine listing. They are not part of the program.
How to use it
RUN it. While it builds the screens it reports "DRAWING FIRST SCREEN", "LOADING DISSOLVE ROUTINES" and so on. Then it shows the title screen. Press OPTION to step through the examples: a spiral at delay values 2000 and 6000 and a sweep at 3000 and 9000. It finishes by cycling both dissolves at delays that grow by 1000 each pass.
How it works
- RAMTOP is lowered twice (lines 10–20), so the OS builds two extra GRAPHICS 1 screens out of sight. Their screen addresses are read from each display list (bytes 4–5).
- The routines take the screen addresses, a delay value and five colour values as USR arguments. The spiral version is called as
USR(ADR(SPCHDIS$),MDLSCR,MDLHDN,DLY,STDDS,EDDS,C0,C1,C2,C3,C4), where the first two are the middle of the visible and hidden screens. Pinho gave a table of offsets for every mode. In GRAPHICS 1 the middle is screen start + 189 and the end is + 399, as used in line 141. - The shared delay loop is POKEd into the cassette buffer at page 4 (line 460), so programs using these routines can't use the cassette at the same time.
- Delay values can be anything from 1 to 65535. Pinho found that 2000–8000 gave the best effects, and that spirals in GRAPHICS 8 and 15 make "particularly unusual patterns".
Listing
2 REM SCREEN DISSOLVER DEMO
3 REM BY FRED PINHO
4 REM (c) 1985, ANTIC PUBLISHING INC.
10 A=PEEK(740):POKE 106,A-8:GOSUB 820:? "DRAWING FIRST SCREEN":GOSUB 260:GOSUB 620
20 POKE 106,A-4:GRAPHICS 1:POKE 559,B:DLS=PEEK(560)+256*PEEK(561):HDN2=PEEK(DLS+4)+256*PEEK(DLS+5)
30 ? "LOADING DISSOLVE ROUTINES":GOSUB 280:GOSUB 460:GOSUB 500:? CHR$(125)
40 REM DRAW SECOND HIDDEN SCREEN
50 ? "DRAWING SECOND SCREEN":GOSUB 260:POKE 559,0:RESTORE 770:FOR T=1 TO 4:READ X,Y,Z:COLOR X:PLOT Y,Z:NEXT T
60 FOR T=1 TO 4:READ V,W,X,Y,Z:COLOR V:PLOT W,X:DRAWTO Y,Z:NEXT T
70 COLOR 10:FOR T=1 TO 15:READ W,X,Y,Z:PLOT W,X:DRAWTO Y,Z:NEXT T:PLOT 8,2:PLOT 17,11:PLOT 16,12
80 FOR T=1 TO 6:READ V,W,X,Y,Z:COLOR V:PLOT W,X:DRAWTO Y,Z:NEXT T
90 REM MAIN SCREEN
100 POKE 106,A:GRAPHICS 1:POKE 756,START/256:POKE 559,B:DL=PEEK(560)+256*PEEK(561):SCR=PEEK(DL+4)+256*PEEK(DL++5)
110 COLOR 58:FOR X=0 TO 19:PLOT X,0:PLOT X,19:NEXT X:FOR Y=1 TO 18:PLOT 0,Y:PLOT 19,Y:NEXT Y
120 COLOR 26:FOR X=1 TO 18:PLOT X,1:PLOT X,18:NEXT X:FOR Y=2 TO 17:PLOT 1,Y:PLOT 18,Y:NEXT Y:POKE 712,34
130 POSITION 7,8:? #6;"SCREEN":POSITION 6,10:? #6;"DISSOLVES"
140 GOSUB 230:? "SPIRAL DELAY VALUE 2000"
141 T=USR(ADR(SPCHDIS$),SCR+189,HDN1+189,2000,SCR,SCR+399,38,202,148,70,0):?
145 GOSUB 230:? CHR$(125)
150 ? "SPIRAL DELAY VALUE 6000":T=USR(ADR(SPCHDIS$),SCR+189,HDN2+189,6000,SCR,SCR+399,40,200,146,234,2)
160 GOSUB 230:? CHR$(125);"SWEEP DELAY VALUE 3000":T=USR(ADR(SWPDIS$),SCR,HDN1,3000,38,202,148,70,0)
170 GOSUB 230:? CHR$(125);"SWEEP DELAY VALUE 9000":T=USR(ADR(SWPDIS$),SCR,HDN2,9000,40,200,146,234,2)
180 GOSUB 230:? CHR$(125);"CHANGES AT INCREASING DELAY VALUES":GOSUB 260:GOSUB 260:X=1000
190 ? "SPIRAL DELAY VALUE ";X:T=USR(ADR(SPCHDIS$),SCR+189,HDN1+189,X,SCR,SCR+399,38,202,148,70,0):GOSUB 260
200 ? CHR$(125);"SWEEP DELAY VALUE ";X:T=USR(ADR(SWPDIS$),SCR,HDN2,X,40,200,146,234,2):GOSUB 260
210 X=X+1000:IF X>65000 THEN END
220 ? CHR$(125):POKE 77,0:GOTO 190
230 POKE 53279,8:? "HIT OPTION TO GO ON"
240 IF PEEK(53279)<>3 THEN 240
250 RETURN
260 FOR T=1 TO 700:NEXT T:RETURN
270 REM SPIRAL DISSOLVE SUBROUTINE
280 DIM SPCHDIS$(413):RESTORE 290:FOR I=1 TO 413:READ Z:SPCHDIS$(I,I)=CHR$(Z):NEXT I:RETURN
290 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,104,141,255,3,141,1,4
300 DATA 104,141,254,3,141,0,4,104,141,42,4,104,141,41,4,104,141,44,4,104
310 DATA 141,43,4,216,162,10,169,0,168,133,207,133,208,177,205,145,203,169,1,141
320 DATA 253,3,230,207,24,165,203,105,1,133,203,165,204,105,0,133,204,24,165,205
330 DATA 105,1,133,205,165,206,105,0,133,206,165,204,205,42,4,240,4,144,13,176
340 DATA 7,165,203,205,41,4,144,4,177,205,145,203,238,253,3,173,253,3,197,207
350 DATA 144,198,240,196,32,2,4,24,144,2,16,181,169,1,141,253,3,230,208,24
360 DATA 169,20,101,203,133,203,165,204,105,0,133,204,24,169,20,101,205,133,205,165
370 DATA 206,105,0,133,206,165,204,205,42,4,240,4,144,33,176,7,165,203,205,41
380 DATA 4,144,24,165,204,205,44,4,240,4,176,15,144,9,165,203,205,43,4,240
390 DATA 2,176,4,177,205,145,203,238,253,3,173,253,3,197,208,144,178,240,176,32
395 DATA 2,4,24,144,2,16,159,169,1,141,253,3,230,207,56,165,203,233,1,133
400 DATA 203,165,204,233,0,133,204,56,165,205,233,1,133,205,165,206,233,0,133,206
405 DATA 165,204,205,44,4,240,4,176,15,144,9,165,203,205,43,4,240,2,176,4
410 DATA 177,205,145,203,238,253,3,173,253,3,197,207,144,196,240,194,32,2,4,24
415 DATA 144,2,16,177,169,1,141,253,3,230,208,56,165,203,233,20,133,203,165,204
420 DATA 233,0,133,204,56,165,205,233,20,133,205,165,206,233,0,133,206,165,204,205
425 DATA 42,4,240,4,144,33,176,7,165,203,205,41,4,144,24,165,204,205,44,4
430 DATA 240,4,176,15,144,9,165,203,205,43,4,240,2,176,4,177,205,145,203,238
435 DATA 253,3,173,253,3,197,208,144,178,240,176,32,2,4,202,208,161,162,0,104
440 DATA 104,157,22,208,157,196,2,232,224,5,208,243,96
450 REM DELAY SUBROUTINE
460 RESTORE 470:FOR I=1026 TO 1064:READ Z:POKE I,Z:NEXT I:RETURN
470 DATA 173,254,3,240,5,206,254,3,208,251,173,255,3,240,11,206,255,3,169,255
480 DATA 141,254,3,24,144,235,173,0,4,141,254,3,173,1,4,141,255,3,96
490 REM SWEEP DISSOLVE SUBROUTINE
500 DIM SWPDIS$(189):RESTORE 510:FOR I=1 TO 189:READ Z:SWPDIS$(I,I)=CHR$(Z):NEXT I:RETURN
510 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,104,141,255,3,141,1,4
520 DATA 104,141,254,3,141,0,4,216,160,0,169,10,141,253,3,162,20,177,205,145
530 DATA 203,24,165,203,105,20,133,203,165,204,105,0,133,204,24,165,205,105,20,133
540 DATA 205,165,206,105,0,133,206,202,208,223,56,165,203,233,19,133,203,165,204,233
550 DATA 0,133,204,56,165,205,233,19,133,205,165,206,233,0,133,206,162,20,32,2
560 DATA 4,24,144,2,208,185,177,205,145,203,56,165,203,233,20,133,203,165,204,233
570 DATA 0,133,204,56,165,205,233,20,133,205,165,206,233,0,133,206,202,208,223,24
580 DATA 165,203,105,21,133,203,165,204,105,0,133,204,24,165,205,105,21,133,205,165
590 DATA 206,105,0,133,206,32,2,4,206,253,3,208,187,162,0,104,104,157,22,208
600 DATA 157,196,2,232,224,5,208,243,96
610 REM DRAW FIRST HIDDEN SCREEN
620 B=PEEK(559):POKE 559,0:RESTORE 710:FOR V=0 TO 14:READ W,X,Y,Z:COLOR 43:PLOT W,X:DRAWTO Y,Z:NEXT V
630 FOR V=0 TO 9:READ W,X,Y,Z:COLOR 10:PLOT W,X:DRAWTO Y,Z:NEXT V
640 FOR W=1 TO 17:READ X,Y,Z:COLOR X:PLOT Y,Z:NEXT W
650 FOR X=0 TO 18 STEP 2:COLOR 154:PLOT X,0:COLOR 186:PLOT X,19:NEXT X
660 FOR X=1 TO 19 STEP 2:COLOR 186:PLOT X,0:COLOR 154:PLOT X,19:NEXT X
670 FOR Y=2 TO 18 STEP 2:COLOR 154:PLOT 0,Y:COLOR 186:PLOT 19,Y:NEXT Y
680 FOR Y=1 TO 17 STEP 2:COLOR 186:PLOT 0,Y:COLOR 154:PLOT 19,Y:NEXT Y
690 COLOR 189:FOR X=11 TO 13:PLOT X,2:NEXT X:COLOR 172:FOR X=14 TO 16:PLOT X,2:NEXT X
700 COLOR 174:FOR X=9 TO 10:PLOT X,2:NEXT X:PLOT 8,1:RETURN
710 DATA 7,2,7,9,8,4,8,7,9,5,9,7,7,10,7,11,13,7,17,7,12,9,12,10,13,8,13,10,14,10,14,11
720 DATA 14,12,15,12,3,12,4,12,1,13,4,13,1,14,5,14,1,15,2,15,8,15,8,17,9,15,9,17
730 DATA 13,3,13,4,6,2,6,7,13,5,14,5,15,4,15,6,5,5,5,7,1,7,3,7,14,14,15,14,15,15,18,15,8,14,12,14,10,15,10,17
740 DATA 39,2,3,35,3,3,35,17,2,33,12,6,40,13,6,34,14,6
750 DATA 36,2,10,38,3,10,36,4,10,34,9,11,37,10,11,34,11,11
760 DATA 33,17,10,36,2,17,37,14,17,40,15,17,37,16,17
770 DATA 62,18,0,63,19,0,92,18,1,93,19,1,140,15,0,19,4,157,14,1,18,5,142,12,1,13,1,142,18,6,18,7
780 DATA 11,12,15,16,10,12,17,19,10,13,16,19,10,14,15,19,9,14,14,19,8,14,13,19,8,15,12,19,7,15,11,19
790 DATA 9,18,10,19,0,2,2,4,0,3,5,8,0,4,4,8,0,5,4,9,0,6,2,8,0,7,1,8
800 DATA 175,7,8,9,8,175,9,9,9,10,188,7,9,7,11,188,6,10,6,12,188,5,10,5,11,173,3,12,5,14
810 REM REDEFINE CHARACTER SET
820 GRAPHICS 1:START=(PEEK(106)-8)*256:SHI=INT(START/256):SLO=START-SHI*256:POKE 203,SLO:POKE 204,SHI
830 DIM CHAR$(28):CHAR$="h{inv}){/inv}{CTRL-,}{inv}{CTRL-E}M){CTRL-.}{CTRL-E}N1M{CTRL-Q}KHPyfLfN%NIbPm{/inv}{CTRL-.}":Z=USR(ADR(CHAR$)):RESTORE 860
840 FOR T=1 TO 21:READ X:FOR Y=0 TO 7:READ Z:POKE X+Y+START,Z:NEXT Y:NEXT T
850 DLST=PEEK(560)+256*PEEK(561):HDN1=PEEK(DLST+4)+256*PEEK(DLST+5):RETURN
860 DATA 8,165,231,231,231,255,219,255,231,16,66,231,165,231,165,231,255,255,24,161,162,228,232,240,227,227,227
870 DATA 32,5,69,231,231,167,255,255,231,40,24,60,126,66,126,219,255,255,48,0,0,0,36,36,36,255,255
880 DATA 56,153,153,153,153,153,255,153,255,64,0,0,0,0,165,255,219,255,80,0,24,60,126,60,24,24,24
890 DATA 88,4,14,63,115,0,48,120,252,96,0,44,68,254,76,44,20,22,104,0,52,34,127,50,52,40,104
900 DATA 208,255,255,255,255,255,255,255,255,112,0,24,8,40,106,28,20,20,120,0,24,16,20,86,56,20,20
910 DATA 224,0,50,36,120,112,112,80,80,232,0,76,36,30,14,14,10,10
920 DATA 240,160,224,160,240,248,252,254,255,248,1,1,1,3,167,239,191,253
930 DATA 480,255,239,231,231,103,39,7,7,488,191,239,255,254,252,248,240,192
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: DISOLV1.BAS.
Credits
- Program listing: Dandy Dissolver — program listing (Antic, January 1986 (Vol. 4, No. 9), "Dandy Dissolver") — Fred Pinho
- Picture: The demo's title screen, which the hidden pictures dissolve into and out of. — Fred Pinho (program); screenshot by the site
- Antic, January 1986 - Vol. 4 No. 9: article (atarimagazines.com) — Fred Pinho, 1986
- Antic disk, January 1986 - Vol. 4 No. 9: DISOLV1.BAS (detokenized listing) — AtariMagazines.com (Kevin Savetz), 1986
