~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/extra/amunits/otherlibs/picasso/examples/p96checkboards.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Program P96CheckBoards;
2
 
 
3
 
{***********************************************************************
4
 
* This is example shows how to use p96GetRTGDataTagList and p96GetBoardDataTagList
5
 
*
6
 
* tabt (Sat Sep 12 23:06:28 1998)
7
 
***********************************************************************}
8
 
 
9
 
{
10
 
    Translated to fpc pascal.
11
 
    15 Mars 2001.
12
 
 
13
 
    Updated for fpc 1.0.7
14
 
    08 Jan 2003.
15
 
 
16
 
    nils.sjoholm@mailbox.swipnet.se
17
 
}
18
 
 
19
 
 
20
 
uses exec, amigados, graphics, picasso96api,utility,amigalib;
21
 
 
22
 
var
23
 
   NumBoards : Longint;
24
 
   i, clock  : Longint;
25
 
   tmp       : Longint;
26
 
   RGBFormats,
27
 
   MemorySize,
28
 
   FreeMemory,
29
 
   LargestFreeMemory,
30
 
   MemoryClock,
31
 
   MoniSwitch  : Longint;
32
 
   BoardName   : Pchar;
33
 
   boardtmp    : array[0..200] of char;
34
 
 
35
 
FUNCTION GetMonitorValue(value : longint): STRING;
36
 
BEGIN
37
 
    IF value = 0 THEN GetMonitorValue := 'not set'
38
 
    ELSE GetMonitorValue := 'set';
39
 
END;
40
 
 
41
 
begin
42
 
   BoardName := @boardtmp;
43
 
 
44
 
   tmp := p96GetRTGDataTags([P96RD_NumberOfBoards, @NumBoards, TAG_END]);
45
 
 
46
 
   writeln('Looking through all boards installed for Picasso96');
47
 
 
48
 
   for i := 0 to NumBoards-1 do begin
49
 
       p96GetBoardDataTags(i,[P96BD_BoardName, @BoardName,
50
 
                              P96BD_RGBFormats, @RGBFormats,
51
 
                              P96BD_TotalMemory, @MemorySize,
52
 
                              P96BD_FreeMemory, @FreeMemory,
53
 
                              P96BD_LargestFreeMemory, @LargestFreeMemory,
54
 
                              P96BD_MemoryClock, @MemoryClock,
55
 
                              P96BD_MonitorSwitch, @MoniSwitch,
56
 
                              TAG_END]);
57
 
 
58
 
      writeln('--------------------------------------------------');
59
 
      printf('Board %ld:      %s'#10,[ i, BoardName]);
60
 
      printf('Total size of memory:     %8ld'#10,[ MemorySize]);
61
 
      printf('Size of free memory:      %8ld'#10,[ FreeMemory]);
62
 
      printf('Largest free chunk:       %8ld'#10,[ LargestFreeMemory]);
63
 
      printf('Monitor switch:   %s'#10,[ GetMonitorValue(MoniSwitch)]);
64
 
      writeln('This board supports:');
65
 
      writeln(#9,'following rgb formats:');
66
 
 
67
 
      if (RGBFormats and RGBFF_NONE) <> 0 then writeln(#9,#9,'PLANAR');
68
 
      if (RGBFormats and RGBFF_CLUT) <> 0 then writeln(#9,#9,'CHUNKY');
69
 
      if (RGBFormats and RGBFF_R5G5B5) <> 0 then writeln(#9,#9,'tR5G5B5');
70
 
      if (RGBFormats and RGBFF_R5G5B5PC) <> 0 then writeln(#9,#9,'R5G5B5PC');
71
 
      if (RGBFormats and RGBFF_B5G5R5PC) <> 0 then writeln(#9,#9,'B5G5R5PC');
72
 
      if (RGBFormats and RGBFF_R5G6B5) <> 0 then writeln(#9,#9,'R5G6B5');
73
 
      if (RGBFormats and RGBFF_R5G6B5PC) <> 0 then writeln(#9,#9,'R5G6B5PC');
74
 
      if (RGBFormats and RGBFF_B5G6R5PC) <> 0 then writeln(#9,#9,'B5G6R5PC');
75
 
      if (RGBFormats and RGBFF_R8G8B8) <> 0 then writeln(#9,#9,'R8G8B8');
76
 
      if (RGBFormats and RGBFF_B8G8R8) <> 0 then writeln(#9,#9,'B8G8R8');
77
 
      if (RGBFormats and RGBFF_A8R8G8B8) <> 0 then writeln(#9,#9,'A8R8G8B8');
78
 
      if (RGBFormats and RGBFF_A8B8G8R8) <> 0 then writeln(#9,#9,'A8B8G8R8');
79
 
      if (RGBFormats and RGBFF_R8G8B8A8) <> 0 then writeln(#9,#9,'R8G8B8A8');
80
 
      if (RGBFormats and RGBFF_B8G8R8A8) <> 0 then writeln(#9,#9,'B8G8R8A8');
81
 
      if (RGBFormats and RGBFF_Y4U2V2) <> 0 then writeln(#9,#9,'Y4U2V2');
82
 
      if (RGBFormats and RGBFF_Y4U1V1) <> 0 then writeln(#9,#9,'Y4U1V1');
83
 
 
84
 
      clock := (MemoryClock+50000) div 100000;
85
 
      write(#9);
86
 
      printf('memory clock set to %ld.%1ld MHz,'#10,[(clock div 10),(clock mod 10)]);
87
 
 
88
 
   end;
89
 
end.