home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
JUIN
/
FADEOUT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
2KB
|
83 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 312 of 360
From : Stephen Cheok 1:153/255.0 01 Jun 93 18:35
To : Liam Stitt 201:5500/551.0
Subj : FADE IN?
────────────────────────────────────────────────────────────────────────────────
LS> Could you post the fade out source?
Hi Liam! Uhm, here is what I have..try it and see if it works!}
PROCEDURE DimDisplay(delayfactor : INTEGER); ASSEMBLER ;
{ Total time to fade out in seconds =
((DelayFactor+1)*MaxIntensity) / 1000 }
CONST
MaxIntensity = 45 ;
{MaxIntensity = 63;}
VAR
DACTable : Array[0..255] OF RECORD
R, G, B : BYTE;
END ;
ASM
PUSH DS
MOV AX, SS
MOV ES, AX
MOV DS, AX
{ Store colour information into DACTable }
LEA DX, DACTable
MOV CX, 256
XOR BX, BX
MOV AX, 1017h
INT 10h
MOV BX, MaxIntensity
{ VGA port 3C8h: PEL address register, (colour index,
increments automatically after every third write)
VGA port 3C9h: PEL write register (R, G, B) }
CLD
@1: LEA SI, DACTable
MOV DI, SI
MOV CX, 3*256
XOR AX, AX
MOV DX, 3C8h
OUT DX, AL
INC DX
{ Get colour value, decrement it and update the table }
@2: LODSB
OR AX, AX
JZ @3
DEC AX
@3: STOSB
OUT DX, AL
LOOP @2
{ Delay before next decrement of R, G, B values }
PUSH ES
PUSH BX
MOV AX, DelayFactor
PUSH AX
CALL Delay
POP BX
POP ES
DEC BX
OR BX, BX
JNZ @1
POP DS
END ; { DimDisplay }
It is done in assembler so if you don't know a bit in assembly... then your out
of luck =8)