;*************************** AMUS Program Label ******************************
; Filename: CAL.M68 Date: 8/7/90
; Category: CAL Hash Code: 367-424-345-632 Version: 1.0(101)
; Initials: ROBB/AM Name: Erik Petrich
; Company: Microlink Computing Systems, Inc. Telephone #: 4053218333
; Related Files:
; Min. Op. Sys.: NONE Expertise Level: BEG
; Special: You need M68 version 2.0 or above.
; Description: Displays a month calendar for any date in the current century.
; By default, it displays the current month.
;
;*****************************************************************************
;
; Copyright 1990 Microlink Computing Systems, Inc.
;
;Edit History:
;[100] 02 May 1990 00:22 Edited by Erik Petrich
;[101] 07 August 1990 03:00 Edited by Erik Petrich
; Rewrote the CheckGraphics subroutine to work correctly in a more
; diverse operating environment.
;
; Draw the top part of the boxes on the calendar
TopLine:
save d1
movw #177400+12.,d1
tcrt
rest d1
crt 38
movw #5.,d2
10$: crt 46
crt 46
crt 42
dbf d2,10$
crt 46
crt 46
crt 39
crlf
rtn
; Draw the bottom part of the boxes on the calendar
BottomLine:
crt 40
movw #5.,d2
10$: crt 46
crt 46
crt 45
dbf d2,10$
crt 46
crt 46
crt 41
crlf
rtn
; Draw the intersection of boxes in between weeks
MiddleLine:
crt 44
movw #5.,d2
10$: crt 46
crt 46
crt 48
dbf d2,10$
crt 46
crt 46
crt 43
crlf
rtn
; Draw the numbers on the calendar
NumberLine:
crt 47
movw #6.,d2
clr d1
10$: movw WorkingDay(a5),d1
cmpw d1,#1.
blo 20$
cmpw d1,MaxDays(a5)
bhi 20$
grafoff
cmpw d1,Day(a5)
bne 15$
save d1
movw #177400+11.,d1 ; make today's date stand out from the rest
tcrt
rest d1
15$: dcvt 2,ot$trm!ot$zer
cmpw d1,Day(a5)
bne 17$
save d1
movw #177400+12.,d1
tcrt
rest d1
17$: grafon
br 30$
20$: type < >
30$: crt 47
incw WorkingDay(a5)
dbf d2,10$
crlf
rtn
; do a TCRT code, translating graphic calls to ascii characters if
; CheckGraphics had determined that our terminal can't do graphics.
CRTsub: save d1
tstw TextOnly(a5)
beq 50$
cmpw d7,#24.
blos 90$
cmpw d7,#47.
bne 10$
type < > ; really |, but a space looks better
br 90$
10$: cmpw d7,#46.
bne 20$
type <->
br 90$
20$: type <+>
br 90$
50$: movw #177400,d1
orw d7,d1
tcrt
90$: rest d1
rtn
; This entire subroutine was rewritten in edit [101]
;
; Check to see if the current terminal supports graphics characters
CheckGraphics:
mov ph.ver,d7
and #^H0FF0FF000,d7 ; mask out edit & patch levels
cmp d7,#<1_24.>+<3_16.>+<3_12.> ; pre 1.3C ???
blo 10$ ; assume the worst if so
jobidx
mov jobtrm(a6),a6
mov t.tdv(a6),a6
movw @a6,d7
andw #td$tch,d7 ; TRMCHR is not supported
beq 10$ ; on the current terminal driver
trmchr TermFeatures(a5),tc$bmp
movw <32./8.>+tc.bmp+TermFeatures(a5),d7
andw #^B1111111111100000,d7
cmpw d7,#^B1111111111100000 ; check from TCRT codes 38 -> 48
beq 20$
10$: setw TextOnly(a5)
20$: rtn