File: testvid1.pas

package info (click to toggle)
fpc 0.99.13-19991013-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 23,104 kB
  • ctags: 9,760
  • sloc: pascal: 253,711; ansic: 5,236; makefile: 3,855; yacc: 2,016; lex: 707; asm: 526; xml: 443; sh: 200; perl: 87; sed: 21; csh: 12; cpp: 1
file content (43 lines) | stat: -rw-r--r-- 923 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
uses
  Video, Keyboard;

procedure FillScreen(W: Word);
var
  I: Integer;
  P: PVideoCell;
  Mode: TVideoMode;
begin
  GetVideoMode(Mode);
  P := PVideoCell(VideoBuf);
  for I := 0 to Mode.Row * Mode.Col do begin
    P^ := W;
    Inc(P);
  end;
  UpdateScreen(True);
end;

var
  Mode: TVideoMode;

begin
  { Video automatically determines the dimensions, so you may want to
    add "magic" numbers here to identify a given video mode }
  {$IFDEF FPC}
    RegisterVideoMode($FF, $FF, True, @DefaultVideoModeSelector, $01094F02);
  {$ELSE}
    RegisterVideoMode($FF, $FF, True, DefaultVideoModeSelector, $01094F02);
  {$ENDIF}
  InitVideo;
  FillScreen($1FB0);
  readln;

  Mode.Col := $FF; Mode.Row := $FF; Mode.Color := True;
  SetVideoMode(Mode);
  FillScreen($1FB0);
  WriteLn('ScreenWidth = ', ScreenWidth);
  WriteLn('ScreenHeight = ', ScreenHeight);
  readln;
  Mode.Row := 25;
  SetVideoMode(Mode);
  DoneVideo;
end.