with Allegro_Ids; use Allegro_Ids;
with Interfaces; use Interfaces;
with System; use System;
package Allegro is
pragma Elaborate_Body;
type A_Close_Button_Procedure is
access procedure;
type A_Integer is access all Integer;
type CPU_Family_Type is private;
type CPU_Model_Type is private;
subtype CPU_Capabilities_Type is Unsigned_32;
type OS_Type_Type is private;
CPU_ID : constant CPU_Capabilities_Type;
CPU_FPU : constant CPU_Capabilities_Type;
CPU_MMX : constant CPU_Capabilities_Type;
CPU_MMXPLUS : constant CPU_Capabilities_Type;
CPU_SSE : constant CPU_Capabilities_Type;
CPU_SSE2 : constant CPU_Capabilities_Type;
CPU_3DNOW : constant CPU_Capabilities_Type;
CPU_ENH3DNOW : constant CPU_Capabilities_Type;
CPU_CMOV : constant CPU_Capabilities_Type;
CPU_AMD64 : constant CPU_Capabilities_Type;
CPU_IA64 : constant CPU_Capabilities_Type;
CPU_SSE3 : constant CPU_Capabilities_Type;
CPU_FAMILY_UNKNOWN : constant CPU_Family_Type;
CPU_FAMILY_I386 : constant CPU_Family_Type;
CPU_FAMILY_I486 : constant CPU_Family_Type;
CPU_FAMILY_I586 : constant CPU_Family_Type;
CPU_FAMILY_I686 : constant CPU_Family_Type;
CPU_FAMILY_ITANIUM : constant CPU_Family_Type;
CPU_FAMILY_EXTENDED : constant CPU_Family_Type;
CPU_MODEL_I486DX : constant CPU_Model_Type;
CPU_MODEL_I486DX50 : constant CPU_Model_Type;
CPU_MODEL_I486SX : constant CPU_Model_Type;
CPU_MODEL_I487SX : constant CPU_Model_Type;
CPU_MODEL_I486SL : constant CPU_Model_Type;
CPU_MODEL_I486SX2 : constant CPU_Model_Type;
CPU_MODEL_I486DX2 : constant CPU_Model_Type;
CPU_MODEL_I486DX4 : constant CPU_Model_Type;
CPU_MODEL_PENTIUM : constant CPU_Model_Type;
CPU_MODEL_PENTIUMP54C : constant CPU_Model_Type;
CPU_MODEL_PENTIUMOVERDRIVE : constant CPU_Model_Type;
CPU_MODEL_PENTIUMOVERDRIVEDX4 : constant CPU_Model_Type;
CPU_MODEL_CYRIX : constant CPU_Model_Type;
CPU_MODEL_UNKNOWN : constant CPU_Model_Type;
CPU_MODEL_K5 : constant CPU_Model_Type;
CPU_MODEL_K6 : constant CPU_Model_Type;
CPU_MODEL_PENTIUMPROA : constant CPU_Model_Type;
CPU_MODEL_PENTIUMPRO : constant CPU_Model_Type;
CPU_MODEL_PENTIUMIIKLAMATH : constant CPU_Model_Type;
CPU_MODEL_PENTIUMII : constant CPU_Model_Type;
CPU_MODEL_CELERON : constant CPU_Model_Type;
CPU_MODEL_PENTIUMIIIKATMAI : constant CPU_Model_Type;
CPU_MODEL_PENTIUMIIICOPPERMINE : constant CPU_Model_Type;
CPU_MODEL_PENTIUMIIIMOBILE : constant CPU_Model_Type;
CPU_MODEL_ATHLON : constant CPU_Model_Type;
CPU_MODEL_DURON : constant CPU_Model_Type;
CPU_MODEL_PENTIUMIV : constant CPU_Model_Type;
CPU_MODEL_XEON : constant CPU_Model_Type;
CPU_MODEL_ATHLON64 : constant CPU_Model_Type;
CPU_MODEL_OPTERON : constant CPU_Model_Type;
OSTYPE_UNKNOWN : constant OS_Type_Type;
OSTYPE_WIN3 : constant OS_Type_Type;
OSTYPE_WIN95 : constant OS_Type_Type;
OSTYPE_WIN98 : constant OS_Type_Type;
OSTYPE_WINME : constant OS_Type_Type;
OSTYPE_WINNT : constant OS_Type_Type;
OSTYPE_WIN2000 : constant OS_Type_Type;
OSTYPE_WINXP : constant OS_Type_Type;
OSTYPE_WIN2003 : constant OS_Type_Type;
OSTYPE_WINVISTA : constant OS_Type_Type;
OSTYPE_OS2 : constant OS_Type_Type;
OSTYPE_WARP : constant OS_Type_Type;
OSTYPE_DOSEMU : constant OS_Type_Type;
OSTYPE_OPENDOS : constant OS_Type_Type;
OSTYPE_LINUX : constant OS_Type_Type;
OSTYPE_SUNOS : constant OS_Type_Type;
OSTYPE_FREEBSD : constant OS_Type_Type;
OSTYPE_NETBSD : constant OS_Type_Type;
OSTYPE_OPENBSD : constant OS_Type_Type;
OSTYPE_IRIX : constant OS_Type_Type;
OSTYPE_DARWIN : constant OS_Type_Type;
OSTYPE_QNX : constant OS_Type_Type;
OSTYPE_UNIX : constant OS_Type_Type;
OSTYPE_BEOS : constant OS_Type_Type;
OSTYPE_MACOS : constant OS_Type_Type;
OSTYPE_MACOSX : constant OS_Type_Type;
procedure Allegro_Date( day, month, year : out Positive );
procedure Allegro_Exit;
function Allegro_Error return String;
function Allegro_Id return String;
function Allegro_Initialize return Integer;
function Allegro_Initialize_Cmdline return Integer;
procedure Allegro_Message( message : String );
procedure Allegro_Version( major, minor, wip : out Integer );
procedure Check_CPU;
function CPU_Capabilities return CPU_Capabilities_Type;
function CPU_Family return CPU_Family_Type;
function CPU_Model return CPU_Model_Type;
function CPU_Vendor return String;
function Desktop_Color_Depth return Natural;
procedure Desktop_Resolution( width,
height : out Natural;
success : out Boolean );
function Install_Allegro( system_id : Integer;
errno_ptr : Address;
atexit_ptr : Address ) return Integer;
function Is_OS_Multitasking return Boolean;
function OS_Type return OS_Type_Type;
function OS_Version return Integer;
function OS_Revision return Integer;
function Set_Close_Button_Callback( handle : A_Close_Button_Procedure ) return Integer;
procedure Set_Window_Title( name : String );
function To_String( capabilities : CPU_Capabilities_Type ) return String;
function To_String( family : CPU_Family_Type ) return String;
function To_String( family : CPU_Family_Type;
model : CPU_Model_Type ) return String;
function To_String( os : OS_Type_Type ) return String;
private
type CPU_Family_Type is new Unsigned_32;
type CPU_Model_Type is new Unsigned_32;
type OS_Type_Type is new AL_ID;
CPU_ID : constant CPU_Capabilities_Type := 16#0001#;
CPU_FPU : constant CPU_Capabilities_Type := 16#0002#;
CPU_MMX : constant CPU_Capabilities_Type := 16#0004#;
CPU_MMXPLUS : constant CPU_Capabilities_Type := 16#0008#;
CPU_SSE : constant CPU_Capabilities_Type := 16#0010#;
CPU_SSE2 : constant CPU_Capabilities_Type := 16#0020#;
CPU_3DNOW : constant CPU_Capabilities_Type := 16#0040#;
CPU_ENH3DNOW : constant CPU_Capabilities_Type := 16#0080#;
CPU_CMOV : constant CPU_Capabilities_Type := 16#0100#;
CPU_AMD64 : constant CPU_Capabilities_Type := 16#0200#;
CPU_IA64 : constant CPU_Capabilities_Type := 16#0400#;
CPU_SSE3 : constant CPU_Capabilities_Type := 16#0800#;
CPU_FAMILY_UNKNOWN : constant CPU_Family_Type := 0;
CPU_FAMILY_I386 : constant CPU_Family_Type := 3;
CPU_FAMILY_I486 : constant CPU_Family_Type := 4;
CPU_FAMILY_I586 : constant CPU_Family_Type := 5;
CPU_FAMILY_I686 : constant CPU_Family_Type := 6;
CPU_FAMILY_ITANIUM : constant CPU_Family_Type := 7;
CPU_FAMILY_EXTENDED : constant CPU_Family_Type := 15;
CPU_MODEL_I486DX : constant CPU_Model_Type := 0;
CPU_MODEL_I486DX50 : constant CPU_Model_Type := 1;
CPU_MODEL_I486SX : constant CPU_Model_Type := 2;
CPU_MODEL_I487SX : constant CPU_Model_Type := 3;
CPU_MODEL_I486SL : constant CPU_Model_Type := 4;
CPU_MODEL_I486SX2 : constant CPU_Model_Type := 5;
CPU_MODEL_I486DX2 : constant CPU_Model_Type := 7;
CPU_MODEL_I486DX4 : constant CPU_Model_Type := 8;
CPU_MODEL_PENTIUM : constant CPU_Model_Type := 1;
CPU_MODEL_PENTIUMP54C : constant CPU_Model_Type := 2;
CPU_MODEL_PENTIUMOVERDRIVE : constant CPU_Model_Type := 3;
CPU_MODEL_PENTIUMOVERDRIVEDX4 : constant CPU_Model_Type := 4;
CPU_MODEL_CYRIX : constant CPU_Model_Type := 14;
CPU_MODEL_UNKNOWN : constant CPU_Model_Type := 15;
CPU_MODEL_K5 : constant CPU_Model_Type := 0;
CPU_MODEL_K6 : constant CPU_Model_Type := 6;
CPU_MODEL_PENTIUMPROA : constant CPU_Model_Type := 0;
CPU_MODEL_PENTIUMPRO : constant CPU_Model_Type := 1;
CPU_MODEL_PENTIUMIIKLAMATH : constant CPU_Model_Type := 3;
CPU_MODEL_PENTIUMII : constant CPU_Model_Type := 5;
CPU_MODEL_CELERON : constant CPU_Model_Type := 6;
CPU_MODEL_PENTIUMIIIKATMAI : constant CPU_Model_Type := 7;
CPU_MODEL_PENTIUMIIICOPPERMINE : constant CPU_Model_Type := 8;
CPU_MODEL_PENTIUMIIIMOBILE : constant CPU_Model_Type := 9;
CPU_MODEL_ATHLON : constant CPU_Model_Type := 2;
CPU_MODEL_DURON : constant CPU_Model_Type := 3;
CPU_MODEL_PENTIUMIV : constant CPU_Model_Type := 0;
CPU_MODEL_XEON : constant CPU_Model_Type := 2;
CPU_MODEL_ATHLON64 : constant CPU_Model_Type := 4;
CPU_MODEL_OPTERON : constant CPU_Model_Type := 5;
OSTYPE_UNKNOWN : constant OS_Type_Type := OS_Type_Type(AL_ID_NONE);
OSTYPE_WIN3 : constant OS_Type_Type := To_AL_ID('W','I','N','3');
OSTYPE_WIN95 : constant OS_Type_Type := To_AL_ID('W','9','5',' ');
OSTYPE_WIN98 : constant OS_Type_Type := To_AL_ID('W','9','8',' ');
OSTYPE_WINME : constant OS_Type_Type := To_AL_ID('W','M','E',' ');
OSTYPE_WINNT : constant OS_Type_Type := To_AL_ID('W','N','T',' ');
OSTYPE_WIN2000 : constant OS_Type_Type := To_AL_ID('W','2','K',' ');
OSTYPE_WINXP : constant OS_Type_Type := To_AL_ID('W','X','P',' ');
OSTYPE_WIN2003 : constant OS_Type_Type := To_AL_ID('W','2','K','3');
OSTYPE_WINVISTA : constant OS_Type_Type := To_AL_ID('W','V','S','T');
OSTYPE_OS2 : constant OS_Type_Type := To_AL_ID('O','S','2',' ');
OSTYPE_WARP : constant OS_Type_Type := To_AL_ID('W','A','R','P');
OSTYPE_DOSEMU : constant OS_Type_Type := To_AL_ID('D','E','M','U');
OSTYPE_OPENDOS : constant OS_Type_Type := To_AL_ID('O','D','O','S');
OSTYPE_LINUX : constant OS_Type_Type := To_AL_ID('T','U','X',' ');
OSTYPE_SUNOS : constant OS_Type_Type := To_AL_ID('S','U','N',' ');
OSTYPE_FREEBSD : constant OS_Type_Type := To_AL_ID('F','B','S','D');
OSTYPE_NETBSD : constant OS_Type_Type := To_AL_ID('N','B','S','D');
OSTYPE_OPENBSD : constant OS_Type_Type := To_AL_ID('O','B','S','D');
OSTYPE_IRIX : constant OS_Type_Type := To_AL_ID('I','R','I','X');
OSTYPE_DARWIN : constant OS_Type_Type := To_AL_ID('D','A','R','W');
OSTYPE_QNX : constant OS_Type_Type := To_AL_ID('Q','N','X',' ');
OSTYPE_UNIX : constant OS_Type_Type := To_AL_ID('U','N','I','X');
OSTYPE_BEOS : constant OS_Type_Type := To_AL_ID('B','E','O','S');
OSTYPE_MACOS : constant OS_Type_Type := To_AL_ID('M','A','C',' ');
OSTYPE_MACOSX : constant OS_Type_Type := To_AL_ID('M','A','C','X');
pragma Convention( C, A_Close_Button_Procedure );
pragma Import( C, Allegro_Initialize, "allegro_initialize" );
pragma Import( C, Allegro_Initialize_Cmdline, "allegro_initialize_cmdline" );
pragma Import( C, Allegro_Exit, "allegro_exit" );
pragma Import( C, Check_CPU, "check_cpu" );
pragma Import( C, CPU_Capabilities, "get_cpu_capabilities" );
pragma Import( C, CPU_Family, "get_cpu_family" );
pragma Import( C, CPU_Model, "get_cpu_model" );
pragma Import( C, Desktop_Color_Depth, "desktop_color_depth" );
pragma Import( C, Install_Allegro, "install_allegro" );
pragma Import( C, OS_Revision, "get_os_revision" );
pragma Import( C, OS_Type, "get_os_type" );
pragma Import( C, OS_Version, "get_os_version" );
pragma Import( C, Set_Close_Button_Callback, "set_close_button_callback" );
end Allegro;