[comp.sys.ibm.pc] Disabling Screen Display

ayac071@ut-ngp.UUCP (William T. Douglass) (09/11/87)

I'm trying to disable the video display during a screen update, write to
the screen buffer, then enable the display.  Problem is, the code I've
written seems to always disable screen (end up w/ a blank screen until
the program exits.)

The system is an IBM AT, CGA and standard Color display (all True Blue.)
The language is Turbo Pascal, Ver. 3.01.  Obviously, there are other means
to update the screen w/out snowfights, but speed is essential here, so I'm
wanting to do non-delaying screen writes while the display is disabled.

Here is the screen disable/enable routine:

(*============================ cut here ========================*)

procedure screenon(flag: boolean);

var
    i: byte;

begin
    (********************************************************************)
    (*****  If flag is true, insure that video display is enabled.  *****)
    (*****  Else, turn display off (bit 3 in port 3D8h).            *****)
    (********************************************************************)
    i := port[$3D8];
    if flag
         then i := (i or $08)
         else i := (i and $F7);
    port[$3D8] := i;

end;  (** proc screenon **)

(*=========================== cut here =============================*)

The intention is to disable the screen by calling ScreenOn(False), doing
the update, then calling ScreenOn(True).  I would appreciate any feed-back
on what I am missing, doing wrong, etc.

Thanks,
	Bill Douglass
	ayac071@ngp.UUCP