;*************************** AMUS Program Label ******************************
; Filename: TALKAT.M68 Date: 02/21/89
; Category: UTIL Hash Code: 122-000-150-044 Version: 1.1
; Initials: GR/AM Name: JAMES A. JARBOE IV
; Company: EDUCATIONAL FILMSTRIPS & VIDEO Telephone #: 4092955767
; Related Files: WLDSCN.UNV Must also have TALKTO.LIT to function
; Min. Op. Sys.: 1.3B Expertise Level: BEG
; Special: Utility front end for TALKTO telecommunications program
; Description: Displays TALKTO script files located on DSK0:[7,0] and allows
; user to activate a selected script file by pressing a CR or EXECUTE.
;
;*****************************************************************************
;****************************************************************************
;* *
;* TALKAT.M68 *
;* *
;* Written By: James A. Jarboe IV *
;* Educational Filmstrips & Video *
;* 1401 19th Street *
;* Huntsville, TX 77340 *
;* 409-295-5767 *
;* *
;* 07-Jan-89 *
;* GR/AM *
;****************************************************************************
; Description: a TALKTO utility that displays the filename & comment line
; of *.TLK files in DSK0:[7,0] for automatic use with TALKTO.
; Will automatically chain to the selected SCRIPT file when
; the cursor is moved to an appropriate Script file and a
; carriage return is pressed.
;
; Options:
; TALKAT/? for help
; Notes:
; You must be a licensed user of TALKTO or program will not work.
; Public SCRIPT files (*.TLK) must be located in DSK0:[7,0].
; TALKAT should be located on DSK0:[1,4].
; The first line of each SCRIPT file (*.TLK) should have a comment
; line describing the SCRIPT file. TALKAT displays the first line
; of the SCRIPT file commented or not. TALKAT will disregard the
; first character of the first line of each SCRIPT file taking for
; granted that the first character is a comment character. This is
; for display purposes only and will not harm the SCRIPT file or
; harm it's activation. When a SCRIPT file is selected, by moving
; cursor bar, Press a Carriage Return and TALKAT will chain to
; TALKTO using the selected SCRIPT file.
;
;
; Notice: This program is donated to AMUS users as a programming example.
;
ASMMSG " "
ASMMSG "( TALKAT )"
ASMMSG "( By James A. Jarboe IV )"
ASMMSG "( LNKLIT with WLDSCN )"
ASMMSG "( Use TALKAT/? for HELP )"
ASMMSG " "
SEARCH SYS
SEARCH SYSSYM
SEARCH TRM
EXTERN $ODTIM
VMAJOR =1 ; James A. Jarboe IV
VMINOR =1 ; Fixed problem with less than 18 *.tlk files
VEDIT =0
VSUB =0
VWHO =0
; TALKAT was taken from an example program FILMAP by Dave Pallmann
; on usage of UltraSoft's WLDSCN routine.
;
;IMPORTANT-- WLDSCN on the AMUS Network will not work with AMOS 2.0
;
; A5---> impure index
; A4---> wildscan DDB index
; A3---> Base of file specifications in memory
; A1---> current file specification
; D5---> number of files in memory
; D4---> current file number
;
;impure area used by TALKAT
.OFINI
.OFDEF INPDDB,D.DDB
.OFDEF BUFFER,30.
.OFDEF CURBAS,2 ; Saves current base
.OFDEF TRMBUF,26. ; Terninal GOODIES
.OFDEF INPBUF,512. ; Input buffer for file
.OFSIZ MEMSIZ
;the following structure is used to remember the directory information in
;memory
;These macros are used to call WLDSCN, the wildcard directory scanner
;These are defined in WLDSCN.UNV as well
DEFINE WINIT
IF NDF,W.INIT,EXTERN W.INIT
CALL W.INIT
ENDM
DEFINE WSPEC EXT
IF NDF,W.SPEC,EXTERN W.SPEC
CALL W.SPEC
IF B,EXT,ASCII /???/
IF NB,EXT,ASCII /'EXT/
BYTE 0
ENDM
DEFINE WSCAN
IF NDF,W.SCAN,EXTERN W.SCAN
CALL W.SCAN
ENDM
;start of code
START: PHDR -1,PV$RPD!PV$RSM,PH$REE!PH$REU ; program header
INIT: GETIMP MEMSIZ,A5 ; allocate local memory
WINIT ; initialize WLDSCN (sets up A4)
USRFRE A3 ; point to free memory to file table
MOV A3,A1 ; set index to table base
CLR D5 ; clear file count
SETOCT: JOBIDX A6 ; index user's JCB
MOVW JOBTYP(A6),CURBAS(A5) ; Save term goodies
ANDW #^C<J.HEX>,JOBTYP(A6) ; force OCTAL radix
TRMCHR TRMBUF(A5) ; Get terminal driver flags
CMDLIN:
CALL HEADER ; Set up screen
CMPB @A2,#57 ; Need help?
JNE 10$ ; No
CALL THELP ; Yes.. then call it
CRLF
JMP EXIT ; Then quit.
10$:
LEA A2,TLK ; Load LIB: filespec
WSPEC ; process wildcard file specification
JNE EXIT ; branch on invalid spec
USREND A2 ; index end of free memory
SUB #10,A2 ; subtract 8 bytes for good measure
LOAD: CTRLC EXIT ; branch on ^C
WSCAN ; get next file that matches spec
JNE CKZERO ; no more - branch
MOVW D.DEV(A4),F.DEV(A1) ; copy spec
MOVW D.DRV(A4),F.DRV(A1) ; from a4scan
MOVW D.PPN(A4),F.PPN(A1) ; DDB @A4 to
MOV D.FIL(A4),F.FIL(A1) ; our internal
MOVW D.EXT(A4),F.EXT(A1) ; table
INC D5 ; add one to file count
JOBIDX A0 ; index user's JCB again
TSTW F.DEV(A1) ; defaulted device code?
BNE 10$ ; no
MOVW JOBDEV(A0),F.DEV(A1) ; yes - use log device code
10$: TSTW F.DRV(A1) ; defaulted drive number?
BPL 20$ ; no
MOVW JOBDRV(A0),F.DRV(A1) ; yes - use log device code
20$: TSTW F.PPN(A1) ; defaulted PPN?
BNE 30$ ; no
MOVW JOBUSR(A0),F.PPN(A1) ; yes - use log account number
30$: ADD #F.SIZ,A1 ; point index to next table entry
CMP A1,A2 ; are we out of memory?
JLT LOAD ; no
PRTTAB 24.,1 ; Yes ...
PRTTAB -1,11. ; then
TYPE <%> ; tell
TYPE <Couldn't fit all > ; em
PRTTAB -1,12. ; we
TYPE <SCRIPT> ; can't
PRTTAB -1,11. ; get
TYPE < files in memory.> ; everything !
PRTTAB -1,12. ; then let
CALL PAUSE ; Pause for input
CKZERO: TST D5 ; any files selected?
JNE SETTRM ; yep... jump to lets see'em
PRTTAB 23.,2 ; No..
PRTTAB -1,11. ; tell
TYPE <%No > ; em
PRTTAB -1,12. ; we
TYPE <TALKTO Script> ; ain't
PRTTAB -1,11. ; got
TYPE < files to select from. >
PRTTAB -1,12. ; no
MOVB #7,D1 ; LIB:*.TLK
TTY ; files
CRLF ; today.
JMP EXIT ; Then quit
SETTRM: JOBIDX A6 ; index JCB
MOV JOBTRM(A6),A6 ; get TCB address
ORW #T$IMI!T$ECS,T.STS(A6) ; force image mode, disable echo
CLR T.ICC(A6) ; clear input buffer
;
;home display to beginning of Script files in memory
;
HOME: MOV A3,A1 ; set index to table base
CLR D4 ; clear current file index
;display current page
DISPLY: PRTTAB -1,12. ; high intensity
MOV A1,A0 ; copy table index
MOV D4,D0 ; copy file index
MOV #3,D2 ; set row to 3
10$: MOV #3,D3 ; set column 3
CMP D2,#21. ; at row 21?
BGE SELECT ; yes - done w/display [101]
CTRLC EXIT ; branch on ^C
CURSOR D2,D3 ; address cursor
CALL DISFIL ; display file
CMP D2,#21. ; at end of screen?
JGT SELECT ; Yes [101]
INC D0 ; inc temp file count
CMP D0,D5 ; past end of table?
BGE SELECT ; yes [101]
ADD #F.SIZ,A0 ; advance to next entry
INC D2 ; advance row
BR 10$ ; branch
;
; display some on screen help
;
SELECT:
PRTTAB 22.,15.
TYPE <[>
PRTTAB -1,11.
TYPE <Move Cursor to desired selection and press RETURN.>
PRTTAB -1,12.
TYPE <]>
PRTTAB 23.,20.
TYPE <[>
PRTTAB -1,11.
TYPE <Press ESCAPE to exit. Press ? for HELP.>
PRTTAB -1,12.
TYPE <]>
PRTTAB 3,10. ; Set up
PRTTAB -1,33. ; Reverse
PRTTAB 3,1 ; Bar
PRTTAB -1,32. ; On
MOV #3,D3 ; First
MOV #3,D2 ; Choice
GETCHR:
CALL THETIM ; Let's show'em date & time
KBD FINISH ; Finish if ^C
UCS ; Upper case it
LEA A0,CMDTBL ; Load the selection table
MOV #-2,D0 ; Ofset d0
10$: TSTB @A0 ; At end of table ?
JEQ 20$ ; Yep..tel'em
ADD #2,D0 ; Add 2 to pointer
CMMB (A0)+,D1 ; We at right character?
BNE 10$ ; Nope... get another
MOVW JMPTBL[~D0],D0 ; Yep.. set up table
JMP JMPTBL[~D0] ; Jump to that selection
20$: MOVB #7.,D1 ; Set the bell
TTY ; Ring the bell
JMP GETCHR ; Try again
;
; The jump table offset
;
JMPTBL: WORD FINISH-JMPTBL
WORD CHAINT-JMPTBL
WORD BACK-JMPTBL
WORD END-JMPTBL
WORD FORWRD-JMPTBL
WORD TOHOME-JMPTBL
WORD FINISH-JMPTBL
WORD ONHELP-JMPTBL
WORD UPLINE-JMPTBL
WORD DOWN-JMPTBL
WORD BACK-JMPTBL
WORD END-JMPTBL
WORD FORWRD-JMPTBL
WORD TOHOME-JMPTBL
WORD CHAINT-JMPTBL
WORD FINISH-JMPTBL
; our character selection table
;
CMDTBL:
BYTE 305 ; MENU to exit (for ESP users)
BYTE 274 ; EXECUTE to activate (for Alpha term)
BYTE 'B ; B for back one page
BYTE 'E ; E for end of table
BYTE 'F ; F for Forward one page
BYTE 'H ; H for Home
BYTE 'Q ; Q for quit
BYTE '? ; ? for help
BYTE 'K-'@ ; ^K for up one line
BYTE 'J-'@ ; ^J for down one line
BYTE 'R-'@ ; ^R for return page
BYTE 'E-'@ ; ^E for end of table
BYTE 'T-'@ ; ^T for forward one page
BYTE '^-'@ ; ^^ for Home
BYTE 'M-'@ ; ^M to activate Script file
BYTE '[-'@ ; ^[ to quit
BYTE 0
EVEN
ONHELP:
CALL NOLIT ; Turn off the bar
CALL THELP ; Call for some help
CALL PAUSE ; Pause for input
PRTTAB 3,1
PRTTAB -1,10.
JMP DISPLY ; Go back to screen display
;
; set up a chainto command in the interface driver
; sort of a "force myself" command.
CHAINT:
CALL NOLIT ; Turn off bar
LEA A0,BUFFER(A5) ; A0--> to buffer area
PUSH A0 ; Save A0
LEA A2,TALK ; A2--> to TALKTO
MOVW (A2)+,(A0)+ ; Move
MOVW (A2)+,(A0)+ ; TALKTO
MOVW (A2)+,(A0)+ ; into buffer
MOVB #32.,(A0)+ ; Add a space
MOV A1,A6 ; A6--> selected script filespec
LEA A2,INPBUF(A5) ; A2--> input buffer
PUSH A2 ; Save a2
LEA A1,F.FIL(A6) ; A1--> selected script filename
UNPACK ; Unpack first 3
UNPACK ; Unpack second 3
CLRB @A2 ; Set the end
POP A2 ; Restore pointer
10$:
CMPB @A2,#32. ; Are we at a space ?
BEQ 20$ ; Yep.. must be end
MOVB (A2)+,(A0)+ ; Move filename to buffer
BR 10$ ; Get next char
20$:
MOVB #13.,(A0)+ ; Put in a CR
CLRB @A0 ; Clear everthing else
POP A0 ; Point to first of buffer
JOBIDX A6 ; Set up this job
PUSH A5 ; Save memory pointer
MOV JOBTRM(A6),A5 ; Set up for TRMICP
CLR T.ICC(A5) ; clear input buffer while we here
THECHR: CTRLC EXIT ; Exit if ^C
MOVB (A0)+,D1 ; Move buffer into job
CMPB D1,#0 ; We finished?
BEQ 10$ ; Yep..
TRMICP ; Oooh the TRMICP
BR THECHR ; Get next char
10$:
CLRW JOBCMS(A6) ; Clear command status
POP A5 ; Restore mem pointer
FINISH: PRTTAB -1,0 ; Clear screen
EXIT: JOBIDX A6 ; Point to this job
MOVW CURBAS(A5),JOBTYP(A6) ; Restore original base
LEA A2,BUFFER(A5) ; Point to buffer
MOV TRMBUF(A5),D2 ; Give it to d2
AND #100,D2 ; see if we got a status line
BEQ 20$ ; Nope.. then bypass these goodies
PRTTAB -1,130. ; Lets clear the staus line
TYPE < >
TYPE < >
PRTTAB -1,129. ; Finish with status line
20$:
PRTTAB -1,12. ; Set normal intensity
PRTTAB -1,28. ; Turn cursor back on
EXIT ; Get out of here
UPLINE:
MOV A1,A6 ; Current filespec
MOV D4,D6 ; Current file number
SUB #F.SIZ,A6 ; Subtract 1 filesize from A6
SUB #1,D6 ; Subtract 1 file number from D6
CMP D6,#0 ; First file name?
JLT GETCHR ; Yep.. then can't go back no mo
MOV A6,A1 ; Point back one filespec
MOV D6,D4 ; Point back one file number
DEC D3 ; Decrease row count
CMPB D3,#2 ; We at row 2?
JEQ BACK ; Yep .then we got to go back a page
CALL HILIT ; Reverse bar it
JMP GETCHR ; Get next character
DOWN: MOV A1,A6 ; Current filespec
MOV D4,D6 ; Current file number
ADD #F.SIZ,A6 ; Add one filesize to A6
ADD #1,D6 ; Add one file number to D6
CMP D6,D5 ; Last file number ?
JGE GETCHR ; Yep .. then can't do it
MOV A6,A1 ; Point forward one filespec
MOV D6,D4 ; Point forward one file number
INC D3 ; Add 1 to row count
CMP D3,#21. ; We at row 21?
JEQ FORWRD ; Yep. then we gota do a new page
CALL HILIT ; Reverse bar it
JMP GETCHR ; Get next char
TOHOME: CALL NOLIT ; Turn off reverse bar
PRTTAB 3,1 ; Set row 3 column 1
PRTTAB -1,10. ; Clear rest of screen
JMP HOME ; Do it from the top
END: CALL NOLIT ; Turn off reverse bar
PRTTAB 3,1 ; Set row 3 column 1
PRTTAB -1,10. ; Clear rest of screen
MOV A3,A1 ; Set end of filespec table
MOV D5,D0 ; Set end of file number count
MUL D0,#F.SIZ ; Mul * filespec size
ADD D0,A1 ; Add total count to end of table
SUB #18.*F.SIZ,A1 ; Subtract 18 filespec's from EOT
MOV D5,D4 ; Total files to d4
SUB #18.,D4 ; Subtract 18 file numbers
CMP D4,#1 ; We at first filename
JGE DISPLY ; Nope.. then display what we got
JMP HOME ; Display from the top
BACK: CALL NOLIT ; Turn off reverse bar
PRTTAB 3,1 ; Set row 3 column 1
PRTTAB -1,10. ; Clear rest of screen
SUB #18.,D4 ; Sub 18 from current file number
SUB #18.*F.SIZ,A1 ; Sub 18 filesizes from filespec
CMP D4,#1 ; We at first one
JGE DISPLY ; Nope .. then show em
JMP HOME ; Show em from the top
FORWRD: CALL NOLIT ; Turn off reverse bar
PRTTAB 3,1 ; Ok clear
PRTTAB -1,10. ; the screen
MOV A1,A6 ; Current filespec
MOV D4,D6 ; Current file number
ADD #18.*F.SIZ,A6 ; Add a screen full to A6
ADD #18.,D6 ; Add a screen full to D6
CMP D6,D5 ; End of table?
JGE DISPLY ; Yep check display
MOV A6,A1 ; Set up next filespec
MOV D6,D4 ; Set up next filenumber
JMP DISPLY ; Display it
; show the filename & the first comment line in the file if we got one
DISFIL: PUSH A1 ; Save table pointer
LEA A2,BUFFER(A5) ; A2--> points to buffer
LEA A1,F.FIL(A0) ; A1--> filename
UNPACK ; Get it
UNPACK ; to ASCII
MOVB #32.,(A2)+ ; add a space
MOVB #32.,(A2)+ ; add another
CLRB @A2 ; Clear the rest
TTYL BUFFER(A5) ; Type out the buffer
30$: POP A1 ; Restore table pointer
SAVE A0-A6,D0-D6 ; Lets be sure
MOVW F.DEV(A0),D.DEV+INPDDB(A5) ; device
MOVW F.DRV(A0),D.DRV+INPDDB(A5) ; drive
MOVW F.PPN(A0),D.PPN+INPDDB(A5) ; PPN
MOV F.FIL(A0),D.FIL+INPDDB(A5) ; filename
MOVW F.EXT(A0),D.EXT+INPDDB(A5) ; file extension
LEA A2,INPBUF(A5) ; A2--> input data buffer
MOV A2,D.BUF+INPDDB(A5) ; Move A2 into DDB buffer
MOVB #100,D.FLG+INPDDB(A5) ; Set init flag so as not to
; screw up D.BUF
OPENI INPDDB(A5) ; Open the file for input
CLR D3 ; Clear column counter
PRTTAB -1,11. ; Dim screen
FILINB INPDDB(A5) ; Get comment char out of way
40$:
FILINB INPDDB(A5) ; Get a byte
CMPB D1,#15 ; End of line ?
BEQ 50$ ; Yep.. close me up
CMPB D1,#0 ; Null char ?
BEQ 50$ ; Yep.. close it
TTY ; Show char
INC D3 ; Inc char count
CMP D3,#69. ; 69th char yet?
BNE 40$ ; Nope.. then do it again
50$:
CLOSE INPDDB(A5) ; Close the file
REST A0-
A6,D0-D6 ; Restore all goodies
PRTTAB -1,12. ; Normal screen
RTN ; Return
HEADER:
PRTTAB -1,0
PRTTAB -1,29.
PRTTAB 1,80.
PRTTAB -1,33.
PRTTAB 1,1
PRTTAB -1,32.
PRTTAB 1,35.
TYPE <TALKAT >
VCVT START+2,OT$TRM ; Get current version number
PRTTAB 2,80.
PRTTAB -1,33.
PRTTAB 2,1
PRTTAB -1,32.
PRTTAB -1,11.
TYPE < Script Description >
TYPE < >
TYPE < >
PRTTAB 2,63.
PUSH A2
LEA A2,INPBUF(A5) ; Setup
CLR D.FIL(A2) ; Clear filename from ddb
CLRW D.EXT(A2) ; Clear extension from ddb
JOBIDX A6 ; Get job
MOVW JOBDEV(A6),D.DEV(A2) ; Current device
MOVW JOBDRV(A6),D.DRV(A2) ; Current drive
MOVW JOBUSR(A6),D.PPN(A2) ; Current ppn
PFILE @A2 ; Print device & Drive on term
TYPE <[> ;
PRPPN D.PPN(A2) ; Print the PPN on term
TYPE <]>
PRTTAB -1,12.
MOV TRMBUF(A5),D3 ; Get terminal driver goodies
AND #100,D3 ; Got a Status line?
BEQ 30$ ; Nope .. then never mind
PRTTAB -1,130. ; Start status line
TYPE <By James A. Jarboe IV> ; Tell em
TYPE < > ; it's by
TYPE < > ; me
PRTTAB -1,129. ; End of status line
30$:
POP A2 ; Reset A2
CALL THETIM ; Lets show em the date & time
RTN
THETIM:
SAVE A2,D3,D4,D5 ; Be safe not sorry
MOV TRMBUF(A5),D3 ; Get terminal goodies
AND #40,D3 ; Amos addresable status line?
BEQ 30$ ; Nope.. then forget the fancy stuff
CLR D3 ; Clear D3 & D4
CLR D4 ; To set up date,time
SUB A2,A2 ; A2 to 0
CLR D5 ; Clear d5 for sure
MOV #^B0000110000000000,D5 ; Set time date flags
PRTTAB -1,54. ; Mmmm. addressable status line
MOVB #'V,D1 ; V = column 55
TTY ; Set it
CALL $ODTIM ; Print date & time
PRTTAB -1,129. ; End of status
30$:
REST A2,D3,D4,D5 ; Restore me
RTN ; Get back
;
; turn off reverse bar
;
NOLIT:
CURSOR D2,#1 ; Row whatever column 1
TYPE < > ; A space
CURSOR D2,#10. ; Row whatever column 10
TYPE < > ; A space
RTN
;
; reverse bar
;
HILIT:
CALL NOLIT ; Kill previous bar
CURSOR D3,#10. ; Row whatever column 10
PRTTAB -1,33. ; Reverse off 1st for no flash
CURSOR D3,#1 ; Row whatever column 1
PRTTAB -1,32. ; Reverse on (no flash)
MOV D3,D2 ; Set previous bar
RTN
PAUSE:
PRTTAB 24.,26. ; Tell em
PRTTAB -1,11. ; to
TYPE <Press > ; press
PRTTAB -1,12. ; any
TYPE <Any key> ; key
PRTTAB -1,11. ; to
TYPE < to continue:> ; continue
PRTTAB -1,12.
KBD ;
PRTTAB 24.,1
PRTTAB -1,9.
RTN
;
; program to rum
;
TALK: ASCII \TALKTO\
BYTE 0
EVEN
;
; where and what to look for on WSCAN
;
TLK: ASCII \DSK0:*.TLK[7,0]\
BYTE 0
EVEN
; Help was generated by AlphaPaint by Ultrasoft
;
THELP:
PRTTAB 3,1
PRTTAB -1,10.
PRTTAB 4,1