p96checkboards.pas 3.5 KB

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