TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: BARRY BLOCK
from: MERVYN BALDWIN
date: 1997-07-02 03:04:00
subject: Re: fade

From: Mervyn Baldwin 
Subject: Re: fade
>Hello Mervyn,
Hello Barry,
Sorry this has taken so long. I did post what follows but I never saw
it but wasn't worried because, at the time, I never saw anything I
posted. James Vahn tells me he has now fixed this and that, in all 
probability that particular mail didn't appear anyway. Since then have 
been extremely busy so I'll try again. I hope I'll see this one. 
From your mail I think you misunderstood what FADE was supposed to do. 
It did, as the name implies, a slow fade to black. Cutting out the 
delays as you did just made it into a very bad screen-clear.
Maybe not all video cards will do this. Anyway, for anybody who can 
use it, here is A86 source for FADE.COM and FADEUP.COM. 
;-----------------------------------------------------------------
;FADE. From PC magV4#12p296.
;Fades VGA screen. Recover by setting mode.
mov ax,1017h    	;read block colour regs
xor bx,bx	        ;1st. reg to read
mov cx,40h      	;regs to read
mov dx,offset buffer    ;to hold reg values
int 10h
mov cx,40h
L1:
push cx
mov cx,0c0
mov si,offset buffer
L2:
cmp b[si],0
je >L3
dec b[si]
L3:
inc si
loop L2
call L6
mov dx,3dah		;port
L4:
in al,dx
test al,8
jne L4
call L6
mov ax,1012h        	;set block colour regs
xor bx,bx       	;1st. reg to set
mov cx,40h      	;regs to set
mov dx,offset buffer    ;of stored values
int 10h
pop cx
loop L1
L5:
;Barry block suggests:-
;mov ah,1        	;check for keyhit
;int 16h
;jz L5
;mov ax,0c00h        	;clear keyboard buffer
;int 21h
;mov ax,003      	;set mode 3
;int 10h
;This works fine but gets 25x80 mode.
mov ax,4c00h
int 21h
L6:
mov dx,3dah
L7:
in al,dx
test al,8
je L7
ret
buffer:
;-----------------------------------------------------------------
;FADEUP. If screen has been faded out (FADE.8)
; will fade it up again. Faulty. D86, for example
; doesn't display unless MODE has been used.
;Don't understand what is happening at uncommented
; part of source.
;Fadeup is rather fast as it stands.
;This, too, came from Vik Oliver's column in PC Magazine.
MOV AH,3        	;Get cursor position & shape
INT 010
PUSH DX         	;save cursor position
MOV AH,0F       	;get AL=current display mode
INT 010
OR AL,080       	;disable CLS
XOR AH,AH       	;set display mode=AL
INT 010
MOV AX,01017        	;read block colour regs
MOV CX,040      	;#blocks to read (from 0)
MOV DX,offset buffer    ;store results
INT 010
POP DX          	;get cursor position
MOV AH,2        	;set cursor position
INT 010
MOV DI,offset buffer2   ;fill buffer2 with zeros
XOR AL,AL       	;
MOV CX,0C0      	;
REP STOSB       	;
CALL setter
MOV CX,040
L1:
PUSH CX
MOV CX,0C0
MOV SI,offset buffer
L2:
MOV AL,B[SI+0C0]
CMP AL,B[SI]
JAE >L3
INC B[SI+0C0]
L3:
INC SI
LOOP L2
CALL delay
CALL setter
POP CX
LOOP L1
exit:
MOV AX,04C00
INT 021
delay:          	;waits for vertical trace
MOV DX,03DA     	;status reg. RO. CRT controller
L4:
IN AL,DX
TEST AL,8       	;loop until bit3 set then safe
JE L4           	;to access for 1.25ms.
RET
setter:
MOV AX,01012        	;set block of colour regs
XOR BX,BX       	;from reg 0
MOV CX,040      	;64 regs
MOV DX,offset buffer2   ;store them here
INT 010
RET
buffer: db 0c0h dup(?)
buffer2:
;-----------------------------------------------------------------
I liked your idea of hitting a key to get the fadeup. The two together 
with the keyhit between make a fun CLS.
-- 
vyn@abaldwin.demon.co.uk
-!-
---
---------------
* Origin: (1:346/100)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.