-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelp.pas
74 lines (53 loc) · 2.72 KB
/
Help.pas
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
(*
Copyright (C) 2024 Jeffrey Getzin.
Licensed under the GNU General Public License v3.0 with additional terms.
See the LICENSE file in the repository root for details.
*)
[Inherit ('Types','SYS$LIBRARY:STARLET','LIBRTL','SMGRTL')]Module Help;
{ This module enables the on-line help function, which can be received by typing the HELP key when in Stonequest }
Var
HelpDisplay,Pasteboard: [External]Unsigned;
Authorized: [External]Boolean;
(******************************************************************************)
[External]Procedure Cursor;External;
[External]Procedure No_Cursor;External;
[Asynchronous,External]Function Oh_No (Var SA: Array [$u1..$u2:Integer] of Integer; Var MA: Array [$u3..$u4:Integer] of [Unsafe]Integer):[Unsafe]Integer;external;
[Asynchronous,Unbound,External]Function LBR$OUTPUT_HELP (
%Ref Output_Routine: Unsigned;
%Ref Output_Width: Unsigned:=%Immed 0;
%StDescr Line_Desc: Packed Array [$l1..$u1:integer] of char:=%immed 0;
%StDescr Library_Name: Packed Array [$l2..$u2:integer] of char:=%immed 0;
%Ref Flags: Unsigned:=%Immed 0;
%Ref Input_Routine: Unsigned:=%Immed 0)
: Integer;External;
[Asynchronous,External]Function Lib$Put_Output (%StDescr output: Packed Array [$l3..$u3:Integer] of char)
: Unsigned;External;
[Asynchronous,External]Function Lib$Get_Input (%StDescr output: Packed Array [$l4..$u4:Integer] of char)
: Unsigned;External;
(******************************************************************************)
[Global]Procedure Help;
{ This procedure calls the HELP routine, LBR$OUTPUT_HELP to print out Stonequest's help. Note: the output from LBR$OUTPUT_HELP is
not sent to the SMG$ pasteboard, so SMG$ does not know it's there. Therefore, a SMG$REPAINT_SCREEN is called to wipe off the non-
SMG$ output }
Const
Flag = HLP$M_PROMPT + HLP$M_HELP;
Var
Width: Unsigned;
FileTxt,HelpTxt: Line;
Begin { Help }
SMG$Erase_Display (HelpDisplay);
SMG$Paste_Virtual_Display (HelpDisplay,Pasteboard,1,1);
Width:=80;
FileTxt:='STONEQUEST.HLB';
HelpTxt:=' ';
{ If Not Authorized then } Revert; { Turn off Moria's condition handler }
Cursor;
{ Run LBR$OUTPUT_HELP }
LBR$OUTPUT_HELP (%Immed LIB$Put_Output,Width,HelpTxt+'',FileTxt+'',Flags:=Flag,Input_Routine:=%Immed LIB$GET_INPUT);
No_Cursor;
{ If Not Authorized then } { Establish (Oh_No); } { Turn Moria's condition handler back on }
{ Unpaste the screen, and get rid of the non-SMG$ garbage printed by LBR$OUTOUT_HELP }
SMG$Unpaste_Virtual_Display (HelpDisplay,Pasteboard);
SMG$Repaint_Screen (Pasteboard);
End; { Help }
End. { Help }