home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
misc
/
pc-hamd1
/
readsstv.bas
< prev
next >
Wrap
BASIC Source File
|
1985-03-18
|
10KB
|
305 lines
10 REM ********************************************************************
20 REM read and display sstv information by Niel Wiegand
30 REM *******************************************************************
40 REM *******************************************************************
50 REM Prologue
60 REM system requirements: 128k, colorgraphics board, cassette interface,
70 REM drive a
80 REM Change History
90 REM 3-1: Initial release level
100 REM 3-3: Changed routines to process audio from basic to machine language
110 REM Changed F7 to both input/store audio and process frame
120 REM 4-1: Added prologue section
130 REM 4-2: added routine to display period trace
140 REM added vertical sync
150 REM 4-3: CHANGED MENU TO WORK FROM ALPHA KEYS
160 REM ADDED HELP FUNCTION
170 REM ADDED PARAMETER SETTING FOR SSTVMLS
171 REM 5-0: changed saved frame dataset names to pictureX.pic
180 REM ******************************************************************
190 REM ****************************************************************
200 REM set up function controls, load mls, and wait for command
210 REM *********************************************************************
220 BLACK=749
230 GRAY1=703
240 GRAY2=657
250 GRAY3=611
260 GRAY4=565
270 DEF SEG=&H1F10
280 BLOAD "SSTVMLS.OBJ",0
290 DEF SEG
300 GOSUB 460
310 KEY OFF
320 COMMAND$=INPUT$(1)
330 IF COMMAND$=" " THEN GOTO 320
340 IF COMMAND$="P" OR COMMAND$="p" THEN GOSUB 2140
350 IF COMMAND$="M" OR COMMAND$="m" THEN GOSUB 460
360 IF COMMAND$="I" OR COMMAND$="i" THEN GOSUB 1350
370 IF COMMAND$="D" OR COMMAND$="d" THEN GOSUB 760
380 IF COMMAND$="S" OR COMMAND$="s" THEN GOSUB 810
390 IF COMMAND$="L" OR COMMAND$="l" THEN GOSUB 1050
400 IF COMMAND$="H" OR COMMAND$="h" THEN GOSUB 2300
410 IF COMMAND$="C" OR COMMAND$="c" THEN GOSUB 2810
420 GOTO 320
430 REM *********************************************************************
440 REM display function menu
450 REM *********************************************************************
460 GOSUB 1720
470 CLS
480 LIN = 99
490 PRINT
500 PRINT
510 PRINT
520 PRINT " SLOWSCAN TV MONITOR"
530 PRINT " VERSION 5.0"
540 PRINT
550 REM " BY NIEL WIEGAND"
560 PRINT " W B 5 Y T G"
570 REM " 911 NORTH BEND DR."
580 REM " AUSTIN, TX. 78758"
590 REM " (AC)512-837-2492"
591 PRINT" FREQ. USED FOR SSTV"
592 PRINT" 3.845 7.171 14.230"
593 PRINT" 21.340 28.680 MHz"
600 PRINT
610 PRINT
620 PRINT " KEY P: PERIOD TRACE DISPLAY"
630 PRINT " KEY M: MENU DISPLAY"
640 PRINT " KEY I: INPUT AND DISPLAY SSTV FRAME"
650 PRINT " KEY D: DISPLAY SSTV FRAME
660 PRINT " KEY S: SAVE SSTV FRAME (1-5)
670 PRINT " KEY L: LOAD SAVED SSTV FRAME (1-5)
680 PRINT " KEY C: CHANGE SSTV SCREEN PARAMETERS"
690 PRINT " KEY H: HELP AND INFORMATION FRAME"
700 PRINT
710 PRINT
720 RETURN
730 REM ****************************************************************
740 REM process and display sstv frame
750 REM ****************************************************************
760 RESTORE
770 GOTO 1780
780 REM ****************************************************************
790 REM save sstv frame
800 REM ****************************************************************
810 PRINT "frame number";
820 INPUT FRAMENUM
830 IF FRAMENUM <1 THEN GOTO 890
840 IF FRAMENUM >5 THEN GOTO 890
850 DEF SEG=&HB800
860 ON FRAMENUM-1 GOTO 900,930,960,990
870 BSAVE "picture1.pic",0,&H4000
880 DEF SEG
890 RETURN
900 BSAVE"picture2.pic",0,&H4000
910 DEF SEG
920 RETURN
930 BSAVE"picture3.pic",0,&H4000
940 DEF SEG
950 RETURN
960 BSAVE"picture4.pic",0,&H4000
970 DEF SEG
980 RETURN
990 BSAVE"picture5.pic",0,&H4000
1000 DEF SEG
1010 RETURN
1020 REM ****************************************************************
1030 REM load sstv frame
1040 REM ****************************************************************
1050 PRINT "frame number";
1060 INPUT FRAMENUM
1070 IF FRAMENUM <1 THEN GOTO 1050
1080 IF FRAMENUM >5 THEN GOTO 1050
1090 GOSUB 1570
1100 DEF SEG=&HB800
1110 ON FRAMENUM-1 GOTO 1150,1180,1210,1240
1120 BLOAD "picture1.pic",0
1130 DEF SEG
1140 RETURN
1150 BLOAD"picture2.pic",0
1160 DEF SEG
1170 RETURN
1180 BLOAD"picture3.pic",0
1190 DEF SEG
1200 RETURN
1210 BLOAD"picture4.pic",0
1220 DEF SEG
1230 RETURN
1240 BLOAD"picture5.pic",0
1250 DEF SEG
1260 RETURN
1270 REM *******************************************************************
1280 REM exit monitor program with proper display mode
1290 REM *******************************************************************
1300 GOSUB 1720
1310 END
1320 REM ******************************************************************
1330 REM read and store audio data
1340 REM ******************************************************************
1350 PRINT "WAITING FOR VERTICAL SYNC PULSE"
1360 DEF SEG=&H400
1370 X=PEEK(&H1A)
1380 POKE X,&H1C
1390 X=PEEK(&H1B)
1400 POKE X,&H1D
1410 DEF SEG=&H1F10
1420 MOTOR 1
1430 DEF USR3=6
1440 X=USR3(0)
1450 DEF USR0=0
1460 FOR I = 1 TO 300
1470 NEXT I
1480 PRINT "STORING SSTV AUDIO"
1490 X=USR0(0)
1500 MOTOR 0
1510 DEF SEG
1520 PRINT "SSTV frame stored"
1530 GOTO 1780
1540 REM ******************************************************************
1550 REM set up screen for low resolution gray mode
1560 REM ******************************************************************
1570 RESTORE
1580 CLS
1590 SCREEN 0,5
1600 OUT &H3D8,33
1610 DATA 113,80,85,10,127,6,100,112,02,01
1620 FOR I=0 TO 9
1630 READ REGINFO
1640 OUT &H3D4,I
1650 OUT &H3D5,REGINFO
1660 NEXT I
1670 OUT &H3D8,9
1680 RETURN
1690 REM ******************************************************************
1700 REM restore normal alpha/num mode
1710 REM ******************************************************************
1720 WIDTH 40
1730 SCREEN 0,0,0
1740 RETURN
1750 REM *********************************************************************
1760 REM initialize variables and display
1770 REM *********************************************************************
1780 GOSUB 1570
1790 DEF SEG=&H1F10
1800 POKE &H1A,125 'MAX RIGHT BORDER
1810 POKE &H1B,115 'MIN RIGHT BORDER
1820 POKE &H1D,25 'SYNC LIMIT
1830 POKE &H1E,6 'SYNC INCREMENT
1840 POKE &H1F,1 'NON-SYNC DECREMENT
1850 POKE &HC,182 'SYNC PERIOD MINUS 768
1860 POKE &H18,100 'NOISE PERIOD MINUS 256
1870 POKE &HE,(BLACK MOD 256)
1880 POKE &HF,(BLACK \ 256)
1890 POKE &H10,(GRAY1 MOD 256)
1900 POKE &H11,(GRAY1 \ 256)
1910 POKE &H12,(GRAY2 MOD 256)
1920 POKE &H13,(GRAY2 \ 256)
1930 POKE &H14,(GRAY3 MOD 256)
1940 POKE &H15,(GRAY3 \ 256)
1950 POKE &H16,(GRAY4 MOD 256)
1960 POKE &H17,(GRAY4 \ 256)
1970 DEF USR1=3
1980 X=USR1(0)
1990 DEF SEG
2000 RETURN
2010 REM ******************************************************************
2020 REM load saved audio buffer
2030 REM ******************************************************************
2040 REM this allows testing standard sstv data rather than using F7 to
2050 REM load the data from cassette tape.
2060 REM ******************************************************************
2070 DEF SEG = &H1700
2080 BLOAD "audio.dat",0
2090 DEF SEG
2100 END
2110 REM ******************************************************************
2120 REM display period trace
2130 REM ******************************************************************
2140 CLS
2150 WIDTH 80
2160 SCREEN 2
2170 LOCATE 4,1
2180 PRINT"WHT"
2190 LOCATE 12,1
2200 PRINT "BLK"
2210 LOCATE 19,1
2220 PRINT "SYNC"
2230 DEF SEG=&H1F10
2240 DEF USR3=9
2250 MOTOR 1
2260 X=USR3(0)
2270 MOTOR 0
2280 DEF SEG
2290 RETURN
2300 GOSUB 1720
2310 CLS
2320 PRINT"PLOT PERIOD TRACE: AUDIO INPUT THROUGH"
2330 PRINT"THE CASSETTE INPUT PORT IS PLOTTED"
2340 PRINT"ON THE SCREEN. VERTICAL SCALE IS MARKED"
2350 PRINT"FOR APPROXIMATE PERIODS OF WHITE, BLACK"
2360 PRINT"AND SYNC. PLOTS 600 CYCLES THEN EXITS."
2370 PRINT
2380 PRINT"MENU DISPLAY: DISPLAY FUNCTION MENU."
2390 PRINT
2400 PRINT"INPUT AND DISPLAY SSTV: AUDIO INPUT"
2410 PRINT"THROUGH THE CASSETTE INPUT PORT IS"
2420 PRINT"USED TO GENERATE A SSTV FRAME IN THREE"
2430 PRINT"STEPS. FIRST WAIT FOR THE VERTICAL SYNC"
2440 PRINT"PULSE, THEN STORE AUDIO CYCLE PERIODS"
2450 PRINT"IN AUDIO BUFFER, THEN PROCESS AUDIO"
2460 PRINT"BUFFER TO FORM SSTV FRAME."
2470 PRINT
2480 PRINT"DISPLAY SSTV FRAME: AUDIO PREVIOUSLY"
2490 PRINT"INPUT AND STORED IN THE AUDIO BUFFER"
2500 PRINT"IS PROCESSED TO GENERATE A SSTV FRAME"
2510 PRINT
2520 PRINT"ENTER TO READ MORE
2530 COMMAND$=INPUT$(1)
2540 IF COMMAND$=" " THEN GOTO 2530
2550 PRINT
2560 PRINT"SAVE SSTV FRAME: SAVE THE DISPLAY"
2570 PRINT"BUFFER AS RAW BINARY DATA IN ONE OF"
2580 PRINT"FIVE DATASETS ON THE DISKETTE"
2590 PRINT"CURRENTLY LOADED ON DRIVE A."
2600 PRINT
2610 PRINT"LOAD SAVED SSTV FRAME: LOAD RAW BINARY"
2620 PRINT"DATA FROM ONE OF FIVE DATASETS ON THE"
2630 PRINT"DISKETTE CURRENTLY LOADED ON DRIVE A"
2640 PRINT"INTO THE DISPLAY BUFFER."
2650 PRINT
2660 PRINT"CHANGE SSTV SRCEEN PARAMETERS: CONTRAST"
2670 PRINT"AND BRIGHTNESS OF THE PICTURE MAY BE"
2680 PRINT"ADJUSTED. NORMAL SETTINGS SET BOTH"
2690 PRINT"EVENLY. CONTRAST OF ZERO IS MOST"
2700 PRINT"CONTRASTY PICTURE. BRIGHTNESS OF 500"
2710 PRINT"IS DARKEST PICTURE."
2720 PRINT
2730 PRINT"ENTER TO RETURN TO MAIN MENU"
2740 COMMAND$=INPUT$(1)
2750 IF COMMAND$=" " THEN GOTO 2740
2760 GOSUB 460
2770 RETURN
2780 REM ********************************************************************
2790 REM CHANGE PARAMETERS PASSED TO MACHINE LANGUAGE SUBROUTINE
2800 REM *******************************************************************
2810 GOSUB 1720
2820 CLS
2830 PRINT "CURRENT BRIGHTNESS SETTING: "GRAY2
2840 PRINT "CURRENT CONTRAST SETTING: "CONTRAST
2850 PRINT
2860 PRINT "INPUT BRIGHTNESS SETTING FROM 500 TO"
2870 PRINT "800 (NORMALLY 657)";
2880 INPUT" ", GRAY2
2890 GRAY2=INT(GRAY2)
2900 PRINT
2910 PRINT "INPUT CONTRAST SETTING FROM 0 TO 100"
2920 PRINT "(NORMALLY 46)";
2930 INPUT" ", CONTRAST
2940 CONTRAST=INT(CONTRAST)
2950 GRAY1=GRAY2+CONTRAST
2960 BLACK=GRAY1+CONTRAST
2970 GRAY3=GRAY2-CONTRAST
2980 GRAY4=GRAY3-CONTRAST
2990 GOSUB 460
3000 RETURN
EOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErOErO