.TITLE MESSG .IDENT /V1.00/ ; ; Fortran callable subroutine to print out driver messages ; to the player task. This value will be driven by the table ; at the label $MSG::. There is one special message, number 3 ; which is handled specially by this routine. ; ; Calling sequence ; ; ; CALL MESSG (ISENT(WHO,I),L) ; ; ; ; External subroutines used by this routine; ; ; $YESNO ; CLEAR ; CPOS(L) ; ; The message table will be in the following format ; ; ; $MSG:: Table of pointers to word values ; ; @pointer .WORD bit 15 --> call clear (only used by msg 3) ; bit 14 --> call wait before printing next message ; bits 13-0 --> length of message to follow ; ; Author : Dave Carroll TSC [JAN-83] ; ; .MCALL QIOW$S,MRKT$S,WTSE$S,DIR$,QIOW$ .ENABL LC .PSECT DATA,RW,D PARS: .WORD 1 .WORD 0 ; parameter for CPOS .PSECT RODATA,RO,D GOODM: .ASCII /Good!/ GDL =.-GOODM .EVEN BADM: .ASCII /Tough luck, but you get it anyway./ BDL =.-BADM .EVEN MIN1: .FLT2 -1. GOOD: QIOW$ IO.WVB,1,1,,,, BAD: QIOW$ IO.WVB,1,1,,,, .PSECT ROCODE,RO,I MESSG:: TST @2(R5) ; anything to do ? BEQ 100$ ; nope, ignore it MOV 4(R5),PARS+2 ; set up for CPOS ; ; We will have a message to print, set the stage ... ; MOV R5,-(SP) ; save the values CMP @2(R5),#MSGMAX ; are we in range BHIS 90$ ; we are out of our range MOV #PARS,R5 ; set for the call CALL CPOS ; position the cursor MOV (SP),R5 ; restore the value MOV @2(R5),R0 ; get the message # ASL R0 ; multiply by two ... MOV $MSG(R0),R0 ; get our pointer TST (R0) ; test the status word BPL 1$ ; don't have to clear the screen MOV R0,-(SP) ; save our pointer for the call CALL CLEAR MOV (SP)+,R0 ; restore the pointer 1$: MOV (R0)+,R1 ; get the byte count MOV R1,-(SP) ; save to see if we need to wait BIC #140000,R1 ; clean up the extra bits MOVB (R0)+,R2 ; get the carriage control desired QIOW$S #IO.WVB,#1,#1,,,, ; write it BIT #40000,(SP)+ ; are we to wait as well BEQ 2$ ; nope, continue MRKT$S #1,#1,#2 ; wait a second WTSE$S #1 ; wait for it 2$: MOV (SP),R5 ; restore R5 mapping CMP @2(R5),#3 ; was this the fatal message ? BNE 90$ ; nope finish up MOV 4(R5),R0 ; get address for bad line MOV MIN1,(R0)+ ; first word MOV MIN1+2,(R0)+ ; done CALL $YESNO ; find out what the answer was ... TST R1 ; is it 0 ... (NO) BEQ 3$ ; if so, inform of poor judgement DIR$ #GOOD BR 90$ ; finish up 3$: DIR$ #BAD ; nope, say so 90$: MOV (SP)+,R5 ; restore the mapping for good CLR @2(R5) ; make the message go away 100$: RETURN .END