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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
{
This file is part of the Free Pascal run time library.
Copyright (c) 2006 Karoly Balogh
member of the Free Pascal Development Team
Keyboard/Video/Mouse helper unit for Amiga/MorphOS
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
unit kvm;
interface
uses
exec, intuition, graphics;
function initKVM: boolean;
procedure doneKVM;
implementation
var
kvmWindow: PWindow;
const
DEFAULT_WINWIDTH = 80;
DEFAULT_WINHEIGHT = 25;
const
CHAR_XSIZE = 8;
CHAR_YSIZE = 16;
function initKVM: boolean;
begin
initKVM:=false;
kvmWindow:=OpenWindowTags(nil, [
WA_Left,50,
WA_Top, 50,
WA_InnerWidth, DEFAULT_WINWIDTH *CHAR_XSIZE,
WA_InnerHeight,DEFAULT_WINHEIGHT*CHAR_YSIZE,
WA_IDCMP, IDCMP_VANILLAKEY or IDCMP_RAWKEY,
WA_Title,DWord(PChar('Free Pascal Video Output')),
WA_Flags,(WFLG_GIMMEZEROZERO or
WFLG_SMART_REFRESH or
WFLG_NOCAREREFRESH or
WFLG_ACTIVATE or
WFLG_DRAGBAR or
WFLG_DEPTHGADGET)
]);
if kvmWindow<>nil then initKVM:=true;
end;
procedure doneKVM;
begin
if kvmWindow <> nil then CloseWindow(kvmWindow);
end;
begin
InitGraphicsLibrary;
InitIntuitionLibrary;
end.
|