From a6ca4f20be8ca2e71588f09110263322c211444a Mon Sep 17 00:00:00 2001 From: William Harrington Date: Wed, 8 Jun 2022 21:24:09 -0500 Subject: Add the N/NR variable for the I/O output at the expansion port. Add line 10. --- sc126/BASIC/COUNTUP2.BAS | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sc126/BASIC/COUNTUP2.BAS b/sc126/BASIC/COUNTUP2.BAS index fa68764..bf79d59 100644 --- a/sc126/BASIC/COUNTUP2.BAS +++ b/sc126/BASIC/COUNTUP2.BAS @@ -1,23 +1,27 @@ +10 RANDOMIZE SEED 20 AR = INT(RND(1)*256) 21 BR = INT(RND(1)*256) 22 CR = INT(RND(1)*256) 23 DR = INT(RND(1)*256) 24 LR = INT(RND(1)*256) 25 MR = INT(RND(1)*256) -25 DELAY = INT(RND(1)*10000) +26 NR = INT(RND(1)*256) +30 DELAY = INT(RND(1)*10000) 40 OUT &H20, 0 41 OUT &H21, 0 42 OUT &H22, 0 43 OUT &H23, 0 44 OUT &H0D, 0 -45 OUT &H00, 0 +45 OUT &H01, 0 +46 OUT &H00, 0 50 GOSUB 100 52 GOSUB 200 54 GOSUB 300 56 GOSUB 400 58 GOSUB 500 60 GOSUB 600 -70 IF A=AR AND B=BR AND C=CR AND D=DR AND L=LR AND M=MR THEN GOTO 1010 +62 GOSUB 700 +70 IF A=AR AND B=BR AND C=CR AND D=DR AND L=LR AND M=MR AND N=NR THEN GOTO 1010 90 GOTO 50 100 IF A = AR THEN RETURN 110 LET A = A + 1 @@ -39,11 +43,15 @@ 510 LET L = L + 1 520 OUT &H0D, L 530 RETURN -600 IF M = MR THEN RETURN -610 LET M = M + 1 -620 OUT &H00, M +600 IF N = NR THEN RETURN +610 LET N = N + 1 +620 OUT &H01, N 630 RETURN +700 IF M = MR THEN RETURN +710 LET M = M + 1 +720 OUT &H00, M +730 RETURN 1000 REM RANDOM DELAY LENGTH 1010 FOR Z = 0 TO DELAY : NEXT Z -1020 A = 0 : B = 0 : C = 0 : D = 0 : L = 0 : M = 0 +1020 A = 0 : B = 0 : C = 0 : D = 0 : L = 0 : M = 0 : N = 0 1030 GOTO 10 -- cgit v1.2.3-54-g00ecf