home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-01-26 | 26.8 KB | 1,112 lines |
- ; STATLINE.A86
- title 'Status Line Driver'
- pagesize 60+11
- ;****************************************
- ;* *
- ;* STATUS LINE ROUTINES *
- ;* CDOS 6.0 XIOS *
- ;* DRI OS ENGR, JMB *
- ;* *
- ;****************************************
- ; Major mods:
- ; 6.x
- ; 9 Nov 88 -- Update VC buffer for SR Terminals GMS
- ; 24 Oct 88 -- Suppress WIN if serial console IJ
- ; 15 Sep 88 -- PC Term support added IJ
- ; 8 SEP 88 -- use global chan_sel value for MGE GMS
- ; 19 AUG 88 -- ignore status line update if we're no GMS
- ; longer top_screen (386)
- ; 21 Jul 88 -- Individual locks in status lines for SR IJ
- ; 17 JUN 88 -- Display printer numbers >9 GMS
- ; 20 APR 88 -- SunRiver support added GMS
- ; 12 JAN 87 -- use PC equipment word to test if mono/color GMS
- ; 7 DEC 87 -- top_screen_mode contains real ROS values GMS
- ; 2 DEC 87 -- replaced num_color/num_mono with video$ GMS
- ; 6.0
- ; 9 SEP 87 -- z_clk_on/off changed for seconds GMS
- ; 5.2
- ; 14 MAY 87 -- **NOT IMPLEMENTED **
- ; Real time clock re-sync'ed every minute GMS
- ; 17 MAR 87 -- Enhanced keyboard support GMS
- ; 5.1
- ; 29 OCT 86 -- Skip retrace test if EGA GMS
- ; 16 Oct 86 -- Added support for Amstrad attribute GMS
- ; 8 OCT 86 -- European keyboard support added GMS
- ; 24 JUN 86 -- display seconds as well (##JW##)
- ; 22 OCT 85 -- change to support new keyboard driver
- ; 10 JUN 85 -- update 4.1 ASM86 version to RASM86
-
- ; include COPYRITE.TXT
-
- nolist
- include CDOS.EQU
- include XIOS.EQU
- include PCHW.EQU
- include ROSDATA.EQU
- include NAT.EQU
- if V386
- if SR
- include SR.EQU
- else
- include PTERM.EQU
- endif
- endif
- list
- ; These were included:
- ; include CDOS.EQU
- ; include XIOS.EQU
- ; include PCHW.EQU
- ; include ROSDATA.EQU
- ; include NAT.EQU
- if V386
- if SR
- ; include SR.EQU
- else
- ; include PTERM.EQU
- endif
- endif
- CGROUP group CODE
- DGROUP group DATA
-
- public io_statline@, sl_error_out@, ww_statline@
- public z_sl_off@, z_sl_mono@, z_sl_color@
- public z_sl_both@, z_sl_blank@
- public z_clk_on@, z_clk_off@
- public clear_statline@, switch_statline@
- public sl_exit_value$, sl_crt_flag$, sl_attrib$
- cseg
- extrn flagwait@ :near, supif@ :near ; in HEADER.A86
- extrn put_crt_s@ :near, copy_full_top@ :near ; in WINDOWS3.A86
- extrn int16_entry@ :near ; in ROSIF.A86
- extrn set_time@ :near ; in INIT.A86
- if V386
- extrn point_vs@ :near ; in WINDOWS2.A86
- if SR
- extrn test1_srterm@ :near ; in SRTERM.A86
- extrn point_pc1@ :near
- extrn sr_raw_key@ :near
- else
- extrn test_pcterm@ :near ; in PCTERM.A86
- extrn point_pc1@ :near
- extrn point_vc@ :near
- endif
- endif
-
- dseg
- extrn beep_counter$ :byte ; in ISRS.A86
- extrn key_flag$ :word, switch_key$ :byte ; in KEYBOARD.A86
- extrn prtsc_key$ :byte, wmenu_key$ :byte
- extrn NX_natnlstat$ :byte
- extrn NX_language$ :byte
- extrn NX_countries$ :word
- extrn ccb_list$ :word ; in PUBDATA.A86
- extrn blank$ :word, sl_pc_flag$ :byte
- extrn cloneflag$ :byte, iattrib$ :byte
- extrn im_here$ :byte ; in WINDOWS3.A86
- extrn top_screen$ :byte, graphic_bits$ :byte
- extrn top_screen_mode$:byte, var_sync$ :byte
- extrn video$ :byte ; in WINDOWS1.A86
- extrn pc_at$ :byte ; in FLOPPY.A86
- extrn nlcb$ :byte
- if V386
- extrn active_vc$:byte
- endif
- if SR
- extrn first_vs_num$ :byte ; in PUBDATA.A86
- extrn con_basead$ :word, station_on_off$ :byte ; in SRTERM.A86
- extrn chan_sel$ :byte
- endif
- eject
-
- ; IO_STATLINE will display status line on the 25th line of IBM PC monochrome
- ; and/or color screen. First gather information into local string
- ; and then copy to the video display RAM.
-
- ; The format of the status line is:
- ;Process1 Process2 Process3 Process4 Console=0 ABCDEF* ^S ^P=0 Win Caps Num 23:59
-
- cseg
-
- ret_statline:
- ;------------
- ; Quick return if status line is being used:
- ret
-
-
- ;============
- ww_statline@:
- ;============
- ; Window manager status line call. It's the same as a normal call
- ; except that source data is char/attrib (160 bytes):
- mov si,rlr$ ; find our process
- mov bl,top_screen$
- cmp bl,P_CONS[si] ; are we already top
- je ww_display
- mov P_CONS[si],bl ; update WMENU VC #
- push cx ! push dx
- mov cx,P_DELAY
- mov dx,1
- call supif@ ; make sure of dispatch
- pop dx ! pop cx
- ww_display:
-
- mov si,offset sl_get_160 ; for char/attrib fetch
- jmps sl_shared ; go to it
-
-
- ;============
- io_statline@:
- ;============
- ; Normal io status line call:
- ; entry: if cx = 0 normal status update
- ; if cx = offset, print 80 chars at cx:dx
- ; if cx = 0FFFFh, resume normal status
- ; DL = physical console number
- ; exit: al = 0 if call was successful
- ; al = 0FFh if call was blocked
-
- mov si,offset sl_get_80 ; for char/attrib fetch
- sl_shared:
- if V386
- ; keep a note of whether or not we update a given physical console
- mov bl,dl ; make PCon an offset
- xor bh,bh ; to block the status line
- cmp cx,0ffffh ; someone returning status line
- jne sl_shared1 ; to normal ?
- mov sr_statline_block[bx],false ; yes, unblock this console
- jmps sl_shared2
- sl_shared1:
- jcxz sl_shared2 ; normal update, do nothing
- mov bx,rlr$ ; find our process
- mov bl,P_CONS[bx] ; get the VCON number
- xor bh,bh ; make a word
- shl bx,1 ; make a word offset
- mov bx,ccb_list$[bx] ; point to the CCB
- mov bl,C_PC[bx] ; read the pcon number
- xor bh,bh ; clear BH
- mov sr_statline_block[bx],true ; special, block this console
- sl_shared2:
- endif
- mov al,TRUE
- xchg sline_locked,al ; is in io_statline at time
- test al,al ; sline_locked = 0ffh if locked
- jz sl_free ; sline_locked = 0 if not
- cmp sl_exit_value$,al ; if not locked on exit
- jnz ret_statline ; then just return
- sl_free:
- push es ; save UDA
- jcxz sl_keep ; if cx=0, skip source update
- mov sl_off,cx ; store offset
- mov sl_seg,dx ; and segment of source data
- sl_keep:
- cmp sl_off,0ffffh ; if normal status line
- jz sl_norm ; then skip
- jcxz sl_ex ; if cx=0, ignore the call
-
- mov sl_get_char,si ; save fetch call
- mov si,sl_off ; source offset
- mov dl,sl_crt_flag$ ; which crt bits
- and dl,sl_pc_flag$ ; mask out pc monitors
- call sl_disp_prep ; ready reg's for display
- if V386
- push bx
- mov bx,rlr$ ; find our process
- mov dh,P_CONS[bx] ; get our VCON number
- pop bx
- endif
- sl_ext_loop:
- mov es,sl_seg ; source segment
- call sl_get_char ; either get_80 or get_160
- call sl_put_char ; put one char to status line
- loop sl_ext_loop ; 80 times
- sl_ex:
- jmp sl_exit
-
- sl_get_80:
- mov al,es:[si] ; fetch character only
- mov ah,sl_attrib$ ; status line attribute
- inc si ; bump once
- ret
-
- sl_get_160:
- mov ax,es:[si] ; fetch character / attribute
- inc si ; and bump twice
- inc si
- ret
- eject
-
- sl_norm:
- ;-------
- ; Normal status line update:
- ; DL = physical console
-
- if V386
- mov bl,dl ; make PCon an offset
- xor bh,bh ; to block the status line
- cmp sr_statline_block[bx],true ; is it blocked ?
- je io_stat_ret ; yes, do nothing
- if SR
- cmp dl,0 ; see if dl is too big
- je io_stat ; if it isn't, skip
- call test1_srterm@ ; test if SUN RIVER main console
- jz io_stat_ret ; no
- mov es,con_basead$ ; base address of control regs
- mov bl,chan_sel$ ; get old select
- xor bh,bh
- test byte ptr station_on_off$[bx],ON ; is station ON
- jz io_stat_ret ; no..
- push dx
- mov dl,top_screen$
- call point_vs@
- call copy_full_top@ ; keep VS_ buffer up to date
- pop dx
- jmps io_stat ; yes..
- else
- jmps io_stat
- endif
- io_stat_ret:
- jmp sl_exit
- io_stat:
- else
- mov dl,0 ; force to main console
- endif
- push ds ! pop es
- mov di,offset status_msg
- mov al,' '
- mov cx,offset smsg_hour - offset status_msg
- rep stosb ; blank out all but time
-
- lea si,console_msg
- lea di,smsg_cstr
- mov cx,length console_msg
- rep movsb
-
- mov al,dl ; physical console number
- call conv_digit ; convert to ascii
- mov smsg_cnum,al ; save it
- ; or ah,ah ; > 9 not supported currently
- ; jz s_onedigit
- ; mov smsg_cnum+1,ah
- ;s_onedigit:
-
- lea di,status_msg ; at the start
- mov rev_console,offset rev_list
- mov bx,offset ccb_list$
- search_ccb:
- mov si,[bx] ; ccb pointer
- inc bx ! inc bx
- cmp dl,C_PC[si] ; our ccb
- jne search_ccb ; no get next
- mov bx,si ; bx -> ccb
- sl_proc_loop:
- mov si,C_OWNER[bx] ; si -> proc desc
- test si,si ; if zero
- jz sl_no_pd ; then it's nobody
-
- test P_FLAG[si],PF_SYS
- lea si,P_NAME[si] ; si -> process name
- jz sl_move_pd ; skip if user process
-
- sl_no_pd: ; if system or null
- lea si,blank_pd ; show the space
- sl_move_pd:
- mov cx,8
- rep movsb ; store the name
- inc di ; to next process
- test C_STATE[bx],CSM_BACKGROUND
- jnz sl_backg
- push bx
- call sl_foreg
- pop bx
- sl_backg:
- add rev_console,2
- mov bx,C_LINK[bx] ; link to next
- cmp bx,0000h ; end link ?
- jne sl_proc_loop
-
- s_get_openvec: ; display a letter for each drive
- push dx
- ; with open files ABCDEF*
- mov dx,open_vec$ ; BDOS sets this vector in SYSDAT
- mov di,offset smsg_openvec ; support up to 4 open drives
- mov cx,13 ; drives to check
- mov al,'A' ; start off with A: drive
- s_get_open1:
- shr dx,1 ; test the LSB
- jnc s_get_open3 ; skip if not open
- cmp di,offset smsg_openvec+2 ; do we have space to display
- jne s_get_open2 ; skip if O.K.
- dec di ; else go and overwrite 4th
- mov al,'*' ; remind them there are more
- s_get_open2: ; AL = character to display
- stosb ; store it into the status line
- s_get_open3:
- inc ax ; move to next drive
- test dx,dx ; test if any more open files
- jnz s_get_open1 ; loop back if more
- pop dx
-
- ;; National keyboard support
- NX_update_status: ; display country/mode
-
- if V386
- cmp dl,0 ; see if dl is too big
- je nx_main ; if it isn't, skip
- if SR
- call test1_srterm@ ; test if SUN RIVER main console
- jz nx_not_sr ; no
- mov al,dl ; physical to AL
- call point_pc1@
- mov al,'8' ; assume eight bit mode
- test PC_NATNLSTAT,NX_just7_bit
- jz NX_bits ; skip if not seven bit
- mov al,'7' ; else display 'xx7'
- NX_bits:
- mov smsg_NX_bits,al ; drop 7 or 8 into status line
- sub bx,bx ; assume U.S.A.
- test PC_NAT,0ffh ; national keyboard
- jz NX_updt_country ; if not, assumption O.K.
- test PC_NATNLSTAT$,NX_nkbd_bit ; U.S.
- jz NX_updt_country
- mov bl,PC_LANGUAGE ; else get language code
- and bl,0fh ; remove enhanced bit
- jmps NX_updt_country
- nx_not_sr:
- else
- ; we have a naming conflict on eg PC_NAT between PCTerm and Sunriver
- ; when we combine the PCTerm and Sunriver we will have to resolve this
- ; and then the following code will go in the SR as well
- ;
- call test_pcterm@ ; test if PC Terminal
- jz nx_main ; no
- mov al,dl ; physical to AL
- call point_pc1@
- mov al,'8' ; assume eight bit mode
- test PC_NATNLSTAT,NX_just7_bit
- jz NX_bits_pc ; skip if not seven bit
- mov al,'7' ; else display 'xx7'
- NX_bits_pc:
- mov smsg_NX_bits,al ; drop 7 or 8 into status line
- sub bx,bx ; assume U.S.A.
- test PC_NAT,0ffh ; national keyboard
- jz NX_updt_country ; if not, assumption O.K.
- test PC_NATNLSTAT$,NX_nkbd_bit ; U.S.
- jz NX_updt_country
- mov bl,PC_LANGUAGE ; else get language code
- and bl,0fh ; remove enhanced bit
- jmps NX_updt_country
- endif
- nx_main:
- endif
- mov al,'8' ; assume eight bit mode
- test NX_natnlstat$,NX_just7_bit
- jz NX_updt_stat_bits ; skip if not seven bit
- mov al,'7' ; else display 'xx7'
- NX_updt_stat_bits:
- mov smsg_NX_bits,al ; drop 7 or 8 into status line
- sub bx,bx ; assume U.S.A.
- test NX_natnlstat$,NX_nkbd_bit ; see if national keboard
- jz NX_updt_country ; if not, assumption O.K.
- mov bl,NX_language$ ; else get language code
- and bl,0fh ; remove enhanced bit
- NX_updt_country:
- shl bx,1 ; make it offset in 2-byte table
- mov ax,word ptr NX_countries$[bx] ; get language abreviation
- mov word ptr smsg_NX_country,ax ; drop it into status line
-
- s_window:
- if V386
- test dl,dl ; main console ?
- jz s_window1 ; don't need to test further
- if not SR ; for the moment exclude SR
- call test_pcterm@ ; is it a PC Terminal
- jz s_capslock ; if so suppress the Win msg
- endif
- s_window1:
- endif
- cmp im_here$,0
- jz s_capslock
- mov si,offset winstr
- mov di,offset smsg_window
- mov cx,length winstr
- rep movsb
-
- s_capslock:
- push ds
- mov ax,PC_SEGMENT
- mov ds,ax
- mov al,kb_flag_40
- pop ds
- test al,CAPSLOCK_BIT
- jz s_numlock
- mov si,offset capstr
- mov di,offset smsg_capslock
- mov cx,length capstr
- rep movsb
-
- s_numlock:
- test al,NUMLOCK_BIT
- jz sl_time
- mov si,offset numstr
- mov di,offset smsg_numlock
- mov cx,length numstr
- rep movsb
-
- sl_time:
- cmp sl_clk_flag,0 ; if clocks disabled
- jz sl_display ; then skip
-
- sl_hours:
- mov al,tod_hour$ ; get current hour from sysdat
- call sl_ascii ; convert bcd to ascii
- mov smsg_hour,ax ; and store the minute
- mov al,tod_min$
- call sl_ascii ; convert bcd to ascii
- mov smsg_min,ax ; and store the minute
- mov al,tod_sec$
- call sl_ascii
- mov smsg_sec,ax
-
- sl_display:
- mov dl,sl_crt_flag$ ; get allowable crt bits
- and dl,sl_pc_flag$ ; mask out pc monitors
- test dl,SL_MONO_BIT + SL_COLOR_BIT
- jz sl_exit ; if both off, bag it
-
- mov si,offset status_msg
- call sl_disp_prep ; get the reg's ready
- sl_disp1:
- cmp cloneflag$,IS_AMSTRAD
- jne use_def1
- mov ah,iattrib$ ; get amstrad default
- jmps def1
- use_def1:
- mov ah,0Fh ; normal attribute
- def1:
- cmp cl,stop_rev ; are we past it?
- ja sl_disp2 ; if so, skip
- cmp cl,start_rev ; time to start?
- jb sl_disp2 ; if not, skip
- cmp cloneflag$,IS_AMSTRAD
- jne use_def2
- mov al,iattrib$
- mov ah,al
- and ax,8877h ; save highlights
- push cx
- mov cl,4
- rol al,cl ; swap colours
- pop cx
- or ah,al ; re-combine
- jmps sl_disp2
- use_def2:
- mov ah,70h ; reverse video it
-
- sl_disp2:
- if V386
- cli
- push ax
- push bx
- mov bx,rlr$ ; find our process
- mov dh,P_CONS[bx] ; get the VCON number
- push dx ; save VCON in DH
- mov dl,dh
- if not SR
- cmp dl,NUM_VIR_CONS
- jb sl_disp3
- call point_vc@
- cmp VC_CRT_ROWS,CRT_ROWS_C ; in 24 line mode ?
- jmps sl_disp4
- sl_disp3:
- endif
- call point_vs@
- cmp VS_CRT_ROWS,CRT_ROWS_C ; in 24 line mode ?
- sl_disp4:
- pop dx
- pop bx
- pop ax
- jne sl_exit ; if not 24 line skip the update
-
-
- push dx ; save VCON in DH
- mov dh,sl_crt_flag$ ; get allowable crt bits
- and dh,sl_pc_flag$ ; mask out pc monitors
- test dh,SL_MONO_BIT + SL_COLOR_BIT
- pop dx
- sti
- jz sl_exit ; if both off, bag it
-
- endif ; so ignore update
- lodsb ; get character
- call sl_put_char ; put ax to status line
- loop sl_disp1
- sl_exit:
- pop es
- mov al,sl_exit_value$ ; successful update
- mov sline_locked,al ; free the semaphore
-
- JMPS sl_ret ; the following was patched
- ; out because of incompatibilty
- ; with TIME command
- test pc_at$,0ffh ; are we on AT/clone
- jz sl_ret
- jmp set_time@ ; yes..re -sync the clock
- sl_ret:
- if V386 ; sl_off was used to block normal update
- mov sl_off,0ffffh ; with SunRiver we have an explicit block
- endif ; per status line so return to non-block value
- sti
- ret
- eject
-
- sl_foreg:
- mov si,rev_console
- mov ax,[si] ; hilight start-stop
- mov START_STOP,ax ; save for later
- s_ctrlS:
- mov ax,C_STATE[bx]
- test ax,CSM_CTRLS
- jz s_ctrlO
- mov smsg_ctrlS,'S^'
- jmps s_ctrlP
- s_ctrlO:
- test ax,CSM_CTRLO
- jz s_ctrlP ; ctrl S and ctrl O are mutally
- mov smsg_ctrlS,'O^' ; exclusive print one of ^S or ^O
- s_ctrlP:
- test ax,CSM_CTRLP
- jz s_mode
- mov smsg_ctrlP,'P^'
- mov dh,'='
- mov smsg_ctrlP_num,dh
- mov al,C_MIMIC[bx]
- call conv_digit ; convert to ascii
- mov smsg_ctrlP_num+1,al ; save it
- or ah,ah ; > 9
- jz s_mode
- mov smsg_ctrlP_num+2,ah
- s_mode:
- ret
-
- ; convert hex number in al to ascii in ah and al
- conv_digit:
- xor ah,ah
- do_tens:
- cmp al,9
- jbe do_digit
- sub al,10
- inc ah ; increment tens
- jmps do_tens
- do_digit:
- or al,'0' ; convert to ascii
- or ah,ah
- jz do_al
- or ah,'0'
- xchg al,ah ; make al tens
- do_al:
- ret
-
- sl_disp_prep:
- ; Set up pointers and count for status display:
-
- mov di,S_L_OFFSET * 2
- mov bx,offset status_copy
- mov cx,80 ; character count
- ret
-
- sl_put_char:
- ; Put one char/attrib to either or both status lines:
- ; entry: ax = char/attrib
- ; dl = crt code mask 01 => mono 02 => color
- if V386
- ; dh = VC number on start of STATLINE update
- endif
-
- if not V386 ; always update for SunRiver/PCTerm
- cmp ax,[bx] ; if character is the same
- jz sl_put4 ; then just bump pointers
- endif
- mov [bx],ax ; save the copy
- test dl,SL_MONO_BIT
- jz sl_put1 ; skip if not to mono
-
- mov es,sl_mono_seg
- if V386
- cli
- push bx
- mov bx,rlr$ ; find our process
- cmp dh,P_CONS[bx] ; has our VCON number changed
- pop bx
- jne sl_put1 ; yes we must be in background
- endif
- mov es:[di],ax ; store if mono on
-
- sl_put1:
- sti
- test dl,SL_COLOR_BIT
- jz sl_put4 ; back to loop if off
- cmp top_screen_mode$,03 ; if anyone is in graphics
- jnz sl_put4 ; then don't show color
-
- ; Color status line character output:
-
- push bx ; get some room
- push cx
- push dx
- mov es,sl_color_seg
- if V386
- cli
- mov bx,rlr$ ; find our process
- cmp dh,P_CONS[bx] ; has our VCON number changed
- jne sl_c_inback ; yes we must be in background
- endif
-
- cmp var_sync$,0 ; need to wait for retrace?
- je sl_c_nowait ; no, just ship it
-
- mov bx,ax ; save char in bx
- mov dx,COLOR_PORT+6 ; crt status
- mov cx,3 ; maximum wait
-
- if not V386
- cli ;; hold the interrupts
- endif
- sl_c_norm1:
- in al,dx ;; wait for horiz retrace
- test al,HRT ;; to go away
- loopnz sl_c_norm1 ;; but don't wait too long
- sl_c_norm2:
- in al,dx ;; wait for a fresh
- test al,HRT ;; horiz retrace
- jz sl_c_norm2
- xchg ax,bx ;; char to ax
- sl_c_nowait:
- stosw ;; store and bump di
- sti ;; ints back on
-
- pop dx ; recover registers
- pop cx
- pop bx
- jmps sl_put5 ; di already bumped
- if V386
- sl_c_inback:
- sti ;; ints back on
- pop dx ; recover registers
- pop cx
- pop bx
- endif
- sl_put4:
- inc di ; bump the crt pointer
- inc di
- sl_put5:
- inc bx ; bump the copy pointer
- inc bx
- ret ; back to loop
-
-
- sl_ascii:
- ; Convert bcd in al to ascii in ax:
-
- mov ah,33h ; the ms nibbles
- mov cl,4
- ror ax,cl ; al = 10's digit
- mov cl,4
- ror ah,cl ; ah = 1's digit
- ret
- eject
-
- sl_error_out@:
- ;-------------
- ; *** Status line error message entry ***
- ;
- ; entry: si -> error message
- ; di -> allowable responses (count,string..)
- ; exit: al = response character
-
-
- if V386
- mov al,'A' ; accept all errors
- cmp active_vc$,NUM_VIR_CONS
- jae a_ret ; return immediately for PCTERM
- endif
-
- mov al,sl_crt_flag$ ; if neither status line
- and al,sl_pc_flag$ ; is enabled, then
- mov al,'A' ; accept all errors
- jnz sl_error_cont
- a_ret:
- ret
-
- sl_error_cont: ; status line is up
- mov al,TRUE
- xchg al,sline_locked ; test and set status semaphore
- test al,al
- jnz sl_error_out@ ; if somebody's using it, wait
- mov sl_exit_value$,TRUE
-
- mov sl_error_msg,si ; save message offset
- mov sl_error_resp,di ; and responses
- push sl_off ; save offset address
- push sl_seg ; and segment
- push key_flag$ ; save keyboard state
-
- push es
- push ds ! pop es ; for local moves
- mov si,offset status_copy
- mov di,offset sl_error_save
- mov cx,80
- rep movsw ; save the current status line
- pop es
-
- mov dx,ds
- mov cx,sl_error_msg
- call io_statline@ ; print the error message
- if not SR
- inc beep_counter$
- endif
- er_response:
- if not SR
- inc beep_counter$ ; beep once
- endif
-
- sl_wait:
- if SR
- mov dl,top_screen$ ; at this console
- cmp dl,NUM_VIR_CONS
- jb sl_wait_main
- mov cl,0 ; wait until key ready
- call sr_raw_key@ ; get a key
- jmps sl_wait_notmain
- sl_wait_main:
- endif
- mov dx,ER_FLAG
- mov key_flag$,dx ; now keyboard is ours
- call flagwait@ ; wait here for a key
-
- mov ah,1 ; ROS int 10h status
- call int16_entry@ ; a key there?
- ; jz sl_wait ; jump if no
- jz er_response
-
- sub ah,ah ; ROS int 10h conin
- call int16_entry@
-
- sub bl,bl ; zero out the special keys
- mov prtsc_key$,bl ; we won't accept them
- mov wmenu_key$,bl
- mov switch_key$,bl
-
- sl_wait_notmain:
- or al,al ; is this an extended code
- ; jz sl_wait ; if so, try again...we don't
- jz er_response ; want it
-
- and al,0DFh ; convert to upper case
- mov di,sl_error_resp
- mov cl,[di]
- mov ch,0
- jcxz er_resp_good ; if di -> 0, take anything
-
- push es
- push ds ! pop es
- inc di ; to response chars
- repnz scasb ; check for legal value
- pop es
- jnz er_response ; if bad, try again
-
- er_resp_good:
- mov sl_error_key,al ; save the value
- mov dx,ds
- mov cx,offset sl_error_save
- call ww_statline@ ; full 160 byte write
-
- mov bl,top_screen$ ; this is the current VC
- xor bh,bh
- shl bx,1 ; make word offset
- mov bx,ccb_list$[bx] ; pick up CCB
- mov dl,C_PC[bx] ; hence Physical Console
- mov cx,0ffffh ; resume normal status line
- call io_statline@ ; on this console
-
- pop key_flag$
- pop sl_seg
- pop sl_off
-
- mov sline_locked,FALSE
- mov sl_exit_value$,FALSE
- mov al,sl_error_key ; return value
- ret
- eject
-
- ;************************************************
- ;* STATUS LINE ESCAPE HANDLERS *
- ;************************************************
-
- z_sl_off@:
- ;---------
- ; esc 0 - turn status line off:
-
- mov dh,0 ; finish with none
- jmps z_sl_blank@ ; shared routine
-
-
- z_sl_mono@:
- ;----------
- ; esc 1 - turn on monochrome status only:
-
- mov dh,SL_MONO_BIT ; finish with mono
- jmps z_sl_blank@ ; shared routine
-
-
- z_sl_color@:
- ;-----------
- ; esc 2 - turn on color status only:
-
- mov dh,SL_COLOR_BIT ; finish with color
- jmps z_sl_blank@ ; shared routine
-
-
- z_sl_both@:
- ;----------
- ; esc 3 - turn on both status lines:
-
- mov dh,SL_MONO_BIT + SL_COLOR_BIT
- ; jmps z_sl_blank@ ; try for both
-
-
- z_sl_blank@:
- ;-----------
- ; shared status line BLANK and change
- ; entry: dh = new sl_crt_flag$ to try
-
- mov al,0FFh ; first get sole control
- xchg al,sline_locked$
- test al,al ; if someone's there
- if SR
- jnz z_sl_exit ; then exit
- else
- jnz z_sl_blank@ ; then wait
- endif
- push bx ; save vs_ pointer
- push es
- ; mov dl,video$
- ; and dl,MONO+COLOR ; 01 for mono 02 color
- mov ax,PC_SEGMENT
- mov es,ax
- mov ax,es: equip_flag_40 ; get equipment byte
- mov dl,02 ; assume color seg
- and al,30h
- cmp al,30h ; mono video ?
- jne z_sl_blank1
- mov dl,01 ; mono
- z_sl_blank1:
- call sl_disp_prep ; prepare for blanking
- push dx
- if V386
- push bx
- mov bx,rlr$ ; find our process
- mov dh,P_CONS[bx] ; get our VCON number
- pop bx
- endif
- z_sl_blank2:
- mov ax,blank$
- call sl_put_char ; write one BLANK
- loop z_sl_blank2 ; 80 times
- pop dx
- pop es
- pop bx ; restore vs_ pointer
-
- and dl,dh ; see who's left
- mov sl_crt_flag$,dl ; and save for updates
- mov sline_locked$,0 ; release the semaphore
- z_sl_exit:
- ret
-
-
- z_clk_off@:
- ;----------
- ; esc 4 - turn status line clock display off:
-
- push es
- push ds
- pop es ; local for stos
- mov sl_clk_flag$,0 ; disable update
- mov di,offset smsg_hour$
- mov cx,8 ; clock characters
- mov al,' '
- rep stosb ; BLANK 'em
- pop es
- ret
-
-
- z_clk_on@:
- ;---------
- ; esc 5 - enable status line clock display:
-
- mov smsg_c1$,':' ; first delimiter
- mov smsg_c2$,':' ; second delimiter
- mov smsg_hour$,'0 ' ; assume initial time
- mov sl_clk_flag$,0FFh ; if hour not 0
- ret
- eject
-
- clear_statline@:
- ;---------------
- ; If our status line is off and we're a 24 line cpm full screen,
- ; then BLANK the physical status line:
- ; entry: bx -> vs_
-
- mov al,SL_MONO_BIT
- cmp VS_CRT_SEG,MONO_SEG
- jz clear_sl_test ; skip if we're monochrome
- mov al,SL_COLOR_BIT
- clear_sl_test:
- test sl_crt_flag$,al ; if our statline is on,
- jnz clear_sl_done ; then this isn't needed
-
- cmp VS_BOTTOM,CRT_ROWS_C-1
- jnz clear_sl_done ; skip if not 24 lines
-
- mov di,2*S_L_OFFSET ; point to physical statline
- mov cx,80 ; chars per line
- mov ax,blank$
- call put_crt_s@ ; store to our monitor
- clear_sl_done:
- ret
-
-
- switch_statline@:
- ;----------------
- ; If in pc mode, disable status line; if not, enable.
- ; Called from io_switch and pc_kbd.
- ; entry: bx -> vs_
-
- mov dl,top_screen$ ; if we're not on top
- cmp dl,VS_NUMBER ; then do nothing
- jne switch_ret
-
- mov al,SL_MONO_BIT ; assume we're monochrome
- cmp VS_CRT_SEG,MONO_SEG
- jz sw_stat_set ; skip if on monochrome
- mov al,SL_COLOR_BIT ; else we're color
- sw_stat_set:
- test VS_MODE,PCMODE_BIT
- jz sw_stat_on ; skip if not pc mode
- cmp VS_BOTTOM,CRT_ROWS_P - 1
- jb sw_stat_on ; skip if above the bottom
-
- sw_stat_off:
- not al ; to turn sl off, complement
- and sl_pc_flag$,al ; and mask the bit off
- jmps sw_stat_clear ; now force an update
- sw_stat_on:
- or sl_pc_flag$,al ; to turn sl on,
- ; jmps sw_stat_clear ; or it in and fall through
-
- sw_stat_clear:
- push es ! push ds ! pop es
- mov di,offset status_copy$
- mov cx,80 ; words per stat line
- sub ax,ax
- cld
- rep stosw ; force a full update
- pop es ; get back the uda
- switch_ret:
- ret
-
- eject
-
- dseg
- ; STATLINE data area:
-
- sline_locked db 0 ; semaphore for status line code
- sl_clk_flag db 0FFh ; do we show the clock?
- sl_exit_value$ db 0 ; restore semaphore on exit
-
- sl_attrib$ db 0Fh ; now used only by external call
- sl_off dw 0ffffh ; offset of source
- sl_seg dw 0 ; segment of source
- sl_get_char rw 1 ; variable fetch vector
-
- sl_crt_flag$ rb 1 ; which monitors to show statline
- sl_mono_seg dw 0B000h ; monochrome crt base address
- sl_color_seg dw 0B800h ; color crt base address
-
- sl_error_msg rw 1 ; error message offset
- sl_error_resp rw 1 ; allowable response table offset
- sl_error_key rb 1 ; response key
-
- start_rev rb 1 ; first column of rev video
- stop_rev rb 1 ; last column of rev video
- START_STOP equ word ptr start_rev
-
- rev_list dw 5049h ; process 1
- dw 4740h ; process 2
- dw 3E37h ; process 3
- dw 352Eh ; process 4
-
- rev_console rw 1
-
- ; Status line message image:
-
- status_msg rb 0
- smsg_proc1 rb 8
- rb 1
- smsg_proc2 rb 8
- rb 1
- smsg_proc3 rb 8
- rb 1
- smsg_proc4 rb 8
- smsg_cstr rb 8
- smsg_cnum rb 1
- rb 1
- smsg_NX_country rb 2
- smsg_NX_bits rb 1
- rb 1
- smsg_openvec rb 2
- rb 1
- smsg_ctrlS rw 0
- smsg_ctrlO rw 1
- smsg_ctrlP rw 1
- smsg_ctrlP_num rb 2
- rb 1
- smsg_window rb 3
- rb 1
- smsg_capslock rb 4
- rb 1
- smsg_numlock rb 3
- rb 1
- smsg_hour dw '0 '
- smsg_c1 db ':'
- smsg_min dw '00'
- smsg_c2 db ':'
- smsg_sec dw '00'
-
- ; To restore "Console=":
-
- console_msg db 'Station='
-
- ; For system or null processes:
-
- blank_pd db ' ____ '
-
- ; Window, capslock, and numlock indicators:
-
- winstr db 'Win'
- capstr db 'Caps'
- numstr db 'Num'
-
- status_copy rw 80 ; keep a copy of status line
-
- sl_error_save rw 80 ; back up for error messages
-
- if V386
- if SR
- sr_statline_block rb NUM_SR_CONS + 1
- else
- sr_statline_block rb NUM_AUX_PORTS + 1
- endif
- endif
- end
-
- ; END OF STATLINE.A86
-