.title KILROY Display picture of Kilroy in VT320 status line .link "SYS$SYSTEM:SYS.STB"/SELECTIVE_SEARCH .library "MACROS" .psect kilroy_rw, long,noshr,noexe,wrt ; ; Misc times for $BINTIM ; point_three: .ascid "0 0:0:0.30" point_six: .ascid "0 0:0:0.60" interval_t: .ascid "0 0:15:0.00" .psect kilroy_re, long,shr,exe,nowrt ; ; Kilroy mainline entry point. User mode, image context. ; load_kilroy:: .word ^M<> ; ; Set up times ; $BINTIM_S timbuf=point_three, timadr=times status R0 $BINTIM_S timbuf=point_six, timadr=times+8 status R0 $BINTIM_S timbuf=interval_t, timadr=interval status R0 ; ; Load Kilroy into memory and point AST at him. ; $CMEXEC_S routin=install_kilroy ret ; ; Code to get Kilroy up and running. ; Executive mode, image context. ; install_kilroy: .word ^M ; ; Allocate a bit of P1 pool ; movl #kilroy_size, R1 jsb g^EXE$ALOP1PROC blbc R0, 1$ movl R2, R7 movl R1, R6 movc3 #kilroy_size, kilroy, (R2) ; ; Set timer to wake code ; $SETIMR_S daytim=interval, astadr=(R7), reqidt=#0 blbc R0, 2$ ; ; Fine, exit. ; movl #SS$_NORMAL, R0 1$: ret ; ; Come here if $SETIMR failed: get back our P1 pool. ; 2$: movl R0, R5 ; Error code from $SETIMR movl R6, R1 movl R7, R0 jsb EXE$DEAP1 movl R5, R0 ret ; ; Kilroy, main code. ; This is position independent, loaded into P1 pool. ; Runs in executive mode, AST context. ; .psect kilroy_pic, long,shr,wrt,noexe,pic kilroy:: .word ^m ; ; Fix up pointers ; movab tty, tty_d4 movab fao, fao_d4 movab faobuf, faobuf_d4 movab devtype, itl_devtyp movab phydevnam, itl_phydev movab phydevnam_l, itl_phydevl ; ; Assign channel to terminal and get device characteristics ; Forget it if we couldn't get the channel. ; $ASSIGN_S chan=chan, devnam=tty_d blbs R0, 3$ brw end1 3$: clrl phydevnam_l $GETDVIW_S chan=chan, itmlst=itemlist, ; ; If no physical device then retry later. ; If terminal is not a VT320 then retry later. ; tstl phydevnam_l beql 2$ cmpl devtype, #112 beql 1$ 2$: brw end ; ; Fire the initialisation data at the terminal. Note that IO$M_BREAKTHRU ; is not used so that a read with input started must complete before Kilroy ; wakes up. ; 1$: $QIOW_S iosb=iosb, chan=chan, - func=#IO$_WRITEVBLK!IO$M_NOFORMAT, - p1=init, p2=#init_l ; ; Set up R11 (pointer to next item in data stream) to start of text/delay ; table, and skip over entry point for sunsequent passes. ; movab table, R11 ; R11 = pointer brb continue ; ; Come here on ASTs for animation, get R11 from ASTPRM. ; kilroy_again:: .word ^M movl 4(AP), R11 ; ; Put setup/reset sequences around ASCIC data ; continue: movw #256, faobuf_d $FAO_S ctrstr=fao_d, outbuf=faobuf_d, outlen=faobuf_d, p1=R11 ; ; Display string ; cvtwl faobuf_d, R0 $QIOW_S iosb=iosb, chan=chan, - func=#IO$_WRITEVBLK!IO$M_BREAKTHRU!IO$M_NOFORMAT, - p1=faobuf, p2=R0 ; ; Advance R11 to delay number ; Get delay number, if zero then end of animation ; movzbl (R11), R0 movab 1(R11)[R0], R11 movl (R11)+, R0 beql end ; ; Get actual time from table and light fuse for next step. ; decl R0 movaq times[R0], R0 $SETIMR_S daytim=(R0), astadr=kilroy_again, reqidt=R11 ret ; ; Come here when animation done. ; Drop channel and fire off timer for next pass. ; end: $DASSGN_S chan=chan end1: $SETIMR_S daytim=interval, astadr=kilroy, reqidt=#0 ret ; ; Data areas. NB: this is relocatable code; pointers must be resolved ; at run time. (*) means is a pointer set at run time ; tty: .ascii "SYS$COMMAND:" ; Terminal name descriptor tty_d: .long tty_d-tty tty_d4: .blkl ; (*) chan: .blkw iosb: .blkw 4 fao: .ascii "[1$}""[?25l!AC""[?25h""[$}" fao_d: .long fao_d-fao ; FAO control string fao_d4: .blkl ; (*) faobuf: .blkb 256 ; FAO buffer string faobuf_d: .long faobuf_d-faobuf faobuf_d4: .blkl ; (*) itemlist: .word 4 ; $GETDVI itemlist to check terminal .word DVI$_DEVTYPE itl_devtyp: .blkl ; (*) .long 0 .word 16 .word DVI$_TT_PHYDEVNAM itl_phydev: .blkl ; (*) itl_phydevl: .blkl ; (*) .long 0 devtype: .blkl ; Device type: 112 = VT300_Series phydevnam: .blkb 16 ; To receive physical device name phydevnam_l: .blkl ; Phy. dev. name len, 0 = disconnected ; ; Data to display. First is initialisation string, rest is data/time table. ; esc = 27 so = 14 si = 15 init: .ascii "P1;1;1;0;1;2;0;0{ @/??[aa]aa]aa[;" - "??_OOGGcSKiiqaA/KB?????BEHGGCB;A@`P@@@@@@@P`@A/" - "?FGOO_____OOGF;AaQIikscGGOO_/?BEHGGCB?????BK;" - "/???[aa]aa]aa[;?_OWS[cQHLR_/?MDDAACG???BCG;" - "??_OOGGcskiIQaA/KB?????BCGGHEB;" - "AaqiiKScGGOO_/?BCGGHEB?????BK;??_OOGGcSKIIqaA/" - "KB?????BEIIHCB;AaQIIKscGGOO_/?BEIIHCB?????BK;" - "??_OOGGcsKIIQaA/KB?????BCHIIEB;AaqIIKScGGOO_/" - "?BCHIIEB?????BK;??????????_____/??GCCAAHDJIICG;" - "_____/?GCIIJDHAACCG;_OOOOOOOOOOOOO_/?GCA???????ACG;" - "?_OGsiHHIQkC/@@ABCCDG??BC?G?""\"") @" - "[2$~" init_l = .-init ; ; Time table. Consists of ASCIC data string followed by time increment number. ; Time increment is index (1 based) (+1) to Times: array, initialised at setup ; time. Zero in time increment indicates end of table. ; table: .ascic "[H""[J""[1;20H"") @""! %" .long 1 .ascic "[1;21H-/." .long 1 .ascic "[1;21H)#*" .long 2 .ascic "[1;21H+#," .long 2 .ascic "[1;21H)#*" .long 2 .ascic "[1;21H'#(" .long 2 .ascic \[1;21H"#$\ .long 2 .ascic "[1;21H'#(" .long 2 .ascic "[1;20H!-/." .long 1 .ascic "[1;20H! " .long 1 .ascic "[1;20H""[K" .long 0 ; ; Times: times is time increments array. Interval is time to next pass. ; times: .blkq 2 interval: .blkq kilroy_size = .-kilroy ; Need to know this for relocation .end load_kilroy