;PAINTSUN.MAR - Program to paint a sunburst to a VT100 or VT52 ; terminal. ; .TITLE PAINTMOON ; $DCDEF $LIBCLIDEF ; .MACRO P LINE,COL,NUM=1,BLINK MOVL #NUM,TEXT_DESC .IIF NB,, PUSHL #4 PUSHL #COL PUSHL #LINE PUSHAL TEXT_DESC CALLS NUM_ARGS,G^SCR$PUT_SCREEN .ENDM ; .PSECT DATA PIC,NOEXE,LONG,NOSHR,WRT ; BIT_MASK: .LONG LIB$M_CLI_CTRLY IOSB: .BLKL 2 SYS_OUTPUT: .ASCID /SYS$OUTPUT/ CHAN: .WORD NUM_ARGS: .LONG 3 FLAG: .LONG DEVICE_TYPE: .LONG TEXT_DESC: .LONG .LONG O_TEXT O_TEXT: .REPT 80 .ASCII /a/ .ENDR SP_TEXT: .REPT 10 .ASCII / / .ENDR STAR_TEXT: .ASCII /*/ VT100_UP_DESC: .LONG 3 .ADDRESS VT100_UP VT100_DOWN_DESC:.LONG 3 .ADDRESS VT100_DOWN VT52_UP_DESC: .LONG 2 .ADDRESS VT52_UP VT52_DOWN_DESC: .LONG 2 .ADDRESS VT52_DOWN SAVE_DOWN_DESC: .LONG VT100_UP: .BYTE ^X1B ;Set special character set for VT100 .ASCII /(0/ ; ESC ( 0 VT100_DOWN: .BYTE ^X1B ;Set normal character set for VT100 .ASCII /(B/ ; ESC ( B VT52_UP: .BYTE ^X1B ;Set special character set for VT52 .ASCII /F/ ; ESC F VT52_DOWN: .BYTE ^X1B ;Set normal character set for VT52 .ASCII /G/ ; ESC G INVALID_TERM: .ASCID /*****ERROR - Invalid terminal type. *****/ ; .PSECT CODE PIC,EXE,LONG,SHR,NOWRT ; PAINTMOON: .WORD ; ;Disable DCL CONTROL-Y PUSHAL BIT_MASK CALLS #1,G^LIB$DISABLE_CTRL ;Enable our own CONTROL_Y AST routine $ASSIGN_S DEVNAM=SYS_OUTPUT,CHAN=CHAN BLBS R0,.+10 PUSHL R0 CALLS #1,G^LIB$STOP $QIOW_S CHAN=CHAN,FUNC=#IO$_SETMODE!IO$M_CTRLYAST,- IOSB=IOSB,P1=CTRLY_AST BLBS R0,.+10 PUSHL R0 CALLS #1,G^LIB$STOP CMPW #1,L^IOSB BEQL .+15 MOVZWL L^IOSB,-(SP) CALLS #1,G^LIB$STOP ;Is the terminal a VT100 or a VT52? PUSHAL DEVICE_TYPE PUSHAL FLAG CALLS #2,G^LIB$SCREEN_INFO ; CMPZV #1,#1,FLAG,#1 ;Is the VT100 flag set BEQL VT100 ; CMPB #DT$_VT52,DEVICE_TYPE ;Is the terminal a VT52? BEQL VT52 ; PUSHAL INVALID_TERM CALLS #1,G^LIB$PUT_OUTPUT JMP END ;Terminal is VT100 compatible- switch to special character set VT100: MOVAL VT100_DOWN_DESC,SAVE_DOWN_DESC ;Save for later PUSHAL VT100_UP_DESC CALLS #1,G^LIB$PUT_OUTPUT BRW ERASE ;Terminal is a VT52 VT52: MOVAL VT52_DOWN_DESC,SAVE_DOWN_DESC ;Save for later PUSHAL VT52_UP_DESC CALLS #1,G^LIB$PUT_OUTPUT ;Erase the screen ERASE: PUSHL #1 PUSHL #1 CALLS #2,G^SCR$ERASE_PAGE ;Sun center P 6,35,11 P 7,32,17 P 8,30,21 P 9,29,23 P 10,28,25 P 11,27,27 P 12,27,27 P 13,27,27 P 14,28,25 P 15,29,23 P 16,30,21 P 17,32,17 P 18,35,11 ;NW Ray P 9,25,2 P 8,20,8 P 7,15,15 P 6,10,18 P 5,5,21 P 4,1,21 P 3,1,19 P 2,1,17 P 1,1,15 ;SW Ray P 18,30,2 P 19,28,6 P 20,26,15 P 21,24,17 P 22,22,19 P 23,20,21 ;E Ray P 12,56,24 P 11,56,24 P 10,55,25 P 9,54,26 P 8,58,22 P 7,63,17 P 6,68,12 P 5,72,8 P 4,77,3 ;W Ray P 12,1,24 P 13,1,24 P 14,1,25 P 15,1,26 P 16,1,22 P 17,1,17 P 18,1,12 P 19,1,7 P 20,1,2 ;N Ray P 6,49,2 P 5,47,6 P 4,40,15 P 3,40,17 P 2,40,19 P 1,40,21 ;SE Ray P 15,54,2 P 16,53,8 P 17,51,15 P 18,49,22 P 19,51,25 P 20,53,27 P 21,55,25 P 22,57,23 P 23,59,21 ;Return to normal character set PUSHL SAVE_DOWN_DESC CALLS #1,G^LIB$PUT_OUTPUT ;Place cursor at the bottom of the screen PUSHL #1 PUSHL #23 CALLS #2,G^SCR$SET_CURSOR ; END: MOVL #SS$_NORMAL,R0 ;Status return ERR: RET ;Exit main routine ; ;CONTROL_Y AST Routine ; CTRLY_AST: .WORD PUSHL SAVE_DOWN_DESC ;return to normal character set CALLS #1,G^LIB$PUT_OUTPUT PUSHAL BIT_MASK ;Enable CTRL/Y CALLS #1,G^LIB$ENABLE_CTRL $EXIT_S #SS$_ABORT ;Image exit with error status .END PAINTMOON