{
Hello!

This program is a demonstration for the use of the VESA Display Power
Management System (DPMS). The program will shut down your display
until press any key, then restore the display again.

Requirements:
* a VESA video card with DPMS capatibilities.
  (The program will check if DPMS functions can be used in your card).
* A VESA DPMS (Or Energy Star) compliant monitor.
* Turbo/Borland Pascal 7 (Works in real and Protected mode)

Note: You can run this program under Windows, but... Please, don't try
to minimize this program while the power state is OFF!
(Don't try press ALT-ENTER)

It's recommended you to enable the "Windows Critical Flag" in your program
BEFORE state the power display in OFF, then disable it
when the display is restored.

******************************************************************************

Remember: This program is distributed AS-IS and it's freeware.
Use it at your own risk.

Send me your comments or questions to the following e-mail adress:

nrs1022@topmail.com.ar


Nicolas Rozas Salgado
Mar del Plata - Argentina
June 21, 2001
}

Uses Dos;
Const
Mode_On = 0;
Mode_Standby = 1;
Mode_Suspend = 2;
Mode_Off = 4;
Var Regs: Registers;

Procedure SetDisplayMode(Mode: Byte);
Begin
Regs.Ax:= $4f10;
Regs.Bl:= 1;
Regs.Bh:= Mode;
Regs.Es:= 0;
Regs.Di:= 0;
Intr($10,Regs);
End;

Procedure My_ReadKey; Assembler;
Asm
Xor Ax,Ax
Int 16h
End;

Var SelectMode: Byte;
Begin
WriteLn('VESA DPMS demonstration program');
WriteLn('Designed by Nicolas Rozas Salgado (nrs1022@topmail.com.ar)');
WriteLn;
SelectMode:= Mode_Off; {You can select the mode here}
Regs.Ax:= $4f10;
Regs.Bl:= 0;
Regs.Es:= 0;
Regs.Di:= 0;
Intr($10,regs);
If Regs.Al <> $4F Then
 Begin
 WriteLn('Error: This program requires a VESA DPMS video card or compatible.');
 Halt;
 End;
WriteLn('The display will shut down now. Press any key to continue.');
WriteLn('Press any key again to restore the display...');
My_ReadKey;
SetDisplayMode(SelectMode);
My_ReadKey;
SetDisplayMode(Mode_On);
My_ReadKey;
End.

{
INT 10 - VESA VBE/PM (Power Management) v1.0+ - SET DISPLAY POWER STATE
	AX = 4F10h
	BL = 01h
	BH = new state (see #0089)
Return: AL = 4Fh if function supported
	AH = call status
	    00h successful
	    else failed
SeeAlso: AX=4F10h/BL=00h,AX=4F10h/BL=02h,AX=A00Ch

(Table 0089)
Values for VESA VBE/PM power state:
 00h	On
 01h	standby
 02h	suspend
 04h	Off
 08h	reduced On (for flat screens)
--------p-104F10BL02-------------------------
INT 10 - VESA VBE/PM (Power Management) v1.0+ - GET DISPLAY POWER STATE
	AX = 4F10h
	BL = 02h
Return: AL = 4Fh if function supported
	AH = call status
	    00h successful
	       BH = current power state (see #0089)
	    else failed
SeeAlso: AX=4F10h/BL=00h,AX=4F10h/BL=01h,AX=A00Dh
}