p96checkboards.pas 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. BoardName := @boardtmp;
  34. tmp := p96GetRTGDataTags([P96RD_NumberOfBoards, @NumBoards, TAG_END]);
  35. writeln('Looking through all boards installed for Picasso96');
  36. for i := 0 to NumBoards-1 do begin
  37. p96GetBoardDataTags(i,[P96BD_BoardName, @BoardName,
  38. P96BD_RGBFormats, @RGBFormats,
  39. P96BD_TotalMemory, @MemorySize,
  40. P96BD_FreeMemory, @FreeMemory,
  41. P96BD_LargestFreeMemory, @LargestFreeMemory,
  42. P96BD_MemoryClock, @MemoryClock,
  43. P96BD_MonitorSwitch, @MoniSwitch,
  44. TAG_END]);
  45. writeln('--------------------------------------------------');
  46. printf('Board %ld: %s'#10,[ i, BoardName]);
  47. printf('Total size of memory: %8ld'#10,[ MemorySize]);
  48. printf('Size of free memory: %8ld'#10,[ FreeMemory]);
  49. printf('Largest free chunk: %8ld'#10,[ LargestFreeMemory]);
  50. printf('Monitor switch: %s'#10,[ GetMonitorValue(MoniSwitch)]);
  51. writeln('This board supports:');
  52. writeln(#9,'following rgb formats:');
  53. if (RGBFormats and RGBFF_NONE) <> 0 then writeln(#9,#9,'PLANAR');
  54. if (RGBFormats and RGBFF_CLUT) <> 0 then writeln(#9,#9,'CHUNKY');
  55. if (RGBFormats and RGBFF_R5G5B5) <> 0 then writeln(#9,#9,'tR5G5B5');
  56. if (RGBFormats and RGBFF_R5G5B5PC) <> 0 then writeln(#9,#9,'R5G5B5PC');
  57. if (RGBFormats and RGBFF_B5G5R5PC) <> 0 then writeln(#9,#9,'B5G5R5PC');
  58. if (RGBFormats and RGBFF_R5G6B5) <> 0 then writeln(#9,#9,'R5G6B5');
  59. if (RGBFormats and RGBFF_R5G6B5PC) <> 0 then writeln(#9,#9,'R5G6B5PC');
  60. if (RGBFormats and RGBFF_B5G6R5PC) <> 0 then writeln(#9,#9,'B5G6R5PC');
  61. if (RGBFormats and RGBFF_R8G8B8) <> 0 then writeln(#9,#9,'R8G8B8');
  62. if (RGBFormats and RGBFF_B8G8R8) <> 0 then writeln(#9,#9,'B8G8R8');
  63. if (RGBFormats and RGBFF_A8R8G8B8) <> 0 then writeln(#9,#9,'A8R8G8B8');
  64. if (RGBFormats and RGBFF_A8B8G8R8) <> 0 then writeln(#9,#9,'A8B8G8R8');
  65. if (RGBFormats and RGBFF_R8G8B8A8) <> 0 then writeln(#9,#9,'R8G8B8A8');
  66. if (RGBFormats and RGBFF_B8G8R8A8) <> 0 then writeln(#9,#9,'B8G8R8A8');
  67. if (RGBFormats and RGBFF_Y4U2V2) <> 0 then writeln(#9,#9,'Y4U2V2');
  68. if (RGBFormats and RGBFF_Y4U1V1) <> 0 then writeln(#9,#9,'Y4U1V1');
  69. clock := (MemoryClock+50000) div 100000;
  70. write(#9);
  71. printf('memory clock set to %ld.%1ld MHz,'#10,[(clock div 10),(clock mod 10)]);
  72. end;
  73. end.