2
{$IFDEF DYNAMIC_VERSION}
14
OrgMode : VioModeInfo;
22
VioMode_640x480x16 : VioModeInfo =
23
( cb: SizeOf(VioModeInfo);
24
fbType: vgmt_Other + vgmt_Graphics;
32
VioMode_320x200x256 : VioModeInfo =
33
( cb: SizeOf(VioModeInfo);
34
fbType: vgmt_Other + vgmt_Graphics;
47
{ Restores screen to the original state }
49
function Driver_Restore_Mode: boolean;
51
VioSetMode(OrgMode, 0);
52
Driver_Restore_Mode := True;
55
function Driver_Set_Graphics( mode : Int )
60
Driver_Set_Graphics := False;
62
{ Save original video mode }
63
OrgMode.cb := SizeOf(VioModeInfo);
64
VioGetMode(OrgMode, 0);
68
Graphics_Mode_Mono : begin
69
rc := VioSetMode( VioMode_640x480x16, 0 );
70
Vio_ScanLineWidth := 80;
75
Graphics_Mode_Gray : begin
76
rc := VioSetMode( VioMode_320x200x256, 0 );
77
Vio_ScanLineWidth := 320;
81
(* default gray palette takes the gray levels *)
82
(* the standard VGA 256 colors mode *)
85
gray_palette[1] := 23;
86
gray_palette[2] := 27;
87
gray_palette[3] := 29;
88
gray_palette[4] := 31;
98
{ Get selector for physical video buffer }
99
if VioGetPhysBuf(VioBuf, 0) <> 0 then exit;
101
{ Make flat pointer that points to the physical video buffer}
102
Ptr16Rec(VioBufOfs).Ofs := 0;
103
Ptr16Rec(VioBufOfs).Sel := VioBuf.Sel;
104
SelToFlat(Pointer(VioBufOfs));
106
{ Clear the screen. Unlike function 0 of the BIOS INT 10h }
107
{ VioSetMode doesn't clear the screen. }
108
FillChar(Pointer(VioBufOfs)^,64*1024,0);
109
Vio := PVioScreenBuffer(VioBufOfs);
111
Driver_Set_Graphics := True;
115
procedure Driver_Display_Bitmap; assembler;
124
mov ecx,[Vio_ScanLineWidth]
135
add ebx,[Vio_ScanLineWidth]