home *** CD-ROM | disk | FTP | other *** search
- #ifndef osreadsysinfo_H
- #define osreadsysinfo_H
-
- /* C header file for OSReadSysInfo
- * written by DefMod (Sep 16 1994) on Tue Sep 27 17:14:32 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef OS_ReadSysInfo
- #define OS_ReadSysInfo 0x58
- #undef XOS_ReadSysInfo
- #define XOS_ReadSysInfo 0x20058
- #undef OSReadSysInfo_ScreenSize
- #define OSReadSysInfo_ScreenSize 0x0
- #undef OSReadSysInfo_Mode
- #define OSReadSysInfo_Mode 0x1
- #undef OSReadSysInfo_MachineId
- #define OSReadSysInfo_MachineId 0x2
- #undef OSReadSysInfo_71XFeatures
- #define OSReadSysInfo_71XFeatures 0x3
-
- /************************
- * Constant definitions *
- ************************/
- #define osreadsysinfo_SPECIAL_FUNCTION 0xFFu
- #define osreadsysinfo_SPECIAL_FUNCTION_SHIFT 0
- #define osreadsysinfo_SPECIAL_FUNCTION_NONE 0x0u
- #define osreadsysinfo_SPECIAL_FUNCTION_IOEB 0x1u
- #define osreadsysinfo_IO_CONTROL 0xFF00u
- #define osreadsysinfo_IO_CONTROL_SHIFT 8
- #define osreadsysinfo_IO_CONTROL_IOC 0x0u
- #define osreadsysinfo_IO_CONTROL_IOMD 0x1u
- #define osreadsysinfo_MEMORY_CONTROL 0xFF0000u
- #define osreadsysinfo_MEMORY_CONTROL_SHIFT 16
- #define osreadsysinfo_MEMORY_CONTROL_MEMC1 0x0u
- #define osreadsysinfo_MEMORY_CONTROL_IOMD 0x1u
- #define osreadsysinfo_VIDEO_CONTROL 0xFF000000u
- #define osreadsysinfo_VIDEO_CONTROL_SHIFT 24
- #define osreadsysinfo_VIDEO_CONTROL_VIDC_1A 0x0u
- #define osreadsysinfo_VIDEO_CONTROL_VIDC20 0x1u
- #define osreadsysinfo_IO 0xFFu
- #define osreadsysinfo_IO_SHIFT 0
- #define osreadsysinfo_IO_NONE 0x0u
- #define osreadsysinfo_IO82C710 0x1u
- #define osreadsysinfo_LCD_CONTROL 0xFFu
- #define osreadsysinfo_LCD_CONTROL_SHIFT 0
- #define osreadsysinfo_LCD_CONTROL_NONE 0x0u
- #define osreadsysinfo_LCD_CONTROL_TYPE1 0x1u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: osreadsysinfo_screen_size()
- *
- * Description: Reads the configured screen size
- *
- * Output: screen_size - value of R0 on exit (X version only)
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x58 with R0 = 0x0.
- */
-
- extern os_error *xosreadsysinfo_screen_size (int *screen_size);
- extern int osreadsysinfo_screen_size (void);
-
- /* ------------------------------------------------------------------------
- * Function: osreadsysinfo_mode()
- *
- * Description: Reads the configured Mode/WimpMode, MonitorType and Sync
- *
- * Output: mode - value of R0 on exit (X version only)
- * monitor_type - value of R1 on exit
- * sync - value of R2 on exit
- *
- * Returns: R0 (non-X version only)
- *
- * Other notes: Calls SWI 0x58 with R0 = 0x1.
- */
-
- extern os_error *xosreadsysinfo_mode (int *mode,
- int *monitor_type,
- int *sync);
- extern int osreadsysinfo_mode (int *monitor_type,
- int *sync);
-
- /* ------------------------------------------------------------------------
- * Function: osreadsysinfo_machine_id()
- *
- * Description: Reads the presence of various chips and unique machine id
- *
- * Output: config0 - value of R0 on exit
- * config1 - value of R1 on exit
- * config2 - value of R2 on exit
- * id_lo - value of R3 on exit
- * id_hi - value of R4 on exit
- *
- * Other notes: Calls SWI 0x58 with R0 = 0x2.
- */
-
- extern os_error *xosreadsysinfo_machine_id (bits *config0,
- bits *config1,
- bits *config2,
- bits *id_lo,
- bits *id_hi);
- extern void osreadsysinfo_machine_id (bits *config0,
- bits *config1,
- bits *config2,
- bits *id_lo,
- bits *id_hi);
-
- /* ------------------------------------------------------------------------
- * Function: osreadsysinfo_71x_features()
- *
- * Description: Reads features mask for 82C710 chip family
- *
- * Output: features - value of R0 on exit
- * features_extended0 - value of R1 on exit
- * features_extended1 - value of R2 on exit
- * features_extended2 - value of R3 on exit
- * features_extended3 - value of R4 on exit
- *
- * Other notes: Calls SWI 0x58 with R0 = 0x3.
- */
-
- extern os_error *xosreadsysinfo_71x_features (bits *features,
- bits *features_extended0,
- bits *features_extended1,
- bits *features_extended2,
- bits *features_extended3);
- extern void osreadsysinfo_71x_features (bits *features,
- bits *features_extended0,
- bits *features_extended1,
- bits *features_extended2,
- bits *features_extended3);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-