1 | unit FormScreen;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Screen,
|
---|
7 | Channel, Device;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TFormScreen }
|
---|
12 |
|
---|
13 | TFormScreen = class(TFormDevice)
|
---|
14 | Image1: TImage;
|
---|
15 | TimerDraw: TTimer;
|
---|
16 | procedure TimerDrawTimer(Sender: TObject);
|
---|
17 | private
|
---|
18 | DrawPending: Boolean;
|
---|
19 | public
|
---|
20 | Screen: TScreen;
|
---|
21 | procedure ScreenChange(Sender: TObject);
|
---|
22 | end;
|
---|
23 |
|
---|
24 |
|
---|
25 | implementation
|
---|
26 |
|
---|
27 | {$R *.lfm}
|
---|
28 |
|
---|
29 | { TFormScreen }
|
---|
30 |
|
---|
31 | procedure TFormScreen.TimerDrawTimer(Sender: TObject);
|
---|
32 | var
|
---|
33 | X, Y: Integer;
|
---|
34 | const
|
---|
35 | CharSize = 16;
|
---|
36 | begin
|
---|
37 | if DrawPending then begin
|
---|
38 | DrawPending := False;
|
---|
39 | if Screen.BitWidth = bw8 then
|
---|
40 | with Screen.Screen8 do begin
|
---|
41 | Image1.Picture.Bitmap.SetSize(Width * CharSize, Height * CharSize);
|
---|
42 | Image1.Picture.Bitmap.Canvas.FillRect(0, 0, Image1.Picture.Bitmap.Width,
|
---|
43 | Image1.Picture.Bitmap.Height);
|
---|
44 | for Y := 0 to Height - 1 do
|
---|
45 | for X := 0 to Width - 1 do
|
---|
46 | Image1.Picture.Bitmap.Canvas.TextOut(X * CharSize, Y * CharSize,
|
---|
47 | Chr(Memory.Read8(Y * Width + X)));
|
---|
48 | end else
|
---|
49 | if Screen.BitWidth = bw16 then
|
---|
50 | with Screen.Screen16 do begin
|
---|
51 | Image1.Picture.Bitmap.SetSize(Width * CharSize, Height * CharSize);
|
---|
52 | Image1.Picture.Bitmap.Canvas.FillRect(0, 0, Image1.Picture.Bitmap.Width,
|
---|
53 | Image1.Picture.Bitmap.Height);
|
---|
54 | for Y := 0 to Height - 1 do
|
---|
55 | for X := 0 to Width - 1 do
|
---|
56 | Image1.Picture.Bitmap.Canvas.TextOut(X * CharSize, Y * CharSize,
|
---|
57 | Chr(Memory.Read8(Y * Width + X)));
|
---|
58 | end;
|
---|
59 | end;
|
---|
60 | end;
|
---|
61 |
|
---|
62 | procedure TFormScreen.ScreenChange(Sender: TObject);
|
---|
63 | begin
|
---|
64 | DrawPending := True;
|
---|
65 | end;
|
---|
66 |
|
---|
67 | end.
|
---|
68 |
|
---|