Skip to content

Commit f1b3550

Browse files
volvo-larsbrinkhofflarsbrinkhoff
authored andcommitted
Updates for the light show program.
1 parent d064bc6 commit f1b3550

File tree

1 file changed

+30
-33
lines changed

1 file changed

+30
-33
lines changed
Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
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
10+
C=3
911
T=10
1012
TT=11
11-
Q=16
13+
PC=16
1214
P=17
1315

16+
COCALL=JSP PC,(PC) ;Coroutine call.
17+
1418
APR==0
1519
PI==4
1620

1721
TICKS=20*60. ;20 seconds.
1822
PDLLEN==20
19-
23+
2024
GO: MOVE P,[-PDLLEN,,PDL-1]
2125
IFN TS,[
2226
;Timesharing code starts here. If not present, fall through to
@@ -32,36 +36,34 @@ IFN TS,[
3236
.REALT A, ;Clock interrupt every 1/60 seconds.
3337
.SUSET [.SMASK,,[%PIRLT]]
3438
JFCL
35-
.HANG
39+
.HANG ;Now entirely interrupt driven.
3640

3741
TSINT: 0
3842
0
39-
PUSH P,A
4043
SKIPL A,TSINT
4144
TLNN A,(%PIRLT) ;Is this the clock interrupt?
42-
.DISMIS TSINT+1
43-
POP P,A
44-
PUSHJ P,LITES
45+
.DISMIS TSINT+1 ;No, dismiss immediately.
46+
PUSHJ P,LITES ;Yes, do our thing.
4547
.DISMIS TSINT+1
4648

4749
ZZ==.
4850
LOC 42
4951
TSINT
5052
LOC ZZ
5153
]
52-
54+
5355
IFN NTS,[
5456
;Non-timesharing code starts here. If the TS code is executed
5557
;first, the UUO handler will be called and jump here.
5658
NTS1: CONO APR,3002 ;APR interrupt at channel 2, enable clock.
5759
CONO PI,12240 ;Enable interrupt.
58-
JRST .
60+
JRST . ;Now entirely interrupt driven.
5961

6062
APRBRK: 0
6163
CONSO APR,1000 ;Is this the clock interrupt?
62-
JRST 12,@APRBRK
63-
PUSHJ P,LITES
64-
CONO APR,1002
64+
JRST 12,@APRBRK ;No, dismiss immediately.
65+
PUSHJ P,LITES ;Yes, do our thing.
66+
CONO APR,1002 ;Clear clock interrupt.
6567
JRST 12,@APRBRK
6668

6769
ZZ==.
@@ -73,60 +75,55 @@ LOC 44
7375
JSR APRBRK
7476
LOC ZZ
7577
]
78+
79+
LITES: AOSN TICK
80+
PUSHJ P,NEW ;Pattern ran out of ticks, get new one.
81+
COCALL
82+
DATAO PI,A ;Display A on memory indicators.
83+
POPJ P,
7684

77-
LITES: PUSH P,A
78-
SKIPE TICK
79-
JRST LITES0
80-
MOVE A,[TICKS] ;Pattern ran out of ticks, get new one.
85+
NEW: MOVE A,[-TICKS]
8186
MOVEM A,TICK
8287
MOVE A,PATRN
8388
CAIN A,PATRNE
8489
MOVEI A,PATRNS ;Reached end of list.
8590
MOVEM A,PATRN
86-
MOVE A,@PATRN
91+
MOVE PC,@PATRN
8792
AOS PATRN
88-
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,
100-
JSP Q,(Q)
97+
COUNT0: COCALL
10198
AOS A
102-
JRST .-2
99+
JRST COUNT0
103100

104101
ROT777: MOVEI A,777 ;Rotating pattern.
105-
JSP Q,(Q)
102+
COCALL
106103
ROT A,1
107104
JRST .-2
108105

109106
.INSRT XOROSH
110107

111108
RANDOM: PUSHJ P,XOROSHIRO"XOROSHIRO ;Random generator.
112-
JSP Q,(Q)
109+
COCALL
113110
JRST RANDOM
114111

115112
SAIL: SETZ A, ;SAIL null job.
116113
SAIL0: ROT A,-1
117114
TLNN A,200000
118115
TLC A,400000
119-
JSP Q,(Q) ? JSP Q,(Q) ? JSP Q,(Q)
116+
COCALL ? COCALL ? COCALL
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)