Skip to content

Commit 88d83c9

Browse files
Updates for the light show program.
1 parent d064bc6 commit 88d83c9

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed
Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
;Default is to build for both TS and NTS.
44
IFNDEF TS,TS==1
55
IFNDEF NTS,NTS==1
6+
IFE TS+NTS,.ERR Must choose at least one of TS or NTS.
67

78
A=1
89
B=2
@@ -16,7 +17,7 @@ PI==4
1617

1718
TICKS=20*60. ;20 seconds.
1819
PDLLEN==20
19-
20+
2021
GO: MOVE P,[-PDLLEN,,PDL-1]
2122
IFN TS,[
2223
;Timesharing code starts here. If not present, fall through to
@@ -32,15 +33,13 @@ IFN TS,[
3233
.REALT A, ;Clock interrupt every 1/60 seconds.
3334
.SUSET [.SMASK,,[%PIRLT]]
3435
JFCL
35-
.HANG
36+
.HANG ;Now entirely interrupt driven.
3637

3738
TSINT: 0
3839
0
39-
PUSH P,A
4040
SKIPL A,TSINT
4141
TLNN A,(%PIRLT) ;Is this the clock interrupt?
4242
.DISMIS TSINT+1
43-
POP P,A
4443
PUSHJ P,LITES
4544
.DISMIS TSINT+1
4645

@@ -49,13 +48,13 @@ LOC 42
4948
TSINT
5049
LOC ZZ
5150
]
52-
51+
5352
IFN NTS,[
5453
;Non-timesharing code starts here. If the TS code is executed
5554
;first, the UUO handler will be called and jump here.
5655
NTS1: CONO APR,3002 ;APR interrupt at channel 2, enable clock.
5756
CONO PI,12240 ;Enable interrupt.
58-
JRST .
57+
JRST . ;Now entirely interrupt driven.
5958

6059
APRBRK: 0
6160
CONSO APR,1000 ;Is this the clock interrupt?
@@ -73,11 +72,16 @@ LOC 44
7372
JSR APRBRK
7473
LOC ZZ
7574
]
75+
76+
LITES: AOSN TICK
77+
PUSHJ P,NEW ;Pattern ran out of ticks, get new one.
78+
MOVE Q,PC
79+
JSP Q,(Q) ;Coroutine call.
80+
MOVEM Q,PC
81+
DATAO PI,A ;Display A on memory indicators.
82+
POPJ P,
7683

77-
LITES: PUSH P,A
78-
SKIPE TICK
79-
JRST LITES0
80-
MOVE A,[TICKS] ;Pattern ran out of ticks, get new one.
84+
NEW: MOVE A,[-TICKS]
8185
MOVEM A,TICK
8286
MOVE A,PATRN
8387
CAIN A,PATRNE
@@ -86,15 +90,8 @@ LITES: PUSH P,A
8690
MOVE A,@PATRN
8791
AOS PATRN
8892
MOVEM A,PC'
89-
LITES0: MOVE Q,PC
90-
POP P,A
91-
JSP Q,(Q) ;Coroutine call.
92-
MOVEM Q,PC
93-
DATAO PI,A ;Display A on memory indicators.
94-
SOS TICK
9593
POPJ P,
96-
97-
94+
9895
COUNTER: ;Simple counter pattern.
9996
SETZ A,
10097
JSP Q,(Q)
@@ -118,15 +115,15 @@ SAIL0: ROT A,-1
118115
TLC A,400000
119116
JSP Q,(Q) ? JSP Q,(Q) ? JSP Q,(Q)
120117
JRST SAIL0
121-
118+
122119
PATRNS: COUNTER
123120
ROT777
124121
RANDOM
125122
SAIL
126123
PATRNE:
127124

128125
PATRN: PATRNE
129-
TICK: 0
126+
TICK: -1
130127
PDL: BLOCK PDLLEN
131128

132129
END GO

0 commit comments

Comments
 (0)