home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / osreadsysi < prev    next >
Encoding:
Text File  |  1994-09-27  |  5.8 KB  |  172 lines

  1. #ifndef osreadsysinfo_H
  2. #define osreadsysinfo_H
  3.  
  4. /* C header file for OSReadSysInfo
  5.  * written by DefMod (Sep 16 1994) on Tue Sep 27 17:14:32 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  OS_ReadSysInfo
  27. #define OS_ReadSysInfo                          0x58
  28. #undef  XOS_ReadSysInfo
  29. #define XOS_ReadSysInfo                         0x20058
  30. #undef  OSReadSysInfo_ScreenSize
  31. #define OSReadSysInfo_ScreenSize                0x0
  32. #undef  OSReadSysInfo_Mode
  33. #define OSReadSysInfo_Mode                      0x1
  34. #undef  OSReadSysInfo_MachineId
  35. #define OSReadSysInfo_MachineId                 0x2
  36. #undef  OSReadSysInfo_71XFeatures
  37. #define OSReadSysInfo_71XFeatures               0x3
  38.  
  39. /************************
  40.  * Constant definitions *
  41.  ************************/
  42. #define osreadsysinfo_SPECIAL_FUNCTION          0xFFu
  43. #define osreadsysinfo_SPECIAL_FUNCTION_SHIFT    0
  44. #define osreadsysinfo_SPECIAL_FUNCTION_NONE     0x0u
  45. #define osreadsysinfo_SPECIAL_FUNCTION_IOEB     0x1u
  46. #define osreadsysinfo_IO_CONTROL                0xFF00u
  47. #define osreadsysinfo_IO_CONTROL_SHIFT          8
  48. #define osreadsysinfo_IO_CONTROL_IOC            0x0u
  49. #define osreadsysinfo_IO_CONTROL_IOMD           0x1u
  50. #define osreadsysinfo_MEMORY_CONTROL            0xFF0000u
  51. #define osreadsysinfo_MEMORY_CONTROL_SHIFT      16
  52. #define osreadsysinfo_MEMORY_CONTROL_MEMC1      0x0u
  53. #define osreadsysinfo_MEMORY_CONTROL_IOMD       0x1u
  54. #define osreadsysinfo_VIDEO_CONTROL             0xFF000000u
  55. #define osreadsysinfo_VIDEO_CONTROL_SHIFT       24
  56. #define osreadsysinfo_VIDEO_CONTROL_VIDC_1A     0x0u
  57. #define osreadsysinfo_VIDEO_CONTROL_VIDC20      0x1u
  58. #define osreadsysinfo_IO                        0xFFu
  59. #define osreadsysinfo_IO_SHIFT                  0
  60. #define osreadsysinfo_IO_NONE                   0x0u
  61. #define osreadsysinfo_IO82C710                  0x1u
  62. #define osreadsysinfo_LCD_CONTROL               0xFFu
  63. #define osreadsysinfo_LCD_CONTROL_SHIFT         0
  64. #define osreadsysinfo_LCD_CONTROL_NONE          0x0u
  65. #define osreadsysinfo_LCD_CONTROL_TYPE1         0x1u
  66.  
  67. /*************************
  68.  * Function declarations *
  69.  *************************/
  70.  
  71. #ifdef __cplusplus
  72.    extern "C" {
  73. #endif
  74.  
  75. /*************************************************************
  76.  * NOTE: The following functions provide direct access to    *
  77.  *       the SWI's noted in the function description.        *
  78.  *       Please read the relevant PRM section for more       *
  79.  *       information on their input/output parameters.       *
  80.  *************************************************************/
  81.  
  82. /* ------------------------------------------------------------------------
  83.  * Function:      osreadsysinfo_screen_size()
  84.  *
  85.  * Description:   Reads the configured screen size
  86.  *
  87.  * Output:        screen_size - value of R0 on exit (X version only)
  88.  *
  89.  * Returns:       R0 (non-X version only)
  90.  *
  91.  * Other notes:   Calls SWI 0x58 with R0 = 0x0.
  92.  */
  93.  
  94. extern os_error *xosreadsysinfo_screen_size (int *screen_size);
  95. extern int osreadsysinfo_screen_size (void);
  96.  
  97. /* ------------------------------------------------------------------------
  98.  * Function:      osreadsysinfo_mode()
  99.  *
  100.  * Description:   Reads the configured Mode/WimpMode, MonitorType and Sync
  101.  *
  102.  * Output:        mode - value of R0 on exit (X version only)
  103.  *                monitor_type - value of R1 on exit
  104.  *                sync - value of R2 on exit
  105.  *
  106.  * Returns:       R0 (non-X version only)
  107.  *
  108.  * Other notes:   Calls SWI 0x58 with R0 = 0x1.
  109.  */
  110.  
  111. extern os_error *xosreadsysinfo_mode (int *mode,
  112.       int *monitor_type,
  113.       int *sync);
  114. extern int osreadsysinfo_mode (int *monitor_type,
  115.       int *sync);
  116.  
  117. /* ------------------------------------------------------------------------
  118.  * Function:      osreadsysinfo_machine_id()
  119.  *
  120.  * Description:   Reads the presence of various chips and unique machine id
  121.  *
  122.  * Output:        config0 - value of R0 on exit
  123.  *                config1 - value of R1 on exit
  124.  *                config2 - value of R2 on exit
  125.  *                id_lo - value of R3 on exit
  126.  *                id_hi - value of R4 on exit
  127.  *
  128.  * Other notes:   Calls SWI 0x58 with R0 = 0x2.
  129.  */
  130.  
  131. extern os_error *xosreadsysinfo_machine_id (bits *config0,
  132.       bits *config1,
  133.       bits *config2,
  134.       bits *id_lo,
  135.       bits *id_hi);
  136. extern void osreadsysinfo_machine_id (bits *config0,
  137.       bits *config1,
  138.       bits *config2,
  139.       bits *id_lo,
  140.       bits *id_hi);
  141.  
  142. /* ------------------------------------------------------------------------
  143.  * Function:      osreadsysinfo_71x_features()
  144.  *
  145.  * Description:   Reads features mask for 82C710 chip family
  146.  *
  147.  * Output:        features - value of R0 on exit
  148.  *                features_extended0 - value of R1 on exit
  149.  *                features_extended1 - value of R2 on exit
  150.  *                features_extended2 - value of R3 on exit
  151.  *                features_extended3 - value of R4 on exit
  152.  *
  153.  * Other notes:   Calls SWI 0x58 with R0 = 0x3.
  154.  */
  155.  
  156. extern os_error *xosreadsysinfo_71x_features (bits *features,
  157.       bits *features_extended0,
  158.       bits *features_extended1,
  159.       bits *features_extended2,
  160.       bits *features_extended3);
  161. extern void osreadsysinfo_71x_features (bits *features,
  162.       bits *features_extended0,
  163.       bits *features_extended1,
  164.       bits *features_extended2,
  165.       bits *features_extended3);
  166.  
  167. #ifdef __cplusplus
  168.    }
  169. #endif
  170.  
  171. #endif
  172.