Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - utilities/dcrock.mid
There is 1 other file named dcrock.mid in the archive. Click here to see a list.
; -*-MIDAS-*-

TITLE DIGITAL CROCK

; Original program hacked up by GLS.
; 10X/20X version hacked by EAK.

if1 {
its==1				; can run on either ITS or
tnx==1				; 10X or 20X
.insrt system
}

; If not ITS, can't use ^P codes.  Must define terminal type explicitly.
ifndef t%hz15, t%hz15==0	; Hazeltine 1500
ifndef t%dm25, t%dm25==0	; Datamedia 2500
ifndef t%vt52, t%vt52==0	; VT52
ife its,[
  ife t%hz15\t%dm25\t%vt52, t%vt52==1	; default to vt52
]


; ACs
A=1
B=2
C=3
D=4
E=5
F=6
G=7
H=10
S=14
X=15
Y=16
P=17


; I/O Channels
ifn its, toch=17


equals var,.scalar

ifn tnx, var oldmod
lpdl==40
var pdl(lpdl)


dcrock:	move p,[-lpdl,,pdl-1]
ifn its,{
	.open toch,[%tjdis+.uao,,'tty]
	 .lose %lsfil
}
ifn tnx,{
	movei 1,.priin
	rfmod
	movem 2,oldmod		; save old status
	trz 2,tt%dam		; set to 8-bit i/o
	sfmod			; zap
}
ifn its,{
	move a,[440700,,frame]
	movei b,lframe
	.call [	setz ? sixbit /siot/
		1000,,toch ? a ? b ((setz))]
	 .lose %lsfil
}
ifn tnx,{
	movei a,.priou
	hrroi b,frame
	movni c,lframe
	sout
}
repeat 6, setzm screen+.rpcnt
	seto h,
hackit:
ifn its,{
	.rdtime s,
	.rtime c,
	camn c,h
	 jrst hackit
	move h,c
}
ifn tnx,{
	time
	move s,a
	seto 2,		; get current time
	setz 4,		; with no funny daylight savings or timezone stuff
	odcnv		; get time
	movei a,(d)
	camn a,h
	 jrst hackit
	move h,a
	movei c,0
	idivi a,60.*60.
	pushj p,sixn
	move a,b
	idivi a,60.
	pushj p,sixn
	move a,b
	pushj p,sixn
}
	MOVNI D,6
LOOP:	LSHC B,6
	ANDI B,17
	MOVE E,DIGITS(B)
	MOVE F,E
	EXCH F,SCREEN+6(D)
	XOR F,E
	JUMPE F,NEXT
	MOVNI G,43
CYCLE:	JUMPGE F,NXTBIT
	hlrz x,chpos+43(g)
	add x,horiz+6(d)
	hrrz y,chpos+43(g)
	addi y,4+2
	pushj p,movcur
	jumpge e,blank
	movei a,"#
	pushj p,outb
	jrst nxtbit
blank:	pushj p,clchar
nxtbit:	lshc e,1
	aojl g,cycle
next:	aojl d,loop
	movei y,22.
	movei x,69.
	pushj p,movcur
	pushj p,force
ifn its,{
	.listen a,
	jumpn a,quit
	addi s,28.
	movn s,s
	.sleep s,
	jrst hackit
}
ifn tnx,{
	movei a,.priou
ife t%vt52,{
	sibe
	 jrst quit
}
ifn t%vt52,{
	sibe
	 jrst [	bin
		caie b,^S
		 jrst quit
;X;		sibe
;X;		 caia
;X;		  jrst quit
		bin
		caie b,^Q
		 jrst quit
		jrst .+1 ]

}
	time
	add a,b
	sub a,s
	jumpl a,hackit
	imuli a,1000.
	idiv a,b
	subi a,7
	disms
	jrst hackit
}
ifn its,{


movcur:	push p,a
	.iot toch,[^P]
	.iot toch,["V]
	movei a,10(y)
	.iot toch,a
	.iot toch,[^P]
	.iot toch,["H]
	movei a,10(x)
	.iot toch,a
	pop p,a
	popj p,


clchar:	.iot toch,[^P]
	.iot toch,["K]
	popj p,


outb:	.iot toch,a
	popj p,


force:	popj p,


quit:	.logout 1,
}



ifn tnx,{


movcur:	push p,a
ifn t%vt52,{
	movei a,33
	pbout
	movei a,"Y
	pbout
	movei a,40(y)
	pbout
	movei a,40(x)
	pbout
}
	pop p,a
	popj p,


clchar:	push p,a
	movei a,40
	pbout
;X;	movei a,^H
;X;	pbout
	pop p,a
	popj p,


outb:	pbout
	popj p,


force:	popj p,


quit:	movei 1,.priou		; Before halting, move to bottom of screen.
ifn t%dm25, hrroi 2,[.byte 7 ? ^L ? 0#140 ? 23.#140 ? ^M ? 0]
ifn t%hz15, hrroi 2,[.byte 7 ? 176 ? ^Q ? 140 ? 23.+140 ? ^M ? 0]
ifn t%vt52, hrroi 2,[asciz "Y7 K"]
	setz 3,
	sout
	movei 1,.priin
	move 2,oldmod
	sfmod		; Restore old modes
	haltf
	jrst dcrock


sixn:	push p,a
	push p,b
	idivi a,10.
	lsh c,6
	addi c,'0(a)
	lsh c,6
	addi c,'0(b)
	pop p,b
	pop p,a
	popj p,
}
SCREEN:	BLOCK 6

RADIX 2.
DIGITS:	011101000110011101011100110001011100
	001000110000100001000010000100011100
	011101000100001000100010001000111110
	011101000100001011100000110001011100
	000100011001010100101111100010000100
	111111000010000111100000110001011100
	011101000110000111101000110001011100
	111110000100001000100010001000100000
	011101000110001011101000110001011100
	011101000110001011110000110001011100
RADIX 8.

ifn its,{
DEFINE HACK CHARS
IRPC X,,[CHARS]
IFSE X,$,	"$
IFSE X,U,	^P ? "U
IFSE X,D,	^P ? "D
IFSE X,B,	^P ? "B
IFSE X,F,	40
TERMIN
TERMIN
}
ifn t%vt52,{
DEFINE HACK CHARS
IRPC X,,[CHARS]
IFSE X,$,	"$
IFSE X,U,	33 ? "A
IFSE X,D,	^J
IFSE X,B,	^H
IFSE X,F,	40
TERMIN
TERMIN
}

FRAME:	.BYTE 7
ifn its,	^P ? "C ? ^P ? "V ? 10+4 ? ^P ? "H ? 10+8
ifn t%vt52,	33 ? "H ? 33 ? "J ? 33 ? "Y ? 40+4 ? 40+8
	HACK $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
	HACK DB$DB$DB$DB$DB$DB$DB$DB$DB$DB$
	HACK BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$
	HACK BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$
	HACK BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$BB$
	HACK BB$BB$
	HACK UB$UB$UB$UB$UB$UB$UB$UB$UB$
ifn its,	^P ? "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