Курсовая работа в институте.
{ $A+,B+,D+,E-,F-,G+,I+,L+,N+,O-,P-,Q-,R-,S+,T-,V+,X+,Y+ }
{ $M 16384, 0, 60000 }
Program Airport_Administrator;
Uses
Crt, Graph, Dos, Globals, General, Menus, AirLib;
Function GetHighestCap( Table : Pointer; Modes : Word;
Size : Integer ) : Integer;
near; assembler;
asm
XOR AX,AX
LES DI, Table
@@1:
MOV SI, Modes
ADD SI, Size
ADD SI, Size
MOV BX, ES:[DI]
CMP BX, 0FFFFH
JE @@4
INC DI
INC DI
MOV CX,Size
@@2:
CMP BX,[SI]
JZ @@3
DEC SI
DEC SI
LOOP @@2
@@3:
CMP AX,CX
JA @@1
MOV AX,CX
JMP @@1
@@4:
end;
Function DetectVesa16 : Integer; far; assembler;
Var
VesaInfo : array [ 0..255 ] of Byte;
asm
MOV AX,SS
MOV ES,AX
LEA DI,VesaInfo
MOV AX,4F00H
INT 10H
CMP AX,004FH
MOV AX,grError
JNZ @@Exit
CMP ES:[DI].VgaInfoBlock.VESASignature.Word[0], 'EV'
JNZ @@Exit
CMP ES:[DI].VgaInfoBlock.VESASignature.Word[2], 'AS'
JNZ @@Exit
LES DI,ES:[DI].VgaInfoBlock.VideoModePtr
PUSH ES
PUSH DI
MOV AX, OFFSET Vesa16Modes
PUSH AX
MOV AX,3
PUSH AX
CALL GetHighestCap
@@Exit:
end;
Procedure SVGAinitialize;
Var
PathToDriver : String; { Stores the DOS path to *.BGI & *.CHR }
begin
PathToDriver := '';
VESA16 := InstallUserDriver( 'VESA', @DetectVesa16 );
GD := IBM8514;
GM := IBM8514Hi;
GD := Detect; { Use autodetection }
InitGraph( GD, GM, PathToDriver );
end;
{- Main ---------------------------------------------------------------------}
Begin
ReadData; { Init database }
SVGAinitialize; { Init graphics mode }
SetGraphMode( 3 ); { Set graphics mode 800x600 pixels, 8 bit color }
CreateWindow( 1, 1, GetMaxX, GetMaxY, 'Airport Administrator' );
InitHorizontalGraphMenu( 10, 30, MENU_ITEM_LIST_MainMenu,
MENU_MAXITEMS_MainMenu );
Area( 6, 26, 136, 24, '' );
BarDeluxe( 5, 55, GetMaxX - 8, GetMaxY - 60, 1, 23 );
repeat
case HorizontalGraphMenu( 10, 30, MENU_ITEM_LIST_MainMenu,
MENU_MAXITEMS_MainMenu ) of
{ File }
0 : case VerticalGraphMenu( 10 + HorizMenuJumper *
BarTextLength[ HorizMenuJumper ],
50, MENU_ITEM_LIST_File,
MENU_MAXITEMS_File ) of
1 : ClearADB;
2 : Quit;
end;
{ Edit }
1 : Operations;
{ Find }
2 : FindRecord;
{ Help }
3 : case VerticalGraphMenu( 10 + HorizMenuJumper *
BarTextLength[ HorizMenuJumper ],
50, MENU_ITEM_LIST_Help,
MENU_MAXITEMS_Help ) of
1 : Help;
2 : About;
end;
end; { case 'HorizontalGraphMenu' }
until False;
End. { of file 'airadmin.pas' }