home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib26a.dsk
/
OCTOBER.1985
/
COUNTUP.TIMER.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
4KB
|
92 lines
10 REM ***********************
20 REM * COUNTUP.TIMER *
30 REM * BY DAVID FAHNESTOCK *
40 REM * COPYRIGHT (C) 1985 *
50 REM * BY MICROSPARC, INC *
60 REM * CONCORD, MA 01742 *
70 REM ***********************
80 GOSUB 900: REM INSTALL SIREN ROUTINE
90 CL = 186:SP = 160:H = 176:MM = 176:M = 176:SS = 176:S = 176: REM 186 = COLON, 160 = SPACE, 176 = 0
100 S% = 176:SS% = 176:M% = 176:MM% = 176:H% = 176
110 K = 32: REM 32 IS ASCII FOR INVERSE SPACE
120 HOME
130 B = ( -16336): REM SPEAKER LOCATION
140 POKE 48,K: REM POKE MEMORY LOCATION 48 WITH VALUE OF K FOR LO-RES GRAPHICS
150 REM DRAW RECTANGLE
160 HLIN 15,23 AT 6: HLIN 15,23 AT 7: HLIN 15,23 AT 10: HLIN 15,23 AT 11: VLIN 7,11 AT 15: VLIN 7,11 AT 23
170 REM FILL RECTANGLE WITH 0:00 00
180 POKE 1552,H: POKE 1553,CL: POKE 1554,MM: POKE 1555,M: POKE 1556,SP: POKE 1557,SS: POKE 1558,S
190 REM DRAW SECOND RECTANGLE
200 HLIN 15,23 AT 20: HLIN 15,23 AT 21: HLIN 15,23 AT 24: HLIN 15,23 AT 25: VLIN 21,23 AT 15: VLIN 21,23 AT 23
210 REM FILL SECOND RECTANGLE WITH 0:00 00
220 POKE 1464,H: POKE 1465,CL: POKE 1466,MM: POKE 1467,M: POKE 1468,SP: POKE 1469,SS: POKE 1470,S
230 REM LOWER TOP OF SCREEN TO ROW 6, RAISE BOTTOM TO ROW 10
240 POKE 34,6: POKE 35,10
250 VTAB 8: HTAB 7: PRINT "USE SPACE BAR TO SET ALARM": HTAB 9: PRINT "PRESS RETURN TO ACCEPT"
260 REM SET LEAST SIGNIFICANT SECOND
270 POKE 1686,30: VTAB 1: PRINT " * COPYRIGHT 1985 MICROSPARC, INC. *": REM 30 = ASCII FOR ^
280 VTAB 8: HTAB 11: POKE -16368,0
290 GOSUB 880: IF X = 141 THEN 340: REM RETURN KEY
300 S% = S% +1
310 IF S% >185 THEN S% = 176: REM 185 = 9, 176 = 0
320 POKE 1558,S%: REM POKE THE LEAST SIGNIFICANT SECOND ONTO SCREEN
330 GOTO 280
340 POKE 1686,K: REM ERASE THE ^ WITH THE VALUE OF K (INVERSE SPACE)
350 REM SET MOST SIGNIFICANT SECOND
360 POKE 1685,30
370 VTAB 8: HTAB 11: POKE -16368,0
380 GOSUB 880: IF X = 141 THEN 430
390 SS% = SS% +1
400 IF SS% >181 THEN SS% = 176
410 POKE 1557,SS%
420 GOTO 370
430 POKE 1685,K
440 REM SET THE LEAST SIGNIFICANT MINUTE
450 POKE 1683,30
460 VTAB 8: HTAB 11: POKE -16368,0
470 GOSUB 880: IF X = 141 THEN 520
480 M% = M% +1
490 IF M% >185 THEN M% = 176
500 POKE 1555,M%
510 GOTO 460
520 POKE 1683,K
530 REM SET MOST SIGNIFICANT MINUTE
540 POKE 1682,30
550 VTAB 8: HTAB 11: POKE -16368,0
560 GOSUB 880: IF X = 141 THEN 610
570 MM% = MM% +1
580 IF MM% >181 THEN MM% = 176
590 POKE 1554,MM%
600 GOTO 550
610 POKE 1682,K
620 REM SET HOUR
630 POKE 1680,30
640 VTAB 8: HTAB 11: POKE -16368,0
650 GOSUB 880: IF X = 141 THEN 700
660 H% = H% +1
670 IF H% >185 THEN H% = 176
680 POKE 1552,H%
690 GOTO 640
700 POKE 1680,K
710 HOME : VTAB 8: HTAB 8: PRINT "IS THIS CORRECT? (Y/N) ";: GET AN$
720 IF AN$ = "Y" THEN 750
730 IF AN$ < >"N" THEN PRINT CHR$(7);: GOTO 710
740 S% = 176:SS% = 176:M% = 176:MM% = 176:H% = 176: GOTO 120
750 HOME : VTAB 8: HTAB 6: PRINT "PRESS RETURN TO START TIMER ";: POKE -16368,0
760 GOSUB 880: IF X = 141 THEN HOME : GOTO 780
770 GOTO 750
780 VTAB 9: HTAB 16: PRINT "ALARM SET": VTAB 15: HTAB 18: PRINT "COUNT"
790 REM COUNTER STARTS HERE
800 FOR H1 = 176 TO 185: FOR M2 = 176 TO 181: FOR M1 = 176 TO 185: FOR S2 = 176 TO 181: FOR S1 = 176 TO 185
810 POKE 1464,H1: POKE 1466,M2: POKE 1467,M1: POKE 1469,S2: POKE 1470,S1
820 IF H1 = H% AND M2 = MM% AND M1 = M% AND S2 = SS% AND S1 = S% THEN 860
830 SOUND = PEEK(B) + PEEK(B) - PEEK(B) + PEEK(B)
840 FOR PAUSE = 1 TO 1000: NEXT : REM TO SLOW DOWN TIMER
850 NEXT S1: NEXT S2: NEXT M1: NEXT M2: NEXT H1
860 CALL 768: REM SOUND SIREN
870 POKE -16368,0: VTAB 22: PRINT "CONTINUE? (Y/N)";: GET K$: ON (K$ < >"Y") GOTO 920: VTAB 22: HTAB 1: CALL -958: RUN
880 X = PEEK( -16384): IF X <128 GOTO 880
890 RETURN
900 FOR X = 768 TO 805: READ Y: POKE X,Y: NEXT : RETURN
910 DATA 169,0,141,16,192,173,48,192,164,0,136,208,253,198,0,208,244,173,48,192,164,0,136,208,253,230,0,208,244,44,0,192,48,3,76,0,3,96
920 TEXT : HOME : END