home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; Copyright (C) 1990 G. Adam Stanislav
- ;; All Rights Reserved
- ;;
- ;; Purpose:
- ;;
- ;; To control AVATAR driver.
- ;;
- ;; Usage:
- ;; avtctl [adsfgGl...]
- ;;
- ;; Revisions:
- ;;
- ;; 07-29-90: Version 1.00. Released to Fidocon '90 participants.
- ;; 08-03-90: Version 1.01. Saves CX before calling AVTCHECK.
- ;; 08-09-90: Version 1.02. Makes AX='AV', BX='AT', CX='AR'.
- ;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- avatar segment
-
- assume cs:avatar, ds:avatar
-
- org 100h
-
- begin:
- ; Get the count of command line
- mov cl, ds:[80h]
- sub ch, ch
-
- ; If nothing there, complain
- jcxz explain
-
- ; see if Avatar is loaded
- push cx ; Changed by avtcheck
- call avtcheck
- pop cx
- jc noavatar
-
- ; pass command line tail to Avatar driver
- mov si, 81h
- mov ax, 1A00h OR '!'
- int 2Fh
-
- ; quit
- mov ax, 4C00h
- int 21h
-
- explain:
- call usage
- mov ax, 4C01h
- int 21h ; quit with errorlevel = 1
-
- noavatar:
- lea dx, noavt
- mov ah, 9
- int 21h ; print no-avatar message
-
- mov ax, 4C02h
- int 21h ; quit with errorlevel = 2
-
- noavt db 'Avatar console not loaded.', 13, 10, '$'
- usg db 13, 10, 'Usage:', 13, 10, 10, 9
- db 'AVTCTL [options]', 13, 10, 10
- db 'Each option is only one character long. The options are '
- db 'case sensitive.', 13, 10
- db 'Some options may not be supported by some drivers, but '
- db 'generally they are:', 13, 10, 10, 9
- db 'a - activate the driver', 13, 10, 9
- db 'd - deactivate the driver', 13, 10, 9
- db 's - slow mode on (BIOS output)', 13, 10, 9
- db 'f - fast mode on (direct screen writes)', 13, 10, 9
- db 'g - gray keys always translated', 13, 10, 9
- db 'G - gray keys never translated', 13, 10, 9
- db 'l - gray keys translated when ScrollLock depressed', 13, 10, 9
- db 't - Tandy 1000 keyboard conversion', 13, 10, 10
- db '$'
-
- dummy db 0
-
- usage:
- lea dx, usg
- mov ah, 9
- int 21h
- ret
-
- avtcheck:
- mov ax, 1A00h
- mov bx, 'AV'
- mov cx, 'AT'
- mov dx, 'AR'
- int 2Fh
- jc avtdunno
-
- inc al ; AL = FF?
- jne avtdunno
-
- avtcheck_1:
- cmp dx, 16h ; DX = ^V?
- jne avtbad
-
- clc
- ret
-
- avtbad:
- stc
- ret
-
- avtdunno:
- ; At this point Avatar either is not loaded, or it is turned off.
- ; We attempt to pass a dummy command to it. If it fails, Avatar
- ; is not loaded
-
- push cx ; save the command line count
- mov cx, 1
- lea si, dummy
- mov ax, 1A00h OR '!'
- int 2Fh
- pop cx ; restore the count
-
- jc avtbad ; no avatar
- inc al
- jne avtbad
- jmp avtcheck_1 ; could be, continue checking
-
- avatar ends
-
- end begin
-
-