home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
20th Century Video Alman…Century in Depth - Sports
/
ALMANAC_03.iso
/
vesa
/
everex
/
e626vesa.exe
/
VIDUTIL.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-03-29
|
9KB
|
424 lines
;------------------------------------------------------------------------
;02/19/90 GL - Source code created
;------------------------------------------------------------------------
;------------------------------------------------------------------------
; BIOS data area variables
cSegMono equ 0B000h
cSegColor equ 0B800h
cSegGrfx equ 0A000h
mSysEquip equ 0410h
mSysMode equ 0449h
mSysColumns equ 044Ah
mSysRegenLen equ 044Ch
mSysRegenOfs equ 044Eh
mSysCursorPos equ 0450h
mSysCursorType equ 0460h
mSysVideoPage equ 0462h
mSysCRTC equ 0463h
mSys3x8 equ 0465h
mSys3x9 equ 0466h
mSysRows equ 0484h
mSysPoints equ 0485h
mSysEGAInfo equ 0487h
mSysSwitches equ 0488h
mSysVGAInfo equ 0489h
mSysDCCIndex equ 048Ah
mSysSavePtr equ 04A8h
mSysPrntScrnStat equ 0500h
CR equ 0Dh
LF equ 0Ah
BS equ 08h
;------------------------------------------------------------------------
cseg segment word public 'CODE'
assume cs:cseg
assume ds:cseg
assume es:cseg
org 0100h
public EndTSRCode
Start:
jmp Initialize
db 'VIDUTIL'
ShiftMask label byte
db cShiftMask
HotKey label byte
db cHotKey
;------------------------------------------------------------------------
;
INSACTIVE equ 10000000b
CAPSACTIVE equ 01000000b
NUMACTIVE equ 00100000b
SCRLACTIVE equ 00010000b
ALTACTIVE equ 00001000b
CTRLACTIVE equ 00000100b
LSHFTACTIVE equ 00000010b
RSHFTACTIVE equ 00000001b
cHotKey equ 31h ; 'N'
;37h ; Prnt Scrn on keypad(*) key
cShiftMask equ CTRLACTIVE + ALTACTIVE
; [Ctrl][Alt] key
; b7 - Insert Active
; b6 - Caps Lock Active
; b5 - Num Lock Active
; b4 - Scroll Lock Active
; b3 - Alt key depressed
; b2 - Ctrl key depressed
; b1 - Left shift key depressed
; b0 - Right shift key depressed
BusyFlags db 00h ; Active bit flags
; b0 : video active
OldInt09 dd 0000h ; Keyboard Break vector
;------------------------------------------------------------------------
NewInt09 proc far
sti
push ax
in al,60h ; Get scan code
cmp al,cs:[HotKey]
je Trigger
Int09Exit:
pop ax
jmp dword ptr cs:[OldInt09]
Trigger:
mov ah,2
int 16h
and al,0Fh
cmp al,cs:[ShiftMask] ; Alt key?
jne Int09Exit
test cs:[BusyFlags],00000001b ; Is VIDUTIL active?
jnz Int09Exit
or cs:[BusyFlags],00000001b ; VIDUTIL is active now
pushf
call dword ptr cs:[OldInt09]
push bx
push cx
push dx
push bp
push si
push di
push ds
push es
push cs
pop ds ; DS = CS
xor ax,ax
mov es,ax ; ES = 0
call VideoUtil
and cs:[BusyFlags],11111110b ; VIDUTIL done
pop es
pop ds
pop di
pop si
pop bp
pop dx
pop cx
pop bx
pop ax
iret
NewInt09 endp
;------------------------------------------------------------------------
;------------------------------------------------------------------------
VideoUtil proc near
GetKB1:
xor ah,ah
int 16h ; Check keyboard
cmp ah,1 ; Esc key?
jne NotEsc
jmp VideoUtilDone ; Exit on Esc key
NotEsc:
cmp ah,21h ; Is it F? (Flicker filter)
je FlickerFilter
cmp ah,16h ; Is it U? (Underscan mode)
je Underscan
cmp ah,2Fh ; Is it V? (Video enable)
je VideoBlank
cmp ah,0Bh ; Is it 0? (Center H&V Pan)
je HorzVertPan0
cmp ah,48h ; Is it up arrow?
je DoUpArrow
cmp ah,50h ; Is it dn arrow?
je DoDnArrow
cmp ah,4Bh ; Is it left arrow?
je DoLeftArrow
cmp ah,4Dh ; Is it right arrow?
je DoRightArrow
jmp short GetKB1
DoUpArrow:
jmp UpArrow
DoDnArrow:
jmp DnArrow
DoLeftArrow:
jmp LeftArrow
DoRightArrow:
jmp RightArrow
FlickerFilter:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,02h
and ch,00000001b
xor ch,1
int 10h
jmp short GetKB1
Underscan:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,03h
shr ch,1
and ch,00000001b
xor ch,1
int 10h
jmp short GetKB1
VideoBlank:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,01h
shr ch,1
shr ch,1
and ch,00000001b
xor ch,1
int 10h
jmp GetKB1
HorzVertPan0:
mov ax,7000h
mov bx,0007h
mov cl,04h
mov ch,00h
int 10h
mov ax,7000h
mov bx,0007h
mov cl,05h
mov ch,00h
int 10h
jmp GetKB1
UpArrow:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,05h
mov ch,dl
inc ch
int 10h
jmp GetKB1
DnArrow:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,05h
mov ch,dl
dec ch
int 10h
jmp GetKB1
LeftArrow:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,04h
mov ch,dh
inc ch
int 10h
jmp GetKB1
RightArrow:
mov ax,7000h
mov bx,0007h
mov cl,00h
int 10h ;Get Video Status
mov ax,7000h
mov bx,0007h
mov cl,04h
mov ch,dh
dec ch
int 10h
jmp GetKB1
VideoUtilDone:
ret
VideoUtil endp
;------------------------------------------------------------------------
;------------------------------------------------------------------------
EndTSRCode label byte
;------------------------------------------------------------------------
;------------------------------------------------------------------------
Initialize:
mov dx,offset Copyright
mov ah,9
int 21h ; Display title message
not byte ptr cs:[Start] ; Search for previous VideoUTIL
xor bx,bx
mov ax,cs
NextSeg:
inc bx
cmp ax,bx ; Search up to this segment
mov es,bx
je NotInstalled
mov si,offset Start
mov di,si
mov cx,0Ah
rep cmpsb ; Check for signature string
or cx,cx ; Did they match
jnz NextSeg
mov dx,offset InstalledMesg
jmp short ErrExit
NotInstalled:
mov ah,30h
int 21h ; Check for DOS 2.0 or later
cmp al,2
jae VerOK
mov dx,offset BadDosMesg
ErrExit:
mov ah,9
int 21h
int 20h ; Display error and exit
VerOK:
mov ax,3509h ; Keyboard break vector
int 21h
mov word ptr ds:[OldInt09 ],bx
mov word ptr ds:[OldInt09+2],es ; Save old vector
mov dx,offset NewInt09
mov ax,2509h
int 21h ; Install new handler
push cs
pop ds
mov ax,ds:[002Ch] ; Get environment seg
mov es,ax
mov ah,49h ; Release memory
int 21h
mov dx,offset EndTSRCode
; mov dx,ds:[BuffEnd]
int 27h ; TSR
;------------------------------------------------------------------------
Copyright db 'VIDUTIL v1.0 (c) 1990 Everex Systems, Inc.',CR,LF
db 'Hotkey is [Alt][Ctrl][N]',CR,LF
db 'Courtesy of Gary Lorensen',CR,LF
db CR,LF
db '╓─────────────────────────────────╥──────────────────────────────────────╖',CR,LF
db '║[Up] - Pan Up ║[U] - Underscan mode ║',CR,LF
db '║[Down] - Pan Down ║[V] - Video enable/disable ║',CR,LF
db '║[Left] - Pan Left ║[0] - Center Horz&Vert Pan ║',CR,LF
db '║[Right] - Pan Right ║[ESC] - Exit TSR and return to app ║',CR,LF
db '║[F] - Flicker filter ║ ║',CR,LF
db '╙─────────────────────────────────╨──────────────────────────────────────╜',CR,LF
db '$',1Ah
InstalledMesg db 'VIDUTIL has been previously installed.',CR,LF,'$'
BadDosMesg db 'VIDUTIL requires DOS 2.0 or later.',CR,LF,'$'
;------------------------------------------------------------------------
cseg ends
end Start
;------------------------------------------------------------------------